检验项目维护

philip 4 years ago
parent e4b71c31fb
commit 6112e89710

@ -2,6 +2,7 @@ package com.foreverwin.mesnac.common.service.impl;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.conditions.update.UpdateWrapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.foreverwin.mesnac.common.constant.Constants;
@ -90,11 +91,14 @@ public class InspectionItemServiceImpl extends ServiceImpl<InspectionItemMapper,
inspectionItem.setInspectionItemNo(inspectItemNoGenerationRules(inspectionItem));
}
if (inspectionItem.getInspectionType().length()>1){
inspectionItem.setCategory("RESOURCE");
inspectionItem.setCategory("EQ");
}else {
inspectionItem.setCategory("QUALITY");
inspectionItem.setCategory("QC");
}
inspectionItem.setSite(CommonMethods.getSite());
if (StringUtil.isBlank(inspectionItem.getRevision())){
inspectionItem.setRevision("1");
}
inspectionItem.setHandle(HandleEnum
.INSPECTION_ITEM.getHandle(inspectionItem.getSite(),inspectionItem.getInspectionItemNo(),inspectionItem.getRevision()));
//保存检验项目维护-副
@ -132,6 +136,15 @@ public class InspectionItemServiceImpl extends ServiceImpl<InspectionItemMapper,
}
//保存检验项目维护-主
if (inspectionItem.getCurrentRevision().equals(Constants.BOOL_TRUE)){
String inspectionItemNo = inspectionItem.getInspectionItemNo();
UpdateWrapper<InspectionItem> updateWrapper=new UpdateWrapper<>();
updateWrapper.eq(InspectionItem.INSPECTION_ITEM_NO,inspectionItemNo);
updateWrapper.eq(InspectionItem.SITE,inspectionItem.getSite());
updateWrapper.ne(InspectionItem.REVISION,inspectionItem.getRevision());
updateWrapper.set(InspectionItem.CURRENT_REVISION,Constants.BOOL_FALSE);
update(updateWrapper);
}
if(inspectionItem.selectById(inspectionItem.getHandle()) == null){
inspectionItem.setCreatedDateTime(LocalDateTime.now());
inspectionItem.setCreateUser(CommonMethods.getUser());
@ -150,9 +163,12 @@ public class InspectionItemServiceImpl extends ServiceImpl<InspectionItemMapper,
@Override
public void deleteServece(InspectionItem inspectionItem) {
if(StringUtil.isEmpty(inspectionItem.getInspectionItemNo())){
if(StringUtil.isBlank(inspectionItem.getInspectionItemNo())){
throw new BaseException("请输入编号");
}
if(StringUtil.isBlank(inspectionItem.getRevision())){
throw new BaseException("请输入版本");
}
inspectionItem.setSite(CommonMethods.getSite());
inspectionItem.setHandle(HandleEnum.INSPECTION_ITEM.getHandle(inspectionItem.getSite(),inspectionItem.getInspectionItemNo(),inspectionItem.getRevision()));
HashMap<String, Object> removeCondition = new HashMap<>();

@ -19,6 +19,7 @@ import java.time.LocalDateTime;
*/
@TableName("OPERATION")
public class Operation extends Model<Operation> {
private static final long serialVersionUID = 1L;
@ -79,6 +80,10 @@ public class Operation extends Model<Operation> {
private String erpWorkCenterBo;
@TableField(exist = false)
private String description;
@TableField(exist = false)
private String stepId;
@TableField(exist = false)
private String item;
public String getHandle() {
@ -308,6 +313,22 @@ public class Operation extends Model<Operation> {
this.description = description;
}
public String getStepId() {
return stepId;
}
public void setStepId(String stepId) {
this.stepId = stepId;
}
public String getItem() {
return item;
}
public void setItem(String item) {
this.item = item;
}
public static final String HANDLE = "HANDLE";
public static final String CHANGE_STAMP = "CHANGE_STAMP";

@ -32,12 +32,23 @@
<result column="ERP_CONTROL_KEY_BO" property="erpControlKeyBo" />
<result column="ERP_WORK_CENTER_BO" property="erpWorkCenterBo" />
<result column="DESCRIPTION" property="description"/>
<result column="STEP_ID" property="stepId"/>
</resultMap>
<!-- 通用查询结果列 -->
<sql id="Base_Column_List">
HANDLE, CHANGE_STAMP, SITE, OPERATION, TYPE, SPECIAL_ROUTER_BO, STATUS_BO, RESOURCE_TYPE_BO, REVISION, CURRENT_REVISION, EFF_START_DATE, EFF_END_DATE, CREATED_DATE_TIME, MODIFIED_DATE_TIME, PCA_DASHBOARD_MODE, DEFAULT_NC_CODE_BO, FAILURE_TRACKING_CONFIG_BO, RESOURCE_BO, MAX_LOOP, REQUIRED_TIME_IN_PROCESS, REPORTING_STEP, PREV_SITE, ORIGINAL_TRANSFER_KEY, SPECIAL_INSTRUCTION, REPORTING_CENTER_BO, ERP_CONTROL_KEY_BO, ERP_WORK_CENTER_BO
</sql>
<sql id="FULL_Column_List">
O.HANDLE, O.CHANGE_STAMP,O.SITE,O.OPERATION, O.TYPE,
O.SPECIAL_ROUTER_BO, O.STATUS_BO, O.RESOURCE_TYPE_BO,
O.REVISION, O.CURRENT_REVISION, O.EFF_START_DATE, O.EFF_END_DATE,
O.CREATED_DATE_TIME, O.MODIFIED_DATE_TIME, O.PCA_DASHBOARD_MODE,
O.DEFAULT_NC_CODE_BO, O.FAILURE_TRACKING_CONFIG_BO, O.RESOURCE_BO,
O.MAX_LOOP, O.REQUIRED_TIME_IN_PROCESS, O.REPORTING_STEP, O.PREV_SITE,
O.ORIGINAL_TRANSFER_KEY, O.SPECIAL_INSTRUCTION, O.REPORTING_CENTER_BO,
O.ERP_CONTROL_KEY_BO, O.ERP_WORK_CENTER_BO,OT.DESCRIPTION,RS.STEP_ID
</sql>
<!-- BaseMapper标准查询/修改/删除 -->
@ -272,15 +283,23 @@
</select>
<select id="selectPage" resultMap="BaseResultMap">
SELECT O.HANDLE, O.SITE, O.OPERATION, OT.DESCRIPTION, O.TYPE, O.SPECIAL_ROUTER_BO, O.STATUS_BO, O.RESOURCE_TYPE_BO, O.REVISION, O.CURRENT_REVISION
SELECT DISTINCT O.OPERATION,RS.STEP_ID,OT.DESCRIPTION
FROM OPERATION O
LEFT JOIN OPERATION_T OT ON O.HANDLE = OT.OPERATION_BO AND OT.LOCALE = 'zh'
LEFT JOIN OPERATION_T OT ON O.HANDLE = OT.OPERATION_BO AND OT.LOCALE = #{locale}
INNER JOIN ROUTER_OPERATION RO ON RO.OPERATION_BO = (SUBSTR(O.HANDLE,1,(SELECT INSTR(O.HANDLE , ',', -1, 1)
FROM DUAL)-1) || ',#'
)
INNER JOIN ROUTER_STEP RS ON rs.HANDLE = RO.ROUTER_STEP_BO
INNER JOIN ROUTER R ON R.HANDLE = RS.ROUTER_BO
INNER JOIN SHOP_ORDER SO ON SO.PLANNED_ROUTER_BO = R.HANDLE
INNER JOIN ITEM I ON I.HANDLE = SO.PLANNED_ITEM_BO
<where>
<if test="ew!=null">
<if test="ew.entity!=null">
<if test="ew.entity.handle!=null">
HANDLE=#{ew.entity.handle}
</if>
<if test="ew.entity.changeStamp!=null"> AND O.CHANGE_STAMP=#{ew.entity.changeStamp}</if>
<if test="ew.entity.site!=null"> AND O.SITE=#{ew.entity.site}</if>
<if test="ew.entity.operation!=null"> AND O.OPERATION=#{ew.entity.operation}</if>
<if test="ew.entity.type!=null"> AND O.TYPE=#{ew.entity.type}</if>
@ -289,7 +308,24 @@
<if test="ew.entity.resourceTypeBo!=null"> AND O.RESOURCE_TYPE_BO=#{ew.entity.resourceTypeBo}</if>
<if test="ew.entity.revision!=null"> AND O.REVISION=#{ew.entity.revision}</if>
<if test="ew.entity.currentRevision!=null"> AND O.CURRENT_REVISION=#{ew.entity.currentRevision}</if>
<if test="ew.entity.description!=null"> AND OT.DESCRIPTION=#{ew.entity.description}</if>
<if test="ew.entity.effStartDate!=null"> AND O.EFF_START_DATE=#{ew.entity.effStartDate}</if>
<if test="ew.entity.effEndDate!=null"> AND O.EFF_END_DATE=#{ew.entity.effEndDate}</if>
<if test="ew.entity.createdDateTime!=null"> AND O.CREATED_DATE_TIME=#{ew.entity.createdDateTime}</if>
<if test="ew.entity.modifiedDateTime!=null"> AND O.MODIFIED_DATE_TIME=#{ew.entity.modifiedDateTime}</if>
<if test="ew.entity.pcaDashboardMode!=null"> AND O.PCA_DASHBOARD_MODE=#{ew.entity.pcaDashboardMode}</if>
<if test="ew.entity.defaultNcCodeBo!=null"> AND O.DEFAULT_NC_CODE_BO=#{ew.entity.defaultNcCodeBo}</if>
<if test="ew.entity.failureTrackingConfigBo!=null"> AND O.FAILURE_TRACKING_CONFIG_BO=#{ew.entity.failureTrackingConfigBo}</if>
<if test="ew.entity.resourceBo!=null"> AND O.RESOURCE_BO=#{ew.entity.resourceBo}</if>
<if test="ew.entity.maxLoop!=null"> AND O.MAX_LOOP=#{ew.entity.maxLoop}</if>
<if test="ew.entity.requiredTimeInProcess!=null"> AND O.REQUIRED_TIME_IN_PROCESS=#{ew.entity.requiredTimeInProcess}</if>
<if test="ew.entity.reportingStep!=null"> AND O.REPORTING_STEP=#{ew.entity.reportingStep}</if>
<if test="ew.entity.prevSite!=null"> AND O.PREV_SITE=#{ew.entity.prevSite}</if>
<if test="ew.entity.originalTransferKey!=null"> AND O.ORIGINAL_TRANSFER_KEY=#{ew.entity.originalTransferKey}</if>
<if test="ew.entity.specialInstruction!=null"> AND O.SPECIAL_INSTRUCTION=#{ew.entity.specialInstruction}</if>
<if test="ew.entity.reportingCenterBo!=null"> AND O.REPORTING_CENTER_BO=#{ew.entity.reportingCenterBo}</if>
<if test="ew.entity.erpControlKeyBo!=null"> AND O.ERP_CONTROL_KEY_BO=#{ew.entity.erpControlKeyBo}</if>
<if test="ew.entity.erpWorkCenterBo!=null"> AND O.ERP_WORK_CENTER_BO=#{ew.entity.erpWorkCenterBo}</if>
<if test="ew.entity.item!=null"> AND i.item=#{ew.entity.item}</if>
</if>
<if test="ew!=null and ew.sqlSegment!=null and ew.nonEmptyOfWhere">
AND ${ew.sqlSegment}
@ -299,6 +335,7 @@
<if test="ew!=null and ew.sqlSegment!=null and ew.emptyOfWhere">
AND ${ew.sqlSegment}
</if>
ORDER BY RS.STEP_ID
</select>
<select id="selectMapsPage" resultType="HashMap">

Loading…
Cancel
Save