质量异常模块提交

赵嘉伟 4 years ago
parent 0554ca83e9
commit 52099503c6

@ -21,15 +21,15 @@ import java.util.List;
/**
*
* @author robert
* @since 2021-07-05
* @author
* @since 2021-07-14
*/
@RestController
@RequestMapping("/Z-ABNORMAL-BILL")
public class AbnormalBillController {
@Autowired
private AbnormalBillService abnormalBillService;
public AbnormalBillService abnormalBillService;
@Autowired
private SfcDispatchCommonService sfcDispatchCommonService;
@ -41,10 +41,6 @@ public class AbnormalBillController {
public AnomalyService anomalyService;
/**
* id
*
@ -94,6 +90,7 @@ public class AbnormalBillController {
.or().like(AbnormalBill::getType, frontPage.getGlobalQuery())
.or().like(AbnormalBill::getItemBo, frontPage.getGlobalQuery())
.or().like(AbnormalBill::getSfc, frontPage.getGlobalQuery())
.or().like(AbnormalBill::getOperation, frontPage.getGlobalQuery())
.or().like(AbnormalBill::getWorkCenter, frontPage.getGlobalQuery())
.or().like(AbnormalBill::getShopOrder, frontPage.getGlobalQuery())
.or().like(AbnormalBill::getMessageType, frontPage.getGlobalQuery())
@ -176,10 +173,6 @@ public class AbnormalBillController {
return R.ok(abnormalBillService.init(messageType,type));
}
// @GetMapping("/findAllUserByUserGroup")
// public R findAllUserByUserGroup(String site, String userGroups){
// return R.ok();
// }
/**
*
@ -313,7 +306,9 @@ public class AbnormalBillController {
@PostMapping("/delete")
public R delete(String ftpPath,String fileName){
return R.ok(fileUploadedService.deleteFile(ftpPath,fileName));
fileUploadedService.deleteFile(ftpPath,fileName);
// abnormalBillService.deleteFileInDatabase(ftpPath,fileName);
return R.ok();
}
@GetMapping("/findUploadPictureByAbnormalBo")
@ -326,14 +321,10 @@ public class AbnormalBillController {
return R.ok(abnormalBillService.getNextNumber(type));
}
// @GetMapping("/test")
// public R test(String category, String resource, String shopOrder, String sfc, String ncCodes ){
// anomalyService.createAnomalyTask(category,resource,shopOrder,sfc,ncCodes);
// return R.ok();
// }
@GetMapping("/anomalyReveseRepair")
public R anomalyReveseRepair(AbnormalBill abnormalBill,AbnormalBillDispose abnormalBillDispose){
public R anomalyReveseRepair(AbnormalBill abnormalBill, AbnormalBillDispose abnormalBillDispose){
return R.ok(abnormalBillService.anomalyReveseRepair(abnormalBill,abnormalBillDispose));
}
}

@ -154,6 +154,17 @@ public class AbnormalBillDisposeDto extends AbnormalBillDispose {
*/
private String fullName;
/**
*
*/
private String operation;
/**
*
* @return
*/
private String ncCodeDescription;
public String getAbnormalNo() {
return abnormalNo;
}
@ -385,4 +396,20 @@ public class AbnormalBillDisposeDto extends AbnormalBillDispose {
public void setFullName(String fullName) {
this.fullName = fullName;
}
public String getNcCodeDescription() {
return ncCodeDescription;
}
public void setNcCodeDescription(String ncCodeDescription) {
this.ncCodeDescription = ncCodeDescription;
}
public String getOperation() {
return operation;
}
public void setOperation(String operation) {
this.operation = operation;
}
}

@ -2,7 +2,6 @@ package com.foreverwin.mesnac.anomaly.mapper;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.foreverwin.mesnac.anomaly.dto.AbnormalBillDisposeDto;
import com.foreverwin.mesnac.anomaly.dto.AbnormalBillDto;
import com.foreverwin.mesnac.anomaly.model.AbnormalBill;
import com.foreverwin.mesnac.anomaly.model.AbnormalBillDispose;
import org.apache.ibatis.annotations.Param;

@ -10,14 +10,16 @@ import java.util.List;
/**
* <p>
* Mapper
* Mapper
* </p>
*
* @author robert
* @since 2021-07-05
* @author
* @since 2021-07-14
*/
@Repository
public interface AbnormalBillMapper extends BaseMapper<AbnormalBill> {
List<AbnormalBillDto> backLog(@Param("abnormalBill")AbnormalBillDto abnormalBillDto, @Param("language")String language);
/**
@ -30,4 +32,5 @@ public interface AbnormalBillMapper extends BaseMapper<AbnormalBill> {
List<AbnormalBill> findCountBySfc(@Param("site")String site,@Param("type")String type,@Param("sfc")String sfc,@Param("status")List<String> status);
}

@ -11,11 +11,11 @@ import java.time.LocalDateTime;
/**
* <p>
*
*
* </p>
*
* @author robert
* @since 2021-07-05
* @author
* @since 2021-07-14
*/
@TableName("Z_ABNORMAL_BILL")
@ -59,6 +59,11 @@ public class AbnormalBill extends Model<AbnormalBill> {
*/
@TableField("SFC")
private String sfc;
/**
*
*/
@TableField("OPERATION")
private String operation;
/**
*
*/
@ -146,6 +151,7 @@ public class AbnormalBill extends Model<AbnormalBill> {
private String entityLocation;
/**
* B J R Z
| C Y |
*/
@TableField("REPORT_FROM")
private String reportFrom;
@ -209,6 +215,8 @@ public class AbnormalBill extends Model<AbnormalBill> {
@TableField(exist = false)
private String fileNum;
public String getHandle() {
return handle;
}
@ -265,6 +273,14 @@ public class AbnormalBill extends Model<AbnormalBill> {
this.sfc = sfc;
}
public String getOperation() {
return operation;
}
public void setOperation(String operation) {
this.operation = operation;
}
public String getWorkCenter() {
return workCenter;
}
@ -527,6 +543,8 @@ public static final String ITEM_BO = "ITEM_BO";
public static final String SFC = "SFC";
public static final String OPERATION = "OPERATION";
public static final String WORK_CENTER = "WORK_CENTER";
public static final String SHOP_ORDER = "SHOP_ORDER";
@ -599,6 +617,7 @@ public static final String MODIFIED_DATE_TIME = "MODIFIED_DATE_TIME";
", type = " + type +
", itemBo = " + itemBo +
", sfc = " + sfc +
", operation = " + operation +
", workCenter = " + workCenter +
", shopOrder = " + shopOrder +
", messageType = " + messageType +

@ -14,11 +14,11 @@ import java.util.List;
/**
* <p>
*
*
* </p>
*
* @author robert
* @since 2021-07-05
* @author
* @since 2021-07-14
*/
public interface AbnormalBillService extends IService<AbnormalBill> {
@ -56,7 +56,7 @@ public interface AbnormalBillService extends IService<AbnormalBill> {
/**
*
*/
HashMap<String,Object> init(String messageType,String type);
HashMap<String,Object> init(String messageType, String type);
/**
*
* @param abnormalBillDto
@ -121,4 +121,6 @@ public interface AbnormalBillService extends IService<AbnormalBill> {
HashMap<String,Object> anomalyReveseRepair(AbnormalBill abnormalBill,AbnormalBillDispose abnormalBillDispose);
// void deleteFileInDatabase(String ftpPath,String fileName);
}

@ -17,10 +17,10 @@ import com.foreverwin.mesnac.common.util.StringUtil;
import com.foreverwin.mesnac.meapi.mapper.*;
import com.foreverwin.mesnac.meapi.model.*;
import com.foreverwin.mesnac.meapi.service.*;
import com.foreverwin.modular.core.exception.BaseException;
import com.foreverwin.modular.core.exception.BusinessException;
import com.foreverwin.modular.core.util.CommonMethods;
import com.foreverwin.modular.core.util.FrontPage;
import com.visiprise.common.exception.BaseException;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.context.i18n.LocaleContextHolder;
import org.springframework.stereotype.Service;
@ -31,18 +31,17 @@ import java.util.*;
/**
* <p>
*
*
* </p>
*
* @author robert
* @since 2021-07-05
* @author
* @since 2021-07-14
*/
@Service
@Transactional(rollbackFor = Exception.class)
public class AbnormalBillServiceImpl extends ServiceImpl<AbnormalBillMapper, AbnormalBill> implements AbnormalBillService, AnomalyService {
@Autowired
private AbnormalBillMapper abnormalBillMapper;
@ -100,8 +99,6 @@ public class AbnormalBillServiceImpl extends ServiceImpl<AbnormalBillMapper, Abn
@Autowired
private NcCodeMapper ncCodeMapper;
@Override
public IPage<AbnormalBill> selectPage(FrontPage<AbnormalBill> frontPage, AbnormalBill abnormalBill) {
QueryWrapper<AbnormalBill> queryWrapper = new QueryWrapper<>();
@ -116,6 +113,7 @@ public class AbnormalBillServiceImpl extends ServiceImpl<AbnormalBillMapper, Abn
return super.list(queryWrapper);
}
@Override
public String anomalyReportOther(AbnormalBill abnormalBill,
AbnormalBillDispose abnormalBillDispose,
@ -188,10 +186,6 @@ public class AbnormalBillServiceImpl extends ServiceImpl<AbnormalBillMapper, Abn
// List<NcCode> ncByNG = ncCodeService.findNcByNG(abnormalBill.getMessageType(), abnormalBill.getNcCode());
// if(ncByNG == null || ncByNG.size() <= 0){
// throw BusinessException.build("该消息类型下没有该不良代码");
// }
this.saveOrUpdate(abnormalBill);
abnormalBillDisposeService.saveOrUpdate(abnormalBillDispose);
@ -208,22 +202,18 @@ public class AbnormalBillServiceImpl extends ServiceImpl<AbnormalBillMapper, Abn
throw BusinessException.build("设备异常有未处理完成的sfc");
}
}
return message;
}
@Override
public HashMap<String, Object> init(String messageType,String type) {
public HashMap<String, Object> init(String messageType, String type) {
HashMap<String, Object> hashMap = new HashMap<>();
String site = CommonMethods.getSite();
//消息类型
if("Z".equals(type)){
List<NcCode> category = ncCodeService.findNcByCategory(messageType,null);
hashMap.put("ncByNG",category);
}
// if("Z".equals(type)){
// List<NcCode> category = ncCodeService.findNcByCategory(messageType,null);
// hashMap.put("ncByNG",category);
// }
//工作中心
WorkCenter workCenter = new WorkCenter();
workCenter.setWcCategory("LEVEL4");
@ -231,10 +221,10 @@ public class AbnormalBillServiceImpl extends ServiceImpl<AbnormalBillMapper, Abn
List<WorkCenter> workCenterList = workCenterService.selectList(workCenter);
hashMap.put("workCenter",workCenterList);
//原因分类
NcCode ncCode = new NcCode();
DataField ncCode = new DataField();
ncCode.setSite(site);
ncCode.setNcCategory("REPAIR");
List<NcCode> ncCodeList = ncCodeService.selectList(ncCode);
ncCode.setDataField("REASON_CATEGORY");
List<DataField> ncCodeList = dataFieldListService.findDataFieldListById(ncCode);
hashMap.put("causeType",ncCodeList);
//责任部门
DataField dataField = new DataField();
@ -668,6 +658,8 @@ public class AbnormalBillServiceImpl extends ServiceImpl<AbnormalBillMapper, Abn
return hashMap;
}
@Override
public void createAnomalyTask(String category, String resource, String shopOrder, String sfc, String ncCodes,String position,String ncQty,String ncDescription) {
String site = CommonMethods.getSite();
@ -721,10 +713,5 @@ public class AbnormalBillServiceImpl extends ServiceImpl<AbnormalBillMapper, Abn
this.saveOrUpdate(abnormalBill);
abnormalBillDisposeService.saveOrUpdate(abnormalBillDispose);
}
}
}

@ -8,6 +8,7 @@ import com.foreverwin.modular.core.util.CommonMethods;
import org.apache.commons.fileupload.FileItem;
import org.apache.commons.net.ftp.FTP;
import org.apache.commons.net.ftp.FTPClient;
import org.apache.commons.net.ftp.FTPFile;
import org.apache.commons.net.ftp.FTPReply;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
@ -23,8 +24,6 @@ import java.io.ByteArrayOutputStream;
import java.io.IOException;
import java.io.InputStream;
import java.io.OutputStream;
import java.time.LocalDate;
import java.time.format.DateTimeFormatter;
/**
* @Description TODO
@ -58,14 +57,12 @@ public class FileUploadedServiceImpl implements FileUploadedService {
if (StringUtil.isBlank(site)) {
site = CommonMethods.getSite();
}
//上传附件目录:年/月/日
String path = LocalDate.now().format(DateTimeFormatter.ofPattern("yyyy/MM/dd"))+"/"+taskNo;
//上传附件名称
String fileName = fileItem.getOriginalFilename();
try {
Ftp ftp = new Ftp(host, port,username,password);
ftp.upload(path, fileName, fileItem.getInputStream());
ftp.upload(taskNo, fileName, fileItem.getInputStream());
ftp.close();
} catch (IOException e) {
logger.info(e.getMessage());
@ -145,8 +142,16 @@ public class FileUploadedServiceImpl implements FileUploadedService {
// 设置编码格式
ftpClient.setControlEncoding("GBK");
//切换FTP目录
ftpClient.changeWorkingDirectory(pathname);
ftpClient.dele(filename);
if(StringUtil.isBlank(filename)){
ftpClient.changeWorkingDirectory(pathname);
FTPFile[] ftpFiles = ftpClient.listFiles();
for (FTPFile ftpFile : ftpFiles) {
ftpClient.dele(ftpFile.getName());
}
}else{
ftpClient.changeWorkingDirectory(pathname);
ftpClient.dele(filename);
}
ftpClient.logout();
flag = true;
return true;
@ -172,20 +177,15 @@ public class FileUploadedServiceImpl implements FileUploadedService {
if (StringUtil.isBlank(site)) {
site = CommonMethods.getSite();
}
//上传附件目录:年/月/日
String path = LocalDate.now().format(DateTimeFormatter.ofPattern("yyyy/MM/dd"))+"/"+taskNo;
//上传附件名称
String fileName = fileItem.getName();
try {
Ftp ftp = new Ftp(host, port,username,password);
ftp.upload(path, fileName, fileItem.getInputStream());
ftp.upload(fileName, fileName, fileItem.getInputStream());
ftp.close();
} catch (IOException e) {
logger.info(e.getMessage());
throw BusinessException.build("" + e.getMessage());
}
}
}

@ -47,6 +47,7 @@
<result column="WORK_ORDER" property="workOrder"/>
<result column="ITEM_NUMBER" property="itemNumber"/>
<result column="NC_CODE" property="ncCode"/>
<result column="NC_CODE_DESCRIPTION" property="ncCodeDescription"/>
<result column="PRODUCT_CATEGORY" property="productCategory"/>
<result column="MAP" property="map"/>
<result column="PB_DESCRIPTION" property="pbDescription"/>
@ -63,6 +64,7 @@
<result column="ROUTER" property="router"/>
<result column="RESRCE_DESCRIPTION" property="resrceDescription"/>
<result column="FULL_NAME" property="fullName"/>
<result column="OPERATION" property="operation"/>
</resultMap>
<!-- 通用查询结果列 -->
@ -617,14 +619,15 @@
SELECT ZAB.ABNORMAL_NO ABNORMAL_NO ,ZAB.STATUS STATUS,I.ITEM ITEM,IT.DESCRIPTION ITEM_DESCRIPTION,
ZAB."TYPE" "TYPE" ,ZAB.SFC SFC,ZAB.MESSAGE_TYPE MESSAGE_TYPE,ZAB.SHOP_ORDER SHOP_ORDER,
ZAB.WORK_CENTER WORK_CENTER,ZAB.RESRCE RESRCE, WORKORDER.VALUE WORK_ORDER,ITEMNUMBER.VALUE ITEM_NUMBER,
PRODUCTCATEGORY.VALUE PRODUCT_CATEGORY,listagg(NCT2.DESCRIPTION || '/'||NCT.DESCRIPTION || ',') within GROUP(ORDER BY zab.ABNORMAL_NO) NC_CODE , ZAB.PB_DESCRIPTION PB_DESCRIPTION ,ZAB.NC_QTY NC_QTY,
PRODUCTCATEGORY.VALUE PRODUCT_CATEGORY,listagg(NG.DESCRIPTION || '/'||NCT.DESCRIPTION || ',') within GROUP(ORDER BY zab.ABNORMAL_NO) NC_CODE_DESCRIPTION,
ZAB.PB_DESCRIPTION PB_DESCRIPTION ,ZAB.NC_QTY NC_QTY,
ZAB.PB_GRADE PB_GRADE ,NWA.FULL_NAME PB_USER ,ZAB.PB_QTY PB_QTY ,ZAB.DISCOVER DISCOVER ,
ZAB.INSPECTOR INSPECTOR ,ZAB.ENTITY_LOCATION ENTITY_LOCATION ,ZAB.REPORT_FROM REPORT_FROM ,ZAB.OBJECT_BO OBJECT_BO ,
ZAB.PB_PHOTOSHOP PB_PHOTOSHOP,ZABD.DUTY_CAUSE_DESCRIPTION DUTY_CAUSE_DESCRIPTION,ZABD.DUTY_CAUSE_TYPE DUTY_CAUSE_TYPE,ZABD.DUTY_DEPART DUTY_DEPART,
ZABD.DUTY_SEND_USER_GROUP DUTY_SEND_USER_GROUP,ZABD.DUTY_TYPE DUTY_TYPE,ZABD.PRINCIPAL_USER PRINCIPAL_USER,ZABD.ABNORMAL_METHOD ABNORMAL_METHOD,
R.ROUTER ROUTER,ZABD.RESOLVE_SHOP_ORDER RESOLVE_SHOP_ORDER,ZABD.RESOLVE_REMARK RESOLVE_REMARK,ZABD.RESOLVE_SEND_USER RESOLVE_SEND_USER,
ZABD.ABNORMAL_REASON ABNORMAL_REASON,ZABD.BEFORE_MEASURE BEFORE_MEASURE,"MAP".VALUE "MAP",
ZABD.ROUTER_BO ROUTER_BO
ZABD.ABNORMAL_REASON ABNORMAL_REASON,ZABD.BEFORE_MEASURE BEFORE_MEASURE,"MAP".VALUE "MAP",listagg(ZANC.NC_CODE_GROUP || '/'||ZANC.NC_CODE || ',') within GROUP(ORDER BY zab.ABNORMAL_NO) NC_CODE,
ZABD.ROUTER_BO ROUTER_BO,ZAB.OPERATION OPERATION
FROM Z_ABNORMAL_BILL ZAB
LEFT JOIN Z_ABNORMAL_BILL_DISPOSE ZABD ON ZAB.HANDLE = ZABD.ABNORMAL_BILL_BO
INNER JOIN ITEM I ON I.HANDLE = ZAB.ITEM_BO
@ -637,7 +640,7 @@
LEFT JOIN Z_ABNORMAL_NC_CODE ZANC ON ZAB.HANDLE = ZANC.ABNORMAL_BILL_BO
LEFT JOIN NC_CODE_T NCT ON ('NCCodeBO:' || ZAB.SITE || ',' || ZANC.NC_CODE) = NCT.NC_CODE_BO AND NCT.LOCALE = #{language}
INNER JOIN Z_NWA_USER NWA ON NWA.USER_NAME = ZAB.PB_USER AND NWA.SITE = ZAB.SITE
LEFT JOIN NC_CODE_T NCT2 ON ('NCCodeBO:' || ZAB.SITE || ',' || ZANC.NC_CODE_GROUP) = NCT2.NC_CODE_BO AND NCT2.LOCALE = #{language}
LEFT JOIN NC_GROUP NG ON NG.NC_GROUP = ZANC.NC_CODE_GROUP AND NG.SITE = ZAB.SITE
LEFT JOIN ROUTER R ON SUBSTR(R.HANDLE,1,INSTR(R.HANDLE,',',-1)-1) = SUBSTR(ZABD.ROUTER_BO,1,INSTR(ZABD.ROUTER_BO,',',-1)-1) AND R.CURRENT_REVISION = 'true'
<where>
<if test="abnormalBill != null">
@ -659,7 +662,7 @@
ZAB.PB_PHOTOSHOP ,ZABD.DUTY_CAUSE_DESCRIPTION ,ZABD.DUTY_CAUSE_TYPE ,ZABD.DUTY_DEPART ,
ZABD.DUTY_SEND_USER_GROUP ,ZABD.DUTY_TYPE ,ZABD.PRINCIPAL_USER ,ZABD.ABNORMAL_METHOD ,
R.ROUTER ,ZABD.RESOLVE_SHOP_ORDER ,ZABD.RESOLVE_REMARK ,ZABD.RESOLVE_SEND_USER ,
ZABD.ABNORMAL_REASON ,ZABD.BEFORE_MEASURE ,"MAP".VALUE,ZABD.ROUTER_BO
ZABD.ABNORMAL_REASON ,ZABD.BEFORE_MEASURE ,"MAP".VALUE,ZABD.ROUTER_BO,ZAB.OPERATION
</select>

@ -11,6 +11,7 @@
<result column="TYPE" property="type" />
<result column="ITEM_BO" property="itemBo" />
<result column="SFC" property="sfc" />
<result column="OPERATION" property="operation" />
<result column="WORK_CENTER" property="workCenter" />
<result column="SHOP_ORDER" property="shopOrder" />
<result column="MESSAGE_TYPE" property="messageType" />
@ -49,17 +50,14 @@
<result column="WORK_CENTER_DESCRIPTION" property="workCenterDescription"/>
<result column="RESRCE_DESCRIPTION" property="resrceDescription"/>
<result column="REPORT_USER" property="reportUser"/>
<result column="RESPONSE_USER" property="responseUser"/>
<result column="RESPONSE_DATE_TIME" property="responseDateTime"/>
<result column="ABNORMAL_METHOD" property="abnormalMethod"/>
<result column="CONFIRM_USER" property="confirmUser"/>
<result column="RESOLVE_REMARK" property="resolveRemark"/>
<result column="CANCEL_UESR" property="cancelUser"/>
</resultMap>
<!-- 通用查询结果列 -->
<sql id="Base_Column_List">
HANDLE, SITE, ABNORMAL_NO, STATUS, TYPE, ITEM_BO, SFC, WORK_CENTER, SHOP_ORDER, MESSAGE_TYPE, RESRCE, NC_CODE, SHUT_DOWN, RESPONSE_USER, RESPONSE_DATE_TIME, PB_DESCRIPTION, NC_QTY, PB_GRADE, PB_USER, PB_QTY, REPAIR_DATE_TIME, DISCOVER, INSPECTOR, ENTITY_LOCATION, REPORT_FROM, OBJECT_BO, PB_PHOTOSHOP, CANCEL_CODE, CANCEL_REASON, CANCEL_DATE_TIME, CANCEL_USER, CREATED_USER, CREATED_DATE_TIME, MODIFIED_USER, MODIFIED_DATE_TIME
HANDLE, SITE, ABNORMAL_NO, STATUS, TYPE, ITEM_BO, SFC, OPERATION, WORK_CENTER, SHOP_ORDER, MESSAGE_TYPE, RESRCE, NC_CODE, SHUT_DOWN, RESPONSE_USER, RESPONSE_DATE_TIME, PB_DESCRIPTION, NC_QTY, PB_GRADE, PB_USER, PB_QTY, REPAIR_DATE_TIME, DISCOVER, INSPECTOR, ENTITY_LOCATION, REPORT_FROM, OBJECT_BO, PB_PHOTOSHOP, CANCEL_CODE, CANCEL_REASON, CANCEL_DATE_TIME, CANCEL_USER, CREATED_USER, CREATED_DATE_TIME, MODIFIED_USER, MODIFIED_DATE_TIME
</sql>
<!-- BaseMapper标准查询/修改/删除 -->
@ -100,6 +98,7 @@
<if test="ew.entity.type!=null"> AND TYPE=#{ew.entity.type}</if>
<if test="ew.entity.itemBo!=null"> AND ITEM_BO=#{ew.entity.itemBo}</if>
<if test="ew.entity.sfc!=null"> AND SFC=#{ew.entity.sfc}</if>
<if test="ew.entity.operation!=null"> AND OPERATION=#{ew.entity.operation}</if>
<if test="ew.entity.workCenter!=null"> AND WORK_CENTER=#{ew.entity.workCenter}</if>
<if test="ew.entity.shopOrder!=null"> AND SHOP_ORDER=#{ew.entity.shopOrder}</if>
<if test="ew.entity.messageType!=null"> AND MESSAGE_TYPE=#{ew.entity.messageType}</if>
@ -145,6 +144,7 @@
<if test="ew.entity.type!=null"> AND TYPE=#{ew.entity.type}</if>
<if test="ew.entity.itemBo!=null"> AND ITEM_BO=#{ew.entity.itemBo}</if>
<if test="ew.entity.sfc!=null"> AND SFC=#{ew.entity.sfc}</if>
<if test="ew.entity.operation!=null"> AND OPERATION=#{ew.entity.operation}</if>
<if test="ew.entity.workCenter!=null"> AND WORK_CENTER=#{ew.entity.workCenter}</if>
<if test="ew.entity.shopOrder!=null"> AND SHOP_ORDER=#{ew.entity.shopOrder}</if>
<if test="ew.entity.messageType!=null"> AND MESSAGE_TYPE=#{ew.entity.messageType}</if>
@ -198,6 +198,7 @@
<if test="ew.entity.type!=null"> AND TYPE=#{ew.entity.type}</if>
<if test="ew.entity.itemBo!=null"> AND ITEM_BO=#{ew.entity.itemBo}</if>
<if test="ew.entity.sfc!=null"> AND SFC=#{ew.entity.sfc}</if>
<if test="ew.entity.operation!=null"> AND OPERATION=#{ew.entity.operation}</if>
<if test="ew.entity.workCenter!=null"> AND WORK_CENTER=#{ew.entity.workCenter}</if>
<if test="ew.entity.shopOrder!=null"> AND SHOP_ORDER=#{ew.entity.shopOrder}</if>
<if test="ew.entity.messageType!=null"> AND MESSAGE_TYPE=#{ew.entity.messageType}</if>
@ -251,6 +252,7 @@
<if test="ew.entity.type!=null"> AND TYPE=#{ew.entity.type}</if>
<if test="ew.entity.itemBo!=null"> AND ITEM_BO=#{ew.entity.itemBo}</if>
<if test="ew.entity.sfc!=null"> AND SFC=#{ew.entity.sfc}</if>
<if test="ew.entity.operation!=null"> AND OPERATION=#{ew.entity.operation}</if>
<if test="ew.entity.workCenter!=null"> AND WORK_CENTER=#{ew.entity.workCenter}</if>
<if test="ew.entity.shopOrder!=null"> AND SHOP_ORDER=#{ew.entity.shopOrder}</if>
<if test="ew.entity.messageType!=null"> AND MESSAGE_TYPE=#{ew.entity.messageType}</if>
@ -304,6 +306,7 @@
<if test="ew.entity.type!=null"> AND TYPE=#{ew.entity.type}</if>
<if test="ew.entity.itemBo!=null"> AND ITEM_BO=#{ew.entity.itemBo}</if>
<if test="ew.entity.sfc!=null"> AND SFC=#{ew.entity.sfc}</if>
<if test="ew.entity.operation!=null"> AND OPERATION=#{ew.entity.operation}</if>
<if test="ew.entity.workCenter!=null"> AND WORK_CENTER=#{ew.entity.workCenter}</if>
<if test="ew.entity.shopOrder!=null"> AND SHOP_ORDER=#{ew.entity.shopOrder}</if>
<if test="ew.entity.messageType!=null"> AND MESSAGE_TYPE=#{ew.entity.messageType}</if>
@ -357,6 +360,7 @@
<if test="ew.entity.type!=null"> AND TYPE=#{ew.entity.type}</if>
<if test="ew.entity.itemBo!=null"> AND ITEM_BO=#{ew.entity.itemBo}</if>
<if test="ew.entity.sfc!=null"> AND SFC=#{ew.entity.sfc}</if>
<if test="ew.entity.operation!=null"> AND OPERATION=#{ew.entity.operation}</if>
<if test="ew.entity.workCenter!=null"> AND WORK_CENTER=#{ew.entity.workCenter}</if>
<if test="ew.entity.shopOrder!=null"> AND SHOP_ORDER=#{ew.entity.shopOrder}</if>
<if test="ew.entity.messageType!=null"> AND MESSAGE_TYPE=#{ew.entity.messageType}</if>
@ -410,6 +414,7 @@
<if test="ew.entity.type!=null"> AND TYPE=#{ew.entity.type}</if>
<if test="ew.entity.itemBo!=null"> AND ITEM_BO=#{ew.entity.itemBo}</if>
<if test="ew.entity.sfc!=null"> AND SFC=#{ew.entity.sfc}</if>
<if test="ew.entity.operation!=null"> AND OPERATION=#{ew.entity.operation}</if>
<if test="ew.entity.workCenter!=null"> AND WORK_CENTER=#{ew.entity.workCenter}</if>
<if test="ew.entity.shopOrder!=null"> AND SHOP_ORDER=#{ew.entity.shopOrder}</if>
<if test="ew.entity.messageType!=null"> AND MESSAGE_TYPE=#{ew.entity.messageType}</if>
@ -459,6 +464,7 @@
<if test="type!=null">TYPE,</if>
<if test="itemBo!=null">ITEM_BO,</if>
<if test="sfc!=null">SFC,</if>
<if test="operation!=null">OPERATION,</if>
<if test="workCenter!=null">WORK_CENTER,</if>
<if test="shopOrder!=null">SHOP_ORDER,</if>
<if test="messageType!=null">MESSAGE_TYPE,</if>
@ -496,6 +502,7 @@
<if test="type!=null">#{type},</if>
<if test="itemBo!=null">#{itemBo},</if>
<if test="sfc!=null">#{sfc},</if>
<if test="operation!=null">#{operation},</if>
<if test="workCenter!=null">#{workCenter},</if>
<if test="shopOrder!=null">#{shopOrder},</if>
<if test="messageType!=null">#{messageType},</if>
@ -540,6 +547,7 @@
#{type},
#{itemBo},
#{sfc},
#{operation},
#{workCenter},
#{shopOrder},
#{messageType},
@ -580,6 +588,7 @@
<if test="et.type!=null">TYPE=#{et.type},</if>
<if test="et.itemBo!=null">ITEM_BO=#{et.itemBo},</if>
<if test="et.sfc!=null">SFC=#{et.sfc},</if>
<if test="et.operation!=null">OPERATION=#{et.operation},</if>
<if test="et.workCenter!=null">WORK_CENTER=#{et.workCenter},</if>
<if test="et.shopOrder!=null">SHOP_ORDER=#{et.shopOrder},</if>
<if test="et.messageType!=null">MESSAGE_TYPE=#{et.messageType},</if>
@ -620,6 +629,7 @@
TYPE=#{et.type},
ITEM_BO=#{et.itemBo},
SFC=#{et.sfc},
OPERATION=#{et.operation},
WORK_CENTER=#{et.workCenter},
SHOP_ORDER=#{et.shopOrder},
MESSAGE_TYPE=#{et.messageType},
@ -660,6 +670,7 @@
<if test="et.type!=null">TYPE=#{et.type},</if>
<if test="et.itemBo!=null">ITEM_BO=#{et.itemBo},</if>
<if test="et.sfc!=null">SFC=#{et.sfc},</if>
<if test="et.operation!=null">OPERATION=#{et.operation},</if>
<if test="et.workCenter!=null">WORK_CENTER=#{et.workCenter},</if>
<if test="et.shopOrder!=null">SHOP_ORDER=#{et.shopOrder},</if>
<if test="et.messageType!=null">MESSAGE_TYPE=#{et.messageType},</if>
@ -699,6 +710,7 @@
<if test="ew.entity.type!=null"> AND TYPE=#{ew.entity.type}</if>
<if test="ew.entity.itemBo!=null"> AND ITEM_BO=#{ew.entity.itemBo}</if>
<if test="ew.entity.sfc!=null"> AND SFC=#{ew.entity.sfc}</if>
<if test="ew.entity.operation!=null"> AND OPERATION=#{ew.entity.operation}</if>
<if test="ew.entity.workCenter!=null"> AND WORK_CENTER=#{ew.entity.workCenter}</if>
<if test="ew.entity.shopOrder!=null"> AND SHOP_ORDER=#{ew.entity.shopOrder}</if>
<if test="ew.entity.messageType!=null"> AND MESSAGE_TYPE=#{ew.entity.messageType}</if>
@ -769,6 +781,7 @@
<if test="ew.entity.type!=null"> AND TYPE=#{ew.entity.type}</if>
<if test="ew.entity.itemBo!=null"> AND ITEM_BO=#{ew.entity.itemBo}</if>
<if test="ew.entity.sfc!=null"> AND SFC=#{ew.entity.sfc}</if>
<if test="ew.entity.operation!=null"> AND OPERATION=#{ew.entity.operation}</if>
<if test="ew.entity.workCenter!=null"> AND WORK_CENTER=#{ew.entity.workCenter}</if>
<if test="ew.entity.shopOrder!=null"> AND SHOP_ORDER=#{ew.entity.shopOrder}</if>
<if test="ew.entity.messageType!=null"> AND MESSAGE_TYPE=#{ew.entity.messageType}</if>
@ -861,19 +874,19 @@
<select id="findAllByAbnormalNoDevice" resultMap="abnormalBillDto">
SELECT ZAB.ABNORMAL_NO ABNORMAL_NO , ZAB.STATUS STATUS ,ZAB.REPORT_FROM REPORT_FROM ,WCT.DESCRIPTION WORK_CENTER_DESCRIPTION,
ZAB.RESRCE RESRCE ,R.DESCRIPTION RESRCE_DESCRIPTION,ZNU.FULL_NAME REPORT_USER,ZAB.MESSAGE_TYPE MESSAGE_TYPE ,
ZAB.NC_CODE NC_CODE ,ZAB.PB_DESCRIPTION PB_DESCRIPTION ,ZAB.SHUT_DOWN SHUT_DOWN ,ZAB.RESPONSE_USER RESPONSE_USER,ZAB.RESPONSE_DATE_TIME RESPONSE_DATE_TIME,
ZABD.ABNORMAL_METHOD ABNORMAL_METHOD,ZNU3.FULL_NAME CONFIRM_USER,ZABD.RESOLVE_REMARK RESOLVE_REMARK,
ZAB.CANCEL_CODE CANCEL_CODE,ZAB.CANCEL_DATE_TIME CANCEL_DATE_TIME,ZNU4.FULL_NAME CANCEL_USER,ZAB.CANCEL_REASON CANCEL_REASON
ZAB.RESRCE RESRCE ,R.DESCRIPTION RESRCE_DESCRIPTION,ZNU.FULL_NAME REPORT_USER,ZAB.MESSAGE_TYPE MESSAGE_TYPE ,
ZAB.NC_CODE NC_CODE ,ZAB.PB_DESCRIPTION PB_DESCRIPTION ,ZAB.SHUT_DOWN SHUT_DOWN ,ZAB.RESPONSE_USER RESPONSE_USER,ZAB.RESPONSE_DATE_TIME RESPONSE_DATE_TIME,
ZABD.ABNORMAL_METHOD ABNORMAL_METHOD,ZNU3.FULL_NAME CONFIRM_USER,ZABD.RESOLVE_REMARK RESOLVE_REMARK,
ZAB.CANCEL_CODE CANCEL_CODE,ZAB.CANCEL_DATE_TIME CANCEL_DATE_TIME,ZNU4.FULL_NAME CANCEL_USER,ZAB.CANCEL_REASON CANCEL_REASON
FROM
Z_ABNORMAL_BILL ZAB
INNER JOIN Z_ABNORMAL_BILL_DISPOSE ZABD ON ZABD.ABNORMAL_BILL_BO = ZAB.HANDLE
INNER JOIN RESRCE R ON R.RESRCE = ZAB.RESRCE AND R.SITE = ZAB.SITE
LEFT JOIN WORK_CENTER_T WCT ON WCT.WORK_CENTER_BO = ('WORKCENTERBO:' || ZAB.SITE || ',' || ZAB.WORK_CENTER) AND WCT.LOCALE =#{language}
LEFT JOIN Z_NWA_USER ZNU ON ZNU.USER_NAME = ZAB.CREATED_USER AND ZNU.SITE = ZAB.SITE
LEFT JOIN Z_NWA_USER ZNU2 ON ZNU2.USER_NAME = ZAB.RESPONSE_USER AND ZNU2.SITE = ZAB.SITE
LEFT JOIN Z_NWA_USER ZNU3 ON ZNU3.USER_NAME = ZABD.RESOLVE_USER AND ZNU3.SITE = ZAB.SITE
LEFT JOIN Z_NWA_USER ZNU4 ON ZNU4.USER_NAME = ZAB.CANCEL_USER AND ZNU4.SITE = ZAB.SITE
Z_ABNORMAL_BILL ZAB
INNER JOIN Z_ABNORMAL_BILL_DISPOSE ZABD ON ZABD.ABNORMAL_BILL_BO = ZAB.HANDLE
INNER JOIN RESRCE R ON R.RESRCE = ZAB.RESRCE AND R.SITE = ZAB.SITE
LEFT JOIN WORK_CENTER_T WCT ON WCT.WORK_CENTER_BO = ('WORKCENTERBO:' || ZAB.SITE || ',' || ZAB.WORK_CENTER) AND WCT.LOCALE =#{language}
LEFT JOIN Z_NWA_USER ZNU ON ZNU.USER_NAME = ZAB.CREATED_USER AND ZNU.SITE = ZAB.SITE
LEFT JOIN Z_NWA_USER ZNU2 ON ZNU2.USER_NAME = ZAB.RESPONSE_USER AND ZNU2.SITE = ZAB.SITE
LEFT JOIN Z_NWA_USER ZNU3 ON ZNU3.USER_NAME = ZABD.RESOLVE_USER AND ZNU3.SITE = ZAB.SITE
LEFT JOIN Z_NWA_USER ZNU4 ON ZNU4.USER_NAME = ZAB.CANCEL_USER AND ZNU4.SITE = ZAB.SITE
<where>
<if test="abnormalBill != null">
<if test="abnormalBill.site != null and abnormalBill.site != ''">
@ -894,18 +907,19 @@
SITE = #{site}
</if>
<if test="status != null and status.size() != 0">
AND STATUS NOT IN
<foreach collection="status" item="item" index="index" separator="," open="(" close=")">
#{item}
</foreach>
AND STATUS NOT IN
<foreach collection="status" item="item" index="index" separator="," open="(" close=")">
#{item}
</foreach>
</if>
<if test="type != null and type != ''">
AND "TYPE" = #{type}
AND "TYPE" = #{type}
</if>
<if test="sfc != null and sfc != ''">
AND SFC = #{sfc}
AND SFC = #{sfc}
</if>
</where>
</select>
</mapper>

@ -59,6 +59,10 @@
<artifactId>commons-lang3</artifactId>
<version>3.7</version>
</dependency>
<dependency>
<groupId>com.foreverwin.mesnac</groupId>
<artifactId>anomaly</artifactId>
</dependency>
<dependency>
<groupId>com.foreverwin.mesnac</groupId>
<artifactId>meapi</artifactId>

@ -1,17 +1,21 @@
package com.foreverwin.mesnac.dataimport.controller;
import com.foreverwin.mesnac.dataimport.util.APResult;
import com.foreverwin.mesnac.dataimport.util.ImportRequest;
import com.foreverwin.mesnac.anomaly.service.FileUploadedService;
import com.foreverwin.mesnac.common.model.ExportTemplate;
import com.foreverwin.mesnac.common.service.ExportTemplateService;
import com.foreverwin.mesnac.dataimport.service.impl.MasterDataImportServiceImpl;
import com.foreverwin.mesnac.dataimport.util.APResult;
import com.foreverwin.mesnac.dataimport.util.ImportRequest;
import com.foreverwin.modular.core.util.CommonMethods;
import com.foreverwin.modular.core.util.R;
import com.foreverwin.modular.core.util.SpringUtil;
import com.sap.me.frame.Utils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.context.i18n.LocaleContextHolder;
import org.springframework.web.bind.annotation.*;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;
import org.springframework.web.multipart.MultipartFile;
import javax.websocket.server.PathParam;
@ -27,18 +31,26 @@ public class DataImportController {
@Autowired
private MasterDataImportServiceImpl masterDataImportService;
@PostMapping("/import")
public String importFile(@PathParam("fileType") String fileType, @PathParam("site") String site, @PathParam("user") String user, @PathParam("handleType") final String handleType, @PathParam("mode") final String mode, @RequestParam("file") MultipartFile multipartFile) {
@Autowired
FileUploadedService fileUploadedService;
@RequestMapping("/import")
public String importFile(@PathParam("fileType") String fileType, @PathParam("site") String site,
@PathParam("user") String user, @PathParam("handleType") final String handleType,
@PathParam("mode") final String mode, @RequestParam("file") MultipartFile multipartFile,@PathParam("taskNo")String taskNo) {
ImportRequest importRequest = new ImportRequest();
importRequest.setFileType(fileType);
importRequest.setSite(site);
importRequest.setUser(user);
importRequest.setMode(mode);
importRequest.setMasterType(handleType);
//-----------------------------------------------------------------------------------------------------------------------------------------
try {
String transInfo = masterDataImportService.importFile(multipartFile, importRequest);
return new APResult().getResult(0, transInfo, transInfo);
// String transInfo = masterDataImportService.importFile(multipartFile, importRequest);
fileUploadedService.uploadAttachment(multipartFile,site,taskNo,fileType);
return new APResult().getResult(0,"上传成功",null);
} catch (Exception e) {
e.printStackTrace();
return new APResult().getResult(9999, e.getMessage(), e.getMessage());

@ -32,8 +32,8 @@ public class GeneratorApplication {
MpGenerator mpGenerator = mpGeneratorBuilder.dataSourceConfig(dataSourceConfig)
.tablePrefix( "APS_", "DS_", "Z_" )
.packageName( "com.foreverwin.mesnac.anomaly" )
.tables("Z_UPLOAD_PICTURES")
.author("Leon.L")
.tables("Z_ABNORMAL_BILL")
.author("赵嘉伟")
.uiAppId("com.foreverwin.me")
.uiPackage("com.foreverwin.me.migration")
.build();

@ -140,10 +140,15 @@ public class NcCodeController {
return R.ok(ncCodeService.findNcByCategory(category,code));
}
@GetMapping("findSecondaryNcByNc")
@GetMapping("/findSecondaryNcByNc")
public R findSecondaryNcByNcI(String ncCode){
return R.ok(ncCodeService.findSecondaryNcByNc(ncCode));
}
@GetMapping("/findNcCodeByNcGroup")
public R findNcCodeByNcGroup(NcGroup ncGroup){
return R.ok(ncCodeService.findNcCodeByNcGroup(ncGroup));
}
}

@ -3,6 +3,7 @@ package com.foreverwin.mesnac.meapi.controller;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.foreverwin.mesnac.meapi.model.NcGroup;
import com.foreverwin.mesnac.meapi.model.Operation;
import com.foreverwin.mesnac.meapi.service.NcGroupService;
import com.foreverwin.modular.core.util.CommonMethods;
import com.foreverwin.modular.core.util.FrontPage;
@ -129,4 +130,9 @@ public class NcGroupController {
public R removeByIds(List<String> ids){
return R.ok(ncGroupService.removeByIds(ids));
}
@GetMapping("/findNgGroupByOperationBo")
public R findNgGroupByOperationBo(Operation operation){
return R.ok(ncGroupService.findNgGroupByOperationBo(operation));
}
}

@ -91,4 +91,6 @@ public class OperationController {
return R.ok(result);
}
}

@ -160,4 +160,9 @@ public class SfcController {
return R.ok(sfcService.removeByIds(ids));
}
@GetMapping("/findOperationBySfc")
public R findOperationBySfc(String sfc){
return R.ok(sfcService.findOperationBySfc(sfc));
}
}

@ -34,4 +34,6 @@ public interface NcCodeMapper extends BaseMapper<NcCode> {
* @return
*/
Integer checkNcCode(@Param("NcCodeList")List<String> ncCodes,@Param("site")String site,@Param("category")String category);
List<NcCode> findNcCodeByNcGroup(@Param("ncGroup")NcGroup ncGroup);
}

@ -1,12 +1,15 @@
package com.foreverwin.mesnac.meapi.mapper;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.foreverwin.mesnac.meapi.model.NcGroup;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.foreverwin.mesnac.meapi.model.Operation;
import org.apache.ibatis.annotations.Param;
import org.springframework.stereotype.Repository;
import java.util.List;
/**
* <p>
* Mapper
@ -19,4 +22,6 @@ import org.springframework.stereotype.Repository;
public interface NcGroupMapper extends BaseMapper<NcGroup> {
IPage selectPageByOperation(Page<NcGroup> frontPage, @Param("site") String site, @Param("operationBO") String operationBO,@Param("globalQuery") String globalQuery);
List<NcGroup> findNgGroupByOperationBo(@Param("operation") Operation operation);
}

@ -28,4 +28,6 @@ public interface OperationMapper extends BaseMapper<Operation> {
Operation queryOperationByErpWorkCenter(@Param("site") String site, @Param("erpWorkCenter") String erpWorkCenter);
IPage<Operation> selectOperationStep( IPage<Operation> page, @Param("locale") String locale,@Param("ew") Wrapper<Operation> wrapper);
}

@ -31,4 +31,6 @@ public interface SfcMapper extends BaseMapper<Sfc> {
Sfc findBySfc(@Param("sfc") Sfc sfc);
IPage pageByResrce(Page<Sfc> pagePlus,@Param("ew") QueryWrapper<SfcDto> queryWrapper,@Param("locale")String locale);
String findOperationBySfc(@Param("site")String site,@Param("sfc")String sfc);
}

@ -33,4 +33,6 @@ public interface NcCodeService extends IService<NcCode> {
List<NcCode> findSecondaryNcByNc(String ncCode);
IPage selectPageByNcGroup(Page<NcGroup> pagePlus, String globalQuery, String ncGroup);
List<NcCode> findNcCodeByNcGroup(NcGroup ncGroup);
}

@ -2,8 +2,9 @@ package com.foreverwin.mesnac.meapi.service;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.foreverwin.mesnac.meapi.model.NcGroup;
import com.baomidou.mybatisplus.extension.service.IService;
import com.foreverwin.mesnac.meapi.model.NcGroup;
import com.foreverwin.mesnac.meapi.model.Operation;
import com.foreverwin.modular.core.util.FrontPage;
import java.util.List;
@ -28,4 +29,6 @@ public interface NcGroupService extends IService<NcGroup> {
List<NcGroup> selectList(NcGroup ncGroup);
IPage selectPageByOperation(Page<NcGroup> pagePlus, String globalQuery, String operation);
List<NcGroup> findNgGroupByOperationBo(Operation operation);
}

@ -39,4 +39,5 @@ public interface OperationService extends IService<Operation> {
* @return
*/
Operation queryOperationByErpWorkCenter(String site, String erpWorkCenter);
}

@ -2,7 +2,6 @@ package com.foreverwin.mesnac.meapi.service;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.service.IService;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.baomidou.mybatisplus.extension.service.IService;
import com.foreverwin.mesnac.meapi.dto.SfcDto;
@ -50,4 +49,7 @@ public interface SfcService extends IService<Sfc> {
*/
SfcDto findSfcData(String site, String sfc);
String findOperationBySfc(String sfc);
}

@ -74,5 +74,12 @@ public class NcCodeServiceImpl extends ServiceImpl<NcCodeMapper, NcCode> impleme
return ncCodeMapper.selectPageByNcGroup(pagePlus, ncGroupBO, globalQuery,LocaleContextHolder.getLocale().getLanguage());
}
@Override
public List<NcCode> findNcCodeByNcGroup(NcGroup ncGroup) {
String site = CommonMethods.getSite();
ncGroup.setSite(site);
return ncCodeMapper.findNcCodeByNcGroup(ncGroup);
}
}

@ -6,6 +6,7 @@ import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.foreverwin.mesnac.meapi.mapper.NcGroupMapper;
import com.foreverwin.mesnac.meapi.model.NcGroup;
import com.foreverwin.mesnac.meapi.model.Operation;
import com.foreverwin.mesnac.meapi.service.NcGroupService;
import com.foreverwin.mesnac.meapi.util.StringUtils;
import com.foreverwin.modular.core.exception.BaseException;
@ -58,5 +59,11 @@ public class NcGroupServiceImpl extends ServiceImpl<NcGroupMapper, NcGroup> impl
return ncGroupMapper.selectPageByOperation(frontPage, site, operationBO, globalQuery);
}
@Override
public List<NcGroup> findNgGroupByOperationBo(Operation operation) {
String site = CommonMethods.getSite();
operation.setSite(site);
return ncGroupMapper.findNgGroupByOperationBo(operation);
}
}

@ -67,4 +67,6 @@ public class OperationServiceImpl extends ServiceImpl<OperationMapper, Operation
}
}

@ -2,6 +2,7 @@ package com.foreverwin.mesnac.meapi.service.impl;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.foreverwin.mesnac.meapi.dto.SfcDto;
import com.foreverwin.modular.core.util.CommonMethods;
import com.foreverwin.modular.core.util.FrontPage;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
@ -71,4 +72,10 @@ public class SfcServiceImpl extends ServiceImpl<SfcMapper, Sfc> implements SfcSe
public SfcDto findSfcData(String site, String sfc) {
return sfcMapper.findSfcData(site, sfc);
}
@Override
public String findOperationBySfc(String sfc) {
String site = CommonMethods.getSite();
return sfcMapper.findOperationBySfc(site,sfc);
}
}

@ -396,4 +396,23 @@
AND NC_CATEGORY = #{category}
</if>
</select>
<select id="findNcCodeByNcGroup" resultMap="BaseResultMap">
SELECT NC.NC_CODE ,NCT.DESCRIPTION
FROM NC_GROUP NG
INNER JOIN NC_GROUP_MEMBER NGM ON NG.HANDLE = NGM.NC_GROUP_BO
INNER JOIN NC_CODE NC ON NGM.NC_CODE_OR_GROUP_GBO = NC.HANDLE
LEFT JOIN NC_CODE_T NCT ON NCT.NC_CODE_BO = NC.HANDLE AND NCT.LOCALE = 'zh'
<where>
<if test="ncGroup != null">
<if test="ncGroup.site != null and ncGroup.site != ''">
NG.SITE = #{ncGroup.site}
</if>
<if test="ncGroup.ncGroup != null and ncGroup.ncGroup != null">
AND NG.NC_GROUP = #{ncGroup.ncGroup}
</if>
</if>
</where>
</select>
</mapper>

@ -19,6 +19,9 @@
<sql id="Base_Column_List">
HANDLE, CHANGE_STAMP, SITE, NC_GROUP, DESCRIPTION, VALID_AT_ALL_OPERATIONS, PRIORITY, CREATED_DATE_TIME, MODIFIED_DATE_TIME
</sql>
<sql id="Full_Column_List">
NG.HANDLE, NG.CHANGE_STAMP, NG.SITE, NG.NC_GROUP, NG.DESCRIPTION, NG.VALID_AT_ALL_OPERATIONS, NG.PRIORITY, NG.CREATED_DATE_TIME, NG.MODIFIED_DATE_TIME
</sql>
<!-- BaseMapper标准查询/修改/删除 -->
@ -350,4 +353,22 @@
AND (ng.NC_GROUP LIKE '%${globalQuery}%' or NG.DESCRIPTION LIKE '%${globalQuery}%')
</if>
</select>
<select id="findNgGroupByOperationBo" resultMap="BaseResultMap">
SELECT DISTINCT NG.NC_GROUP,NG.DESCRIPTION
FROM NC_GROUP NG
LEFT JOIN NC_GROUP_VALID_OPER NGVO ON NG.HANDLE = NGVO.NC_GROUP_BO
<where>
<if test="operation != null">
<if test="operation.site != null and operation.site != ''">
NG.SITE = #{operation.site}
</if>
<if test="operation.handle != null">
AND (NGVO.OPERATION_BO = #{operation.handle}
OR NG.VALID_AT_ALL_OPERATIONS = 'true')
</if>
</if>
</where>
</select>
</mapper>

@ -634,4 +634,6 @@
</if>
ORDER BY RS.STEP_ID
</select>
</mapper>

@ -673,4 +673,15 @@
AND S.STATUS_BO IN ('StatusBO:'||#{ew.entity.site}||',401','StatusBO:'||#{ew.entity.site}||',402','StatusBO:'||#{ew.entity.site}||',403')
AND zprt.STATUS='FINISH' AND ZPRT."RESULT"='OK'
</select>
<select id="findOperationBySfc" resultType="string">
SELECT SS.OPERATION_BO
FROM SFC S
INNER JOIN SFC_ROUTING SR ON SR.SFC_BO = S.HANDLE
INNER JOIN SFC_ROUTER ST ON ST.SFC_ROUTING_BO = SR.HANDLE
INNER JOIN SFC_STEP SS ON SS.SFC_ROUTER_BO = ST.HANDLE
WHERE (SS.QTY_IN_QUEUE > 0 OR SS.QTY_IN_WORK > 0)
AND S.SFC = #{sfc} AND S.SITE = #{site}
</select>
</mapper>

Loading…
Cancel
Save