PDA手持填写巡检记录优化

highway
wws 1 year ago
parent 6dafbca7d1
commit baa2e209a3

@ -18,6 +18,7 @@ import org.springframework.web.context.request.RequestContextHolder;
import org.springframework.web.context.request.ServletRequestAttributes; import org.springframework.web.context.request.ServletRequestAttributes;
import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletRequest;
import java.math.BigDecimal;
import java.text.ParseException; import java.text.ParseException;
import java.text.SimpleDateFormat; import java.text.SimpleDateFormat;
import java.util.ArrayList; import java.util.ArrayList;
@ -144,6 +145,8 @@ public class DevicePDAServiceImpl implements IDevicePDAService {
@DS("#header.poolName") @DS("#header.poolName")
public AjaxResult updateInspectionRecord(EquOrder equOrder) { public AjaxResult updateInspectionRecord(EquOrder equOrder) {
boolean checkRepair = false;
EquOrderEqu equ = equOrder.getEqu(); EquOrderEqu equ = equOrder.getEqu();
List<EquOrderDetail> detailList = equ.getDetailList(); List<EquOrderDetail> detailList = equ.getDetailList();
for (EquOrderDetail detail : detailList) { for (EquOrderDetail detail : detailList) {
@ -167,6 +170,21 @@ public class DevicePDAServiceImpl implements IDevicePDAService {
} }
equOrderStandardMapper.insertBaseFileBatch(files); equOrderStandardMapper.insertBaseFileBatch(files);
} }
// 校验标准信息-是否申请报修
if (standard.getStandardType().equals("quantify")) {
int up = standard.getActualValue().compareTo(standard.getDetailUpLimit());
int down = standard.getActualValue().compareTo(standard.getDetailDownLimit());
if (!(up != 1 && down != -1)) {
checkRepair = true;
}
}else {
// 未达标
if (standard.getDetailReach().equals("1")) {
checkRepair = true;
}
}
// 更新标准 // 更新标准
standard.setUpdateTime(DateUtils.getNowDate()); standard.setUpdateTime(DateUtils.getNowDate());
equOrderStandardMapper.updateEquOrderStandard(standard); equOrderStandardMapper.updateEquOrderStandard(standard);
@ -174,11 +192,13 @@ public class DevicePDAServiceImpl implements IDevicePDAService {
} }
// 更新工单信息 // 更新工单信息
equOrder.setOrderStatus("1"); equOrder.setOrderStatus("1"); // 状态为已完成
equOrder.setUpdateTime(DateUtils.getNowDate()); equOrder.setUpdateTime(DateUtils.getNowDate());
equOrder.setUpdateBy(SecurityContextHolder.getUserName()); equOrder.setUpdateBy(SecurityContextHolder.getUserName());
equOrder.setPlanPerson(SecurityContextHolder.getUserName()); equOrder.setPlanPerson(SecurityContextHolder.getUserName());
equOrder.setPlanPerson(SecurityContextHolder.getUserName());
if (checkRepair) {
// 获取故障报修流水号 // 获取故障报修流水号
EquRepairOrder equRepairOrder = new EquRepairOrder(); EquRepairOrder equRepairOrder = new EquRepairOrder();
String serialNum = String.format("%03d", equRepairOrderMapper.selectOrderCodeSerialNumber()); String serialNum = String.format("%03d", equRepairOrderMapper.selectOrderCodeSerialNumber());
@ -187,7 +207,6 @@ public class DevicePDAServiceImpl implements IDevicePDAService {
equRepairOrder.setOrderCode("BX"+DateUtils.dateTimeNow(DateUtils.YYYYMMDD) + equipmentCode + serialNum); equRepairOrder.setOrderCode("BX"+DateUtils.dateTimeNow(DateUtils.YYYYMMDD) + equipmentCode + serialNum);
//在主表中存入报修单号信息 //在主表中存入报修单号信息
equOrder.setRepairCode(equRepairOrder.getOrderCode()); equOrder.setRepairCode(equRepairOrder.getOrderCode());
equOrderMapper.updateEquOrder(equOrder);
//新增报修记录 //新增报修记录
equRepairOrder.setOrderId(IdUtils.fastSimpleUUID()); equRepairOrder.setOrderId(IdUtils.fastSimpleUUID());
@ -198,6 +217,10 @@ public class DevicePDAServiceImpl implements IDevicePDAService {
String key = "#header.poolName"; String key = "#header.poolName";
equRepairOrder.setFactoryCode(request.getHeader(key.substring(8)).replace("ds_","")); equRepairOrder.setFactoryCode(request.getHeader(key.substring(8)).replace("ds_",""));
equRepairOrderMapper.insertEquRepairOrder(equRepairOrder); equRepairOrderMapper.insertEquRepairOrder(equRepairOrder);
}
// 更新工单信息
equOrderMapper.updateEquOrder(equOrder);
return success(equOrder); return success(equOrder);
} }

Loading…
Cancel
Save