自报不良代码显示描述

master
philip 4 years ago
parent fcb84abe06
commit 6689e3ce1f

@ -1,14 +1,19 @@
package com.foreverwin.mesnac.production.controller;
import com.fasterxml.jackson.core.type.TypeReference;
import com.fasterxml.jackson.databind.ObjectMapper;
import com.foreverwin.mesnac.common.util.StringUtil;
import com.foreverwin.mesnac.meapi.dto.SfcDto;
import com.foreverwin.mesnac.meapi.dto.WorkCenterDto;
import com.foreverwin.mesnac.meapi.model.Sfc;
import com.foreverwin.mesnac.production.service.PodTemplateService;
import com.foreverwin.modular.core.exception.BaseException;
import com.foreverwin.modular.core.util.R;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.*;
import java.util.List;
import java.util.Map;
@Controller
@ -60,7 +65,20 @@ public class PodTemplateController {
@ResponseBody
@PostMapping("/sfcComplete")
public R sfcComplete(@RequestBody Map<String,Object> map) {
podTemplateService.sfcComplete(map);
List<SfcDto> sfcDtoList = (List<SfcDto>) map.get("sfcDtoList");
ObjectMapper mapper = new ObjectMapper();
sfcDtoList = mapper.convertValue(sfcDtoList, new TypeReference<List<SfcDto>>() {
});
String resrce = (String) map.get("resrce");
if (sfcDtoList == null || sfcDtoList.size() < 1) {
throw new BaseException("作业列表不能为空");
}
if (StringUtil.isBlank(resrce)) {
throw new BaseException("资源不能为空");
}
for (SfcDto sfcDto : sfcDtoList) {
podTemplateService.sfcComplete(sfcDto,resrce);
}
return R.ok();
}

@ -4,7 +4,7 @@ import com.foreverwin.mesnac.meapi.dto.SfcDto;
import com.foreverwin.mesnac.meapi.dto.WorkCenterDto;
import com.foreverwin.mesnac.meapi.model.Sfc;
import java.util.List;
import java.math.BigDecimal;
import java.util.Map;
public interface PodTemplateService {
@ -16,9 +16,9 @@ public interface PodTemplateService {
void sfcStart(Map<String, Object> map);
void sfcComplete(Map<String, Object> map);
void sfcComplete(SfcDto sfcDto, String resrce);
void sendErp(List<Map<String,Object>> mapList);
void sendErp(String sfc, String stepId, BigDecimal qty, BigDecimal scrapQty, BigDecimal workHour);
SfcDto getInfoBySfc(Sfc sfc);

@ -240,20 +240,7 @@ public class PodTemplateServiceImpl implements PodTemplateService {
}
@Override
public void sfcComplete(Map<String, Object> map) {
List<SfcDto> sfcDtoList = (List<SfcDto>) map.get("sfcDtoList");
ObjectMapper mapper = new ObjectMapper();
sfcDtoList = mapper.convertValue(sfcDtoList, new TypeReference<List<SfcDto>>() {});
List<Map<String,Object>> postMapList=new ArrayList<>();
String resrce = (String) map.get("resrce");
if (sfcDtoList == null || sfcDtoList.size() < 1) {
throw new BaseException("作业列表不能为空");
}
if (StringUtil.isBlank(resrce)) {
throw new BaseException("资源不能为空");
}
for (SfcDto sfcDto:sfcDtoList){
Map<String,Object> postMap=new HashMap<>();
public void sfcComplete(SfcDto sfcDto, String resrce) {
String site = CommonMethods.getSite();
String operation = sfcDto.getOperation();
Operation currentRevisionRef = operationService.getCurrentRevisionRef(site, operation);
@ -317,22 +304,15 @@ public class PodTemplateServiceImpl implements PodTemplateService {
LocalDateTime startTime = sfcService.getSfcStartTime(HandleEnum.SFC.getHandle(site, sfc));
long workHourSeconds = Duration.between(startTime, LocalDateTime.now()).getSeconds();
BigDecimal workHour = new BigDecimal(workHourSeconds).divide(BigDecimal.valueOf(3600), 2, RoundingMode.HALF_UP);
postMap.put("sfc",sfc);
postMap.put("stepId",stepId);
postMap.put("qty",qty);
postMap.put("scrapQty",BigDecimal.ZERO);
postMap.put("workHour",workHour);
postMapList.add(postMap);
sfcCrossService.completeAction(site, currentRevisionRef.getHandle(), resrce, sfcServiceById.getHandle(), qty);
//更改派工单状态
sfcDispatchCommonService.updateSfcDispatchStatus(site, CommonMethods.getUser(), dispatchNo, DispatchStatusEnum.COMPLETE.getCode());
//报工
//sendErp(sfc, stepId, qty, BigDecimal.ZERO, workHour);
} catch (Exception e) {
ExceptionUtil.throwException(e);
}
}
//报工
sendErp(postMapList);
}
public void materialConsumption(String site, String operation, String sfcBo, String stepId, String resource) {
@ -425,19 +405,12 @@ public class PodTemplateServiceImpl implements PodTemplateService {
}
@Override
public void sendErp(List<Map<String,Object>> postMapList) {
public void sendErp(String sfc, String stepId, BigDecimal qty, BigDecimal scrapQty, BigDecimal workHour) {
//请求参数
ZprodordconfStruIn[] ins = new ZprodordconfStruIn[1];
for (int i=0;i<postMapList.size();i++){
Map<String, Object> map = postMapList.get(i);
String sfc = (String)map.get("sfc");
Sfc sfcServiceById = sfcService.getById(HandleEnum.SFC.getHandle(CommonMethods.getSite(), sfc));
String shopOrderBo = sfcServiceById.getShopOrderBo();
String shopOrder = StringUtil.trimHandle(shopOrderBo);
String stepId = (String)map.get("stepId");
BigDecimal qty = (BigDecimal) map.get("qty");
BigDecimal scrapQty = (BigDecimal)map.get("scrapQty");
BigDecimal workHour = (BigDecimal)map.get("workHour");
ZprodordconfStruIn struIn = new ZprodordconfStruIn();
//生产订单
struIn.setAufnr(shopOrder);
@ -452,13 +425,11 @@ public class PodTemplateServiceImpl implements PodTemplateService {
struIn.setIsm01(workHour);
//人工工时
struIn.setIsm02(workHour);
struIn.setIsm03(BigDecimal.ZERO);
struIn.setIsm04(BigDecimal.ZERO);
struIn.setIsm05(BigDecimal.ZERO);
struIn.setIsm06(BigDecimal.ZERO);
ins[i] = struIn;
}
struIn.setIsm03(workHour);
struIn.setIsm04(workHour);
struIn.setIsm05(workHour);
struIn.setIsm06(workHour);
ins[0] = struIn;
TableOfZprodordconfStruInHolder inHolder = new TableOfZprodordconfStruInHolder(ins);
//返回对象
@ -477,13 +448,16 @@ public class PodTemplateServiceImpl implements PodTemplateService {
//调用WS
try {
ERPAPI.erpWebService().zmesProdordconf(inHolder, outHolder);
if (outHolder.value.length == 1) {
throw new BaseException("ERP接口返回错误");
}
String status = outHolder.value[1].getRet();
String message = outHolder.value[1].getMsg();
if (status.equals("E")) {
throw new BaseException("ERP接口返回:状态:" + status + ",消息:" + message);
if (!status.equals("S")) {
throw new BaseException("ERP接口返回错误消息:" + message);
}
} catch (RemoteException e) {
ExceptionUtil.throwException(e);
throw new BaseException("ERP接口错误: " + e.getMessage());
} finally {
//记录接口日志
IntegrationLog log = new IntegrationLog();
@ -493,7 +467,7 @@ public class PodTemplateServiceImpl implements PodTemplateService {
log.setCategory("REQUEST");
log.setIntegrationWay("ERP");
log.setIntegrationMethod("erpWebService.zmesProdordconf");
log.setParam(inHolder.toString());
log.setParam(Arrays.toString(ins));
log.setStatus(outHolder.value[1].getRet());
log.setResultMessage(outHolder.value[1].getMsg());
log.setTransactionId("");

@ -17,7 +17,7 @@ import java.time.LocalDateTime;
* </p>
*
* @author Philip
* @since 2021-06-21
* @since 2021-08-16
*/
@TableName("Z_SELF_REPORT")
@ -116,6 +116,12 @@ public class SelfReport extends Model<SelfReport> {
*/
@TableField("MODIFIED_DATE_TIME")
private LocalDateTime modifiedDateTime;
/**
*
*/
@TableField("NC_CODE_DESC")
private String ncCodeDesc;
/**
*
*/
@ -302,6 +308,14 @@ public class SelfReport extends Model<SelfReport> {
this.modifiedDateTime = modifiedDateTime;
}
public String getNcCodeDesc() {
return ncCodeDesc;
}
public void setNcCodeDesc(String ncCodeDesc) {
this.ncCodeDesc = ncCodeDesc;
}
public static final String HANDLE = "HANDLE";
public static final String SITE = "SITE";
@ -338,6 +352,8 @@ public class SelfReport extends Model<SelfReport> {
public static final String MODIFIED_DATE_TIME = "MODIFIED_DATE_TIME";
public static final String NC_CODE_DESC = "NC_CODE_DESC";
@Override
protected Serializable pkVal() {
@ -365,6 +381,7 @@ public class SelfReport extends Model<SelfReport> {
", createdDateTime = " + createdDateTime +
", modifyUser = " + modifyUser +
", modifiedDateTime = " + modifiedDateTime +
", ncCodeDesc = " + ncCodeDesc +
"}";
}
}

@ -11,7 +11,9 @@ import com.foreverwin.mesnac.common.enums.HandleEnum;
import com.foreverwin.mesnac.common.service.AnomalyService;
import com.foreverwin.mesnac.common.service.CommonService;
import com.foreverwin.mesnac.common.util.StringUtil;
import com.foreverwin.mesnac.meapi.dto.NcCodeDto;
import com.foreverwin.mesnac.meapi.dto.SfcDto;
import com.foreverwin.mesnac.meapi.service.NcCodeService;
import com.foreverwin.mesnac.production.mapper.SfcCrossMapper;
import com.foreverwin.mesnac.quality.dto.SelfReportRequest;
import com.foreverwin.mesnac.quality.mapper.SelfReportMapper;
@ -55,6 +57,8 @@ public class SelfReportServiceImpl extends ServiceImpl<SelfReportMapper, SelfRep
private AnomalyService anomalyService;
@Autowired
private CommonService commonService;
@Autowired
private NcCodeService ncCodeService;
@Override
@ -131,10 +135,15 @@ public class SelfReportServiceImpl extends ServiceImpl<SelfReportMapper, SelfRep
List<SelfReportRequest> selfReportList = list.stream().filter(selfReportRequest -> selfReportRequest.getType().equals("Z")).collect(Collectors.toList());
if (selfReportList.size()>0){
StringBuilder stringBuilder = new StringBuilder();
StringBuilder description = new StringBuilder();
for (int i=0;i<selfReportList.size();i++){
stringBuilder.append(selfReportList.get(i).getNcCode());
String ncCode = selfReportList.get(i).getNcCode();
stringBuilder.append(ncCode);
List<NcCodeDto> ncCodeDescriptionByNcCode = ncCodeService.findNcCodeDescriptionByNcCode(ncCode);
description.append(ncCodeDescriptionByNcCode.get(0).getNgDescription());
if (i!=selfReportList.size()-1){
stringBuilder.append(",");
description.append(",");
}
}
Date date = new Date(System.currentTimeMillis());
@ -157,6 +166,7 @@ public class SelfReportServiceImpl extends ServiceImpl<SelfReportMapper, SelfRep
selfReport.setResrce(resrce);
selfReport.setSfc(sfc);
selfReport.setNcCode(stringBuilder.toString());
selfReport.setNcCodeDesc(description.toString());
selfReport.setNcQty(new BigDecimal(ncQty));
selfReport.setLocation(location);
selfReport.setState(Constants.STATUS_NEW);

@ -22,11 +22,12 @@
<result column="CREATED_DATE_TIME" property="createdDateTime" />
<result column="MODIFY_USER" property="modifyUser" />
<result column="MODIFIED_DATE_TIME" property="modifiedDateTime" />
<result column="NC_CODE_DESC" property="ncCodeDesc" />
</resultMap>
<!-- 通用查询结果列 -->
<sql id="Base_Column_List">
HANDLE, SITE, TASK_NO, WORK_CENTER, SHOP_ORDER, ITEM, OP_STEP, RESRCE, SFC, NC_CODE, NC_QTY, LOCATION, STATE, REMARK, CREATE_USER, CREATED_DATE_TIME, MODIFY_USER, MODIFIED_DATE_TIME
HANDLE, SITE, TASK_NO, WORK_CENTER, SHOP_ORDER, ITEM, OP_STEP, RESRCE, SFC, NC_CODE, NC_QTY, LOCATION, STATE, REMARK, CREATE_USER, CREATED_DATE_TIME, MODIFY_USER, MODIFIED_DATE_TIME, NC_CODE_DESC
</sql>
<!-- BaseMapper标准查询/修改/删除 -->
@ -78,6 +79,7 @@
<if test="ew.entity.createdDateTime!=null"> AND CREATED_DATE_TIME=#{ew.entity.createdDateTime}</if>
<if test="ew.entity.modifyUser!=null"> AND MODIFY_USER=#{ew.entity.modifyUser}</if>
<if test="ew.entity.modifiedDateTime!=null"> AND MODIFIED_DATE_TIME=#{ew.entity.modifiedDateTime}</if>
<if test="ew.entity.ncCodeDesc!=null"> AND NC_CODE_DESC=#{ew.entity.ncCodeDesc}</if>
</where>
</select>
@ -106,6 +108,7 @@
<if test="ew.entity.createdDateTime!=null"> AND CREATED_DATE_TIME=#{ew.entity.createdDateTime}</if>
<if test="ew.entity.modifyUser!=null"> AND MODIFY_USER=#{ew.entity.modifyUser}</if>
<if test="ew.entity.modifiedDateTime!=null"> AND MODIFIED_DATE_TIME=#{ew.entity.modifiedDateTime}</if>
<if test="ew.entity.ncCodeDesc!=null"> AND NC_CODE_DESC=#{ew.entity.ncCodeDesc}</if>
</if>
<if test="ew!=null and ew.sqlSegment!=null and ew.nonEmptyOfWhere">
${ew.sqlSegment}
@ -142,6 +145,7 @@
<if test="ew.entity.createdDateTime!=null"> AND CREATED_DATE_TIME=#{ew.entity.createdDateTime}</if>
<if test="ew.entity.modifyUser!=null"> AND MODIFY_USER=#{ew.entity.modifyUser}</if>
<if test="ew.entity.modifiedDateTime!=null"> AND MODIFIED_DATE_TIME=#{ew.entity.modifiedDateTime}</if>
<if test="ew.entity.ncCodeDesc!=null"> AND NC_CODE_DESC=#{ew.entity.ncCodeDesc}</if>
</if>
<if test="ew!=null and ew.sqlSegment!=null and ew.nonEmptyOfWhere">
${ew.sqlSegment}
@ -152,46 +156,6 @@
${ew.sqlSegment}
</if>
</select>
<select id="selectListByCondition" resultMap="BaseResultMap">
SELECT ZSR.HANDLE, ZSR.SITE, ZSR.TASK_NO, ZSR.WORK_CENTER, ZSR.SHOP_ORDER, ZSR.ITEM, ZSR.OP_STEP, ZSR.RESRCE, ZSR.SFC, ZSR.NC_CODE, ZSR.NC_QTY, ZSR.LOCATION, ZSR.STATE, ZSR.REMARK, B.FULL_NAME CREATE_USER,ZSR. CREATED_DATE_TIME,IT.DESCRIPTION FROM Z_SELF_REPORT ZSR
JOIN ITEM I ON I.ITEM = ZSR.ITEM AND I.CURRENT_REVISION='true'
LEFT JOIN ITEM_T IT ON I.HANDLE = IT.ITEM_BO AND IT.LOCALE = #{locale}
LEFT JOIN Z_NWA_USER B ON ZSR.SITE = B.SITE AND ZSR.CREATE_USER = B.USER_NAME
<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.site!=null"> AND ZSR.SITE=#{ew.entity.site}</if>
<if test="ew.entity.taskNo!=null"> AND ZSR.TASK_NO=#{ew.entity.taskNo}</if>
<if test="ew.entity.workCenter!=null and ew.entity.workCenter!='' "> AND ZSR.WORK_CENTER=#{ew.entity.workCenter}</if>
<if test="ew.entity.shopOrder!=null and ew.entity.shopOrder!=''"> AND ZSR.SHOP_ORDER=#{ew.entity.shopOrder}</if>
<if test="ew.entity.item!=null and ew.entity.item!=''"> AND ZSR.ITEM=#{ew.entity.item}</if>
<if test="ew.entity.opStep!=null and ew.entity.opStep!=''"> AND ZSR.OP_STEP=#{ew.entity.opStep}</if>
<if test="ew.entity.resrce!=null"> AND ZSR.RESRCE=#{ew.entity.resrce}</if>
<if test="ew.entity.sfc!=null and ew.entity.sfc!='' "> AND ZSR.SFC=#{ew.entity.sfc}</if>
<if test="ew.entity.ncCode!=null"> AND ZSR.NC_CODE=#{ew.entity.ncCode}</if>
<if test="ew.entity.ncQty!=null"> AND ZSR.NC_QTY=#{ew.entity.ncQty}</if>
<if test="ew.entity.location!=null"> AND ZSR.LOCATION=#{ew.entity.location}</if>
<if test="ew.entity.state!=null and ew.entity.state!=''"> AND ZSR.STATE=#{ew.entity.state}</if>
<if test="ew.entity.remark!=null"> AND ZSR.REMARK=#{ew.entity.remark}</if>
<if test="ew.entity.createUser!=null"> AND ZSR.CREATE_USER=#{ew.entity.createUser}</if>
<if test="ew.entity.createdDateTime!=null"> AND ZSR.CREATED_DATE_TIME=#{ew.entity.createdDateTime}</if>
<if test="ew.entity.modifyUser!=null"> AND ZSR.MODIFY_USER=#{ew.entity.modifyUser}</if>
<if test="ew.entity.modifiedDateTime!=null"> AND ZSR.MODIFIED_DATE_TIME=#{ew.entity.modifiedDateTime}</if>
</if>
<if test="startTime!=null"> AND ZSR.CREATED_DATE_TIME >=#{startTime}</if>
<if test="endTime!=null"> AND ZSR.CREATED_DATE_TIME &lt;=#{endTime}</if>
<if test="ew!=null and ew.sqlSegment!=null and ew.nonEmptyOfWhere">
${ew.sqlSegment}
</if>
</if>
</where>
<if test="ew!=null and ew.sqlSegment!=null and ew.emptyOfWhere">
${ew.sqlSegment}
</if>
</select>
<select id="selectMaps" resultType="HashMap">
SELECT <choose><when test="ew != null and ew.sqlSelect != null">${ew.sqlSelect}</when><otherwise><include refid="Base_Column_List"></include></otherwise></choose> FROM Z_SELF_REPORT
@ -218,6 +182,7 @@
<if test="ew.entity.createdDateTime!=null"> AND CREATED_DATE_TIME=#{ew.entity.createdDateTime}</if>
<if test="ew.entity.modifyUser!=null"> AND MODIFY_USER=#{ew.entity.modifyUser}</if>
<if test="ew.entity.modifiedDateTime!=null"> AND MODIFIED_DATE_TIME=#{ew.entity.modifiedDateTime}</if>
<if test="ew.entity.ncCodeDesc!=null"> AND NC_CODE_DESC=#{ew.entity.ncCodeDesc}</if>
</if>
<if test="ew!=null and ew.sqlSegment!=null and ew.nonEmptyOfWhere">
${ew.sqlSegment}
@ -254,6 +219,7 @@
<if test="ew.entity.createdDateTime!=null"> AND CREATED_DATE_TIME=#{ew.entity.createdDateTime}</if>
<if test="ew.entity.modifyUser!=null"> AND MODIFY_USER=#{ew.entity.modifyUser}</if>
<if test="ew.entity.modifiedDateTime!=null"> AND MODIFIED_DATE_TIME=#{ew.entity.modifiedDateTime}</if>
<if test="ew.entity.ncCodeDesc!=null"> AND NC_CODE_DESC=#{ew.entity.ncCodeDesc}</if>
</if>
<if test="ew!=null and ew.sqlSegment!=null and ew.nonEmptyOfWhere">
${ew.sqlSegment}
@ -290,6 +256,7 @@
<if test="ew.entity.createdDateTime!=null"> AND CREATED_DATE_TIME=#{ew.entity.createdDateTime}</if>
<if test="ew.entity.modifyUser!=null"> AND MODIFY_USER=#{ew.entity.modifyUser}</if>
<if test="ew.entity.modifiedDateTime!=null"> AND MODIFIED_DATE_TIME=#{ew.entity.modifiedDateTime}</if>
<if test="ew.entity.ncCodeDesc!=null"> AND NC_CODE_DESC=#{ew.entity.ncCodeDesc}</if>
</if>
<if test="ew!=null and ew.sqlSegment!=null and ew.nonEmptyOfWhere">
${ew.sqlSegment}
@ -326,6 +293,7 @@
<if test="ew.entity.createdDateTime!=null"> AND CREATED_DATE_TIME=#{ew.entity.createdDateTime}</if>
<if test="ew.entity.modifyUser!=null"> AND MODIFY_USER=#{ew.entity.modifyUser}</if>
<if test="ew.entity.modifiedDateTime!=null"> AND MODIFIED_DATE_TIME=#{ew.entity.modifiedDateTime}</if>
<if test="ew.entity.ncCodeDesc!=null"> AND NC_CODE_DESC=#{ew.entity.ncCodeDesc}</if>
</if>
<if test="ew!=null and ew.sqlSegment!=null and ew.nonEmptyOfWhere">
${ew.sqlSegment}
@ -358,6 +326,7 @@
<if test="createdDateTime!=null">CREATED_DATE_TIME,</if>
<if test="modifyUser!=null">MODIFY_USER,</if>
<if test="modifiedDateTime!=null">MODIFIED_DATE_TIME,</if>
<if test="ncCodeDesc!=null">NC_CODE_DESC,</if>
</trim> VALUES
<trim prefix="(" suffix=")" suffixOverrides=",">
#{handle},
@ -378,6 +347,7 @@
<if test="createdDateTime!=null">#{createdDateTime},</if>
<if test="modifyUser!=null">#{modifyUser},</if>
<if test="modifiedDateTime!=null">#{modifiedDateTime},</if>
<if test="ncCodeDesc!=null">#{ncCodeDesc},</if>
</trim>
</insert>
@ -405,6 +375,7 @@
#{createdDateTime},
#{modifyUser},
#{modifiedDateTime},
#{ncCodeDesc},
</trim>
</insert>
@ -428,6 +399,7 @@
<if test="et.createdDateTime!=null">CREATED_DATE_TIME=#{et.createdDateTime},</if>
<if test="et.modifyUser!=null">MODIFY_USER=#{et.modifyUser},</if>
<if test="et.modifiedDateTime!=null">MODIFIED_DATE_TIME=#{et.modifiedDateTime},</if>
<if test="et.ncCodeDesc!=null">NC_CODE_DESC=#{et.ncCodeDesc},</if>
</trim> WHERE HANDLE=#{et.handle} <if test="et instanceof java.util.Map"><if test="et.MP_OPTLOCK_VERSION_ORIGINAL!=null">and ${et.MP_OPTLOCK_VERSION_COLUMN}=#{et.MP_OPTLOCK_VERSION_ORIGINAL}</if></if>
</update>
@ -451,6 +423,7 @@
CREATED_DATE_TIME=#{et.createdDateTime},
MODIFY_USER=#{et.modifyUser},
MODIFIED_DATE_TIME=#{et.modifiedDateTime},
NC_CODE_DESC=#{et.ncCodeDesc},
</trim> WHERE HANDLE=#{et.handle} <if test="et instanceof java.util.Map"><if test="et.MP_OPTLOCK_VERSION_ORIGINAL!=null">and ${et.MP_OPTLOCK_VERSION_COLUMN}=#{et.MP_OPTLOCK_VERSION_ORIGINAL}</if></if>
</update>
@ -474,6 +447,7 @@
<if test="et.createdDateTime!=null">CREATED_DATE_TIME=#{et.createdDateTime},</if>
<if test="et.modifyUser!=null">MODIFY_USER=#{et.modifyUser},</if>
<if test="et.modifiedDateTime!=null">MODIFIED_DATE_TIME=#{et.modifiedDateTime},</if>
<if test="et.ncCodeDesc!=null">NC_CODE_DESC=#{et.ncCodeDesc},</if>
</trim>
<where>
<if test="ew!=null">
@ -496,6 +470,7 @@
<if test="ew.entity.createdDateTime!=null"> AND CREATED_DATE_TIME=#{ew.entity.createdDateTime}</if>
<if test="ew.entity.modifyUser!=null"> AND MODIFY_USER=#{ew.entity.modifyUser}</if>
<if test="ew.entity.modifiedDateTime!=null"> AND MODIFIED_DATE_TIME=#{ew.entity.modifiedDateTime}</if>
<if test="ew.entity.ncCodeDesc!=null"> AND NC_CODE_DESC=#{ew.entity.ncCodeDesc}</if>
</if>
<if test="ew!=null and ew.sqlSegment!=null and ew.nonEmptyOfWhere">
${ew.sqlSegment}
@ -549,6 +524,7 @@
<if test="ew.entity.createdDateTime!=null"> AND CREATED_DATE_TIME=#{ew.entity.createdDateTime}</if>
<if test="ew.entity.modifyUser!=null"> AND MODIFY_USER=#{ew.entity.modifyUser}</if>
<if test="ew.entity.modifiedDateTime!=null"> AND MODIFIED_DATE_TIME=#{ew.entity.modifiedDateTime}</if>
<if test="ew.entity.ncCodeDesc!=null"> AND NC_CODE_DESC=#{ew.entity.ncCodeDesc}</if>
</if>
<if test="ew!=null and ew.sqlSegment!=null and ew.nonEmptyOfWhere">
${ew.sqlSegment}
@ -566,5 +542,44 @@
</foreach>)
</delete>
<!-- BaseMapper标准查询/修改/删除 -->
<select id="selectListByCondition" resultMap="BaseResultMap">
SELECT ZSR.HANDLE, ZSR.SITE, ZSR.TASK_NO, ZSR.WORK_CENTER,ZSR.NC_CODE_DESC, ZSR.SHOP_ORDER, ZSR.ITEM, ZSR.OP_STEP, ZSR.RESRCE, ZSR.SFC, ZSR.NC_CODE, ZSR.NC_QTY, ZSR.LOCATION, ZSR.STATE, ZSR.REMARK, B.FULL_NAME CREATE_USER,ZSR. CREATED_DATE_TIME,IT.DESCRIPTION FROM Z_SELF_REPORT ZSR
JOIN ITEM I ON I.ITEM = ZSR.ITEM AND I.CURRENT_REVISION='true'
LEFT JOIN ITEM_T IT ON I.HANDLE = IT.ITEM_BO AND IT.LOCALE = #{locale}
LEFT JOIN Z_NWA_USER B ON ZSR.SITE = B.SITE AND ZSR.CREATE_USER = B.USER_NAME
<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.site!=null"> AND ZSR.SITE=#{ew.entity.site}</if>
<if test="ew.entity.taskNo!=null"> AND ZSR.TASK_NO=#{ew.entity.taskNo}</if>
<if test="ew.entity.workCenter!=null and ew.entity.workCenter!='' "> AND ZSR.WORK_CENTER=#{ew.entity.workCenter}</if>
<if test="ew.entity.shopOrder!=null and ew.entity.shopOrder!=''"> AND ZSR.SHOP_ORDER=#{ew.entity.shopOrder}</if>
<if test="ew.entity.item!=null and ew.entity.item!=''"> AND ZSR.ITEM=#{ew.entity.item}</if>
<if test="ew.entity.opStep!=null and ew.entity.opStep!=''"> AND ZSR.OP_STEP=#{ew.entity.opStep}</if>
<if test="ew.entity.resrce!=null"> AND ZSR.RESRCE=#{ew.entity.resrce}</if>
<if test="ew.entity.sfc!=null and ew.entity.sfc!='' "> AND ZSR.SFC=#{ew.entity.sfc}</if>
<if test="ew.entity.ncCode!=null"> AND ZSR.NC_CODE=#{ew.entity.ncCode}</if>
<if test="ew.entity.ncQty!=null"> AND ZSR.NC_QTY=#{ew.entity.ncQty}</if>
<if test="ew.entity.location!=null"> AND ZSR.LOCATION=#{ew.entity.location}</if>
<if test="ew.entity.state!=null and ew.entity.state!=''"> AND ZSR.STATE=#{ew.entity.state}</if>
<if test="ew.entity.remark!=null"> AND ZSR.REMARK=#{ew.entity.remark}</if>
<if test="ew.entity.createUser!=null"> AND ZSR.CREATE_USER=#{ew.entity.createUser}</if>
<if test="ew.entity.createdDateTime!=null"> AND ZSR.CREATED_DATE_TIME=#{ew.entity.createdDateTime}</if>
<if test="ew.entity.modifyUser!=null"> AND ZSR.MODIFY_USER=#{ew.entity.modifyUser}</if>
<if test="ew.entity.modifiedDateTime!=null"> AND ZSR.MODIFIED_DATE_TIME=#{ew.entity.modifiedDateTime}</if>
</if>
<if test="startTime!=null"> AND ZSR.CREATED_DATE_TIME >=#{startTime}</if>
<if test="endTime!=null"> AND ZSR.CREATED_DATE_TIME &lt;=#{endTime}</if>
<if test="ew!=null and ew.sqlSegment!=null and ew.nonEmptyOfWhere">
${ew.sqlSegment}
</if>
</if>
</where>
<if test="ew!=null and ew.sqlSegment!=null and ew.emptyOfWhere">
${ew.sqlSegment}
</if>
</select>
</mapper>

Loading…
Cancel
Save