Merge remote-tracking branch 'origin/master'

master
zpl 4 years ago
commit 2ff97cc813

@ -71,6 +71,19 @@ public class AbnormalBillController {
return R.ok(result);
}
/**
*
*
* @return
*/
@ResponseBody
@GetMapping("getQCAbnormal")
public R getQCAbnormal(){
List<AbnormalBill> result;
result = abnormalBillService.getQCAbnormal();
return R.ok(result);
}
/**
*
*

@ -1,16 +1,15 @@
package com.foreverwin.mesnac.anomaly.controller;
import com.foreverwin.modular.core.util.R;
import com.foreverwin.modular.core.util.FrontPage;
import com.foreverwin.modular.core.util.CommonMethods;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import org.springframework.web.bind.annotation.RequestMapping;
import com.foreverwin.mesnac.anomaly.dto.AbnormalPlanDto;
import com.foreverwin.mesnac.anomaly.model.AbnormalPlan;
import com.foreverwin.mesnac.anomaly.service.AbnormalPlanService;
import com.foreverwin.modular.core.util.FrontPage;
import com.foreverwin.modular.core.util.R;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;
import com.foreverwin.mesnac.anomaly.service.AbnormalPlanService;
import com.foreverwin.mesnac.anomaly.model.AbnormalPlan;
import java.util.List;
/**
@ -69,7 +68,7 @@ public class AbnormalPlanController {
queryWrapper.lambda().and(wrapper -> wrapper
.like(AbnormalPlan::getHandle, frontPage.getGlobalQuery())
.or().like(AbnormalPlan::getSite, frontPage.getGlobalQuery())
.or().like(AbnormalPlan::getAbnormalBillBo, frontPage.getGlobalQuery())
.or().like(AbnormalPlan::getAbnormalNo, frontPage.getGlobalQuery())
.or().like(AbnormalPlan::getStatus, frontPage.getGlobalQuery())
.or().like(AbnormalPlan::getWorkCenter, frontPage.getGlobalQuery())
.or().like(AbnormalPlan::getAbnormalMethod, frontPage.getGlobalQuery())
@ -77,6 +76,7 @@ public class AbnormalPlanController {
.or().like(AbnormalPlan::getResrce, frontPage.getGlobalQuery())
.or().like(AbnormalPlan::getItemBo, frontPage.getGlobalQuery())
.or().like(AbnormalPlan::getProcessor, frontPage.getGlobalQuery())
.or().like(AbnormalPlan::getSendUserGroup, frontPage.getGlobalQuery())
.or().like(AbnormalPlan::getClosedUser, frontPage.getGlobalQuery())
.or().like(AbnormalPlan::getCreatedUser, frontPage.getGlobalQuery())
.or().like(AbnormalPlan::getModifiedUser, frontPage.getGlobalQuery())
@ -127,4 +127,15 @@ public class AbnormalPlanController {
public R removeByIds(List<String> ids){
return R.ok(abnormalPlanService.removeByIds(ids));
}
@GetMapping("/findAbnormalPlan")
public R findAbnormalPlan(AbnormalPlanDto abnormalPlanDto){
return R.ok(abnormalPlanService.findAbnormalPlan(abnormalPlanDto));
}
@GetMapping("/processes")
public R processes(List<AbnormalPlan> abnormalPlanList){
abnormalPlanService.processes(abnormalPlanList);
return R.ok();
}
}

@ -0,0 +1,67 @@
package com.foreverwin.mesnac.anomaly.dto;
import com.foreverwin.mesnac.anomaly.model.AbnormalPlan;
import java.time.LocalDateTime;
/**
* @Description TODO
* @Author zhaojiawei
* @Since 2021-08-07
*/
public class AbnormalPlanDto extends AbnormalPlan {
private String itemDescription;
private String fullName;
private LocalDateTime startDateTime;
private LocalDateTime endDateTime;
private String resrceDescription;
public String getItemDescription() {
return itemDescription;
}
public void setItemDescription(String itemDescription) {
this.itemDescription = itemDescription;
}
public String getFullName() {
return fullName;
}
public LocalDateTime getStartDateTime() {
return startDateTime;
}
public void setStartDateTime(LocalDateTime startDateTime) {
this.startDateTime = startDateTime;
}
public void setFullName(String fullName) {
this.fullName = fullName;
}
public LocalDateTime getEndDateTime() {
return endDateTime;
}
public void setEndDateTime(LocalDateTime endDateTime) {
this.endDateTime = endDateTime;
}
public String getResrceDescription() {
return resrceDescription;
}
public void setResrceDescription(String resrceDescription) {
this.resrceDescription = resrceDescription;
}
}

@ -21,10 +21,10 @@ public interface AbnormalBillDisposeMapper extends BaseMapper<AbnormalBillDispos
/**
*
* @param abnormalBill
* @param language
* @param locale
* @return
*/
AbnormalBillDisposeDto findAllByAbnormalNo(@Param("abnormalBill") AbnormalBill abnormalBill, @Param("language")String language);
AbnormalBillDisposeDto findAllByAbnormalNo(@Param("abnormalBill") AbnormalBill abnormalBill, @Param("locale")String locale);

@ -35,4 +35,6 @@ public interface AbnormalBillMapper extends BaseMapper<AbnormalBill> {
Integer findAbnormalMethodBySFC(@Param("site")String site,@Param("sfc")String sfc);
List<ScrapDto> findScrapDtoBySfc(@Param("site")String site, @Param("sfc")String sfc);
List<AbnormalBill> getQCAbnormalList(@Param("site") String site);
}

@ -1,12 +1,16 @@
package com.foreverwin.mesnac.anomaly.mapper;
import com.foreverwin.mesnac.anomaly.model.AbnormalPlan;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.foreverwin.mesnac.anomaly.dto.AbnormalPlanDto;
import com.foreverwin.mesnac.anomaly.model.AbnormalPlan;
import org.apache.ibatis.annotations.Param;
import org.springframework.stereotype.Repository;
import java.util.List;
/**
* <p>
* Mapper
* Mapper
* </p>
*
* @author zjw
@ -15,4 +19,5 @@ import org.springframework.stereotype.Repository;
@Repository
public interface AbnormalPlanMapper extends BaseMapper<AbnormalPlan> {
List<AbnormalPlanDto> findAbnormalPlan(@Param("locale") String locale, @Param("abnormalPlanDto")AbnormalPlan abnormalPlanDto);
}

@ -1,18 +1,17 @@
package com.foreverwin.mesnac.anomaly.model;
import java.io.Serializable;
import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import com.baomidou.mybatisplus.extension.activerecord.Model;
import com.baomidou.mybatisplus.annotation.TableId;
import java.time.LocalDateTime;
import com.baomidou.mybatisplus.annotation.TableField;
import java.io.Serializable;
import com.baomidou.mybatisplus.annotation.IdType;
import java.time.LocalDateTime;
/**
* <p>
*
*
* </p>
*
* @author zjw
@ -38,8 +37,8 @@ public class AbnormalPlan extends Model<AbnormalPlan> {
/**
*
*/
@TableField("ABNORMAL_BILL_BO")
private String abnormalBillBo;
@TableField("ABNORMAL_NO")
private String abnormalNo;
/**
*
*/
@ -81,10 +80,15 @@ public class AbnormalPlan extends Model<AbnormalPlan> {
@TableField("PROCESSOR")
private String processor;
/**
*
*
*/
@TableField("PROCESS_DATE_TIME")
private LocalDateTime processDateTime;
@TableField("SEND_USER_GROUP")
private String sendUserGroup;
/**
*
*/
@TableField("SEND_DATE_TIME")
private LocalDateTime sendDateTime;
/**
*
*/
@ -133,12 +137,12 @@ public class AbnormalPlan extends Model<AbnormalPlan> {
this.site = site;
}
public String getAbnormalBillBo() {
return abnormalBillBo;
public String getAbnormalNo() {
return abnormalNo;
}
public void setAbnormalBillBo(String abnormalBillBo) {
this.abnormalBillBo = abnormalBillBo;
public void setAbnormalNo(String abnormalNo) {
this.abnormalNo = abnormalNo;
}
public String getStatus() {
@ -205,12 +209,20 @@ public class AbnormalPlan extends Model<AbnormalPlan> {
this.processor = processor;
}
public LocalDateTime getProcessDateTime() {
return processDateTime;
public String getSendUserGroup() {
return sendUserGroup;
}
public void setProcessDateTime(LocalDateTime processDateTime) {
this.processDateTime = processDateTime;
public void setSendUserGroup(String sendUserGroup) {
this.sendUserGroup = sendUserGroup;
}
public LocalDateTime getSendDateTime() {
return sendDateTime;
}
public void setSendDateTime(LocalDateTime sendDateTime) {
this.sendDateTime = sendDateTime;
}
public String getClosedUser() {
@ -265,7 +277,7 @@ public static final String HANDLE = "HANDLE";
public static final String SITE = "SITE";
public static final String ABNORMAL_BILL_BO = "ABNORMAL_BILL_BO";
public static final String ABNORMAL_NO = "ABNORMAL_NO";
public static final String STATUS = "STATUS";
@ -283,7 +295,9 @@ public static final String QTY = "QTY";
public static final String PROCESSOR = "PROCESSOR";
public static final String PROCESS_DATE_TIME = "PROCESS_DATE_TIME";
public static final String SEND_USER_GROUP = "SEND_USER_GROUP";
public static final String SEND_DATE_TIME = "SEND_DATE_TIME";
public static final String CLOSED_USER = "CLOSED_USER";
@ -308,7 +322,7 @@ public static final String MODIFIED_DATE_TIME = "MODIFIED_DATE_TIME";
return "AbnormalPlan{" +
"handle = " + handle +
", site = " + site +
", abnormalBillBo = " + abnormalBillBo +
", abnormalNo = " + abnormalNo +
", status = " + status +
", workCenter = " + workCenter +
", abnormalMethod = " + abnormalMethod +
@ -317,7 +331,8 @@ public static final String MODIFIED_DATE_TIME = "MODIFIED_DATE_TIME";
", itemBo = " + itemBo +
", qty = " + qty +
", processor = " + processor +
", processDateTime = " + processDateTime +
", sendUserGroup = " + sendUserGroup +
", sendDateTime = " + sendDateTime +
", closedUser = " + closedUser +
", closedDateTime = " + closedDateTime +
", createdUser = " + createdUser +

@ -134,4 +134,5 @@ public interface AbnormalBillService extends IService<AbnormalBill> {
*/
String formatMessage(AbnormalBill abnormalBill,String messageType, String site);
List<AbnormalBill> getQCAbnormal();
}

@ -3,6 +3,7 @@ package com.foreverwin.mesnac.anomaly.service;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.service.IService;
import com.foreverwin.mesnac.anomaly.dto.AbnormalBillDisposeDto;
import com.foreverwin.mesnac.anomaly.dto.AbnormalPlanDto;
import com.foreverwin.mesnac.anomaly.model.AbnormalPlan;
import com.foreverwin.modular.core.util.FrontPage;
@ -11,7 +12,7 @@ import java.util.List;
/**
* <p>
*
*
* </p>
*
* @author zjw
@ -29,4 +30,8 @@ public interface AbnormalPlanService extends IService<AbnormalPlan> {
List<AbnormalPlan> selectList(AbnormalPlan abnormalPlan);
void saveAbnormalPlan(AbnormalBillDisposeDto abnormalBillDisposeDto, LocalDateTime now);
List<AbnormalPlanDto> findAbnormalPlan(AbnormalPlanDto abnormalPlanDto);
void processes(List<AbnormalPlan> abnormalPlanList);
}

@ -20,7 +20,6 @@ import com.foreverwin.mesnac.common.service.AnomalyService;
import com.foreverwin.mesnac.common.service.MessageService;
import com.foreverwin.mesnac.common.util.ActiveMQUtil;
import com.foreverwin.mesnac.common.util.StringUtil;
import com.foreverwin.mesnac.meapi.dto.ShopOrderDto;
import com.foreverwin.mesnac.meapi.mapper.*;
import com.foreverwin.mesnac.meapi.model.*;
import com.foreverwin.mesnac.meapi.service.*;
@ -915,7 +914,7 @@ public class AbnormalBillServiceImpl extends ServiceImpl<AbnormalBillMapper, Abn
//得到升级的用户组
//新建有、响应没有、纠防确认有、方案确认没有、取消没有、关闭没有
if(Constants.NEW.equals(abnormalBill.getStatus()) || Constants.CORRECTION_CONFIRM.equals(abnormalBill.getStatus())){
abnormalMessage.setUpUserGroup(abnormalMessage.getSendUserGroup()+"_UP");
abnormalMessage.setUpUserGroup(abnormalMessage.getSendUserGroup()+"_SJ");
//得到升级的时间和等级
UserGroup customFieldByGroup = userGroupMapper.getCustomFieldByGroup(site, abnormalMessage.getSendUserGroup());
if(customFieldByGroup != null && !StringUtil.isBlank(customFieldByGroup.getMessageNoticeTime())){
@ -937,7 +936,6 @@ public class AbnormalBillServiceImpl extends ServiceImpl<AbnormalBillMapper, Abn
//abnormalMessage.setAbnormalNode(Constants.ABNORMAL_MESSAGE_REPORT);
//设置状态新建是Y响应为N纠防确认是N方案确认是Y
if(Constants.ABNORMAL_MESSAGE_RESPONSE.equals(abnormalMessage.getNode()) ||
Constants.ABNORMAL_MESSAGE_CORRECTION_CONFIRM.equals(abnormalMessage.getNode())){
@ -945,8 +943,6 @@ public class AbnormalBillServiceImpl extends ServiceImpl<AbnormalBillMapper, Abn
}else{
abnormalMessage.setStatus("Y");
}
abnormalMessage.setCreatedUser(user);
abnormalMessage.setCreatedDateTime(now);
abnormalMessage.setModifiedUser(user);
@ -986,46 +982,51 @@ public class AbnormalBillServiceImpl extends ServiceImpl<AbnormalBillMapper, Abn
if(sendMessageType == null){
throw new BaseException("异常提报时找不到要发送的消息类型");
}
//查处所有要替换的消息内容
AbnormalBillDisposeDto messageContent = abnormalBillDisposeMapper.findAllByAbnormalNo(abnormalBill, locale);
//格式化消息
String body = sendMessageType.getBody();
//替换消息类型中的参数
Map<String, String> messageMap = new HashMap<>();
//根据车间找到对应车间的描述
WorkCenter workCenter = workCenterMapper.findWorkCenterDescriptionByWorkCenter(site, abnormalBill.getWorkCenter(), locale);
//根据资源找到对应的产线的描述
WorkCenter line = null;
if(StringUtil.isBlank(abnormalBill.getResrce())){
line = workCenterMapper.findWorkCenterDescriptionByResrce(HandleEnum.RESOURCE.getHandle(site, abnormalBill.getResrce()), locale);
}
//项目号
ShopOrderDto projectNo = shopOrderMapper.findByShopOrderBo(HandleEnum.SHOP_ORDER.getHandle(site, abnormalBill.getShopOrder()));
//物料
Item _item = itemMapper.selectById(locale, abnormalBill.getItemBo());
String item = "";
if(_item != null){
item = _item.getItem() + "/" + _item.getDescription();
}
if(workCenter != null && !StringUtil.isBlank(workCenter.getDescription())){
messageMap.put("WORKCENTER",workCenter.getDescription());
}
if(line != null && !StringUtil.isBlank(line.getDescription())){
messageMap.put("WORKCENTER_LIN",line.getDescription());
}
if(projectNo != null && !StringUtil.isBlank(projectNo.getItemNumber())){
messageMap.put("PROJECT",projectNo.getItemNumber());
}
if(!StringUtil.isBlank(abnormalBill.getWorkCenter())){
messageMap.put("SHOPORDER",abnormalBill.getWorkCenter());
}
messageMap.put("ITEM",item);
// WorkCenter workCenter = workCenterMapper.findWorkCenterDescriptionByWorkCenter(site, abnormalBill.getWorkCenter(), locale);
// //根据资源找到对应的产线的描述
// WorkCenter line = null;
// if(StringUtil.isBlank(abnormalBill.getResrce())){
// line = workCenterMapper.findWorkCenterDescriptionByResrce(HandleEnum.RESOURCE.getHandle(site, abnormalBill.getResrce()), locale);
// }
//
// //项目号
// ShopOrderDto projectNo = shopOrderMapper.findByShopOrderBo(HandleEnum.SHOP_ORDER.getHandle(site, abnormalBill.getShopOrder()));
// //物料
// Item _item = itemMapper.selectById(locale, abnormalBill.getItemBo());
// String item = "";
// if(_item != null){
// item = _item.getItem() + "/" + _item.getDescription();
// }
// if(workCenter != null && !StringUtil.isBlank(workCenter.getDescription())){
// messageMap.put("WORKCENTER",workCenter.getDescription());
// }
// if(line != null && !StringUtil.isBlank(line.getDescription())){
// messageMap.put("WORKCENTER_LIN",line.getDescription());
// }
// if(projectNo != null && !StringUtil.isBlank(projectNo.getItemNumber())){
// messageMap.put("PROJECT",projectNo.getItemNumber());
// }
// if(!StringUtil.isBlank(abnormalBill.getWorkCenter())){
// messageMap.put("SHOPORDER",abnormalBill.getWorkCenter());
// }
// messageMap.put("ITEM",item);
//格式化之后的消息
return StringUtils.format(body, messageMap);
}
@Override
public List<AbnormalBill> getQCAbnormal() {
return abnormalBillMapper.getQCAbnormalList(CommonMethods.getSite());
}
@Override

@ -4,22 +4,32 @@ import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.foreverwin.mesnac.anomaly.dto.AbnormalBillDisposeDto;
import com.foreverwin.mesnac.anomaly.dto.AbnormalPlanDto;
import com.foreverwin.mesnac.anomaly.mapper.AbnormalPlanMapper;
import com.foreverwin.mesnac.anomaly.model.AbnormalPlan;
import com.foreverwin.mesnac.anomaly.service.AbnormalPlanService;
import com.foreverwin.mesnac.common.constant.Constants;
import com.foreverwin.mesnac.common.enums.HandleEnum;
import com.foreverwin.mesnac.common.mapper.MessageMapper;
import com.foreverwin.mesnac.common.model.Message;
import com.foreverwin.mesnac.common.service.MessageService;
import com.foreverwin.mesnac.common.util.ActiveMQUtil;
import com.foreverwin.mesnac.meapi.model.NwaUser;
import com.foreverwin.mesnac.meapi.service.NwaUserService;
import com.foreverwin.modular.core.util.CommonMethods;
import com.foreverwin.modular.core.util.FrontPage;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.context.i18n.LocaleContextHolder;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import java.time.LocalDateTime;
import java.util.List;
import java.util.UUID;
/**
* <p>
*
*
* </p>
*
* @author zjw
@ -33,6 +43,19 @@ public class AbnormalPlanServiceImpl extends ServiceImpl<AbnormalPlanMapper, Abn
@Autowired
private AbnormalPlanMapper abnormalPlanMapper;
@Autowired
private MessageMapper messageMapper;
@Autowired
private MessageService messageService;
@Autowired
private NwaUserService nwaUserService;
@Autowired
private ActiveMQUtil activeMQUtil;
@Override
public IPage<AbnormalPlan> selectPage(FrontPage<AbnormalPlan> frontPage, AbnormalPlan abnormalPlan) {
QueryWrapper<AbnormalPlan> queryWrapper = new QueryWrapper<>();
@ -47,15 +70,16 @@ public class AbnormalPlanServiceImpl extends ServiceImpl<AbnormalPlanMapper, Abn
return super.list(queryWrapper);
}
@Override
public void saveAbnormalPlan(AbnormalBillDisposeDto abnormalBillDisposeDto,LocalDateTime now) {
public void saveAbnormalPlan(AbnormalBillDisposeDto abnormalBillDisposeDto, LocalDateTime now) {
String site = CommonMethods.getSite();
AbnormalPlan abnormalPlan = new AbnormalPlan();
String user = CommonMethods.getUser();
//设置主键
abnormalPlan.setHandle(HandleEnum.ABNORMAL_PLAN.getHandle(site,abnormalBillDisposeDto.getAbnormalNo()));
abnormalPlan.setSite(site);
abnormalPlan.setAbnormalBillBo(HandleEnum.ABNORMAL_BILL.getHandle(site,abnormalBillDisposeDto.getAbnormalNo()));
abnormalPlan.setAbnormalNo(abnormalBillDisposeDto.getAbnormalNo());
abnormalPlan.setStatus(Constants.UNTREATED);//未处理
abnormalPlan.setWorkCenter(abnormalBillDisposeDto.getWorkCenter());
abnormalPlan.setAbnormalMethod(abnormalBillDisposeDto.getAbnormalMethod());
@ -74,4 +98,59 @@ public class AbnormalPlanServiceImpl extends ServiceImpl<AbnormalPlanMapper, Abn
this.saveOrUpdate(abnormalPlan);
}
@Override
public List<AbnormalPlanDto> findAbnormalPlan(AbnormalPlanDto abnormalPlanDto) {
String site = CommonMethods.getSite();
String locale = LocaleContextHolder.getLocale().getLanguage();
abnormalPlanDto.setSite(site);
return abnormalPlanMapper.findAbnormalPlan(locale,abnormalPlanDto);
}
@Override
public void processes(List<AbnormalPlan> abnormalPlanList) {
String site = CommonMethods.getSite();
LocalDateTime now = LocalDateTime.now();
String user = CommonMethods.getUser();
for (AbnormalPlan abnormalPlan : abnormalPlanList){
Message message = new Message();
String uuid = UUID.randomUUID().toString();
message.setHandle(uuid);
message.setSite(site);
message.setObjectBo(HandleEnum.ABNORMAL_PLAN.getHandle(site,abnormalPlan.getAbnormalNo()));
message.setMessageType(Constants.ABNORMAL_MESSAGE_PLAN);
//设置消息格式content没做
message.setSendUserGroup(abnormalPlan.getSendUserGroup());
message.setGrade(Double.parseDouble("1.0"));
message.setResponseDateTime(now);
message.setNode("PLAN");
//设置为Y则不进入计时器
message.setStatus("Y");
message.setCreatedUser(user);
message.setCreatedDateTime(now);
message.setModifiedUser(user);
message.setModifiedDateTime(now);
//发送消息
List<NwaUser> nwaUsers = nwaUserService.checkUserGroup(site,message.getSendUserGroup());
StringBuilder sendUsers = new StringBuilder();
for (int i = 0; i < nwaUsers.size(); i++) {
if(i == (nwaUsers.size() - 1)){
sendUsers.append(nwaUsers.get(i));
}else{
sendUsers.append(nwaUsers.get(i)).append("|");
}
}
activeMQUtil.wechatSendMessage(sendUsers.toString(),message.getContent());
//保存
messageService.saveOrUpdate(message);
}
}
}

@ -633,14 +633,14 @@
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
LEFT JOIN ITEM_T IT ON IT.ITEM_BO = I.HANDLE AND IT.LOCALE = #{language}
LEFT JOIN ITEM_T IT ON IT.ITEM_BO = I.HANDLE AND IT.LOCALE = #{locale}
INNER JOIN SHOP_ORDER SO ON SO.SHOP_ORDER = ZAB.SHOP_ORDER AND SO.SITE = ZAB.SITE
LEFT JOIN CUSTOM_FIELDS WORKORDER ON WORKORDER.HANDLE = SO.HANDLE AND WORKORDER."ATTRIBUTE" = 'WORK_ORDER'
LEFT JOIN CUSTOM_FIELDS ITEMNUMBER ON ITEMNUMBER.HANDLE = SO.HANDLE AND ITEMNUMBER."ATTRIBUTE" = 'ITEM_NUMBER'
LEFT JOIN CUSTOM_FIELDS PRODUCTCATEGORY ON PRODUCTCATEGORY.HANDLE = SO.HANDLE AND PRODUCTCATEGORY."ATTRIBUTE" = 'PRODUCT_CATEGORY'
LEFT JOIN CUSTOM_FIELDS "MAP" ON "MAP".HANDLE = SO.HANDLE AND "MAP"."ATTRIBUTE" = 'MAP'
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}
LEFT JOIN NC_CODE_T NCT ON ('NCCodeBO:' || ZAB.SITE || ',' || ZANC.NC_CODE) = NCT.NC_CODE_BO AND NCT.LOCALE = #{locale}
LEFT JOIN Z_NWA_USER NWA ON NWA.USER_NAME = ZAB.PB_USER AND NWA.SITE = ZAB.SITE
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'

@ -1013,4 +1013,10 @@
</where>
</select>
<select id="getQCAbnormalList" resultMap="BaseResultMap">
SELECT * FROM Z_ABNORMAL_BILL zab
JOIN sfc s ON zab.SITE=s.SITE AND zab.SFC=s.SFC
JOIN Z_ABNORMAL_BILL_DISPOSE ZABD ON ZABD.ABNORMAL_BILL_BO= ZAB.HANDLE
WHERE zab.SITE=#{site} AND zab.STATUS='G' AND zab."TYPE"='Z' AND s.QTY>1 AND (ZABD.ABNORMAL_METHOD='F' OR ZABD.ABNORMAL_METHOD='C') AND ZABD.ROUTER_BO IS NOT NULL
</select>
</mapper>

@ -6,7 +6,7 @@
<resultMap id="BaseResultMap" type="com.foreverwin.mesnac.anomaly.model.AbnormalPlan">
<id column="HANDLE" property="handle" />
<result column="SITE" property="site" />
<result column="ABNORMAL_BILL_BO" property="abnormalBillBo" />
<result column="ABNORMAL_NO" property="abnormalNo" />
<result column="STATUS" property="status" />
<result column="WORK_CENTER" property="workCenter" />
<result column="ABNORMAL_METHOD" property="abnormalMethod" />
@ -15,7 +15,8 @@
<result column="ITEM_BO" property="itemBo" />
<result column="QTY" property="qty" />
<result column="PROCESSOR" property="processor" />
<result column="PROCESS_DATE_TIME" property="processDateTime" />
<result column="SEND_USER_GROUP" property="sendUserGroup" />
<result column="SEND_DATE_TIME" property="sendDateTime" />
<result column="CLOSED_USER" property="closedUser" />
<result column="CLOSED_DATE_TIME" property="closedDateTime" />
<result column="CREATED_USER" property="createdUser" />
@ -26,9 +27,15 @@
<!-- 通用查询结果列 -->
<sql id="Base_Column_List">
HANDLE, SITE, ABNORMAL_BILL_BO, STATUS, WORK_CENTER, ABNORMAL_METHOD, SHOP_ORDER, RESRCE, ITEM_BO, QTY, PROCESSOR, PROCESS_DATE_TIME, CLOSED_USER, CLOSED_DATE_TIME, CREATED_USER, CREATED_DATE_TIME, MODIFIED_USER, MODIFIED_DATE_TIME
HANDLE, SITE, ABNORMAL_NO, STATUS, WORK_CENTER, ABNORMAL_METHOD, SHOP_ORDER, RESRCE, ITEM_BO, QTY, PROCESSOR, SEND_USER_GROUP, SEND_DATE_TIME, CLOSED_USER, CLOSED_DATE_TIME, CREATED_USER, CREATED_DATE_TIME, MODIFIED_USER, MODIFIED_DATE_TIME
</sql>
<resultMap id="abnormalPlanDto" type="com.foreverwin.mesnac.anomaly.dto.AbnormalPlanDto" extends="BaseResultMap">
<result column="ITEM_DESCRIPTION" property="itemDescription"/>
<result column="FULL_NAME" property="fullName"/>
<result column="RESRCE_DESCRIPTION" property="resrceDescription"/>
</resultMap>
<!-- BaseMapper标准查询/修改/删除 -->
<select id="selectById" resultMap="BaseResultMap">
SELECT <include refid="Base_Column_List"></include> FROM Z_ABNORMAL_PLAN WHERE HANDLE=#{handle}
@ -62,7 +69,7 @@
HANDLE=#{ew.handle}
</if>
<if test="ew.entity.site!=null"> AND SITE=#{ew.entity.site}</if>
<if test="ew.entity.abnormalBillBo!=null"> AND ABNORMAL_BILL_BO=#{ew.entity.abnormalBillBo}</if>
<if test="ew.entity.abnormalNo!=null"> AND ABNORMAL_NO=#{ew.entity.abnormalNo}</if>
<if test="ew.entity.status!=null"> AND STATUS=#{ew.entity.status}</if>
<if test="ew.entity.workCenter!=null"> AND WORK_CENTER=#{ew.entity.workCenter}</if>
<if test="ew.entity.abnormalMethod!=null"> AND ABNORMAL_METHOD=#{ew.entity.abnormalMethod}</if>
@ -71,7 +78,8 @@
<if test="ew.entity.itemBo!=null"> AND ITEM_BO=#{ew.entity.itemBo}</if>
<if test="ew.entity.qty!=null"> AND QTY=#{ew.entity.qty}</if>
<if test="ew.entity.processor!=null"> AND PROCESSOR=#{ew.entity.processor}</if>
<if test="ew.entity.processDateTime!=null"> AND PROCESS_DATE_TIME=#{ew.entity.processDateTime}</if>
<if test="ew.entity.sendUserGroup!=null"> AND SEND_USER_GROUP=#{ew.entity.sendUserGroup}</if>
<if test="ew.entity.sendDateTime!=null"> AND SEND_DATE_TIME=#{ew.entity.sendDateTime}</if>
<if test="ew.entity.closedUser!=null"> AND CLOSED_USER=#{ew.entity.closedUser}</if>
<if test="ew.entity.closedDateTime!=null"> AND CLOSED_DATE_TIME=#{ew.entity.closedDateTime}</if>
<if test="ew.entity.createdUser!=null"> AND CREATED_USER=#{ew.entity.createdUser}</if>
@ -90,7 +98,7 @@
HANDLE=#{ew.entity.handle}
</if>
<if test="ew.entity.site!=null"> AND SITE=#{ew.entity.site}</if>
<if test="ew.entity.abnormalBillBo!=null"> AND ABNORMAL_BILL_BO=#{ew.entity.abnormalBillBo}</if>
<if test="ew.entity.abnormalNo!=null"> AND ABNORMAL_NO=#{ew.entity.abnormalNo}</if>
<if test="ew.entity.status!=null"> AND STATUS=#{ew.entity.status}</if>
<if test="ew.entity.workCenter!=null"> AND WORK_CENTER=#{ew.entity.workCenter}</if>
<if test="ew.entity.abnormalMethod!=null"> AND ABNORMAL_METHOD=#{ew.entity.abnormalMethod}</if>
@ -99,7 +107,8 @@
<if test="ew.entity.itemBo!=null"> AND ITEM_BO=#{ew.entity.itemBo}</if>
<if test="ew.entity.qty!=null"> AND QTY=#{ew.entity.qty}</if>
<if test="ew.entity.processor!=null"> AND PROCESSOR=#{ew.entity.processor}</if>
<if test="ew.entity.processDateTime!=null"> AND PROCESS_DATE_TIME=#{ew.entity.processDateTime}</if>
<if test="ew.entity.sendUserGroup!=null"> AND SEND_USER_GROUP=#{ew.entity.sendUserGroup}</if>
<if test="ew.entity.sendDateTime!=null"> AND SEND_DATE_TIME=#{ew.entity.sendDateTime}</if>
<if test="ew.entity.closedUser!=null"> AND CLOSED_USER=#{ew.entity.closedUser}</if>
<if test="ew.entity.closedDateTime!=null"> AND CLOSED_DATE_TIME=#{ew.entity.closedDateTime}</if>
<if test="ew.entity.createdUser!=null"> AND CREATED_USER=#{ew.entity.createdUser}</if>
@ -126,7 +135,7 @@
HANDLE=#{ew.entity.handle}
</if>
<if test="ew.entity.site!=null"> AND SITE=#{ew.entity.site}</if>
<if test="ew.entity.abnormalBillBo!=null"> AND ABNORMAL_BILL_BO=#{ew.entity.abnormalBillBo}</if>
<if test="ew.entity.abnormalNo!=null"> AND ABNORMAL_NO=#{ew.entity.abnormalNo}</if>
<if test="ew.entity.status!=null"> AND STATUS=#{ew.entity.status}</if>
<if test="ew.entity.workCenter!=null"> AND WORK_CENTER=#{ew.entity.workCenter}</if>
<if test="ew.entity.abnormalMethod!=null"> AND ABNORMAL_METHOD=#{ew.entity.abnormalMethod}</if>
@ -135,7 +144,8 @@
<if test="ew.entity.itemBo!=null"> AND ITEM_BO=#{ew.entity.itemBo}</if>
<if test="ew.entity.qty!=null"> AND QTY=#{ew.entity.qty}</if>
<if test="ew.entity.processor!=null"> AND PROCESSOR=#{ew.entity.processor}</if>
<if test="ew.entity.processDateTime!=null"> AND PROCESS_DATE_TIME=#{ew.entity.processDateTime}</if>
<if test="ew.entity.sendUserGroup!=null"> AND SEND_USER_GROUP=#{ew.entity.sendUserGroup}</if>
<if test="ew.entity.sendDateTime!=null"> AND SEND_DATE_TIME=#{ew.entity.sendDateTime}</if>
<if test="ew.entity.closedUser!=null"> AND CLOSED_USER=#{ew.entity.closedUser}</if>
<if test="ew.entity.closedDateTime!=null"> AND CLOSED_DATE_TIME=#{ew.entity.closedDateTime}</if>
<if test="ew.entity.createdUser!=null"> AND CREATED_USER=#{ew.entity.createdUser}</if>
@ -162,7 +172,7 @@
HANDLE=#{ew.entity.handle}
</if>
<if test="ew.entity.site!=null"> AND SITE=#{ew.entity.site}</if>
<if test="ew.entity.abnormalBillBo!=null"> AND ABNORMAL_BILL_BO=#{ew.entity.abnormalBillBo}</if>
<if test="ew.entity.abnormalNo!=null"> AND ABNORMAL_NO=#{ew.entity.abnormalNo}</if>
<if test="ew.entity.status!=null"> AND STATUS=#{ew.entity.status}</if>
<if test="ew.entity.workCenter!=null"> AND WORK_CENTER=#{ew.entity.workCenter}</if>
<if test="ew.entity.abnormalMethod!=null"> AND ABNORMAL_METHOD=#{ew.entity.abnormalMethod}</if>
@ -171,7 +181,8 @@
<if test="ew.entity.itemBo!=null"> AND ITEM_BO=#{ew.entity.itemBo}</if>
<if test="ew.entity.qty!=null"> AND QTY=#{ew.entity.qty}</if>
<if test="ew.entity.processor!=null"> AND PROCESSOR=#{ew.entity.processor}</if>
<if test="ew.entity.processDateTime!=null"> AND PROCESS_DATE_TIME=#{ew.entity.processDateTime}</if>
<if test="ew.entity.sendUserGroup!=null"> AND SEND_USER_GROUP=#{ew.entity.sendUserGroup}</if>
<if test="ew.entity.sendDateTime!=null"> AND SEND_DATE_TIME=#{ew.entity.sendDateTime}</if>
<if test="ew.entity.closedUser!=null"> AND CLOSED_USER=#{ew.entity.closedUser}</if>
<if test="ew.entity.closedDateTime!=null"> AND CLOSED_DATE_TIME=#{ew.entity.closedDateTime}</if>
<if test="ew.entity.createdUser!=null"> AND CREATED_USER=#{ew.entity.createdUser}</if>
@ -198,7 +209,7 @@
HANDLE=#{ew.entity.handle}
</if>
<if test="ew.entity.site!=null"> AND SITE=#{ew.entity.site}</if>
<if test="ew.entity.abnormalBillBo!=null"> AND ABNORMAL_BILL_BO=#{ew.entity.abnormalBillBo}</if>
<if test="ew.entity.abnormalNo!=null"> AND ABNORMAL_NO=#{ew.entity.abnormalNo}</if>
<if test="ew.entity.status!=null"> AND STATUS=#{ew.entity.status}</if>
<if test="ew.entity.workCenter!=null"> AND WORK_CENTER=#{ew.entity.workCenter}</if>
<if test="ew.entity.abnormalMethod!=null"> AND ABNORMAL_METHOD=#{ew.entity.abnormalMethod}</if>
@ -207,7 +218,8 @@
<if test="ew.entity.itemBo!=null"> AND ITEM_BO=#{ew.entity.itemBo}</if>
<if test="ew.entity.qty!=null"> AND QTY=#{ew.entity.qty}</if>
<if test="ew.entity.processor!=null"> AND PROCESSOR=#{ew.entity.processor}</if>
<if test="ew.entity.processDateTime!=null"> AND PROCESS_DATE_TIME=#{ew.entity.processDateTime}</if>
<if test="ew.entity.sendUserGroup!=null"> AND SEND_USER_GROUP=#{ew.entity.sendUserGroup}</if>
<if test="ew.entity.sendDateTime!=null"> AND SEND_DATE_TIME=#{ew.entity.sendDateTime}</if>
<if test="ew.entity.closedUser!=null"> AND CLOSED_USER=#{ew.entity.closedUser}</if>
<if test="ew.entity.closedDateTime!=null"> AND CLOSED_DATE_TIME=#{ew.entity.closedDateTime}</if>
<if test="ew.entity.createdUser!=null"> AND CREATED_USER=#{ew.entity.createdUser}</if>
@ -234,7 +246,7 @@
HANDLE=#{ew.entity.handle}
</if>
<if test="ew.entity.site!=null"> AND SITE=#{ew.entity.site}</if>
<if test="ew.entity.abnormalBillBo!=null"> AND ABNORMAL_BILL_BO=#{ew.entity.abnormalBillBo}</if>
<if test="ew.entity.abnormalNo!=null"> AND ABNORMAL_NO=#{ew.entity.abnormalNo}</if>
<if test="ew.entity.status!=null"> AND STATUS=#{ew.entity.status}</if>
<if test="ew.entity.workCenter!=null"> AND WORK_CENTER=#{ew.entity.workCenter}</if>
<if test="ew.entity.abnormalMethod!=null"> AND ABNORMAL_METHOD=#{ew.entity.abnormalMethod}</if>
@ -243,7 +255,8 @@
<if test="ew.entity.itemBo!=null"> AND ITEM_BO=#{ew.entity.itemBo}</if>
<if test="ew.entity.qty!=null"> AND QTY=#{ew.entity.qty}</if>
<if test="ew.entity.processor!=null"> AND PROCESSOR=#{ew.entity.processor}</if>
<if test="ew.entity.processDateTime!=null"> AND PROCESS_DATE_TIME=#{ew.entity.processDateTime}</if>
<if test="ew.entity.sendUserGroup!=null"> AND SEND_USER_GROUP=#{ew.entity.sendUserGroup}</if>
<if test="ew.entity.sendDateTime!=null"> AND SEND_DATE_TIME=#{ew.entity.sendDateTime}</if>
<if test="ew.entity.closedUser!=null"> AND CLOSED_USER=#{ew.entity.closedUser}</if>
<if test="ew.entity.closedDateTime!=null"> AND CLOSED_DATE_TIME=#{ew.entity.closedDateTime}</if>
<if test="ew.entity.createdUser!=null"> AND CREATED_USER=#{ew.entity.createdUser}</if>
@ -270,7 +283,7 @@
HANDLE=#{ew.entity.handle}
</if>
<if test="ew.entity.site!=null"> AND SITE=#{ew.entity.site}</if>
<if test="ew.entity.abnormalBillBo!=null"> AND ABNORMAL_BILL_BO=#{ew.entity.abnormalBillBo}</if>
<if test="ew.entity.abnormalNo!=null"> AND ABNORMAL_NO=#{ew.entity.abnormalNo}</if>
<if test="ew.entity.status!=null"> AND STATUS=#{ew.entity.status}</if>
<if test="ew.entity.workCenter!=null"> AND WORK_CENTER=#{ew.entity.workCenter}</if>
<if test="ew.entity.abnormalMethod!=null"> AND ABNORMAL_METHOD=#{ew.entity.abnormalMethod}</if>
@ -279,7 +292,8 @@
<if test="ew.entity.itemBo!=null"> AND ITEM_BO=#{ew.entity.itemBo}</if>
<if test="ew.entity.qty!=null"> AND QTY=#{ew.entity.qty}</if>
<if test="ew.entity.processor!=null"> AND PROCESSOR=#{ew.entity.processor}</if>
<if test="ew.entity.processDateTime!=null"> AND PROCESS_DATE_TIME=#{ew.entity.processDateTime}</if>
<if test="ew.entity.sendUserGroup!=null"> AND SEND_USER_GROUP=#{ew.entity.sendUserGroup}</if>
<if test="ew.entity.sendDateTime!=null"> AND SEND_DATE_TIME=#{ew.entity.sendDateTime}</if>
<if test="ew.entity.closedUser!=null"> AND CLOSED_USER=#{ew.entity.closedUser}</if>
<if test="ew.entity.closedDateTime!=null"> AND CLOSED_DATE_TIME=#{ew.entity.closedDateTime}</if>
<if test="ew.entity.createdUser!=null"> AND CREATED_USER=#{ew.entity.createdUser}</if>
@ -302,7 +316,7 @@
<trim prefix="(" suffix=")" suffixOverrides=",">
HANDLE,
<if test="site!=null">SITE,</if>
<if test="abnormalBillBo!=null">ABNORMAL_BILL_BO,</if>
<if test="abnormalNo!=null">ABNORMAL_NO,</if>
<if test="status!=null">STATUS,</if>
<if test="workCenter!=null">WORK_CENTER,</if>
<if test="abnormalMethod!=null">ABNORMAL_METHOD,</if>
@ -311,7 +325,8 @@
<if test="itemBo!=null">ITEM_BO,</if>
<if test="qty!=null">QTY,</if>
<if test="processor!=null">PROCESSOR,</if>
<if test="processDateTime!=null">PROCESS_DATE_TIME,</if>
<if test="sendUserGroup!=null">SEND_USER_GROUP,</if>
<if test="sendDateTime!=null">SEND_DATE_TIME,</if>
<if test="closedUser!=null">CLOSED_USER,</if>
<if test="closedDateTime!=null">CLOSED_DATE_TIME,</if>
<if test="createdUser!=null">CREATED_USER,</if>
@ -322,7 +337,7 @@
<trim prefix="(" suffix=")" suffixOverrides=",">
#{handle},
<if test="site!=null">#{site},</if>
<if test="abnormalBillBo!=null">#{abnormalBillBo},</if>
<if test="abnormalNo!=null">#{abnormalNo},</if>
<if test="status!=null">#{status},</if>
<if test="workCenter!=null">#{workCenter},</if>
<if test="abnormalMethod!=null">#{abnormalMethod},</if>
@ -331,7 +346,8 @@
<if test="itemBo!=null">#{itemBo},</if>
<if test="qty!=null">#{qty},</if>
<if test="processor!=null">#{processor},</if>
<if test="processDateTime!=null">#{processDateTime},</if>
<if test="sendUserGroup!=null">#{sendUserGroup},</if>
<if test="sendDateTime!=null">#{sendDateTime},</if>
<if test="closedUser!=null">#{closedUser},</if>
<if test="closedDateTime!=null">#{closedDateTime},</if>
<if test="createdUser!=null">#{createdUser},</if>
@ -349,7 +365,7 @@
<trim prefix="(" suffix=")" suffixOverrides=",">
#{handle},
#{site},
#{abnormalBillBo},
#{abnormalNo},
#{status},
#{workCenter},
#{abnormalMethod},
@ -358,7 +374,8 @@
#{itemBo},
#{qty},
#{processor},
#{processDateTime},
#{sendUserGroup},
#{sendDateTime},
#{closedUser},
#{closedDateTime},
#{createdUser},
@ -372,7 +389,7 @@
<update id="updateById">
UPDATE Z_ABNORMAL_PLAN <trim prefix="SET" suffixOverrides=",">
<if test="et.site!=null">SITE=#{et.site},</if>
<if test="et.abnormalBillBo!=null">ABNORMAL_BILL_BO=#{et.abnormalBillBo},</if>
<if test="et.abnormalNo!=null">ABNORMAL_NO=#{et.abnormalNo},</if>
<if test="et.status!=null">STATUS=#{et.status},</if>
<if test="et.workCenter!=null">WORK_CENTER=#{et.workCenter},</if>
<if test="et.abnormalMethod!=null">ABNORMAL_METHOD=#{et.abnormalMethod},</if>
@ -381,7 +398,8 @@
<if test="et.itemBo!=null">ITEM_BO=#{et.itemBo},</if>
<if test="et.qty!=null">QTY=#{et.qty},</if>
<if test="et.processor!=null">PROCESSOR=#{et.processor},</if>
<if test="et.processDateTime!=null">PROCESS_DATE_TIME=#{et.processDateTime},</if>
<if test="et.sendUserGroup!=null">SEND_USER_GROUP=#{et.sendUserGroup},</if>
<if test="et.sendDateTime!=null">SEND_DATE_TIME=#{et.sendDateTime},</if>
<if test="et.closedUser!=null">CLOSED_USER=#{et.closedUser},</if>
<if test="et.closedDateTime!=null">CLOSED_DATE_TIME=#{et.closedDateTime},</if>
<if test="et.createdUser!=null">CREATED_USER=#{et.createdUser},</if>
@ -395,7 +413,7 @@
<update id="updateAllColumnById">
UPDATE Z_ABNORMAL_PLAN <trim prefix="SET" suffixOverrides=",">
SITE=#{et.site},
ABNORMAL_BILL_BO=#{et.abnormalBillBo},
ABNORMAL_NO=#{et.abnormalNo},
STATUS=#{et.status},
WORK_CENTER=#{et.workCenter},
ABNORMAL_METHOD=#{et.abnormalMethod},
@ -404,7 +422,8 @@
ITEM_BO=#{et.itemBo},
QTY=#{et.qty},
PROCESSOR=#{et.processor},
PROCESS_DATE_TIME=#{et.processDateTime},
SEND_USER_GROUP=#{et.sendUserGroup},
SEND_DATE_TIME=#{et.sendDateTime},
CLOSED_USER=#{et.closedUser},
CLOSED_DATE_TIME=#{et.closedDateTime},
CREATED_USER=#{et.createdUser},
@ -418,7 +437,7 @@
<update id="update">
UPDATE Z_ABNORMAL_PLAN <trim prefix="SET" suffixOverrides=",">
<if test="et.site!=null">SITE=#{et.site},</if>
<if test="et.abnormalBillBo!=null">ABNORMAL_BILL_BO=#{et.abnormalBillBo},</if>
<if test="et.abnormalNo!=null">ABNORMAL_NO=#{et.abnormalNo},</if>
<if test="et.status!=null">STATUS=#{et.status},</if>
<if test="et.workCenter!=null">WORK_CENTER=#{et.workCenter},</if>
<if test="et.abnormalMethod!=null">ABNORMAL_METHOD=#{et.abnormalMethod},</if>
@ -427,7 +446,8 @@
<if test="et.itemBo!=null">ITEM_BO=#{et.itemBo},</if>
<if test="et.qty!=null">QTY=#{et.qty},</if>
<if test="et.processor!=null">PROCESSOR=#{et.processor},</if>
<if test="et.processDateTime!=null">PROCESS_DATE_TIME=#{et.processDateTime},</if>
<if test="et.sendUserGroup!=null">SEND_USER_GROUP=#{et.sendUserGroup},</if>
<if test="et.sendDateTime!=null">SEND_DATE_TIME=#{et.sendDateTime},</if>
<if test="et.closedUser!=null">CLOSED_USER=#{et.closedUser},</if>
<if test="et.closedDateTime!=null">CLOSED_DATE_TIME=#{et.closedDateTime},</if>
<if test="et.createdUser!=null">CREATED_USER=#{et.createdUser},</if>
@ -440,7 +460,7 @@
<if test="ew.entity!=null">
HANDLE=#{ew.entity.handle}
<if test="ew.entity.site!=null"> AND SITE=#{ew.entity.site}</if>
<if test="ew.entity.abnormalBillBo!=null"> AND ABNORMAL_BILL_BO=#{ew.entity.abnormalBillBo}</if>
<if test="ew.entity.abnormalNo!=null"> AND ABNORMAL_NO=#{ew.entity.abnormalNo}</if>
<if test="ew.entity.status!=null"> AND STATUS=#{ew.entity.status}</if>
<if test="ew.entity.workCenter!=null"> AND WORK_CENTER=#{ew.entity.workCenter}</if>
<if test="ew.entity.abnormalMethod!=null"> AND ABNORMAL_METHOD=#{ew.entity.abnormalMethod}</if>
@ -449,7 +469,8 @@
<if test="ew.entity.itemBo!=null"> AND ITEM_BO=#{ew.entity.itemBo}</if>
<if test="ew.entity.qty!=null"> AND QTY=#{ew.entity.qty}</if>
<if test="ew.entity.processor!=null"> AND PROCESSOR=#{ew.entity.processor}</if>
<if test="ew.entity.processDateTime!=null"> AND PROCESS_DATE_TIME=#{ew.entity.processDateTime}</if>
<if test="ew.entity.sendUserGroup!=null"> AND SEND_USER_GROUP=#{ew.entity.sendUserGroup}</if>
<if test="ew.entity.sendDateTime!=null"> AND SEND_DATE_TIME=#{ew.entity.sendDateTime}</if>
<if test="ew.entity.closedUser!=null"> AND CLOSED_USER=#{ew.entity.closedUser}</if>
<if test="ew.entity.closedDateTime!=null"> AND CLOSED_DATE_TIME=#{ew.entity.closedDateTime}</if>
<if test="ew.entity.createdUser!=null"> AND CREATED_USER=#{ew.entity.createdUser}</if>
@ -493,7 +514,7 @@
HANDLE=#{ew.entity.handle}
</if>
<if test="ew.entity.site!=null"> AND SITE=#{ew.entity.site}</if>
<if test="ew.entity.abnormalBillBo!=null"> AND ABNORMAL_BILL_BO=#{ew.entity.abnormalBillBo}</if>
<if test="ew.entity.abnormalNo!=null"> AND ABNORMAL_NO=#{ew.entity.abnormalNo}</if>
<if test="ew.entity.status!=null"> AND STATUS=#{ew.entity.status}</if>
<if test="ew.entity.workCenter!=null"> AND WORK_CENTER=#{ew.entity.workCenter}</if>
<if test="ew.entity.abnormalMethod!=null"> AND ABNORMAL_METHOD=#{ew.entity.abnormalMethod}</if>
@ -502,7 +523,8 @@
<if test="ew.entity.itemBo!=null"> AND ITEM_BO=#{ew.entity.itemBo}</if>
<if test="ew.entity.qty!=null"> AND QTY=#{ew.entity.qty}</if>
<if test="ew.entity.processor!=null"> AND PROCESSOR=#{ew.entity.processor}</if>
<if test="ew.entity.processDateTime!=null"> AND PROCESS_DATE_TIME=#{ew.entity.processDateTime}</if>
<if test="ew.entity.sendUserGroup!=null"> AND SEND_USER_GROUP=#{ew.entity.sendUserGroup}</if>
<if test="ew.entity.sendDateTime!=null"> AND SEND_DATE_TIME=#{ew.entity.sendDateTime}</if>
<if test="ew.entity.closedUser!=null"> AND CLOSED_USER=#{ew.entity.closedUser}</if>
<if test="ew.entity.closedDateTime!=null"> AND CLOSED_DATE_TIME=#{ew.entity.closedDateTime}</if>
<if test="ew.entity.createdUser!=null"> AND CREATED_USER=#{ew.entity.createdUser}</if>
@ -527,4 +549,42 @@
</delete>
<!-- BaseMapper标准查询/修改/删除 -->
<select id="findAbnormalPlan" resultMap="abnormalPlanDto">
SELECT ZAP.ABNORMAL_NO ABNORMAL_NO ,ZAP.ABNORMAL_METHOD ABNORMAL_METHOD ,
ZAP.SHOP_ORDER SHOP_ORDER ,R.DESCRIPTION RESRCE_DESCRIPTION,ZAP.STATUS STATUS ,
IT.DESCRIPTION ITEM_DESCRIPTION,ZAP.QTY QTY ,ZNU.FULL_NAME FULL_NAME
FROM Z_ABNORMAL_PLAN ZAP
LEFT JOIN RESRCE R ON R.RESRCE = ZAP.RESRCE AND R.SITE = ZAP.SITE
LEFT JOIN ITEM_T IT ON IT.ITEM_BO = ZAP.ITEM_BO AND IT.LOCALE = #{locale}
LEFT JOIN Z_NWA_USER ZNU ON ZNU.USER_NAME = ZAP.PROCESSOR AND ZNU.SITE = ZAP.SITE
<where>
ZAP.SITE =#{abnormalPlanDto.site}
<if test="abnormalPlanDto.workCenter != null and abnormalPlanDto.workCenter != ''">
AND ZAP.WORK_CENTER = #{abnormalPlanDto.workCenter}
</if>
<if test="abnormalPlanDto.resrce != null and abnormalPlanDto.resrce != ''">
AND ZAP.RESRCE =#{abnormalPlanDto.resrce}
</if>
<if test="abnormalPlanDto.shopOrder != null and abnormalPlanDto.shopOrder != ''">
AND ZAP.SHOP_ORDER = #{abnormalPlanDto.shopOrder}
</if>
<if test="abnormalPlanDto.abnormalNo != null and abnormalPlanDto.abnormalNo != '' ">
AND ZAP.ABNORMAL_NO = #{abnormalPlanDto.abnormalNo}
</if>
<if test="abnormalPlanDto.status != null and abnormalPlanDto.status != ''">
AND ZAP.STATUS = #{abnormalPlanDto.status}
</if>
<if test="abnormalPlanDto.abnormalMethod != null and abnormalPlanDto.abnormalMethod != ''">
AND ZAP.ABNORMAL_METHOD = #{abnormalPlanDto.abnormalMethod}
</if>
<if test="abnormalPlanDto.startDateTime != null ">
AND ZAP.CLOSED_DATE_TIME &gt;= #{abnormalPlanDto.startDateTime}
</if>
<if test="abnormalPlanDto.endDateTime != null">
AND ZAP.CLOSED_DATE_TIME &lt;= #{abnormalPlanDto.endDateTime}
</if>
</where>
</select>
</mapper>

@ -143,6 +143,7 @@ public interface Constants {
String ABNORMAL_MESSAGE_QUALITY = "QCYC";//质量异常消息类型
String ABNORMAL_MESSAGE_OTHER = "OTYC";//其他异常消息类型
String ABNORMAL_MESSAGE_RESOURCE = "RSYC";//设备异常消息类型
String ABNORMAL_MESSAGE_PLAN = "PLYC";//计划异常待办事项
/**
*
@ -172,8 +173,8 @@ public interface Constants {
/**
*
*/
String UNTREATED = "UNTREATED"; //未处理
String PROCESSED = "PROCESSED"; //已处理
String UNTREATED = "UN"; //未处理
String PROCESSED = "PR"; //已处理
}

@ -14,12 +14,21 @@ public class SfcDto extends Sfc {
private String resrce;
private String workCenter;
private String dispatchNo;
private String abnormalNo;
private String stepId;
private String plannedStartDate;
private String plannedCompDate;
//工作令号
private String workOrder;
public String getAbnormalNo() {
return abnormalNo;
}
public void setAbnormalNo(String abnormalNo) {
this.abnormalNo = abnormalNo;
}
public String getWorkOrder() {
return workOrder;
}

@ -6,6 +6,15 @@ public class SplitSfcDto extends SplitSfc {
private String ncCode;
private String routerBo;
private String ncQty;
private String abnormalNo;
public String getAbnormalNo() {
return abnormalNo;
}
public void setAbnormalNo(String abnormalNo) {
this.abnormalNo = abnormalNo;
}
public String getNcCode() {
return ncCode;

@ -8,6 +8,8 @@ import com.foreverwin.mesnac.common.service.SfcDispatchCommonService;
import com.foreverwin.mesnac.common.util.ExceptionUtil;
import com.foreverwin.mesnac.common.util.StringUtil;
import com.foreverwin.mesnac.meapi.dto.SfcDto;
import com.foreverwin.mesnac.meapi.model.Router;
import com.foreverwin.mesnac.meapi.service.RouterService;
import com.foreverwin.mesnac.meapi.service.ShopOrderService;
import com.foreverwin.mesnac.production.dto.SplitSfcDto;
import com.foreverwin.mesnac.production.mapper.SplitSfcMapper;
@ -50,6 +52,8 @@ public class SplitSfcServiceImpl extends ServiceImpl<SplitSfcMapper, SplitSfc> i
private SfcDispatchCommonService sfcDispatchCommonService;
@Autowired
private ShopOrderService shopOrderService;
@Autowired
private RouterService routerService;
@Override
public IPage<SplitSfc> selectPage(FrontPage<SplitSfc> frontPage, SplitSfc splitSfc) {
QueryWrapper<SplitSfc> queryWrapper = new QueryWrapper<>();
@ -80,6 +84,7 @@ public class SplitSfcServiceImpl extends ServiceImpl<SplitSfcMapper, SplitSfc> i
throw new BaseException("未找到方案确认的质量异常");
}
sfcData.setQty(Double.valueOf(sfcDto.getNcQty()));
sfcData.setAbnormalNo(sfcDto.getAbnormalNo());
return sfcData;
}
@Override
@ -133,6 +138,8 @@ public class SplitSfcServiceImpl extends ServiceImpl<SplitSfcMapper, SplitSfc> i
splitSfc.setCreatedDateTime(LocalDateTime.now());
save(splitSfc);
String workCenterBo = shopOrderService.getById(HandleEnum.SHOP_ORDER.getHandle(site, sfcData.getShopOrder())).getPlannedWorkCenterBo();
Router routerBySfcBo = routerService.getRouterBySfcBo(HandleEnum.SFC.getHandle(site, sfc));
sfcDispatchCommonService.saveSfcDispatch(site,CommonMethods.getUser(),StringUtil.trimHandle(workCenterBo),sfc, sfcData.getShopOrder(),routerBySfcBo.getHandle());
return splitSfc;
} catch (Exception e) {
ExceptionUtil.throwException(e);

@ -378,7 +378,7 @@
WHERE S.HANDLE=#{handle}
</select>
<select id="getAbnormalQty" resultType="com.foreverwin.mesnac.production.dto.SplitSfcDto">
SELECT zab.NC_QTY,zsbd.ROUTER_BO,zab.NC_CODE FROM Z_ABNORMAL_BILL zab
SELECT zab.NC_QTY,zsbd.ROUTER_BO,zab.NC_CODE,zab.ABNORMAL_NO FROM Z_ABNORMAL_BILL zab
JOIN Z_ABNORMAL_BILL_DISPOSE zsbd ON zab.HANDLE=ZSBD.ABNORMAL_BILL_BO
WHERE ZAB.SFC=#{sfc} AND zab.SITE=#{site} AND ZAB.OPERATION=#{operation} AND zab.STATUS='F' AND zab."TYPE"='Z' AND zsbd.ABNORMAL_METHOD='F'
</select>

@ -1,6 +1,7 @@
package com.foreverwin.mesnac.quality.service.impl;
import com.foreverwin.mesnac.common.constant.Constants;
import com.foreverwin.mesnac.common.enums.HandleEnum;
import com.foreverwin.mesnac.common.model.InspectionTask;
import com.foreverwin.mesnac.common.model.InspectionTaskDetail;
import com.foreverwin.mesnac.common.service.InspectionTaskDetailService;
@ -114,6 +115,12 @@ public class InspectionTaskManageServiceImpl implements InspectionTaskManageServ
throw BusinessException.build("任务【" +taskNo+ "】不是新建状态,不允许执行合格操作");
}
List<InspectionTaskManageDetail> inspectionItemDetailList = this.getInspectionTaskDetail(HandleEnum.INSPECTION_TASK.getHandle(taskNo));
if (inspectionItemDetailList != null || inspectionItemDetailList.size() > 0) {
throw BusinessException.build("检验任务:"+taskNo+"有检验项目,不允许执行合格操作");
}
//修改数据
InspectionTask inspectionTask = new InspectionTask();
inspectionTask.setHandle(request.getHandle());

Loading…
Cancel
Save