Commit 83e9b103 by 宋祥

1.生产领料页面优化,增加查询条件

parent 3825520d
...@@ -42,6 +42,8 @@ public class HGKC008 extends DaoEPBase { ...@@ -42,6 +42,8 @@ public class HGKC008 extends DaoEPBase {
public static final String FIELD_RECEIVE_TYPE = "receiveType"; /* 领料单类型 0:正常,1:退库*/ public static final String FIELD_RECEIVE_TYPE = "receiveType"; /* 领料单类型 0:正常,1:退库*/
public static final String FIELD_PROJ_CODE = "projCode"; /* 项目编码*/ public static final String FIELD_PROJ_CODE = "projCode"; /* 项目编码*/
public static final String FIELD_PROJ_NAME = "projName"; /* 项目名称*/ public static final String FIELD_PROJ_NAME = "projName"; /* 项目名称*/
public static final String FIELD_RECEIVE_USER_ID = "receiveUserId"; /* 领用人ID*/
public static final String FIELD_RECEIVE_USER_NAME = "receiveUserName"; /* 领用人姓名*/
public static final String COL_ID = "ID"; /* 主键id*/ public static final String COL_ID = "ID"; /* 主键id*/
public static final String COL_ACCOUNT_CODE = "ACCOUNT_CODE"; /* 账套*/ public static final String COL_ACCOUNT_CODE = "ACCOUNT_CODE"; /* 账套*/
...@@ -63,6 +65,8 @@ public class HGKC008 extends DaoEPBase { ...@@ -63,6 +65,8 @@ public class HGKC008 extends DaoEPBase {
public static final String COL_RECEIVE_TYPE = "RECEIVE_TYPE"; /* 领料单类型 0:正常,1:退库*/ public static final String COL_RECEIVE_TYPE = "RECEIVE_TYPE"; /* 领料单类型 0:正常,1:退库*/
public static final String COL_PROJ_CODE = "PROJ_CODE"; /* 项目编码*/ public static final String COL_PROJ_CODE = "PROJ_CODE"; /* 项目编码*/
public static final String COL_PROJ_NAME = "PROJ_NAME"; /* 项目名称*/ public static final String COL_PROJ_NAME = "PROJ_NAME"; /* 项目名称*/
public static final String COL_RECEIVE_USER_ID = "RECEIVE_USER_ID"; /* 领用人ID*/
public static final String COL_RECEIVE_USER_NAME = "RECEIVE_USER_NAME"; /* 领用人姓名*/
public static final String QUERY = "HGKC008.query"; public static final String QUERY = "HGKC008.query";
public static final String COUNT = "HGKC008.count"; public static final String COUNT = "HGKC008.count";
...@@ -93,6 +97,8 @@ public class HGKC008 extends DaoEPBase { ...@@ -93,6 +97,8 @@ public class HGKC008 extends DaoEPBase {
private Integer receiveType = new Integer(0); /* 领料单类型 0:正常,1:退库*/ private Integer receiveType = new Integer(0); /* 领料单类型 0:正常,1:退库*/
private String projCode = " "; /* 项目编码*/ private String projCode = " "; /* 项目编码*/
private String projName = " "; /* 项目名称*/ private String projName = " "; /* 项目名称*/
private String receiveUserId = " "; /* 领用人ID*/
private String receiveUserName = " "; /* 领用人姓名*/
/** /**
* initialize the metadata. * initialize the metadata.
...@@ -179,8 +185,14 @@ public class HGKC008 extends DaoEPBase { ...@@ -179,8 +185,14 @@ public class HGKC008 extends DaoEPBase {
eiColumn = new EiColumn(FIELD_PROJ_NAME); eiColumn = new EiColumn(FIELD_PROJ_NAME);
eiColumn.setDescName("项目名称"); eiColumn.setDescName("项目名称");
eiMetadata.addMeta(eiColumn); eiMetadata.addMeta(eiColumn);
eiColumn = new EiColumn(FIELD_RECEIVE_USER_ID);
eiColumn.setDescName("领用人ID");
eiMetadata.addMeta(eiColumn);
eiColumn = new EiColumn(FIELD_RECEIVE_USER_NAME);
eiColumn.setDescName("领用人姓名");
eiMetadata.addMeta(eiColumn);
} }
/** /**
...@@ -494,7 +506,23 @@ public class HGKC008 extends DaoEPBase { ...@@ -494,7 +506,23 @@ public class HGKC008 extends DaoEPBase {
public void setProjName(String projName) { public void setProjName(String projName) {
this.projName = projName; this.projName = projName;
} }
public String getReceiveUserId() {
return receiveUserId;
}
public void setReceiveUserId(String receiveUserId) {
this.receiveUserId = receiveUserId;
}
public String getReceiveUserName() {
return receiveUserName;
}
public void setReceiveUserName(String receiveUserName) {
this.receiveUserName = receiveUserName;
}
/** /**
* get the value from Map. * get the value from Map.
* *
...@@ -523,6 +551,8 @@ public class HGKC008 extends DaoEPBase { ...@@ -523,6 +551,8 @@ public class HGKC008 extends DaoEPBase {
setReceiveType(NumberUtils.toInteger(StringUtils.toString(map.get(FIELD_RECEIVE_TYPE)), receiveType)); setReceiveType(NumberUtils.toInteger(StringUtils.toString(map.get(FIELD_RECEIVE_TYPE)), receiveType));
setProjCode(StringUtils.defaultIfEmpty(StringUtils.toString(map.get(FIELD_PROJ_CODE)), projCode)); setProjCode(StringUtils.defaultIfEmpty(StringUtils.toString(map.get(FIELD_PROJ_CODE)), projCode));
setProjName(StringUtils.defaultIfEmpty(StringUtils.toString(map.get(FIELD_PROJ_NAME)), projName)); setProjName(StringUtils.defaultIfEmpty(StringUtils.toString(map.get(FIELD_PROJ_NAME)), projName));
setReceiveUserId(StringUtils.defaultIfEmpty(StringUtils.toString(map.get(FIELD_RECEIVE_USER_ID)), receiveUserId));
setReceiveUserName(StringUtils.defaultIfEmpty(StringUtils.toString(map.get(FIELD_RECEIVE_USER_NAME)), receiveUserName));
} }
/** /**
...@@ -552,6 +582,8 @@ public class HGKC008 extends DaoEPBase { ...@@ -552,6 +582,8 @@ public class HGKC008 extends DaoEPBase {
map.put(FIELD_RECEIVE_TYPE, StringUtils.toString(receiveType, eiMetadata.getMeta(FIELD_RECEIVE_TYPE))); map.put(FIELD_RECEIVE_TYPE, StringUtils.toString(receiveType, eiMetadata.getMeta(FIELD_RECEIVE_TYPE)));
map.put(FIELD_PROJ_CODE, StringUtils.toString(projCode, eiMetadata.getMeta(FIELD_PROJ_CODE))); map.put(FIELD_PROJ_CODE, StringUtils.toString(projCode, eiMetadata.getMeta(FIELD_PROJ_CODE)));
map.put(FIELD_PROJ_NAME, StringUtils.toString(projName, eiMetadata.getMeta(FIELD_PROJ_NAME))); map.put(FIELD_PROJ_NAME, StringUtils.toString(projName, eiMetadata.getMeta(FIELD_PROJ_NAME)));
map.put(FIELD_RECEIVE_USER_ID, StringUtils.toString(receiveUserId, eiMetadata.getMeta(FIELD_RECEIVE_USER_ID)));
map.put(FIELD_RECEIVE_USER_NAME, StringUtils.toString(receiveUserName, eiMetadata.getMeta(FIELD_RECEIVE_USER_NAME)));
return map; return map;
} }
......
package com.baosight.hggp.hg.kc.domain;
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.math.BigDecimal;
import java.util.HashMap;
import java.util.Map;
/**
* Project: <br>
* Title:Hgkc010.java <br>
* Description: <br>
*
* Copyrigth:Baosight Software LTD.co Copyright (c) 2019. <br>
*
* @version 1.0
* @history 2024-05-13 15:39:23 create
*/
public class HGKC010B extends HGKC010 {
public static final String FIELD_APPLY_QTY = "applyQty"; /* 申请数量*/
public static final String COL_APPLY_QTY = "APPLY_QTY"; /* 申请数量*/
private BigDecimal applyQty = new BigDecimal(0.000); /* 申请数量*/
/**
* initialize the metadata.
*/
public void initMetaData() {
EiColumn eiColumn;
eiColumn = new EiColumn(FIELD_APPLY_QTY);
eiColumn.setType("N");
eiColumn.setScaleLength(0);
eiColumn.setFieldLength(15);
eiColumn.setDescName("申请数量");
eiMetadata.addMeta(eiColumn);
}
/**
* the constructor.
*/
public HGKC010B() {
super.initMetaData();
initMetaData();
}
public BigDecimal getApplyQty() {
return applyQty;
}
public void setApplyQty(BigDecimal applyQty) {
this.applyQty = applyQty;
}
/**
* get the value from Map.
*
* @param map - source data map
*/
@Override
public void fromMap(Map map) {
super.fromMap(map);
setApplyQty(NumberUtils.toBigDecimal(StringUtils.toString(map.get(FIELD_APPLY_QTY)), applyQty));
}
/**
* set the value to Map.
*/
@Override
public Map toMap() {
Map map = super.toMap();
map.put(FIELD_APPLY_QTY, StringUtils.toString(applyQty, eiMetadata.getMeta(FIELD_APPLY_QTY)));
return map;
}
}
...@@ -17,6 +17,7 @@ import com.baosight.hggp.util.CommonMethod; ...@@ -17,6 +17,7 @@ import com.baosight.hggp.util.CommonMethod;
import com.baosight.hggp.util.EiInfoUtils; import com.baosight.hggp.util.EiInfoUtils;
import com.baosight.hggp.util.ErrorCodeUtils; import com.baosight.hggp.util.ErrorCodeUtils;
import com.baosight.hggp.util.LogUtils; import com.baosight.hggp.util.LogUtils;
import com.baosight.hggp.util.MapUtils;
import com.baosight.hggp.util.ObjectUtils; import com.baosight.hggp.util.ObjectUtils;
import com.baosight.hggp.util.contants.ACConstants; import com.baosight.hggp.util.contants.ACConstants;
import com.baosight.iplat4j.core.ei.EiBlock; import com.baosight.iplat4j.core.ei.EiBlock;
...@@ -35,7 +36,6 @@ import java.util.List; ...@@ -35,7 +36,6 @@ import java.util.List;
import java.util.Map; import java.util.Map;
import java.util.Objects; import java.util.Objects;
/** /**
* @Author jhs * @Author jhs
* @Date 2024/5/14 14:46 * @Date 2024/5/14 14:46
...@@ -44,12 +44,12 @@ public class ServiceHGKC008 extends ServiceBase { ...@@ -44,12 +44,12 @@ public class ServiceHGKC008 extends ServiceBase {
public EiInfo initLoad(EiInfo inInfo) { public EiInfo initLoad(EiInfo inInfo) {
try { try {
inInfo = super.query(inInfo, HGKC008.QUERY, new HGKC008()); inInfo = super.query(inInfo, HGKC008.QUERY, new HGKC008());
Map map = new HashMap(); Map map = new HashMap();
map.put(HGKC008.FIELD_ACCOUNT_CODE, UserSessionUtils.getAccountCode()); map.put(HGKC008.FIELD_ACCOUNT_CODE, UserSessionUtils.getAccountCode());
CommonMethod.initBlock(inInfo, CommonMethod.initBlock(inInfo, Arrays.asList(DdynamicEnum.COMPANY_BOX_BLOCK_ID,
Arrays.asList(DdynamicEnum.COMPANY_BOX_BLOCK_ID, DdynamicEnum.PROJ_RECORD_BY_ROLE_BLOCK_ID, DdynamicEnum.PROJ_RECORD_BY_ROLE_BLOCK_ID, DdynamicEnum.WH_RECORD_BLOCK_ID,
DdynamicEnum.WH_RECORD_BLOCK_ID), map, false DdynamicEnum.USER_BLOCK_ID), map, false
); );
EiInfoUtils.addBlock(inInfo, "roleCompany", UserSessionUtils.getRoleCompany(), Company.class); EiInfoUtils.addBlock(inInfo, "roleCompany", UserSessionUtils.getRoleCompany(), Company.class);
} catch (Exception e) { } catch (Exception e) {
...@@ -81,61 +81,66 @@ public class ServiceHGKC008 extends ServiceBase { ...@@ -81,61 +81,66 @@ public class ServiceHGKC008 extends ServiceBase {
@Override @Override
public EiInfo delete(EiInfo inInfo) { public EiInfo delete(EiInfo inInfo) {
try { try {
List<Map> resultRows = inInfo.getBlock(EiConstant.resultBlock).getRows(); List<Map> resultRows = inInfo.getBlock(EiConstant.resultBlock).getRows();
// 生产领料ids // 生产领料ids
List<Long> ids = ObjectUtils.listKey(resultRows, HGKC008.FIELD_ID); List<Long> ids = ObjectUtils.listKey(resultRows, HGKC008.FIELD_ID);
DaoUtils.update(HGKC008.BATCH_DELETE, new HashMap<String,Object>(){{put("ids",ids);}}); DaoUtils.update(HGKC008.BATCH_DELETE, new HashMap<String, Object>() {{
inInfo = this.query(inInfo); put("ids", ids);
inInfo.setStatus(EiConstant.STATUS_DEFAULT); }});
inInfo.setMsg("操作成功!本次对[" + resultRows.size() + "]条数据删除成功!"); inInfo = this.query(inInfo);
inInfo.setStatus(EiConstant.STATUS_DEFAULT);
inInfo.setMsg("操作成功!本次对[" + resultRows.size() + "]条数据删除成功!");
} catch (Exception e) { } catch (Exception e) {
LogUtils.setDetailMsg(inInfo, e, "删除失败"); LogUtils.setDetailMsg(inInfo, e, "删除失败");
} }
return inInfo; return inInfo;
} }
public EiInfo save(EiInfo inInfo){ /**
try { * @param inInfo
Map resultMap = EiInfoUtils.getFirstRow(inInfo,EiConstant.resultBlock); * @return
HGKC008 hgkc008 = new HGKC008(); */
hgkc008.fromMap(resultMap); public EiInfo save(EiInfo inInfo) {
this.checkSaveData(hgkc008); try {
if(Objects.nonNull(hgkc008.getId())&&hgkc008.getId()!=0){ List<HGKC008> fKc008s = MapUtils.toDaoEPBases(inInfo, HGKC008.class);
DaoUtils.update(HGKC008.UPDATE, hgkc008); for (HGKC008 fKc008 : fKc008s) {
//同时修改子表的仓库数据、公司数据 this.checkSaveData(fKc008);
HGKCTools.HgKc008A.updateWhCodeByReceiveId(hgkc008); if (Objects.nonNull(fKc008.getId()) && fKc008.getId() != 0) {
}else { DaoUtils.update(HGKC008.UPDATE, fKc008);
//生成生产领料编号 //同时修改子表的仓库数据、公司数据
hgkc008.setApplyCode(SequenceGenerator.getNextSequence(HGConstant.SequenceId.RECEIVE_CODE)); HGKCTools.HgKc008A.updateWhCodeByReceiveId(fKc008);
hgkc008.setStatus(HGConstant.ProductStatus.WTJ); } else {
DaoUtils.insert(HGKC008.INSERT, hgkc008); //生成生产领料编号
fKc008.setApplyCode(SequenceGenerator.getNextSequence(HGConstant.SequenceId.RECEIVE_CODE));
EiInfoUtils.addBlock(inInfo,"entity", hgkc008, HGKC008.class); fKc008.setStatus(HGConstant.ProductStatus.WTJ);
} DaoUtils.insert(HGKC008.INSERT, fKc008);
inInfo.setStatus(EiConstant.STATUS_DEFAULT); // EiInfoUtils.addBlock(inInfo, "entity", hgkc008, HGKC008.class);
inInfo.setMsg("保存成功!"); }
} catch (Exception e) { }
LogUtils.setDetailMsg(inInfo, e, "保存失败"); inInfo = this.query(inInfo);
} inInfo.setStatus(EiConstant.STATUS_DEFAULT);
return inInfo; inInfo.setMsg("保存成功!");
} } catch (Exception e) {
LogUtils.setDetailMsg(inInfo, e, "保存失败");
/** }
* 校验保存的数据 return inInfo;
* }
* @param hgkc008
*/ /**
private void checkSaveData(HGKC008 hgkc008) { * 校验保存的数据
if(Objects.nonNull(hgkc008.getId())&&hgkc008.getId()>0){ *
AssertUtils.isTrue(hgkc008.getStatus().compareTo(HGConstant.ProductStatus.YTJ) == 0,"领料单已提交,不可修改"); * @param hgkc008
} */
AssertUtils.isEmpty(UserSessionUtils.getAccountCode(), "当前用户未绑定公司,无法操作数据,请联系管理员!"); private void checkSaveData(HGKC008 hgkc008) {
AssertUtils.isEmpty(UserSessionUtils.getOrgId(), "当前用户未绑定部门,无法操作数据,请联系管理员!"); if (Objects.nonNull(hgkc008.getId()) && hgkc008.getId() > 0) {
AssertUtils.isEmpty(hgkc008.getCompanyCode(), "请选择公司!"); AssertUtils.isTrue(hgkc008.getStatus().compareTo(HGConstant.ProductStatus.YTJ) == 0, "领料单已提交,不可修改");
AssertUtils.isEmpty(hgkc008.getWhCode(), "请选择仓库信息!"); }
AssertUtils.isEmpty(hgkc008.getWhName(), "请选择仓库信息!"); AssertUtils.isEmpty(UserSessionUtils.getAccountCode(), "当前用户未绑定公司,无法操作数据,请联系管理员!");
} AssertUtils.isEmpty(UserSessionUtils.getOrgId(), "当前用户未绑定部门,无法操作数据,请联系管理员!");
AssertUtils.isEmpty(hgkc008.getCompanyCode(), "请选择公司!");
AssertUtils.isEmpty(hgkc008.getWhCode(), "请选择仓库信息!");
AssertUtils.isEmpty(hgkc008.getWhName(), "请选择仓库信息!");
}
/** /**
* 修改启用状态 * 修改启用状态
......
...@@ -33,7 +33,7 @@ public class ServiceHGKC008A extends ServiceBase { ...@@ -33,7 +33,7 @@ public class ServiceHGKC008A extends ServiceBase {
Map map = new HashMap(); Map map = new HashMap();
map.put(HGKC008A.FIELD_ACCOUNT_CODE, UserSessionUtils.getAccountCode()); map.put(HGKC008A.FIELD_ACCOUNT_CODE, UserSessionUtils.getAccountCode());
map.put(HGKC008A.FIELD_WH_CODE, whCode); map.put(HGKC008A.FIELD_WH_CODE, whCode);
map.put(HGPZ004.FIELD_INVENT_TYPE_DETAILS, InventTypeDetailEnum.getInentTypeThree()); // map.put(HGPZ004.FIELD_INVENT_TYPE_DETAILS, InventTypeDetailEnum.getInentTypeThree());
CommonMethod.initBlock(inInfo, CommonMethod.initBlock(inInfo,
Arrays.asList(DdynamicEnum.INVENT_TYPE_BOX_BLOCK_ID,DdynamicEnum.INVENT_CODE_BOX_BLOCK_ID),map,false Arrays.asList(DdynamicEnum.INVENT_TYPE_BOX_BLOCK_ID,DdynamicEnum.INVENT_CODE_BOX_BLOCK_ID),map,false
); );
......
...@@ -4,12 +4,14 @@ import com.baosight.hggp.aspect.annotation.OperationLogAnnotation; ...@@ -4,12 +4,14 @@ import com.baosight.hggp.aspect.annotation.OperationLogAnnotation;
import com.baosight.hggp.common.DdynamicEnum; import com.baosight.hggp.common.DdynamicEnum;
import com.baosight.hggp.common.InventTypeDetailEnum; import com.baosight.hggp.common.InventTypeDetailEnum;
import com.baosight.hggp.core.dao.DaoUtils; import com.baosight.hggp.core.dao.DaoUtils;
import com.baosight.hggp.core.enums.DeleteFlagEnum;
import com.baosight.hggp.core.security.UserSessionUtils; import com.baosight.hggp.core.security.UserSessionUtils;
import com.baosight.hggp.hg.constant.HGConstant; import com.baosight.hggp.hg.constant.HGConstant;
import com.baosight.hggp.hg.constant.HGSqlConstant; import com.baosight.hggp.hg.constant.HGSqlConstant;
import com.baosight.hggp.hg.kc.domain.HGKC008; import com.baosight.hggp.hg.kc.domain.HGKC008;
import com.baosight.hggp.hg.kc.domain.HGKC008A; import com.baosight.hggp.hg.kc.domain.HGKC008A;
import com.baosight.hggp.hg.kc.domain.HGKC010; import com.baosight.hggp.hg.kc.domain.HGKC010;
import com.baosight.hggp.hg.kc.domain.HGKC010B;
import com.baosight.hggp.hg.kc.utils.HGKCUtils; import com.baosight.hggp.hg.kc.utils.HGKCUtils;
import com.baosight.hggp.hg.xs.domain.Company; import com.baosight.hggp.hg.xs.domain.Company;
import com.baosight.hggp.util.AssertUtils; import com.baosight.hggp.util.AssertUtils;
...@@ -23,9 +25,9 @@ import com.baosight.iplat4j.core.ei.EiConstant; ...@@ -23,9 +25,9 @@ import com.baosight.iplat4j.core.ei.EiConstant;
import com.baosight.iplat4j.core.ei.EiInfo; import com.baosight.iplat4j.core.ei.EiInfo;
import com.baosight.iplat4j.core.service.impl.ServiceBase; import com.baosight.iplat4j.core.service.impl.ServiceBase;
import java.math.BigDecimal;
import java.util.Arrays; import java.util.Arrays;
import java.util.HashMap; import java.util.HashMap;
import java.util.LinkedList;
import java.util.List; import java.util.List;
import java.util.Map; import java.util.Map;
...@@ -87,56 +89,79 @@ public class ServiceHGKC008B extends ServiceBase { ...@@ -87,56 +89,79 @@ public class ServiceHGKC008B extends ServiceBase {
@OperationLogAnnotation(operModul = "实时库存", operType = "查询", operDesc = "确认") @OperationLogAnnotation(operModul = "实时库存", operType = "查询", operDesc = "确认")
public EiInfo confirm(EiInfo inInfo) { public EiInfo confirm(EiInfo inInfo) {
try { try {
String receiveId = inInfo.getCellStr(EiConstant.queryBlock, ACConstants.ROW_CODE_0, HGKC008A.FIELD_RECEIVE_ID); String receiveId = inInfo.getCellStr(EiConstant.queryBlock, ACConstants.ROW_CODE_0,
List<HGKC010> hgkc010s = MapUtils.toDaoEPBases(inInfo, HGKC010.class); HGKC008A.FIELD_RECEIVE_ID);
List<HGKC010B> fKc010Bs = MapUtils.toDaoEPBases(inInfo, HGKC010B.class);
// db数据 // db数据
Map<Long, HGKC010> dbHgkc010Map = HGKCUtils.HgKc010.lockGetDataEp(hgkc010s); Map<Long, HGKC010> dbKc010Map = HGKCUtils.HgKc010.lockGetDataEp(fKc010Bs);
// 领料明细
List<HGKC008A> hgkc008AList = HGKCUtils.HgKc008A.listByPrimaryId(receiveId); List<HGKC008A> dbKc008As = HGKCUtils.HgKc008A.listByPrimaryId(receiveId);
// 领料主信息
HGKC008 hgkc008 = HGKCUtils.HgKc008.get(receiveId); HGKC008 hgkc008 = HGKCUtils.HgKc008.get(receiveId);
// 数据校验 // 数据校验
this.checkConfirmData(hgkc008AList, dbHgkc010Map,hgkc008); this.checkConfirmData(fKc010Bs, dbKc008As, dbKc010Map, hgkc008);
// 保存数据 // 保存数据
this.confirmData(dbHgkc010Map, hgkc008); this.confirmData(fKc010Bs, dbKc010Map, hgkc008);
inInfo = this.query(inInfo); inInfo = this.query(inInfo);
inInfo.setStatus(EiConstant.STATUS_DEFAULT); inInfo.setStatus(EiConstant.STATUS_DEFAULT);
inInfo.setMsg("操作成功!本次对[" + hgkc010s.size() + "]条数据保存成功!"); inInfo.setMsg("操作成功!本次对[" + fKc010Bs.size() + "]条数据保存成功!");
} catch (Exception e) { } catch (Exception e) {
LogUtils.setDetailMsg(inInfo, e, "保存失败"); LogUtils.setDetailMsg(inInfo, e, "保存失败");
} }
return inInfo; return inInfo;
} }
private void confirmData(Map<Long, HGKC010> dbHgkc010Map, HGKC008 hgkc008) { /**
List<HGKC008A> hgkc008AList = new LinkedList<>(); * 确认数量
dbHgkc010Map.forEach((k,v) ->{ *
HGKC008A hgkc008A = new HGKC008A(); * @param fKc010Bs
BeanUtils.copyProperties(hgkc008,hgkc008A,"id","createdBy","createdName","createdTime","updatedBy","updatedName","updatedTime"); * @param dbKc010Map
hgkc008A.setReceiveId(hgkc008.getId()); * @param dbKc008
hgkc008A.setInvLength(v.getLength()); */
hgkc008A.setInvThick(v.getThick()); private void confirmData(List<HGKC010B> fKc010Bs, Map<Long, HGKC010> dbKc010Map, HGKC008 dbKc008) {
hgkc008A.setInvUnitWeight(v.getInvUnitWeight()); for (HGKC010B fKc010B : fKc010Bs) {
hgkc008A.setInvWeight(v.getInvWeight()); Long id = fKc010B.getId();
hgkc008A.setInvWidth(v.getWidth()); HGKC010 dbKc010 = dbKc010Map.get(id);
hgkc008A.setInvSpec(v.getSpec()); HGKC008A newKc008A = BeanUtils.copy(dbKc010, HGKC008A.class);
hgkc008A.setInventType(v.getInventType()); newKc008A.setProjCode(dbKc008.getProjCode());
hgkc008A.setInventTypeDetail(v.getInventTypeDetail()); newKc008A.setProjName(dbKc008.getProjName());
hgkc008A.setInventCode(v.getInventCode()); newKc008A.setCompanyCode(dbKc008.getCompanyCode());
hgkc008A.setInventName(v.getInventName()); newKc008A.setCompanyName(dbKc008.getCompanyName());
hgkc008A.setInvQty(v.getInvQty()); newKc008A.setReceiveId(dbKc008.getId());
hgkc008AList.add(hgkc008A); newKc008A.setInvQty(fKc010B.getApplyQty());
}); newKc008A.setInvWeight(fKc010B.getApplyQty().multiply(dbKc010.getInvUnitWeight()));
DaoUtils.insertBatch(HGKC008A.INSERT, hgkc008AList); newKc008A.setInvWidth(dbKc010.getWidth());
newKc008A.setInvLength(dbKc010.getLength());
newKc008A.setInvThick(dbKc010.getThick());
newKc008A.setInvSpec(dbKc010.getSpec());
newKc008A.setInvSpecId(dbKc010.getSpecId());
newKc008A.setDeleteFlag(DeleteFlagEnum.UN_REMOVE.getCode());
DaoUtils.insert(HGKC008A.INSERT, newKc008A);
}
} }
private void checkConfirmData(List<HGKC008A> hgkc008AList, Map<Long, HGKC010> dbHgkc010Map, HGKC008 hgkc008) { /**
AssertUtils.isTrue(hgkc008.getStatus().compareTo(HGConstant.ProductStatus.YTJ) == 0, "领料单已提交,不可修改"); * 数据校验
hgkc008AList.forEach(o -> { *
dbHgkc010Map.forEach((k, v) -> { * @param fKc010Bs
AssertUtils.isTrue(o.getInventCode().equals(v.getInventCode()), "此领料单已选择存货:" + v.getInventCode()); * @param dbKc008As
}); * @param dbKc010Map
}); * @param dbKc008
*/
private void checkConfirmData(List<HGKC010B> fKc010Bs, List<HGKC008A> dbKc008As, Map<Long, HGKC010> dbKc010Map,
HGKC008 dbKc008) {
AssertUtils.isEquals(dbKc008.getStatus(), HGConstant.ProductStatus.YTJ, "领料单已提交,不可修改");
for (HGKC010B fKc010B : fKc010Bs) {
AssertUtils.isGe(BigDecimal.ZERO, fKc010B.getApplyQty(), String.format("库存【%s】申请数量必须大于0",
fKc010B.getInventCode()));
}
for (HGKC008A dbKc008A : dbKc008As) {
for (Map.Entry<Long, HGKC010> dbKc010MapEntry : dbKc010Map.entrySet()) {
HGKC010 dbKc010 = dbKc010MapEntry.getValue();
AssertUtils.isEquals(dbKc010.getInventCode(), dbKc008A.getInventCode(),
String.format("此领料单已选择存货:%s", dbKc010.getInventCode()));
}
}
} }
} }
<?xml version="1.0" encoding="UTF-8"?> <?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"> <!DOCTYPE sqlMap PUBLIC "-//iBATIS.com//DTD SQL Map 2.0//EN" "http://www.ibatis.com/dtd/sql-map-2.dtd">
<sqlMap namespace="HGKC008"> <sqlMap namespace="HGKC008">
<sql id="condition"> <sql id="column">
ID as "id", <!-- 主键id -->
ACCOUNT_CODE as "accountCode", <!-- 账套 -->
DEP_CODE as "depCode", <!-- 部门编码 -->
CREATED_BY as "createdBy", <!-- 创建人 -->
CREATED_NAME as "createdName", <!-- 创建人名称 -->
CREATED_TIME as "createdTime", <!-- 创建时间 -->
UPDATED_BY as "updatedBy", <!-- 修改人 -->
UPDATED_NAME as "updatedName", <!-- 修改人名称 -->
UPDATED_TIME as "updatedTime", <!-- 修改时间 -->
DELETE_FLAG as "deleteFlag", <!-- 是否删除 0-否1-是 -->
COMPANY_CODE as "companyCode", <!-- 公司编码 -->
COMPANY_NAME as "companyName", <!-- 公司名称 -->
RECEIPT_DATE as "receiptDate", <!-- 单据日期 -->
APPLY_CODE as "applyCode", <!-- 申请单号 -->
WH_CODE as "whCode", <!-- 仓库编号 -->
WH_NAME as "whName", <!-- 仓库名称 -->
STATUS as "status", <!-- 状态 0未提交,1已提交 -->
PROJ_CODE as "projCode", <!-- 项目编码 -->
PROJ_NAME as "projName", <!-- 项目名称 -->
RECEIVE_TYPE as "receiveType", <!-- 领料单类型 0:正常,1:退库 -->
RECEIVE_USER_ID as "receiveUserId", <!-- 领料人ID -->
RECEIVE_USER_NAME as "receiveUserName" <!-- 领料人姓名 -->
</sql>
<sql id="condition">
<include refid="HGXSDataAuth.authCondition"/> <include refid="HGXSDataAuth.authCondition"/>
<isNotEmpty prepend=" AND " property="id"> <isNotEmpty prepend=" AND " property="id">
ID = #id# ID = #id#
...@@ -58,6 +83,9 @@ ...@@ -58,6 +83,9 @@
<isNotEmpty prepend=" AND " property="receiveType"> <isNotEmpty prepend=" AND " property="receiveType">
RECEIVE_TYPE = #receiveType# RECEIVE_TYPE = #receiveType#
</isNotEmpty> </isNotEmpty>
<isNotEmpty prepend=" AND " property="receiveUserId">
RECEIVE_USER_ID = #receiveUserId#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="projCode"> <isNotEmpty prepend=" AND " property="projCode">
PROJ_CODE = #projCode# PROJ_CODE = #projCode#
</isNotEmpty> </isNotEmpty>
...@@ -66,131 +94,117 @@ ...@@ -66,131 +94,117 @@
</isNotEmpty> </isNotEmpty>
</sql> </sql>
<select id="query" parameterClass="java.util.HashMap" <sql id="customCondition">
resultClass="com.baosight.hggp.hg.kc.domain.HGKC008"> <include refid="condition"/>
SELECT <isNotEmpty prepend=" AND " property="inventTypeDetail">
ID as "id", <!-- 主键id --> ID IN (SELECT RECEIVE_ID FROM ${hggpSchema}.HGKC008A WHERE INVENT_TYPE_DETAIL = #inventTypeDetail#)
ACCOUNT_CODE as "accountCode", <!-- 账套 --> </isNotEmpty>
DEP_CODE as "depCode", <!-- 部门编码 --> </sql>
CREATED_BY as "createdBy", <!-- 创建人 -->
CREATED_NAME as "createdName", <!-- 创建人名称 -->
CREATED_TIME as "createdTime", <!-- 创建时间 -->
UPDATED_BY as "updatedBy", <!-- 修改人 -->
UPDATED_NAME as "updatedName", <!-- 修改人名称 -->
UPDATED_TIME as "updatedTime", <!-- 修改时间 -->
DELETE_FLAG as "deleteFlag", <!-- 是否删除 0-否1-是 -->
COMPANY_CODE as "companyCode", <!-- 公司编码 -->
COMPANY_NAME as "companyName", <!-- 公司名称 -->
RECEIPT_DATE as "receiptDate", <!-- 单据日期 -->
APPLY_CODE as "applyCode", <!-- 申请单号 -->
WH_CODE as "whCode", <!-- 仓库编号 -->
WH_NAME as "whName", <!-- 仓库名称 -->
STATUS as "status", <!-- 状态 0未提交,1已提交 -->
PROJ_CODE as "projCode", <!-- 项目编码 -->
PROJ_NAME as "projName", <!-- 项目名称 -->
RECEIVE_TYPE as "receiveType" <!-- 领料单类型 0:正常,1:退库 -->
FROM ${hggpSchema}.HGKC008 WHERE 1=1
<include refid="condition" />
<dynamic prepend="ORDER BY">
<isNotEmpty property="orderBy">
$orderBy$
</isNotEmpty>
<isEmpty property="orderBy">
CREATED_TIME desc
</isEmpty>
</dynamic>
</select> <sql id="orderBy">
<dynamic prepend="ORDER BY">
<isNotEmpty property="orderBy">
$orderBy$
</isNotEmpty>
<isEmpty property="orderBy">
CREATED_TIME desc
</isEmpty>
</dynamic>
</sql>
<select id="count" resultClass="int"> <select id="query" resultClass="com.baosight.hggp.hg.kc.domain.HGKC008">
SELECT COUNT(*) FROM ${hggpSchema}.HGKC008 WHERE 1=1 SELECT
<include refid="condition" /> <include refid="column"/>
FROM ${hggpSchema}.HGKC008 WHERE 1=1
<include refid="customCondition" />
<include refid="orderBy"/>
</select> </select>
<select id="count" resultClass="int">
SELECT COUNT(*) FROM ${hggpSchema}.HGKC008 WHERE 1=1
<include refid="customCondition"/>
</select>
<insert id="insert"> <insert id="insert">
INSERT INTO ${hggpSchema}.HGKC008 (ID, <!-- 主键id --> INSERT INTO ${hggpSchema}.HGKC008 (
PROJ_CODE, <!-- 项目编码 --> PROJ_CODE, <!-- 项目编码 -->
PROJ_NAME, <!-- 项目名称 --> PROJ_NAME, <!-- 项目名称 -->
ACCOUNT_CODE, <!-- 账套 --> ACCOUNT_CODE, <!-- 账套 -->
DEP_CODE, <!-- 部门编码 --> DEP_CODE, <!-- 部门编码 -->
CREATED_BY, <!-- 创建人 --> CREATED_BY, <!-- 创建人 -->
CREATED_NAME, <!-- 创建人名称 --> CREATED_NAME, <!-- 创建人名称 -->
CREATED_TIME, <!-- 创建时间 --> CREATED_TIME, <!-- 创建时间 -->
UPDATED_BY, <!-- 修改人 --> DELETE_FLAG, <!-- 是否删除 0-否1-是 -->
UPDATED_NAME, <!-- 修改人名称 --> COMPANY_CODE, <!-- 公司编码 -->
UPDATED_TIME, <!-- 修改时间 --> COMPANY_NAME, <!-- 公司名称 -->
DELETE_FLAG, <!-- 是否删除 0-否1-是 --> RECEIPT_DATE, <!-- 单据日期 -->
COMPANY_CODE, <!-- 公司编码 --> APPLY_CODE, <!-- 申请单号 -->
COMPANY_NAME, <!-- 公司名称 --> WH_CODE, <!-- 仓库编号 -->
RECEIPT_DATE, <!-- 单据日期 --> WH_NAME, <!-- 仓库名称 -->
APPLY_CODE, <!-- 申请单号 --> STATUS, <!-- 状态 0未提交,1已提交 -->
WH_CODE, <!-- 仓库编号 --> RECEIVE_TYPE, <!-- 领料单类型 0:正常,1:退库 -->
WH_NAME, <!-- 仓库名称 --> RECEIVE_USER_ID,
STATUS, <!-- 状态 0未提交,1已提交 --> RECEIVE_USER_NAME
RECEIVE_TYPE <!-- 领料单类型 0:正常,1:退库 --> ) VALUES (
) #projCode#, #projName#, #accountCode#, #depCode#, #createdBy#, #createdName#, #createdTime#,
VALUES (#id#,#projCode#, #projName#, #accountCode#, #depCode#, #createdBy#, #createdName#, #createdTime#, #updatedBy#, #updatedName#, #updatedTime#, #deleteFlag#, #companyCode#, #companyName#, #receiptDate#, #applyCode#, #whCode#, #whName#, #status#, #receiveType#) #deleteFlag#, #companyCode#, #companyName#, #receiptDate#,
<selectKey resultClass="long" keyProperty="id"> #applyCode#, #whCode#, #whName#, #status#, #receiveType#, #receiveUserId#, #receiveUserName#)
SELECT MAX(ID) AS "id" FROM ${hggpSchema}.HGKC008 <selectKey resultClass="long" keyProperty="id">
</selectKey> SELECT MAX(ID) AS "id" FROM ${hggpSchema}.HGKC008
</insert> </selectKey>
</insert>
<delete id="delete"> <delete id="delete">
DELETE FROM ${hggpSchema}.HGKC008 WHERE ID = #id# DELETE FROM ${hggpSchema}.HGKC008 WHERE ID = #id#
</delete> </delete>
<update id="update"> <update id="update">
UPDATE ${hggpSchema}.HGKC008 UPDATE ${hggpSchema}.HGKC008
SET SET
ACCOUNT_CODE = #accountCode#, <!-- 账套 --> PROJ_CODE = #projCode#, <!-- 项目编码 -->
PROJ_CODE = #projCode#, <!-- 项目编码 --> PROJ_NAME = #projName#, <!-- 项目名称 -->
PROJ_NAME = #projName#, <!-- 项目名称 --> UPDATED_BY = #updatedBy#, <!-- 修改人 -->
DEP_CODE = #depCode#, <!-- 部门编码 --> UPDATED_NAME = #updatedName#, <!-- 修改人名称 -->
CREATED_BY = #createdBy#, <!-- 创建人 --> UPDATED_TIME = #updatedTime#, <!-- 修改时间 -->
CREATED_NAME = #createdName#, <!-- 创建人名称 --> COMPANY_CODE = #companyCode#, <!-- 公司编码 -->
CREATED_TIME = #createdTime#, <!-- 创建时间 --> COMPANY_NAME = #companyName#, <!-- 公司名称 -->
UPDATED_BY = #updatedBy#, <!-- 修改人 --> RECEIPT_DATE = #receiptDate#, <!-- 单据日期 -->
UPDATED_NAME = #updatedName#, <!-- 修改人名称 --> WH_CODE = #whCode#, <!-- 仓库编号 -->
UPDATED_TIME = #updatedTime#, <!-- 修改时间 --> WH_NAME = #whName#, <!-- 仓库名称 -->
DELETE_FLAG = #deleteFlag#, <!-- 是否删除 0-否1-是 --> STATUS = #status#, <!-- 状态 0未提交,1已提交 -->
COMPANY_CODE = #companyCode#, <!-- 公司编码 --> RECEIVE_TYPE = #receiveType#, <!-- 领料单类型 0:正常,1:退库 -->
COMPANY_NAME = #companyName#, <!-- 公司名称 --> RECEIVE_USER_ID = #receiveUserId#,
RECEIPT_DATE = #receiptDate#, <!-- 单据日期 --> RECEIVE_USER_NAME = #receiveUserName#
APPLY_CODE = #applyCode#, <!-- 申请单号 --> WHERE ID = #id#
WH_CODE = #whCode#, <!-- 仓库编号 --> </update>
WH_NAME = #whName#, <!-- 仓库名称 -->
STATUS = #status#, <!-- 状态 0未提交,1已提交 -->
RECEIVE_TYPE = #receiveType# <!-- 领料单类型 0:正常,1:退库 -->
WHERE ID = #id#
</update>
<delete id="batchDelete"> <delete id="batchDelete">
DELETE FROM ${hggpSchema}.HGKC008 WHERE DELETE FROM ${hggpSchema}.HGKC008 WHERE
id IN <iterate close=")" open="(" conjunction="," property="ids">#ids[]#</iterate> id IN
</delete> <iterate close=")" open="(" conjunction="," property="ids">#ids[]#</iterate>
</delete>
<update id="updateStatus">
UPDATE ${hggpSchema}.HGKC008
SET
UPDATED_BY = #updatedBy#, <!-- 更新人 -->
UPDATED_NAME = #updatedName#, <!-- 更新人名称 -->
UPDATED_TIME = #updatedTime#, <!-- 更新时间 -->
STATUS = #status# <!-- 状态 0未提交,1已提交 -->
WHERE
ID = #id#
</update>
<update id="updateStatus"> <update id="updateReceiveType">
UPDATE ${hggpSchema}.HGKC008 UPDATE ${hggpSchema}.HGKC008
SET SET
UPDATED_BY = #updatedBy#, <!-- 更新人 --> UPDATED_BY = #updatedBy#, <!-- 更新人 -->
UPDATED_NAME = #updatedName#, <!-- 更新人名称 --> UPDATED_NAME = #updatedName#, <!-- 更新人名称 -->
UPDATED_TIME = #updatedTime#, <!-- 更新时间 --> UPDATED_TIME = #updatedTime#, <!-- 更新时间 -->
STATUS = #status# <!-- 状态 0未提交,1已提交 --> RECEIVE_TYPE = #receiveType# <!-- 领料单类型 0:正常,1:退库 -->
WHERE WHERE
ID = #id# ID = #id#
</update> </update>
<update id="updateReceiveType">
UPDATE ${hggpSchema}.HGKC008
SET
UPDATED_BY = #updatedBy#, <!-- 更新人 -->
UPDATED_NAME = #updatedName#, <!-- 更新人名称 -->
UPDATED_TIME = #updatedTime#, <!-- 更新时间 -->
RECEIVE_TYPE = #receiveType# <!-- 领料单类型 0:正常,1:退库 -->
WHERE
ID = #id#
</update>
<select id="queryCheckList" resultClass="com.baosight.hggp.hg.kc.domain.HGKC008"> <select id="queryCheckList" resultClass="com.baosight.hggp.hg.kc.domain.HGKC008">
SELECT SELECT
......
<?xml version="1.0" encoding="UTF-8"?> <?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"> <!DOCTYPE sqlMap PUBLIC "-//iBATIS.com//DTD SQL Map 2.0//EN" "http://www.ibatis.com/dtd/sql-map-2.dtd">
<sqlMap namespace="HGKC008A"> <sqlMap namespace="HGKC008A">
<sql id="condition"> <sql id="condition">
<isNotEmpty prepend=" AND " property="id"> <isNotEmpty prepend=" AND " property="id">
ID = #id# ID = #id#
</isNotEmpty> </isNotEmpty>
...@@ -158,7 +158,7 @@ ...@@ -158,7 +158,7 @@
</select> </select>
<insert id="insert"> <insert id="insert">
INSERT INTO ${hggpSchema}.HGKC008A (ID, <!-- 主键id --> INSERT INTO ${hggpSchema}.HGKC008A (
ACCOUNT_CODE, <!-- 账套 --> ACCOUNT_CODE, <!-- 账套 -->
PROJ_CODE, <!-- 项目编码 --> PROJ_CODE, <!-- 项目编码 -->
PROJ_NAME, <!-- 项目名称 --> PROJ_NAME, <!-- 项目名称 -->
...@@ -166,9 +166,6 @@ ...@@ -166,9 +166,6 @@
CREATED_BY, <!-- 创建人 --> CREATED_BY, <!-- 创建人 -->
CREATED_NAME, <!-- 创建人名称 --> CREATED_NAME, <!-- 创建人名称 -->
CREATED_TIME, <!-- 创建时间 --> CREATED_TIME, <!-- 创建时间 -->
UPDATED_BY, <!-- 修改人 -->
UPDATED_NAME, <!-- 修改人名称 -->
UPDATED_TIME, <!-- 修改时间 -->
DELETE_FLAG, <!-- 是否删除 0-否1-是 --> DELETE_FLAG, <!-- 是否删除 0-否1-是 -->
RECEIVE_ID, <!-- 领料单id --> RECEIVE_ID, <!-- 领料单id -->
COMPANY_CODE, <!-- 公司编码 --> COMPANY_CODE, <!-- 公司编码 -->
...@@ -190,9 +187,8 @@ ...@@ -190,9 +187,8 @@
PRICE, <!-- 单价 --> PRICE, <!-- 单价 -->
AMOUNT, <!-- 金额 --> AMOUNT, <!-- 金额 -->
INVENT_TYPE_DETAIL INVENT_TYPE_DETAIL
) ) VALUES (#accountCode#,#projCode#, #projName#, #depCode#, #createdBy#, #createdName#, #createdTime#,
VALUES (#id#, #accountCode#,#projCode#, #projName#, #depCode#, #createdBy#, #createdName#, #createdTime#, #deleteFlag#, #receiveId#, #companyCode#, #companyName#, #whCode#,
#updatedBy#, #updatedName#, #updatedTime#, #deleteFlag#, #receiveId#, #companyCode#, #companyName#, #whCode#,
#whName#, #inventRecordId#, #inventType#, #inventCode#, #inventName#, #invSpecId#,#invSpec#, #invLength#, #whName#, #inventRecordId#, #inventType#, #inventCode#, #inventName#, #invSpecId#,#invSpec#, #invLength#,
#invWidth#, #invThick#, #invQty#, #invUnitWeight#, #invWeight#, #price#, #amount#, #inventTypeDetail#) #invWidth#, #invThick#, #invQty#, #invUnitWeight#, #invWeight#, #price#, #amount#, #inventTypeDetail#)
</insert> </insert>
......
...@@ -7,13 +7,22 @@ import com.baosight.hggp.core.dao.DaoUtils; ...@@ -7,13 +7,22 @@ import com.baosight.hggp.core.dao.DaoUtils;
import com.baosight.hggp.hg.sc.domain.HGSC005; import com.baosight.hggp.hg.sc.domain.HGSC005;
import com.baosight.hggp.hg.sc.domain.HGSC005A; import com.baosight.hggp.hg.sc.domain.HGSC005A;
import com.baosight.hggp.hg.sc.tools.HGSCTools; import com.baosight.hggp.hg.sc.tools.HGSCTools;
import com.baosight.hggp.util.*; import com.baosight.hggp.util.AssertUtils;
import com.baosight.hggp.util.CommonMethod;
import com.baosight.hggp.util.DateUtil;
import com.baosight.hggp.util.EiInfoUtils;
import com.baosight.hggp.util.LogUtils;
import com.baosight.hggp.util.MapUtils;
import com.baosight.iplat4j.core.ei.EiConstant; import com.baosight.iplat4j.core.ei.EiConstant;
import com.baosight.iplat4j.core.ei.EiInfo; import com.baosight.iplat4j.core.ei.EiInfo;
import com.baosight.iplat4j.core.exception.PlatException; import com.baosight.iplat4j.core.exception.PlatException;
import com.baosight.iplat4j.core.service.impl.ServiceBase; import com.baosight.iplat4j.core.service.impl.ServiceBase;
import java.util.*; import java.util.Arrays;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import java.util.Objects;
/** /**
* @Author wwl * @Author wwl
...@@ -110,7 +119,32 @@ public class ServiceHGSC005A extends ServiceBase { ...@@ -110,7 +119,32 @@ public class ServiceHGSC005A extends ServiceBase {
} }
/** /**
* 排产 * 正序排产
*
* @param inInfo
* @return
*/
@OperationLogAnnotation(operModul = "生产计划详情", operType = "排产", operDesc = "排产")
public EiInfo scheduleEx(EiInfo inInfo) {
try {
Map queryMap = EiInfoUtils.getFirstRow(inInfo);
String planCode = MapUtils.getString(queryMap, "planCode");
HGSC005 dbSc005 = HGSCTools.THGSC005.queryByPlanCode(planCode);
this.checkScheduleData(dbSc005);
int count = HGSCTools.THGSC005A.schedule(queryMap, "A");
dbSc005.setIsSchedule(CommonConstant.YesNo.YES_1);
DaoUtils.update(HGSC005.UPDATE, dbSc005);
inInfo = this.query(inInfo);
inInfo.setStatus(EiConstant.STATUS_DEFAULT);
inInfo.setMsg("操作成功!本次对[" + count + "]条数据排产成功!");
} catch (Exception e) {
LogUtils.setDetailMsg(inInfo, e, "操作失败");
}
return inInfo;
}
/**
* 倒序排产
* *
* @param inInfo * @param inInfo
* @return * @return
...@@ -122,7 +156,7 @@ public class ServiceHGSC005A extends ServiceBase { ...@@ -122,7 +156,7 @@ public class ServiceHGSC005A extends ServiceBase {
String planCode = MapUtils.getString(queryMap, "planCode"); String planCode = MapUtils.getString(queryMap, "planCode");
HGSC005 dbSc005 = HGSCTools.THGSC005.queryByPlanCode(planCode); HGSC005 dbSc005 = HGSCTools.THGSC005.queryByPlanCode(planCode);
this.checkScheduleData(dbSc005); this.checkScheduleData(dbSc005);
int count = HGSCTools.THGSC005A.schedule(queryMap); int count = HGSCTools.THGSC005A.schedule(queryMap, "D");
dbSc005.setIsSchedule(CommonConstant.YesNo.YES_1); dbSc005.setIsSchedule(CommonConstant.YesNo.YES_1);
DaoUtils.update(HGSC005.UPDATE, dbSc005); DaoUtils.update(HGSC005.UPDATE, dbSc005);
inInfo = this.query(inInfo); inInfo = this.query(inInfo);
......
...@@ -1060,9 +1060,10 @@ public class HGSCTools { ...@@ -1060,9 +1060,10 @@ public class HGSCTools {
* 排产 * 排产
* *
* @param queryMap * @param queryMap
* @param sortType
* @return * @return
*/ */
public static int schedule(Map queryMap) { public static int schedule(Map queryMap, String sortType) {
List<HGSC005A> hgsc005AList = DaoBase.getInstance().query(HGSC005A.QUERY, queryMap); List<HGSC005A> hgsc005AList = DaoBase.getInstance().query(HGSC005A.QUERY, queryMap);
// hgsc005AList.sort(Comparator.comparing(HGSC005A::getProductType).thenComparing(HGSC005A::getProcessOrder,Comparator.reverseOrder())); // hgsc005AList.sort(Comparator.comparing(HGSC005A::getProductType).thenComparing(HGSC005A::getProcessOrder,Comparator.reverseOrder()));
//通过工序编码查询工序设置 //通过工序编码查询工序设置
...@@ -1113,26 +1114,26 @@ public class HGSCTools { ...@@ -1113,26 +1114,26 @@ public class HGSCTools {
} }
return hgsc005AList.size(); return hgsc005AList.size();
} }
private static String handleEndDate(String endDate ,HGSC005A planInfo){ private static String handleEndDate(String endDate, HGSC005A planInfo) {
if(StringUtils.isBlank(endDate)&&StringUtils.isNotBlank(planInfo.getFinishDate())){ if (StringUtils.isBlank(endDate) && StringUtils.isNotBlank(planInfo.getFinishDate())) {
endDate = DateUtil.toDateStr(DateUtils.addDays(DateUtil.toDate(planInfo.getFinishDate(),DateUtil.DATE10_PATTERN),finishDateDiffDay.intValue()),DateUtil.DATE10_PATTERN); endDate = DateUtil.toDateStr(DateUtils.addDays(DateUtil.toDate(planInfo.getFinishDate(),
} DateUtil.DATE10_PATTERN), finishDateDiffDay.intValue()), DateUtil.DATE10_PATTERN);
return endDate; }
} return endDate;
}
private static BigDecimal calculateWordHour(HGSC005A planInfo, List<HGSJ001> hgsj001List
, List<HGPZ005> hgpz005List, List<HGPZ005A> hgpz005AList private static BigDecimal calculateWordHour(HGSC005A planInfo, List<HGSJ001> hgsj001List,
, String endDate, BigDecimal remainder){ List<HGPZ005> hgpz005List, List<HGPZ005A> hgpz005AList, String endDate, BigDecimal remainder) {
endDate = handleEndDate(endDate,planInfo); endDate = handleEndDate(endDate, planInfo);
planInfo.setPlanEndDate(endDate); planInfo.setPlanEndDate(endDate);
AtomicReference<BigDecimal> workHour = new AtomicReference<>(new BigDecimal(0)); AtomicReference<BigDecimal> workHour = new AtomicReference<>(new BigDecimal(0));
BigDecimal finalRemainder = remainder; BigDecimal finalRemainder = remainder;
hgsj001List.stream().forEach(sj->{ hgsj001List.stream().forEach(sj -> {
if(StringUtils.equals(sj.getProcessCode(),planInfo.getProcessCode())){ if (StringUtils.equals(sj.getProcessCode(), planInfo.getProcessCode())) {
hgpz005AList.forEach(productProcess -> { hgpz005AList.forEach(productProcess -> {
if(productProcess.getId().compareTo(planInfo.getInventProcessId())==0){ if (productProcess.getId().compareTo(planInfo.getInventProcessId()) == 0) {
BigDecimal composingCoeff = productProcess.getComposingCoeff(); BigDecimal composingCoeff = productProcess.getComposingCoeff();
hgpz005List.forEach(product->{ hgpz005List.forEach(product->{
if(StringUtils.equals(product.getInventCode(),planInfo.getProductCode())){ if(StringUtils.equals(product.getInventCode(),planInfo.getProductCode())){
//额定工时 //额定工时
......
...@@ -47,7 +47,7 @@ ...@@ -47,7 +47,7 @@
<EF:EFColumn ename="receiveQty" cname="已收货数量" enable="false" width="120" align="right" format="{0:N3}" <EF:EFColumn ename="receiveQty" cname="已收货数量" enable="false" width="120" align="right" format="{0:N3}"
defaultValue="0" sumType="page"/> defaultValue="0" sumType="page"/>
<EF:EFComboColumn ename="calculationMethod" cname="计算方式" enable="true" width="100" align="center" <EF:EFComboColumn ename="calculationMethod" cname="计算方式" enable="true" width="100" align="center"
required="true"> copy="true" required="true">
<EF:EFCodeOption codeName="hggp.cg.calculationMethod"/> <EF:EFCodeOption codeName="hggp.cg.calculationMethod"/>
</EF:EFComboColumn> </EF:EFComboColumn>
<EF:EFColumn ename="price" cname="单价" width="80" align="right" format="{0:N3}" required="true"/> <EF:EFColumn ename="price" cname="单价" width="80" align="right" format="{0:N3}" required="true"/>
......
...@@ -3,6 +3,7 @@ $(function (){ ...@@ -3,6 +3,7 @@ $(function (){
var companyCodes = __eiInfo.getBlock("roleCompany").getMappedRows(); var companyCodes = __eiInfo.getBlock("roleCompany").getMappedRows();
var projCodes = __eiInfo.getBlock("projRecordByRole_block_id").getMappedRows(); var projCodes = __eiInfo.getBlock("projRecordByRole_block_id").getMappedRows();
var whRecordBoxBlocks = __eiInfo.getBlock("wh_record_block_id").getMappedRows(); var whRecordBoxBlocks = __eiInfo.getBlock("wh_record_block_id").getMappedRows();
var users = __eiInfo.getBlock("user_block_id").getMappedRows();
$(".row").children().attr("class", "col-md-3"); $(".row").children().attr("class", "col-md-3");
...@@ -21,114 +22,114 @@ $(function (){ ...@@ -21,114 +22,114 @@ $(function (){
pageSize: 10, pageSize: 10,
pageSizes: [10, 20, 50, 100], pageSizes: [10, 20, 50, 100],
}, },
columns: [ columns: [{
{ field: "operator",
field: "operator", title: "操作",
title: "操作", template: function (item) {
template: function (item) { let status = item.status;
let status = item.status; let template = '';
let template = ''; if (item.id) {
if (item.id){ template += '<a style="cursor: pointer;display: inline-flex;justify-content: center;margin:auto 5px" '
template += '<a style="cursor: pointer;display: inline-flex;justify-content: center;margin:auto 5px" ' + 'onclick="showDetail(' + item.id + ',\'' + item.whCode + '\',\''
+ 'onclick="showDetail(' + item.id + ',\''+item.whCode+'\',\''+item.companyCode+'\',\''+item.status+'\')" >领料详情</a>'; + item.companyCode + '\',\'' + item.status + '\')" >领料详情</a>';
if (status == 0) { if (status == 0) {
template += '<a style="cursor: pointer;display: inline-flex;justify-content: center;margin:auto 5px" ' template += '<a style="cursor: pointer;display: inline-flex;justify-content: center;margin:auto 5px" '
+ 'onclick="updateStatus(' + item.id + ',1)" >提交</a>'; + 'onclick="updateStatus(' + item.id + ',1)" >提交</a>';
} }
} }
return template; return template;
} }
},{ }, {
field: "companyCode", field: "companyCode",
template: function (dataItem) { template: function (dataItem) {
for (let i = 0; i < companyCodes.length; i++) { for (let i = 0; i < companyCodes.length; i++) {
if (companyCodes[i]['companyCode'] === dataItem['companyCode']){ if (companyCodes[i]['companyCode'] === dataItem['companyCode']) {
dataItem['companyName'] = companyCodes[i]['companyName'] dataItem['companyName'] = companyCodes[i]['companyName']
return companyCodes[i]['companyName']; return companyCodes[i]['companyName'];
} }
} }
return dataItem["companyCode"]; return dataItem["companyCode"];
} }
}, { }, {
field: "projCode", field: "projCode",
template: function (item) { template: function (item) {
let template = ""; let template = "";
if(item.projCode){ if (item.projCode) {
for(let i=0;i<projCodes.length;i++){ for (let i = 0; i < projCodes.length; i++) {
if(item.projCode === projCodes[i]['valueField']){ if (item.projCode === projCodes[i]['valueField']) {
template = projCodes[i]['valueField']; template = projCodes[i]['valueField'];
} }
} }
} }
return item.projCode; return item.projCode;
}, },
editor: function (container, options) { editor: function (container, options) {
let inInfo = new EiInfo(); let inInfo = new EiInfo();
inInfo.set("inqu_status-0-companyCode", options.model["companyCode"]); inInfo.set("inqu_status-0-companyCode", options.model["companyCode"]);
inInfo.set("inqu_status-0-approvalStatus", 2); inInfo.set("inqu_status-0-approvalStatus", 2);
inInfo.set("field", options.field); inInfo.set("field", options.field);
let dataSource; let dataSource;
EiCommunicator.send("HGSC003", "projComboBox", inInfo, { EiCommunicator.send("HGSC003", "projComboBox", inInfo, {
onSuccess: function (ei) { onSuccess: function (ei) {
dataSource = ei.getBlock("projRecordByRole_block_id").getMappedRows(); dataSource = ei.getBlock("projRecordByRole_block_id").getMappedRows();
}, },
onFail: function (ei) { onFail: function (ei) {
} }
}, {async: false}); }, {async: false});
var input = $('<input />'); var input = $('<input />');
input.attr("name", options.field); input.attr("name", options.field);
input.attr("id", options.field); input.attr("id", options.field);
input.appendTo(container); input.appendTo(container);
input.kendoDropDownList({ input.kendoDropDownList({
dataSource: projCodes, dataSource: projCodes,
minLength: 0, minLength: 0,
dataTextField: "textField", dataTextField: "textField",
dataValueField: "valueField", dataValueField: "valueField",
optionLabelTemplate: "[#:valueField#]#:textField#", optionLabelTemplate: "[#:valueField#]#:textField#",
valueTemplate: "[#:valueField#]#:textField#", valueTemplate: "[#:valueField#]#:textField#",
template: "[#:valueField#]#:textField#", template: "[#:valueField#]#:textField#",
filter: "contains" filter: "contains"
}); });
} }
}, { }, {
field: "whCode", field: "whCode",
template: function (item) { template: function (item) {
let template = ""; let template = "";
if(item.whCode){ if (item.whCode) {
for(let i=0;i<whRecordBoxBlocks.length;i++){ for (let i = 0; i < whRecordBoxBlocks.length; i++) {
if(item.whCode === whRecordBoxBlocks[i]['valueField']){ if (item.whCode === whRecordBoxBlocks[i]['valueField']) {
template = whRecordBoxBlocks[i]['valueField']; template = whRecordBoxBlocks[i]['valueField'];
} }
} }
} }
return item.whCode; return item.whCode;
}, },
editor: function (container, options) { editor: function (container, options) {
var input = $('<input />'); var input = $('<input />');
input.attr("name", options.field); input.attr("name", options.field);
input.attr("id", options.field); input.attr("id", options.field);
input.appendTo(container); input.appendTo(container);
input.kendoDropDownList({ input.kendoDropDownList({
dataSource: whRecordBoxBlocks, dataSource: whRecordBoxBlocks,
minLength: 0, minLength: 0,
dataTextField: "textField", dataTextField: "textField",
dataValueField: "valueField", dataValueField: "valueField",
optionLabelTemplate: "[#:valueField#]#:textField#", optionLabelTemplate: "[#:valueField#]#:textField#",
valueTemplate: "[#:valueField#]#:textField#", valueTemplate: "[#:valueField#]#:textField#",
template: "[#:valueField#]#:textField#", template: "[#:valueField#]#:textField#",
filter: "contains" filter: "contains"
}); });
} }
}, { }, {
field: "receiptDate", field: "receiptDate",
attributes: { attributes: {
class: "i-input-readonly" class: "i-input-readonly"
}, },
defaultValue: function () { defaultValue: function () {
return currShortDate(); return currShortDate();
} }
} }
], ],
loadComplete: function(grid) { loadComplete: function(grid) {
// 此 grid 对象 // 此 grid 对象
// 处理父子级联动,通过监听 change 事件,判断父级节点是否发生变化 // 处理父子级联动,通过监听 change 事件,判断父级节点是否发生变化
...@@ -160,6 +161,13 @@ $(function (){ ...@@ -160,6 +161,13 @@ $(function (){
} }
} }
} }
if (e.field == "receiveUserId") {
for (let i = 0; i < users.length; i++) {
if (item.receiveUserId === users[i]['valueField']) {
resultGrid.setCellValue(item, 'receiveUserName', users[i]['textField'])
}
}
}
}); });
}, },
beforeEdit: function (e) { beforeEdit: function (e) {
...@@ -184,7 +192,7 @@ $(function (){ ...@@ -184,7 +192,7 @@ $(function (){
//deleteFunc(); //deleteFunc();
}, },
onSuccess: function (e) { onSuccess: function (e) {
if (e.eiInfo.extAttr.methodName == 'save' || e.eiInfo.extAttr.methodName == 'delete') { if (e.eiInfo.extAttr.methodName == 'delete') {
query(); query();
} }
}, },
......
...@@ -12,39 +12,60 @@ ...@@ -12,39 +12,60 @@
</head> </head>
<EF:EFPage title="生产领料单"> <EF:EFPage title="生产领料单">
<EF:EFRegion id="inqu" title="查询条件"> <EF:EFRegion id="inqu" title="查询条件">
<div class="row"> <div class="row">
<EF:EFInput ename="inqu_status-0-companyName" cname="公司名称" colWidth="3"/> <EF:EFInput ename="inqu_status-0-companyName" cname="公司名称" colWidth="3"/>
<EF:EFDatePicker cname="单据日期" blockId="inqu_status" ename="receiptDate" row="0" colWidth="3" <EF:EFDatePicker cname="单据日期" blockId="inqu_status" ename="receiptDate" row="0" colWidth="3"
role="date" format="yyyy-MM-dd" readonly="true"/> role="date" format="yyyy-MM-dd" readonly="true"/>
<EF:EFInput ename="inqu_status-0-applyCode" cname="生产领料单号" colWidth="3"/> <EF:EFInput ename="inqu_status-0-applyCode" cname="生产领料单号" colWidth="3"/>
<EF:EFInput ename="inqu_status-0-whName" cname="仓库名称" colWidth="3"/> <EF:EFInput ename="inqu_status-0-whName" cname="仓库名称" colWidth="3"/>
</div> </div>
</EF:EFRegion> <div class="row">
<EF:EFRegion id="result" title="记录集"> <EF:EFSelect ename="receiveUserId" cname="领料人" blockId="inqu_status" row="0" colWidth="3" filter="contains">
<EF:EFGrid blockId="result" autoDraw="no" isFloat="true" copyToAdd="false"> <EF:EFOption label="全部" value=""/>
<EF:EFColumn ename="id" cname="主键" hidden="true"/> <EF:EFOptions blockId="user_block_id" textField="textField" valueField="valueField"/>
<EF:EFColumn ename="operator" cname="操作" locked="true" enable="false" width="120" align="center"/> </EF:EFSelect>
<EF:EFComboColumn cname="类型" ename="receiveType" width="90" align="center" required="false" enable="false"> <EF:EFSelect ename="inventTypeDetail" cname="存货类型" blockId="inqu_status" row="0" colWidth="3"
<EF:EFCodeOption codeName="hggp.receiveType" /> filter="contains">
</EF:EFComboColumn> <EF:EFOption label="全部" value=""/>
<EF:EFComboColumn ename="companyCode" cname="公司名称" <EF:EFCodeOption codeName="hggp.hgpz.inventTypeDetail"/>
columnTemplate="#=textField#" itemTemplate="#=textField#" </EF:EFSelect>
textField="textField" valueField="valueField" <EF:EFSelect ename="status" cname="状态" blockId="inqu_status" row="0" colWidth="3">
maxLength="16" width="140" required="true" <EF:EFOption label="全部" value=""/>
align="center" filter="contains" sort="true"> <EF:EFCodeOption codeName="hggp.sc.productStatus"/>
<EF:EFOptions blockId="companyBox_block_id" textField="textField" valueField="valueField"/> </EF:EFSelect>
</EF:EFComboColumn> </div>
<EF:EFColumn ename="companyName" cname="公司名称" hidden="true"/>
<EF:EFColumn ename="projCode" cname="项目编码" enable="true" width="130" align="center" required="true"/>
<EF:EFColumn ename="projName" cname="项目名称" width="120" align="center" enable="false" required="true"/>
<EF:EFColumn ename="applyCode" cname="生产领料单号" enable="false" width="120" align="center"/>
<EF:EFColumn ename="receiptDate" cname="单据日期" width="120" align="center" editType="date"
dateFormat="yyyy-MM-dd" parseFormats="['yyyyMMdd']" required="true"/>
<EF:EFColumn ename="whCode" cname="仓库编码" enable="true" width="120" align="center" required="true"/>
<EF:EFColumn ename="whName" cname="仓库名称" width="120" align="center" enable="false" required="true"/>
<EF:EFComboColumn cname="状态" ename="status" width="90" align="center" required="false" enable="false">
<EF:EFCodeOption codeName="hggp.sc.productStatus" />
</EF:EFComboColumn>
</EF:EFGrid>
</EF:EFRegion> </EF:EFRegion>
<EF:EFRegion id="result" title="记录集">
<EF:EFGrid blockId="result" autoDraw="no" isFloat="true" copyToAdd="false">
<EF:EFColumn ename="id" cname="主键" hidden="true"/>
<EF:EFColumn ename="operator" cname="操作" locked="true" enable="false" width="120" align="center"/>
<EF:EFComboColumn cname="类型" ename="receiveType" width="90" align="center" required="false" enable="false">
<EF:EFCodeOption codeName="hggp.receiveType"/>
</EF:EFComboColumn>
<EF:EFComboColumn ename="companyCode" cname="公司名称"
columnTemplate="#=textField#" itemTemplate="#=textField#"
textField="textField" valueField="valueField"
maxLength="16" width="140" required="true"
align="center" filter="contains" sort="true">
<EF:EFOptions blockId="companyBox_block_id" textField="textField" valueField="valueField"/>
</EF:EFComboColumn>
<EF:EFColumn ename="companyName" cname="公司名称" hidden="true"/>
<EF:EFColumn ename="projCode" cname="项目编码" enable="true" width="130" align="center" required="true"/>
<EF:EFColumn ename="projName" cname="项目名称" width="120" align="center" enable="false" required="true"/>
<EF:EFColumn ename="applyCode" cname="生产领料单号" enable="false" width="120" align="center"/>
<EF:EFColumn ename="receiptDate" cname="单据日期" width="120" align="center" editType="date"
dateFormat="yyyy-MM-dd" parseFormats="['yyyyMMdd']" required="true"/>
<EF:EFColumn ename="whCode" cname="仓库编码" enable="true" width="120" align="center" required="true"/>
<EF:EFColumn ename="whName" cname="仓库名称" width="120" align="center" enable="false" required="true"/>
<EF:EFComboColumn ename="receiveUserId" cname="领料人" width="120" align="center"
required="true" blockName="user_block_id" textField="textField" valueField="valueField"
columnTemplate="#=textField#" itemTemplate="#=textField#">
</EF:EFComboColumn>
<EF:EFColumn ename="receiveUserName" cname="领料人姓名" width="120" align="center" enable="false" hidden="true"/>
<EF:EFComboColumn cname="状态" ename="status" width="90" align="center" required="false" enable="false">
<EF:EFCodeOption codeName="hggp.sc.productStatus"/>
</EF:EFComboColumn>
</EF:EFGrid>
</EF:EFRegion>
</EF:EFPage> </EF:EFPage>
...@@ -25,18 +25,17 @@ $(function (){ ...@@ -25,18 +25,17 @@ $(function (){
e.preventDefault(); e.preventDefault();
} }
}, },
columns: [ columns: [{
{ field: "inventCode",
field: "inventCode", template: function (item) {
template: function (item) { let template = "";
let template = ""; if (item.inventCode) {
if(item.inventCode){ for (let i = 0; i < inventRecordBoxBlocks.length; i++) {
for(let i=0;i<inventRecordBoxBlocks.length;i++){ if (item.inventCode === inventRecordBoxBlocks[i]['valueField']) {
if(item.inventCode === inventRecordBoxBlocks[i]['valueField']){ template = inventRecordBoxBlocks[i]['valueField'];
template = inventRecordBoxBlocks[i]['valueField']; }
} }
} }
}
return template; return template;
}, },
editor: function (container, options) { editor: function (container, options) {
...@@ -55,8 +54,7 @@ $(function (){ ...@@ -55,8 +54,7 @@ $(function (){
filter: "contains" filter: "contains"
}); });
} }
}, }, {
{
field: "receiveId", field: "receiveId",
template: function (item) { template: function (item) {
item['receiveId'] =$("#inqu_status-0-receiveId").val(); item['receiveId'] =$("#inqu_status-0-receiveId").val();
......
...@@ -40,16 +40,11 @@ let confirm = function () { ...@@ -40,16 +40,11 @@ let confirm = function () {
return; return;
} }
for (let i = 0; i < rows.length; i++) { for (let i = 0; i < rows.length; i++) {
let invQty = rows[i]['invQty']; let applyQty = rows[i]['applyQty'];
let invWeight = rows[i]['invWeight']; if (!isPositiveNumber(applyQty)) {
if (!isPositiveNumber(invQty)) { message("勾选的第" + (i + 1) + "行申请数量必须大于0");
message("勾选的第" + (i + 1) + "行库存数量必须大于0");
return; return;
} }
// if (!isPositiveNumber(invWeight)) {
// message("勾选的第" + (i + 1) + "行库存总重必须大于0");
// return;
// }
} }
JSUtils.confirm("确定对勾选的[" + rows.length + "]条数据进行\"生产领料\"操作吗? ", { JSUtils.confirm("确定对勾选的[" + rows.length + "]条数据进行\"生产领料\"操作吗? ", {
ok: function () { ok: function () {
......
...@@ -39,6 +39,7 @@ ...@@ -39,6 +39,7 @@
<EF:EFColumn ename="inventName" cname="存货名称" enable="false" width="100" align="center"/> <EF:EFColumn ename="inventName" cname="存货名称" enable="false" width="100" align="center"/>
<EF:EFColumn ename="specId" cname="规格ID" enable="false" width="100" align="center" hidden="true"/> <EF:EFColumn ename="specId" cname="规格ID" enable="false" width="100" align="center" hidden="true"/>
<EF:EFColumn ename="spec" cname="规格" enable="false" width="120" align="center"/> <EF:EFColumn ename="spec" cname="规格" enable="false" width="120" align="center"/>
<EF:EFColumn ename="applyQty" cname="申请数量" width="120" align="right" format="{0:N3}" required="true"/>
<EF:EFColumn ename="invQty" cname="库存数量" enable="false" width="120" align="right" format="{0:N3}"/> <EF:EFColumn ename="invQty" cname="库存数量" enable="false" width="120" align="right" format="{0:N3}"/>
<EF:EFColumn ename="invUnitWeight" cname="单重(KG)" enable="false" width="120" align="right" format="{0:N3}"/> <EF:EFColumn ename="invUnitWeight" cname="单重(KG)" enable="false" width="120" align="right" format="{0:N3}"/>
<EF:EFColumn ename="invWeight" cname="库存总重(KG)" enable="false" width="120" align="right" format="{0:N3}"/> <EF:EFColumn ename="invWeight" cname="库存总重(KG)" enable="false" width="120" align="right" format="{0:N3}"/>
......
...@@ -6,6 +6,12 @@ $(function () { ...@@ -6,6 +6,12 @@ $(function () {
resultGrid.dataSource.page(1); resultGrid.dataSource.page(1);
}); });
// 正序排产
$("#BNT_SCHEDULE_EX").on("click", scheduleEx);
// 倒序排产
$("#BNT_SCHEDULE").on("click", schedule);
IPLATUI.EFGrid.result = { IPLATUI.EFGrid.result = {
pageable: { pageable: {
pageSize: 20, pageSize: 20,
...@@ -14,8 +20,6 @@ $(function () { ...@@ -14,8 +20,6 @@ $(function () {
columns: [ columns: [
], ],
loadComplete: function(grid) { loadComplete: function(grid) {
//排产
$("#BNT_SCHEDULE").on("click", schedule);
}, },
onSuccess: function (e) { onSuccess: function (e) {
if (e.eiInfo.extAttr.methodName == 'save' || e.eiInfo.extAttr.methodName == 'delete' if (e.eiInfo.extAttr.methodName == 'save' || e.eiInfo.extAttr.methodName == 'delete'
...@@ -39,7 +43,18 @@ $(window).load(function () { ...@@ -39,7 +43,18 @@ $(window).load(function () {
}); });
/** /**
* 排产 * 正序排产
*/
function schedule() {
JSUtils.confirm("自动排产将覆盖原排产数据,请谨慎操作,确认对当前数据进行排产? ", {
ok: function () {
JSUtils.submitGridsData("result", "HGSC005A", "scheduleEx", true);
}
});
}
/**
* 倒序排产
*/ */
function schedule() { function schedule() {
JSUtils.confirm("自动排产将覆盖原排产数据,请谨慎操作,确认对当前数据进行排产? ", { JSUtils.confirm("自动排产将覆盖原排产数据,请谨慎操作,确认对当前数据进行排产? ", {
......
...@@ -39,10 +39,10 @@ ...@@ -39,10 +39,10 @@
<EF:EFColumn ename="productName" cname="产品名称" width="120" enable="true" align="center" readonly="true"/> <EF:EFColumn ename="productName" cname="产品名称" width="120" enable="true" align="center" readonly="true"/>
<EF:EFColumn ename="processName" cname="工序" width="120" enable="true" align="center" readonly="true"/> <EF:EFColumn ename="processName" cname="工序" width="120" enable="true" align="center" readonly="true"/>
<EF:EFColumn ename="finishDate" cname="交货日期" width="120" enable="true" align="center" readonly="true"/> <EF:EFColumn ename="finishDate" cname="交货日期" width="120" enable="true" align="center" readonly="true"/>
<EF:EFColumn ename="planStartDate" cname="计划开工日期" width="120" enable="true" align="center" editType="date" <EF:EFColumn ename="planStartDate" cname="计划开工日期" width="140" enable="true" align="center" editType="date"
dateFormat="yyyy-MM-dd" parseFormats="['yyyy-MM-dd']" required="true"/> dateFormat="yyyy-MM-dd" parseFormats="['yyyy-MM-dd']" required="true" copy="true"/>
<EF:EFColumn ename="planEndDate" cname="计划完工日期" width="120" enable="true" align="center" editType="date" <EF:EFColumn ename="planEndDate" cname="计划完工日期" width="140" enable="true" align="center" editType="date"
dateFormat="yyyy-MM-dd" parseFormats="['yyyy-MM-dd']" required="true"/> dateFormat="yyyy-MM-dd" parseFormats="['yyyy-MM-dd']" required="true" copy="true"/>
<EF:EFColumn ename="singleWeight" cname="单重(KG)" format="{0:0.00}" editType="text" width="120" enable="true" <EF:EFColumn ename="singleWeight" cname="单重(KG)" format="{0:0.00}" editType="text" width="120" enable="true"
align="center" readonly="true"/> align="center" readonly="true"/>
<EF:EFColumn ename="totalWeight" cname="计划重量(KG)" format="{0:0.00}" editType="text" width="120" <EF:EFColumn ename="totalWeight" cname="计划重量(KG)" format="{0:0.00}" editType="text" width="120"
......
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