更新代码
This commit is contained in:
parent
684e8e0b5a
commit
a80e2acfdb
@ -9,5 +9,5 @@ import cn.iocoder.yudao.framework.common.exception.ErrorCode;
|
|||||||
**/
|
**/
|
||||||
public interface RepairErrorCodeConstants {
|
public interface RepairErrorCodeConstants {
|
||||||
ErrorCode GOODS_IS_EMPTY = new ErrorCode(500, "商品为空");
|
ErrorCode GOODS_IS_EMPTY = new ErrorCode(500, "商品为空");
|
||||||
ErrorCode ITEM_IS_EMPTY = new ErrorCode(500, "工单内容");
|
ErrorCode ITEM_IS_EMPTY = new ErrorCode(500, "工单内容为空");
|
||||||
}
|
}
|
||||||
|
@ -2,16 +2,18 @@ package cn.iocoder.yudao.module.tickets.controller.admin;
|
|||||||
|
|
||||||
|
|
||||||
import cn.iocoder.yudao.framework.common.pojo.CommonResult;
|
import cn.iocoder.yudao.framework.common.pojo.CommonResult;
|
||||||
|
import cn.iocoder.yudao.module.tickets.entity.DlRepairTickets;
|
||||||
import cn.iocoder.yudao.module.tickets.service.DlRepairTicketsService;
|
import cn.iocoder.yudao.module.tickets.service.DlRepairTicketsService;
|
||||||
|
import cn.iocoder.yudao.module.tickets.vo.DlRepairTicketsReqVO;
|
||||||
import cn.iocoder.yudao.module.tickets.vo.DlRepairTicketsRespVO;
|
import cn.iocoder.yudao.module.tickets.vo.DlRepairTicketsRespVO;
|
||||||
|
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||||
import io.swagger.v3.oas.annotations.Operation;
|
import io.swagger.v3.oas.annotations.Operation;
|
||||||
import org.springframework.web.bind.annotation.PostMapping;
|
import org.springframework.web.bind.annotation.*;
|
||||||
import org.springframework.web.bind.annotation.RequestBody;
|
|
||||||
import org.springframework.web.bind.annotation.RequestMapping;
|
|
||||||
import org.springframework.web.bind.annotation.RestController;
|
|
||||||
|
|
||||||
import javax.annotation.Resource;
|
import javax.annotation.Resource;
|
||||||
|
|
||||||
|
import static cn.iocoder.yudao.framework.common.pojo.CommonResult.success;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 维修工单表(DlRepairTickets)表控制层
|
* 维修工单表(DlRepairTickets)表控制层
|
||||||
* @author 小李
|
* @author 小李
|
||||||
@ -39,5 +41,23 @@ public class DlRepairTicketsController {
|
|||||||
dlRepairTicketsService.createTickets(ticketsRespVO);
|
dlRepairTicketsService.createTickets(ticketsRespVO);
|
||||||
return CommonResult.ok();
|
return CommonResult.ok();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 维修工单表 分页
|
||||||
|
*
|
||||||
|
* @author 小李
|
||||||
|
* @date 20:51 2024/9/20
|
||||||
|
* @param repairTicketsReqVO 查询对象
|
||||||
|
* @param pageNo 页码
|
||||||
|
* @param pageSize 条数
|
||||||
|
**/
|
||||||
|
@GetMapping("/page")
|
||||||
|
@Operation(summary = "维修工单表 分页")
|
||||||
|
public CommonResult<?> getTicketsPage(DlRepairTicketsReqVO repairTicketsReqVO,
|
||||||
|
@RequestParam(value = "pageNo", defaultValue = "1")Integer pageNo,
|
||||||
|
@RequestParam(value = "pageSize", defaultValue = "10")Integer pageSize){
|
||||||
|
Page<DlRepairTickets> page = new Page<>(pageNo, pageSize);
|
||||||
|
return success(dlRepairTicketsService.getTicketsPage(repairTicketsReqVO, page));
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -100,9 +100,14 @@ public class DlRepairTickets extends TenantBaseDO {
|
|||||||
private String repairAdvice;
|
private String repairAdvice;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 质保说明
|
* 质保说明(公里)
|
||||||
*/
|
*/
|
||||||
private String qualityExplain;
|
private String qualityMileage;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 质保说明(天数)
|
||||||
|
*/
|
||||||
|
private String qualityDay;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 是否终检(字典yes_no);已存在于系统中(是:0,否:1)
|
* 是否终检(字典yes_no);已存在于系统中(是:0,否:1)
|
||||||
@ -148,4 +153,7 @@ public class DlRepairTickets extends TenantBaseDO {
|
|||||||
|
|
||||||
/** 工单总价 */
|
/** 工单总价 */
|
||||||
private BigDecimal totalPrice;
|
private BigDecimal totalPrice;
|
||||||
|
|
||||||
|
/** 是否已结算 */
|
||||||
|
private String ticketsStatus;
|
||||||
}
|
}
|
||||||
|
@ -1,8 +1,12 @@
|
|||||||
package cn.iocoder.yudao.module.tickets.mapper;
|
package cn.iocoder.yudao.module.tickets.mapper;
|
||||||
|
|
||||||
import cn.iocoder.yudao.module.tickets.entity.DlRepairTickets;
|
import cn.iocoder.yudao.module.tickets.entity.DlRepairTickets;
|
||||||
|
import cn.iocoder.yudao.module.tickets.vo.DlRepairTicketsReqVO;
|
||||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||||
|
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||||
|
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||||
import org.apache.ibatis.annotations.Mapper;
|
import org.apache.ibatis.annotations.Mapper;
|
||||||
|
import org.apache.ibatis.annotations.Param;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 针对表【dl_repair_tickets(维修工单表)】的数据库操作Mapper
|
* 针对表【dl_repair_tickets(维修工单表)】的数据库操作Mapper
|
||||||
@ -13,6 +17,14 @@ import org.apache.ibatis.annotations.Mapper;
|
|||||||
@Mapper
|
@Mapper
|
||||||
public interface DlRepairTicketsMapper extends BaseMapper<DlRepairTickets> {
|
public interface DlRepairTicketsMapper extends BaseMapper<DlRepairTickets> {
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 维修工单表 分页
|
||||||
|
*
|
||||||
|
* @author 小李
|
||||||
|
* @date 20:51 2024/9/20
|
||||||
|
* @param repairTicketsReqVO 查询对象
|
||||||
|
**/
|
||||||
|
IPage<DlRepairTickets> getTicketsPage(@Param("map") DlRepairTicketsReqVO repairTicketsReqVO, Page<DlRepairTickets> page);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@ -1,7 +1,10 @@
|
|||||||
package cn.iocoder.yudao.module.tickets.service;
|
package cn.iocoder.yudao.module.tickets.service;
|
||||||
|
|
||||||
import cn.iocoder.yudao.module.tickets.entity.DlRepairTickets;
|
import cn.iocoder.yudao.module.tickets.entity.DlRepairTickets;
|
||||||
|
import cn.iocoder.yudao.module.tickets.vo.DlRepairTicketsReqVO;
|
||||||
import cn.iocoder.yudao.module.tickets.vo.DlRepairTicketsRespVO;
|
import cn.iocoder.yudao.module.tickets.vo.DlRepairTicketsRespVO;
|
||||||
|
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||||
|
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||||
import com.baomidou.mybatisplus.extension.service.IService;
|
import com.baomidou.mybatisplus.extension.service.IService;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -20,4 +23,13 @@ public interface DlRepairTicketsService extends IService<DlRepairTickets> {
|
|||||||
* @param ticketsRespVO 新增对象
|
* @param ticketsRespVO 新增对象
|
||||||
**/
|
**/
|
||||||
void createTickets(DlRepairTicketsRespVO ticketsRespVO);
|
void createTickets(DlRepairTicketsRespVO ticketsRespVO);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 维修工单表 分页
|
||||||
|
*
|
||||||
|
* @author 小李
|
||||||
|
* @date 20:51 2024/9/20
|
||||||
|
* @param repairTicketsReqVO 查询对象
|
||||||
|
**/
|
||||||
|
IPage<DlRepairTickets> getTicketsPage(DlRepairTicketsReqVO repairTicketsReqVO, Page<DlRepairTickets> page);
|
||||||
}
|
}
|
||||||
|
@ -7,7 +7,11 @@ import cn.iocoder.yudao.module.tickets.entity.DlRepairTitem;
|
|||||||
import cn.iocoder.yudao.module.tickets.mapper.DlRepairTicketsMapper;
|
import cn.iocoder.yudao.module.tickets.mapper.DlRepairTicketsMapper;
|
||||||
import cn.iocoder.yudao.module.tickets.service.DlRepairTicketsService;
|
import cn.iocoder.yudao.module.tickets.service.DlRepairTicketsService;
|
||||||
import cn.iocoder.yudao.module.tickets.service.DlRepairTitemService;
|
import cn.iocoder.yudao.module.tickets.service.DlRepairTitemService;
|
||||||
|
import cn.iocoder.yudao.module.tickets.vo.DlRepairTicketsReqVO;
|
||||||
import cn.iocoder.yudao.module.tickets.vo.DlRepairTicketsRespVO;
|
import cn.iocoder.yudao.module.tickets.vo.DlRepairTicketsRespVO;
|
||||||
|
import com.baomidou.dynamic.datasource.annotation.DSTransactional;
|
||||||
|
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||||
|
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||||
import org.springframework.stereotype.Service;
|
import org.springframework.stereotype.Service;
|
||||||
|
|
||||||
@ -38,6 +42,7 @@ public class DlRepairTicketsServiceImpl extends ServiceImpl<DlRepairTicketsMappe
|
|||||||
* @param ticketsRespVO 新增对象
|
* @param ticketsRespVO 新增对象
|
||||||
**/
|
**/
|
||||||
@Override
|
@Override
|
||||||
|
@DSTransactional
|
||||||
public void createTickets(DlRepairTicketsRespVO ticketsRespVO){
|
public void createTickets(DlRepairTicketsRespVO ticketsRespVO){
|
||||||
// 新增主表
|
// 新增主表
|
||||||
baseMapper.insert(ticketsRespVO);
|
baseMapper.insert(ticketsRespVO);
|
||||||
@ -52,6 +57,18 @@ public class DlRepairTicketsServiceImpl extends ServiceImpl<DlRepairTicketsMappe
|
|||||||
});
|
});
|
||||||
titemService.saveBatch(itemList);
|
titemService.saveBatch(itemList);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 维修工单表 分页
|
||||||
|
*
|
||||||
|
* @author 小李
|
||||||
|
* @date 20:51 2024/9/20
|
||||||
|
* @param repairTicketsReqVO 查询对象
|
||||||
|
**/
|
||||||
|
@Override
|
||||||
|
public IPage<DlRepairTickets> getTicketsPage(DlRepairTicketsReqVO repairTicketsReqVO, Page<DlRepairTickets> page){
|
||||||
|
return baseMapper.getTicketsPage(repairTicketsReqVO, page);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@ -21,7 +21,8 @@
|
|||||||
<result property="adviserName" column="adviser_name" jdbcType="VARCHAR"/>
|
<result property="adviserName" column="adviser_name" jdbcType="VARCHAR"/>
|
||||||
<result property="payType" column="pay_type" jdbcType="VARCHAR"/>
|
<result property="payType" column="pay_type" jdbcType="VARCHAR"/>
|
||||||
<result property="repairAdvice" column="repair_advice" jdbcType="VARCHAR"/>
|
<result property="repairAdvice" column="repair_advice" jdbcType="VARCHAR"/>
|
||||||
<result property="qualityExplain" column="quality_explain" jdbcType="VARCHAR"/>
|
<result property="qualityMileage" column="quality_mileage" jdbcType="VARCHAR"/>
|
||||||
|
<result property="qualityDay" column="quality_day" jdbcType="VARCHAR"/>
|
||||||
<result property="endCheck" column="end_check" jdbcType="VARCHAR"/>
|
<result property="endCheck" column="end_check" jdbcType="VARCHAR"/>
|
||||||
<result property="partDisposal" column="part_disposal" jdbcType="VARCHAR"/>
|
<result property="partDisposal" column="part_disposal" jdbcType="VARCHAR"/>
|
||||||
<result property="remark" column="remark" jdbcType="VARCHAR"/>
|
<result property="remark" column="remark" jdbcType="VARCHAR"/>
|
||||||
@ -33,6 +34,7 @@
|
|||||||
<result property="partPrice" column="part_price" />
|
<result property="partPrice" column="part_price" />
|
||||||
<result property="otherPrice" column="other_price" />
|
<result property="otherPrice" column="other_price" />
|
||||||
<result property="totalPrice" column="total_price" />
|
<result property="totalPrice" column="total_price" />
|
||||||
|
<result property="ticketStatus" column="ticket_status" />
|
||||||
</resultMap>
|
</resultMap>
|
||||||
|
|
||||||
<sql id="Base_SQL">
|
<sql id="Base_SQL">
|
||||||
@ -52,7 +54,8 @@
|
|||||||
adviser_name,
|
adviser_name,
|
||||||
pay_type,
|
pay_type,
|
||||||
repair_advice,
|
repair_advice,
|
||||||
quality_explain,
|
quality_mileage,
|
||||||
|
quality_day,
|
||||||
end_check,
|
end_check,
|
||||||
part_disposal,
|
part_disposal,
|
||||||
remark,
|
remark,
|
||||||
@ -63,8 +66,16 @@
|
|||||||
project_price,
|
project_price,
|
||||||
part_price,
|
part_price,
|
||||||
other_price,
|
other_price,
|
||||||
total_price
|
total_price,
|
||||||
|
tickets_status
|
||||||
from dl_repair_tickets drt
|
from dl_repair_tickets drt
|
||||||
where drt.deleted = '0'
|
where drt.deleted = '0'
|
||||||
</sql>
|
</sql>
|
||||||
|
|
||||||
|
<select id="getTicketsPage" resultMap="BaseResultMap">
|
||||||
|
<include refid="Base_SQL" />
|
||||||
|
<if test="map.ticketsStatus != null and map.ticketsStatus != ''">
|
||||||
|
and drt.tickets_status = #{map.ticketsStatus}
|
||||||
|
</if>
|
||||||
|
</select>
|
||||||
</mapper>
|
</mapper>
|
||||||
|
Loading…
Reference in New Issue
Block a user