委外保养定时任务逻辑修改

highway
wws 1 year ago
parent 170a3926a8
commit 8659dd8f11

@ -1,5 +1,9 @@
package com.op.device.controller; package com.op.device.controller;
import com.op.common.core.web.domain.AjaxResult;
import com.op.device.service.IDeviceInterfaceService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping; import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController; import org.springframework.web.bind.annotation.RestController;
@ -13,4 +17,17 @@ import org.springframework.web.bind.annotation.RestController;
@RequestMapping("/deviceInterface") @RequestMapping("/deviceInterface")
public class DeviceInterfaceController { public class DeviceInterfaceController {
@Autowired
private IDeviceInterfaceService deviceInterfaceService;
/**
*
* @return
*/
@GetMapping("/getRepairWorkOrder")
public AjaxResult getRepairWorkOrder() {
return deviceInterfaceService.getRepairWorkOrder();
}
} }

@ -0,0 +1,5 @@
package com.op.device.domain.dto;
// 看板传参实体
public class InterfaceDTO {
}

@ -0,0 +1,6 @@
package com.op.device.domain.vo;
// 看板维修工单返回VO
public class IRepairWorkOrderVO {
}

@ -161,4 +161,10 @@ public interface EquOrderMapper {
* @param orderIds * @param orderIds
*/ */
void delEquOrderByOrderIds(String[] orderIds); void delEquOrderByOrderIds(String[] orderIds);
/**
* Code
* @param repairCode
*/
void updateEquOrderStatusComplete(String repairCode);
} }

@ -1,7 +1,15 @@
package com.op.device.service; package com.op.device.service;
import com.op.common.core.web.domain.AjaxResult;
/** /**
* *
*/ */
public interface IDeviceInterfaceService { public interface IDeviceInterfaceService {
/**
*
* @return
*/
AjaxResult getRepairWorkOrder();
} }

@ -1,11 +1,38 @@
package com.op.device.service.impl; package com.op.device.service.impl;
import com.baomidou.dynamic.datasource.annotation.DS;
import com.op.common.core.web.domain.AjaxResult;
import com.op.device.domain.EquRepairWorkOrder;
import com.op.device.mapper.EquRepairWorkOrderMapper;
import com.op.device.service.IDeviceInterfaceService; import com.op.device.service.IDeviceInterfaceService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
import java.util.List;
import static com.op.common.core.web.domain.AjaxResult.success;
/** /**
* *
*/ */
@Service @Service
public class DeviceInterfaceServiceImpl implements IDeviceInterfaceService { public class DeviceInterfaceServiceImpl implements IDeviceInterfaceService {
@Autowired
private EquRepairWorkOrderMapper equRepairWorkOrderMapper;
/**
*
* @return
*/
@Override
@DS("#header.poolName")
public AjaxResult getRepairWorkOrder() {
// 获取待维修的工单
EquRepairWorkOrder workTemp = new EquRepairWorkOrder();
workTemp.setWorkStatus("0");
List<EquRepairWorkOrder> workOrderList = equRepairWorkOrderMapper.selectEquRepairWorkOrderList(workTemp);
// EquRepairWorkOrder workOrder = equRepairWorkOrderMapper.selectWaitingWorkOrder();
return success(workOrderList);
}
} }

@ -160,11 +160,9 @@ public class DeviceTaskServiceImpl implements IDeviceTaskService {
new LinkedBlockingQueue<Runnable>()); new LinkedBlockingQueue<Runnable>());
try { try {
dateSources.forEach(dateSource -> { dateSources.forEach(dateSource -> {
if("ds_1000".equals(dateSource.get("poolName"))){//TODO生产去掉
logger.info("++++++++++++" + dateSource.get("poolName") + "++++保养开始++++++++++"); logger.info("++++++++++++" + dateSource.get("poolName") + "++++保养开始++++++++++");
Runnable run = () -> createMaintenancePlanFunc(dateSource.get("poolName")); Runnable run = () -> createMaintenancePlanFunc(dateSource.get("poolName"));
executorService.execute(run); executorService.execute(run);
}
}); });
} catch (Exception e) { } catch (Exception e) {
logger.error("service == dataClearTask == exception", e); logger.error("service == dataClearTask == exception", e);
@ -298,10 +296,10 @@ public class DeviceTaskServiceImpl implements IDeviceTaskService {
sparePartsLedgerMapper.updateSpareNumReduce(apply); sparePartsLedgerMapper.updateSpareNumReduce(apply);
} }
if(!CollectionUtils.isEmpty(spares)){ // if(!CollectionUtils.isEmpty(spares)){
sce = equOrderEquSpareMapper.insertEquOrderEquSpares(spares); // sce = equOrderEquSpareMapper.insertEquOrderEquSpares(spares);
System.out.println(plan.getPlanCode()+"========equ_spare_apply:"+sce); // System.out.println(plan.getPlanCode()+"========equ_spare_apply:"+sce);
} // }
/**equ_plan_detail->equ_order_detail*******************************************************/ /**equ_plan_detail->equ_order_detail*******************************************************/
@ -348,12 +346,12 @@ public class DeviceTaskServiceImpl implements IDeviceTaskService {
EquOutsourceWork equOutsourceWork = new EquOutsourceWork(); EquOutsourceWork equOutsourceWork = new EquOutsourceWork();
BeanUtils.copyProperties(plan,equOutsourceWork); BeanUtils.copyProperties(plan,equOutsourceWork);
equOutsourceWork.setWorkId(IdUtils.fastSimpleUUID()); equOutsourceWork.setWorkId(IdUtils.fastSimpleUUID());
equOutsourceWork.setOrderCode(orderCode);
equOutsourceWork.setWorkCode(order.getOutsourceCode()); equOutsourceWork.setWorkCode(order.getOutsourceCode());
equOutsourceWork.setWorkType("1");//1委外保养0委外维修 equOutsourceWork.setWorkType("1");//1委外保养0委外维修
equOutsourceWork.setCreateBy(createBy); equOutsourceWork.setCreateBy(createBy);
equOutsourceWork.setCreateTime(nowtime); equOutsourceWork.setCreateTime(nowtime);
equOutsourceWork.setDelFlag("0"); equOutsourceWork.setDelFlag("0");
equOutsourceWork.setRepairCode(orderCode);
sce = equOutsourceWorkMapper.insertEquOutsourceWork(equOutsourceWork); sce = equOutsourceWorkMapper.insertEquOutsourceWork(equOutsourceWork);
System.out.println(plan.getPlanCode() + "========equ_outsource_work:" + sce); System.out.println(plan.getPlanCode() + "========equ_outsource_work:" + sce);
}else { }else {

@ -7,6 +7,7 @@ import com.op.common.core.utils.DateUtils;
import com.op.common.core.utils.uuid.IdUtils; import com.op.common.core.utils.uuid.IdUtils;
import com.op.common.security.utils.SecurityUtils; import com.op.common.security.utils.SecurityUtils;
import com.op.device.domain.EquRepairWorkOrder; import com.op.device.domain.EquRepairWorkOrder;
import com.op.device.mapper.EquOrderMapper;
import com.op.device.mapper.EquRepairWorkOrderMapper; import com.op.device.mapper.EquRepairWorkOrderMapper;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
@ -32,6 +33,9 @@ public class EquOutsourceWorkServiceImpl implements IEquOutsourceWorkService {
@Autowired @Autowired
private EquRepairWorkOrderMapper equRepairWorkOrderMapper; private EquRepairWorkOrderMapper equRepairWorkOrderMapper;
@Autowired
private EquOrderMapper equOrderMapper;
/** /**
* *
@ -95,6 +99,8 @@ public class EquOutsourceWorkServiceImpl implements IEquOutsourceWorkService {
if(equOutsourceWork.getWorkStatus().equals("1")){ if(equOutsourceWork.getWorkStatus().equals("1")){
//更新维修工单状态 //更新维修工单状态
equRepairWorkOrderMapper.updateWorkStatus(equOutsourceWork.getRepairCode()); equRepairWorkOrderMapper.updateWorkStatus(equOutsourceWork.getRepairCode());
//更新保养工单状态
equOrderMapper.updateEquOrderStatusComplete(equOutsourceWork.getRepairCode());
} }
equOutsourceWork.setUpdateTime(DateUtils.getNowDate()); equOutsourceWork.setUpdateTime(DateUtils.getNowDate());
equOutsourceWork.setUpdateBy(SecurityUtils.getUsername()); equOutsourceWork.setUpdateBy(SecurityUtils.getUsername());

@ -142,7 +142,7 @@ public class EquSpareApplyServiceImpl implements IEquSpareApplyService {
} }
/** /**
* TODO *
* *
* @param applyIds * @param applyIds
* @return * @return

@ -105,6 +105,7 @@
<if test="updateTime != null">#{updateTime},</if> <if test="updateTime != null">#{updateTime},</if>
</trim> </trim>
</insert> </insert>
<insert id="insertEquOrderEquSpares"> <insert id="insertEquOrderEquSpares">
insert into equ_order_equ_spare( insert into equ_order_equ_spare(
id, order_code, material_code, material_desc, id, order_code, material_code, material_desc,

@ -350,4 +350,12 @@
where order_id = #{orderId} where order_id = #{orderId}
</update> </update>
<update id="updateEquOrderStatusComplete" parameterType="String">
update equ_order
set
order_status = '1'
where order_code = #{repairCode}
and del_flag = '0'
</update>
</mapper> </mapper>

Loading…
Cancel
Save