删除标准code、备件code字段、工单查询逻辑变更

highway
wws 1 year ago
parent bf0ea1b707
commit 6e236cb58d

@ -149,6 +149,16 @@ public class EquOrder extends BaseEntity {
private String workCode; private String workCode;
private int days; private int days;
private String equipmentName;
public String getEquipmentName() {
return equipmentName;
}
public void setEquipmentName(String equipmentName) {
this.equipmentName = equipmentName;
}
public int getDays() { public int getDays() {
return days; return days;
} }

@ -243,7 +243,7 @@ public class DevicePDAServiceImpl implements IDevicePDAService {
// 获取故障报修流水号 // 获取故障报修流水号
EquRepairOrder equRepairOrder = new EquRepairOrder(); EquRepairOrder equRepairOrder = new EquRepairOrder();
String serialNum = String.format("%03d", equRepairOrderMapper.selectOrderCodeSerialNumber()); String serialNum = String.format("%03d", equRepairOrderMapper.selectOrderCodeSerialNumber());
String equipmentCode = equOrder.getEquipmentCode(); String equipmentCode = equOrder.getEqu().getEquipmentCode();
//报修单号 //报修单号
equRepairOrder.setOrderCode("BX"+DateUtils.dateTimeNow(DateUtils.YYYYMMDD) + equipmentCode + serialNum); equRepairOrder.setOrderCode("BX"+DateUtils.dateTimeNow(DateUtils.YYYYMMDD) + equipmentCode + serialNum);
//在主表中存入报修单号信息 //在主表中存入报修单号信息

@ -111,7 +111,13 @@ public class EquOrderServiceImpl implements IEquOrderService {
@Override @Override
@DS("#header.poolName") @DS("#header.poolName")
public List<EquOrder> selectEquOrderList(EquOrder equOrder) { public List<EquOrder> selectEquOrderList(EquOrder equOrder) {
return equOrderMapper.selectEquOrderList(equOrder); List<EquOrder> orderList = equOrderMapper.selectEquOrderList(equOrder);
for (EquOrder order : orderList) {
EquOrderEqu equ = equOrderEquMapper.selectEquOrderEquListByParentCode(order.getOrderCode());
order.setEquipmentCode(equ.getEquipmentCode());
order.setEquipmentName(equ.getEquipmentName());
}
return orderList;
} }
/** /**
@ -229,7 +235,7 @@ public class EquOrderServiceImpl implements IEquOrderService {
// 获取故障报修流水号 // 获取故障报修流水号
EquRepairOrder equRepairOrder = new EquRepairOrder(); EquRepairOrder equRepairOrder = new EquRepairOrder();
String serialNum = String.format("%03d", equRepairOrderMapper.selectOrderCodeSerialNumber()); String serialNum = String.format("%03d", equRepairOrderMapper.selectOrderCodeSerialNumber());
String equipmentCode = equOrder.getEquipmentCode(); String equipmentCode = equOrder.getEqu().getEquipmentCode();
//报修单号 //报修单号
equRepairOrder.setOrderCode("BX" + DateUtils.dateTimeNow(DateUtils.YYYYMMDD) + equipmentCode + serialNum); equRepairOrder.setOrderCode("BX" + DateUtils.dateTimeNow(DateUtils.YYYYMMDD) + equipmentCode + serialNum);
//在主表中存入报修单号信息 //在主表中存入报修单号信息

@ -448,9 +448,6 @@ public class EquPlanServiceImpl implements IEquPlanService {
// 处理标准 // 处理标准
List<EquPlanStandard> standardList = item.getEquPlanStandardList(); List<EquPlanStandard> standardList = item.getEquPlanStandardList();
// 检查项详情流水号
int detailCodeTemp = 0;
// 判断是否插入检查项 // 判断是否插入检查项
boolean checkInsert = false; boolean checkInsert = false;
@ -463,7 +460,6 @@ public class EquPlanServiceImpl implements IEquPlanService {
standard.setId(IdUtils.fastSimpleUUID()); standard.setId(IdUtils.fastSimpleUUID());
standard.setParentCode(item.getCode()); standard.setParentCode(item.getCode());
standard.setPlanCode(equPlan.getPlanCode()); standard.setPlanCode(equPlan.getPlanCode());
standard.setCode("D" + item.getCode() + String.format("%02d", ++detailCodeTemp));
standard.setCreateBy(SecurityContextHolder.getUserName()); standard.setCreateBy(SecurityContextHolder.getUserName());
standard.setCreateTime(DateUtils.getNowDate()); standard.setCreateTime(DateUtils.getNowDate());
standard.setUpdateBy(SecurityContextHolder.getUserName()); standard.setUpdateBy(SecurityContextHolder.getUserName());

@ -127,7 +127,6 @@ public class EquUpkeepOrderServiceImpl implements IEquUpkeepOrderService {
EquOrderEquSpare spareTemp = new EquOrderEquSpare(); EquOrderEquSpare spareTemp = new EquOrderEquSpare();
BeanUtils.copyProperties(spare,spareTemp); BeanUtils.copyProperties(spare,spareTemp);
spareTemp.setId(IdUtils.fastSimpleUUID()); spareTemp.setId(IdUtils.fastSimpleUUID());
spareTemp.setCode("S"+equOrder.getOrderCode()+String.format("%03d",++spareSerialNum));
spareTemp.setOrderCode(equOrder.getOrderCode()); spareTemp.setOrderCode(equOrder.getOrderCode());
spareTemp.setParentCode(equ.getCode()); spareTemp.setParentCode(equ.getCode());
spareTemp.setFactoryCode(factory); spareTemp.setFactoryCode(factory);
@ -163,12 +162,10 @@ public class EquUpkeepOrderServiceImpl implements IEquUpkeepOrderService {
// 插入检查项信息 // 插入检查项信息
equOrderDetailMapper.insertEquOrderDetail(equOrderDetail); equOrderDetailMapper.insertEquOrderDetail(equOrderDetail);
int standardSerialNum = 0;
for (EquPlanStandard standard : standardList) { for (EquPlanStandard standard : standardList) {
EquOrderStandard orderStandard = new EquOrderStandard(); EquOrderStandard orderStandard = new EquOrderStandard();
BeanUtils.copyProperties(standard,orderStandard); BeanUtils.copyProperties(standard,orderStandard);
orderStandard.setId(IdUtils.fastSimpleUUID()); orderStandard.setId(IdUtils.fastSimpleUUID());
orderStandard.setCode("S"+equOrder.getOrderCode()+String.format("%03d",++standardSerialNum));
orderStandard.setParentCode(equOrderDetail.getCode()); orderStandard.setParentCode(equOrderDetail.getCode());
orderStandard.setOrderCode(equOrder.getOrderCode()); orderStandard.setOrderCode(equOrder.getOrderCode());
orderStandard.setCreateBy(SecurityContextHolder.getUserName()); orderStandard.setCreateBy(SecurityContextHolder.getUserName());

@ -275,9 +275,6 @@ public class EquUpkeepServiceImpl implements IEquUpkeepService {
// 处理标准 // 处理标准
List<EquPlanStandard> standardList = item.getEquPlanStandardList(); List<EquPlanStandard> standardList = item.getEquPlanStandardList();
// 检查项详情流水号
int detailCodeTemp = 0;
// 判断是否插入检查项 // 判断是否插入检查项
boolean checkInsert = false; boolean checkInsert = false;
@ -290,7 +287,6 @@ public class EquUpkeepServiceImpl implements IEquUpkeepService {
standard.setId(IdUtils.fastSimpleUUID()); standard.setId(IdUtils.fastSimpleUUID());
standard.setParentCode(item.getCode()); standard.setParentCode(item.getCode());
standard.setPlanCode(equPlan.getPlanCode()); standard.setPlanCode(equPlan.getPlanCode());
standard.setCode("D" + item.getCode() + String.format("%02d", ++detailCodeTemp));
standard.setCreateBy(SecurityContextHolder.getUserName()); standard.setCreateBy(SecurityContextHolder.getUserName());
standard.setCreateTime(DateUtils.getNowDate()); standard.setCreateTime(DateUtils.getNowDate());
standard.setUpdateBy(SecurityContextHolder.getUserName()); standard.setUpdateBy(SecurityContextHolder.getUserName());
@ -321,7 +317,6 @@ public class EquUpkeepServiceImpl implements IEquUpkeepService {
if (spareList != null) { if (spareList != null) {
for (EquPlanEquSpare spare : spareList) { for (EquPlanEquSpare spare : spareList) {
spare.setId(IdUtils.fastSimpleUUID()); spare.setId(IdUtils.fastSimpleUUID());
spare.setCode("S" + equPlan.getPlanCode() + String.format("%02d", ++spareCodeTemp));
spare.setPlanCode(equPlan.getPlanCode()); spare.setPlanCode(equPlan.getPlanCode());
spare.setParentCode(equipment.getCode()); spare.setParentCode(equipment.getCode());
spare.setFactoryCode(factory); spare.setFactoryCode(factory);

@ -35,6 +35,8 @@ public class InspectionWorkServiceImpl implements IInspectionWorkService {
private EquPlanMapper equPlanMapper; private EquPlanMapper equPlanMapper;
@Autowired @Autowired
private EquOrderEquSpareMapper equOrderEquSpareMapper; private EquOrderEquSpareMapper equOrderEquSpareMapper;
@Autowired
private EquOrderEquMapper equOrderEquMapper;
/** /**
* *
@ -60,7 +62,7 @@ public class InspectionWorkServiceImpl implements IInspectionWorkService {
// 替换循环周期 // 替换循环周期
order.setPlanLoopType(equOrderMapper.changeLoopType(order.getPlanLoopType())); order.setPlanLoopType(equOrderMapper.changeLoopType(order.getPlanLoopType()));
Equipment equipment = equipmentMapper.selectEquipmentByEquipmentCode(order.getEquipmentCode()); Equipment equipment = equipmentMapper.selectEquipmentByEquipmentCode(equOrderEquMapper.selectEquOrderEquListByParentCode(order.getOrderCode()).getEquipmentCode());
// 查询检查项、标准 // 查询检查项、标准
List<EquOrderDetail> detailList = equOrderDetailMapper.selectEquOrderDetailByOrderCode(order.getOrderCode()); List<EquOrderDetail> detailList = equOrderDetailMapper.selectEquOrderDetailByOrderCode(order.getOrderCode());

@ -60,7 +60,6 @@
<if test="planLoopEnd != null "> and plan_loop_end = #{planLoopEnd}</if> <if test="planLoopEnd != null "> and plan_loop_end = #{planLoopEnd}</if>
<if test="orderStart != null "> and order_start = #{orderStart}</if> <if test="orderStart != null "> and order_start = #{orderStart}</if>
<if test="orderEnd != null "> and order_end = #{orderEnd}</if> <if test="orderEnd != null "> and order_end = #{orderEnd}</if>
<if test="equipmentCode != null and equipmentCode != ''"> and equipment_code = #{equipmentCode}</if>
<if test="orderStatus != null and orderStatus != ''"> and order_status = #{orderStatus}</if> <if test="orderStatus != null and orderStatus != ''"> and order_status = #{orderStatus}</if>
<if test="orderCost != null "> and order_cost = #{orderCost}</if> <if test="orderCost != null "> and order_cost = #{orderCost}</if>
<if test="planPerson != null and planPerson != ''"> and plan_person like concat('%', #{planPerson}, '%')</if> <if test="planPerson != null and planPerson != ''"> and plan_person like concat('%', #{planPerson}, '%')</if>
@ -82,6 +81,14 @@
<if test="repairCode != null "> and repair_code = #{repairCode}</if> <if test="repairCode != null "> and repair_code = #{repairCode}</if>
<if test="workCode != null "> and work_code = #{workCode}</if> <if test="workCode != null "> and work_code = #{workCode}</if>
and del_flag = '0' and del_flag = '0'
<if test="(equipmentCode != null and equipmentCode != '') or (equipmentName != null and equipmentName != '')">
and order_code in (
select order_code from equ_order_equ
where equ_order.order_code = equ_order_equ.order_code
<if test="equipmentCode != null and equipmentCode != ''">and equ_order_equ.equipment_code like concat('%', #{equipmentCode}, '%')</if>
<if test="equipmentName != null and equipmentName != ''">and equ_order_equ.equipment_name like concat('%', #{equipmentName}, '%')</if>
)
</if>
</where> </where>
</select> </select>

Loading…
Cancel
Save