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

highway
wws 1 year ago
parent 52b3bc3a83
commit c3f27a0b37

@ -145,6 +145,36 @@ public class EquPlan extends BaseEntity {
private String shutDown;
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() {
return planEquId;
}

@ -95,6 +95,10 @@ public class EquPlanServiceImpl implements IEquPlanService {
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);
//获取当前所选工厂
@ -140,8 +144,10 @@ public class EquPlanServiceImpl implements IEquPlanService {
equPlan.setPlanId(IdUtils.fastSimpleUUID());
equPlan.setPlanCode((DateUtils.dateTimeNow(DateUtils.YYYYMMDD) + planSerialNum));
equPlan.setPlanLoopStart(equPlan.getPlanTimeArray().get(0));
equPlan.setPlanLoopEnd(equPlan.getPlanTimeArray().get(1));
if (equPlan.getPlanTimeArray().size() > 0) {
equPlan.setPlanLoopStart(equPlan.getPlanTimeArray().get(0));
equPlan.setPlanLoopEnd(equPlan.getPlanTimeArray().get(1));
}
equPlan.setFactoryCode(factory);
equPlan.setCreateBy(SecurityContextHolder.getUserName());
equPlan.setCreateTime(DateUtils.getNowDate());

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

@ -73,6 +73,8 @@
<if test="upkeep != null and upkeep != ''"> and upkeep = #{upkeep}</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="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'
</where>
</select>

Loading…
Cancel
Save