Merge remote-tracking branch 'origin/master'

master
夜笙歌 4 weeks ago
commit 9fcec467b9

@ -54,4 +54,6 @@ public class SystemConstants {
public static final Long PROCESS_ACTIVITY_ID_STOCK_NOTENOUGH = 5011L;//物料库存告警
public static final Long PROCESS_ACTIVITY_ID_PRODUCE_PAUSE = 7011L;//车间暂停通知
public static final Long PROCESS_ACTIVITY_ID_RECEIVE_BILL = 8011L;//收料通知单通知
}

@ -88,7 +88,7 @@ public enum BusinessType
ALLOCATE,
/**
*
* (16)
*/
UNALLOCATE,
@ -110,7 +110,7 @@ public enum BusinessType
/**
*
* (20)
*/
OUTSTOCK,
@ -135,7 +135,7 @@ public enum BusinessType
PRINT,
/**
*
* (25)
*/
REGENERATE,
@ -160,7 +160,7 @@ public enum BusinessType
RECALL,
/**
*
* (30)
*/
PAUSE,

@ -37,6 +37,8 @@ public class SysFileController
SysFile sysFile = new SysFile();
sysFile.setName(FileUtils.getName(url));
sysFile.setUrl(url);
log.info("url:"+url);
log.info("name:"+sysFile.getName());
return R.ok(sysFile);
}
catch (Exception e)

@ -144,8 +144,8 @@ public class KingdeeErpSyncController {
* ERPMES
*/
@PostMapping("/syncPurchaseReceiveBillFromErp")
@Log(title = "ERP采购收料单", businessType = BusinessType.INSERT)
@InnerAuth
// @Log(title = "ERP采购收料单", businessType = BusinessType.INSERT)
// @InnerAuth
public AjaxResult syncPurchaseReceiveBillFromErp(@RequestBody ErpSyncInfoVo erpSyncInfoVo) {
try {
return AjaxResult.success(kingdeeErpSyncService.syncPurchaseReceiveBillFromErp(0, erpSyncInfoVo));

@ -87,6 +87,8 @@ public class MesPurchaseReceiveBill extends BaseEntity
@Excel(name = "京源项目;F_TOND_Base")
private String tondBase;
private Date preDeliveryDate;
/** 单价;FPRICE */
@Excel(name = "单价;FPRICE")
private BigDecimal price;
@ -251,7 +253,16 @@ public class MesPurchaseReceiveBill extends BaseEntity
{
return tondBase;
}
public void setPrice(BigDecimal price)
public Date getPreDeliveryDate() {
return preDeliveryDate;
}
public void setPreDeliveryDate(Date preDeliveryDate) {
this.preDeliveryDate = preDeliveryDate;
}
public void setPrice(BigDecimal price)
{
this.price = price;
}

@ -4,8 +4,11 @@ package com.hw.jindie.service.impl;
import com.alibaba.fastjson2.JSONArray;
import com.alibaba.fastjson2.JSONObject;
import com.alibaba.nacos.shaded.com.google.gson.Gson;
import com.hw.common.core.constant.SecurityConstants;
import com.hw.common.core.utils.StringUtils;
import com.hw.jindie.config.KingdeeConfig;
import com.hw.system.api.RemoteLogService;
import com.hw.system.api.domain.SysOperLog;
import com.kingdee.bos.webapi.entity.RepoRet;
import com.kingdee.bos.webapi.entity.RepoStatus;
import com.kingdee.bos.webapi.sdk.K3CloudApi;
@ -13,8 +16,11 @@ import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.stereotype.Service;
import javax.annotation.Resource;
import java.math.BigDecimal;
import java.util.ArrayList;
import java.util.Date;
import java.util.List;
/**
@ -24,6 +30,8 @@ import java.util.ArrayList;
*/
@Service
public class KingdeeErpService {
@Resource
private RemoteLogService remoteLogService;
private static final Logger logger = LoggerFactory.getLogger(KingdeeErpService.class);
@ -115,6 +123,8 @@ public class KingdeeErpService {
RepoRet repoRet = gson.fromJson(resultJson, RepoRet.class);
logger.info("singleSavePurchaseRequisition接口调用成功|请求参数:" + saveParams + "|返回结果:" + resultJson);
RepoStatus responseStatus = repoRet.getResult().getResponseStatus();
List<SysOperLog> sysOperLogList = new ArrayList<>();
Date currentDate = new Date();
if (responseStatus.isIsSuccess()) {
JSONObject json = new JSONObject();
json.put("formId", KingdeeConfig.PUR_Requisition);
@ -125,12 +135,28 @@ public class KingdeeErpService {
if (!commitRepoRet.getResult().getResponseStatus().isIsSuccess()) {
logger.error("singleSavePurchaseRequisitionCommitException|请求参数:" + json.toJSONString() + "|返回结果:" + commitRepoRet);
}
SysOperLog sysOperLogCommit = this.getSysOperLog("原材料入库申请单提交", 1, "com.hw.jindie.controller.KingdeeErpSyncController.syncPurchaseReceiveBillFromErp",
"POST", "syncPurchaseReceiveBillFromErp", "PUR_ReceiveBill(" + json.toString() + ")", commitRepoRet.toString(), currentDate, 1L);
sysOperLogList.add(sysOperLogCommit);
//采购申请单审核
String auditResult = this.genericAuditInterface(json);
RepoRet auditRepoRet = gson.fromJson(auditResult, RepoRet.class);
if (!auditRepoRet.getResult().getResponseStatus().isIsSuccess()) {
logger.error("singleSavePurchaseRequisitionAuditException|请求参数:" + json.toJSONString() + "|返回结果:" + commitRepoRet);
logger.error("singleSavePurchaseRequisitionAuditException|请求参数:" + json.toJSONString() + "|返回结果:" + auditRepoRet);
}
SysOperLog sysOperLogAudit = this.getSysOperLog("原材料入库申请单审核", 1, "com.hw.jindie.controller.KingdeeErpSyncController.syncPurchaseReceiveBillFromErp",
"POST", "syncPurchaseReceiveBillFromErp", "PUR_ReceiveBill(" + json.toString() + ")", commitRepoRet.toString(), currentDate, 1L);
sysOperLogList.add(sysOperLogAudit);
if (!sysOperLogList.isEmpty()) {
for (SysOperLog sysOperLog : sysOperLogList) {
remoteLogService.saveLog(sysOperLog, SecurityConstants.INNER);
}
}
}
return gson.toJson(responseStatus);
} catch (Exception e) {
@ -265,27 +291,51 @@ public class KingdeeErpService {
String saveParams = data.toJSONString();
String resultJson = client.save(formId, saveParams);
List<SysOperLog> sysOperLogList = new ArrayList<>();
Date currentDate = new Date();
//用于记录结果
Gson gson = new Gson();
//对返回结果进行解析和校验
RepoRet repoRet = gson.fromJson(resultJson, RepoRet.class);
logger.info("savePurchaseStorage接口调用成功|请求参数:" + saveParams + "|返回结果:" + resultJson);
RepoStatus responseStatus = repoRet.getResult().getResponseStatus();
if (responseStatus.isIsSuccess()) {
Long beginTimeL = System.currentTimeMillis();
JSONObject json = new JSONObject();
json.put("formId", KingdeeConfig.STK_InStock);
json.put("Ids", repoRet.getResult().getId());
//采购入库单提交
String commitResult = this.genericCommitInterface(json);
RepoRet commitRepoRet = gson.fromJson(commitResult, RepoRet.class);
String commitResultStr = "成功";
if (!commitRepoRet.getResult().getResponseStatus().isIsSuccess()) {
commitResultStr = "失败";
logger.error("savePurchaseStorage|请求参数:" + json.toJSONString() + "|返回结果:" + commitRepoRet);
}
SysOperLog sysOperLogCommit = this.getSysOperLog("原材料入库申请单提交", 1, "com.hw.jindie.controller.KingdeeErpSyncController.savePurchaseStorage",
"POST", "syncPurchaseReceiveBillFromErp", formId+"(" + json.toString() + ")", commitResultStr, currentDate, System.currentTimeMillis()-beginTimeL);
sysOperLogList.add(sysOperLogCommit);
beginTimeL = System.currentTimeMillis();
//采购入库单审核
String auditResult = this.genericAuditInterface(json);
RepoRet auditRepoRet = gson.fromJson(auditResult, RepoRet.class);
String auditResultStr = "成功";
if (!auditRepoRet.getResult().getResponseStatus().isIsSuccess()) {
logger.error("savePurchaseStorage|请求参数:" + json.toJSONString() + "|返回结果:" + commitRepoRet);
auditResultStr = "失败";
logger.error("savePurchaseStorage|请求参数:" + json.toJSONString() + "|返回结果:" + auditRepoRet);
}
SysOperLog sysOperLogAudit = this.getSysOperLog("原材料入库申请单审核", 1, "com.hw.jindie.controller.KingdeeErpSyncController.savePurchaseStorage",
"POST", "syncPurchaseReceiveBillFromErp", formId+"(" + json.toString() + ")", auditResultStr, currentDate, System.currentTimeMillis()-beginTimeL);
sysOperLogList.add(sysOperLogAudit);
if (!sysOperLogList.isEmpty()) {
for (SysOperLog sysOperLog : sysOperLogList) {
remoteLogService.saveLog(sysOperLog, SecurityConstants.INNER);
}
}
}
return gson.toJson(responseStatus);
@ -459,6 +509,9 @@ public class KingdeeErpService {
String saveParams = data.toJSONString();
String resultJson = client.save(formId, saveParams);
List<SysOperLog> sysOperLogList = new ArrayList<>();
Date currentDate = new Date();
//用于记录结果
Gson gson = new Gson();
//对返回结果进行解析和校验
@ -466,21 +519,44 @@ public class KingdeeErpService {
logger.info("saveOtherOutStorage接口调用成功|请求参数:" + saveParams + "|返回结果:" + resultJson);
RepoStatus responseStatus = repoRet.getResult().getResponseStatus();
if (responseStatus.isIsSuccess()) {
Long beginTimeL = System.currentTimeMillis();
JSONObject json = new JSONObject();
json.put("formId", KingdeeConfig.STK_MisDelivery);
json.put("Ids", repoRet.getResult().getId());
//其他出库单提交
String commitResult = this.genericCommitInterface(json);
RepoRet commitRepoRet = gson.fromJson(commitResult, RepoRet.class);
String commitResultStr = "成功";
if (!commitRepoRet.getResult().getResponseStatus().isIsSuccess()) {
commitResultStr = "失败";
logger.error("saveOtherOutStorage|请求参数:" + json.toJSONString() + "|返回结果:" + commitRepoRet);
}
SysOperLog sysOperLogCommit = this.getSysOperLog("其他出库单提交", 1, "com.hw.jindie.controller.KingdeeErpSyncController.saveOtherOutStorage",
"POST", "saveOtherOutStorage", formId+"(" + json.toString() + ")", commitResultStr, currentDate, System.currentTimeMillis()-beginTimeL);
sysOperLogList.add(sysOperLogCommit);
beginTimeL = System.currentTimeMillis();
//其他出库单审核
String auditResult = this.genericAuditInterface(json);
RepoRet auditRepoRet = gson.fromJson(auditResult, RepoRet.class);
String auditResultStr = "成功";
if (!auditRepoRet.getResult().getResponseStatus().isIsSuccess()) {
auditResultStr = "失败";
logger.error("saveOtherOutStorage|请求参数:" + json.toJSONString() + "|返回结果:" + commitRepoRet);
}
SysOperLog sysOperLogAudit = this.getSysOperLog("其他出库单审核", 1, "com.hw.jindie.controller.KingdeeErpSyncController.saveOtherOutStorage",
"POST", "saveOtherOutStorage", formId+"(" + json.toString() + ")", auditResultStr, currentDate, System.currentTimeMillis()-beginTimeL);
sysOperLogList.add(sysOperLogAudit);
if (!sysOperLogList.isEmpty()) {
for (SysOperLog sysOperLog : sysOperLogList) {
remoteLogService.saveLog(sysOperLog, SecurityConstants.INNER);
}
}
}
return gson.toJson(responseStatus);
} catch (Exception e) {
@ -552,6 +628,9 @@ public class KingdeeErpService {
String saveParams = data.toJSONString();
String resultJson = client.save(formId, saveParams);
List<SysOperLog> sysOperLogList = new ArrayList<>();
Date currentDate = new Date();
//用于记录结果
Gson gson = new Gson();
//对返回结果进行解析和校验
@ -559,21 +638,43 @@ public class KingdeeErpService {
logger.info("saveOtherInStorage接口调用成功|请求参数:" + saveParams + "|返回结果:" + resultJson);
RepoStatus responseStatus = repoRet.getResult().getResponseStatus();
if (responseStatus.isIsSuccess()) {
Long beginTimeL = System.currentTimeMillis();
JSONObject json = new JSONObject();
json.put("formId", KingdeeConfig.STK_MISCELLANEOUS);
json.put("Ids", repoRet.getResult().getId());
//其他入库单提交
String commitResult = this.genericCommitInterface(json);
RepoRet commitRepoRet = gson.fromJson(commitResult, RepoRet.class);
String commitResultStr = "成功";
if (!commitRepoRet.getResult().getResponseStatus().isIsSuccess()){
commitResultStr = "失败";
logger.error("saveOtherInStorage|请求参数:" + json.toJSONString() + "|返回结果:" + commitRepoRet);
}
SysOperLog sysOperLogCommit = this.getSysOperLog("其他入库单提交", 1, "com.hw.jindie.controller.KingdeeErpSyncController.saveOtherInStorage",
"POST", "saveOtherInStorage", formId+"(" + json.toString() + ")", commitResultStr, currentDate, System.currentTimeMillis()-beginTimeL);
sysOperLogList.add(sysOperLogCommit);
beginTimeL = System.currentTimeMillis();
//其他入库单审核
String auditResult = this.genericAuditInterface(json);
RepoRet auditRepoRet = gson.fromJson(auditResult, RepoRet.class);
String auditResultStr = "成功";
if (!auditRepoRet.getResult().getResponseStatus().isIsSuccess()){
auditResultStr = "失败";
logger.error("saveOtherInStorage|请求参数:" + json.toJSONString() + "|返回结果:" + commitRepoRet);
}
SysOperLog sysOperLogAudit = this.getSysOperLog("其他入库单审核", 1, "com.hw.jindie.controller.KingdeeErpSyncController.saveOtherInStorage",
"POST", "saveOtherInStorage", formId+"(" + json.toString() + ")", auditResultStr, currentDate, System.currentTimeMillis()-beginTimeL);
sysOperLogList.add(sysOperLogAudit);
if (!sysOperLogList.isEmpty()) {
for (SysOperLog sysOperLog : sysOperLogList) {
remoteLogService.saveLog(sysOperLog, SecurityConstants.INNER);
}
}
}
return gson.toJson(responseStatus);
} catch (Exception e) {
@ -583,4 +684,24 @@ public class KingdeeErpService {
}
private SysOperLog getSysOperLog(String logTitle, Integer businessType, String method, String requestMethod, String operUrl,
String operParam, String jsonResult, Date operTime, Long costTime) throws Exception {
SysOperLog sysOperLog = new SysOperLog();
sysOperLog.setTitle(logTitle);
sysOperLog.setBusinessType(businessType);
sysOperLog.setMethod(method);
sysOperLog.setRequestMethod(requestMethod);
sysOperLog.setOperatorType(0);
sysOperLog.setOperIp("127.0.0.1");
sysOperLog.setOperName("定时任务");
sysOperLog.setOperUrl(operUrl);
sysOperLog.setOperParam(operParam);
sysOperLog.setJsonResult(jsonResult);
sysOperLog.setStatus(0);
sysOperLog.setOperTime(operTime);
sysOperLog.setCostTime(costTime);
return sysOperLog;
}
}

@ -1219,7 +1219,7 @@ public class KingdeeErpSyncServiceImpl implements IKingdeeErpSyncService {
// String FDocumentStatus = "C";
JSONObject queryJson = new JSONObject();
String formId = "PUR_ReceiveBill";
String fieldKeys = "FID,FBillNo,FDocumentStatus,FSupplierId,FModifyDate,FCreateDate,FStockOrgId,FActlandQty,FActReceiveQty,FDetailEntity_FEntryID,FDetailEntity_Link_FSBillId,FDetailEntity_Link_FSId,FOrderBillNo,FMaterialId,FMaterialId.FNumber,FMaterialId.Fname";
String fieldKeys = "FID,FBillNo,FDocumentStatus,FSupplierId,FModifyDate,FCreateDate,FStockOrgId,FActlandQty,FActReceiveQty,FDetailEntity_FEntryID,FDetailEntity_Link_FSBillId,FDetailEntity_Link_FSId,FPreDeliveryDate,FOrderBillNo,FMaterialId,FMaterialId.FNumber,FMaterialId.Fname,FMateriaModel,F_TOND_Base";
// String filterString = "";
String orderString = "";
int topRowCount = 0;
@ -1265,6 +1265,8 @@ public class KingdeeErpSyncServiceImpl implements IKingdeeErpSyncService {
List<SysOperLog> sysOperLogList = new ArrayList<>();
Date currentDate = new Date();
StringBuilder notifyInfoBuilder = new StringBuilder("收料通知:");
Long projectErpId = null;
String projectName = "";
try {
for (int i = 0; i < resultArray.size(); i++) {
Long beginTimeL = System.currentTimeMillis();
@ -1296,8 +1298,7 @@ public class KingdeeErpSyncServiceImpl implements IKingdeeErpSyncService {
String fsId = resultObject.getString("FDetailEntity.Link.FSId");
Long fStockOrgId = resultObject.getLong("FStockOrgId");
//京源项目
// String tondBase = resultObject.getString("F.TOND.Base");
//供应商id
Long supplierId = resultObject.getLong("FSupplierId");
@ -1313,6 +1314,11 @@ public class KingdeeErpSyncServiceImpl implements IKingdeeErpSyncService {
//更新时间
String FModifyDate = resultObject.getString("FModifyDate");
String tondBase = resultObject.getString("F.TOND.Base");
String materialSpec = resultObject.getString("FMateriaModel");
//计划交货日期
String preDeliveryDate = resultObject.getString("FPreDeliveryDate");
mesPurchaseReceiveBill.setErpId(erpId);
mesPurchaseReceiveBill.setBillNo(billNo);
mesPurchaseReceiveBill.setPoNo(poNo);
@ -1326,10 +1332,13 @@ public class KingdeeErpSyncServiceImpl implements IKingdeeErpSyncService {
mesPurchaseReceiveBill.setPurchaseOrgId(fStockOrgId);
mesPurchaseReceiveBill.setActReceiveAmount(actReceiveAmount);
mesPurchaseReceiveBill.setActLandAmount(actlandAmount);
// mesPurchaseReceiveBill.setTondBase(tondBase);
mesPurchaseReceiveBill.setTondBase(tondBase);
mesPurchaseReceiveBill.setSupplierId(supplierId);
mesPurchaseReceiveBill.setUpdateTime(currentDate);
if (preDeliveryDate != null) {
mesPurchaseReceiveBill.setPreDeliveryDate(conversionERPTime(preDeliveryDate));
}
if (approveDate != null) {
mesPurchaseReceiveBill.setApproveDate(conversionERPTime(approveDate));
@ -1349,12 +1358,33 @@ public class KingdeeErpSyncServiceImpl implements IKingdeeErpSyncService {
MesPurchaseReceiveBill existedPurchaseReceiveBill = mesPurchaseReceiveBillMapper.selectMesPurchaseReceiveBillByUI(erpId, fentryId);
if (StringUtils.isNotEmpty(tondBase)) {
Long tondBaseL = Long.valueOf(tondBase);
if (StringUtils.isEmpty(projectName)) {
projectErpId = tondBaseL;
MesProjectInfo mesProjectInfo = mesProjectInfoMapper.selectMesProjectInfoByErpId(tondBaseL);
projectName = mesProjectInfo == null ? "" : mesProjectInfo.getProjectName();
}else{
if(!tondBaseL.equals(projectErpId)){
projectErpId = tondBaseL;
MesProjectInfo mesProjectInfo = mesProjectInfoMapper.selectMesProjectInfoByErpId(tondBaseL);
projectName = mesProjectInfo == null ? "" : mesProjectInfo.getProjectName();
}
}
}
if (existedPurchaseReceiveBill != null) {
mesPurchaseReceiveBill.setReceiveBillId(existedPurchaseReceiveBill.getReceiveBillId());
toUpdatePurchaseReceiveBillList.add(mesPurchaseReceiveBill);
} else {
toInsertPurchaseReceiveBillList.add(mesPurchaseReceiveBill);
notifyInfoBuilder.append(materialName).append(";");
notifyInfoBuilder.append("物料名称:").append(materialName).append("|物料规格:").append(materialSpec)
.append("|实到数量:").append(actlandAmount).append("|预计到货日期:")
.append(preDeliveryDate).append("|项目名称:").append(projectName)
.append(";");
}
// System.out.println("l:"+resultArray.get(i).toString().length());
@ -1413,7 +1443,7 @@ public class KingdeeErpSyncServiceImpl implements IKingdeeErpSyncService {
sysPointRouter.setProcessActivityId(SystemConstants.PROCESS_ACTIVITY_ID_STOCK_NOTENOUGH);
sysPointRouter.setCreateBy("定时任务");
sysPointRouter.setCreateTime(new Date());
sysPointRouter.setProcessActivityId(7011L);
sysPointRouter.setProcessActivityId(SystemConstants.PROCESS_ACTIVITY_ID_RECEIVE_BILL);
sysPointRouter.setEmailFlag("1");
sysPointRouter.setSentEmailFlag("0");

@ -22,6 +22,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<result property="erpModifyDate" column="erp_modify_date" />
<result property="purchaseOrgId" column="purchase_org_id" />
<result property="tondBase" column="tond_base" />
<result property="preDeliveryDate" column="pre_delivery_date" />
<result property="price" column="price" />
<result property="supplierId" column="supplier_id" />
<result property="remark" column="remark" />
@ -83,6 +84,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<if test="erpModifyDate != null">erp_modify_date,</if>
<if test="purchaseOrgId != null">purchase_org_id,</if>
<if test="tondBase != null">tond_base,</if>
<if test="preDeliveryDate != null">pre_delivery_date,</if>
<if test="price != null">price,</if>
<if test="supplierId != null">supplier_id,</if>
<if test="remark != null">remark,</if>
@ -108,6 +110,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<if test="erpModifyDate != null">#{erpModifyDate},</if>
<if test="purchaseOrgId != null">#{purchaseOrgId},</if>
<if test="tondBase != null">#{tondBase},</if>
<if test="preDeliveryDate != null">#{preDeliveryDate},</if>
<if test="price != null">#{price},</if>
<if test="supplierId != null">#{supplierId},</if>
<if test="remark != null">#{remark},</if>
@ -137,6 +140,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<if test="erpModifyDate != null">erp_modify_date = #{erpModifyDate},</if>
<if test="purchaseOrgId != null">purchase_org_id = #{purchaseOrgId},</if>
<if test="tondBase != null">tond_base = #{tondBase},</if>
<if test="preDeliveryDate != null">pre_delivery_date = #{preDeliveryDate},</if>
<if test="price != null">price = #{price},</if>
<if test="supplierId != null">supplier_id = #{supplierId},</if>
<if test="remark != null">remark = #{remark},</if>

@ -323,4 +323,40 @@ public class MesProductPlanController extends BaseController {
return R.fail(e.getMessage());
}
}
/**
* List
* @param attachType
* @param dispatchCode
* @param processId
* @param userId
* @return
*/
@GetMapping(value = "/attachInfoList/{attachType}/{dispatchCode}/{processId}/{userId}")
public AjaxResult getAttachInfoList(@PathVariable("attachType") String attachType, @PathVariable("dispatchCode") String dispatchCode,
@PathVariable("processId") Long processId, @PathVariable("userId") Long userId) {
return success(mesProductPlanService.getAttachInfoList(dispatchCode, processId, userId, attachType));
}
/**
*
* @param attachType
* @param attachId
* @return
*/
@GetMapping(value = "/checkMesProductPlanAttachInfo/{attachType}/{attachId}")
public AjaxResult checkMesProductPlanAttachInfo(@PathVariable("attachType") String attachType, @PathVariable("attachId") String attachId) {
return success(mesProductPlanService.checkMesProductPlanAttachInfo(attachType, attachId));
}
/**
* planIdSOPList
* @param attachType
* @param planId
* @return
*/
@GetMapping(value = "/getDispatchAttachByPlanIdList/{attachType}/{planId}")
public AjaxResult getDispatchAttachByPlanIdList(@PathVariable("attachType") String attachType, @PathVariable("planId") Long planId) {
return success(mesProductPlanService.getDispatchAttachByPlanIdList(attachType, planId));
}
}

@ -5,14 +5,12 @@ import java.util.List;
import java.util.Map;
import com.hw.mes.domain.MesBaseAttachInfo;
import com.hw.mes.domain.MesMaterialBom;
import com.hw.mes.domain.MesProductOrder;
import com.hw.mes.domain.MesProductPlan;
import com.hw.mes.domain.vo.MesAssignTaskVo;
import com.hw.mes.domain.vo.MesMaterialScanVo;
import com.hw.mes.domain.vo.MesProductPlanDeleteVo;
import com.hw.mes.domain.vo.MesProductPlanEditVo;
import org.springframework.transaction.annotation.Transactional;
/**
* Service
@ -187,4 +185,29 @@ public interface IMesProductPlanService
*/
public List<MesProductPlan> selectMesProductPlanJoinUserList(MesProductPlan mesProductPlan);
/**
* List
* @param attachType
* @param dispatchCode
* @param processId
* @param userId
* @return
*/
public List<MesBaseAttachInfo> getAttachInfoList(String dispatchCode, Long processId, Long userId, String attachType);
/**
*
* @param attachType
* @param attachId
* @return
*/
String checkMesProductPlanAttachInfo(String attachType, String attachId);
/**
* planIdSOPList
* @param attachType
* @param planId
* @return
*/
public List<MesBaseAttachInfo> getDispatchAttachByPlanIdList(String attachType, Long planId);
}

@ -7,6 +7,7 @@ import java.util.stream.Collectors;
import java.util.stream.Stream;
import com.hw.common.core.constant.CacheConstants;
import com.hw.common.core.constant.MesConstants;
import com.hw.common.core.constant.SecurityConstants;
import com.hw.common.core.domain.R;
import com.hw.common.core.exception.ServiceException;
@ -15,6 +16,7 @@ import com.hw.common.core.utils.MailUtils;
import com.hw.common.core.utils.StringUtils;
import com.hw.common.redis.service.RedisService;
import com.hw.mes.domain.MesBaseAttachInfo;
import com.hw.mes.mapper.MesProductPlanMapper;
import com.hw.mes.service.IMesBaseAttachInfoService;
import com.hw.system.api.RemoteUserService;
import com.hw.system.api.domain.SysUser;
@ -46,6 +48,9 @@ public class MesMaterialBomServiceImpl implements IMesMaterialBomService {
@Autowired
private RedisService redisService;
@Autowired
private MesProductPlanMapper mesProductPlanMapper;
/**
* BOM
*
@ -290,23 +295,26 @@ public class MesMaterialBomServiceImpl implements IMesMaterialBomService {
public List<MesBaseAttachInfo> getBomAttachInfo(String attachType, Long[] materialBomIds) {
List<Long> attachIdList = new ArrayList<>();
for (Long materialBomId : materialBomIds) {
if (attachType.equals("1")){
MesMaterialBom materialBom = mesMaterialBomMapper.selectMesMaterialBomByMaterialBomId(materialBomId);
if (StringUtils.isNotEmpty(materialBom.getAttachId())){
String[] split = materialBom.getAttachId().split(",");
List<Long> longList = Arrays.stream(split)
.map(Long::valueOf) // 转换每个字符串为 Long
.collect(Collectors.toList());
attachIdList.addAll(longList);
}
} else {
MesMaterialBom materialBom = mesMaterialBomMapper.selectMesMaterialBomByMaterialBomId(materialBomId);
if (StringUtils.isNotEmpty(materialBom.getSopId())){
String[] split = materialBom.getSopId().split(",");
List<Long> longList = Arrays.stream(split)
.map(Long::valueOf) // 转换每个字符串为 Long
.collect(Collectors.toList());
attachIdList.addAll(longList);
MesMaterialBom mesMaterialBom = new MesMaterialBom();
mesMaterialBom.setAncestors(materialBomId.toString());
List<MesMaterialBom> materialBomList = mesMaterialBomMapper.selectMesMaterialBomList(mesMaterialBom);
for (MesMaterialBom materialBom : materialBomList) {
if (attachType.equals(MesConstants.MES_ATTACH_TYPE_DRAWING)){
if (StringUtils.isNotEmpty(materialBom.getAttachId())){
String[] split = materialBom.getAttachId().split(",");
List<Long> longList = Arrays.stream(split)
.map(Long::valueOf) // 转换每个字符串为 Long
.collect(Collectors.toList());
attachIdList.addAll(longList);
}
} else {
if (StringUtils.isNotEmpty(materialBom.getSopId())){
String[] split = materialBom.getSopId().split(",");
List<Long> longList = Arrays.stream(split)
.map(Long::valueOf) // 转换每个字符串为 Long
.collect(Collectors.toList());
attachIdList.addAll(longList);
}
}
}
}

@ -9,12 +9,10 @@ import com.hw.common.core.constant.MesConstants;
import com.hw.common.core.exception.ServiceException;
import com.hw.common.core.utils.DateUtils;
import com.hw.common.core.utils.SocketUtils;
import com.hw.common.core.utils.ip.IpUtils;
import com.hw.common.core.utils.uuid.Seq;
import com.hw.common.security.utils.SecurityUtils;
import com.hw.mes.api.domain.MesBaseBarcodeInfo;
import com.hw.mes.api.domain.MesBaseStationInfo;
import com.hw.mes.config.MesConfig;
import com.hw.mes.domain.*;
import com.hw.mes.domain.vo.MesAssignTaskVo;
@ -25,7 +23,6 @@ import com.hw.mes.mapper.*;
import com.hw.mes.service.IMesBaseAttachInfoService;
import com.hw.mes.service.IMesProductOrderService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.data.redis.core.StringRedisTemplate;
import org.springframework.stereotype.Service;
import com.hw.common.core.utils.StringUtils;
@ -776,6 +773,123 @@ public class MesProductPlanServiceImpl implements IMesProductPlanService {
return mesProductPlanMapper.selectMesProductPlanJoinUserList(mesProductPlan);
}
/**
* List
* @param attachType
* @param dispatchCode
* @param processId
* @param userId
* @return
*/
@Override
public List<MesBaseAttachInfo> getAttachInfoList(String dispatchCode, Long processId, Long userId, String attachType) {
MesProductPlan queryProductPlan = new MesProductPlan();
queryProductPlan.setProcessId(processId);
queryProductPlan.setDispatchCode(dispatchCode);
queryProductPlan.setUserId(userId);
List<MesProductPlan> mesProductPlans = mesProductPlanMapper.selectOnlyMesProductPlans(queryProductPlan);
if (mesProductPlans != null && !mesProductPlans.isEmpty()) {
MesProductPlan mesProductPlan = mesProductPlans.get(0);
try {
if (attachType.equals(MesConstants.MES_ATTACH_TYPE_DRAWING)) {
if (StringUtils.isEmpty(mesProductPlan.getAttachId())) {
return new ArrayList<>();
}
Long[] attachIds = Arrays.stream(mesProductPlan.getAttachId().split(","))
.map(String::trim)
.map(Long::parseLong)
.toArray(Long[]::new);
return mesBaseAttachInfoService.selectMesBaseAttachInfoByAttachIds(attachIds);
} else if (attachType.equals(MesConstants.MES_ATTACH_TYPE_SOP)) {
if (StringUtils.isEmpty(mesProductPlan.getSopId())) {
return new ArrayList<>();
}
Long[] sopIds = Arrays.stream(mesProductPlan.getSopId().split(","))
.map(String::trim)
.map(Long::parseLong)
.toArray(Long[]::new);
return mesBaseAttachInfoService.selectMesBaseAttachInfoByAttachIds(sopIds);
} else {
return new ArrayList<>();
}
} catch (Exception e) {
return new ArrayList<>();
}
}
return new ArrayList<>();
}
/**
*
* @param attachType
* @param attachId
* @return
*/
@Override
public String checkMesProductPlanAttachInfo(String attachType, String attachId) {
String result = null;
StringBuilder buffer = new StringBuilder();
buffer.append("生产派工已绑定此");
List<MesProductPlan> productPlanList = new ArrayList<>();
MesProductPlan mesProductPlan = new MesProductPlan();
if (attachType.equals(MesConstants.MES_ATTACH_TYPE_DRAWING)) {
mesProductPlan.setAttachId(attachId);
productPlanList = mesProductPlanMapper.selectMesProductPlanList(mesProductPlan);
buffer.append("图纸!");
} else if (attachType.equals(MesConstants.MES_ATTACH_TYPE_SOP)){
mesProductPlan.setSopId(attachId);
productPlanList = mesProductPlanMapper.selectMesProductPlanList(mesProductPlan);
buffer.append("SOP");
}
if (productPlanList.size() > 0){
result = buffer.toString();
}
//未绑定
return result;
}
/**
* planIdSOPList
* @param attachType
* @param planId
* @return
*/
@Override
public List<MesBaseAttachInfo> getDispatchAttachByPlanIdList(String attachType, Long planId) {
MesProductPlan queryProductPlan = new MesProductPlan();
queryProductPlan.setPlanId(planId);
List<MesProductPlan> mesProductPlans = mesProductPlanMapper.selectOnlyMesProductPlans(queryProductPlan);
if (mesProductPlans != null && !mesProductPlans.isEmpty()) {
MesProductPlan mesProductPlan = mesProductPlans.get(0);
try {
if (attachType.equals(MesConstants.MES_ATTACH_TYPE_DRAWING)) {
if (StringUtils.isEmpty(mesProductPlan.getAttachId())) {
return new ArrayList<>();
}
Long[] attachIds = Arrays.stream(mesProductPlan.getAttachId().split(","))
.map(String::trim)
.map(Long::parseLong)
.toArray(Long[]::new);
return mesBaseAttachInfoService.selectMesBaseAttachInfoByAttachIds(attachIds);
} else if (attachType.equals(MesConstants.MES_ATTACH_TYPE_SOP)) {
if (StringUtils.isEmpty(mesProductPlan.getSopId())) {
return new ArrayList<>();
}
Long[] sopIds = Arrays.stream(mesProductPlan.getSopId().split(","))
.map(String::trim)
.map(Long::parseLong)
.toArray(Long[]::new);
return mesBaseAttachInfoService.selectMesBaseAttachInfoByAttachIds(sopIds);
} else {
return new ArrayList<>();
}
} catch (Exception e) {
return new ArrayList<>();
}
}
return new ArrayList<>();
}
// public String executeAssignTaskResultTask() {
// ScheduledExecutorService executor = Executors.newSingleThreadScheduledExecutor();

@ -62,7 +62,7 @@
<include refid="selectMesMaterialBomVo"/>
<where>
<if test="parentId != null ">and parent_id = #{parentId}</if>
<if test="ancestors != null and ancestors != ''">and ancestors like concat('%', #{ancestors},'%')</if>
<if test="ancestors != null and ancestors != ''">and (material_bom_id = #{ancestors} or ancestors like concat('%', #{ancestors},'%'))</if>
<if test="materialId != null ">and material_id = #{materialId}</if>
<if test="erpMaterialId != null ">and erp_material_id = #{erpMaterialId}</if>
<if test="materialName != null and materialName != ''">and material_name like concat('%', #{materialName},

@ -152,7 +152,8 @@
<if test="planEndTime != null ">and mpp.plan_end_time = #{planEndTime}</if>
<if test="realBeginTime != null ">and mpp.real_begin_time = #{realBeginTime}</if>
<if test="realEndTime != null ">and mpp.real_end_time = #{realEndTime}</if>
<if test="attachId != null and attachId != ''">and mpp.attach_id = #{attachId}</if>
<if test="attachId != null and attachId != ''">and mpp.attach_id like concat('%', #{attachId},'%')</if>
<if test="sopId != null and sopId != ''">and mpp.sop_id like concat('%', #{sopId},'%')</if>
<if test="planStatus != null and planStatus != ''">and mpp.plan_status = #{planStatus}</if>
<if test="isFlag != null and isFlag != ''">and mpp.is_flag = #{isFlag}</if>
</where>
@ -508,8 +509,10 @@
a.is_flag
from mes_product_plan a
<where>
<if test="planId != null ">and a.plan_id = #{planId}</if>
<if test="dispatchCode != null and dispatchCode != ''">and a.dispatch_code = #{dispatchCode}</if>
<if test="processId != null ">and a.process_id = #{processId}</if>
<if test="userId != null ">and a.user_id = #{userId}</if>
<if test="finalProcessFlag != null and finalProcessFlag != ''">and a.final_process_flag = #{finalProcessFlag}</if>
<if test="productOrderId != null ">and a.product_order_id = #{productOrderId}</if>
</where>

@ -45,6 +45,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<if test="completeDate != null "> and complete_date = #{completeDate}</if>
<if test="isFlag != null and isFlag != ''"> and is_flag = #{isFlag}</if>
</where>
order by erp_modify_date desc
</select>
<select id="selectMesProjectInfoByProjectId" parameterType="Long" resultMap="MesProjectInfoResult">

@ -1,6 +1,7 @@
package com.hw.system.common.service.impl;
import java.rmi.ServerException;
import java.util.ArrayList;
import java.util.Date;
import java.util.List;
import java.util.Map;
@ -132,13 +133,11 @@ public class SysPointRouterServiceImpl implements ISysPointRouterService {
String emailAccountInfo = redisService.getCacheObject(CacheConstants.SYS_EAMIL_ACCOUNT_INFO);
String emailAccount = "";
String emailPassword = "";
if(StringUtils.isNotEmpty(emailAccountInfo)){
int splitIndex = emailAccountInfo.indexOf(",");
emailAccount = emailAccountInfo.substring(0,splitIndex);
emailPassword = emailAccountInfo.substring(splitIndex+1);
if (StringUtils.isNotEmpty(emailAccountInfo)) {
int splitIndex = emailAccountInfo.indexOf(",");
emailAccount = emailAccountInfo.substring(0, splitIndex);
emailPassword = emailAccountInfo.substring(splitIndex + 1);
}
System.out.println(emailAccount+"e:"+emailPassword);
SysPointRouter queryPointRouter = new SysPointRouter();
List<SysPointRouter> sysPointRouterList = sysPointRouterMapper.selectEmailNotifySysPointRouterList(queryPointRouter);
@ -146,12 +145,31 @@ public class SysPointRouterServiceImpl implements ISysPointRouterService {
Map<Long, List<SysPointRouter>> sysPointRouterMap = sysPointRouterList.stream()
.filter(spo -> spo.getProcessActivityId() != null).collect(Collectors.groupingBy(SysPointRouter::getProcessActivityId));
String emailTitle = "";
List<String> emailTitleList = new ArrayList<>();
for (Long processActivityId : sysPointRouterMap.keySet()) {
List<SysPointRouter> sysPointRoutersByActivityList = sysPointRouterMap.get(processActivityId);
List<SysUser> sysUsers = sysUserMapper.selectProcessActivityAuthUserList(processActivityId);
String sendMsg = "";
String colon = "";
for (SysPointRouter sysPointRouter : sysPointRoutersByActivityList) {
sendMsg += sysPointRouter.getRemark() + ";";
String remark = sysPointRouter.getRemark();
int colonIndex = remark.indexOf(colon);
if (colonIndex >= 0) {
emailTitle = remark.substring(0, colonIndex);
remark = remark.replaceFirst(colon, "\n\n");
}else{
emailTitle = remark;
}
emailTitle = emailTitle.length() > 30 ? emailTitle.substring(0, 30) : emailTitle;
if (!emailTitleList.contains(emailTitle)) {
emailTitleList.add(emailTitle);
}
remark = remark.replaceAll(";", "\n\n");
sendMsg += remark + "\n\n";
sysPointRouter.setSentEmailFlag("1");
sysPointRouter.setUpdateTime(new Date());
// sysPointRouter.setUpdateBy(SecurityUtils.getLoginUser().getNickname());
@ -160,7 +178,7 @@ public class SysPointRouterServiceImpl implements ISysPointRouterService {
for (SysUser sysUser : sysUsers) {
if (StringUtils.isNotEmpty(sysUser.getEmail())) {
MailUtils.processSendEmail(emailAccount,emailPassword,sysUser.getEmail(), "通知", sendMsg);
MailUtils.processSendEmail(emailAccount, emailPassword, sysUser.getEmail(), emailTitleList.toString(), sendMsg);
}
}

@ -246,6 +246,7 @@ public class WmsApiController extends BaseController {
* @return
*/
@PostMapping(("/synchronizeInventoryInformationToERP"))
@Log(title = "同步原材料入库信息", businessType = BusinessType.INSERT)
public AjaxResult synchronizeInventoryInformationToERP() {
int result = 0;
Map<Long, List<WmsRawInstock>> purchaseOrderIdMap = wmsErpScheduledTaskService.synchronizeInventoryInformationToERP();
@ -261,6 +262,7 @@ public class WmsApiController extends BaseController {
* @return
*/
@PostMapping(("/synchronizeRawMaterialDeliveryInformationToERP"))
@Log(title = "同步原材料出库信息", businessType = BusinessType.INSERT)
public AjaxResult synchronizeRawMaterialDeliveryInformationToERP() {
Map<Long, List<WmsRawOutstockDetail>> otherMaterialIdMap = wmsErpScheduledTaskService.synchronizeOtherMaterialDeliveryInformationToERP();
for (Long materialId : otherMaterialIdMap.keySet()) {
@ -282,6 +284,7 @@ public class WmsApiController extends BaseController {
* @return
*/
@PostMapping(("/synchronizeRawReturnInformationToERP"))
@Log(title = "同步原材料退库信息", businessType = BusinessType.INSERT)
public AjaxResult synchronizeRawReturnInformationToERP() {
Map<Long, List<WmsRawReturnDetail>> purchaseOrderIdMap = wmsErpScheduledTaskService.synchronizeRawReturnInformationToERP();
int result= 0;
@ -298,6 +301,7 @@ public class WmsApiController extends BaseController {
* @return
*/
@PostMapping(("/synchronizeProductInstockInformationToERP/{days}"))
@Log(title = "同步成品入库信息", businessType = BusinessType.INSERT)
public AjaxResult synchronizeProductInstockInformationToERP(@PathVariable Integer days) {
Map<Long, List<WmsProductInstock>> productIdMap = wmsErpScheduledTaskService.synchronizeProductInstockInformationToERP(days);
int result = 0;
@ -314,6 +318,7 @@ public class WmsApiController extends BaseController {
* @return
*/
@PostMapping(("/synchronizeProductOutstockInformationToERP/{days}"))
@Log(title = "同步成品出库信息", businessType = BusinessType.INSERT)
public AjaxResult synchronizeProductOutstockInformationToERP(@PathVariable Integer days) {
Map<Long, List<WmsProductOutstock>> productIdMap = wmsErpScheduledTaskService.synchronizeProductOutstockInformationToERP(days);
int result = 0;
@ -327,7 +332,7 @@ public class WmsApiController extends BaseController {
/**
* WCS-45
*/
@Log(title = "入库", businessType = BusinessType.CONTINUE)
@Log(title = "调度入库", businessType = BusinessType.CONTINUE)
@PostMapping(("/continueRawInstock"))
public AjaxResult continueRawInstock(@Validated @RequestBody WmsRawInstockContinueVo wmsRawInstockContinueVo) {
return toAjax(wmsRawInstockService.continueRawInstock(wmsRawInstockContinueVo));

@ -154,3 +154,27 @@ export function getUserList(query) {
params: query
})
}
// 获取生产派工附件List列表
export function getAttachInfoList(attachType, dispatchCode, processId, userId) {
return request({
url: '/mes/productplan/attachInfoList/' + attachType + '/' + dispatchCode + '/' + processId + '/' + userId,
method: 'get'
})
}
// 校验生产派工是否已绑定附件
export function checkMesProductPlanAttachInfo(attachType, attachIds) {
return request({
url: '/mes/productplan/checkMesProductPlanAttachInfo/' + attachType + '/' + attachIds,
method: 'get'
})
}
// 根据planId获取生产派工SOP附件List列表
export function getDispatchAttachByPlanIdList(attachType, planId) {
return request({
url: '/mes/productplan/getDispatchAttachByPlanIdList/' + attachType + '/' + planId,
method: 'get'
})
}

@ -639,7 +639,7 @@ import applyRawReturn from '@//views/board/common/applyRawReturn.vue';
import WorkshopNotice from "@/components/workshopNotice/index.vue";
import {noticeData} from "@/utils/notice"
import ViewFile from "@/components/viewFile/index.vue";
import {getDispatchSOPAttachList} from "@/api/mes/productplan";
import {getDispatchAttachByPlanIdList, } from "@/api/mes/productplan";
import {monitorSerialData} from "@/utils/serial";
import saleOrderRelates from "@/views/board/common/saleOrderRelates.vue";
@ -1855,7 +1855,7 @@ export default {
/** SOP预览*/
handleViewSOP(e) {
this.fileListData = [];
getDispatchSOPAttachList(e.dispatchCode, e.processId).then(res => {
getDispatchAttachByPlanIdList("2", e.planId).then(res => {
let attachList = res.data;
let thisFileList = [];
attachList.forEach(e => {

@ -513,7 +513,7 @@ import applyRawOutstock from "@/views/board/common/applyRawOutstock.vue";
import applyRawReturn from '@//views/board/common/applyRawReturn.vue';
import {getNowDateTime} from "@/utils/ruoyi";
import ViewFile from "@/components/viewFile/index.vue";
import {getDispatchSOPAttachList} from "@/api/mes/productplan";
import {getDispatchAttachByPlanIdList, } from "@/api/mes/productplan";
const vw = (document.documentElement.clientWidth || document.body.clientWidth) / 100
export default {
@ -1102,7 +1102,7 @@ export default {
/** SOP预览*/
handleViewSOP(e){
this.fileListData = [];
getDispatchSOPAttachList(e.dispatchCode, e.processId).then(res => {
getDispatchAttachByPlanIdList("2", e.planId).then(res => {
let attachList = res.data;
let thisFileList = [];
attachList.forEach(e => {

@ -494,7 +494,7 @@ import {getNowDateTime} from "@/utils/ruoyi";
import WorkshopNotice from "@/components/workshopNotice/index.vue";
import {noticeData} from "@/utils/notice"
import ViewFile from "@/components/viewFile/index.vue";
import {getDispatchSOPAttachList} from "@/api/mes/productplan";
import {getDispatchAttachByPlanIdList, } from "@/api/mes/productplan";
const vw = (document.documentElement.clientWidth || document.body.clientWidth) / 100
export default {
@ -1270,7 +1270,7 @@ export default {
/** SOP预览*/
handleViewSOP(e){
this.fileListData = [];
getDispatchSOPAttachList(e.dispatchCode, e.processId).then(res => {
getDispatchAttachByPlanIdList("2", e.planId).then(res => {
let attachList = res.data;
let thisFileList = [];
attachList.forEach(e => {

@ -374,7 +374,7 @@ import {addWmslocation, updateWmslocation} from "@/api/wms/wmslocation";
import WorkshopNotice from "@/components/workshopNotice/index.vue";
import {noticeData} from "@/utils/notice"
import ViewFile from "@/components/viewFile/index.vue";
import {getDispatchSOPAttachList} from "@/api/mes/productplan";
import {getDispatchAttachByPlanIdList, } from "@/api/mes/productplan";
const setState = (e) => {
if (e === '1') {
@ -1335,7 +1335,7 @@ export default {
/** SOP预览*/
handleViewSOP(){
this.fileListData = [];
getDispatchSOPAttachList(this.selectedRows.dispatchCode, this.selectedRows.processId).then(res => {
getDispatchAttachByPlanIdList("2", this.selectedRows.planId).then(res => {
let attachList = res.data;
let thisFileList = [];
attachList.forEach(e => {

@ -383,7 +383,7 @@ import {
import WorkshopNotice from "@/components/workshopNotice/index.vue";
import {noticeData} from "@/utils/notice"
import ViewFile from "@/components/viewFile/index.vue";
import {getDispatchSOPAttachList} from "@/api/mes/productplan";
import {getDispatchAttachByPlanIdList, } from "@/api/mes/productplan";
import applyRawOutstock from "@/views/board/common/applyRawOutstock.vue";
import PrintPage from "@/views/board/barcode/workshopBarcode.vue";
@ -1044,7 +1044,7 @@ export default {
/** SOP预览*/
handleViewSOP(e) {
this.fileListData = [];
getDispatchSOPAttachList(e.dispatchCode, e.processId).then(res => {
getDispatchAttachByPlanIdList("2", e.planId).then(res => {
let attachList = res.data;
let thisFileList = [];
attachList.forEach(e => {

@ -110,9 +110,9 @@
<el-table-column v-if="temperature!==null" label="触发温度阈值" align="center" prop="temperature" min-width="110"/>
<el-table-column v-if="!humidity!==null" label="触发湿度阈值" align="center" prop="humidity" min-width="110"/>
<el-table-column v-if="noise!==null" label="触发噪声阈值" align="center" prop="noise" min-width="110"/>
<el-table-column label="触发阈值次数" align="center" prop="triggerNumber" min-width="110"/>
<el-table-column label="时间范围(分)" align="center" prop="timeRange" min-width="110"/>
<el-table-column label="设备离线时间(分)" align="center" prop="deviceOfflineTime" min-width="120"/>
<!-- <el-table-column label="触发阈值次数" align="center" prop="triggerNumber" min-width="110"/>-->
<!-- <el-table-column label="时间范围(分)" align="center" prop="timeRange" min-width="110"/>-->
<!-- <el-table-column label="设备离线时间(分)" align="center" prop="deviceOfflineTime" min-width="120"/>-->
<!-- <el-table-column label="通知用户" align="center" prop="notifyUser" />-->
<el-table-column label="备注" align="center" prop="cause" />
@ -200,15 +200,15 @@
<el-form-item label="噪声阈值" prop="noise" v-if="form.energyType==6">
<el-input-number v-model="form.noise" placeholder="请输入触发阈值" />
</el-form-item>
<el-form-item label="触发阈值次数" prop="triggerNumber">
<el-input-number v-model="form.triggerNumber" placeholder="请输入触发阈值次数" />
</el-form-item>
<el-form-item label="时间范围(分)" prop="timeRange">
<el-input-number v-model="form.timeRange" placeholder="请输入时间范围(分)" />
</el-form-item>
<el-form-item label="设备离线时间(分)" prop="deviceOfflineTime">
<el-input-number v-model="form.deviceOfflineTime" placeholder="请输入设备离线时间(分)" />
</el-form-item>
<!-- <el-form-item label="触发阈值次数" prop="triggerNumber">-->
<!-- <el-input-number v-model="form.triggerNumber" placeholder="请输入触发阈值次数" />-->
<!-- </el-form-item>-->
<!-- <el-form-item label="时间范围(分)" prop="timeRange">-->
<!-- <el-input-number v-model="form.timeRange" placeholder="请输入时间范围(分)" />-->
<!-- </el-form-item>-->
<!-- <el-form-item label="设备离线时间(分)" prop="deviceOfflineTime">-->
<!-- <el-input-number v-model="form.deviceOfflineTime" placeholder="请输入设备离线时间(分)" />-->
<!-- </el-form-item>-->
<!-- <el-form-item label="通知用户" prop="notifyUser">-->
<!-- <el-input v-model="form.notifyUser" placeholder="请输入通知用户" />-->
<!-- </el-form-item>-->

@ -470,9 +470,13 @@ import "@riophae/vue-treeselect/dist/vue-treeselect.css";
import selectMaterial from '@//views/mes/materialinfo/selectMaterial.vue';
import {verifyBOMIsProduction} from "@//api/mes/productOrder";
import {getToken} from "@/utils/auth";
import {getDispatchDrawingList, getDispatchSOPAttachList, uploadFile} from "@/api/mes/productplan";
import {
checkMesProductPlanAttachInfo,
uploadFile
} from "@/api/mes/productplan";
import {selectByAttachIds} from "@/api/mes/baseAttachInfo";
import {findUserList} from "@/api/system/user";
import {getConfigKey} from "@/api/system/config";
export default {
name: "MaterialBom",
@ -645,8 +649,37 @@ export default {
},
created() {
this.getList();
this.getConfigValues();
},
methods: {
getConfigValues(){
//
getConfigKey("mes.drawing.allowedExtension").then(res => {
if(res.msg){
this.drawingFileType = res.msg.split(",");
}
});
getConfigKey("mes.drawing.maxSize").then(res => {
if(res.msg){
this.drawingFileSize = res.msg;
}
});
getConfigKey("mes.sop.allowedExtension").then(res => {
if(res.msg){
this.sopFileType = res.msg.split(",");
}
});
getConfigKey("mes.sop.maxSize").then(res => {
if (res.msg) {
this.sopFileSize = res.msg;
}
});
},
/** 查询物料BOM信息列表 */
getList() {
this.loading = true;
@ -942,6 +975,7 @@ export default {
},
//
drawingFileUploadSubmit() {
this.$modal.loading();
this.addProductPlanObject.attachId = this.uploadAttachList[this.addProductPlanObject.materialBomId].join(",");
this.uploadAttachList = [];
let updateData = {
@ -954,6 +988,7 @@ export default {
updateBomAttachInfo(updateData).then(response => {
this.$modal.msgSuccess("更新图纸成功");
this.addProductPlanObject = null;
this.$modal.closeLoading();
this.blueprintModel = false;
this.getList();
}).catch(() => {
@ -983,9 +1018,20 @@ export default {
);
},
//
handleRemoveDrawing(file) {
async handleRemoveDrawing(file) {
let arrPic = this.$refs.drawingUpload.uploadFiles;
let index = arrPic.indexOf(file);
let flag = false;
let attachId = this.uploadAttachList[this.addProductPlanObject.materialBomId][index];
await checkMesProductPlanAttachInfo("1", attachId).then(res => {
if (res.msg != null){
this.$modal.msgWarning(res.msg);
flag = true
}
})
if (flag){
return
}
this.uploadAttachList[this.addProductPlanObject.materialBomId].splice(index, 1);
let num = 0;
arrPic.map((item) => {
@ -1020,6 +1066,7 @@ export default {
},
//sop
sopFileUploadSubmit() {
this.$modal.loading();
this.addProductPlanObject.sopId = this.uploadSopList[this.addProductPlanObject.materialBomId].join(",");
this.uploadSopList = [];
let updateData = {
@ -1032,6 +1079,7 @@ export default {
updateBomAttachInfo(updateData).then(response => {
this.$modal.msgSuccess("更新SOP成功");
this.addProductPlanObject = null;
this.$modal.closeLoading();
this.sopViewModel = false;
this.getList();
}).catch(() => {
@ -1061,9 +1109,20 @@ export default {
);
},
//
handleRemoveSop(file) {
async handleRemoveSop(file) {
let arrPic = this.$refs.drawingUpload.uploadFiles;
let index = arrPic.indexOf(file);
let flag = false;
let attachId = this.uploadAttachList[this.addProductPlanObject.materialBomId][index];
await checkMesProductPlanAttachInfo("2", attachId).then(res => {
if (res.msg != null){
this.$modal.msgWarning(res.msg);
flag = true
}
})
if (flag){
return
}
this.uploadSopList[this.addProductPlanObject.materialBomId].splice(index, 1);
let num = 0;
arrPic.map((item) => {

@ -186,7 +186,7 @@
size="mini"
type="primary"
@click="handleDrawing(scope.row)"
v-if=" scope.row.userId != null"
>图纸
</el-button>
<el-button
@ -194,7 +194,7 @@
size="mini"
type="success"
@click="handleSop(scope.row)"
v-if="scope.row.processType !== PROCESS_TYPE.AUTO && scope.row.children != null && scope.row.children !== undefined"
v-if=" scope.row.userId != null"
>SOP
</el-button>
@ -238,12 +238,13 @@
</el-card>
<el-dialog
:visible.sync="blueprintModel"
title="上传图纸"
title="选择图纸"
width="30%"
@before-close="blueprintModel = false">
<el-form ref="form">
<el-form-item label="选择BOM图纸">
<el-select v-model="materialBomAttachIdList" placeholder="请选择选择BOM图纸" multiple filterable :clearable="false" :disabled="!(nowRow.processType !== PROCESS_TYPE.AUTO && nowRow.children != null && nowRow.children !== undefined)">
<el-select v-model="materialBomAttachIdList" placeholder="请选择选择BOM图纸" multiple filterable :clearable="false"
:disabled="(addProductPlanObject.planStatus !== PLAN_STATUS.DISPATCHED)">
<el-option
v-for="item in attachInfoList"
:key="item.attachId"
@ -292,7 +293,7 @@
<span
class="el-upload-list__item-delete"
@click="handleRemoveDrawing(file)"
v-if="nowRow.processType !== PROCESS_TYPE.AUTO && nowRow.children != null && nowRow.children !== undefined"
v-if="addProductPlanObject.planStatus === PLAN_STATUS.DISPATCHED"
>
<i class="el-icon-delete"></i>
</span>
@ -308,12 +309,13 @@
<el-dialog
:visible.sync="sopViewModel"
title="上传SOP附件"
title="选择SOP"
width="30%"
@before-close="sopViewModel = false">
<el-form ref="form">
<el-form-item label="选择BOM的SOP">
<el-select v-model="materialBomAttachIdList" placeholder="请选择选择BOM的SOP" multiple filterable :clearable="false">
<el-select v-model="materialBomAttachIdList" placeholder="请选择选择BOM的SOP" multiple filterable :clearable="false"
:disabled="(addProductPlanObject.planStatus !== PLAN_STATUS.DISPATCHED)">
<el-option
v-for="item in attachInfoList"
:key="item.attachId"
@ -362,6 +364,7 @@
<span
class="el-upload-list__item-delete"
@click="handleRemoveSop(file)"
v-if="addProductPlanObject.planStatus === PLAN_STATUS.DISPATCHED"
>
<i class="el-icon-delete"></i>
</span>
@ -370,12 +373,12 @@
</el-upload>
<span slot="footer" class="dialog-footer">
<!-- 上传提示 -->
<div class="el-upload__tip" slot="tip" v-if="isShowTip">
请上传
<template v-if="sopFileSize"> <b style="color: #f56c6c">{{ sopFileSize }}MB</b></template>
<template v-if="sopFileType"> <b style="color: #f56c6c">{{ sopFileType.join("/") }}</b></template>
的文件
</div>
<!-- <div class="el-upload__tip" slot="tip" v-if="isShowTip">-->
<!-- 请上传-->
<!-- <template v-if="sopFileSize"> <b style="color: #f56c6c">{{ sopFileSize }}MB</b></template>-->
<!-- <template v-if="sopFileType"> <b style="color: #f56c6c">{{ sopFileType.join("/") }}</b></template>-->
<!-- 的文件-->
<!-- </div>-->
<el-button type="primary" @click="sopFileUploadSubmit"> </el-button>
<el-button @click="sopViewModel = false"> </el-button>
</span>
@ -406,13 +409,13 @@
import {getProductOrder} from "@//api/mes/productOrder";
import {
deleteProductPlansByDispatchCode,
getDispatchCode, getDispatchDrawingList, getDispatchSOPAttachList,
getDispatchCode,
selectProductPlans,
checkAddMesProductPlanList,
orderAddMesProductPlanList,
getBaseRouteProcesses,
getProcessUsers,
uploadFile
uploadFile, getAttachInfoList
} from "@//api/mes/productplan";
import {getConfigKey} from "@//api/system/config"
import {deepClone} from "@//utils/index";
@ -477,7 +480,6 @@ export default {
},
data() {
return {
nowRow:{},
blueprintModel: false,
sopViewModel: false,
pictureDetailModel: false,
@ -602,7 +604,10 @@ export default {
INTERNAL: '2',//
},
id: 1,
ATTACH_TYPE: {
DRAWING: "1",//:
SOP: "2",//:SOP
},
processUsers: [],
//BOMList
attachInfoList: [],
@ -613,7 +618,6 @@ export default {
watch: {
'materialBomAttachIdList': {
handler(newVal, oldVal) {
console.log("val:",newVal,oldVal)
this.updateAttachInfoByBom(newVal, oldVal);
},
}
@ -734,6 +738,8 @@ export default {
obj.processOrder = groupedProductPlan.processOrder;
obj.displayFlag = groupedProductPlan.displayFlag;
obj.finalProcessFlag = groupedProductPlan.finalProcessFlag;
obj.attachId = groupedProductPlan.attachId;
obj.sopId = groupedProductPlan.sopId;
obj.planBeginTime = this.form.planBeginTime;
obj.planEndTime = this.form.planEndTime;
@ -800,19 +806,23 @@ export default {
this.$set(data.children, data.children.length, {
id: id,
dispatchCode: scope.row.dispatchCode,
processId: scope.row.processId,
productionTime: scope.row.productionTime,
materialBomId: scope.row.materialBomId,
planStatus: this.PLAN_STATUS.DISPATCHED,
userId: ""
userId: null
})
} else {
this.$set(data, 'children', [
{
id: id,
dispatchCode: scope.row.dispatchCode,
processId: scope.row.processId,
productionTime: scope.row.productionTime,
materialBomId: scope.row.materialBomId,
planStatus: this.PLAN_STATUS.DISPATCHED,
userId: "",
userId: null,
}
])
}
@ -895,8 +905,8 @@ export default {
toUpdatedProductPlan.planEndTime = processUser.planEndTime;
toUpdatedProductPlan.planId = processUser.planId;
toUpdatedProductPlan.planStatus = processUser.planStatus;
toUpdatedProductPlan.attachId = e.attachId;
toUpdatedProductPlan.sopId = e.sopId;
toUpdatedProductPlan.attachId = processUser.attachId;
toUpdatedProductPlan.sopId = processUser.sopId;
toUpdatedProductPlan.planAmount = planDispatchAmount;
toUpdatedProductPlan.dispatchAmount = planDispatchAmount;
toUpdatedProductPlan.children = null;
@ -1111,9 +1121,12 @@ export default {
} else {
obj.children = [{
id: this.id,
dispatchCode: obj.dispatchCode,
processId: obj.processId,
materialBomId: obj.materialBomId,
planStatus: this.PLAN_STATUS.DISPATCHED,
productionTime: obj.productionTime
productionTime: obj.productionTime,
userId: null
}]
}
@ -1158,10 +1171,10 @@ export default {
/** 查看图纸 */
handleDrawing(row) {
this.fileList = [];
if (row.oldRowFlag && (!this.previewDrawingFlag[row.dispatchCode + "-" + row.processId]
|| this.previewDrawingFlag[row.dispatchCode + "-" + row.processId] !== "1")) {
this.previewDrawingFlag[row.dispatchCode + "-" + row.processId] = "1";
getDispatchDrawingList(row.dispatchCode, row.processId).then(res => {
if (row.planId != null && (!this.previewDrawingFlag[row.dispatchCode + "-" + row.processId + "-" + row.userId]
|| this.previewDrawingFlag[row.dispatchCode + "-" + row.processId + "-" + row.userId] !== "1")) {
this.previewDrawingFlag[row.dispatchCode + "-" + row.processId + "-" + row.userId] = "1";
getAttachInfoList(this.ATTACH_TYPE.DRAWING, row.dispatchCode, row.processId, row.userId).then(res => {
let attachList = res.data;
attachList.forEach(e => {
let previewFile = {};
@ -1175,19 +1188,19 @@ export default {
groupAttachFile.attachId = e.attachId;
groupAttachFile.attachPath = e.attachPath;
groupAttachFile.attachName = e.attachName;
let groupAttachFileList = this.groupAttachFileList[this.addProductPlanObject.dispatchCode + "-" + this.addProductPlanObject.processId];
this.groupAttachFileList[this.addProductPlanObject.dispatchCode + "-" + this.addProductPlanObject.processId] = groupAttachFileList ? this.groupAttachFileList[this.addProductPlanObject.dispatchCode + "-" + this.addProductPlanObject.processId] : [];
this.groupAttachFileList[this.addProductPlanObject.dispatchCode + "-" + this.addProductPlanObject.processId].push(groupAttachFile);
let groupAttachFileList = this.groupAttachFileList[this.addProductPlanObject.dispatchCode + "-" + this.addProductPlanObject.processId + "-" + this.addProductPlanObject.userId];
this.groupAttachFileList[this.addProductPlanObject.dispatchCode + "-" + this.addProductPlanObject.processId + "-" + this.addProductPlanObject.userId] = groupAttachFileList ? this.groupAttachFileList[this.addProductPlanObject.dispatchCode + "-" + this.addProductPlanObject.processId + "-" + this.addProductPlanObject.userId] : [];
this.groupAttachFileList[this.addProductPlanObject.dispatchCode + "-" + this.addProductPlanObject.processId + "-" + this.addProductPlanObject.userId].push(groupAttachFile);
let uploadAttachList = this.uploadAttachList[this.addProductPlanObject.dispatchCode + "-" + this.addProductPlanObject.processId];
this.uploadAttachList[this.addProductPlanObject.dispatchCode + "-" + this.addProductPlanObject.processId] = uploadAttachList ? this.uploadAttachList[this.addProductPlanObject.dispatchCode + "-" + this.addProductPlanObject.processId] : [];
this.uploadAttachList[this.addProductPlanObject.dispatchCode + "-" + this.addProductPlanObject.processId].push(e.attachId);
let uploadAttachList = this.uploadAttachList[this.addProductPlanObject.dispatchCode + "-" + this.addProductPlanObject.processId + "-" + this.addProductPlanObject.userId];
this.uploadAttachList[this.addProductPlanObject.dispatchCode + "-" + this.addProductPlanObject.processId + "-" + this.addProductPlanObject.userId] = uploadAttachList ? this.uploadAttachList[this.addProductPlanObject.dispatchCode + "-" + this.addProductPlanObject.processId + "-" + this.addProductPlanObject.userId] : [];
this.uploadAttachList[this.addProductPlanObject.dispatchCode + "-" + this.addProductPlanObject.processId + "-" + this.addProductPlanObject.userId].push(e.attachId);
})
})
} else {
if (this.groupAttachFileList[row.dispatchCode + "-" + row.processId]) {
this.groupAttachFileList[row.dispatchCode + "-" + row.processId].forEach(e => {
if (this.groupAttachFileList[row.dispatchCode + "-" + row.processId + "-" + row.userId]) {
this.groupAttachFileList[row.dispatchCode + "-" + row.processId + "-" + row.userId].forEach(e => {
let previewFile = {};
previewFile.url = e.attachPath;
previewFile.name = e.attachName;
@ -1198,7 +1211,7 @@ export default {
this.addProductPlanObject = row;
this.materialBomAttachIdList = [];
getBomAttachInfo("1", this.addProductPlanObject.materialBomId).then(response => {
getBomAttachInfo(this.ATTACH_TYPE.DRAWING, this.addProductPlanObject.materialBomId).then(response => {
this.attachInfoList = response.data;
for (let e of this.fileList) {
let attachInfo = this.attachInfoList.find(item => item.attachPath === e.url);
@ -1214,14 +1227,16 @@ export default {
drawingFileUploadSubmit() {
for (let i = 0; i < this.mesProductPlanList.length; i++) {
let mesProductPlan = this.mesProductPlanList[i];
if (mesProductPlan.dispatchCode === this.addProductPlanObject.dispatchCode
&& mesProductPlan.processId === this.addProductPlanObject.processId) {
this.mesProductPlanList[i].attachId = this.uploadAttachList[this.addProductPlanObject.dispatchCode + "-" + this.addProductPlanObject.processId].join(",");
for (let child of mesProductPlan.children) {
if (mesProductPlan.dispatchCode === this.addProductPlanObject.dispatchCode
&& mesProductPlan.processId === this.addProductPlanObject.processId
&& child.userId === this.addProductPlanObject.userId) {
child.attachId = this.uploadAttachList[this.addProductPlanObject.dispatchCode + "-" + this.addProductPlanObject.processId + "-" + this.addProductPlanObject.userId].join(",");
}
}
}
// this.uploadAttachList = [];
this.addProductPlanObject = null;
this.addProductPlanObject = {};
this.blueprintModel = false;
},
@ -1233,12 +1248,12 @@ export default {
const formData = new FormData();
formData.append("file", fileData);
formData.append("processId", this.addProductPlanObject.processId);
formData.append("attachType", "1");
formData.append("attachType", this.ATTACH_TYPE.DRAWING);
uploadFile(formData).then(
(res) => {
let uploadAttachList = this.uploadAttachList[this.addProductPlanObject.dispatchCode + "-" + this.addProductPlanObject.processId];
this.uploadAttachList[this.addProductPlanObject.dispatchCode + "-" + this.addProductPlanObject.processId] = uploadAttachList ? this.uploadAttachList[this.addProductPlanObject.dispatchCode + "-" + this.addProductPlanObject.processId] : [];
this.uploadAttachList[this.addProductPlanObject.dispatchCode + "-" + this.addProductPlanObject.processId].push(res.attachId);
let uploadAttachList = this.uploadAttachList[this.addProductPlanObject.dispatchCode + "-" + this.addProductPlanObject.processId + "-" + this.addProductPlanObject.userId];
this.uploadAttachList[this.addProductPlanObject.dispatchCode + "-" + this.addProductPlanObject.processId + "-" + this.addProductPlanObject.userId] = uploadAttachList ? this.uploadAttachList[this.addProductPlanObject.dispatchCode + "-" + this.addProductPlanObject.processId + "-" + this.addProductPlanObject.userId] : [];
this.uploadAttachList[this.addProductPlanObject.dispatchCode + "-" + this.addProductPlanObject.processId + "-" + this.addProductPlanObject.userId].push(res.attachId);
//
let groupAttachFile = {};
@ -1247,9 +1262,9 @@ export default {
groupAttachFile.attachId = res.attachId;
groupAttachFile.attachPath = res.imgUrl;
groupAttachFile.attachName = res.fileName;
let groupAttachFileList = this.groupAttachFileList[this.addProductPlanObject.dispatchCode + "-" + this.addProductPlanObject.processId];
this.groupAttachFileList[this.addProductPlanObject.dispatchCode + "-" + this.addProductPlanObject.processId] = groupAttachFileList ? this.groupAttachFileList[this.addProductPlanObject.dispatchCode + "-" + this.addProductPlanObject.processId] : [];
this.groupAttachFileList[this.addProductPlanObject.dispatchCode + "-" + this.addProductPlanObject.processId].push(groupAttachFile);
let groupAttachFileList = this.groupAttachFileList[this.addProductPlanObject.dispatchCode + "-" + this.addProductPlanObject.processId + "-" + this.addProductPlanObject.userId];
this.groupAttachFileList[this.addProductPlanObject.dispatchCode + "-" + this.addProductPlanObject.processId + "-" + this.addProductPlanObject.userId] = groupAttachFileList ? this.groupAttachFileList[this.addProductPlanObject.dispatchCode + "-" + this.addProductPlanObject.processId + "-" + this.addProductPlanObject.userId] : [];
this.groupAttachFileList[this.addProductPlanObject.dispatchCode + "-" + this.addProductPlanObject.processId + "-" + this.addProductPlanObject.userId].push(groupAttachFile);
this.$modal.closeLoading();
}, (err) => {
this.$refs.drawingUpload.clearFiles(); //
@ -1262,11 +1277,10 @@ export default {
handleRemoveDrawing(file) {
let arrPic = this.$refs.drawingUpload.uploadFiles;
let index = arrPic.indexOf(file);
console.log("index",index)
this.uploadAttachList[this.addProductPlanObject.dispatchCode + "-" + this.addProductPlanObject.processId].splice(index, 1);
this.uploadAttachList[this.addProductPlanObject.dispatchCode + "-" + this.addProductPlanObject.processId + "-" + this.addProductPlanObject.userId].splice(index, 1);
// this.uploadAttachList.splice(index, 1);
this.fileList.splice(index, 1);
this.groupAttachFileList[this.addProductPlanObject.dispatchCode + "-" + this.addProductPlanObject.processId].splice(index, 1);
this.groupAttachFileList[this.addProductPlanObject.dispatchCode + "-" + this.addProductPlanObject.processId + "-" + this.addProductPlanObject.userId].splice(index, 1);
let num = 0;
arrPic.map((item) => {
if (item.uid === file.uid) {
@ -1281,25 +1295,13 @@ export default {
},
/** 查看sop */
handleSop(row) {
this.nowRow = row
this.fileList = [];
if (row.oldRowFlag && (!this.previewSopFlag[row.dispatchCode + "-" + row.processId]
|| this.previewSopFlag[row.dispatchCode + "-" + row.processId] !== "1")) {
this.previewSopFlag[row.dispatchCode + "-" + row.processId] = "1";
getDispatchSOPAttachList(row.dispatchCode, row.processId).then(res => {
if (row.planId != null && (!this.previewSopFlag[row.dispatchCode + "-" + row.processId + "-" + row.userId]
|| this.previewSopFlag[row.dispatchCode + "-" + row.processId + "-" + row.userId] !== "1")) {
this.previewSopFlag[row.dispatchCode + "-" + row.processId + "-" + row.userId] = "1";
getAttachInfoList(this.ATTACH_TYPE.SOP, row.dispatchCode, row.processId, row.userId).then(res => {
let attachList = res.data;
attachList.forEach(e => {
let previewFile = {};
@ -1313,19 +1315,19 @@ export default {
groupSopFile.attachId = e.attachId;
groupSopFile.attachPath = e.attachPath;
groupSopFile.attachName = e.attachName;
let groupSopFileList = this.groupSopFileList[this.addProductPlanObject.dispatchCode + "-" + this.addProductPlanObject.processId];
this.groupSopFileList[this.addProductPlanObject.dispatchCode + "-" + this.addProductPlanObject.processId] = groupSopFileList ? this.groupSopFileList[this.addProductPlanObject.dispatchCode + "-" + this.addProductPlanObject.processId] : [];
this.groupSopFileList[this.addProductPlanObject.dispatchCode + "-" + this.addProductPlanObject.processId].push(groupSopFile);
let groupSopFileList = this.groupSopFileList[this.addProductPlanObject.dispatchCode + "-" + this.addProductPlanObject.processId + "-" + this.addProductPlanObject.userId];
this.groupSopFileList[this.addProductPlanObject.dispatchCode + "-" + this.addProductPlanObject.processId + "-" + this.addProductPlanObject.userId] = groupSopFileList ? this.groupSopFileList[this.addProductPlanObject.dispatchCode + "-" + this.addProductPlanObject.processId + "-" + this.addProductPlanObject.userId] : [];
this.groupSopFileList[this.addProductPlanObject.dispatchCode + "-" + this.addProductPlanObject.processId + "-" + this.addProductPlanObject.userId].push(groupSopFile);
let uploadSopList = this.uploadSopList[this.addProductPlanObject.dispatchCode + "-" + this.addProductPlanObject.processId];
this.uploadSopList[this.addProductPlanObject.dispatchCode + "-" + this.addProductPlanObject.processId] = uploadSopList ? this.uploadSopList[this.addProductPlanObject.dispatchCode + "-" + this.addProductPlanObject.processId] : [];
this.uploadSopList[this.addProductPlanObject.dispatchCode + "-" + this.addProductPlanObject.processId].push(e.attachId);
let uploadSopList = this.uploadSopList[this.addProductPlanObject.dispatchCode + "-" + this.addProductPlanObject.processId + "-" + this.addProductPlanObject.userId];
this.uploadSopList[this.addProductPlanObject.dispatchCode + "-" + this.addProductPlanObject.processId + "-" + this.addProductPlanObject.userId] = uploadSopList ? this.uploadSopList[this.addProductPlanObject.dispatchCode + "-" + this.addProductPlanObject.processId + "-" + this.addProductPlanObject.userId] : [];
this.uploadSopList[this.addProductPlanObject.dispatchCode + "-" + this.addProductPlanObject.processId + "-" + this.addProductPlanObject.userId].push(e.attachId);
})
})
} else {
if (this.groupSopFileList[row.dispatchCode + "-" + row.processId]) {
this.groupSopFileList[row.dispatchCode + "-" + row.processId].forEach(e => {
if (this.groupSopFileList[row.dispatchCode + "-" + row.processId + "-" + row.userId]) {
this.groupSopFileList[row.dispatchCode + "-" + row.processId + "-" + row.userId].forEach(e => {
let previewFile = {};
previewFile.url = e.attachPath;
previewFile.name = e.attachName;
@ -1336,7 +1338,7 @@ export default {
this.addProductPlanObject = row;
this.materialBomAttachIdList = [];
getBomAttachInfo("2", this.addProductPlanObject.materialBomId).then(response => {
getBomAttachInfo(this.ATTACH_TYPE.SOP, this.addProductPlanObject.materialBomId).then(response => {
this.attachInfoList = response.data;
for (let e of this.fileList) {
let attachInfo = this.attachInfoList.find(item => item.attachPath === e.url);
@ -1352,14 +1354,16 @@ export default {
sopFileUploadSubmit() {
for (let i = 0; i < this.mesProductPlanList.length; i++) {
let mesProductPlan = this.mesProductPlanList[i];
if (mesProductPlan.dispatchCode === this.addProductPlanObject.dispatchCode
&& mesProductPlan.processId === this.addProductPlanObject.processId) {
this.mesProductPlanList[i].sopId = this.uploadSopList[this.addProductPlanObject.dispatchCode + "-" + this.addProductPlanObject.processId].join(",");
for (let child of mesProductPlan.children) {
if (mesProductPlan.dispatchCode === this.addProductPlanObject.dispatchCode
&& mesProductPlan.processId === this.addProductPlanObject.processId
&& child.userId === this.addProductPlanObject.userId) {
child.sopId = this.uploadSopList[this.addProductPlanObject.dispatchCode + "-" + this.addProductPlanObject.processId + "-" + this.addProductPlanObject.userId].join(",");
}
}
}
// this.uploadAttachList = [];
this.addProductPlanObject = null;
this.addProductPlanObject = {};
this.sopViewModel = false;
},
@ -1371,12 +1375,12 @@ export default {
const formData = new FormData();
formData.append("file", fileData);
formData.append("processId", this.addProductPlanObject.processId);
formData.append("attachType", "2");
formData.append("attachType", this.ATTACH_TYPE.SOP);
uploadFile(formData).then(
(res) => {
let uploadSopList = this.uploadSopList[this.addProductPlanObject.dispatchCode + "-" + this.addProductPlanObject.processId];
this.uploadSopList[this.addProductPlanObject.dispatchCode + "-" + this.addProductPlanObject.processId] = uploadSopList ? this.uploadSopList[this.addProductPlanObject.dispatchCode + "-" + this.addProductPlanObject.processId] : [];
this.uploadSopList[this.addProductPlanObject.dispatchCode + "-" + this.addProductPlanObject.processId].push(res.attachId);
let uploadSopList = this.uploadSopList[this.addProductPlanObject.dispatchCode + "-" + this.addProductPlanObject.processId + "-" + this.addProductPlanObject.userId];
this.uploadSopList[this.addProductPlanObject.dispatchCode + "-" + this.addProductPlanObject.processId + "-" + this.addProductPlanObject.userId] = uploadSopList ? this.uploadSopList[this.addProductPlanObject.dispatchCode + "-" + this.addProductPlanObject.processId + "-" + this.addProductPlanObject.userId] : [];
this.uploadSopList[this.addProductPlanObject.dispatchCode + "-" + this.addProductPlanObject.processId + "-" + this.addProductPlanObject.userId].push(res.attachId);
//
let groupSopFile = {};
@ -1385,9 +1389,9 @@ export default {
groupSopFile.attachId = res.attachId;
groupSopFile.attachPath = res.imgUrl;
groupSopFile.attachName = res.fileName;
let groupSopFileList = this.groupSopFileList[this.addProductPlanObject.dispatchCode + "-" + this.addProductPlanObject.processId];
this.groupSopFileList[this.addProductPlanObject.dispatchCode + "-" + this.addProductPlanObject.processId] = groupSopFileList ? this.groupSopFileList[this.addProductPlanObject.dispatchCode + "-" + this.addProductPlanObject.processId] : [];
this.groupSopFileList[this.addProductPlanObject.dispatchCode + "-" + this.addProductPlanObject.processId].push(groupSopFile);
let groupSopFileList = this.groupSopFileList[this.addProductPlanObject.dispatchCode + "-" + this.addProductPlanObject.processId + "-" + this.addProductPlanObject.userId];
this.groupSopFileList[this.addProductPlanObject.dispatchCode + "-" + this.addProductPlanObject.processId + "-" + this.addProductPlanObject.userId] = groupSopFileList ? this.groupSopFileList[this.addProductPlanObject.dispatchCode + "-" + this.addProductPlanObject.processId + "-" + this.addProductPlanObject.userId] : [];
this.groupSopFileList[this.addProductPlanObject.dispatchCode + "-" + this.addProductPlanObject.processId + "-" + this.addProductPlanObject.userId].push(groupSopFile);
this.$modal.closeLoading();
}, (err) => {
this.$refs.drawingUpload.clearFiles(); //
@ -1400,8 +1404,8 @@ export default {
handleRemoveSop(file) {
let arrPic = this.$refs.drawingUpload.uploadFiles;
let index = arrPic.indexOf(file);
this.uploadSopList[this.addProductPlanObject.dispatchCode + "-" + this.addProductPlanObject.processId].splice(index, 1);
this.groupSopFileList[this.addProductPlanObject.dispatchCode + "-" + this.addProductPlanObject.processId].splice(index, 1);
this.uploadSopList[this.addProductPlanObject.dispatchCode + "-" + this.addProductPlanObject.processId + "-" + this.addProductPlanObject.userId].splice(index, 1);
this.groupSopFileList[this.addProductPlanObject.dispatchCode + "-" + this.addProductPlanObject.processId + "-" + this.addProductPlanObject.userId].splice(index, 1);
this.fileList.splice(index, 1);
let num = 0;
arrPic.map((item) => {
@ -1511,12 +1515,12 @@ export default {
groupAttachFile.attachId = e.attachId;
groupAttachFile.attachPath = e.attachPath;
groupAttachFile.attachName = e.attachName;
let groupAttachFileList = this.groupAttachFileList[this.addProductPlanObject.dispatchCode + "-" + this.addProductPlanObject.processId];
this.groupAttachFileList[this.addProductPlanObject.dispatchCode + "-" + this.addProductPlanObject.processId] = groupAttachFileList ? this.groupAttachFileList[this.addProductPlanObject.dispatchCode + "-" + this.addProductPlanObject.processId] : [];
this.groupAttachFileList[this.addProductPlanObject.dispatchCode + "-" + this.addProductPlanObject.processId].push(groupAttachFile);
let uploadAttachList = this.uploadAttachList[this.addProductPlanObject.dispatchCode + "-" + this.addProductPlanObject.processId];
this.uploadAttachList[this.addProductPlanObject.dispatchCode + "-" + this.addProductPlanObject.processId] = uploadAttachList ? this.uploadAttachList[this.addProductPlanObject.dispatchCode + "-" + this.addProductPlanObject.processId] : [];
this.uploadAttachList[this.addProductPlanObject.dispatchCode + "-" + this.addProductPlanObject.processId].push(e.attachId);
let groupAttachFileList = this.groupAttachFileList[this.addProductPlanObject.dispatchCode + "-" + this.addProductPlanObject.processId + "-" + this.addProductPlanObject.userId];
this.groupAttachFileList[this.addProductPlanObject.dispatchCode + "-" + this.addProductPlanObject.processId + "-" + this.addProductPlanObject.userId] = groupAttachFileList ? this.groupAttachFileList[this.addProductPlanObject.dispatchCode + "-" + this.addProductPlanObject.processId + "-" + this.addProductPlanObject.userId] : [];
this.groupAttachFileList[this.addProductPlanObject.dispatchCode + "-" + this.addProductPlanObject.processId + "-" + this.addProductPlanObject.userId].push(groupAttachFile);
let uploadAttachList = this.uploadAttachList[this.addProductPlanObject.dispatchCode + "-" + this.addProductPlanObject.processId + "-" + this.addProductPlanObject.userId];
this.uploadAttachList[this.addProductPlanObject.dispatchCode + "-" + this.addProductPlanObject.processId + "-" + this.addProductPlanObject.userId] = uploadAttachList ? this.uploadAttachList[this.addProductPlanObject.dispatchCode + "-" + this.addProductPlanObject.processId + "-" + this.addProductPlanObject.userId] : [];
this.uploadAttachList[this.addProductPlanObject.dispatchCode + "-" + this.addProductPlanObject.processId + "-" + this.addProductPlanObject.userId].push(e.attachId);
}
} else {
//SOP
@ -1531,12 +1535,12 @@ export default {
groupSopFile.attachId = e.attachId;
groupSopFile.attachPath = e.attachPath;
groupSopFile.attachName = e.attachName;
let groupSopFileList = this.groupSopFileList[this.addProductPlanObject.dispatchCode + "-" + this.addProductPlanObject.processId];
this.groupSopFileList[this.addProductPlanObject.dispatchCode + "-" + this.addProductPlanObject.processId] = groupSopFileList ? this.groupSopFileList[this.addProductPlanObject.dispatchCode + "-" + this.addProductPlanObject.processId] : [];
this.groupSopFileList[this.addProductPlanObject.dispatchCode + "-" + this.addProductPlanObject.processId].push(groupSopFile);
let uploadSopList = this.uploadSopList[this.addProductPlanObject.dispatchCode + "-" + this.addProductPlanObject.processId];
this.uploadSopList[this.addProductPlanObject.dispatchCode + "-" + this.addProductPlanObject.processId] = uploadSopList ? this.uploadSopList[this.addProductPlanObject.dispatchCode + "-" + this.addProductPlanObject.processId] : [];
this.uploadSopList[this.addProductPlanObject.dispatchCode + "-" + this.addProductPlanObject.processId].push(e.attachId);
let groupSopFileList = this.groupSopFileList[this.addProductPlanObject.dispatchCode + "-" + this.addProductPlanObject.processId + "-" + this.addProductPlanObject.userId];
this.groupSopFileList[this.addProductPlanObject.dispatchCode + "-" + this.addProductPlanObject.processId + "-" + this.addProductPlanObject.userId] = groupSopFileList ? this.groupSopFileList[this.addProductPlanObject.dispatchCode + "-" + this.addProductPlanObject.processId + "-" + this.addProductPlanObject.userId] : [];
this.groupSopFileList[this.addProductPlanObject.dispatchCode + "-" + this.addProductPlanObject.processId + "-" + this.addProductPlanObject.userId].push(groupSopFile);
let uploadSopList = this.uploadSopList[this.addProductPlanObject.dispatchCode + "-" + this.addProductPlanObject.processId + "-" + this.addProductPlanObject.userId];
this.uploadSopList[this.addProductPlanObject.dispatchCode + "-" + this.addProductPlanObject.processId + "-" + this.addProductPlanObject.userId] = uploadSopList ? this.uploadSopList[this.addProductPlanObject.dispatchCode + "-" + this.addProductPlanObject.processId + "-" + this.addProductPlanObject.userId] : [];
this.uploadSopList[this.addProductPlanObject.dispatchCode + "-" + this.addProductPlanObject.processId + "-" + this.addProductPlanObject.userId].push(e.attachId);
}
}
},

@ -208,7 +208,11 @@ export default {
{ required: true, message: "人工出库标识不能为空", trigger: "change" }
],
},
detailFlag: true
detailFlag: true,
MANUAL_FLAG:{
YES:'1',
NO:'0'
}
};
},
created() {
@ -228,6 +232,7 @@ export default {
this.loading = true;
getProductOutstockAudit(this.form.productOutstockId).then(response => {
this.form = response.data;
this.form.manualFlag = this.form.warehouseId ===531 ? '1' : null;
this.loading = false;
});
},

Loading…
Cancel
Save