自报不良代码显示描述

master
philip 4 years ago
parent fcb84abe06
commit 6689e3ce1f

@ -1,14 +1,19 @@
package com.foreverwin.mesnac.production.controller; 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.SfcDto;
import com.foreverwin.mesnac.meapi.dto.WorkCenterDto; import com.foreverwin.mesnac.meapi.dto.WorkCenterDto;
import com.foreverwin.mesnac.meapi.model.Sfc; import com.foreverwin.mesnac.meapi.model.Sfc;
import com.foreverwin.mesnac.production.service.PodTemplateService; import com.foreverwin.mesnac.production.service.PodTemplateService;
import com.foreverwin.modular.core.exception.BaseException;
import com.foreverwin.modular.core.util.R; import com.foreverwin.modular.core.util.R;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller; import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.*; import org.springframework.web.bind.annotation.*;
import java.util.List;
import java.util.Map; import java.util.Map;
@Controller @Controller
@ -60,7 +65,20 @@ public class PodTemplateController {
@ResponseBody @ResponseBody
@PostMapping("/sfcComplete") @PostMapping("/sfcComplete")
public R sfcComplete(@RequestBody Map<String,Object> map) { 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(); 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.dto.WorkCenterDto;
import com.foreverwin.mesnac.meapi.model.Sfc; import com.foreverwin.mesnac.meapi.model.Sfc;
import java.util.List; import java.math.BigDecimal;
import java.util.Map; import java.util.Map;
public interface PodTemplateService { public interface PodTemplateService {
@ -16,9 +16,9 @@ public interface PodTemplateService {
void sfcStart(Map<String, Object> map); 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); SfcDto getInfoBySfc(Sfc sfc);

@ -220,10 +220,10 @@ public class PodTemplateServiceImpl implements PodTemplateService {
} }
} }
//是否完成专检 //是否完成专检
QueryWrapper<InspectionTask> queryWrapper=new QueryWrapper<>(); QueryWrapper<InspectionTask> queryWrapper = new QueryWrapper<>();
queryWrapper.eq(InspectionTask.CATEGORY,Constants.INSPECTION_TYPE_P); queryWrapper.eq(InspectionTask.CATEGORY, Constants.INSPECTION_TYPE_P);
queryWrapper.eq(InspectionTask.SFC,sfc); queryWrapper.eq(InspectionTask.SFC, sfc);
queryWrapper.ne(InspectionTask.RESULT,Constants.RSESULT_OK); queryWrapper.ne(InspectionTask.RESULT, Constants.RSESULT_OK);
List<InspectionTask> list = inspectionTaskService.list(queryWrapper); List<InspectionTask> list = inspectionTaskService.list(queryWrapper);
if (!list.isEmpty()) { if (!list.isEmpty()) {
throw new BaseException("请完成专检检验任务"); throw new BaseException("请完成专检检验任务");
@ -240,99 +240,79 @@ public class PodTemplateServiceImpl implements PodTemplateService {
} }
@Override @Override
public void sfcComplete(Map<String, Object> map) { public void sfcComplete(SfcDto sfcDto, String resrce) {
List<SfcDto> sfcDtoList = (List<SfcDto>) map.get("sfcDtoList"); String site = CommonMethods.getSite();
ObjectMapper mapper = new ObjectMapper(); String operation = sfcDto.getOperation();
sfcDtoList = mapper.convertValue(sfcDtoList, new TypeReference<List<SfcDto>>() {}); Operation currentRevisionRef = operationService.getCurrentRevisionRef(site, operation);
List<Map<String,Object>> postMapList=new ArrayList<>(); String sfc = sfcDto.getSfc();
String resrce = (String) map.get("resrce"); String stepId = sfcDto.getStepId();
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<>();
String site = CommonMethods.getSite();
String operation = sfcDto.getOperation();
Operation currentRevisionRef = operationService.getCurrentRevisionRef(site, operation);
String sfc = sfcDto.getSfc();
String stepId = sfcDto.getStepId();
String dispatchNo = sfcDto.getDispatchNo(); String dispatchNo = sfcDto.getDispatchNo();
Sfc sfcServiceById = sfcService.getById(HandleEnum.SFC.getHandle(site, sfc)); Sfc sfcServiceById = sfcService.getById(HandleEnum.SFC.getHandle(site, sfc));
BigDecimal qty = new BigDecimal(sfcServiceById.getQty().toString()); BigDecimal qty = new BigDecimal(sfcServiceById.getQty().toString());
//是否有自检检验项目 //是否有自检检验项目
List<InspectionItemDetail> inspectionItemDetails = inspectionItemService.selectQualityInspection(sfc, operation, stepId, Constants.INSPECTION_TYPE_Z); List<InspectionItemDetail> inspectionItemDetails = inspectionItemService.selectQualityInspection(sfc, operation, stepId, Constants.INSPECTION_TYPE_Z);
if (inspectionItemDetails.size() > 0 && inspectionItemDetails.get(0) != null) { if (inspectionItemDetails.size() > 0 && inspectionItemDetails.get(0) != null) {
//是否有自检检验任务 //是否有自检检验任务
InspectionTask createTask = inspectionTaskService.isCreateTask(site, Constants.INSPECTION_TYPE_Z, sfc, operation, stepId); InspectionTask createTask = inspectionTaskService.isCreateTask(site, Constants.INSPECTION_TYPE_Z, sfc, operation, stepId);
if (createTask == null || !createTask.getStatus().equals(Constants.INSPECTION_TASK_STATUS_COMPLETE)) { if (createTask == null || !createTask.getStatus().equals(Constants.INSPECTION_TASK_STATUS_COMPLETE)) {
throw new BaseException("请完成自检检验任务"); throw new BaseException("请完成自检检验任务");
}
if (!createTask.getResult().equals(Constants.RSESULT_OK)) {
throw new BaseException("自检任务不合格,不能完成请检查");
}
} }
//是否装配完成 if (!createTask.getResult().equals(Constants.RSESULT_OK)) {
List<Map<String, Object>> assembleList = sfcDataAssembleMapper.querySfcAssemble(HandleEnum.SFC_DISPATCH.getHandle(site,dispatchNo)); throw new BaseException("自检任务不合格,不能完成请检查");
if (assembleList!=null&&assembleList.size()>0){
for (Map<String,Object> objectMap:assembleList){
String isAssemble= (String) objectMap.get("IS_ASSEMBLE");
if (!isAssemble.equals("GREEN")){
throw new BaseException("未装配完成");
}
}
} }
//物料消耗 }
materialConsumption(site, operation, HandleEnum.SFC.getHandle(site, sfc), stepId, resrce); //是否装配完成
try { List<Map<String, Object>> assembleList = sfcDataAssembleMapper.querySfcAssemble(HandleEnum.SFC_DISPATCH.getHandle(site, dispatchNo));
//专检创建 if (assembleList != null && assembleList.size() > 0) {
Map<String, Object> paramMap=new HashMap<>(); for (Map<String, Object> objectMap : assembleList) {
paramMap.put("SFC",sfc); String isAssemble = (String) objectMap.get("IS_ASSEMBLE");
paramMap.put("SHOP_ORDER",StringUtil.trimHandle(sfcServiceById.getShopOrderBo())); if (!isAssemble.equals("GREEN")) {
paramMap.put("OPERATION",operation); throw new BaseException("未装配完成");
paramMap.put("STEP_ID",stepId);
String workShopBo = commonService.getWorkShopBo(HandleEnum.RESOURCE.getHandle(site, resrce));
paramMap.put("WORK_CENTER",StringUtil.trimHandle(workShopBo));
paramMap.put("RESRCE",resrce);
paramMap.put("SFC_DISPATCH_DETAIL_BO",HandleEnum.SFC_DISPATCH.getHandle(site,dispatchNo));
inspectionItemDetails = inspectionItemService.selectQualityInspection(sfc,operation, stepId, Constants.INSPECTION_TYPE_P);
if (inspectionItemDetails.size() > 0 && inspectionItemDetails.get(0) != null) {
paramMap.put("CATEGORY",Constants.INSPECTION_TYPE_P);
inspectionTaskService.createTask(paramMap);
}else {
paramMap.put("CATEGORY",Constants.INSPECTION_TYPE_P);
inspectionTaskService.createCompleteTask(paramMap);
}
//首件创建
inspectionItemDetails = inspectionItemService.selectQualityInspection(sfc,operation, stepId, Constants.INSPECTION_TYPE_S);
if (inspectionItemDetails.size() > 0 && inspectionItemDetails.get(0) != null) {
paramMap.put("CATEGORY",Constants.INSPECTION_TYPE_S);
inspectionTaskService.createTask(paramMap);
} }
//计算工时 }
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); materialConsumption(site, operation, HandleEnum.SFC.getHandle(site, sfc), stepId, resrce);
postMap.put("sfc",sfc); try {
postMap.put("stepId",stepId); //专检创建
postMap.put("qty",qty); Map<String, Object> paramMap = new HashMap<>();
postMap.put("scrapQty",BigDecimal.ZERO); paramMap.put("SFC", sfc);
postMap.put("workHour",workHour); paramMap.put("SHOP_ORDER", StringUtil.trimHandle(sfcServiceById.getShopOrderBo()));
postMapList.add(postMap); paramMap.put("OPERATION", operation);
sfcCrossService.completeAction(site, currentRevisionRef.getHandle(), resrce, sfcServiceById.getHandle(), qty); paramMap.put("STEP_ID", stepId);
//更改派工单状态 String workShopBo = commonService.getWorkShopBo(HandleEnum.RESOURCE.getHandle(site, resrce));
sfcDispatchCommonService.updateSfcDispatchStatus(site, CommonMethods.getUser(), dispatchNo, DispatchStatusEnum.COMPLETE.getCode()); paramMap.put("WORK_CENTER", StringUtil.trimHandle(workShopBo));
paramMap.put("RESRCE", resrce);
paramMap.put("SFC_DISPATCH_DETAIL_BO", HandleEnum.SFC_DISPATCH.getHandle(site, dispatchNo));
} catch (Exception e) { inspectionItemDetails = inspectionItemService.selectQualityInspection(sfc, operation, stepId, Constants.INSPECTION_TYPE_P);
ExceptionUtil.throwException(e); if (inspectionItemDetails.size() > 0 && inspectionItemDetails.get(0) != null) {
paramMap.put("CATEGORY", Constants.INSPECTION_TYPE_P);
inspectionTaskService.createTask(paramMap);
} else {
paramMap.put("CATEGORY", Constants.INSPECTION_TYPE_P);
inspectionTaskService.createCompleteTask(paramMap);
}
//首件创建
inspectionItemDetails = inspectionItemService.selectQualityInspection(sfc, operation, stepId, Constants.INSPECTION_TYPE_S);
if (inspectionItemDetails.size() > 0 && inspectionItemDetails.get(0) != null) {
paramMap.put("CATEGORY", Constants.INSPECTION_TYPE_S);
inspectionTaskService.createTask(paramMap);
} }
//计算工时
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);
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) { public void materialConsumption(String site, String operation, String sfcBo, String stepId, String resource) {
@ -425,40 +405,31 @@ public class PodTemplateServiceImpl implements PodTemplateService {
} }
@Override @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]; ZprodordconfStruIn[] ins = new ZprodordconfStruIn[1];
for (int i=0;i<postMapList.size();i++){ Sfc sfcServiceById = sfcService.getById(HandleEnum.SFC.getHandle(CommonMethods.getSite(), sfc));
Map<String, Object> map = postMapList.get(i); String shopOrderBo = sfcServiceById.getShopOrderBo();
String sfc = (String)map.get("sfc"); String shopOrder = StringUtil.trimHandle(shopOrderBo);
Sfc sfcServiceById = sfcService.getById(HandleEnum.SFC.getHandle(CommonMethods.getSite(),sfc)); ZprodordconfStruIn struIn = new ZprodordconfStruIn();
String shopOrderBo = sfcServiceById.getShopOrderBo(); //生产订单
String shopOrder = StringUtil.trimHandle(shopOrderBo); struIn.setAufnr(shopOrder);
String stepId = (String)map.get("stepId"); //步骤标示
BigDecimal qty = (BigDecimal) map.get("qty"); struIn.setVornr(stepId);
BigDecimal scrapQty = (BigDecimal)map.get("scrapQty"); struIn.setAueru("1");
BigDecimal workHour = (BigDecimal)map.get("workHour"); //良品数量
ZprodordconfStruIn struIn = new ZprodordconfStruIn(); struIn.setLmnga(qty);
//生产订单 //报废数量
struIn.setAufnr(shopOrder); struIn.setXmnga(scrapQty);
//步骤标示 //机器工时
struIn.setVornr(stepId); struIn.setIsm01(workHour);
struIn.setAueru("1"); //人工工时
//良品数量 struIn.setIsm02(workHour);
struIn.setLmnga(qty); struIn.setIsm03(workHour);
//报废数量 struIn.setIsm04(workHour);
struIn.setXmnga(scrapQty); struIn.setIsm05(workHour);
//机器工时 struIn.setIsm06(workHour);
struIn.setIsm01(workHour); ins[0] = struIn;
//人工工时
struIn.setIsm02(workHour);
struIn.setIsm03(BigDecimal.ZERO);
struIn.setIsm04(BigDecimal.ZERO);
struIn.setIsm05(BigDecimal.ZERO);
struIn.setIsm06(BigDecimal.ZERO);
ins[i] = struIn;
}
TableOfZprodordconfStruInHolder inHolder = new TableOfZprodordconfStruInHolder(ins); TableOfZprodordconfStruInHolder inHolder = new TableOfZprodordconfStruInHolder(ins);
//返回对象 //返回对象
@ -477,13 +448,16 @@ public class PodTemplateServiceImpl implements PodTemplateService {
//调用WS //调用WS
try { try {
ERPAPI.erpWebService().zmesProdordconf(inHolder, outHolder); ERPAPI.erpWebService().zmesProdordconf(inHolder, outHolder);
if (outHolder.value.length == 1) {
throw new BaseException("ERP接口返回错误");
}
String status = outHolder.value[1].getRet(); String status = outHolder.value[1].getRet();
String message = outHolder.value[1].getMsg(); String message = outHolder.value[1].getMsg();
if (status.equals("E")) { if (!status.equals("S")) {
throw new BaseException("ERP接口返回:状态:" + status + ",消息:" + message); throw new BaseException("ERP接口返回错误消息:" + message);
} }
} catch (RemoteException e) { } catch (RemoteException e) {
ExceptionUtil.throwException(e); throw new BaseException("ERP接口错误: " + e.getMessage());
} finally { } finally {
//记录接口日志 //记录接口日志
IntegrationLog log = new IntegrationLog(); IntegrationLog log = new IntegrationLog();
@ -493,7 +467,7 @@ public class PodTemplateServiceImpl implements PodTemplateService {
log.setCategory("REQUEST"); log.setCategory("REQUEST");
log.setIntegrationWay("ERP"); log.setIntegrationWay("ERP");
log.setIntegrationMethod("erpWebService.zmesProdordconf"); log.setIntegrationMethod("erpWebService.zmesProdordconf");
log.setParam(inHolder.toString()); log.setParam(Arrays.toString(ins));
log.setStatus(outHolder.value[1].getRet()); log.setStatus(outHolder.value[1].getRet());
log.setResultMessage(outHolder.value[1].getMsg()); log.setResultMessage(outHolder.value[1].getMsg());
log.setTransactionId(""); log.setTransactionId("");

@ -17,105 +17,111 @@ import java.time.LocalDateTime;
* </p> * </p>
* *
* @author Philip * @author Philip
* @since 2021-06-21 * @since 2021-08-16
*/ */
@TableName("Z_SELF_REPORT") @TableName("Z_SELF_REPORT")
public class SelfReport extends Model<SelfReport> { public class SelfReport extends Model<SelfReport> {
private static final long serialVersionUID = 1L; private static final long serialVersionUID = 1L;
/** /**
* *
*/ */
@TableId(value = "HANDLE", type = IdType.INPUT) @TableId(value = "HANDLE", type = IdType.INPUT)
private String handle; private String handle;
/** /**
* *
*/ */
@TableField("SITE") @TableField("SITE")
private String site; private String site;
/** /**
* *
*/ */
@TableField("TASK_NO") @TableField("TASK_NO")
private String taskNo; private String taskNo;
/** /**
* *
*/ */
@TableField("WORK_CENTER") @TableField("WORK_CENTER")
private String workCenter; private String workCenter;
/** /**
* *
*/ */
@TableField("SHOP_ORDER") @TableField("SHOP_ORDER")
private String shopOrder; private String shopOrder;
/** /**
* *
*/ */
@TableField("ITEM") @TableField("ITEM")
private String item; private String item;
/** /**
* / * /
*/ */
@TableField("OP_STEP") @TableField("OP_STEP")
private String opStep; private String opStep;
/** /**
* *
*/ */
@TableField("RESRCE") @TableField("RESRCE")
private String resrce; private String resrce;
/** /**
* *
*/ */
@TableField("SFC") @TableField("SFC")
private String sfc; private String sfc;
/** /**
* *
*/ */
@TableField("NC_CODE") @TableField("NC_CODE")
private String ncCode; private String ncCode;
/** /**
* *
*/ */
@TableField("NC_QTY") @TableField("NC_QTY")
private BigDecimal ncQty; private BigDecimal ncQty;
/** /**
* *
*/ */
@TableField("LOCATION") @TableField("LOCATION")
private String location; private String location;
/** /**
* |NEW|CONF|REJ * |NEW|CONF|REJ
*/ */
@TableField("STATE") @TableField("STATE")
private String state; private String state;
/** /**
* *
*/ */
@TableField("REMARK") @TableField("REMARK")
private String remark; private String remark;
/** /**
* *
*/ */
@TableField("CREATE_USER") @TableField("CREATE_USER")
private String createUser; private String createUser;
/** /**
* *
*/ */
@TableField("CREATED_DATE_TIME") @TableField("CREATED_DATE_TIME")
private LocalDateTime createdDateTime; private LocalDateTime createdDateTime;
/** /**
* *
*/ */
@TableField("MODIFY_USER") @TableField("MODIFY_USER")
private String modifyUser; private String modifyUser;
/** /**
* *
*/ */
@TableField("MODIFIED_DATE_TIME") @TableField("MODIFIED_DATE_TIME")
private LocalDateTime modifiedDateTime; private LocalDateTime modifiedDateTime;
/**
*
*/
@TableField("NC_CODE_DESC")
private String ncCodeDesc;
/** /**
* *
*/ */
@ -302,41 +308,51 @@ public class SelfReport extends Model<SelfReport> {
this.modifiedDateTime = modifiedDateTime; this.modifiedDateTime = modifiedDateTime;
} }
public static final String HANDLE = "HANDLE"; 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";
public static final String SITE = "SITE"; public static final String TASK_NO = "TASK_NO";
public static final String TASK_NO = "TASK_NO"; public static final String WORK_CENTER = "WORK_CENTER";
public static final String WORK_CENTER = "WORK_CENTER"; public static final String SHOP_ORDER = "SHOP_ORDER";
public static final String SHOP_ORDER = "SHOP_ORDER"; public static final String ITEM = "ITEM";
public static final String ITEM = "ITEM"; public static final String OP_STEP = "OP_STEP";
public static final String OP_STEP = "OP_STEP"; public static final String RESRCE = "RESRCE";
public static final String RESRCE = "RESRCE"; public static final String SFC = "SFC";
public static final String SFC = "SFC"; public static final String NC_CODE = "NC_CODE";
public static final String NC_CODE = "NC_CODE"; public static final String NC_QTY = "NC_QTY";
public static final String NC_QTY = "NC_QTY"; public static final String LOCATION = "LOCATION";
public static final String LOCATION = "LOCATION"; public static final String STATE = "STATE";
public static final String STATE = "STATE"; public static final String REMARK = "REMARK";
public static final String REMARK = "REMARK"; public static final String CREATE_USER = "CREATE_USER";
public static final String CREATE_USER = "CREATE_USER"; public static final String CREATED_DATE_TIME = "CREATED_DATE_TIME";
public static final String CREATED_DATE_TIME = "CREATED_DATE_TIME"; public static final String MODIFY_USER = "MODIFY_USER";
public static final String MODIFY_USER = "MODIFY_USER"; public static final String MODIFIED_DATE_TIME = "MODIFIED_DATE_TIME";
public static final String MODIFIED_DATE_TIME = "MODIFIED_DATE_TIME"; public static final String NC_CODE_DESC = "NC_CODE_DESC";
@Override @Override
@ -347,24 +363,25 @@ public class SelfReport extends Model<SelfReport> {
@Override @Override
public String toString() { public String toString() {
return "SelfReport{" + return "SelfReport{" +
"handle = " + handle + "handle = " + handle +
", site = " + site + ", site = " + site +
", taskNo = " + taskNo + ", taskNo = " + taskNo +
", workCenter = " + workCenter + ", workCenter = " + workCenter +
", shopOrder = " + shopOrder + ", shopOrder = " + shopOrder +
", item = " + item + ", item = " + item +
", opStep = " + opStep + ", opStep = " + opStep +
", resrce = " + resrce + ", resrce = " + resrce +
", sfc = " + sfc + ", sfc = " + sfc +
", ncCode = " + ncCode + ", ncCode = " + ncCode +
", ncQty = " + ncQty + ", ncQty = " + ncQty +
", location = " + location + ", location = " + location +
", state = " + state + ", state = " + state +
", remark = " + remark + ", remark = " + remark +
", createUser = " + createUser + ", createUser = " + createUser +
", createdDateTime = " + createdDateTime + ", createdDateTime = " + createdDateTime +
", modifyUser = " + modifyUser + ", modifyUser = " + modifyUser +
", modifiedDateTime = " + modifiedDateTime + ", 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.AnomalyService;
import com.foreverwin.mesnac.common.service.CommonService; import com.foreverwin.mesnac.common.service.CommonService;
import com.foreverwin.mesnac.common.util.StringUtil; 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.dto.SfcDto;
import com.foreverwin.mesnac.meapi.service.NcCodeService;
import com.foreverwin.mesnac.production.mapper.SfcCrossMapper; import com.foreverwin.mesnac.production.mapper.SfcCrossMapper;
import com.foreverwin.mesnac.quality.dto.SelfReportRequest; import com.foreverwin.mesnac.quality.dto.SelfReportRequest;
import com.foreverwin.mesnac.quality.mapper.SelfReportMapper; import com.foreverwin.mesnac.quality.mapper.SelfReportMapper;
@ -55,6 +57,8 @@ public class SelfReportServiceImpl extends ServiceImpl<SelfReportMapper, SelfRep
private AnomalyService anomalyService; private AnomalyService anomalyService;
@Autowired @Autowired
private CommonService commonService; private CommonService commonService;
@Autowired
private NcCodeService ncCodeService;
@Override @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()); List<SelfReportRequest> selfReportList = list.stream().filter(selfReportRequest -> selfReportRequest.getType().equals("Z")).collect(Collectors.toList());
if (selfReportList.size()>0){ if (selfReportList.size()>0){
StringBuilder stringBuilder = new StringBuilder(); StringBuilder stringBuilder = new StringBuilder();
StringBuilder description = new StringBuilder();
for (int i=0;i<selfReportList.size();i++){ 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){ if (i!=selfReportList.size()-1){
stringBuilder.append(","); stringBuilder.append(",");
description.append(",");
} }
} }
Date date = new Date(System.currentTimeMillis()); Date date = new Date(System.currentTimeMillis());
@ -157,6 +166,7 @@ public class SelfReportServiceImpl extends ServiceImpl<SelfReportMapper, SelfRep
selfReport.setResrce(resrce); selfReport.setResrce(resrce);
selfReport.setSfc(sfc); selfReport.setSfc(sfc);
selfReport.setNcCode(stringBuilder.toString()); selfReport.setNcCode(stringBuilder.toString());
selfReport.setNcCodeDesc(description.toString());
selfReport.setNcQty(new BigDecimal(ncQty)); selfReport.setNcQty(new BigDecimal(ncQty));
selfReport.setLocation(location); selfReport.setLocation(location);
selfReport.setState(Constants.STATUS_NEW); selfReport.setState(Constants.STATUS_NEW);

@ -22,11 +22,12 @@
<result column="CREATED_DATE_TIME" property="createdDateTime" /> <result column="CREATED_DATE_TIME" property="createdDateTime" />
<result column="MODIFY_USER" property="modifyUser" /> <result column="MODIFY_USER" property="modifyUser" />
<result column="MODIFIED_DATE_TIME" property="modifiedDateTime" /> <result column="MODIFIED_DATE_TIME" property="modifiedDateTime" />
<result column="NC_CODE_DESC" property="ncCodeDesc" />
</resultMap> </resultMap>
<!-- 通用查询结果列 --> <!-- 通用查询结果列 -->
<sql id="Base_Column_List"> <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> </sql>
<!-- BaseMapper标准查询/修改/删除 --> <!-- BaseMapper标准查询/修改/删除 -->
@ -78,6 +79,7 @@
<if test="ew.entity.createdDateTime!=null"> AND CREATED_DATE_TIME=#{ew.entity.createdDateTime}</if> <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.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.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> </where>
</select> </select>
@ -106,6 +108,7 @@
<if test="ew.entity.createdDateTime!=null"> AND CREATED_DATE_TIME=#{ew.entity.createdDateTime}</if> <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.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.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>
<if test="ew!=null and ew.sqlSegment!=null and ew.nonEmptyOfWhere"> <if test="ew!=null and ew.sqlSegment!=null and ew.nonEmptyOfWhere">
${ew.sqlSegment} ${ew.sqlSegment}
@ -142,6 +145,7 @@
<if test="ew.entity.createdDateTime!=null"> AND CREATED_DATE_TIME=#{ew.entity.createdDateTime}</if> <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.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.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>
<if test="ew!=null and ew.sqlSegment!=null and ew.nonEmptyOfWhere"> <if test="ew!=null and ew.sqlSegment!=null and ew.nonEmptyOfWhere">
${ew.sqlSegment} ${ew.sqlSegment}
@ -152,46 +156,6 @@
${ew.sqlSegment} ${ew.sqlSegment}
</if> </if>
</select> </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 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 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.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.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.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>
<if test="ew!=null and ew.sqlSegment!=null and ew.nonEmptyOfWhere"> <if test="ew!=null and ew.sqlSegment!=null and ew.nonEmptyOfWhere">
${ew.sqlSegment} ${ew.sqlSegment}
@ -254,6 +219,7 @@
<if test="ew.entity.createdDateTime!=null"> AND CREATED_DATE_TIME=#{ew.entity.createdDateTime}</if> <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.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.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>
<if test="ew!=null and ew.sqlSegment!=null and ew.nonEmptyOfWhere"> <if test="ew!=null and ew.sqlSegment!=null and ew.nonEmptyOfWhere">
${ew.sqlSegment} ${ew.sqlSegment}
@ -290,6 +256,7 @@
<if test="ew.entity.createdDateTime!=null"> AND CREATED_DATE_TIME=#{ew.entity.createdDateTime}</if> <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.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.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>
<if test="ew!=null and ew.sqlSegment!=null and ew.nonEmptyOfWhere"> <if test="ew!=null and ew.sqlSegment!=null and ew.nonEmptyOfWhere">
${ew.sqlSegment} ${ew.sqlSegment}
@ -326,6 +293,7 @@
<if test="ew.entity.createdDateTime!=null"> AND CREATED_DATE_TIME=#{ew.entity.createdDateTime}</if> <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.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.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>
<if test="ew!=null and ew.sqlSegment!=null and ew.nonEmptyOfWhere"> <if test="ew!=null and ew.sqlSegment!=null and ew.nonEmptyOfWhere">
${ew.sqlSegment} ${ew.sqlSegment}
@ -358,6 +326,7 @@
<if test="createdDateTime!=null">CREATED_DATE_TIME,</if> <if test="createdDateTime!=null">CREATED_DATE_TIME,</if>
<if test="modifyUser!=null">MODIFY_USER,</if> <if test="modifyUser!=null">MODIFY_USER,</if>
<if test="modifiedDateTime!=null">MODIFIED_DATE_TIME,</if> <if test="modifiedDateTime!=null">MODIFIED_DATE_TIME,</if>
<if test="ncCodeDesc!=null">NC_CODE_DESC,</if>
</trim> VALUES </trim> VALUES
<trim prefix="(" suffix=")" suffixOverrides=","> <trim prefix="(" suffix=")" suffixOverrides=",">
#{handle}, #{handle},
@ -378,6 +347,7 @@
<if test="createdDateTime!=null">#{createdDateTime},</if> <if test="createdDateTime!=null">#{createdDateTime},</if>
<if test="modifyUser!=null">#{modifyUser},</if> <if test="modifyUser!=null">#{modifyUser},</if>
<if test="modifiedDateTime!=null">#{modifiedDateTime},</if> <if test="modifiedDateTime!=null">#{modifiedDateTime},</if>
<if test="ncCodeDesc!=null">#{ncCodeDesc},</if>
</trim> </trim>
</insert> </insert>
@ -405,6 +375,7 @@
#{createdDateTime}, #{createdDateTime},
#{modifyUser}, #{modifyUser},
#{modifiedDateTime}, #{modifiedDateTime},
#{ncCodeDesc},
</trim> </trim>
</insert> </insert>
@ -428,6 +399,7 @@
<if test="et.createdDateTime!=null">CREATED_DATE_TIME=#{et.createdDateTime},</if> <if test="et.createdDateTime!=null">CREATED_DATE_TIME=#{et.createdDateTime},</if>
<if test="et.modifyUser!=null">MODIFY_USER=#{et.modifyUser},</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.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> </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> </update>
@ -451,6 +423,7 @@
CREATED_DATE_TIME=#{et.createdDateTime}, CREATED_DATE_TIME=#{et.createdDateTime},
MODIFY_USER=#{et.modifyUser}, MODIFY_USER=#{et.modifyUser},
MODIFIED_DATE_TIME=#{et.modifiedDateTime}, 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> </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> </update>
@ -474,6 +447,7 @@
<if test="et.createdDateTime!=null">CREATED_DATE_TIME=#{et.createdDateTime},</if> <if test="et.createdDateTime!=null">CREATED_DATE_TIME=#{et.createdDateTime},</if>
<if test="et.modifyUser!=null">MODIFY_USER=#{et.modifyUser},</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.modifiedDateTime!=null">MODIFIED_DATE_TIME=#{et.modifiedDateTime},</if>
<if test="et.ncCodeDesc!=null">NC_CODE_DESC=#{et.ncCodeDesc},</if>
</trim> </trim>
<where> <where>
<if test="ew!=null"> <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.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.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.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>
<if test="ew!=null and ew.sqlSegment!=null and ew.nonEmptyOfWhere"> <if test="ew!=null and ew.sqlSegment!=null and ew.nonEmptyOfWhere">
${ew.sqlSegment} ${ew.sqlSegment}
@ -549,6 +524,7 @@
<if test="ew.entity.createdDateTime!=null"> AND CREATED_DATE_TIME=#{ew.entity.createdDateTime}</if> <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.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.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>
<if test="ew!=null and ew.sqlSegment!=null and ew.nonEmptyOfWhere"> <if test="ew!=null and ew.sqlSegment!=null and ew.nonEmptyOfWhere">
${ew.sqlSegment} ${ew.sqlSegment}
@ -566,5 +542,44 @@
</foreach>) </foreach>)
</delete> </delete>
<!-- BaseMapper标准查询/修改/删除 --> <!-- 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> </mapper>

Loading…
Cancel
Save