更新代码
This commit is contained in:
parent
8b253be951
commit
eeafcc14cb
@ -42,4 +42,6 @@ public class CarMainRespVO extends CarMain {
|
|||||||
String bxCont;
|
String bxCont;
|
||||||
/**车辆品牌型号数组*/
|
/**车辆品牌型号数组*/
|
||||||
List<String> brandAndModel;
|
List<String> brandAndModel;
|
||||||
|
/** 车辆类型 */
|
||||||
|
private String brandType;
|
||||||
}
|
}
|
@ -117,6 +117,7 @@
|
|||||||
bcm.phone_number AS phoneNumber,
|
bcm.phone_number AS phoneNumber,
|
||||||
bcb.brand_name AS brandStr,
|
bcb.brand_name AS brandStr,
|
||||||
bcmm.model_name AS modelStr,
|
bcmm.model_name AS modelStr,
|
||||||
|
bcb.brand_type AS brand_type,
|
||||||
DATEDIFF(tbcm.next_inspection_date, CURDATE()) AS njCont,
|
DATEDIFF(tbcm.next_inspection_date, CURDATE()) AS njCont,
|
||||||
DATEDIFF(tbcm.next_maintenance_date, CURDATE()) AS byCont,
|
DATEDIFF(tbcm.next_maintenance_date, CURDATE()) AS byCont,
|
||||||
DATEDIFF(tbcm.insurance_expiry_date, CURDATE()) AS bxCont
|
DATEDIFF(tbcm.insurance_expiry_date, CURDATE()) AS bxCont
|
||||||
|
@ -9,4 +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, "工单内容");
|
||||||
}
|
}
|
||||||
|
@ -1,7 +1,12 @@
|
|||||||
package cn.iocoder.yudao.module.tickets.controller.admin;
|
package cn.iocoder.yudao.module.tickets.controller.admin;
|
||||||
|
|
||||||
|
|
||||||
|
import cn.iocoder.yudao.framework.common.pojo.CommonResult;
|
||||||
import cn.iocoder.yudao.module.tickets.service.DlRepairTicketsService;
|
import cn.iocoder.yudao.module.tickets.service.DlRepairTicketsService;
|
||||||
|
import cn.iocoder.yudao.module.tickets.vo.DlRepairTicketsRespVO;
|
||||||
|
import io.swagger.v3.oas.annotations.Operation;
|
||||||
|
import org.springframework.web.bind.annotation.PostMapping;
|
||||||
|
import org.springframework.web.bind.annotation.RequestBody;
|
||||||
import org.springframework.web.bind.annotation.RequestMapping;
|
import org.springframework.web.bind.annotation.RequestMapping;
|
||||||
import org.springframework.web.bind.annotation.RestController;
|
import org.springframework.web.bind.annotation.RestController;
|
||||||
|
|
||||||
@ -13,12 +18,26 @@ import javax.annotation.Resource;
|
|||||||
* @date 18:21 2024/9/13
|
* @date 18:21 2024/9/13
|
||||||
**/
|
**/
|
||||||
@RestController
|
@RestController
|
||||||
@RequestMapping("dlRepairTickets")
|
@RequestMapping("/repair/tickets")
|
||||||
public class DlRepairTicketsController {
|
public class DlRepairTicketsController {
|
||||||
/**
|
/**
|
||||||
* 服务对象
|
* 服务对象
|
||||||
*/
|
*/
|
||||||
@Resource
|
@Resource
|
||||||
private DlRepairTicketsService dlRepairTicketsService;
|
private DlRepairTicketsService dlRepairTicketsService;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 维修工单表 新增
|
||||||
|
*
|
||||||
|
* @author 小李
|
||||||
|
* @date 11:33 2024/9/20
|
||||||
|
* @param ticketsRespVO 新增对象
|
||||||
|
**/
|
||||||
|
@PostMapping("/create")
|
||||||
|
@Operation(summary = "维修工单表 新增")
|
||||||
|
public CommonResult<?> createTicket(@RequestBody DlRepairTicketsRespVO ticketsRespVO){
|
||||||
|
dlRepairTicketsService.createTickets(ticketsRespVO);
|
||||||
|
return CommonResult.ok();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -14,7 +14,7 @@ import javax.annotation.Resource;
|
|||||||
* @date 18:21 2024/9/13
|
* @date 18:21 2024/9/13
|
||||||
**/
|
**/
|
||||||
@RestController
|
@RestController
|
||||||
@RequestMapping("dlRepairTitem")
|
@RequestMapping("/repair/titem")
|
||||||
public class DlRepairTitemController {
|
public class DlRepairTitemController {
|
||||||
/**
|
/**
|
||||||
* 服务对象
|
* 服务对象
|
||||||
|
@ -7,6 +7,8 @@ import com.baomidou.mybatisplus.annotation.TableName;
|
|||||||
import lombok.Data;
|
import lombok.Data;
|
||||||
import lombok.EqualsAndHashCode;
|
import lombok.EqualsAndHashCode;
|
||||||
|
|
||||||
|
import java.math.BigDecimal;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 维修工单表
|
* 维修工单表
|
||||||
* @author 小李
|
* @author 小李
|
||||||
@ -131,4 +133,19 @@ public class DlRepairTickets extends TenantBaseDO {
|
|||||||
* 部门ID
|
* 部门ID
|
||||||
*/
|
*/
|
||||||
private Long deptId;
|
private Long deptId;
|
||||||
}
|
|
||||||
|
/** 工单子项的总数(每一个子项的数量) */
|
||||||
|
private Integer count;
|
||||||
|
|
||||||
|
/** 工单项目总价 */
|
||||||
|
private BigDecimal projectPrice;
|
||||||
|
|
||||||
|
/** 工单配件总价 */
|
||||||
|
private BigDecimal partPrice;
|
||||||
|
|
||||||
|
/** 工单其他总价 */
|
||||||
|
private BigDecimal otherPrice;
|
||||||
|
|
||||||
|
/** 工单总价 */
|
||||||
|
private BigDecimal totalPrice;
|
||||||
|
}
|
||||||
|
@ -1,6 +1,7 @@
|
|||||||
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.DlRepairTicketsRespVO;
|
||||||
import com.baomidou.mybatisplus.extension.service.IService;
|
import com.baomidou.mybatisplus.extension.service.IService;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -11,4 +12,12 @@ import com.baomidou.mybatisplus.extension.service.IService;
|
|||||||
**/
|
**/
|
||||||
public interface DlRepairTicketsService extends IService<DlRepairTickets> {
|
public interface DlRepairTicketsService extends IService<DlRepairTickets> {
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 维修工单表 新增
|
||||||
|
*
|
||||||
|
* @author 小李
|
||||||
|
* @date 11:33 2024/9/20
|
||||||
|
* @param ticketsRespVO 新增对象
|
||||||
|
**/
|
||||||
|
void createTickets(DlRepairTicketsRespVO ticketsRespVO);
|
||||||
}
|
}
|
||||||
|
@ -1,11 +1,22 @@
|
|||||||
package cn.iocoder.yudao.module.tickets.service.impl;
|
package cn.iocoder.yudao.module.tickets.service.impl;
|
||||||
|
|
||||||
|
import cn.hutool.core.collection.CollectionUtil;
|
||||||
|
import cn.iocoder.yudao.common.RepairErrorCodeConstants;
|
||||||
import cn.iocoder.yudao.module.tickets.entity.DlRepairTickets;
|
import cn.iocoder.yudao.module.tickets.entity.DlRepairTickets;
|
||||||
|
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.vo.DlRepairTicketsRespVO;
|
||||||
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;
|
||||||
|
|
||||||
|
import javax.annotation.Resource;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
import static cn.iocoder.yudao.framework.common.exception.util.ServiceExceptionUtil.exception;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 针对表【dl_repair_tickets(维修工单表)】的数据库操作Service实现
|
* 针对表【dl_repair_tickets(维修工单表)】的数据库操作Service实现
|
||||||
*
|
*
|
||||||
@ -16,6 +27,31 @@ import org.springframework.stereotype.Service;
|
|||||||
public class DlRepairTicketsServiceImpl extends ServiceImpl<DlRepairTicketsMapper, DlRepairTickets>
|
public class DlRepairTicketsServiceImpl extends ServiceImpl<DlRepairTicketsMapper, DlRepairTickets>
|
||||||
implements DlRepairTicketsService {
|
implements DlRepairTicketsService {
|
||||||
|
|
||||||
|
@Resource
|
||||||
|
private DlRepairTitemService titemService;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 维修工单表 新增
|
||||||
|
*
|
||||||
|
* @author 小李
|
||||||
|
* @date 11:33 2024/9/20
|
||||||
|
* @param ticketsRespVO 新增对象
|
||||||
|
**/
|
||||||
|
@Override
|
||||||
|
public void createTickets(DlRepairTicketsRespVO ticketsRespVO){
|
||||||
|
// 新增主表
|
||||||
|
baseMapper.insert(ticketsRespVO);
|
||||||
|
|
||||||
|
// 新增子表
|
||||||
|
if (CollectionUtil.isEmpty(ticketsRespVO.getItemList())){
|
||||||
|
throw exception(RepairErrorCodeConstants.ITEM_IS_EMPTY);
|
||||||
|
}
|
||||||
|
List<DlRepairTitem> itemList = ticketsRespVO.getItemList();
|
||||||
|
itemList.forEach(item -> {
|
||||||
|
item.setTichetId(ticketsRespVO.getId());
|
||||||
|
});
|
||||||
|
titemService.saveBatch(itemList);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@ -1,8 +1,11 @@
|
|||||||
package cn.iocoder.yudao.module.tickets.vo;
|
package cn.iocoder.yudao.module.tickets.vo;
|
||||||
|
|
||||||
import cn.iocoder.yudao.module.tickets.entity.DlRepairTickets;
|
import cn.iocoder.yudao.module.tickets.entity.DlRepairTickets;
|
||||||
|
import cn.iocoder.yudao.module.tickets.entity.DlRepairTitem;
|
||||||
import lombok.Data;
|
import lombok.Data;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 维修工单表 响应VO
|
* 维修工单表 响应VO
|
||||||
* @author 小李
|
* @author 小李
|
||||||
@ -10,4 +13,7 @@ import lombok.Data;
|
|||||||
**/
|
**/
|
||||||
@Data
|
@Data
|
||||||
public class DlRepairTicketsRespVO extends DlRepairTickets {
|
public class DlRepairTicketsRespVO extends DlRepairTickets {
|
||||||
|
|
||||||
|
/** 子表数组 */
|
||||||
|
private List<DlRepairTitem> itemList;
|
||||||
}
|
}
|
||||||
|
@ -28,6 +28,11 @@
|
|||||||
<result property="ticketType" column="ticket_type" jdbcType="VARCHAR"/>
|
<result property="ticketType" column="ticket_type" jdbcType="VARCHAR"/>
|
||||||
<result property="corpId" column="corp_id" jdbcType="VARCHAR"/>
|
<result property="corpId" column="corp_id" jdbcType="VARCHAR"/>
|
||||||
<result property="deptId" column="dept_id" jdbcType="BIGINT"/>
|
<result property="deptId" column="dept_id" jdbcType="BIGINT"/>
|
||||||
|
<result property="count" column="count" />
|
||||||
|
<result property="projectPrice" column="project_price" />
|
||||||
|
<result property="partPrice" column="part_price" />
|
||||||
|
<result property="otherPrice" column="other_price" />
|
||||||
|
<result property="totalPrice" column="total_price" />
|
||||||
</resultMap>
|
</resultMap>
|
||||||
|
|
||||||
<sql id="Base_SQL">
|
<sql id="Base_SQL">
|
||||||
@ -53,7 +58,12 @@
|
|||||||
remark,
|
remark,
|
||||||
ticket_type,
|
ticket_type,
|
||||||
corp_id,
|
corp_id,
|
||||||
dept_id
|
dept_id,
|
||||||
|
count,
|
||||||
|
project_price,
|
||||||
|
part_price,
|
||||||
|
other_price,
|
||||||
|
total_price
|
||||||
from dl_repair_tickets drt
|
from dl_repair_tickets drt
|
||||||
where drt.deleted = '0'
|
where drt.deleted = '0'
|
||||||
</sql>
|
</sql>
|
||||||
|
@ -68,7 +68,7 @@ flowable:
|
|||||||
mybatis-plus:
|
mybatis-plus:
|
||||||
configuration:
|
configuration:
|
||||||
map-underscore-to-camel-case: true # 虽然默认为 true ,但是还是显示去指定下。
|
map-underscore-to-camel-case: true # 虽然默认为 true ,但是还是显示去指定下。
|
||||||
log-impl: org.apache.ibatis.logging.stdout.StdOutImpl
|
# log-impl: org.apache.ibatis.logging.stdout.StdOutImpl
|
||||||
global-config:
|
global-config:
|
||||||
db-config:
|
db-config:
|
||||||
id-type: NONE # “智能”模式,基于 IdTypeEnvironmentPostProcessor + 数据源的类型,自动适配成 AUTO、INPUT 模式。
|
id-type: NONE # “智能”模式,基于 IdTypeEnvironmentPostProcessor + 数据源的类型,自动适配成 AUTO、INPUT 模式。
|
||||||
|
Loading…
Reference in New Issue
Block a user