计划新增-parentCode存放上级id

highway
wws 1 year ago
parent 5ff08114f2
commit 5bf8279617

@ -116,11 +116,11 @@ public class DevicePDAServiceImpl implements IDevicePDAService {
order.setWorkCenterName(equOrderMapper.selectCenterNameByCenterCode(order.getPlanWorkshop())); order.setWorkCenterName(equOrderMapper.selectCenterNameByCenterCode(order.getPlanWorkshop()));
EquOrderEqu equ = equOrderEquMapper.selectEquOrderEquListByParentCode(order.getOrderCode()); EquOrderEqu equ = equOrderEquMapper.selectEquOrderEquListByParentCode(order.getOrderId());
List<EquOrderDetail> detailList = equOrderDetailMapper.selectEquOrderDetailByParentCode(equ.getCode()); List<EquOrderDetail> detailList = equOrderDetailMapper.selectEquOrderDetailByParentCode(equ.getId());
for (EquOrderDetail detail : detailList) { for (EquOrderDetail detail : detailList) {
List<EquOrderStandard> standardList = equOrderStandardMapper.selectEquOrderStandardByParentCode(detail.getCode()); List<EquOrderStandard> standardList = equOrderStandardMapper.selectEquOrderStandardByParentCode(detail.getId());
detail.setStandardList(standardList); detail.setStandardList(standardList);
} }
equ.setDetailList(detailList); equ.setDetailList(detailList);

@ -72,16 +72,16 @@ public class EquOrderServiceImpl implements IEquOrderService {
order.setWorkCenterName(equOrderMapper.selectCenterNameByCenterCode(order.getPlanWorkshop())); order.setWorkCenterName(equOrderMapper.selectCenterNameByCenterCode(order.getPlanWorkshop()));
EquOrderEqu equ = equOrderEquMapper.selectEquOrderEquListByParentCode(order.getOrderCode()); EquOrderEqu equ = equOrderEquMapper.selectEquOrderEquListByParentCode(order.getOrderId());
List<EquOrderDetail> detailList = equOrderDetailMapper.selectEquOrderDetailByParentCode(equ.getCode()); List<EquOrderDetail> detailList = equOrderDetailMapper.selectEquOrderDetailByParentCode(equ.getId());
for (EquOrderDetail detail : detailList) { for (EquOrderDetail detail : detailList) {
List<EquOrderStandard> standardList = equOrderStandardMapper.selectEquOrderStandardByParentCode(detail.getCode()); List<EquOrderStandard> standardList = equOrderStandardMapper.selectEquOrderStandardByParentCode(detail.getId());
detail.setStandardList(standardList); detail.setStandardList(standardList);
} }
equ.setDetailList(detailList); equ.setDetailList(detailList);
List<EquOrderEquSpare> spareList = equOrderEquSpareMapper.selectEquOrderEquSpareByParentCode(equ.getCode()); List<EquOrderEquSpare> spareList = equOrderEquSpareMapper.selectEquOrderEquSpareByParentCode(equ.getId());
if (spareList.size() > 0) { if (spareList.size() > 0) {
equ.setSpareList(spareList); equ.setSpareList(spareList);
} }
@ -113,7 +113,7 @@ public class EquOrderServiceImpl implements IEquOrderService {
public List<EquOrder> selectEquOrderList(EquOrder equOrder) { public List<EquOrder> selectEquOrderList(EquOrder equOrder) {
List<EquOrder> orderList = equOrderMapper.selectEquOrderList(equOrder); List<EquOrder> orderList = equOrderMapper.selectEquOrderList(equOrder);
for (EquOrder order : orderList) { for (EquOrder order : orderList) {
EquOrderEqu equ = equOrderEquMapper.selectEquOrderEquListByParentCode(order.getOrderCode()); EquOrderEqu equ = equOrderEquMapper.selectEquOrderEquListByParentCode(order.getOrderId());
order.setEquipmentCode(equ.getEquipmentCode()); order.setEquipmentCode(equ.getEquipmentCode());
order.setEquipmentName(equ.getEquipmentName()); order.setEquipmentName(equ.getEquipmentName());
} }

@ -349,10 +349,10 @@ public class EquPlanServiceImpl implements IEquPlanService {
for (EquPlanEqu equipment : equipmentList) { for (EquPlanEqu equipment : equipmentList) {
// 获取检查项list // 获取检查项list
List<EquPlanDetail> detailList = equPlanDetailMapper.selectEquPlanDetailListByParentCode(equipment.getCode()); List<EquPlanDetail> detailList = equPlanDetailMapper.selectEquPlanDetailListByParentCode(equipment.getId());
for (EquPlanDetail detail : detailList) { for (EquPlanDetail detail : detailList) {
// 获取标准list // 获取标准list
List<EquPlanStandard> standardList = equPlanStandardMapper.selectEquPlanStandardListByParentCode(detail.getCode()); List<EquPlanStandard> standardList = equPlanStandardMapper.selectEquPlanStandardListByParentCode(detail.getId());
for (EquPlanStandard standard : standardList) { for (EquPlanStandard standard : standardList) {
standard.setShowFlag(true); standard.setShowFlag(true);
} }
@ -365,7 +365,7 @@ public class EquPlanServiceImpl implements IEquPlanService {
equipment.setEquPlanDetailList(detailList); equipment.setEquPlanDetailList(detailList);
EquPlanEquSpare spare = new EquPlanEquSpare(); EquPlanEquSpare spare = new EquPlanEquSpare();
spare.setParentCode(equipment.getCode()); spare.setParentCode(equipment.getId());
// 备件信息 // 备件信息
List<EquPlanEquSpare> spareList = equPlanEquSpareMapper.selectEquPlanEquSpareList(spare); List<EquPlanEquSpare> spareList = equPlanEquSpareMapper.selectEquPlanEquSpareList(spare);
if (spareList.size() > 0) { if (spareList.size() > 0) {

@ -111,8 +111,7 @@ public class EquUpkeepOrderServiceImpl implements IEquUpkeepOrderService {
EquPlanEqu equPlanEqu = equPlanEquList.get(0); EquPlanEqu equPlanEqu = equPlanEquList.get(0);
BeanUtils.copyProperties(equPlanEqu,equ); BeanUtils.copyProperties(equPlanEqu,equ);
equ.setId(IdUtils.fastSimpleUUID()); equ.setId(IdUtils.fastSimpleUUID());
equ.setCode("E"+DateUtils.dateTimeNow(DateUtils.YYYYMMDD)+"001"); equ.setParentCode(equOrder.getOrderId());
equ.setParentCode(equOrder.getOrderCode());
equ.setOrderCode(equOrder.getOrderCode()); equ.setOrderCode(equOrder.getOrderCode());
equ.setFactoryCode(factory); equ.setFactoryCode(factory);
equ.setAttr1(""); equ.setAttr1("");
@ -122,13 +121,12 @@ 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();
int spareSerialNum = 0;
for (EquPlanEquSpare spare : equSpareList) { for (EquPlanEquSpare spare : equSpareList) {
EquOrderEquSpare spareTemp = new EquOrderEquSpare(); EquOrderEquSpare spareTemp = new EquOrderEquSpare();
BeanUtils.copyProperties(spare,spareTemp); BeanUtils.copyProperties(spare,spareTemp);
spareTemp.setId(IdUtils.fastSimpleUUID()); spareTemp.setId(IdUtils.fastSimpleUUID());
spareTemp.setOrderCode(equOrder.getOrderCode()); spareTemp.setOrderCode(equOrder.getOrderCode());
spareTemp.setParentCode(equ.getCode()); spareTemp.setParentCode(equ.getId());
spareTemp.setFactoryCode(factory); spareTemp.setFactoryCode(factory);
spareTemp.setCreateBy(SecurityContextHolder.getUserName()); spareTemp.setCreateBy(SecurityContextHolder.getUserName());
spareTemp.setCreateTime(DateUtils.getNowDate()); spareTemp.setCreateTime(DateUtils.getNowDate());
@ -143,16 +141,14 @@ public class EquUpkeepOrderServiceImpl implements IEquUpkeepOrderService {
// 生成工单-设备-保养项 // 生成工单-设备-保养项
List<EquPlanDetail> detailList = equPlanEqu.getEquPlanDetailList(); List<EquPlanDetail> detailList = equPlanEqu.getEquPlanDetailList();
int detailSerialNum = 0;
for (EquPlanDetail detail : detailList) { for (EquPlanDetail detail : detailList) {
EquOrderDetail equOrderDetail = new EquOrderDetail(); EquOrderDetail equOrderDetail = new EquOrderDetail();
List<EquOrderStandard> orderStandardList = new ArrayList<>(); List<EquOrderStandard> orderStandardList = new ArrayList<>();
List<EquPlanStandard> standardList = detail.getEquPlanStandardList(); List<EquPlanStandard> standardList = detail.getEquPlanStandardList();
BeanUtils.copyProperties(detail,equOrderDetail); BeanUtils.copyProperties(detail,equOrderDetail);
equOrderDetail.setId(IdUtils.fastSimpleUUID()); equOrderDetail.setId(IdUtils.fastSimpleUUID());
equOrderDetail.setCode("C"+DateUtils.dateTimeNow(DateUtils.YYYYMMDD)+String.format("%03d",++detailSerialNum));
equOrderDetail.setOrderCode(equOrder.getOrderCode()); equOrderDetail.setOrderCode(equOrder.getOrderCode());
equOrderDetail.setParentCode(equ.getCode()); equOrderDetail.setParentCode(equ.getId());
equOrderDetail.setFactroyCode(factory); equOrderDetail.setFactroyCode(factory);
equOrderDetail.setStandardList(orderStandardList); equOrderDetail.setStandardList(orderStandardList);
equOrderDetail.setCreateBy(SecurityContextHolder.getUserName()); equOrderDetail.setCreateBy(SecurityContextHolder.getUserName());
@ -166,7 +162,7 @@ public class EquUpkeepOrderServiceImpl implements IEquUpkeepOrderService {
EquOrderStandard orderStandard = new EquOrderStandard(); EquOrderStandard orderStandard = new EquOrderStandard();
BeanUtils.copyProperties(standard,orderStandard); BeanUtils.copyProperties(standard,orderStandard);
orderStandard.setId(IdUtils.fastSimpleUUID()); orderStandard.setId(IdUtils.fastSimpleUUID());
orderStandard.setParentCode(equOrderDetail.getCode()); orderStandard.setParentCode(equOrderDetail.getId());
orderStandard.setOrderCode(equOrder.getOrderCode()); orderStandard.setOrderCode(equOrder.getOrderCode());
orderStandard.setCreateBy(SecurityContextHolder.getUserName()); orderStandard.setCreateBy(SecurityContextHolder.getUserName());
orderStandard.setCreateTime(DateUtils.getNowDate()); orderStandard.setCreateTime(DateUtils.getNowDate());
@ -182,7 +178,6 @@ public class EquUpkeepOrderServiceImpl implements IEquUpkeepOrderService {
for (SysUser user : personList) { for (SysUser user : personList) {
EquOrderPerson equOrderPerson = new EquOrderPerson(); EquOrderPerson equOrderPerson = new EquOrderPerson();
equOrderPerson.setId(IdUtils.fastSimpleUUID()); equOrderPerson.setId(IdUtils.fastSimpleUUID());
// TODO 要改变编码格式
equOrderPerson.setOrderCode(equOrder.getOrderCode()); equOrderPerson.setOrderCode(equOrder.getOrderCode());
equOrderPerson.setFactoryCode(factory); equOrderPerson.setFactoryCode(factory);
equOrderPerson.setUserId(user.getUserId()); equOrderPerson.setUserId(user.getUserId());

@ -247,7 +247,7 @@ public class EquUpkeepServiceImpl implements IEquUpkeepService {
equipment.setId(IdUtils.fastSimpleUUID()); equipment.setId(IdUtils.fastSimpleUUID());
equipment.setPlanCode(equPlan.getPlanCode()); equipment.setPlanCode(equPlan.getPlanCode());
equipment.setCode("E" + equPlan.getPlanCode() + String.format("%02d", ++equipmentCodeTemp)); equipment.setCode("E" + equPlan.getPlanCode() + String.format("%02d", ++equipmentCodeTemp));
equipment.setParentCode(equPlan.getPlanCode()); equipment.setParentCode(equPlan.getPlanId());
equipment.setFactoryCode(factory); equipment.setFactoryCode(factory);
equipment.setCreateBy(SecurityContextHolder.getUserName()); equipment.setCreateBy(SecurityContextHolder.getUserName());
equipment.setCreateTime(DateUtils.getNowDate()); equipment.setCreateTime(DateUtils.getNowDate());
@ -266,7 +266,7 @@ public class EquUpkeepServiceImpl implements IEquUpkeepService {
item.setId(IdUtils.fastSimpleUUID()); item.setId(IdUtils.fastSimpleUUID());
item.setPlanCode(equPlan.getPlanCode()); item.setPlanCode(equPlan.getPlanCode());
item.setCode("C" + equipment.getCode() + String.format("%02d", ++itemCodeTemp)); item.setCode("C" + equipment.getCode() + String.format("%02d", ++itemCodeTemp));
item.setParentCode(equipment.getCode()); item.setParentCode(equipment.getId());
item.setCreateBy(SecurityContextHolder.getUserName()); item.setCreateBy(SecurityContextHolder.getUserName());
item.setCreateTime(DateUtils.getNowDate()); item.setCreateTime(DateUtils.getNowDate());
item.setUpdateBy(SecurityContextHolder.getUserName()); item.setUpdateBy(SecurityContextHolder.getUserName());
@ -285,7 +285,7 @@ public class EquUpkeepServiceImpl implements IEquUpkeepService {
checkInsert = true; checkInsert = true;
standard.setId(IdUtils.fastSimpleUUID()); standard.setId(IdUtils.fastSimpleUUID());
standard.setParentCode(item.getCode()); standard.setParentCode(item.getId());
standard.setPlanCode(equPlan.getPlanCode()); standard.setPlanCode(equPlan.getPlanCode());
standard.setCreateBy(SecurityContextHolder.getUserName()); standard.setCreateBy(SecurityContextHolder.getUserName());
standard.setCreateTime(DateUtils.getNowDate()); standard.setCreateTime(DateUtils.getNowDate());
@ -318,7 +318,7 @@ public class EquUpkeepServiceImpl implements IEquUpkeepService {
for (EquPlanEquSpare spare : spareList) { for (EquPlanEquSpare spare : spareList) {
spare.setId(IdUtils.fastSimpleUUID()); spare.setId(IdUtils.fastSimpleUUID());
spare.setPlanCode(equPlan.getPlanCode()); spare.setPlanCode(equPlan.getPlanCode());
spare.setParentCode(equipment.getCode()); spare.setParentCode(equipment.getId());
spare.setFactoryCode(factory); spare.setFactoryCode(factory);
spare.setCreateBy(SecurityContextHolder.getUserName()); spare.setCreateBy(SecurityContextHolder.getUserName());
spare.setCreateTime(DateUtils.getNowDate()); spare.setCreateTime(DateUtils.getNowDate());

@ -62,12 +62,12 @@ public class InspectionWorkServiceImpl implements IInspectionWorkService {
// 替换循环周期 // 替换循环周期
order.setPlanLoopType(equOrderMapper.changeLoopType(order.getPlanLoopType())); order.setPlanLoopType(equOrderMapper.changeLoopType(order.getPlanLoopType()));
Equipment equipment = equipmentMapper.selectEquipmentByEquipmentCode(equOrderEquMapper.selectEquOrderEquListByParentCode(order.getOrderCode()).getEquipmentCode()); Equipment equipment = equipmentMapper.selectEquipmentByEquipmentCode(equOrderEquMapper.selectEquOrderEquListByParentCode(order.getOrderId()).getEquipmentCode());
// 查询检查项、标准 // 查询检查项、标准
List<EquOrderDetail> detailList = equOrderDetailMapper.selectEquOrderDetailByOrderCode(order.getOrderCode()); List<EquOrderDetail> detailList = equOrderDetailMapper.selectEquOrderDetailByOrderCode(order.getOrderCode());
for (EquOrderDetail detail : detailList) { for (EquOrderDetail detail : detailList) {
List<EquOrderStandard> standardList = equOrderStandardMapper.selectEquOrderStandardByParentCode(detail.getCode()); List<EquOrderStandard> standardList = equOrderStandardMapper.selectEquOrderStandardByParentCode(detail.getId());
for (EquOrderStandard standard : standardList) { for (EquOrderStandard standard : standardList) {
if (standard.getStandardType().equals("quantify")){ if (standard.getStandardType().equals("quantify")){
standard.setStandardTypeName("定量"); standard.setStandardTypeName("定量");

@ -26,7 +26,6 @@
<result property="createTime" column="create_time" /> <result property="createTime" column="create_time" />
<result property="updateBy" column="update_by" /> <result property="updateBy" column="update_by" />
<result property="updateTime" column="update_time" /> <result property="updateTime" column="update_time" />
<result property="picturePath" column="picture_path" />
<result property="errorFlag" column="error_flag" /> <result property="errorFlag" column="error_flag" />
<result property="faultType" column="fault_type" /> <result property="faultType" column="fault_type" />
<result property="repairReach" column="repair_reach" /> <result property="repairReach" column="repair_reach" />
@ -38,7 +37,7 @@
</resultMap> </resultMap>
<sql id="selectEquOrderStandardVo"> <sql id="selectEquOrderStandardVo">
select id, code, parent_code, order_code, standard_type, standard_name, detail_up_limit, detail_down_limit, detail_unit, detail_reach, actual_value, detail_error, factory_code, attr1, attr2, attr3, del_flag, create_by, create_time, update_by, update_time,picture_path,error_flag,fault_type,repair_reach,repair_value,repair_picture from equ_order_standard select id, code, parent_code, order_code, standard_type, standard_name, detail_up_limit, detail_down_limit, detail_unit, detail_reach, actual_value, detail_error, factory_code, attr1, attr2, attr3, del_flag, create_by, create_time, update_by, update_time,error_flag,fault_type,repair_reach,repair_value,repair_picture from equ_order_standard
</sql> </sql>
<select id="selectEquOrderStandardList" parameterType="EquOrderStandard" resultMap="EquOrderStandardResult"> <select id="selectEquOrderStandardList" parameterType="EquOrderStandard" resultMap="EquOrderStandardResult">
@ -59,7 +58,6 @@
<if test="attr1 != null and attr1 != ''"> and attr1 = #{attr1}</if> <if test="attr1 != null and attr1 != ''"> and attr1 = #{attr1}</if>
<if test="attr2 != null and attr2 != ''"> and attr2 = #{attr2}</if> <if test="attr2 != null and attr2 != ''"> and attr2 = #{attr2}</if>
<if test="attr3 != null and attr3 != ''"> and attr3 = #{attr3}</if> <if test="attr3 != null and attr3 != ''"> and attr3 = #{attr3}</if>
<if test="picturePath != null and picturePath != ''"> and picture_path = #{picturePath}</if>
<if test="errorFlag != null and errorFlag != ''"> and error_flag = #{errorFlag}</if> <if test="errorFlag != null and errorFlag != ''"> and error_flag = #{errorFlag}</if>
<if test="faultType != null and faultType != ''"> and fault_type = #{faultType}</if> <if test="faultType != null and faultType != ''"> and fault_type = #{faultType}</if>
<if test="repairReach != null and repairReach != ''"> and repair_reach = #{repairReach}</if> <if test="repairReach != null and repairReach != ''"> and repair_reach = #{repairReach}</if>
@ -103,7 +101,6 @@
<if test="createTime != null">create_time,</if> <if test="createTime != null">create_time,</if>
<if test="updateBy != null and updateBy != ''">update_by,</if> <if test="updateBy != null and updateBy != ''">update_by,</if>
<if test="updateTime != null">update_time,</if> <if test="updateTime != null">update_time,</if>
<if test="picturePath != null">picture_path,</if>
<if test="errorFlag != null">error_flag,</if> <if test="errorFlag != null">error_flag,</if>
<if test="faultType != null">fault_type,</if> <if test="faultType != null">fault_type,</if>
<if test="repairReach != null">repair_reach,</if> <if test="repairReach != null">repair_reach,</if>
@ -132,7 +129,6 @@
<if test="createTime != null">#{createTime},</if> <if test="createTime != null">#{createTime},</if>
<if test="updateBy != null and updateBy != ''">#{updateBy},</if> <if test="updateBy != null and updateBy != ''">#{updateBy},</if>
<if test="updateTime != null">#{updateTime},</if> <if test="updateTime != null">#{updateTime},</if>
<if test="picturePath != null">#{picturePath},</if>
<if test="errorFlag != null">#{errorFlag},</if> <if test="errorFlag != null">#{errorFlag},</if>
<if test="faultType != null">#{faultType},</if> <if test="faultType != null">#{faultType},</if>
<if test="repairReach != null">#{repairReach},</if> <if test="repairReach != null">#{repairReach},</if>
@ -180,7 +176,6 @@
<if test="createTime != null">create_time = #{createTime},</if> <if test="createTime != null">create_time = #{createTime},</if>
<if test="updateBy != null and updateBy != ''">update_by = #{updateBy},</if> <if test="updateBy != null and updateBy != ''">update_by = #{updateBy},</if>
<if test="updateTime != null">update_time = #{updateTime},</if> <if test="updateTime != null">update_time = #{updateTime},</if>
<if test="picturePath != null">picture_path = #{picturePath},</if>
<if test="errorFlag != null">error_flag = #{errorFlag},</if> <if test="errorFlag != null">error_flag = #{errorFlag},</if>
<if test="faultType != null">fault_type = #{faultType},</if> <if test="faultType != null">fault_type = #{faultType},</if>
<if test="repairReach != null">repair_reach = #{repairReach},</if> <if test="repairReach != null">repair_reach = #{repairReach},</if>

Loading…
Cancel
Save