|
|
@ -70,6 +70,9 @@ public class DeviceTaskServiceImpl implements IDeviceTaskService {
|
|
|
|
private EquOrderPersonMapper equOrderPersonMapper;
|
|
|
|
private EquOrderPersonMapper equOrderPersonMapper;
|
|
|
|
@Autowired
|
|
|
|
@Autowired
|
|
|
|
private RemoteUserService remoteUserService;
|
|
|
|
private RemoteUserService remoteUserService;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@Autowired
|
|
|
|
|
|
|
|
private EquOutsourceWorkMapper equOutsourceWorkMapper;
|
|
|
|
/**
|
|
|
|
/**
|
|
|
|
* 根据点检计划生成点检任务
|
|
|
|
* 根据点检计划生成点检任务
|
|
|
|
* **/
|
|
|
|
* **/
|
|
|
@ -254,6 +257,10 @@ public class DeviceTaskServiceImpl implements IDeviceTaskService {
|
|
|
|
String serialNum = String.format("%03d",equOrderMapper.selectSerialNumber());
|
|
|
|
String serialNum = String.format("%03d",equOrderMapper.selectSerialNumber());
|
|
|
|
String orderCode = "O"+DateUtils.dateTimeNow(DateUtils.YYYYMMDD)+serialNum;
|
|
|
|
String orderCode = "O"+DateUtils.dateTimeNow(DateUtils.YYYYMMDD)+serialNum;
|
|
|
|
order.setOrderCode(orderCode);
|
|
|
|
order.setOrderCode(orderCode);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if("1".equals(plan.getUpkeep())) {//1委外工单
|
|
|
|
|
|
|
|
order.setOutsourceCode("BW"+orderCode);
|
|
|
|
|
|
|
|
}
|
|
|
|
/**equ_order**/
|
|
|
|
/**equ_order**/
|
|
|
|
sce = equOrderMapper.insertEquOrder(order);
|
|
|
|
sce = equOrderMapper.insertEquOrder(order);
|
|
|
|
System.out.println(plan.getPlanCode()+"========equ_order:"+sce);
|
|
|
|
System.out.println(plan.getPlanCode()+"========equ_order:"+sce);
|
|
|
@ -310,23 +317,37 @@ public class DeviceTaskServiceImpl implements IDeviceTaskService {
|
|
|
|
/**equ_plan_standard->equ_order_standard*******************************************************/
|
|
|
|
/**equ_plan_standard->equ_order_standard*******************************************************/
|
|
|
|
if(!CollectionUtils.isEmpty(standards)) {
|
|
|
|
if(!CollectionUtils.isEmpty(standards)) {
|
|
|
|
sce = equOrderStandardMapper.insertEquOrderStandards(standards);
|
|
|
|
sce = equOrderStandardMapper.insertEquOrderStandards(standards);
|
|
|
|
System.out.println(plan.getPlanCode() + "========equ_order_detail:" + sce);
|
|
|
|
System.out.println(plan.getPlanCode() + "========equ_order_standard:" + sce);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
/**equ_plan_person->equ_order_standard*********************************************************/
|
|
|
|
/**equ_plan_person->equ_order_standard*********************************************************/
|
|
|
|
EquPlanPerson equPlanPerson = new EquPlanPerson();
|
|
|
|
if("1".equals(plan.getUpkeep())){//1委外
|
|
|
|
equPlanPerson.setPlanCode(plan.getPlanCode());
|
|
|
|
EquOutsourceWork equOutsourceWork = new EquOutsourceWork();
|
|
|
|
List<EquPlanPerson> persons = equPlanPersonMapper.selectEquPlanPersonList(equPlanPerson);
|
|
|
|
BeanUtils.copyProperties(plan,equOutsourceWork);
|
|
|
|
|
|
|
|
equOutsourceWork.setWorkId(IdUtils.fastSimpleUUID());
|
|
|
|
|
|
|
|
equOutsourceWork.setOrderCode(orderCode);
|
|
|
|
|
|
|
|
equOutsourceWork.setWorkCode(order.getOutsourceCode());
|
|
|
|
|
|
|
|
equOutsourceWork.setWorkType("1");//1委外保养0委外维修
|
|
|
|
|
|
|
|
equOutsourceWork.setCreateBy(createBy);
|
|
|
|
|
|
|
|
equOutsourceWork.setCreateTime(nowtime);
|
|
|
|
|
|
|
|
equOutsourceWork.setDelFlag("0");
|
|
|
|
|
|
|
|
sce = equOutsourceWorkMapper.insertEquOutsourceWork(equOutsourceWork);
|
|
|
|
|
|
|
|
System.out.println(plan.getPlanCode() + "========equ_outsource_work:" + sce);
|
|
|
|
|
|
|
|
}else {
|
|
|
|
|
|
|
|
EquPlanPerson equPlanPerson = new EquPlanPerson();
|
|
|
|
|
|
|
|
equPlanPerson.setPlanCode(plan.getPlanCode());
|
|
|
|
|
|
|
|
List<EquPlanPerson> persons = equPlanPersonMapper.selectEquPlanPersonList(equPlanPerson);
|
|
|
|
|
|
|
|
|
|
|
|
for(EquPlanPerson person:persons){
|
|
|
|
for (EquPlanPerson person : persons) {
|
|
|
|
person.setId(IdUtils.fastSimpleUUID());
|
|
|
|
person.setId(IdUtils.fastSimpleUUID());
|
|
|
|
person.setCreateTime(nowtime);
|
|
|
|
person.setCreateTime(nowtime);
|
|
|
|
person.setCreateBy(createBy);
|
|
|
|
person.setCreateBy(createBy);
|
|
|
|
person.setDelFlag("0");
|
|
|
|
person.setDelFlag("0");
|
|
|
|
person.setPlanCode(orderCode);
|
|
|
|
person.setPlanCode(orderCode);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
if(!CollectionUtils.isEmpty(persons)) {
|
|
|
|
if (!CollectionUtils.isEmpty(persons)) {
|
|
|
|
sce = equOrderPersonMapper.insertEquOrderPlans(persons);
|
|
|
|
sce = equOrderPersonMapper.insertEquOrderPersons(persons);
|
|
|
|
System.out.println(plan.getPlanCode() + "========equ_order_standard:" + sce);
|
|
|
|
System.out.println(plan.getPlanCode() + "========equ_order_person:" + sce);
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
return sce;
|
|
|
|
return sce;
|
|
|
|
}
|
|
|
|
}
|
|
|
|