Commit 38007abe by liuyang

2024-10-10 委外入库出库调整

parent bffae33b
package com.baosight.hggp.hg.kc.domain;
import com.baosight.hggp.hg.sc.domain.HGSC010A;
import com.baosight.hggp.util.DateUtils;
import com.baosight.iplat4j.core.data.DaoEPBase;
import com.baosight.iplat4j.core.ei.EiColumn;
import com.baosight.iplat4j.core.util.NumberUtils;
import com.baosight.iplat4j.core.util.StringUtils;
import java.util.HashMap;
import java.util.Map;
/**
* @author LiuYang
* @version 1.0 2024/10/10
* @description
*/
public class HGKC014B extends HGSC010A {
public static final String FIELD_CONTRACT_DATE = "contractDate"; /* 委托日期*/
public static final String FIELD_SUP_CODE = "supCode"; /* 供应商编码*/
public static final String FIELD_SUP_NAME = "supName"; /* 供应商名称*/
public static final String FIELD_USER_ID = "userId"; /* 申请人*/
public static final String FIELD_SUB_STATUS = "subStatus"; /* 提交状态 0-未提交 1-已提交*/
public static final String COL_SUP_CODE = "SUP_CODE"; /* 供应商编码*/
public static final String COL_SUP_NAME = "SUP_NAME"; /* 供应商名称*/
public static final String COL_USER_ID = "USER_ID"; /* 申请人*/
public static final String COL_SUB_STATUS = "SUB_STATUS"; /* 提交状态 0-未提交 1-已提交*/
public static final String QUERY = "HGKC014B.query";
public static final String COUNT = "HGKC014B.count";
private String contractDate = " "; /* 委托日期*/
private String supCode = " "; /* 供应商编码*/
private String supName = " "; /* 供应商名称*/
private String userId = " "; /* 申请人*/
private Integer subStatus = 0; /* 提交状态 0-未提交 1-已提交*/
public void initMetaData() {
super.initMetaData();
EiColumn eiColumn;
eiColumn = new EiColumn(FIELD_CONTRACT_DATE);
eiColumn.setDescName("委托日期");
eiMetadata.addMeta(eiColumn);
eiColumn = new EiColumn(FIELD_SUP_CODE);
eiColumn.setDescName("供应商编码");
eiMetadata.addMeta(eiColumn);
eiColumn = new EiColumn(FIELD_SUP_NAME);
eiColumn.setDescName("供应商名称");
eiMetadata.addMeta(eiColumn);
eiColumn = new EiColumn(FIELD_USER_ID);
eiColumn.setDescName("申请人");
eiMetadata.addMeta(eiColumn);
eiColumn = new EiColumn(FIELD_SUB_STATUS);
eiColumn.setDescName("提交状态 0-未提交 1-已提交");
eiMetadata.addMeta(eiColumn);
}
public HGKC014B() {
initMetaData();
}
public String getContractDate() {
return contractDate;
}
public void setContractDate(String contractDate) {
this.contractDate = contractDate;
}
public String getSupCode() {
return supCode;
}
public void setSupCode(String supCode) {
this.supCode = supCode;
}
public String getSupName() {
return supName;
}
public void setSupName(String supName) {
this.supName = supName;
}
public String getUserId() {
return userId;
}
public void setUserId(String userId) {
this.userId = userId;
}
public Integer getSubStatus() {
return subStatus;
}
public void setSubStatus(Integer subStatus) {
this.subStatus = subStatus;
}
public void fromMap(Map map) {
super.fromMap(map);
setContractDate(StringUtils.defaultIfEmpty(StringUtils.toString(DateUtils.formatShort(map.get(FIELD_CONTRACT_DATE))), contractDate));
setSupCode(StringUtils.defaultIfEmpty(StringUtils.toString(map.get(FIELD_SUP_CODE)), supCode));
setSupName(StringUtils.defaultIfEmpty(StringUtils.toString(map.get(FIELD_SUP_NAME)), supName));
setUserId(StringUtils.defaultIfEmpty(StringUtils.toString(map.get(FIELD_USER_ID)), userId));
setSubStatus(NumberUtils.toInteger(StringUtils.toString(map.get(FIELD_SUB_STATUS)), subStatus));
}
public Map toMap() {
Map map = super.toMap();
map.put(FIELD_CONTRACT_DATE, StringUtils.toString(contractDate, eiMetadata.getMeta(FIELD_CONTRACT_DATE)));
map.put(FIELD_SUP_CODE, StringUtils.toString(supCode, eiMetadata.getMeta(FIELD_SUP_CODE)));
map.put(FIELD_SUP_NAME, StringUtils.toString(supName, eiMetadata.getMeta(FIELD_SUP_NAME)));
map.put(FIELD_USER_ID, StringUtils.toString(userId, eiMetadata.getMeta(FIELD_USER_ID)));
map.put(FIELD_SUB_STATUS, StringUtils.toString(subStatus, eiMetadata.getMeta(FIELD_SUB_STATUS)));
return map;
}
}
......@@ -667,6 +667,7 @@ public class HGKC015A extends DaoEPBase {
map.put(FIELD_COMPANY_CODE, StringUtils.toString(companyCode, eiMetadata.getMeta(FIELD_COMPANY_CODE)));
map.put(FIELD_COMPANY_NAME, StringUtils.toString(companyName, eiMetadata.getMeta(FIELD_COMPANY_NAME)));
map.put(FIELD_PARENT_ID, StringUtils.toString(parentId, eiMetadata.getMeta(FIELD_PARENT_ID)));
map.put(FIELD_CONTRACT_CODE, StringUtils.toString(contractCode, eiMetadata.getMeta(FIELD_CONTRACT_CODE)));
map.put(FIELD_OUT_CODE, StringUtils.toString(outCode, eiMetadata.getMeta(FIELD_OUT_CODE)));
map.put(FIELD_INVENT_TYPE, StringUtils.toString(inventType, eiMetadata.getMeta(FIELD_INVENT_TYPE)));
map.put(FIELD_INVENT_CODE, StringUtils.toString(inventCode, eiMetadata.getMeta(FIELD_INVENT_CODE)));
......
package com.baosight.hggp.hg.kc.domain;
import com.baosight.hggp.hg.sc.domain.HGSC010B;
import com.baosight.hggp.util.DateUtils;
import com.baosight.iplat4j.core.ei.EiColumn;
import com.baosight.iplat4j.core.util.NumberUtils;
import com.baosight.iplat4j.core.util.StringUtils;
import java.util.HashMap;
import java.util.Map;
/**
* @author LiuYang
* @version 1.0 2024/10/10
* @description
*/
public class HGKC015B extends HGSC010B {
public static final String FIELD_CONTRACT_DATE = "contractDate"; /* 委托日期*/
public static final String FIELD_SUP_CODE = "supCode"; /* 供应商编码*/
public static final String FIELD_SUP_NAME = "supName"; /* 供应商名称*/
public static final String FIELD_USER_ID = "userId"; /* 申请人*/
public static final String FIELD_SUB_STATUS = "subStatus"; /* 提交状态 0-未提交 1-已提交*/
public static final String COL_SUP_CODE = "SUP_CODE"; /* 供应商编码*/
public static final String COL_SUP_NAME = "SUP_NAME"; /* 供应商名称*/
public static final String COL_USER_ID = "USER_ID"; /* 申请人*/
public static final String COL_SUB_STATUS = "SUB_STATUS"; /* 提交状态 0-未提交 1-已提交*/
public static final String QUERY = "HGKC015B.query";
public static final String COUNT = "HGKC015B.count";
private String contractDate = " "; /* 委托日期*/
private String supCode = " "; /* 供应商编码*/
private String supName = " "; /* 供应商名称*/
private String userId = " "; /* 申请人*/
private Integer subStatus = 0; /* 提交状态 0-未提交 1-已提交*/
public void initMetaData() {
super.initMetaData();
EiColumn eiColumn;
eiColumn = new EiColumn(FIELD_CONTRACT_DATE);
eiColumn.setDescName("委托日期");
eiMetadata.addMeta(eiColumn);
eiColumn = new EiColumn(FIELD_SUP_CODE);
eiColumn.setDescName("供应商编码");
eiMetadata.addMeta(eiColumn);
eiColumn = new EiColumn(FIELD_SUP_NAME);
eiColumn.setDescName("供应商名称");
eiMetadata.addMeta(eiColumn);
eiColumn = new EiColumn(FIELD_USER_ID);
eiColumn.setDescName("申请人");
eiMetadata.addMeta(eiColumn);
eiColumn = new EiColumn(FIELD_SUB_STATUS);
eiColumn.setDescName("提交状态 0-未提交 1-已提交");
eiMetadata.addMeta(eiColumn);
}
public String getContractDate() {
return contractDate;
}
public void setContractDate(String contractDate) {
this.contractDate = contractDate;
}
public String getSupCode() {
return supCode;
}
public void setSupCode(String supCode) {
this.supCode = supCode;
}
public String getSupName() {
return supName;
}
public void setSupName(String supName) {
this.supName = supName;
}
public String getUserId() {
return userId;
}
public void setUserId(String userId) {
this.userId = userId;
}
public Integer getSubStatus() {
return subStatus;
}
public void setSubStatus(Integer subStatus) {
this.subStatus = subStatus;
}
public void fromMap(Map map) {
super.fromMap(map);
setContractDate(StringUtils.defaultIfEmpty(StringUtils.toString(DateUtils.formatShort(map.get(FIELD_CONTRACT_DATE))), contractDate));
setSupCode(StringUtils.defaultIfEmpty(StringUtils.toString(map.get(FIELD_SUP_CODE)), supCode));
setSupName(StringUtils.defaultIfEmpty(StringUtils.toString(map.get(FIELD_SUP_NAME)), supName));
setUserId(StringUtils.defaultIfEmpty(StringUtils.toString(map.get(FIELD_USER_ID)), userId));
setSubStatus(NumberUtils.toInteger(StringUtils.toString(map.get(FIELD_SUB_STATUS)), subStatus));
}
public Map toMap() {
Map map = super.toMap();
map.put(FIELD_CONTRACT_DATE, StringUtils.toString(contractDate, eiMetadata.getMeta(FIELD_CONTRACT_DATE)));
map.put(FIELD_SUP_CODE, StringUtils.toString(supCode, eiMetadata.getMeta(FIELD_SUP_CODE)));
map.put(FIELD_SUP_NAME, StringUtils.toString(supName, eiMetadata.getMeta(FIELD_SUP_NAME)));
map.put(FIELD_USER_ID, StringUtils.toString(userId, eiMetadata.getMeta(FIELD_USER_ID)));
map.put(FIELD_SUB_STATUS, StringUtils.toString(subStatus, eiMetadata.getMeta(FIELD_SUB_STATUS)));
return map;
}
}
......@@ -86,7 +86,7 @@ public class ServiceHGKC014 extends ServiceEPBase {
List<String> contractCodes = ObjectUtils.listEpKey(hgkc014As, HGKC014A.FIELD_CONTRACT_CODE);
List<HGSC010A> hgsc010As = HGSCTools.Hgsc010a.getByContractCode(contractCodes);
for (HGKC014 hgkc014: hgkc014List) {
AssertUtils.isTrue(hgkc014.getStatus().equals(CommonConstant.YesNo.YES_1), "当前委外任务已提交,不允许删除!");
AssertUtils.isTrue(!hgkc014.getStatus().equals(CommonConstant.YesNo.NO_0), "当前委外任务已提交,不允许删除!");
if (Objects.nonNull(hgkc014As)){
List<HGKC014A> hgkc014AList = hgkc014As.stream().filter(hgkc014A -> hgkc014A.getParentId().equals(hgkc014.getId())).collect(Collectors.toList());
HGKCTools.HgKc014A.deleteByParentId(hgkc014AList, hgsc010As);
......@@ -108,7 +108,7 @@ public class ServiceHGKC014 extends ServiceEPBase {
for (Map resultMap: resultMaps) {
HGKC014 hgkc014 = new HGKC014();
hgkc014.fromMap(resultMap);
if(Objects.nonNull(hgkc014.getId())&&hgkc014.getId()!=0){
if(Objects.nonNull(hgkc014.getId()) && hgkc014.getId()!=0){
this.modify(hgkc014);
}else {
this.add(hgkc014);
......@@ -183,11 +183,12 @@ public class ServiceHGKC014 extends ServiceEPBase {
List<HGKC014> resultMaps = MapUtils.toDaoEPBases(inInfo, HGKC014.class);
List<Long> ids = ObjectUtils.listEpKey(resultMaps, HGKC014.FIELD_ID);
List<HGKC014A> hgkc014AList = HGKCTools.HgKc014A.getByParentId(ids);
AssertUtils.isTrue(Objects.isNull(hgkc014AList), "请先添加入库明细");
AssertUtils.isTrue(Objects.isNull(hgkc014AList), "请先添加委外入库明细");
for (HGKC014 hgkc014 : resultMaps) {
List<HGKC014A> hgkc14As = hgkc014AList.stream()
.filter(item -> item.getParentId().equals(hgkc014.getId())).collect(Collectors.toList());
AssertUtils.isTrue(hgkc14As.size() <= 0, "请先添加入库明细");
AssertUtils.isTrue(hgkc14As.size() <= 0, "请先添加委外入库明细");
AssertUtils.isTrue(hgkc014.getStatus().equals(HgKcConst.HgKc014.Status.S0), "当前委外入库任务已提交,不允许重复提交!");
hgkc014.setStatus(HgKcConst.HgKc014.Status.S1);
DaoUtils.update(HgKcSqlConstant.HgKc014.UPDATE_STATUS, hgkc014);
// 更新明细状态
......
......@@ -7,6 +7,7 @@ import com.baosight.hggp.core.constant.CommonConstant;
import com.baosight.hggp.core.dao.DaoUtils;
import com.baosight.hggp.core.security.UserSessionUtils;
import com.baosight.hggp.hg.constant.HGConstant;
import com.baosight.hggp.hg.kc.constant.HgKcSqlConstant;
import com.baosight.hggp.hg.kc.domain.HGKC014;
import com.baosight.hggp.hg.kc.domain.HGKC014A;
import com.baosight.hggp.hg.kc.tools.HGKCTools;
......@@ -24,6 +25,7 @@ import com.baosight.iplat4j.core.exception.PlatException;
import com.baosight.iplat4j.core.resource.I18nMessages;
import com.baosight.iplat4j.core.service.impl.ServiceEPBase;
import com.baosight.iplat4j.ed.util.SequenceGenerator;
import org.apache.commons.collections.CollectionUtils;
import java.util.*;
import java.util.stream.Collectors;
......@@ -68,7 +70,8 @@ public class ServiceHGKC014A extends ServiceEPBase {
public EiInfo query(EiInfo inInfo) {
try {
Map queryMap = EiInfoUtils.getFirstRow(inInfo);
queryMap.remove("status");
queryMap.put(HGKC014A.FIELD_DELETE_FLAG, CommonConstant.YesNo.NO_0);
inInfo = super.query(inInfo, HGKC014A.QUERY, new HGKC014A());
} catch (PlatException e) {
LogUtils.setDetailMsg(inInfo, e, "查询失败");
......@@ -116,7 +119,22 @@ public class ServiceHGKC014A extends ServiceEPBase {
List<String> contractCodes = ObjectUtils.listEpKey(hgkc014List, HGKC014A.FIELD_CONTRACT_CODE);
List<HGSC010A> hgsc010As = HGSCTools.Hgsc010a.getByContractCode(contractCodes);
HGKCTools.HgKc014A.deleteByParentId(hgkc014List, hgsc010As);
if (CollectionUtils.isNotEmpty(hgkc014List)){
for (HGKC014A hgkc014A: hgkc014List) {
hgsc010As.stream().filter(hgsc010A ->
hgsc010A.getContractCode().equals(hgkc014A.getContractCode())
&& hgsc010A.getProductCode().equals(hgkc014A.getProductCode())
&& hgsc010A.getSpec().equals(hgkc014A.getSpec())
).forEach(hgsc010A -> {
hgsc010A.setRemainingQty(hgsc010A.getRemainingQty().add(hgkc014A.getDepositQty()));
hgsc010A.setRemainingWeight(hgsc010A.getRemainingWeight().add(hgkc014A.getDepositWeight()));
hgsc010A.setDepositQty(hgsc010A.getDepositQty().subtract(hgkc014A.getDepositQty()));
hgsc010A.setDepositWeight(hgsc010A.getDepositWeight().subtract(hgkc014A.getDepositWeight()));
DaoUtils.update(HGSC010A.UPDATE, hgsc010A);
});
DaoUtils.update(HGKC014A.DELETE, hgkc014A);
}
}
inInfo.setStatus(EiConstant.STATUS_SUCCESS);
inInfo.setMsgByKey("ep.1000", new String[]{String.valueOf(i), I18nMessages.getText("label.delete", "删除")});
......
......@@ -3,12 +3,14 @@ package com.baosight.hggp.hg.kc.service;
import com.baosight.hggp.aspect.annotation.OperationLogAnnotation;
import com.baosight.hggp.common.DdynamicEnum;
import com.baosight.hggp.common.InventTypeDetailEnum;
import com.baosight.hggp.core.constant.CommonConstant;
import com.baosight.hggp.core.dao.DaoUtils;
import com.baosight.hggp.core.security.UserSessionUtils;
import com.baosight.hggp.hg.constant.HGConstant;
import com.baosight.hggp.hg.kc.constant.HgKcSqlConstant;
import com.baosight.hggp.hg.kc.domain.HGKC014;
import com.baosight.hggp.hg.kc.domain.HGKC014A;
import com.baosight.hggp.hg.kc.domain.HGKC014B;
import com.baosight.hggp.hg.kc.tools.HGKCTools;
import com.baosight.hggp.hg.pz.domain.HGPZ004;
import com.baosight.hggp.hg.pz.domain.HGPZ005;
......@@ -38,9 +40,9 @@ public class ServiceHGKC014B extends ServiceEPBase {
@Override
public EiInfo initLoad(EiInfo inInfo) {
try {
CommonMethod.initBlock(inInfo, Arrays.asList(DdynamicEnum.WH_RECORD_BLOCK_ID, DdynamicEnum.USER_BLOCK_ID,DdynamicEnum.INVENT_TYPE_BLOCK_ID));
CommonMethod.initBlock(inInfo, Arrays.asList(DdynamicEnum.WH_RECORD_BLOCK_ID, DdynamicEnum.SUP_RECORD_BLOCK_ID, DdynamicEnum.USER_BLOCK_ID,DdynamicEnum.INVENT_TYPE_BLOCK_ID));
EiInfoUtils.addBlock(inInfo,"roleCompany", UserSessionUtils.getRoleCompany(), Company.class);
inInfo.addBlock(EiConstant.resultBlock).addBlockMeta(new HGSC010A().eiMetadata);
inInfo.addBlock(EiConstant.resultBlock).addBlockMeta(new HGKC014B().eiMetadata);
} catch (Exception e) {
LogUtils.setDetailMsg(inInfo, e, "初始化失败");
}
......@@ -52,14 +54,17 @@ public class ServiceHGKC014B extends ServiceEPBase {
try {
Map queryMap = EiInfoUtils.getFirstRow(inInfo);
queryMap.put("isRemainingQty", "true");
queryMap.put("status", "1");
queryMap.remove("parentId");
inInfo = super.query(inInfo, HGSC010A.QUERY, new HGSC010A());
List<HGSC010A> resultBlock = MapUtils.toDaoEPBases(inInfo, HGSC010A.class);
resultBlock.forEach(hgsc010a -> {
hgsc010a.setDepositQty(BigDecimal.ZERO);
hgsc010a.setDepositWeight(BigDecimal.ZERO);
});
queryMap.put(HGKC014A.FIELD_DELETE_FLAG, CommonConstant.YesNo.NO_0);
inInfo = super.query(inInfo, HGKC014B.QUERY, new HGKC014B());
List<HGKC014B> resultBlock = MapUtils.toDaoEPBases(inInfo, HGKC014B.class);
if (resultBlock != null){
resultBlock.forEach(hgsc010a -> {
hgsc010a.setDepositQty(BigDecimal.ZERO);
hgsc010a.setDepositWeight(BigDecimal.ZERO);
});
}
inInfo.getBlock(EiConstant.resultBlock).setRows(resultBlock);
} catch (PlatException e) {
......@@ -99,8 +104,6 @@ public class ServiceHGKC014B extends ServiceEPBase {
DaoUtils.update(HGKC014A.UPDATE, kc014a);
}else {
hgkc014a.setParentId(Long.parseLong(paramMap.get("parentId").toString()));
hgkc014a.setCompanyCode(paramMap.get("companyCode").toString());
hgkc014a.setCompanyName(paramMap.get("companyName").toString());
hgkc014a.setWhCode(paramMap.get("whCode").toString());
hgkc014a.setWhName(paramMap.get("whName").toString());
hgkc014a.setDepositCode(paramMap.get("depositCode").toString());
......@@ -118,6 +121,8 @@ public class ServiceHGKC014B extends ServiceEPBase {
public void add(HGKC014A hgkc014a) {
hgkc014a.setPcsId(hgkc014a.getId());
hgkc014a.setDeliverQty(BigDecimal.ZERO);
hgkc014a.setActualQty(BigDecimal.ZERO);
hgkc014a.setUpdatedBy(null);
hgkc014a.setUpdatedName(null);
hgkc014a.setUpdatedTime(null);
......
......@@ -6,6 +6,7 @@ import com.baosight.hggp.core.constant.CommonConstant;
import com.baosight.hggp.core.dao.DaoUtils;
import com.baosight.hggp.core.security.UserSessionUtils;
import com.baosight.hggp.hg.constant.HGConstant;
import com.baosight.hggp.hg.kc.constant.HgKcConst;
import com.baosight.hggp.hg.kc.constant.HgKcSqlConstant;
import com.baosight.hggp.hg.kc.domain.HGKC015;
import com.baosight.hggp.hg.kc.domain.HGKC015A;
......@@ -82,7 +83,7 @@ public class ServiceHGKC015 extends ServiceEPBase {
List<String> contractCodes = ObjectUtils.listEpKey(hgkc015As, HGKC015A.FIELD_CONTRACT_CODE);
List<HGSC010B> hgsc010Bs = HGSCTools.Hgsc010b.getByContractCode(contractCodes);
for (HGKC015 hgkc015: hgkc015List) {
AssertUtils.isTrue(hgkc015.getStatus().equals(CommonConstant.YesNo.YES_1), "当前委外任务已提交,不允许删除!");
AssertUtils.isTrue(!hgkc015.getStatus().equals(CommonConstant.YesNo.NO_0), "当前委外任务已提交,不允许删除!");
if (Objects.nonNull(hgkc015As)){
List<HGKC015A> hgkc015AList = hgkc015As.stream().filter(hgkc015A -> hgkc015A.getParentId().equals(hgkc015.getId())).collect(Collectors.toList());
HGKCTools.HgKc015a.deleteByParentId(hgkc015AList, hgsc010Bs);
......@@ -136,10 +137,11 @@ public class ServiceHGKC015 extends ServiceEPBase {
List<Long> ids = ObjectUtils.listEpKey(resultMaps, HGKC015.FIELD_ID);
List<HGKC015A> hgkc015AList = HGKCTools.HgKc015a.getByParentId(ids);
List<HGSC010B> hgsc010Bs = HGSCTools.Hgsc010b.getByContractCode(ObjectUtils.listEpKey(hgkc015AList, HGKC015A.FIELD_CONTRACT_CODE));
AssertUtils.isTrue(Objects.isNull(hgkc015AList), "请先添加出库明细");
AssertUtils.isTrue(Objects.isNull(hgkc015AList), "请先添加委外出库明细");
for (HGKC015 hgkc015: resultMaps) {
List<HGKC015A> hgkc15As = hgkc015AList.stream().filter(item -> item.getParentId().equals(hgkc015.getId())).collect(Collectors.toList());
AssertUtils.isTrue(hgkc15As.size()<= 0, "请先添加出库明细");
AssertUtils.isTrue(hgkc15As.size()<= 0, "请先添加委外出库明细");
AssertUtils.isTrue(hgkc015.getStatus().equals(HgKcConst.HgKc014.Status.S0), "当前委外入库任务已提交,不允许重复提交!");
hgkc015.setStatus(CommonConstant.YesNo.YES_1);
DaoUtils.update(HgKcSqlConstant.HgKc015.UPDATE_STATUS, hgkc015);
for (HGKC015A hgkc015A: hgkc15As) {
......
......@@ -7,6 +7,8 @@ import com.baosight.hggp.core.constant.CommonConstant;
import com.baosight.hggp.core.dao.DaoUtils;
import com.baosight.hggp.core.security.UserSessionUtils;
import com.baosight.hggp.hg.constant.HGConstant;
import com.baosight.hggp.hg.kc.constant.HgKcSqlConstant;
import com.baosight.hggp.hg.kc.domain.HGKC014A;
import com.baosight.hggp.hg.kc.domain.HGKC015;
import com.baosight.hggp.hg.kc.domain.HGKC015A;
import com.baosight.hggp.hg.kc.tools.HGKCTools;
......@@ -23,6 +25,7 @@ import com.baosight.iplat4j.core.exception.PlatException;
import com.baosight.iplat4j.core.resource.I18nMessages;
import com.baosight.iplat4j.core.service.impl.ServiceEPBase;
import com.baosight.iplat4j.ed.util.SequenceGenerator;
import org.apache.commons.collections.CollectionUtils;
import java.util.Arrays;
import java.util.HashMap;
......@@ -68,7 +71,8 @@ public class ServiceHGKC015A extends ServiceEPBase {
public EiInfo query(EiInfo inInfo) {
try {
Map queryMap = EiInfoUtils.getFirstRow(inInfo);
queryMap.remove("status");
queryMap.put(HGKC015A.FIELD_DELETE_FLAG, CommonConstant.YesNo.NO_0);
inInfo = super.query(inInfo, HGKC015A.QUERY, new HGKC015A());
} catch (PlatException e) {
LogUtils.setDetailMsg(inInfo, e, "查询失败");
......@@ -116,7 +120,22 @@ public class ServiceHGKC015A extends ServiceEPBase {
List<String> contractCodes = ObjectUtils.listEpKey(hgkc015List, HGKC015A.FIELD_CONTRACT_CODE);
List<HGSC010B> hgsc010Bs = HGSCTools.Hgsc010b.getByContractCode(contractCodes);
HGKCTools.HgKc015a.deleteByParentId(hgkc015List, hgsc010Bs);
if (CollectionUtils.isNotEmpty(hgkc015List)){
for (HGKC015A hgkc015A: hgkc015List) {
hgsc010Bs.stream().filter(hgsc010B ->
hgsc010B.getContractCode().equals(hgkc015A.getContractCode())
&& hgsc010B.getInventCode().equals(hgkc015A.getInventCode())
&& hgsc010B.getSpec().equals(hgkc015A.getSpec())
).forEach(hgsc010B -> {
hgsc010B.setRemainingQty(hgsc010B.getRemainingQty().add(hgkc015A.getOutQty()));
hgsc010B.setRemainingWeight(hgsc010B.getRemainingWeight().add(hgkc015A.getOutWeight()));
hgsc010B.setOutQty(hgsc010B.getOutQty().subtract(hgkc015A.getOutQty()));
hgsc010B.setOutWeight(hgsc010B.getOutWeight().subtract(hgkc015A.getOutWeight()));
DaoUtils.update(HGSC010B.UPDATE, hgsc010B);
});
DaoUtils.update(HGKC015A.DELETE, hgkc015A);
}
}
inInfo.setStatus(EiConstant.STATUS_SUCCESS);
inInfo.setMsgByKey("ep.1000", new String[]{String.valueOf(i), I18nMessages.getText("label.delete", "删除")});
......
......@@ -2,9 +2,12 @@ package com.baosight.hggp.hg.kc.service;
import com.baosight.hggp.aspect.annotation.OperationLogAnnotation;
import com.baosight.hggp.common.DdynamicEnum;
import com.baosight.hggp.core.constant.CommonConstant;
import com.baosight.hggp.core.dao.DaoUtils;
import com.baosight.hggp.core.security.UserSessionUtils;
import com.baosight.hggp.hg.kc.domain.HGKC014A;
import com.baosight.hggp.hg.kc.domain.HGKC015A;
import com.baosight.hggp.hg.kc.domain.HGKC015B;
import com.baosight.hggp.hg.kc.tools.HGKCTools;
import com.baosight.hggp.hg.sc.domain.HGSC010B;
import com.baosight.hggp.hg.xs.domain.Company;
......@@ -34,9 +37,9 @@ public class ServiceHGKC015B extends ServiceEPBase {
@Override
public EiInfo initLoad(EiInfo inInfo) {
try {
CommonMethod.initBlock(inInfo, Arrays.asList(DdynamicEnum.WH_RECORD_BLOCK_ID, DdynamicEnum.USER_BLOCK_ID,DdynamicEnum.INVENT_TYPE_BLOCK_ID));
CommonMethod.initBlock(inInfo, Arrays.asList(DdynamicEnum.WH_RECORD_BLOCK_ID, DdynamicEnum.SUP_RECORD_BLOCK_ID,DdynamicEnum.USER_BLOCK_ID,DdynamicEnum.INVENT_TYPE_BLOCK_ID));
EiInfoUtils.addBlock(inInfo,"roleCompany", UserSessionUtils.getRoleCompany(), Company.class);
inInfo.addBlock(EiConstant.resultBlock).addBlockMeta(new HGSC010B().eiMetadata);
inInfo.addBlock(EiConstant.resultBlock).addBlockMeta(new HGKC015B().eiMetadata);
} catch (Exception e) {
LogUtils.setDetailMsg(inInfo, e, "初始化失败");
}
......@@ -48,14 +51,16 @@ public class ServiceHGKC015B extends ServiceEPBase {
try {
Map queryMap = EiInfoUtils.getFirstRow(inInfo);
queryMap.put("isRemainingQty", "true");
queryMap.put("status", "1");
queryMap.remove("parentId");
inInfo = super.query(inInfo, HGSC010B.QUERY, new HGSC010B());
List<HGSC010B> resultBlock = MapUtils.toDaoEPBases(inInfo, HGSC010B.class);
resultBlock.forEach(hgsc010a -> {
hgsc010a.setOutQty(BigDecimal.ZERO);
hgsc010a.setOutWeight(BigDecimal.ZERO);
});
queryMap.put(HGKC015A.FIELD_DELETE_FLAG, CommonConstant.YesNo.NO_0);
inInfo = super.query(inInfo, HGKC015B.QUERY, new HGKC015B());
List<HGKC015B> resultBlock = MapUtils.toDaoEPBases(inInfo, HGKC015B.class);
if (resultBlock != null){
resultBlock.forEach(hgsc010a -> {
hgsc010a.setOutQty(BigDecimal.ZERO);
hgsc010a.setOutWeight(BigDecimal.ZERO);
});
}
inInfo.getBlock(EiConstant.resultBlock).setRows(resultBlock);
} catch (PlatException e) {
......@@ -95,8 +100,6 @@ public class ServiceHGKC015B extends ServiceEPBase {
DaoUtils.update(HGKC015A.UPDATE, kc015a);
}else {
hgkc015a.setParentId(Long.parseLong(paramMap.get("parentId").toString()));
hgkc015a.setCompanyCode(paramMap.get("companyCode").toString());
hgkc015a.setCompanyName(paramMap.get("companyName").toString());
hgkc015a.setWhCode(paramMap.get("whCode").toString());
hgkc015a.setWhName(paramMap.get("whName").toString());
hgkc015a.setOutCode(paramMap.get("outCode").toString());
......
......@@ -142,7 +142,7 @@
$orderBy$
</isNotEmpty>
<isEmpty property="orderBy">
ID asc
ID desc
</isEmpty>
</dynamic>
......
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE sqlMap PUBLIC "-//ibatis.apache.org//DTD SQL Map 2.0//EN" "http://ibatis.apache.org/dtd/sql-map-2.dtd">
<sqlMap namespace="HGKC014B">
<sql id="column">
A.ID as "id", <!-- ID -->
B.ACCOUNT_CODE as "accountCode", <!-- 账套 -->
B.DEP_CODE as "depCode", <!-- 部门编码 -->
B.DELETE_FLAG as "deleteFlag", <!-- 是否删除 0-否1-是 -->
B.COMPANY_CODE as "companyCode", <!-- 公司编码 -->
B.COMPANY_NAME as "companyName", <!-- 公司名称 -->
A.PARENT_ID as "parentId", <!-- 委托ID -->
B.CONTRACT_DATE as "contractDate", <!-- 委托日期 -->
B.CONTRACT_CODE as "contractCode", <!-- 委托单号 -->
B.SUP_CODE as "supCode", <!-- 供应商编码 -->
B.SUP_NAME as "supName", <!-- 供应商名称 -->
B.USER_ID as "userId", <!-- 申请人 -->
B.SUB_STATUS as "subStatus", <!-- 提交状态 0-未提交 1-已提交 -->
A.INVENT_TYPE as "inventType", <!-- 存货类型 -->
A.PRODUCT_CODE as "productCode", <!-- 成品编码 -->
A.PRODUCT_NAME as "productName", <!-- 成品名称 -->
A.SPEC_ID as "specId",
A.SPEC as "spec", <!-- 规格 -->
A.UNIT as "unit", <!-- 单位 -->
A.PCS_QTY as "pcsQty", <!-- 加工数量 -->
A.PCS_UNIT_WEIGHT as "pcsUnitWeight",
A.PCS_WEIGHT as "pcsWeight", <!-- 加工重量 -->
A.DEPOSIT_QTY as "depositQty", <!-- 入库数量 -->
A.DEPOSIT_UNIT_WEIGHT as "depositUnitWeight", <!-- 入库单量 -->
A.DEPOSIT_WEIGHT as "depositWeight", <!-- 入库重量 -->
A.REMAINING_QTY as "remainingQty", <!-- 剩余数量 -->
A.REMAINING_UNIT_WEIGHT as "remainingUnitWeight", <!-- 剩余单量 -->
A.REMAINING_WEIGHT as "remainingWeight", <!-- 剩余重量 -->
A.DELIVER_QTY as "deliverQty" <!-- 退货数量 -->
</sql>
<sql id="condition">
<include refid="HGXSDataAuth.authConditionA"/>
<isNotEmpty prepend=" AND " property="id">
A.ID = #id#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="deleteFlag">
B.DELETE_FLAG = #deleteFlag#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="companyCode">
B.COMPANY_CODE = #companyCode#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="companyName">
B.COMPANY_NAME = #companyName#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="parentId">
A.PARENT_ID = #parentId#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="contractCode">
B.CONTRACT_CODE LIKE CONCAT('%', #contractCode#, '%')
</isNotEmpty>
<isNotEmpty prepend=" AND " property="inventType">
A.INVENT_TYPE = #inventType#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="productCode">
A.PRODUCT_CODE = #productCode#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="productName">
A.PRODUCT_NAME = #productName#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="specId">
A.SPEC_ID = #specId#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="spec">
A.SPEC = #spec#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="unit">
A.UNIT = #unit#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="pcsQty">
A.PCS_QTY = #pcsQty#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="pcsWeight">
A.PCS_WEIGHT = #pcsWeight#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="depositQty">
A.DEPOSIT_QTY = #depositQty#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="depositWeight">
A.DEPOSIT_WEIGHT = #depositWeight#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="remainingQty">
A.REMAINING_QTY = #remainingQty#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="remainingWeight">
A.REMAINING_WEIGHT = #remainingWeight#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="parentIds">
A.PARENT_ID IN <iterate close=")" open="(" conjunction="," property="parentIds">#parentIds[]#</iterate>
</isNotEmpty>
<isNotEmpty prepend=" AND " property="contractCodes">
B.CONTRACT_CODE IN <iterate close=")" open="(" conjunction="," property="contractCodes">#contractCodes[]#</iterate>
</isNotEmpty>
<isNotEmpty prepend=" AND " property="isRemainingQty">
A.REMAINING_QTY > 0
</isNotEmpty>
<isNotEmpty prepend=" AND " property="startDate">
B.CONTRACT_DATE &gt;= REPLACE(#startDate#, '-', '')
</isNotEmpty>
<isNotEmpty prepend=" AND " property="endDate">
B.CONTRACT_DATE &lt;= REPLACE(#endDate#, '-', '')
</isNotEmpty>
<isNotEmpty prepend=" AND " property="supCode">
B.SUP_CODE = #supCode#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="supName">
B.SUP_NAME LIKE CONCAT('%', #supName#, '%')
</isNotEmpty>
<isNotEmpty prepend=" AND " property="userId">
B.USER_ID = #userId#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="subStatus">
B.SUB_STATUS = #subStatus#
</isNotEmpty>
</sql>
<sql id="idCondition">
<isNotEmpty prepend=" AND " property="id">
ID = #id#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="ids">
ID IN <iterate close=")" open="(" conjunction="," property="ids">#ids[]#</iterate>
</isNotEmpty>
</sql>
<select id="query" resultClass="com.baosight.hggp.hg.kc.domain.HGKC014B">
SELECT
<include refid="column"/>
FROM ${hggpSchema}.HGSC010A A JOIN ${hggpSchema}.HGSC010 B ON A.PARENT_ID = B.ID
WHERE 1=1
<include refid="condition"/>
<dynamic prepend="ORDER BY">
<isNotEmpty property="orderBy">
$orderBy$
</isNotEmpty>
<isEmpty property="orderBy">
B.CONTRACT_DATE DESC
</isEmpty>
</dynamic>
</select>
<select id="count" resultClass="int">
SELECT COUNT(*) FROM ${hggpSchema}.HGSC010A A JOIN ${hggpSchema}.HGSC010 B ON A.PARENT_ID = B.ID WHERE 1=1
<include refid="condition"/>
</select>
</sqlMap>
\ No newline at end of file
......@@ -148,7 +148,7 @@
$orderBy$
</isNotEmpty>
<isEmpty property="orderBy">
ID asc
ID desc
</isEmpty>
</dynamic>
......@@ -259,6 +259,13 @@
DELETE FROM ${hggpSchema}.HGKC015A WHERE ID = #id#
</delete>
<delete id="deleteByParentId">
DELETE FROM ${hggpSchema}.HGKC015A WHERE PARENT_ID = #parentId#
<isNotEmpty prepend=" AND " property="outCode">
OUT_CODE = #outCode#
</isNotEmpty>
</delete>
<update id="update">
UPDATE ${hggpSchema}.HGKC015A
SET
......
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE sqlMap PUBLIC "-//ibatis.apache.org//DTD SQL Map 2.0//EN" "http://ibatis.apache.org/dtd/sql-map-2.dtd">
<sqlMap namespace="HGKC015B">
<sql id="condition">
<include refid="HGXSDataAuth.authConditionA"/>
<isNotEmpty prepend=" AND " property="id">
A.ID = #id#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="deleteFlag">
B.DELETE_FLAG = #deleteFlag#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="companyCode">
B.COMPANY_CODE = #companyCode#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="companyName">
B.COMPANY_NAME = #companyName#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="parentId">
A.PARENT_ID = #parentId#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="contractCode">
B.CONTRACT_CODE LIKE CONCAT('%', #contractCode#, '%')
</isNotEmpty>
<isNotEmpty prepend=" AND " property="inventType">
A.INVENT_TYPE = #inventType#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="inventCode">
A.INVENT_CODE = #inventCode#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="inventName">
A.INVENT_NAME = #inventName#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="specId">
A.SPEC_ID = #specId#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="spec">
A.SPEC = #spec#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="unit">
A.UNIT = #unit#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="pcsQty">
A.PCS_QTY = #pcsQty#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="pcsWeight">
A.PCS_WEIGHT = #pcsWeight#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="outQty">
A.OUT_QTY = #outQty#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="outWeight">
A.OUT_WEIGHT = #outWeight#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="remainingQty">
A.REMAINING_QTY = #remainingQty#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="remainingWeight">
A.REMAINING_WEIGHT = #remainingWeight#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="parentIds">
A.PARENT_ID IN <iterate close=")" open="(" conjunction="," property="parentIds">#parentIds[]#</iterate>
</isNotEmpty>
<isNotEmpty prepend=" AND " property="contractCodes">
B.CONTRACT_CODE IN <iterate close=")" open="(" conjunction="," property="contractCodes">#contractCodes[]#</iterate>
</isNotEmpty>
<isNotEmpty prepend=" AND " property="isRemainingQty">
A.REMAINING_QTY > 0
</isNotEmpty>
<isNotEmpty prepend=" AND " property="startDate">
B.CONTRACT_DATE &gt;= REPLACE(#startDate#, '-', '')
</isNotEmpty>
<isNotEmpty prepend=" AND " property="endDate">
B.CONTRACT_DATE &lt;= REPLACE(#endDate#, '-', '')
</isNotEmpty>
<isNotEmpty prepend=" AND " property="supCode">
B.SUP_CODE = #supCode#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="supName">
B.SUP_NAME LIKE CONCAT('%', #supName#, '%')
</isNotEmpty>
<isNotEmpty prepend=" AND " property="userId">
B.USER_ID = #userId#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="subStatus">
B.SUB_STATUS = #subStatus#
</isNotEmpty>
</sql>
<select id="query" parameterClass="java.util.HashMap"
resultClass="com.baosight.hggp.hg.kc.domain.HGKC015B">
SELECT
A.ID as "id", <!-- ID -->
B.ACCOUNT_CODE as "accountCode", <!-- 账套 -->
B.DEP_CODE as "depCode", <!-- 部门编码 -->
B.DELETE_FLAG as "deleteFlag", <!-- 是否删除 0-否1-是 -->
B.COMPANY_CODE as "companyCode", <!-- 公司编码 -->
B.COMPANY_NAME as "companyName", <!-- 公司名称 -->
A.PARENT_ID as "parentId", <!-- 委托ID -->
B.CONTRACT_DATE as "contractDate", <!-- 委托日期 -->
B.CONTRACT_CODE as "contractCode", <!-- 委托单号 -->
B.SUP_CODE as "supCode", <!-- 供应商编码 -->
B.SUP_NAME as "supName", <!-- 供应商名称 -->
B.USER_ID as "userId", <!-- 申请人 -->
B.SUB_STATUS as "subStatus", <!-- 提交状态 0-未提交 1-已提交 -->
A.INVENT_TYPE as "inventType", <!-- 存货类型 -->
A.INVENT_CODE as "inventCode", <!-- 原料编码 -->
A.INVENT_NAME as "inventName", <!-- 原料名称 -->
A.SPEC_ID as "specId",
A.SPEC as "spec", <!-- 规格 -->
A.UNIT as "unit", <!-- 单位 -->
A.PCS_QTY as "pcsQty", <!-- 加工数量 -->
A.PCS_UNIT_WEIGHT as "pcsUnitWeight",
A.PCS_WEIGHT as "pcsWeight", <!-- 加工重量 -->
A.OUT_QTY as "outQty", <!-- 出库数量 -->
A.OUT_UNIT_WEIGHT as "outUnitWeight",
A.OUT_WEIGHT as "outWeight", <!-- 出库重量 -->
A.REMAINING_QTY as "remainingQty", <!-- 剩余数量 -->
A.REMAINING_UNIT_WEIGHT as "remainingUnitWeight",
A.REMAINING_WEIGHT as "remainingWeight" <!-- 剩余重量 -->
FROM ${hggpSchema}.HGSC010B A JOIN ${hggpSchema}.HGSC010 B ON A.PARENT_ID = B.ID WHERE 1=1
<include refid="condition" />
<dynamic prepend="ORDER BY">
<isNotEmpty property="orderBy">
$orderBy$
</isNotEmpty>
<isEmpty property="orderBy">
B.CONTRACT_DATE DESC
</isEmpty>
</dynamic>
</select>
<select id="count" resultClass="int">
SELECT COUNT(*) FROM ${hggpSchema}.HGSC010B A JOIN ${hggpSchema}.HGSC010 B ON A.PARENT_ID = B.ID WHERE 1=1
<include refid="condition" />
</select>
</sqlMap>
\ No newline at end of file
......@@ -66,7 +66,10 @@
<sqlMap resource="com/baosight/hggp/hg/kc/sql/HGKC013A.xml"/>
<sqlMap resource="com/baosight/hggp/hg/kc/sql/HGKC014.xml"/>
<sqlMap resource="com/baosight/hggp/hg/kc/sql/HGKC014A.xml"/>
<sqlMap resource="com/baosight/hggp/hg/kc/sql/HGKC014B.xml"/>
<sqlMap resource="com/baosight/hggp/hg/kc/sql/HGKC015.xml"/>
<sqlMap resource="com/baosight/hggp/hg/kc/sql/HGKC015A.xml"/>
<sqlMap resource="com/baosight/hggp/hg/kc/sql/HGKC015B.xml"/>
<!-- 质量 -->
<sqlMap resource="com/baosight/hggp/hg/zl/sql/HGZL001.xml"/>
......
......@@ -19,7 +19,13 @@ $(function () {
let template = '';
if (item.companyCode) {
template += '<a style="cursor: pointer;display: inline-flex;justify-content: center;margin:auto 5px" '
+ 'onclick="showFunc(\'' + item.companyCode + '\',\'' + item.companyName + '\',\'' + item.id + '\')" >详情</a>';
+ 'onclick="showFunc(\'' + item.companyCode + '\',' +
'\'' + item.companyName + '\',' +
'\'' + item.depositCode + '\',' +
'\'' + item.whCode + '\',' +
'\'' + item.whName + '\',' +
'\'' + item.id + '\',' +
'\'' + item.status + '\')" >详情</a>';
}
return template;
}
......@@ -35,13 +41,12 @@ $(function () {
],
beforeEdit: function (e) {
let item = e.model;
if(item.subStatus == '1'){
if(item.status != 0){
e.preventDefault();
}
},
loadComplete: function (grid) {
$("#BNT_SUBMIT").on("click", updateStatus);
$("#BNT_SELECT").on("click", selectFunc);
grid.dataSource.bind("change", function (e) {
if (e.field == "companyCode") {
for (let i = 0; i < companyCodeBox.length; i++) {
......@@ -93,15 +98,22 @@ let query = function () {
* 显示附件详情
* @param companyCode 公司编码
* @param companyName 公司名称
* @param depositCode
* @param whCode
* @param whName
* @param parentId 父级ID
* @param contractCode 委托编号
* @param status
*/
function showFunc(companyCode,companyName,parentId) {
function showFunc(companyCode,companyName,depositCode,whCode,whName,parentId,status) {
JSColorbox.open({
href: "HGKC014A?methodName=initLoad" +
"&inqu_status-0-companyCode=" + companyCode +
"&inqu_status-0-companyName=" + companyName +
"&inqu_status-0-parentId=" + parentId ,
"&inqu_status-0-whCode=" + whCode +
"&inqu_status-0-whName=" + whName +
"&inqu_status-0-depositCode=" + depositCode +
"&inqu_status-0-parentId=" + parentId +
"&inqu_status-0-status=" + status,
title: "<div style='text-align: center;'>委外入库详情</div>",
width: "90%",
height: "80%",
......@@ -118,47 +130,7 @@ function cancelFunc() {
JSColorbox.close();
}
/**
* 显示附件详情
* @param companyCode 公司编码
* @param companyName 公司名称
* @param parentId 父级ID
* @param contractCode 委托编号
*/
function selectFunc() {
let rows = resultGrid.getCheckedRows();
if (rows.length !== 1) {
message("请选择一条委外入库单");
return;
}
let flag = true;
rows.forEach(function (item,index){
if (item.status == '1'){
message("选中的第" + (index + 1) + "行\"状态\"\"已提交\",不能进行操作!");
flag = false;
return;
}
})
if (flag){
JSColorbox.open({
href: "HGKC014B?methodName=initLoad" +
"&inqu_status-0-companyCode=" + rows[0].companyCode +
"&inqu_status-0-companyName=" + rows[0].companyName +
"&inqu_status-0-whCode=" + rows[0].whCode +
"&inqu_status-0-whName=" + rows[0].whName +
"&inqu_status-0-depositCode=" + rows[0].depositCode +
"&inqu_status-0-parentId=" + rows[0].id ,
title: "<div style='text-align: center;'>委外入库详情</div>",
width: "90%",
height: "80%",
callbackName: function (){
// 关闭弹窗
JSColorbox.close();
}
});
}
}
let save = function (btnNode) {
let rows = resultGrid.getCheckedRows();
......
......@@ -38,6 +38,7 @@ $(function () {
}
],
loadComplete: function (grid) {
$("#BNT_SELECT").on("click", selectFunc);
grid.dataSource.bind("change", function (e) {
if (e.field == "productCode") {
for (let i = 0; i < inventRecordBox.length; i++) {
......@@ -73,8 +74,8 @@ $(function () {
}
}
}
})
/**
* 页面加载时执行
*/
......@@ -120,5 +121,40 @@ let saveResult = function (btnNode) {
};
/**
* 选择委外加工
* @param companyCode 公司编码
* @param companyName 公司名称
* @param parentId 父级ID
* @param contractCode 委托编号
*/
function selectFunc() {
let status = $("#inqu_status-0-status").val();
let flag = true;
if (status != 0) {
message("委外入库单已提交,无法选择委外加工!");
flag = false;
}
if (flag){
JSColorbox.open({
href: "HGKC014B?methodName=initLoad" +
"&inqu_status-0-companyCode=" + $("#inqu_status-0-companyCode").val() +
"&inqu_status-0-companyName=" + $("#inqu_status-0-companyName").val() +
"&inqu_status-0-whCode=" + $("#inqu_status-0-whCode").val() +
"&inqu_status-0-whName=" + $("#inqu_status-0-whName").val() +
"&inqu_status-0-depositCode=" + $("#inqu_status-0-depositCode").val() +
"&inqu_status-0-parentId=" + $("#inqu_status-0-parentId").val() ,
title: "<div style='text-align: center;'>选择委外加工</div>",
width: "95%",
height: "90%",
callbackName: function (){
// 关闭弹窗
JSColorbox.close();
query();
}
});
}
}
......@@ -16,12 +16,26 @@
</script>
<EF:EFPage title="委外入库明细">
<EF:EFRegion id="result" title="成本信息">
<EF:EFRegion id="inqu" title="查询条件" showClear="true">
<EF:EFInput blockId="inqu_status" row="0" ename="parentId" cname="委托ID" type="hidden"/>
<EF:EFInput blockId="inqu_status" row="0" ename="companyCode" cname="公司编码" type="hidden"/>
<EF:EFInput blockId="inqu_status" row="0" ename="companyName" cname="公司名称" type="hidden"/>
<EF:EFInput blockId="inqu_status" row="0" ename="depositDate" cname="委外入库单号" type="hidden"/>
<EF:EFInput blockId="inqu_status" row="0" colWidth="3" ename="companyName" cname="公司名称" />
<EF:EFInput blockId="inqu_status" row="0" ename="whCode" cname="仓库编码" type="hidden"/>
<EF:EFInput blockId="inqu_status" row="0" colWidth="3" ename="whName" cname="仓库名称" />
<EF:EFInput blockId="inqu_status" row="0" ename="depositCode" cname="委外入库单号" type="hidden"/>
<EF:EFInput blockId="inqu_status" row="0" ename="status" cname="状态" type="hidden"/>
<EF:EFSelect blockId="inqu_status" row="0" colWidth="3" ename="productCode" cname="成品名称"
required="true" filter="contains">
<EF:EFOption label="请选择" value=""/>
<EF:EFOptions blockId="invent_record_box_block_id" textField="textField" valueField="valueField"/>
</EF:EFSelect>
<EF:EFSelect blockId="inqu_status" row="0" colWidth="3" ename="inventType" cname="存货类型"
required="true" filter="contains">
<EF:EFOption label="请选择" value=""/>
<EF:EFOptions blockId="invent_type_block_id" textField="textField" valueField="valueField"/>
</EF:EFSelect>
</EF:EFRegion>
<EF:EFRegion id="result" title="成本信息">
<EF:EFGrid blockId="result" autoDraw="override" isFloat="true">
<EF:EFColumn ename="id" primaryKey="true" cname="内码" hidden="true"/>
<EF:EFComboColumn ename="productCode" cname="成品编码" width="120" align="center" required="true" readonly="false"
......
......@@ -89,7 +89,6 @@ $(function () {
$(window).load(function () {
// 查询
query();
$("#depositDate").val(currShortDate);
});
let query = function () {
......@@ -130,7 +129,7 @@ let saveResult = function () {
function (e) {
let status = e.getStatus();
if (status !== -1) {
parent.JSColorbox.close()
parent.JSColorbox.setValueCallback()
}
});
}
......
......@@ -19,16 +19,67 @@
var ctx = "${ctx}";
</script>
<EF:EFPage title="选择委外加工">
<EF:EFRegion id="result" title="委外加工">
<EF:EFInput blockId="inqu_status" row="0" ename="companyCode" cname="公司编码" type="hidden"/>
<EF:EFInput blockId="inqu_status" row="0" ename="companyName" cname="公司编码" type="hidden"/>
<EF:EFRegion id="inqu" title="查询条件" showClear="true">
<EF:EFSelect blockId="inqu_status" row="0" ename="companyCode" cname="公司名称" colWidth="3" filter="contains" readonly="true">
<EF:EFOption label="全部" value=""/>
<EF:EFOptions blockId="roleCompany" textField="companyName" valueField="companyCode"/>
</EF:EFSelect>
<EF:EFDateSpan startCname="委外加工日期" endCname="至" blockId="inqu_status"
startName="startDate" endName="endDate" row="0" role="date"
format="yyyy-MM-dd" ratio="3:3" satrtRatio="4:8" endRatio="4:8" readonly="false">
</EF:EFDateSpan>
<EF:EFInput blockId="inqu_status" row="0" ename="contractCode" cname="委外单号" placeholder="模糊查询" colWidth="3"/>
<EF:EFSelect blockId="inqu_status" row="0" ename="supCode" cname="供应商名称" colWidth="3" filter="contains">
<EF:EFOption label="全部" value=""/>
<EF:EFOptions blockId="sup_record_block_id" textField="textField" valueField="valueField"/>
</EF:EFSelect>
<EF:EFSelect blockId="inqu_status" row="0" ename="userId" cname="申请人" colWidth="3" filter="contains">
<EF:EFOption label="全部" value=""/>
<EF:EFOptions blockId="user_block_id" textField="textField" valueField="valueField"/>
</EF:EFSelect>
<EF:EFSelect blockId="inqu_status" row="0" ename="subStatus" cname="提交状态" colWidth="3" filter="contains" defaultValue="1" readonly="true">
<EF:EFCodeOption codeName="hggp.hpkc.submitStatus"/>
</EF:EFSelect>
<EF:EFInput blockId="inqu_status" row="0" ename="whCode" cname="仓库编码" type="hidden"/>
<EF:EFInput blockId="inqu_status" row="0" ename="whName" cname="仓库名称" type="hidden"/>
<EF:EFInput blockId="inqu_status" row="0" ename="parentId" cname="上级ID" type="hidden"/>
<EF:EFInput blockId="inqu_status" row="0" ename="depositCode" cname="委外入库单号" type="hidden"/>
</EF:EFRegion>
<EF:EFRegion id="result" title="委外加工">
<EF:EFGrid blockId="result" autoDraw="override" checkMode="row" isFloat="true" copyToAdd="false">
<EF:EFColumn ename="id" primaryKey="true" cname="内码" hidden="true"/>
<%--<EF:EFComboColumn ename="companyCode" cname="公司名称"
columnTemplate="#=companyName#" itemTemplate="#=companyName#"
textField="companyName" valueField="companyCode"
maxLength="16" readonly="false" width="200" required="true"
align="center" filter="contains" sort="true">
<EF:EFOptions blockId="roleCompany" textField="companyName" valueField="companyCode"/>
</EF:EFComboColumn>--%>
<EF:EFColumn ename="companyCode" cname="公司编码" width="120" hidden="true"/>
<EF:EFColumn ename="companyName" cname="公司名称" align="center" width="200"/>
<EF:EFColumn ename="contractDate" cname="委外加工日期" width="120" enable="true" readonly="false" align="center" editType="date"
dateFormat="yyyy-MM-dd" parseFormats="['yyyyMMdd']" required="false"/>
<EF:EFColumn ename="contractCode" cname="委外单号" width="120" enable="false" readonly="false" align="center"/>
<%--<EF:EFComboColumn ename="supCode" cname="供应商名称"
columnTemplate="#=textField#" itemTemplate="#=textField#"
textField="textField" valueField="valueField"
maxLength="16" readonly="false" width="200" required="true"
align="center" filter="contains" sort="true">
<EF:EFOptions blockId="sup_record_block_id" textField="textField" valueField="valueField"/>
</EF:EFComboColumn>--%>
<EF:EFColumn ename="supCode" cname="供应商编码" width="120" hidden="true"/>
<EF:EFColumn ename="supName" cname="供应商名称" align="center" width="120" />
<EF:EFComboColumn ename="userId" cname="申请人" defaultValue="${loginName}"
columnTemplate="#=textField#" itemTemplate="#=textField#"
textField="textField" valueField="valueField"
maxLength="16" readonly="false" width="100" required="false"
align="center" filter="contains" sort="true">
<EF:EFOptions blockId="user_block_id" textField="textField" valueField="valueField"/>
</EF:EFComboColumn>
<EF:EFComboColumn ename="subStatus" cname="提交状态" width="80" enable="true" readonly="true" align="center"
required="false" defaultValue="0">
<EF:EFCodeOption codeName="hggp.hpkc.submitStatus"/>
</EF:EFComboColumn>
<EF:EFComboColumn ename="productCode" cname="成品编码" width="120" align="center" required="true" readonly="true"
blockName="invent_record_box_block_id" textField="textField" valueField="valueField"
columnTemplate="#=textField#" itemTemplate="#=textField#"
......
......@@ -19,7 +19,7 @@ $(function () {
let template = '';
if (item.companyCode) {
template += '<a style="cursor: pointer;display: inline-flex;justify-content: center;margin:auto 5px" '
+ 'onclick="showFunc(\'' + item.companyCode + '\',\'' + item.companyName + '\',\'' + item.id + '\')" >详情</a>';
+ 'onclick="showFunc(\'' + item.companyCode + '\',\'' + item.companyName + '\',\'' + item.outCode + '\',\'' + item.whCode + '\',\'' + item.whName + '\',\'' + item.id + '\',\'' + item.status + '\')" >详情</a>';
}
return template;
}
......@@ -35,13 +35,13 @@ $(function () {
],
beforeEdit: function (e) {
let item = e.model;
if(item.Status == '1'){
if(item.status != '0'){
e.preventDefault();
}
},
loadComplete: function (grid) {
$("#BNT_SUBMIT").on("click", updateStatus);
$("#BNT_SELECT").on("click", selectFunc);
grid.dataSource.bind("change", function (e) {
if (e.field == "companyCode") {
for (let i = 0; i < companyCodeBox.length; i++) {
......@@ -100,15 +100,21 @@ let query = function () {
* 显示附件详情
* @param companyCode 公司编码
* @param companyName 公司名称
* @param outCode 出库单号
* @param whCode
* @param whName
* @param parentId 父级ID
* @param contractCode 委托编号
*/
function showFunc(companyCode,companyName,parentId) {
function showFunc(companyCode,companyName,outCode,whCode,whName,parentId,status) {
JSColorbox.open({
href: "HGKC015A?methodName=initLoad" +
"&inqu_status-0-companyCode=" + companyCode +
"&inqu_status-0-companyName=" + companyName +
"&inqu_status-0-parentId=" + parentId ,
"&inqu_status-0-whCode=" + whCode +
"&inqu_status-0-whName=" + whName +
"&inqu_status-0-outCode=" + outCode +
"&inqu_status-0-parentId=" + parentId+
"&inqu_status-0-status=" + status,
title: "<div style='text-align: center;'>委外出库详情</div>",
width: "90%",
height: "80%",
......@@ -125,46 +131,6 @@ function cancelFunc() {
JSColorbox.close();
}
/**
* 显示附件详情
* @param companyCode 公司编码
* @param companyName 公司名称
* @param parentId 父级ID
* @param contractCode 委托编号
*/
function selectFunc() {
let rows = resultGrid.getCheckedRows();
if (rows.length !== 1) {
message("请选择一条委外入库单");
return;
}
let flag = true;
rows.forEach(function (item,index){
if (item.status == '1'){
message("选中的第" + (index + 1) + "行\"状态\"\"已提交\",不能进行操作!");
flag = false;
return;
}
})
if (flag){
JSColorbox.open({
href: "HGKC015B?methodName=initLoad" +
"&inqu_status-0-companyCode=" + rows[0].companyCode +
"&inqu_status-0-companyName=" + rows[0].companyName +
"&inqu_status-0-whCode=" + rows[0].whCode +
"&inqu_status-0-whName=" + rows[0].whName +
"&inqu_status-0-outCode=" + rows[0].outCode +
"&inqu_status-0-parentId=" + rows[0].id ,
title: "<div style='text-align: center;'>委外出库详情</div>",
width: "90%",
height: "80%",
callbackName: function (){
// 关闭弹窗
JSColorbox.close();
}
});
}
}
let save = function (btnNode) {
let rows = resultGrid.getCheckedRows();
......
......@@ -38,6 +38,7 @@ $(function () {
}
],
loadComplete: function (grid) {
$("#BNT_SELECT").on("click", selectFunc);
grid.dataSource.bind("change", function (e) {
if (e.field == "inventCode") {
for (let i = 0; i < inventRecordBox.length; i++) {
......@@ -87,6 +88,10 @@ let query = function () {
resultGrid.dataSource.page(1);
}
/**
* 保存
* @param btnNode
*/
let saveResult = function (btnNode) {
let rows = resultGrid.getCheckedRows();
if (rows.length < 1) {
......@@ -120,5 +125,41 @@ let saveResult = function (btnNode) {
};
/**
* 选择委外加工
* @param companyCode 公司编码
* @param companyName 公司名称
* @param parentId 父级ID
* @param contractCode 委托编号
*/
function selectFunc() {
let status = $("#inqu_status-0-status").val();
let flag = true;
if (status != 0) {
message("委外入库单已提交,无法选择委外加工!");
flag = false;
}
if (flag){
JSColorbox.open({
href: "HGKC015B?methodName=initLoad" +
"&inqu_status-0-companyCode=" + $("#inqu_status-0-companyCode").val() +
"&inqu_status-0-companyName=" + $("#inqu_status-0-companyName").val() +
"&inqu_status-0-whCode=" + $("#inqu_status-0-whCode").val() +
"&inqu_status-0-whName=" + $("#inqu_status-0-whName").val() +
"&inqu_status-0-outCode=" + $("#inqu_status-0-outCode").val() +
"&inqu_status-0-parentId=" + $("#inqu_status-0-parentId").val() ,
title: "<div style='text-align: center;'>选择委外加工</div>",
width: "95%",
height: "90%",
callbackName: function (){
// 关闭弹窗
JSColorbox.close();
query();
}
});
}
}
......@@ -15,15 +15,29 @@
var ctx = "${ctx}";
</script>
<EF:EFPage title="委外出库明细">
<EF:EFRegion id="result" title="成本信息">
<EF:EFRegion id="inqu" title="查询条件" showClear="true">
<EF:EFInput blockId="inqu_status" row="0" ename="parentId" cname="委托ID" type="hidden"/>
<EF:EFInput blockId="inqu_status" row="0" ename="companyCode" cname="公司编码" type="hidden"/>
<EF:EFInput blockId="inqu_status" row="0" ename="companyName" cname="公司名称" type="hidden"/>
<EF:EFInput blockId="inqu_status" row="0" ename="outDate" cname="委外入库单号" type="hidden"/>
<EF:EFInput blockId="inqu_status" row="0" ename="companyName" colWidth="3" cname="公司名称"/>
<EF:EFInput blockId="inqu_status" row="0" ename="whCode" cname="仓库编码" type="hidden"/>
<EF:EFInput blockId="inqu_status" row="0" ename="whName" colWidth="3" cname="仓库名称"/>
<EF:EFInput blockId="inqu_status" row="0" ename="outCode" cname="委外出库单号" type="hidden"/>
<EF:EFInput blockId="inqu_status" row="0" ename="status" cname="状态" type="hidden"/>
<EF:EFSelect blockId="inqu_status" row="0" colWidth="3" ename="inventCode" cname="原料名称"
required="true" filter="contains">
<EF:EFOption label="请选择" value=""/>
<EF:EFOptions blockId="invent_record_box_block_id" textField="textField" valueField="valueField"/>
</EF:EFSelect>
<EF:EFSelect blockId="inqu_status" row="0" colWidth="3" ename="inventType" cname="存货类型"
required="true" filter="contains">
<EF:EFOption label="请选择" value=""/>
<EF:EFOptions blockId="invent_type_block_id" textField="textField" valueField="valueField"/>
</EF:EFSelect>
</EF:EFRegion>
<EF:EFRegion id="result" title="成本信息">
<EF:EFGrid blockId="result" autoDraw="override" isFloat="true">
<EF:EFColumn ename="id" primaryKey="true" cname="内码" hidden="true"/>
<EF:EFColumn ename="parentId" cname="内码" hidden="true"/>
<EF:EFComboColumn ename="inventCode" cname="原料编码" width="120" align="center" required="true" readonly="false"
blockName="invent_record_box_block_id" textField="textField" valueField="valueField"
columnTemplate="#=textField#" itemTemplate="#=textField#"
......
......@@ -129,7 +129,7 @@ let saveResult = function () {
function (e) {
let status = e.getStatus();
if (status !== -1) {
parent.JSColorbox.close()
parent.JSColorbox.setValueCallback()
}
});
}
......
......@@ -18,16 +18,54 @@
var ctx = "${ctx}";
</script>
<EF:EFPage title="选择委外加工">
<EF:EFRegion id="result" title="委外加工">
<EF:EFInput blockId="inqu_status" row="0" ename="companyCode" cname="公司编码" type="hidden"/>
<EF:EFInput blockId="inqu_status" row="0" ename="companyName" cname="公司编码" type="hidden"/>
<EF:EFRegion id="inqu" title="查询条件" showClear="true">
<EF:EFSelect blockId="inqu_status" row="0" ename="companyCode" cname="公司名称" colWidth="3" filter="contains">
<EF:EFOption label="全部" value=""/>
<EF:EFOptions blockId="roleCompany" textField="companyName" valueField="companyCode"/>
</EF:EFSelect>
<EF:EFDateSpan startCname="委外加工日期" endCname="至" blockId="inqu_status"
startName="startDate" endName="endDate" row="0" role="date"
format="yyyy-MM-dd" ratio="3:3" satrtRatio="4:8" endRatio="4:8" readonly="false">
</EF:EFDateSpan>
<EF:EFInput blockId="inqu_status" row="0" ename="contractCode" cname="委外单号" placeholder="模糊查询" colWidth="3"/>
<EF:EFSelect blockId="inqu_status" row="0" ename="supCode" cname="供应商名称" colWidth="3" filter="contains">
<EF:EFOption label="全部" value=""/>
<EF:EFOptions blockId="sup_record_block_id" textField="textField" valueField="valueField"/>
</EF:EFSelect>
<EF:EFSelect blockId="inqu_status" row="0" ename="userId" cname="申请人" colWidth="3" filter="contains">
<EF:EFOption label="全部" value=""/>
<EF:EFOptions blockId="user_block_id" textField="textField" valueField="valueField"/>
</EF:EFSelect>
<EF:EFSelect blockId="inqu_status" row="0" ename="subStatus" cname="提交状态" colWidth="3" filter="contains" readonly="true" defaultValue="1">
<EF:EFOption label="全部" value=""/>
<EF:EFCodeOption codeName="hggp.hpkc.submitStatus"/>
</EF:EFSelect>
<EF:EFInput blockId="inqu_status" row="0" ename="whCode" cname="仓库编码" type="hidden"/>
<EF:EFInput blockId="inqu_status" row="0" ename="whName" cname="仓库名称" type="hidden"/>
<EF:EFInput blockId="inqu_status" row="0" ename="parentId" cname="上级ID" type="hidden"/>
<EF:EFInput blockId="inqu_status" row="0" ename="outCode" cname="委外出库单号" type="hidden"/>
</EF:EFRegion>
<EF:EFRegion id="result" title="委外加工">
<EF:EFGrid blockId="result" autoDraw="override" checkMode="row" isFloat="true" copyToAdd="false">
<EF:EFColumn ename="id" primaryKey="true" cname="内码" hidden="true"/>
<EF:EFColumn ename="companyCode" cname="公司编码" width="120" hidden="true"/>
<EF:EFColumn ename="companyName" cname="公司名称" align="center" width="200"/>
<EF:EFColumn ename="contractDate" cname="委外加工日期" width="120" enable="true" readonly="false" align="center" editType="date"
dateFormat="yyyy-MM-dd" parseFormats="['yyyyMMdd']" required="true"/>
<EF:EFColumn ename="contractCode" cname="委外单号" width="120" enable="false" readonly="false" align="center"/>
<EF:EFColumn ename="supCode" cname="供应商编码" width="120" hidden="true"/>
<EF:EFColumn ename="supName" cname="供应商名称" align="center" width="120" />
<EF:EFComboColumn ename="userId" cname="申请人" defaultValue="${loginName}"
columnTemplate="#=textField#" itemTemplate="#=textField#"
textField="textField" valueField="valueField"
maxLength="16" readonly="false" width="100" required="true"
align="center" filter="contains" sort="true">
<EF:EFOptions blockId="user_block_id" textField="textField" valueField="valueField"/>
</EF:EFComboColumn>
<EF:EFComboColumn ename="subStatus" cname="提交状态" width="80" enable="true" readonly="true" align="center"
required="false" defaultValue="0">
<EF:EFCodeOption codeName="hggp.hpkc.submitStatus"/>
</EF:EFComboColumn>
<EF:EFComboColumn ename="inventCode" cname="原料编码" width="120" align="center" required="true" readonly="true"
blockName="invent_record_box_block_id" textField="textField" valueField="valueField"
columnTemplate="#=textField#" itemTemplate="#=textField#"
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment