|
|
|
@ -189,14 +189,14 @@ public class QcCheckTaskIncomeServiceImpl<QcCheckUnqualifiedService> implements
|
|
|
|
|
return 0;//没有找到检测项目
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/**qc_sample_rule**/
|
|
|
|
|
QcCheckTaskIncome sampQua = new QcCheckTaskIncome();
|
|
|
|
|
sampQua.setCheckType(qcCheckTaskIncome.getCheckType());
|
|
|
|
|
sampQua.setQuality(qcCheckTaskIncome.getQuality());
|
|
|
|
|
String sampNum = qcSampleRuleMapper.getSampNum(sampQua);
|
|
|
|
|
if(StringUtils.isNotBlank(sampNum)){
|
|
|
|
|
qcCheckTaskIncome.setSampleQuality(new BigDecimal(sampNum));
|
|
|
|
|
}
|
|
|
|
|
// /**qc_sample_rule**/
|
|
|
|
|
// QcCheckTaskIncome sampQua = new QcCheckTaskIncome();
|
|
|
|
|
// sampQua.setCheckType(qcCheckTaskIncome.getCheckType());
|
|
|
|
|
// sampQua.setQuality(qcCheckTaskIncome.getQuality());
|
|
|
|
|
// String sampNum = qcSampleRuleMapper.getSampNum(sampQua);
|
|
|
|
|
// if(StringUtils.isNotBlank(sampNum)){
|
|
|
|
|
// qcCheckTaskIncome.setSampleQuality(new BigDecimal(sampNum));
|
|
|
|
|
// }
|
|
|
|
|
|
|
|
|
|
/**qc_check_task**/
|
|
|
|
|
String beLongId = IdUtils.fastSimpleUUID();
|
|
|
|
@ -659,9 +659,12 @@ public class QcCheckTaskIncomeServiceImpl<QcCheckUnqualifiedService> implements
|
|
|
|
|
result = qcCheckTaskIncome.getCheckResult();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
//抽样方案
|
|
|
|
|
BigDecimal sampleQua = this.getSampleQua(qcCheckTaskIncome);
|
|
|
|
|
|
|
|
|
|
int n = 0;
|
|
|
|
|
QcCheckTaskIncome qcCheckTask = new QcCheckTaskIncome();
|
|
|
|
|
qcCheckTask.setSampleQuality(sampleQua);
|
|
|
|
|
qcCheckTask.setUpdateBy(updateBy);
|
|
|
|
|
qcCheckTask.setRecordId(belongId);
|
|
|
|
|
qcCheckTask.setCheckStatus("2");//检测状态0待检测1检测中2检测完成
|
|
|
|
@ -830,56 +833,66 @@ public class QcCheckTaskIncomeServiceImpl<QcCheckUnqualifiedService> implements
|
|
|
|
|
unqualified.setUser("999999");
|
|
|
|
|
qcCheckUnqualifiedService.updateQcCheckUnqualified(unqualified);
|
|
|
|
|
}
|
|
|
|
|
//发送企业微信
|
|
|
|
|
this.sendWX(qcCheckTaskIncome);
|
|
|
|
|
}
|
|
|
|
|
return 1 ;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
//发企业微信--------------------开始(跟班组有关)
|
|
|
|
|
SysNoticeGroup noticeQo = new SysNoticeGroup();
|
|
|
|
|
if(qcCheckTaskIncome.getCheckType().equals("checkTypeLL")){
|
|
|
|
|
noticeQo.setNoticeId(9L);
|
|
|
|
|
}else if(qcCheckTaskIncome.getCheckType().equals("checkTypeSC")){
|
|
|
|
|
noticeQo.setNoticeId(13L);
|
|
|
|
|
}else if(qcCheckTaskIncome.getCheckType().equals("checkTypeSCXJ")){
|
|
|
|
|
noticeQo.setNoticeId(14L);
|
|
|
|
|
}else if(qcCheckTaskIncome.getCheckType().equals("checkTypeCP")){
|
|
|
|
|
noticeQo.setNoticeId(15L);
|
|
|
|
|
}else if(qcCheckTaskIncome.getCheckType().equals("checkTypeCPPC")){
|
|
|
|
|
noticeQo.setNoticeId(16L);
|
|
|
|
|
}
|
|
|
|
|
protected void sendWX(QcCheckTaskIncome qcCheckTaskIncome){
|
|
|
|
|
//发企业微信--------------------开始(跟班组有关)
|
|
|
|
|
SysNoticeGroup noticeQo = new SysNoticeGroup();
|
|
|
|
|
if(qcCheckTaskIncome.getCheckType().equals("checkTypeLL")){
|
|
|
|
|
noticeQo.setNoticeId(9L);
|
|
|
|
|
}else if(qcCheckTaskIncome.getCheckType().equals("checkTypeSC")){
|
|
|
|
|
noticeQo.setNoticeId(13L);
|
|
|
|
|
}else if(qcCheckTaskIncome.getCheckType().equals("checkTypeSCXJ")){
|
|
|
|
|
noticeQo.setNoticeId(14L);
|
|
|
|
|
}else if(qcCheckTaskIncome.getCheckType().equals("checkTypeCP")){
|
|
|
|
|
noticeQo.setNoticeId(15L);
|
|
|
|
|
}else if(qcCheckTaskIncome.getCheckType().equals("checkTypeCPPC")){
|
|
|
|
|
noticeQo.setNoticeId(16L);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
List<SysNoticeGroup> notices = qcCheckTaskIncomeMapper.getNoticesGroup(noticeQo);
|
|
|
|
|
if(!CollectionUtils.isEmpty(notices)) {
|
|
|
|
|
List<WechartDTO> wecharts = new ArrayList<>();
|
|
|
|
|
for (SysNoticeGroup noticedto : notices) {
|
|
|
|
|
WechartDTO wechart0 = new WechartDTO();
|
|
|
|
|
wechart0.setUserId(noticedto.getWxId());
|
|
|
|
|
String contentInfo = noticedto.getNoticeContent();
|
|
|
|
|
contentInfo = contentInfo.replace("${materialCode}", qcCheckTaskIncome.getMaterialCode()+"\n")
|
|
|
|
|
.replace("${materialName}", qcCheckTaskIncome.getMaterialName()+"\n")
|
|
|
|
|
.replace("${checkNo}", qcCheckTaskIncome.getCheckNo()+"\n")
|
|
|
|
|
.replace("${supplierName}", qcCheckTaskIncome.getSupplierName()+"\n")
|
|
|
|
|
.replace("${quality}", qcCheckTaskIncome.getQuality()+"\n");
|
|
|
|
|
if(StringUtils.isNotBlank(qcCheckTaskIncome.getIncomeBatchNo())){
|
|
|
|
|
contentInfo = contentInfo.replace("${incomeBatchNo}", qcCheckTaskIncome.getIncomeBatchNo()+"\n");
|
|
|
|
|
}
|
|
|
|
|
if(StringUtils.isNotBlank(qcCheckTaskIncome.getOrderNo())){
|
|
|
|
|
contentInfo = contentInfo.replace("${orderNo}", qcCheckTaskIncome.getOrderNo()+"\n");
|
|
|
|
|
}
|
|
|
|
|
Matcher m = p2.matcher(contentInfo);
|
|
|
|
|
contentInfo = m.replaceAll("");
|
|
|
|
|
wechart0.setText(contentInfo);
|
|
|
|
|
wecharts.add(wechart0);
|
|
|
|
|
List<SysNoticeGroup> notices = qcCheckTaskIncomeMapper.getNoticesGroup(noticeQo);
|
|
|
|
|
if(!CollectionUtils.isEmpty(notices)) {
|
|
|
|
|
List<WechartDTO> wecharts = new ArrayList<>();
|
|
|
|
|
for (SysNoticeGroup noticedto : notices) {
|
|
|
|
|
WechartDTO wechart0 = new WechartDTO();
|
|
|
|
|
wechart0.setUserId(noticedto.getWxId());
|
|
|
|
|
String contentInfo = noticedto.getNoticeContent();
|
|
|
|
|
contentInfo = contentInfo.replace("${materialCode}", qcCheckTaskIncome.getMaterialCode()+"\n")
|
|
|
|
|
.replace("${materialName}", qcCheckTaskIncome.getMaterialName()+"\n")
|
|
|
|
|
.replace("${checkNo}", qcCheckTaskIncome.getCheckNo()+"\n")
|
|
|
|
|
.replace("${supplierName}", qcCheckTaskIncome.getSupplierName()+"\n")
|
|
|
|
|
.replace("${quality}", qcCheckTaskIncome.getQuality()+"\n");
|
|
|
|
|
if(StringUtils.isNotBlank(qcCheckTaskIncome.getIncomeBatchNo())){
|
|
|
|
|
contentInfo = contentInfo.replace("${incomeBatchNo}", qcCheckTaskIncome.getIncomeBatchNo()+"\n");
|
|
|
|
|
}
|
|
|
|
|
logger.info("检验企业微信提醒请求:" + JSONObject.toJSONString(wecharts));
|
|
|
|
|
if (!CollectionUtils.isEmpty(wecharts)) {
|
|
|
|
|
new Thread(() -> {
|
|
|
|
|
AjaxResult wxresult = remoteOpenService.sendWeChartMessage(wecharts);
|
|
|
|
|
logger.info("检验企业微信提醒结果:" + JSONObject.toJSONString(wxresult));
|
|
|
|
|
|
|
|
|
|
}).start();
|
|
|
|
|
if(StringUtils.isNotBlank(qcCheckTaskIncome.getOrderNo())){
|
|
|
|
|
contentInfo = contentInfo.replace("${orderNo}", qcCheckTaskIncome.getOrderNo()+"\n");
|
|
|
|
|
}
|
|
|
|
|
//发企业微信--------------------结束
|
|
|
|
|
Matcher m = p2.matcher(contentInfo);
|
|
|
|
|
contentInfo = m.replaceAll("");
|
|
|
|
|
wechart0.setText(contentInfo);
|
|
|
|
|
wecharts.add(wechart0);
|
|
|
|
|
}
|
|
|
|
|
logger.info("检验企业微信提醒请求:" + JSONObject.toJSONString(wecharts));
|
|
|
|
|
if (!CollectionUtils.isEmpty(wecharts)) {
|
|
|
|
|
new Thread(() -> {
|
|
|
|
|
AjaxResult wxresult = remoteOpenService.sendWeChartMessage(wecharts);
|
|
|
|
|
logger.info("检验企业微信提醒结果:" + JSONObject.toJSONString(wxresult));
|
|
|
|
|
|
|
|
|
|
}).start();
|
|
|
|
|
}
|
|
|
|
|
//发企业微信--------------------结束
|
|
|
|
|
}
|
|
|
|
|
return 1 ;
|
|
|
|
|
}
|
|
|
|
|
//抽样方案
|
|
|
|
|
protected BigDecimal getSampleQua(QcCheckTaskIncome qcCheckTaskIncome){
|
|
|
|
|
BigDecimal sampleQua = BigDecimal.ZERO;
|
|
|
|
|
|
|
|
|
|
return sampleQua;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
@Override
|
|
|
|
|