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

highway
wws 1 year ago
parent bf0ea1b707
commit 6e236cb58d

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

@ -243,7 +243,7 @@ public class DevicePDAServiceImpl implements IDevicePDAService {
// 获取故障报修流水号
EquRepairOrder equRepairOrder = new EquRepairOrder();
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);
//在主表中存入报修单号信息

@ -82,7 +82,7 @@ public class EquOrderServiceImpl implements IEquOrderService {
equ.setDetailList(detailList);
List<EquOrderEquSpare> spareList = equOrderEquSpareMapper.selectEquOrderEquSpareByParentCode(equ.getCode());
if (spareList.size()>0) {
if (spareList.size() > 0) {
equ.setSpareList(spareList);
}
@ -111,7 +111,13 @@ public class EquOrderServiceImpl implements IEquOrderService {
@Override
@DS("#header.poolName")
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;
}
/**
@ -141,11 +147,11 @@ public class EquOrderServiceImpl implements IEquOrderService {
if (equOrder.getRepairCode() != null) {
if (!equOrder.getRepairCode().isEmpty()) {
EquRepairOrder repairOrder = equRepairOrderMapper.selectEquRepairOrderByRepairCode(equOrder.getRepairCode());
if (repairOrder==null) {
return error(500,"未查询到报修单信息!");
}else {
if (!repairOrder.getOrderStatus().equals("待审核")){
return error(500,"报修单已审核,不可修改记录!");
if (repairOrder == null) {
return error(500, "未查询到报修单信息!");
} else {
if (!repairOrder.getOrderStatus().equals("待审核")) {
return error(500, "报修单已审核,不可修改记录!");
}
}
}
@ -188,7 +194,7 @@ public class EquOrderServiceImpl implements IEquOrderService {
standard.setErrorFlag("1");
standard.setDetailReach("0");
}
}else {
} else {
// TODO 未达标
standard.setErrorFlag("0");
if (standard.getDetailReach().equals("0")) {
@ -216,44 +222,44 @@ public class EquOrderServiceImpl implements IEquOrderService {
boolean checkRepair = false;
if (equOrder.getRepairCode() == null){
if (equOrder.getRepairCode() == null) {
checkRepair = true;
}else {
if (equOrder.getRepairCode().isEmpty()){
} else {
if (equOrder.getRepairCode().isEmpty()) {
checkRepair = true;
}
}
// 报修信息
if (checkRepair && hasError ) {
// 获取故障报修流水号
EquRepairOrder equRepairOrder = new EquRepairOrder();
String serialNum = String.format("%03d", equRepairOrderMapper.selectOrderCodeSerialNumber());
String equipmentCode = equOrder.getEquipmentCode();
//报修单号
equRepairOrder.setOrderCode("BX"+DateUtils.dateTimeNow(DateUtils.YYYYMMDD) + equipmentCode + serialNum);
//在主表中存入报修单号信息
equOrder.setRepairCode(equRepairOrder.getOrderCode());
//新增报修记录
equRepairOrder.setOrderId(IdUtils.fastSimpleUUID());
equRepairOrder.setCreateTime(DateUtils.getNowDate());
equRepairOrder.setCreateBy(SecurityUtils.getUsername());
// 报修来源
if (equOrder.getPlanType().equals("inspection")){
equRepairOrder.setOrderSource("巡检");
}
if (equOrder.getPlanType().equals("spotInspection")){
equRepairOrder.setOrderSource("点检");
}
if (equOrder.getPlanType().equals("maintenance")){
equRepairOrder.setOrderSource("保养");
}
equRepairOrder.setOrderStatus("待审核");
HttpServletRequest request = ((ServletRequestAttributes) RequestContextHolder.getRequestAttributes()).getRequest();
String key = "#header.poolName";
equRepairOrder.setFactoryCode(request.getHeader(key.substring(8)).replace("ds_",""));
equRepairOrderMapper.insertEquRepairOrder(equRepairOrder);
if (checkRepair && hasError) {
// 获取故障报修流水号
EquRepairOrder equRepairOrder = new EquRepairOrder();
String serialNum = String.format("%03d", equRepairOrderMapper.selectOrderCodeSerialNumber());
String equipmentCode = equOrder.getEqu().getEquipmentCode();
//报修单号
equRepairOrder.setOrderCode("BX" + DateUtils.dateTimeNow(DateUtils.YYYYMMDD) + equipmentCode + serialNum);
//在主表中存入报修单号信息
equOrder.setRepairCode(equRepairOrder.getOrderCode());
//新增报修记录
equRepairOrder.setOrderId(IdUtils.fastSimpleUUID());
equRepairOrder.setCreateTime(DateUtils.getNowDate());
equRepairOrder.setCreateBy(SecurityUtils.getUsername());
// 报修来源
if (equOrder.getPlanType().equals("inspection")) {
equRepairOrder.setOrderSource("巡检");
}
if (equOrder.getPlanType().equals("spotInspection")) {
equRepairOrder.setOrderSource("点检");
}
if (equOrder.getPlanType().equals("maintenance")) {
equRepairOrder.setOrderSource("保养");
}
equRepairOrder.setOrderStatus("待审核");
HttpServletRequest request = ((ServletRequestAttributes) RequestContextHolder.getRequestAttributes()).getRequest();
String key = "#header.poolName";
equRepairOrder.setFactoryCode(request.getHeader(key.substring(8)).replace("ds_", ""));
equRepairOrderMapper.insertEquRepairOrder(equRepairOrder);
}
if (!hasError) {

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

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

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

@ -35,6 +35,8 @@ public class InspectionWorkServiceImpl implements IInspectionWorkService {
private EquPlanMapper equPlanMapper;
@Autowired
private EquOrderEquSpareMapper equOrderEquSpareMapper;
@Autowired
private EquOrderEquMapper equOrderEquMapper;
/**
*
@ -60,7 +62,7 @@ public class InspectionWorkServiceImpl implements IInspectionWorkService {
// 替换循环周期
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());

@ -60,7 +60,6 @@
<if test="planLoopEnd != null "> and plan_loop_end = #{planLoopEnd}</if>
<if test="orderStart != null "> and order_start = #{orderStart}</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="orderCost != null "> and order_cost = #{orderCost}</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="workCode != null "> and work_code = #{workCode}</if>
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>
</select>

Loading…
Cancel
Save