配件领退修改最后完善

This commit is contained in:
xiaofajia 2024-10-22 15:57:53 +08:00
parent a7dcde4c65
commit 44feda7273
3 changed files with 32 additions and 2 deletions

View File

@ -6,6 +6,7 @@ import cn.hutool.core.util.ObjectUtil;
import cn.iocoder.yudao.common.RepairErrorCodeConstants; import cn.iocoder.yudao.common.RepairErrorCodeConstants;
import cn.iocoder.yudao.common.SoStatusEnum; import cn.iocoder.yudao.common.SoStatusEnum;
import cn.iocoder.yudao.framework.security.core.util.SecurityFrameworkUtils; import cn.iocoder.yudao.framework.security.core.util.SecurityFrameworkUtils;
import cn.iocoder.yudao.module.base.service.RepairWorkerService;
import cn.iocoder.yudao.module.company.entity.Company; import cn.iocoder.yudao.module.company.entity.Company;
import cn.iocoder.yudao.module.company.service.CompanyService; import cn.iocoder.yudao.module.company.service.CompanyService;
import cn.iocoder.yudao.module.project.entity.RepairWares; import cn.iocoder.yudao.module.project.entity.RepairWares;
@ -85,6 +86,10 @@ public class DlRepairSoServiceImpl extends ServiceImpl<DlRepairSoMapper, DlRepai
@Lazy @Lazy
private DlRepairTitemService titemService; private DlRepairTitemService titemService;
@Resource
@Lazy
private RepairWorkerService repairWorkerService;
/** /**
* 采购单/领料单 新增 * 采购单/领料单 新增
* *
@ -165,6 +170,16 @@ public class DlRepairSoServiceImpl extends ServiceImpl<DlRepairSoMapper, DlRepai
@Override @Override
public void voidRepairSo(DlRepairSoReqVO repairSoReqVO) { public void voidRepairSo(DlRepairSoReqVO repairSoReqVO) {
baseMapper.updateById(repairSoReqVO); baseMapper.updateById(repairSoReqVO);
// 查主表
DlRepairSo so = baseMapper.selectById(repairSoReqVO.getId());
// 查当前登录操作人的userId
Long loginUserId = SecurityFrameworkUtils.getLoginUserId();
// 如果主表记录的领退料人与操作人一致即是员工点击的作废即需要通知仓库
boolean flag = so.getUserId().equals(loginUserId);
if (flag){
repairWorkerService.sentMessage(Long.valueOf(so.getCreator()), (so.getSoType().equals("02") ? "领料单:" : "退料单:") + so.getSoNo() + "已被" + so.getUserName() + "作废");
}
} }
/** /**
@ -249,6 +264,11 @@ public class DlRepairSoServiceImpl extends ServiceImpl<DlRepairSoMapper, DlRepai
List<DlTwItem> flag = list.stream().filter(item -> !item.getWaresStatus().equals("01")).collect(Collectors.toList()); List<DlTwItem> flag = list.stream().filter(item -> !item.getWaresStatus().equals("01")).collect(Collectors.toList());
dlTicketWares.setStatus(CollectionUtil.isEmpty(flag) ? "03" : "04"); dlTicketWares.setStatus(CollectionUtil.isEmpty(flag) ? "03" : "04");
ticketWaresService.updateById(dlTicketWares); ticketWaresService.updateById(dlTicketWares);
// 查主表记录
DlRepairSo newSo = baseMapper.selectById(id);
// 通知仓库
repairWorkerService.sentMessage(Long.valueOf(newSo.getCreator()), newSo.getUserName() + "已确认领料单:" + newSo.getSoNo());
} }
/** /**
@ -351,6 +371,11 @@ public class DlRepairSoServiceImpl extends ServiceImpl<DlRepairSoMapper, DlRepai
BigDecimal partPrice = newTickets.getPartPrice() == null ? BigDecimal.ZERO : newTickets.getPartPrice(); BigDecimal partPrice = newTickets.getPartPrice() == null ? BigDecimal.ZERO : newTickets.getPartPrice();
newTickets.setTotalPrice(projectPrice.add(partPrice).add(otherPrice)); newTickets.setTotalPrice(projectPrice.add(partPrice).add(otherPrice));
ticketsService.updateById(newTickets); ticketsService.updateById(newTickets);
// 查主表
DlRepairSo newSo = baseMapper.selectById(id);
// 通知仓库
repairWorkerService.sentMessage(Long.valueOf(newSo.getCreator()), newSo.getUserName() + "已确认退料单:" + newSo.getSoNo());
} }
} }

View File

@ -57,4 +57,7 @@ public class DlTicketWares extends TenantBaseDO {
/** 维修顾问namesystem_user的nickname */ /** 维修顾问namesystem_user的nickname */
private String adviserName; private String adviserName;
/** 客户车辆的车牌号dl_repair_tickets中的carNo */
private String licenseNumber;
} }

View File

@ -15,6 +15,7 @@
<result property="repairName" column="repair_name" /> <result property="repairName" column="repair_name" />
<result property="adviserId" column="adviser_id" /> <result property="adviserId" column="adviser_id" />
<result property="adviserName" column="adviser_name" /> <result property="adviserName" column="adviser_name" />
<result property="licenseNumber" column="license_number" />
</resultMap> </resultMap>
<sql id="Base_SQL"> <sql id="Base_SQL">
@ -24,7 +25,8 @@
dtw.repair_id as repair_id, dtw.repair_id as repair_id,
dtw.repair_name as repair_name, dtw.repair_name as repair_name,
dtw.adviser_id as adviser_id, dtw.adviser_id as adviser_id,
dtw.adviser_name as adviser_name dtw.adviser_name as adviser_name,
dtw.license_number
from dl_ticket_wares dtw from dl_ticket_wares dtw
left join dl_repair_tickets drt left join dl_repair_tickets drt
on dtw.ticket_id = drt.id on dtw.ticket_id = drt.id
@ -39,7 +41,7 @@
or or
drt.ticket_no like concat('%', #{map.query}, '%') drt.ticket_no like concat('%', #{map.query}, '%')
or or
drt.car_no like concat('%', #{map.query}, '%') dtw.license_number like concat('%', #{map.query}, '%')
) )
</if> </if>
<if test="map.type != null and map.type != ''"> <if test="map.type != null and map.type != ''">