Merge remote-tracking branch 'origin/master'

master
zpl 3 years ago
commit 00517d55d3

@ -22,12 +22,10 @@ import com.foreverwin.mesnac.common.service.MessageService;
import com.foreverwin.mesnac.common.service.UserService;
import com.foreverwin.mesnac.common.util.ActiveMQUtil;
import com.foreverwin.mesnac.common.util.StringUtil;
import com.foreverwin.mesnac.meapi.dto.NcCodeDto;
import com.foreverwin.mesnac.meapi.mapper.*;
import com.foreverwin.mesnac.meapi.model.*;
import com.foreverwin.mesnac.meapi.service.DataFieldListService;
import com.foreverwin.mesnac.meapi.service.NwaUserService;
import com.foreverwin.mesnac.meapi.service.RouterService;
import com.foreverwin.mesnac.meapi.service.WorkCenterService;
import com.foreverwin.mesnac.meapi.service.*;
import com.foreverwin.mesnac.meapi.util.StringUtils;
import com.foreverwin.mesnac.quality.service.SelfReportService;
import com.foreverwin.modular.core.exception.BaseException;
@ -130,6 +128,9 @@ public class AbnormalBillServiceImpl extends ServiceImpl<AbnormalBillMapper, Abn
@Autowired
private UserService userService;
@Autowired
private NcCodeService ncCodeService;
@Override
@ -237,6 +238,28 @@ public class AbnormalBillServiceImpl extends ServiceImpl<AbnormalBillMapper, Abn
@Override
public String anomalyReportDevice(AbnormalBill abnormalBill,AbnormalBillDispose abnormalBillDispose) {
String message = this.generateAbnormalBill(abnormalBill, abnormalBillDispose, null, null);
LocalDateTime now = LocalDateTime.now();
String user = CommonMethods.getUser();
//异常代码
List<NcCodeDto> ncCodesAndNcGroups = ncCodeService.findNcCodeDescriptionByNcCode(abnormalBill.getNcCode());
List<AbnormalNcCode> abnormalNcCodes = new LinkedList<>();
for(int i = 0; i < ncCodesAndNcGroups.size(); i ++){
AbnormalNcCode abnormalNcCode = new AbnormalNcCode();
String uuid = UUID.randomUUID().toString();
abnormalNcCode.setHandle(uuid);
abnormalNcCode.setSite(abnormalBill.getSite());
abnormalNcCode.setAbnormalBillBo(abnormalBill.getHandle());
abnormalNcCode.setNcCodeGroup(ncCodesAndNcGroups.get(i).getNgGroup());
abnormalNcCode.setNcCode(ncCodesAndNcGroups.get(i).getNcCode());
abnormalNcCode.setNcQty(abnormalBill.getNcQty());
abnormalNcCode.setCreatedUser(user);
abnormalNcCode.setCreatedDateTime(now);
abnormalNcCode.setModifiedUser(user);
abnormalNcCode.setModifiedDateTime(now);
abnormalNcCodes.add(abnormalNcCode);
}
abnormalNcCodeService.saveOrUpdateBatch(abnormalNcCodes);
abnormalBillDisposeService.saveOrUpdate(abnormalBillDispose);
this.saveOrUpdate(abnormalBill);
//发送消息

@ -973,11 +973,14 @@
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.REPORT_SEND_USER_GROUP REPORT_SEND_USER_GROUP
ZAB.REPORT_SEND_USER_GROUP REPORT_SEND_USER_GROUP,
SUBSTR(LISTAGG(NCT.DESCRIPTION || ',') WITHIN GROUP(ORDER BY ZAB.ABNORMAL_NO),0,LENGTH(LISTAGG(NCT.DESCRIPTION || ',') WITHIN GROUP(ORDER BY ZAB.ABNORMAL_NO))-1) NC_CODE_DESCRIPTION
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 Z_ABNORMAL_NC_CODE zanc ON zanc.ABNORMAL_BILL_BO = ZAB.HANDLE
LEFT JOIN NC_CODE_T NCT ON NCT.NC_CODE_BO = 'NCCodeBO:'|| ZAB.SITE || ',' || ZANC.NC_CODE AND NCT.LOCALE = #{language}
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
@ -993,6 +996,13 @@
</if>
</if>
</where>
GROUP BY
ZAB.ABNORMAL_NO , ZAB.STATUS ,ZAB.REPORT_FROM ,WCT.DESCRIPTION ,
ZAB.RESRCE ,R.DESCRIPTION ,ZNU.FULL_NAME ,ZAB.MESSAGE_TYPE ,
ZAB.NC_CODE ,ZAB.PB_DESCRIPTION ,ZAB.SHUT_DOWN ,ZAB.RESPONSE_USER ,ZAB.RESPONSE_DATE_TIME ,
ZABD.ABNORMAL_METHOD ,ZNU3.FULL_NAME ,ZABD.RESOLVE_REMARK ,
ZAB.CANCEL_CODE ,ZAB.CANCEL_DATE_TIME ,ZNU4.FULL_NAME ,ZAB.CANCEL_REASON ,
ZAB.REPORT_SEND_USER_GROUP
</select>
<select id="findCountBySfc" resultMap="BaseResultMap">

@ -1,21 +1,16 @@
package com.foreverwin.mesnac.common.util;
import com.foreverwin.modular.core.exception.BaseException;
import org.json.JSONObject;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.autoconfigure.condition.ConditionalOnProperty;
import org.springframework.jms.core.JmsMessagingTemplate;
import org.springframework.stereotype.Component;
import java.util.concurrent.TimeUnit;
/**
* @Description TODO
* @Author zhaojiawei
* @Since 2021-07-21
*/
@Component
@ConditionalOnProperty(prefix = "activeMq", value = {"enabled"}, matchIfMissing = true)
public class ActiveMQUtil {
@ -28,16 +23,13 @@ public class ActiveMQUtil {
try{
jsonObject.put("TO_USER", user);
jsonObject.put("CONTENT",text);
defaultJmsTemplate.getJmsTemplate().setReceiveTimeout(TimeUnit.SECONDS.toMillis(3));
String message = defaultJmsTemplate.convertSendAndReceive(queue, jsonObject.toString(), String.class);
if (StringUtil.isBlank(message)) {
//记日志
}
// defaultJmsTemplate.getJmsTemplate().setReceiveTimeout(TimeUnit.SECONDS.toMillis(3));
defaultJmsTemplate.convertAndSend(queue, jsonObject.toString());
// if (StringUtil.isBlank(message)) {
// //记日志
// }
}catch (Exception ignored){
throw new BaseException("消息发送失败");
// throw new BaseException("消息发送失败");
}
}
}

@ -168,6 +168,8 @@ public class CallItem extends Model<CallItem> {
@TableField(exist = false)
private String resourceType;
@TableField(exist = false)
private String resourceDescription;
@TableField(exist = false)
private String blankingSize;
@TableField(exist = false)
private String operationDescription;
@ -484,6 +486,22 @@ public class CallItem extends Model<CallItem> {
this.resourceType = resourceType;
}
public String getWorkCenterDescription() {
return workCenterDescription;
}
public void setWorkCenterDescription(String workCenterDescription) {
this.workCenterDescription = workCenterDescription;
}
public String getResourceDescription() {
return resourceDescription;
}
public void setResourceDescription(String resourceDescription) {
this.resourceDescription = resourceDescription;
}
public String getBlankingSize() {
return blankingSize;
}

@ -41,6 +41,7 @@
<result column="DISPATCH_QTY" property="dispatchQty" />
<result column="RESOURCE_TYPE" property="resourceType" />
<result column="BLANKING_SIZE" property="blankingSize" />
<result column="RESOURCE_DESCRIPTION" property="resourceDescription" />
<result column="OPERATION_DESCRIPTION" property="operationDescription" />
<result column="PLANNED_START_DATE" property="plannedStartDate" />
<result column="REMARK" property="remark" />
@ -881,10 +882,11 @@
</select>
<select id="finsIssueItemListToResource" resultMap="FullResultMap">
SELECT VIP.SITE, VIP.WORK_ORDER, VIP.CALL_TYPE, VIP.ITEM_GROUP, VIP.ITEM_BO, VIP.ITEM, VIP.ITEM_DESCRIPTION, VIP.REQUIRED_QTY, VIP.BLANKING_SIZE, VIP.RESRCE, SIP.SOURCE_RESOURCE
SELECT VIP.SITE, VIP.WORK_ORDER, VIP.CALL_TYPE, VIP.ITEM_GROUP, VIP.ITEM_BO, VIP.ITEM, VIP.ITEM_DESCRIPTION, VIP.REQUIRED_QTY, VIP.BLANKING_SIZE, VIP.RESRCE, VIP.RESOURCE_DESCRIPTION, SIP.SOURCE_RESOURCE
FROM (
SELECT L.SITE, CF.VALUE WORK_ORDER, L.CALL_TYPE, IG.ITEM_GROUP, CP.HANDLE ITEM_BO, CP.ITEM, CT.DESCRIPTION ITEM_DESCRIPTION, SUM(L.REQUIRED_QTY)-SUM(NVL(L.ISSUE_QTY,0)) REQUIRED_QTY, W.BLANKING_SIZE, W.RESRCE
SELECT L.SITE, CF.VALUE WORK_ORDER, L.CALL_TYPE, IG.ITEM_GROUP, CP.HANDLE ITEM_BO, CP.ITEM, CT.DESCRIPTION ITEM_DESCRIPTION, SUM(L.REQUIRED_QTY)-SUM(NVL(L.ISSUE_QTY,0)) REQUIRED_QTY, W.BLANKING_SIZE, W.RESRCE, RS.DESCRIPTION RESOURCE_DESCRIPTION
FROM Z_CALL_ITEM L
INNER JOIN RESRCE RS ON L.SITE = RS.SITE AND L.RESRCE = RS.RESRCE
INNER JOIN Z_SFC_DISPATCH W ON L.SFC_DISPATCH_BO = W.HANDLE
INNER JOIN ITEM CP ON CP.HANDLE = L.COMPONENT_BO
LEFT JOIN ITEM_T CT ON CT.ITEM_BO = CP.HANDLE AND CT.LOCALE = 'zh'
@ -911,7 +913,7 @@
<if test="requiredToDT != null">
AND L.REQUIRED_DATE_TIME &lt;= #{requiredToDT}
</if>
GROUP BY L.SITE, CF.VALUE, L.CALL_TYPE, IG.ITEM_GROUP, CP.HANDLE, CP.ITEM, CT.DESCRIPTION, W.BLANKING_SIZE, W.RESRCE
GROUP BY L.SITE, CF.VALUE, L.CALL_TYPE, IG.ITEM_GROUP, CP.HANDLE, CP.ITEM, CT.DESCRIPTION, W.BLANKING_SIZE, W.RESRCE, RS.DESCRIPTION
) VIP
LEFT JOIN (
SELECT L.SITE, L.ITEM_BO, ZD.RESRCE SOURCE_RESOURCE

@ -696,7 +696,7 @@
LEFT JOIN WORK_CENTER WR ON WR.HANDLE = WCM.WORK_CENTER_BO
WHERE SD.SITE = #{site}
<if test="workCenter != null and workCenter != ''">
AND SD.WORK_CENTER = #{workCenter}
AND SD.OPERATION LIKE #{workCenter}||'%'
</if>
<if test="dispatchStatus != null and dispatchStatus != ''">
AND SD.DISPATCH_STATUS = #{dispatchStatus}

@ -1,8 +1,14 @@
package com.foreverwin.mesnac.integration.controller;
import com.foreverwin.mesnac.integration.model.IntegrationLog;
import com.foreverwin.mesnac.integration.service.IntegrationLogService;
import com.foreverwin.modular.core.util.R;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.*;
import org.springframework.web.bind.annotation.RestController;
/**
*
@ -12,6 +18,12 @@ import org.springframework.web.bind.annotation.*;
@RestController
@RequestMapping("/Z-INTEGRATION-LOG")
public class IntegrationLogController {
@Autowired
private IntegrationLogService integrationLogService;
@PostMapping("/findIntegrationLog")
public R findIntegrationLog(@RequestBody IntegrationLog integration){
return R.ok(integrationLogService.findIntegrationLog(integration));
}
}

@ -2,8 +2,11 @@ package com.foreverwin.mesnac.integration.mapper;
import com.foreverwin.mesnac.integration.model.IntegrationLog;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import org.apache.ibatis.annotations.Param;
import org.springframework.stereotype.Repository;
import java.util.List;
/**
* <p>
* Mapper
@ -15,4 +18,5 @@ import org.springframework.stereotype.Repository;
@Repository
public interface IntegrationLogMapper extends BaseMapper<IntegrationLog> {
List<IntegrationLog> findIntegrationLog(@Param("integration") IntegrationLog integration);
}

@ -1,13 +1,13 @@
package com.foreverwin.mesnac.integration.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.io.Serializable;
import java.time.LocalDateTime;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.IdType;
/**
* <p>
@ -94,6 +94,12 @@ public class IntegrationLog extends Model<IntegrationLog> {
@TableField("CREATED_DATE_TIME")
private LocalDateTime createdDateTime;
@TableField(exist = false)
private LocalDateTime startDateTime;
@TableField(exist = false)
private LocalDateTime endDateTime;
public String getHandle() {
return handle;
@ -207,6 +213,22 @@ public class IntegrationLog extends Model<IntegrationLog> {
this.createdDateTime = createdDateTime;
}
public LocalDateTime getStartDateTime() {
return startDateTime;
}
public void setStartDateTime(LocalDateTime startDateTime) {
this.startDateTime = startDateTime;
}
public LocalDateTime getEndDateTime() {
return endDateTime;
}
public void setEndDateTime(LocalDateTime endDateTime) {
this.endDateTime = endDateTime;
}
public static final String HANDLE = "HANDLE";
public static final String SITE = "SITE";

@ -3,6 +3,8 @@ package com.foreverwin.mesnac.integration.service;
import com.baomidou.mybatisplus.extension.service.IService;
import com.foreverwin.mesnac.integration.model.IntegrationLog;
import java.util.List;
/**
* <p>
*
@ -14,4 +16,6 @@ import com.foreverwin.mesnac.integration.model.IntegrationLog;
public interface IntegrationLogService extends IService<IntegrationLog> {
void saveIntegrationLog(IntegrationLog integrationLog);
List<IntegrationLog> findIntegrationLog(IntegrationLog integration);
}

@ -1,14 +1,17 @@
package com.foreverwin.mesnac.integration.service.impl;
import com.foreverwin.mesnac.integration.model.IntegrationLog;
import com.foreverwin.mesnac.integration.mapper.IntegrationLogMapper;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.foreverwin.mesnac.integration.mapper.IntegrationLogMapper;
import com.foreverwin.mesnac.integration.model.IntegrationLog;
import com.foreverwin.mesnac.integration.service.IntegrationLogService;
import org.springframework.stereotype.Service;
import com.foreverwin.modular.core.util.CommonMethods;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Propagation;
import org.springframework.transaction.annotation.Transactional;
import java.util.List;
/**
* <p>
*
@ -30,4 +33,11 @@ public class IntegrationLogServiceImpl extends ServiceImpl<IntegrationLogMapper,
public void saveIntegrationLog(IntegrationLog integrationLog) {
integrationLogMapper.insert(integrationLog);
}
@Override
public List<IntegrationLog> findIntegrationLog(IntegrationLog integration) {
String site = CommonMethods.getSite();
integration.setSite(site);
return integrationLogMapper.findIntegrationLog(integration);
}
}

@ -462,5 +462,26 @@
</foreach>)
</delete>
<!-- BaseMapper标准查询/修改/删除 -->
<select id="findIntegrationLog" resultMap="BaseResultMap">
SELECT <include refid="Base_Column_List"></include>
FROM Z_INTEGRATION_LOG
<where>
SITE = #{integration.site}
<if test="integration.integrationType != null and integration.integrationType != ''">
AND INTEGRATION_TYPE = #{integration.integrationType}
</if>
<if test="integration.integrationWay != null and integration.integrationWay != ''">
AND INTEGRATION_WAY = #{integration.integrationWay}
</if>
<if test="integration.status != null and integration.status != ''">
AND STATUS = #{integration.status}
</if>
<if test="integration.startDateTime != null">
AND REQUEST_DATE_TIME &gt;= #{integration.startDateTime}
</if>
<if test="integration.endDateTime != null">
AND REQUEST_DATE_TIME &lt;= #{integration.endDateTime}
</if>
</where>
</select>
</mapper>

Loading…
Cancel
Save