下机台获取-unlock

highway
zhaoxiaolin 12 months ago
parent 6f8a167d96
commit 8dfc341463

@ -68,5 +68,5 @@ public interface EquOrderPersonMapper {
*/ */
List<String> selectEquOrderPersonByOrderCode(String orderCode); List<String> selectEquOrderPersonByOrderCode(String orderCode);
int insertEquOrderPlans(@Param("list") List<EquPlanPerson> persons); int insertEquOrderPersons(@Param("list") List<EquPlanPerson> persons);
} }

@ -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("OW"+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,order);
equOutsourceWork.setWorkId(IdUtils.fastSimpleUUID());
equOutsourceWork.setWorkCode(order.getOutsourceCode());
equOutsourceWork.setCreateBy(createBy);
equOutsourceWork.setCreateTime(nowtime);
equOutsourceWork.setDelFlag("0");
for(EquPlanPerson person:persons){ //TODO;
person.setId(IdUtils.fastSimpleUUID()); sce = equOutsourceWorkMapper.insertEquOutsourceWork(equOutsourceWork);
person.setCreateTime(nowtime); System.out.println(plan.getPlanCode() + "========equ_outsource_work:" + sce);
person.setCreateBy(createBy); }else {
person.setDelFlag("0"); EquPlanPerson equPlanPerson = new EquPlanPerson();
person.setPlanCode(orderCode); equPlanPerson.setPlanCode(plan.getPlanCode());
} List<EquPlanPerson> persons = equPlanPersonMapper.selectEquPlanPersonList(equPlanPerson);
if(!CollectionUtils.isEmpty(persons)) {
sce = equOrderPersonMapper.insertEquOrderPlans(persons); for (EquPlanPerson person : persons) {
System.out.println(plan.getPlanCode() + "========equ_order_standard:" + sce); person.setId(IdUtils.fastSimpleUUID());
person.setCreateTime(nowtime);
person.setCreateBy(createBy);
person.setDelFlag("0");
person.setPlanCode(orderCode);
}
if (!CollectionUtils.isEmpty(persons)) {
sce = equOrderPersonMapper.insertEquOrderPersons(persons);
System.out.println(plan.getPlanCode() + "========equ_order_person:" + sce);
}
} }
return sce; return sce;
} }

@ -18,6 +18,10 @@
ep.calculation_rule calculationRule, ep.calculation_rule calculationRule,
ep.shut_down as 'shutDown', ep.shut_down as 'shutDown',
ep.upkeep, ep.upkeep,
ep.work_person workPerson,
ep.work_outsourcing_unit workOutsourcingUnit,
ep.work_connection workConnection,
ep.work_reason workReason,
epe.equipment_code equipmentCode, epe.equipment_code equipmentCode,
epe.equipment_name equipmentName, epe.equipment_name equipmentName,
epe.id planEquId epe.id planEquId

@ -82,7 +82,7 @@
<if test="updateTime != null">#{updateTime},</if> <if test="updateTime != null">#{updateTime},</if>
</trim> </trim>
</insert> </insert>
<insert id="insertEquOrderPlans"> <insert id="insertEquOrderPersons">
insert into equ_order_person insert into equ_order_person
( (
id, order_code, user_id, user_name, factory_code, id, order_code, user_id, user_name, factory_code,

@ -109,7 +109,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
bp.product_code productCode, bp.product_code productCode,
bp.product_model productModel, bp.product_model productModel,
w.prod_line_code prodLineCode w.prod_line_code prodLineCode
from pro_rfid_process_detail rfid from pro_rfid_process_detail rfid with (NOLOCK)
left join pro_process p on p.process_id = rfid.next_process_id left join pro_process p on p.process_id = rfid.next_process_id
left join pro_order_workorder w on w.workorder_code = rfid.workorder_code left join pro_order_workorder w on w.workorder_code = rfid.workorder_code
left join base_product bp on bp.product_code = w.product_code left join base_product bp on bp.product_code = w.product_code

@ -39,7 +39,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
bp.product_code productCode, bp.product_code productCode,
bp.product_model productModel, bp.product_model productModel,
w.prod_line_code prodLineCode w.prod_line_code prodLineCode
from pro_rfid_process_detail rfid from pro_rfid_process_detail rfid with (NOLOCK)
left join pro_process p on p.process_id = rfid.next_process_id left join pro_process p on p.process_id = rfid.next_process_id
left join pro_order_workorder w on w.workorder_code = rfid.workorder_code left join pro_order_workorder w on w.workorder_code = rfid.workorder_code
left join base_product bp on bp.product_code = w.product_code left join base_product bp on bp.product_code = w.product_code

Loading…
Cancel
Save