|
|
@ -56,7 +56,7 @@ public class DevicePDAServiceImpl implements IDevicePDAService {
|
|
|
|
@Autowired
|
|
|
|
@Autowired
|
|
|
|
private EquEquipmentMapper equEquipmentMapper;
|
|
|
|
private EquEquipmentMapper equEquipmentMapper;
|
|
|
|
@Autowired
|
|
|
|
@Autowired
|
|
|
|
private EquSpareApplyMapper equSpareApplyMapper;
|
|
|
|
private EquSpareApplyMapper equSpareApplyMapper;
|
|
|
|
@Autowired
|
|
|
|
@Autowired
|
|
|
|
private EquFileMapper equFileMapper;
|
|
|
|
private EquFileMapper equFileMapper;
|
|
|
|
|
|
|
|
|
|
|
@ -165,7 +165,7 @@ public class DevicePDAServiceImpl implements IDevicePDAService {
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
/**
|
|
|
|
* 填写巡检记录工单
|
|
|
|
* 填写巡检、点检、保养记录
|
|
|
|
*
|
|
|
|
*
|
|
|
|
* @param equOrder
|
|
|
|
* @param equOrder
|
|
|
|
* @return
|
|
|
|
* @return
|
|
|
@ -178,11 +178,11 @@ public class DevicePDAServiceImpl implements IDevicePDAService {
|
|
|
|
if (equOrder.getRepairCode() != null) {
|
|
|
|
if (equOrder.getRepairCode() != null) {
|
|
|
|
if (!equOrder.getRepairCode().isEmpty()) {
|
|
|
|
if (!equOrder.getRepairCode().isEmpty()) {
|
|
|
|
EquRepairOrder repairOrder = equRepairOrderMapper.selectEquRepairOrderByRepairCode(equOrder.getRepairCode());
|
|
|
|
EquRepairOrder repairOrder = equRepairOrderMapper.selectEquRepairOrderByRepairCode(equOrder.getRepairCode());
|
|
|
|
if (repairOrder==null) {
|
|
|
|
if (repairOrder == null) {
|
|
|
|
return error(500,"未查询到报修单信息!");
|
|
|
|
return error(500, "未查询到报修单信息!");
|
|
|
|
}else {
|
|
|
|
} else {
|
|
|
|
if (!repairOrder.getOrderStatus().equals("待审核")){
|
|
|
|
if (!repairOrder.getOrderStatus().equals("待审核")) {
|
|
|
|
return error(500,"报修单已审核,不可修改记录!");
|
|
|
|
return error(500, "报修单已审核,不可修改记录!");
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
@ -228,7 +228,7 @@ public class DevicePDAServiceImpl implements IDevicePDAService {
|
|
|
|
hasError = true;
|
|
|
|
hasError = true;
|
|
|
|
standard.setDetailReach("0");
|
|
|
|
standard.setDetailReach("0");
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}else {
|
|
|
|
} else {
|
|
|
|
// 未达标
|
|
|
|
// 未达标
|
|
|
|
standard.setErrorFlag("0");
|
|
|
|
standard.setErrorFlag("0");
|
|
|
|
if (standard.getDetailReach().equals("0")) {
|
|
|
|
if (standard.getDetailReach().equals("0")) {
|
|
|
@ -255,10 +255,10 @@ public class DevicePDAServiceImpl implements IDevicePDAService {
|
|
|
|
|
|
|
|
|
|
|
|
boolean checkRepair = false;
|
|
|
|
boolean checkRepair = false;
|
|
|
|
|
|
|
|
|
|
|
|
if (equOrder.getRepairCode() == null){
|
|
|
|
if (equOrder.getRepairCode() == null) {
|
|
|
|
checkRepair = true;
|
|
|
|
checkRepair = true;
|
|
|
|
}else {
|
|
|
|
} else {
|
|
|
|
if (equOrder.getRepairCode().isEmpty()){
|
|
|
|
if (equOrder.getRepairCode().isEmpty()) {
|
|
|
|
checkRepair = true;
|
|
|
|
checkRepair = true;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
@ -270,7 +270,7 @@ public class DevicePDAServiceImpl implements IDevicePDAService {
|
|
|
|
String serialNum = String.format("%03d", equRepairOrderMapper.selectOrderCodeSerialNumber());
|
|
|
|
String serialNum = String.format("%03d", equRepairOrderMapper.selectOrderCodeSerialNumber());
|
|
|
|
String equipmentCode = equOrder.getEquipmentCode();
|
|
|
|
String equipmentCode = equOrder.getEquipmentCode();
|
|
|
|
//报修单号
|
|
|
|
//报修单号
|
|
|
|
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());
|
|
|
|
|
|
|
|
|
|
|
@ -289,19 +289,19 @@ public class DevicePDAServiceImpl implements IDevicePDAService {
|
|
|
|
equRepairOrder.setOrderConnection(equTeamUserList.getPhonenumber());
|
|
|
|
equRepairOrder.setOrderConnection(equTeamUserList.getPhonenumber());
|
|
|
|
equRepairOrder.setOrderRepairmanName(equTeamUserList.getNickName());
|
|
|
|
equRepairOrder.setOrderRepairmanName(equTeamUserList.getNickName());
|
|
|
|
// 报修来源
|
|
|
|
// 报修来源
|
|
|
|
if (equOrder.getPlanType().equals("inspection")){
|
|
|
|
if (equOrder.getPlanType().equals("inspection")) {
|
|
|
|
equRepairOrder.setOrderSource("巡检");
|
|
|
|
equRepairOrder.setOrderSource("巡检");
|
|
|
|
}
|
|
|
|
}
|
|
|
|
if (equOrder.getPlanType().equals("spotInspection")){
|
|
|
|
if (equOrder.getPlanType().equals("spotInspection")) {
|
|
|
|
equRepairOrder.setOrderSource("点检");
|
|
|
|
equRepairOrder.setOrderSource("点检");
|
|
|
|
}
|
|
|
|
}
|
|
|
|
if (equOrder.getPlanType().equals("maintenance")){
|
|
|
|
if (equOrder.getPlanType().equals("maintenance")) {
|
|
|
|
equRepairOrder.setOrderSource("保养");
|
|
|
|
equRepairOrder.setOrderSource("保养");
|
|
|
|
}
|
|
|
|
}
|
|
|
|
equRepairOrder.setOrderStatus("待审核");
|
|
|
|
equRepairOrder.setOrderStatus("待审核");
|
|
|
|
HttpServletRequest request = ((ServletRequestAttributes) RequestContextHolder.getRequestAttributes()).getRequest();
|
|
|
|
HttpServletRequest request = ((ServletRequestAttributes) RequestContextHolder.getRequestAttributes()).getRequest();
|
|
|
|
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);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
@ -344,8 +344,9 @@ public class DevicePDAServiceImpl implements IDevicePDAService {
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
//////////////////////报修
|
|
|
|
//////////////////////报修
|
|
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
/**
|
|
|
|
* 新增报修记录
|
|
|
|
* 新增报修记录
|
|
|
|
*
|
|
|
|
*
|
|
|
|
* @param equRepairOrder
|
|
|
|
* @param equRepairOrder
|
|
|
|
* @return
|
|
|
|
* @return
|
|
|
@ -362,7 +363,7 @@ public class DevicePDAServiceImpl implements IDevicePDAService {
|
|
|
|
String serialNum = String.format("%03d", equRepairOrderMapper.selectOrderCodeSerialNumber());
|
|
|
|
String serialNum = String.format("%03d", equRepairOrderMapper.selectOrderCodeSerialNumber());
|
|
|
|
String equipmentCode = equRepairOrder.getEquipmentCode();
|
|
|
|
String equipmentCode = equRepairOrder.getEquipmentCode();
|
|
|
|
//报修单号
|
|
|
|
//报修单号
|
|
|
|
equRepairOrder.setOrderCode("BX"+DateUtils.dateTimeNow(DateUtils.YYYYMMDD) + equipmentCode + serialNum);
|
|
|
|
equRepairOrder.setOrderCode("BX" + DateUtils.dateTimeNow(DateUtils.YYYYMMDD) + equipmentCode + serialNum);
|
|
|
|
equRepairOrder.setCreateTime(DateUtils.getNowDate());
|
|
|
|
equRepairOrder.setCreateTime(DateUtils.getNowDate());
|
|
|
|
equRepairOrder.setCreateBy(SecurityUtils.getUsername());
|
|
|
|
equRepairOrder.setCreateBy(SecurityUtils.getUsername());
|
|
|
|
equRepairOrder.setOrderRepairmanCode(SecurityUtils.getUsername());
|
|
|
|
equRepairOrder.setOrderRepairmanCode(SecurityUtils.getUsername());
|
|
|
@ -370,7 +371,7 @@ public class DevicePDAServiceImpl implements IDevicePDAService {
|
|
|
|
equRepairOrder.setOrderStatus("待审核");
|
|
|
|
equRepairOrder.setOrderStatus("待审核");
|
|
|
|
HttpServletRequest request = ((ServletRequestAttributes) RequestContextHolder.getRequestAttributes()).getRequest();
|
|
|
|
HttpServletRequest request = ((ServletRequestAttributes) RequestContextHolder.getRequestAttributes()).getRequest();
|
|
|
|
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);
|
|
|
|
|
|
|
|
|
|
|
|
//删除照片 不需要清照片 因为是新增
|
|
|
|
//删除照片 不需要清照片 因为是新增
|
|
|
@ -435,6 +436,8 @@ public class DevicePDAServiceImpl implements IDevicePDAService {
|
|
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
/**
|
|
|
|
* 开始保养任务
|
|
|
|
* 开始保养任务
|
|
|
|
|
|
|
|
* TODO 修改设备状态
|
|
|
|
|
|
|
|
*
|
|
|
|
* @param pdadto
|
|
|
|
* @param pdadto
|
|
|
|
* @return
|
|
|
|
* @return
|
|
|
|
*/
|
|
|
|
*/
|
|
|
@ -490,6 +493,7 @@ public class DevicePDAServiceImpl implements IDevicePDAService {
|
|
|
|
return error();
|
|
|
|
return error();
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
/**
|
|
|
|
* 获取维修人员
|
|
|
|
* 获取维修人员
|
|
|
|
*
|
|
|
|
*
|
|
|
@ -520,7 +524,7 @@ public class DevicePDAServiceImpl implements IDevicePDAService {
|
|
|
|
//不停机 那么实际停机开始时间和实际停机结束时间都没有
|
|
|
|
//不停机 那么实际停机开始时间和实际停机结束时间都没有
|
|
|
|
//如果停机 那么实际停机时间就是传入的时间
|
|
|
|
//如果停机 那么实际停机时间就是传入的时间
|
|
|
|
equRepairWorkOrder.setWorkStartTime(DateUtils.getNowDate());
|
|
|
|
equRepairWorkOrder.setWorkStartTime(DateUtils.getNowDate());
|
|
|
|
if(equRepairWorkOrder.getWorkDownMachine().equals("1")){
|
|
|
|
if (equRepairWorkOrder.getWorkDownMachine().equals("1")) {
|
|
|
|
equRepairWorkOrder.setActualDownStartTime(DateUtils.getNowDate());
|
|
|
|
equRepairWorkOrder.setActualDownStartTime(DateUtils.getNowDate());
|
|
|
|
}
|
|
|
|
}
|
|
|
|
equRepairWorkOrder.setUpdateBy(SecurityUtils.getUsername());
|
|
|
|
equRepairWorkOrder.setUpdateBy(SecurityUtils.getUsername());
|
|
|
@ -535,8 +539,6 @@ public class DevicePDAServiceImpl implements IDevicePDAService {
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
/**
|
|
|
|
*
|
|
|
|
|
|
|
|
*
|
|
|
|
|
|
|
|
* @param equipmentId
|
|
|
|
* @param equipmentId
|
|
|
|
* @return
|
|
|
|
* @return
|
|
|
|
*/
|
|
|
|
*/
|
|
|
@ -544,8 +546,8 @@ public class DevicePDAServiceImpl implements IDevicePDAService {
|
|
|
|
@DS("#header.poolName")
|
|
|
|
@DS("#header.poolName")
|
|
|
|
public AjaxResult selectEquEquipmentByEquEquipmentId(Long equipmentId) {
|
|
|
|
public AjaxResult selectEquEquipmentByEquEquipmentId(Long equipmentId) {
|
|
|
|
try {
|
|
|
|
try {
|
|
|
|
EquEquipment list = equEquipmentMapper.selectEquEquipmentByEquEquipmentId(equipmentId);
|
|
|
|
EquEquipment list = equEquipmentMapper.selectEquEquipmentByEquEquipmentId(equipmentId);
|
|
|
|
return success(list);
|
|
|
|
return success(list);
|
|
|
|
} catch (Exception e) {
|
|
|
|
} catch (Exception e) {
|
|
|
|
return error();
|
|
|
|
return error();
|
|
|
|
}
|
|
|
|
}
|
|
|
@ -561,43 +563,43 @@ public class DevicePDAServiceImpl implements IDevicePDAService {
|
|
|
|
@DS("#header.poolName")
|
|
|
|
@DS("#header.poolName")
|
|
|
|
public AjaxResult selectPdaRepairWorkOrderDetails(String workId) {
|
|
|
|
public AjaxResult selectPdaRepairWorkOrderDetails(String workId) {
|
|
|
|
try {
|
|
|
|
try {
|
|
|
|
EquRepairWorkOrder list = equRepairWorkOrderMapper.selectEquRepairWorkOrderByWorkId(workId);
|
|
|
|
EquRepairWorkOrder list = equRepairWorkOrderMapper.selectEquRepairWorkOrderByWorkId(workId);
|
|
|
|
//查询对应检查项信息
|
|
|
|
//查询对应检查项信息
|
|
|
|
EquOrder equOrder = new EquOrder();
|
|
|
|
EquOrder equOrder = new EquOrder();
|
|
|
|
equOrder.setWorkCode(list.getWorkCode());
|
|
|
|
equOrder.setWorkCode(list.getWorkCode());
|
|
|
|
//检查项
|
|
|
|
//检查项
|
|
|
|
List<EquOrder> checkLists = equOrderMapper.selectCheckListByWorkCode(equOrder);
|
|
|
|
List<EquOrder> checkLists = equOrderMapper.selectCheckListByWorkCode(equOrder);
|
|
|
|
//每个检查项对应的检测标准
|
|
|
|
//每个检查项对应的检测标准
|
|
|
|
for(EquOrder equOrder1 :checkLists){
|
|
|
|
for (EquOrder equOrder1 : checkLists) {
|
|
|
|
EquOrderStandard equOrderStandard = new EquOrderStandard();
|
|
|
|
EquOrderStandard equOrderStandard = new EquOrderStandard();
|
|
|
|
equOrderStandard.setOrderCode(equOrder1.getOrderCode());
|
|
|
|
equOrderStandard.setOrderCode(equOrder1.getOrderCode());
|
|
|
|
equOrderStandard.setParentCode(equOrder1.getId());
|
|
|
|
equOrderStandard.setParentCode(equOrder1.getId());
|
|
|
|
List<EquOrderStandard> standardLists = equOrderStandardMapper.selectPdaEquOrderList(equOrderStandard);
|
|
|
|
List<EquOrderStandard> standardLists = equOrderStandardMapper.selectPdaEquOrderList(equOrderStandard);
|
|
|
|
for(EquOrderStandard standardList :standardLists){
|
|
|
|
for (EquOrderStandard standardList : standardLists) {
|
|
|
|
//每个检查标准里面的照片
|
|
|
|
//每个检查标准里面的照片
|
|
|
|
List<BaseFileData> files = equOrderStandardMapper.getBaseFileBatch(standardList.getId());
|
|
|
|
List<BaseFileData> files = equOrderStandardMapper.getBaseFileBatch(standardList.getId());
|
|
|
|
if (!CollectionUtils.isEmpty(files)) {
|
|
|
|
if (!CollectionUtils.isEmpty(files)) {
|
|
|
|
standardList.setPicturePaths(files);
|
|
|
|
standardList.setPicturePaths(files);
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
standardList.setDetailReach(standardList.getRepairReach());
|
|
|
|
|
|
|
|
standardList.setActualValue(standardList.getRepairValue());
|
|
|
|
}
|
|
|
|
}
|
|
|
|
standardList.setDetailReach(standardList.getRepairReach());
|
|
|
|
equOrder1.setStandardList(standardLists);
|
|
|
|
standardList.setActualValue(standardList.getRepairValue());
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|
|
|
|
equOrder1.setStandardList(standardLists);
|
|
|
|
list.setDetailList(checkLists);
|
|
|
|
}
|
|
|
|
|
|
|
|
list.setDetailList(checkLists);
|
|
|
|
//备件申领单
|
|
|
|
|
|
|
|
EquRepairWorkOrder equRepairWorkOrder = new EquRepairWorkOrder();
|
|
|
|
//备件申领单
|
|
|
|
equRepairWorkOrder.setWorkCode(list.getWorkCode());
|
|
|
|
EquRepairWorkOrder equRepairWorkOrder = new EquRepairWorkOrder();
|
|
|
|
List<EquSpareApply> applyLists = equSpareApplyMapper.selectRepairSparePartsRecord(equRepairWorkOrder);
|
|
|
|
equRepairWorkOrder.setWorkCode(list.getWorkCode());
|
|
|
|
list.setApplyList(applyLists);
|
|
|
|
List<EquSpareApply> applyLists = equSpareApplyMapper.selectRepairSparePartsRecord(equRepairWorkOrder);
|
|
|
|
|
|
|
|
list.setApplyList(applyLists);
|
|
|
|
//文件
|
|
|
|
|
|
|
|
List<BaseFileData> files = equRepairWorkOrderMapper.getBaseFileBatch(workId);
|
|
|
|
//文件
|
|
|
|
if (!CollectionUtils.isEmpty(files)) {
|
|
|
|
List<BaseFileData> files = equRepairWorkOrderMapper.getBaseFileBatch(workId);
|
|
|
|
list.setFiles(files);
|
|
|
|
if (!CollectionUtils.isEmpty(files)) {
|
|
|
|
}
|
|
|
|
list.setFiles(files);
|
|
|
|
return success(list);
|
|
|
|
}
|
|
|
|
|
|
|
|
return success(list);
|
|
|
|
|
|
|
|
} catch (Exception e) {
|
|
|
|
} catch (Exception e) {
|
|
|
|
return error();
|
|
|
|
return error();
|
|
|
|
}
|
|
|
|
}
|
|
|
@ -612,114 +614,114 @@ public class DevicePDAServiceImpl implements IDevicePDAService {
|
|
|
|
@Override
|
|
|
|
@Override
|
|
|
|
@DS("#header.poolName")
|
|
|
|
@DS("#header.poolName")
|
|
|
|
public AjaxResult updateMaintenanceRecords(EquRepairWorkOrder equRepairWorkOrder) {
|
|
|
|
public AjaxResult updateMaintenanceRecords(EquRepairWorkOrder equRepairWorkOrder) {
|
|
|
|
//判断是否停机
|
|
|
|
//判断是否停机
|
|
|
|
EquRepairWorkOrder list = equRepairWorkOrderMapper.selectEquRepairWorkOrderByWorkId(equRepairWorkOrder.getWorkId());
|
|
|
|
EquRepairWorkOrder list = equRepairWorkOrderMapper.selectEquRepairWorkOrderByWorkId(equRepairWorkOrder.getWorkId());
|
|
|
|
if(list.getWorkDownMachine().equals("1")){
|
|
|
|
if (list.getWorkDownMachine().equals("1")) {
|
|
|
|
//维修结束时间、维修真正停机时间
|
|
|
|
//维修结束时间、维修真正停机时间
|
|
|
|
equRepairWorkOrder.setActualDownEndTime(DateUtils.getNowDate());
|
|
|
|
equRepairWorkOrder.setActualDownEndTime(DateUtils.getNowDate());
|
|
|
|
}
|
|
|
|
}
|
|
|
|
equRepairWorkOrder.setWorkEndTime(DateUtils.getNowDate());
|
|
|
|
equRepairWorkOrder.setWorkEndTime(DateUtils.getNowDate());
|
|
|
|
//更新每一项点检/巡检检查项信息
|
|
|
|
//更新每一项点检/巡检检查项信息
|
|
|
|
List<EquOrder> checkLists = equRepairWorkOrder.getDetailList();
|
|
|
|
List<EquOrder> checkLists = equRepairWorkOrder.getDetailList();
|
|
|
|
for(EquOrder checkList:checkLists){
|
|
|
|
for (EquOrder checkList : checkLists) {
|
|
|
|
checkList.setUpdateBy(SecurityUtils.getUsername());
|
|
|
|
checkList.setUpdateBy(SecurityUtils.getUsername());
|
|
|
|
checkList.setUpdateTime(DateUtils.getNowDate());
|
|
|
|
checkList.setUpdateTime(DateUtils.getNowDate());
|
|
|
|
List<EquOrderStandard> standardLists = checkList.getStandardList();
|
|
|
|
List<EquOrderStandard> standardLists = checkList.getStandardList();
|
|
|
|
for(EquOrderStandard standardList :standardLists){
|
|
|
|
for (EquOrderStandard standardList : standardLists) {
|
|
|
|
//先删除每个检查项标准图片
|
|
|
|
//先删除每个检查项标准图片
|
|
|
|
equOrderStandardMapper.deleteBaseFileBySourceId(standardList.getId());
|
|
|
|
equOrderStandardMapper.deleteBaseFileBySourceId(standardList.getId());
|
|
|
|
//图片
|
|
|
|
//图片
|
|
|
|
if (StringUtils.isNotEmpty(standardList.getPicturePath())) {
|
|
|
|
if (StringUtils.isNotEmpty(standardList.getPicturePath())) {
|
|
|
|
String[] ids = standardList.getPicturePath().split(",");
|
|
|
|
String[] ids = standardList.getPicturePath().split(",");
|
|
|
|
List<BaseFileData> files = new ArrayList<>();
|
|
|
|
List<BaseFileData> files = new ArrayList<>();
|
|
|
|
BaseFileData file = null;
|
|
|
|
BaseFileData file = null;
|
|
|
|
for (String id : ids) {
|
|
|
|
for (String id : ids) {
|
|
|
|
file = new BaseFileData();
|
|
|
|
file = new BaseFileData();
|
|
|
|
file.setFileId(IdUtils.fastSimpleUUID());
|
|
|
|
file.setFileId(IdUtils.fastSimpleUUID());
|
|
|
|
file.setFileName(id.split("&fileName=")[1]);
|
|
|
|
file.setFileName(id.split("&fileName=")[1]);
|
|
|
|
file.setFileAddress(id);
|
|
|
|
file.setFileAddress(id);
|
|
|
|
file.setSourceId(standardList.getId());
|
|
|
|
file.setSourceId(standardList.getId());
|
|
|
|
file.setCreateBy(SecurityUtils.getUsername());
|
|
|
|
file.setCreateBy(SecurityUtils.getUsername());
|
|
|
|
file.setCreateTime(new Date());
|
|
|
|
file.setCreateTime(new Date());
|
|
|
|
//维修后
|
|
|
|
//维修后
|
|
|
|
file.setImageType("4");
|
|
|
|
file.setImageType("4");
|
|
|
|
files.add(file);
|
|
|
|
files.add(file);
|
|
|
|
}
|
|
|
|
|
|
|
|
equOrderStandardMapper.insertBaseFileBatch(files);
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|
|
|
|
standardList.setRepairReach(standardList.getDetailReach());
|
|
|
|
equOrderStandardMapper.insertBaseFileBatch(files);
|
|
|
|
standardList.setRepairValue(standardList.getActualValue());
|
|
|
|
|
|
|
|
standardList.setUpdateTime(DateUtils.getNowDate());
|
|
|
|
|
|
|
|
standardList.setUpdateBy(SecurityUtils.getUsername());
|
|
|
|
|
|
|
|
equOrderStandardMapper.updateActualValues(standardList);
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|
|
|
|
equOrderMapper.updateEquOrder(checkList);
|
|
|
|
standardList.setRepairReach(standardList.getDetailReach());
|
|
|
|
|
|
|
|
standardList.setRepairValue(standardList.getActualValue());
|
|
|
|
|
|
|
|
standardList.setUpdateTime(DateUtils.getNowDate());
|
|
|
|
|
|
|
|
standardList.setUpdateBy(SecurityUtils.getUsername());
|
|
|
|
|
|
|
|
equOrderStandardMapper.updateActualValues(standardList);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
equOrderMapper.updateEquOrder(checkList);
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
//新建申领单
|
|
|
|
//新建申领单
|
|
|
|
List<EquSpareApply> equSpareApplies = equRepairWorkOrder.getApplyList();
|
|
|
|
List<EquSpareApply> equSpareApplies = equRepairWorkOrder.getApplyList();
|
|
|
|
for(EquSpareApply equSpareApply:equSpareApplies){
|
|
|
|
for (EquSpareApply equSpareApply : equSpareApplies) {
|
|
|
|
//生成领料单code
|
|
|
|
//生成领料单code
|
|
|
|
String serialNum = String.format("%03d", equSpareApplyMapper.selectSerialNumber());
|
|
|
|
String serialNum = String.format("%03d", equSpareApplyMapper.selectSerialNumber());
|
|
|
|
String code = DateUtils.dateTimeNow(DateUtils.YYYYMMDD) + equRepairWorkOrder.getWorkCode().substring(10);
|
|
|
|
String code = DateUtils.dateTimeNow(DateUtils.YYYYMMDD) + equRepairWorkOrder.getWorkCode().substring(10);
|
|
|
|
//十五位单号
|
|
|
|
//十五位单号
|
|
|
|
equSpareApply.setApplyCode("AW" + code + serialNum);
|
|
|
|
equSpareApply.setApplyCode("AW" + code + serialNum);
|
|
|
|
equSpareApply.setApplyId(IdUtils.fastSimpleUUID());
|
|
|
|
equSpareApply.setApplyId(IdUtils.fastSimpleUUID());
|
|
|
|
//备品备件规格型号!!!!!
|
|
|
|
//备品备件规格型号!!!!!
|
|
|
|
// equSpareApply.setSpareModel(equSpareApply.getS);
|
|
|
|
// equSpareApply.setSpareModel(equSpareApply.getS);
|
|
|
|
equSpareApply.setSpareCode(equSpareApply.getMaterialCode());
|
|
|
|
equSpareApply.setSpareCode(equSpareApply.getMaterialCode());
|
|
|
|
equSpareApply.setSpareName(equSpareApply.getMaterialDesc());
|
|
|
|
equSpareApply.setSpareName(equSpareApply.getMaterialDesc());
|
|
|
|
equSpareApply.setApplyPeople(SecurityUtils.getUsername());
|
|
|
|
equSpareApply.setApplyPeople(SecurityUtils.getUsername());
|
|
|
|
equSpareApply.setCreateBy(SecurityUtils.getUsername());
|
|
|
|
equSpareApply.setCreateBy(SecurityUtils.getUsername());
|
|
|
|
equSpareApply.setCreateTime(DateUtils.getNowDate());
|
|
|
|
equSpareApply.setCreateTime(DateUtils.getNowDate());
|
|
|
|
equSpareApply.setApplyTime(DateUtils.getNowDate());
|
|
|
|
equSpareApply.setApplyTime(DateUtils.getNowDate());
|
|
|
|
equSpareApply.setSpareUseEquipment(equRepairWorkOrder.getEquipmentCode());
|
|
|
|
equSpareApply.setSpareUseEquipment(equRepairWorkOrder.getEquipmentCode());
|
|
|
|
equSpareApply.setWorkCode(equRepairWorkOrder.getWorkCode());
|
|
|
|
equSpareApply.setWorkCode(equRepairWorkOrder.getWorkCode());
|
|
|
|
HttpServletRequest request = ((ServletRequestAttributes) RequestContextHolder.getRequestAttributes()).getRequest();
|
|
|
|
HttpServletRequest request = ((ServletRequestAttributes) RequestContextHolder.getRequestAttributes()).getRequest();
|
|
|
|
String key = "#header.poolName";
|
|
|
|
String key = "#header.poolName";
|
|
|
|
equSpareApply.setFactoryCode(request.getHeader(key.substring(8)).replace("ds_",""));
|
|
|
|
equSpareApply.setFactoryCode(request.getHeader(key.substring(8)).replace("ds_", ""));
|
|
|
|
equSpareApplyMapper.insertEquSpareApply(equSpareApply);
|
|
|
|
equSpareApplyMapper.insertEquSpareApply(equSpareApply);
|
|
|
|
|
|
|
|
|
|
|
|
//更新完备品申领单后,更新库存
|
|
|
|
//更新完备品申领单后,更新库存
|
|
|
|
SparePartsLedger sparePartsLedger = new SparePartsLedger();
|
|
|
|
SparePartsLedger sparePartsLedger = new SparePartsLedger();
|
|
|
|
sparePartsLedger.setStorageId(equSpareApply.getStorageId());
|
|
|
|
sparePartsLedger.setStorageId(equSpareApply.getStorageId());
|
|
|
|
BigDecimal applyNum = equSpareApply.getSpareQuantity();
|
|
|
|
BigDecimal applyNum = equSpareApply.getSpareQuantity();
|
|
|
|
BigDecimal amount = equSpareApply.getAmount();
|
|
|
|
BigDecimal amount = equSpareApply.getAmount();
|
|
|
|
sparePartsLedger.setAmount(amount.subtract(applyNum));
|
|
|
|
sparePartsLedger.setAmount(amount.subtract(applyNum));
|
|
|
|
sparePartsLedgerMapper.updateSparePartsLedger(sparePartsLedger);
|
|
|
|
sparePartsLedgerMapper.updateSparePartsLedger(sparePartsLedger);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
//图片
|
|
|
|
//图片
|
|
|
|
//先删除每个维修工单对应图片
|
|
|
|
//先删除每个维修工单对应图片
|
|
|
|
equRepairWorkOrderMapper.deleteBaseFileBySourceId(equRepairWorkOrder.getWorkId());
|
|
|
|
equRepairWorkOrderMapper.deleteBaseFileBySourceId(equRepairWorkOrder.getWorkId());
|
|
|
|
if (StringUtils.isNotEmpty(equRepairWorkOrder.getFileList())) {
|
|
|
|
if (StringUtils.isNotEmpty(equRepairWorkOrder.getFileList())) {
|
|
|
|
String[] ids = equRepairWorkOrder.getFileList().split(",");
|
|
|
|
String[] ids = equRepairWorkOrder.getFileList().split(",");
|
|
|
|
List<BaseFileData> files = new ArrayList<>();
|
|
|
|
List<BaseFileData> files = new ArrayList<>();
|
|
|
|
BaseFileData file = null;
|
|
|
|
BaseFileData file = null;
|
|
|
|
for (String id : ids) {
|
|
|
|
for (String id : ids) {
|
|
|
|
file = new BaseFileData();
|
|
|
|
file = new BaseFileData();
|
|
|
|
file.setFileId(IdUtils.fastSimpleUUID());
|
|
|
|
file.setFileId(IdUtils.fastSimpleUUID());
|
|
|
|
file.setFileName(id.split("&fileName=")[1]);
|
|
|
|
file.setFileName(id.split("&fileName=")[1]);
|
|
|
|
file.setFileAddress(id);
|
|
|
|
file.setFileAddress(id);
|
|
|
|
file.setSourceId(equRepairWorkOrder.getWorkId());
|
|
|
|
file.setSourceId(equRepairWorkOrder.getWorkId());
|
|
|
|
file.setCreateBy(SecurityUtils.getUsername());
|
|
|
|
file.setCreateBy(SecurityUtils.getUsername());
|
|
|
|
file.setCreateTime(new Date());
|
|
|
|
file.setCreateTime(new Date());
|
|
|
|
//维修后
|
|
|
|
//维修后
|
|
|
|
file.setImageType("4");
|
|
|
|
file.setImageType("4");
|
|
|
|
files.add(file);
|
|
|
|
files.add(file);
|
|
|
|
}
|
|
|
|
|
|
|
|
equRepairWorkOrderMapper.insertBaseFileBatch(files);
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|
|
|
|
//维修人:当前登录人
|
|
|
|
equRepairWorkOrderMapper.insertBaseFileBatch(files);
|
|
|
|
//维修状态
|
|
|
|
}
|
|
|
|
equRepairWorkOrder.setWorkStatus("1");
|
|
|
|
//维修人:当前登录人
|
|
|
|
//维修结束时间
|
|
|
|
//维修状态
|
|
|
|
equRepairWorkOrder.setWorkPerson(SecurityUtils.getUsername());
|
|
|
|
equRepairWorkOrder.setWorkStatus("1");
|
|
|
|
equRepairWorkOrder.setUpdateBy(SecurityUtils.getUsername());
|
|
|
|
//维修结束时间
|
|
|
|
equRepairWorkOrder.setUpdateTime(DateUtils.getNowDate());
|
|
|
|
equRepairWorkOrder.setWorkPerson(SecurityUtils.getUsername());
|
|
|
|
equRepairWorkOrderMapper.updateEquRepairWorkOrder(equRepairWorkOrder);
|
|
|
|
equRepairWorkOrder.setUpdateBy(SecurityUtils.getUsername());
|
|
|
|
//需要更新设备状态????这里没做
|
|
|
|
equRepairWorkOrder.setUpdateTime(DateUtils.getNowDate());
|
|
|
|
return success("提交成功,维修完成!");
|
|
|
|
equRepairWorkOrderMapper.updateEquRepairWorkOrder(equRepairWorkOrder);
|
|
|
|
|
|
|
|
//需要更新设备状态????这里没做
|
|
|
|
|
|
|
|
return success("提交成功,维修完成!");
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
/**
|
|
|
|