点检、巡检、保养逻辑优化

highway
wws 1 year ago
parent 52b3bc3a83
commit c3f27a0b37

@ -145,6 +145,36 @@ public class EquPlan extends BaseEntity {
private String shutDown; private String shutDown;
private String planEquId; private String planEquId;
private List<Date> loopStartArray;
private Date loopStart;
private Date loopEnd;
public Date getLoopEnd() {
return loopEnd;
}
public void setLoopEnd(Date loopEnd) {
this.loopEnd = loopEnd;
}
public Date getLoopStart() {
return loopStart;
}
public void setLoopStart(Date loopStart) {
this.loopStart = loopStart;
}
public List<Date> getLoopStartArray() {
return loopStartArray;
}
public void setLoopStartArray(List<Date> loopStartArray) {
this.loopStartArray = loopStartArray;
}
public String getPlanEquId() { public String getPlanEquId() {
return planEquId; return planEquId;
} }

@ -95,6 +95,10 @@ public class EquPlanServiceImpl implements IEquPlanService {
equPlan.setUpdateTimeEnd(formatter.format(equPlan.getUpdateTimeArray().get(1))); equPlan.setUpdateTimeEnd(formatter.format(equPlan.getUpdateTimeArray().get(1)));
} }
} }
if (equPlan.getLoopStartArray() != null) {
equPlan.setLoopStart(equPlan.getLoopStartArray().get(0));
equPlan.setLoopEnd(equPlan.getLoopStartArray().get(1));
}
List<EquPlan> equPlans = equPlanMapper.selectEquPlanList(equPlan); List<EquPlan> equPlans = equPlanMapper.selectEquPlanList(equPlan);
//获取当前所选工厂 //获取当前所选工厂
@ -140,8 +144,10 @@ public class EquPlanServiceImpl implements IEquPlanService {
equPlan.setPlanId(IdUtils.fastSimpleUUID()); equPlan.setPlanId(IdUtils.fastSimpleUUID());
equPlan.setPlanCode((DateUtils.dateTimeNow(DateUtils.YYYYMMDD) + planSerialNum)); equPlan.setPlanCode((DateUtils.dateTimeNow(DateUtils.YYYYMMDD) + planSerialNum));
equPlan.setPlanLoopStart(equPlan.getPlanTimeArray().get(0)); if (equPlan.getPlanTimeArray().size() > 0) {
equPlan.setPlanLoopEnd(equPlan.getPlanTimeArray().get(1)); equPlan.setPlanLoopStart(equPlan.getPlanTimeArray().get(0));
equPlan.setPlanLoopEnd(equPlan.getPlanTimeArray().get(1));
}
equPlan.setFactoryCode(factory); equPlan.setFactoryCode(factory);
equPlan.setCreateBy(SecurityContextHolder.getUserName()); equPlan.setCreateBy(SecurityContextHolder.getUserName());
equPlan.setCreateTime(DateUtils.getNowDate()); equPlan.setCreateTime(DateUtils.getNowDate());

@ -121,23 +121,24 @@ public class EquUpkeepOrderServiceImpl implements IEquUpkeepOrderService {
// 生成工单-备件 // 生成工单-备件
List<EquOrderEquSpare> spareList = new ArrayList<>(); List<EquOrderEquSpare> spareList = new ArrayList<>();
List<EquPlanEquSpare> equSpareList = equPlanEqu.getSpareList(); List<EquPlanEquSpare> equSpareList = equPlanEqu.getSpareList();
for (EquPlanEquSpare spare : equSpareList) { if (equSpareList != null) {
EquOrderEquSpare spareTemp = new EquOrderEquSpare(); for (EquPlanEquSpare spare : equSpareList) {
BeanUtils.copyProperties(spare,spareTemp); EquOrderEquSpare spareTemp = new EquOrderEquSpare();
spareTemp.setId(IdUtils.fastSimpleUUID()); BeanUtils.copyProperties(spare,spareTemp);
spareTemp.setOrderCode(equOrder.getOrderCode()); spareTemp.setId(IdUtils.fastSimpleUUID());
spareTemp.setParentCode(equ.getId()); spareTemp.setOrderCode(equOrder.getOrderCode());
spareTemp.setFactoryCode(factory); spareTemp.setParentCode(equ.getId());
spareTemp.setCreateBy(SecurityContextHolder.getUserName()); spareTemp.setFactoryCode(factory);
spareTemp.setCreateTime(DateUtils.getNowDate()); spareTemp.setCreateBy(SecurityContextHolder.getUserName());
spareTemp.setUpdateBy(SecurityContextHolder.getUserName()); spareTemp.setCreateTime(DateUtils.getNowDate());
spareTemp.setUpdateTime(DateUtils.getNowDate()); spareTemp.setUpdateBy(SecurityContextHolder.getUserName());
// 插入备件信息 spareTemp.setUpdateTime(DateUtils.getNowDate());
equOrderEquSpareMapper.insertEquOrderEquSpare(spareTemp); // 插入备件信息
spareList.add(spareTemp); equOrderEquSpareMapper.insertEquOrderEquSpare(spareTemp);
spareList.add(spareTemp);
}
} }
// 备件置入
System.out.println(spareList);
// 生成工单-设备-保养项 // 生成工单-设备-保养项
List<EquPlanDetail> detailList = equPlanEqu.getEquPlanDetailList(); List<EquPlanDetail> detailList = equPlanEqu.getEquPlanDetailList();

@ -73,6 +73,8 @@
<if test="upkeep != null and upkeep != ''"> and upkeep = #{upkeep}</if> <if test="upkeep != null and upkeep != ''"> and upkeep = #{upkeep}</if>
<if test="calculationRule != null and calculationRule != ''"> and calculation_rule = #{calculationRule}</if> <if test="calculationRule != null and calculationRule != ''"> and calculation_rule = #{calculationRule}</if>
<if test="shutDown != null and shutDown != ''"> and shut_down = #{shutDown}</if> <if test="shutDown != null and shutDown != ''"> and shut_down = #{shutDown}</if>
<if test="loopStart != null "> and CONVERT(date,plan_loop_start) >= #{loopStart}</if>
<if test="loopEnd != null "> and #{loopEnd} >= CONVERT(date,plan_loop_start)</if>
and del_flag = '0' and del_flag = '0'
</where> </where>
</select> </select>

Loading…
Cancel
Save