|
@@ -13,6 +13,7 @@ import com.rongwei.bscommon.sys.service.*;
|
|
|
import com.rongwei.bscommon.sys.utils.ApsUtils;
|
|
|
import com.rongwei.bsentity.domain.*;
|
|
|
import com.rongwei.bsentity.vo.*;
|
|
|
+import com.rongwei.rwadmincommon.system.domain.SysDictDo;
|
|
|
import com.rongwei.rwadmincommon.system.vo.SysUserVo;
|
|
|
import com.rongwei.rwcommon.base.BaseDo;
|
|
|
import com.rongwei.rwcommon.base.R;
|
|
@@ -21,8 +22,6 @@ import com.rongwei.rwcommon.utils.StringUtils;
|
|
|
import com.rongwei.rwcommon.vo.MailDo;
|
|
|
import com.rongwei.rwcommon.vo.generalsql.MasterSlaveInsertVo;
|
|
|
import com.rongwei.rwcommon.vo.generalsql.MasterSlaveUpdateVo;
|
|
|
-import com.rongwei.rwcommonentity.commonservers.domain.SysMindMappingDo;
|
|
|
-
|
|
|
import com.rongwei.safecommon.fegin.CXAdminFeginClient;
|
|
|
import com.rongwei.safecommon.fegin.CXCommonFeginClient;
|
|
|
import com.rongwei.safecommon.utils.CXCommonUtils;
|
|
@@ -49,7 +48,6 @@ import static com.rongwei.safecommon.utils.SaveConstans.DatePattern.DATE_PATTERN
|
|
|
import static com.rongwei.safecommon.utils.SaveConstans.NotifyContent.*;
|
|
|
import static com.rongwei.safecommon.utils.SaveConstans.NotifyTitle.*;
|
|
|
import static com.rongwei.safecommon.utils.SaveConstans.NotifyType.*;
|
|
|
-import static java.lang.Thread.sleep;
|
|
|
|
|
|
/**
|
|
|
*
|
|
@@ -156,6 +154,8 @@ public class ApsProductionOrderServiceImpl extends ServiceImpl<ApsProductionOrde
|
|
|
private ApsReportThProcessTableService apsReportThProcessTableService;
|
|
|
@Autowired
|
|
|
private ApsReportThProcessPhotoService apsReportThProcessPhotoService;
|
|
|
+ @Autowired
|
|
|
+ private ApsReportOutputServiceImpl apsReportOutputService;
|
|
|
|
|
|
|
|
|
public static final String ERROR_MSG = "%s上诉订单的排程交货期大于承诺交货期";
|
|
@@ -663,8 +663,10 @@ public class ApsProductionOrderServiceImpl extends ServiceImpl<ApsProductionOrde
|
|
|
if (apsProductionOrderDos.isEmpty()) {
|
|
|
return;
|
|
|
}
|
|
|
+ //缺陷字典
|
|
|
+ List<SysDictDo> defectTypes = apsReportOutputService.getQualityDefectsDictsByType();
|
|
|
//所有的坯料计划id
|
|
|
- List<String> blankIds = apsProductionOrderDos.stream().map(ApsProductionOrderDo::getAuditorid).distinct().collect(Collectors.toList());
|
|
|
+ List<String> blankIds = apsProductionOrderDos.stream().map(ApsProductionOrderDo::getCustomid).distinct().collect(Collectors.toList());
|
|
|
//坯料输出成品
|
|
|
List<ApsProcessOutputProductDo> apsProcessOutputProductDos = apsProcessOutputProductService.list(new LambdaQueryWrapper<ApsProcessOutputProductDo>()
|
|
|
.in(ApsProcessOutputProductDo::getBlankid, blankIds)
|
|
@@ -682,7 +684,7 @@ public class ApsProductionOrderServiceImpl extends ServiceImpl<ApsProductionOrde
|
|
|
content[0] = "<div>报工检验不合格,请及时调整计划</div>" +
|
|
|
"<div>客户【" + olist.get(0).getCustomname() + "】【" + DateUtil.format(olist.get(0).getOrderdate(), DATE_PATTERN_YMD) + "】的订单【" + olist.get(0).getOrderno() + "】</div>";
|
|
|
//按照坯料计划分组
|
|
|
- Map<String, List<ApsProductionOrderDo>> blankList = olist.stream().collect(Collectors.groupingBy(o -> o.getAuditorid()));
|
|
|
+ Map<String, List<ApsProductionOrderDo>> blankList = olist.stream().collect(Collectors.groupingBy(o -> o.getCustomid()));
|
|
|
blankList.forEach((b, blist) -> {
|
|
|
List<ApsProcessOutputProductDo> apsProcessOutputProductDoList = apsProcessOutputProductDos.stream().filter(out -> out.getBlankid().equals(b)).collect(Collectors.toList());
|
|
|
for (ApsProcessOutputProductDo apsProcessOutputProductDo : apsProcessOutputProductDoList) {
|
|
@@ -691,9 +693,9 @@ public class ApsProductionOrderServiceImpl extends ServiceImpl<ApsProductionOrde
|
|
|
});
|
|
|
|
|
|
for (ApsProductionOrderDo apsProductionOrderDo : olist) {
|
|
|
- content[0] += "<div>批次号【" + apsProductionOrderDo.getAuditor() + "】工序【" + apsProductionOrderDo.getCustomorderno() + "】检验等级【" + apsProductionOrderDo.getCustomordertype() + "】</div>";
|
|
|
- content[0] += "<div>主要缺陷【" + (apsProductionOrderDo.getRemark() == null ? "" : apsProductionOrderDo.getRemark()) + "】</div>";
|
|
|
- content[0] += "<div>次要缺陷【" + (apsProductionOrderDo.getOtherprecaution() == null ? "" : apsProductionOrderDo.getOtherprecaution()) + "】</div>";
|
|
|
+ content[0] += "<div>批次号【" + apsProductionOrderDo.getCustomwarehouse() + "】工序【" + apsProductionOrderDo.getCustomorderno() + "】检验等级【" + apsProductionOrderDo.getCustomordertype() + "】</div>";
|
|
|
+ content[0] += "<div>主要缺陷【" + handleDefect(apsProductionOrderDo.getRemark(), defectTypes) + "】</div>";
|
|
|
+ content[0] += "<div>次要缺陷【" + handleDefect(apsProductionOrderDo.getRoption(), defectTypes) + "】</div>";
|
|
|
}
|
|
|
|
|
|
//邮件提醒
|
|
@@ -709,6 +711,33 @@ public class ApsProductionOrderServiceImpl extends ServiceImpl<ApsProductionOrde
|
|
|
});
|
|
|
}
|
|
|
|
|
|
+ /**
|
|
|
+ * 处理主要缺陷/次要缺陷字典值显示为逗号分隔的文本
|
|
|
+ *
|
|
|
+ * @param defect
|
|
|
+ * @return
|
|
|
+ */
|
|
|
+ private String handleDefect(String defect, List<SysDictDo> dictDos) {
|
|
|
+ String result = "";
|
|
|
+ if (org.apache.commons.lang.StringUtils.isNotBlank(defect)) {
|
|
|
+ List<String> dictNameList = new ArrayList<>();
|
|
|
+ String[] valuesToLookup = defect.split(",");
|
|
|
+ for (SysDictDo sysDictDo : dictDos) {
|
|
|
+ for (String value : valuesToLookup) {
|
|
|
+ if (sysDictDo.getId().equals(value.trim())) {
|
|
|
+ dictNameList.add(sysDictDo.getName());
|
|
|
+ // 一旦找到匹配的值,就不需要再检查该字典项的其他值了
|
|
|
+ break;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ if (!dictNameList.isEmpty()) {
|
|
|
+ result = String.join(",", dictNameList);
|
|
|
+ }
|
|
|
+ }
|
|
|
+ return result;
|
|
|
+ }
|
|
|
+
|
|
|
/*
|
|
|
根据保存前数据的 id 获取撤回前版本所有主子表信息
|
|
|
*/
|