Commit 8374a3d3 by 宋祥

1.计划明细增加计划行号

parent cb9ba8d3
...@@ -36,6 +36,7 @@ public class HGCG001A extends DaoEPBase { ...@@ -36,6 +36,7 @@ public class HGCG001A extends DaoEPBase {
public static final String FIELD_COMPANY_NAME = "companyName"; /* 公司名称*/ public static final String FIELD_COMPANY_NAME = "companyName"; /* 公司名称*/
public static final String FIELD_PLAN_DATE = "planDate"; /* 计划日期*/ public static final String FIELD_PLAN_DATE = "planDate"; /* 计划日期*/
public static final String FIELD_PLAN_NO = "planNo"; /* 计划单号*/ public static final String FIELD_PLAN_NO = "planNo"; /* 计划单号*/
public static final String FIELD_PLAN_LINE_NO = "planLineNo"; /* 计划单行号*/
public static final String FIELD_INVENT_TYPE = "inventType"; /* 存货类型*/ public static final String FIELD_INVENT_TYPE = "inventType"; /* 存货类型*/
public static final String FIELD_INVENT_CODE = "inventCode"; /* 存货编码*/ public static final String FIELD_INVENT_CODE = "inventCode"; /* 存货编码*/
public static final String FIELD_INVENT_NAME = "inventName"; /* 存货名称*/ public static final String FIELD_INVENT_NAME = "inventName"; /* 存货名称*/
...@@ -122,6 +123,7 @@ public class HGCG001A extends DaoEPBase { ...@@ -122,6 +123,7 @@ public class HGCG001A extends DaoEPBase {
private String companyName = " "; /* 公司名称*/ private String companyName = " "; /* 公司名称*/
private String planDate = " "; /* 计划日期*/ private String planDate = " "; /* 计划日期*/
private String planNo = " "; /* 计划单号*/ private String planNo = " "; /* 计划单号*/
private String planLineNo = " "; /* 计划单行号*/
private String inventType = " "; /* 存货类型*/ private String inventType = " "; /* 存货类型*/
private String inventCode = " "; /* 存货编码*/ private String inventCode = " "; /* 存货编码*/
private String inventName = " "; /* 存货名称*/ private String inventName = " "; /* 存货名称*/
...@@ -216,7 +218,11 @@ public class HGCG001A extends DaoEPBase { ...@@ -216,7 +218,11 @@ public class HGCG001A extends DaoEPBase {
eiColumn = new EiColumn(FIELD_PLAN_NO); eiColumn = new EiColumn(FIELD_PLAN_NO);
eiColumn.setDescName("计划单号"); eiColumn.setDescName("计划单号");
eiMetadata.addMeta(eiColumn); eiMetadata.addMeta(eiColumn);
eiColumn = new EiColumn(FIELD_PLAN_LINE_NO);
eiColumn.setDescName("计划单行号");
eiMetadata.addMeta(eiColumn);
eiColumn = new EiColumn(FIELD_INVENT_TYPE); eiColumn = new EiColumn(FIELD_INVENT_TYPE);
eiColumn.setDescName("存货类型"); eiColumn.setDescName("存货类型");
eiMetadata.addMeta(eiColumn); eiMetadata.addMeta(eiColumn);
...@@ -984,6 +990,14 @@ public class HGCG001A extends DaoEPBase { ...@@ -984,6 +990,14 @@ public class HGCG001A extends DaoEPBase {
this.calculationMethod = calculationMethod; this.calculationMethod = calculationMethod;
} }
public String getPlanLineNo() {
return planLineNo;
}
public void setPlanLineNo(String planLineNo) {
this.planLineNo = planLineNo;
}
/** /**
* get the value from Map. * get the value from Map.
* *
...@@ -1006,6 +1020,7 @@ public class HGCG001A extends DaoEPBase { ...@@ -1006,6 +1020,7 @@ public class HGCG001A extends DaoEPBase {
setCompanyName(StringUtils.defaultIfEmpty(StringUtils.toString(map.get(FIELD_COMPANY_NAME)), companyName)); setCompanyName(StringUtils.defaultIfEmpty(StringUtils.toString(map.get(FIELD_COMPANY_NAME)), companyName));
setPlanDate(StringUtils.defaultIfEmpty(StringUtils.toString(map.get(FIELD_PLAN_DATE)), planDate)); setPlanDate(StringUtils.defaultIfEmpty(StringUtils.toString(map.get(FIELD_PLAN_DATE)), planDate));
setPlanNo(StringUtils.defaultIfEmpty(StringUtils.toString(map.get(FIELD_PLAN_NO)), planNo)); setPlanNo(StringUtils.defaultIfEmpty(StringUtils.toString(map.get(FIELD_PLAN_NO)), planNo));
setPlanLineNo(StringUtils.defaultIfEmpty(StringUtils.toString(map.get(FIELD_PLAN_LINE_NO)), planLineNo));
setInventType(StringUtils.defaultIfEmpty(StringUtils.toString(map.get(FIELD_INVENT_TYPE)), inventType)); setInventType(StringUtils.defaultIfEmpty(StringUtils.toString(map.get(FIELD_INVENT_TYPE)), inventType));
setInventCode(StringUtils.defaultIfEmpty(StringUtils.toString(map.get(FIELD_INVENT_CODE)), inventCode)); setInventCode(StringUtils.defaultIfEmpty(StringUtils.toString(map.get(FIELD_INVENT_CODE)), inventCode));
setInventName(StringUtils.defaultIfEmpty(StringUtils.toString(map.get(FIELD_INVENT_NAME)), inventName)); setInventName(StringUtils.defaultIfEmpty(StringUtils.toString(map.get(FIELD_INVENT_NAME)), inventName));
...@@ -1059,6 +1074,7 @@ public class HGCG001A extends DaoEPBase { ...@@ -1059,6 +1074,7 @@ public class HGCG001A extends DaoEPBase {
map.put(FIELD_COMPANY_NAME, StringUtils.toString(companyName, eiMetadata.getMeta(FIELD_COMPANY_NAME))); map.put(FIELD_COMPANY_NAME, StringUtils.toString(companyName, eiMetadata.getMeta(FIELD_COMPANY_NAME)));
map.put(FIELD_PLAN_DATE, StringUtils.toString(planDate, eiMetadata.getMeta(FIELD_PLAN_DATE))); map.put(FIELD_PLAN_DATE, StringUtils.toString(planDate, eiMetadata.getMeta(FIELD_PLAN_DATE)));
map.put(FIELD_PLAN_NO, StringUtils.toString(planNo, eiMetadata.getMeta(FIELD_PLAN_NO))); map.put(FIELD_PLAN_NO, StringUtils.toString(planNo, eiMetadata.getMeta(FIELD_PLAN_NO)));
map.put(FIELD_PLAN_LINE_NO, StringUtils.toString(planLineNo, eiMetadata.getMeta(FIELD_PLAN_LINE_NO)));
map.put(FIELD_INVENT_TYPE, StringUtils.toString(inventType, eiMetadata.getMeta(FIELD_INVENT_TYPE))); 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))); map.put(FIELD_INVENT_CODE, StringUtils.toString(inventCode, eiMetadata.getMeta(FIELD_INVENT_CODE)));
map.put(FIELD_INVENT_NAME, StringUtils.toString(inventName, eiMetadata.getMeta(FIELD_INVENT_NAME))); map.put(FIELD_INVENT_NAME, StringUtils.toString(inventName, eiMetadata.getMeta(FIELD_INVENT_NAME)));
......
...@@ -22,6 +22,7 @@ import com.baosight.hggp.util.contants.ACConstants; ...@@ -22,6 +22,7 @@ import com.baosight.hggp.util.contants.ACConstants;
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.service.impl.ServiceBase; import com.baosight.iplat4j.core.service.impl.ServiceBase;
import com.baosight.iplat4j.ed.util.SequenceGenerator;
import java.math.BigDecimal; import java.math.BigDecimal;
import java.math.RoundingMode; import java.math.RoundingMode;
...@@ -121,25 +122,33 @@ public class ServiceHGCG001A extends ServiceBase { ...@@ -121,25 +122,33 @@ public class ServiceHGCG001A extends ServiceBase {
AssertUtils.isGe(BigDecimal.ZERO, fCg001a.getPurWeight(), String.format("计划明细[%s]采购重量必须大于0", fCg001a.getInventCode())); AssertUtils.isGe(BigDecimal.ZERO, fCg001a.getPurWeight(), String.format("计划明细[%s]采购重量必须大于0", fCg001a.getInventCode()));
} }
} }
/** /**
* 数据保存 * 数据保存
* *
* @param fCg001s * @param fCg001s
*/ */
private void saveData(List<HGCG001A> fCg001s,HGCG001 cg001) { private void saveData(List<HGCG001A> fCg001s, HGCG001 dbCg001) {
for (HGCG001A fCg001a : fCg001s) { for (HGCG001A fCg001a : fCg001s) {
fCg001a.setPurUnitWeight(fCg001a.getPurWeight().divide(fCg001a.getPurQty(), 3, RoundingMode.HALF_UP)); fCg001a.setPurUnitWeight(fCg001a.getPurWeight().divide(fCg001a.getPurQty(), 3, RoundingMode.HALF_UP));
if(fCg001a.getId() == null || fCg001a.getId() == 0){ if (fCg001a.getId() == null || fCg001a.getId() == 0) {
BeanUtils.copyProperties(cg001,fCg001a,"id","createdBy","createdName","createdTime","updatedBy","updatedName","updatedTime", fCg001a.setPlanDate(dbCg001.getPlanDate());
"inventType","inventTypeDetail","inventCode","inventName","spec","material","unit","length","width","thick","purQty","purUnitWeight","purWeight"); fCg001a.setPlanNo(dbCg001.getPlanNo());
fCg001a.setPlanLineNo(SequenceGenerator.getNextSequence(HGConstant.SequenceId.CG_PLAN_LINE_NO,
new String[]{dbCg001.getPlanNo()}));
fCg001a.setCompanyCode(dbCg001.getCompanyCode());
fCg001a.setCompanyName(dbCg001.getCompanyName());
fCg001a.setProjCode(dbCg001.getProjCode());
fCg001a.setProjName(dbCg001.getProjName());
fCg001a.setStatus(HGConstant.CgPlanStatus.S_0);
fCg001a.setDeleteFlag(DeleteFlagEnum.UN_REMOVE.getCode());
DaoUtils.insert(HGCG001A.INSERT, fCg001a); DaoUtils.insert(HGCG001A.INSERT, fCg001a);
}else{ } else {
DaoUtils.update(HGCG001A.UPDATE, fCg001a); DaoUtils.update(HGCG001A.UPDATE, fCg001a);
} }
} }
//修改主表数量 //修改主表数量
updateCg001Pur(cg001); updateCg001Pur(dbCg001);
} }
private void updateCg001Pur(HGCG001 cg001) { private void updateCg001Pur(HGCG001 cg001) {
......
...@@ -99,6 +99,8 @@ public class HGConstant { ...@@ -99,6 +99,8 @@ public class HGConstant {
public static final String APPLY_CODE = "APPLY_CODE"; public static final String APPLY_CODE = "APPLY_CODE";
// 采购计划号 // 采购计划号
public static final String CG_PLAN_NO = "CG_PLAN_NO"; public static final String CG_PLAN_NO = "CG_PLAN_NO";
// 采购计划行号
public static final String CG_PLAN_LINE_NO = "CG_PLAN_LINE_NO";
// 采购合同号 // 采购合同号
public static final String CG_CONTRACT_NO = "CG_CONTRACT_NO"; public static final String CG_CONTRACT_NO = "CG_CONTRACT_NO";
// 采购合同行号 // 采购合同行号
......
...@@ -268,6 +268,8 @@ public class ServiceHGSC009A extends ServiceBase { ...@@ -268,6 +268,8 @@ public class ServiceHGSC009A extends ServiceBase {
cg001A.setPlanWeight(hgsc009A.getGrossAmount()); cg001A.setPlanWeight(hgsc009A.getGrossAmount());
cg001A.setPlanQty(hgsc009A.getQuantity()); cg001A.setPlanQty(hgsc009A.getQuantity());
cg001A.setPlanNo(hgcg001.getPlanNo()); cg001A.setPlanNo(hgcg001.getPlanNo());
cg001A.setPlanLineNo(SequenceGenerator.getNextSequence(HGConstant.SequenceId.CG_PLAN_LINE_NO,
new String[]{hgcg001.getPlanNo()}));
cg001A.setUnit(finalPz005Map.get(hgsc009A.getInventCode()).getUnit()); cg001A.setUnit(finalPz005Map.get(hgsc009A.getInventCode()).getUnit());
cg001A.setInventType(finalPz005Map.get(hgsc009A.getInventCode()).getInventType()); cg001A.setInventType(finalPz005Map.get(hgsc009A.getInventCode()).getInventType());
DaoUtils.insert(HGCG001A.INSERT, cg001A); DaoUtils.insert(HGCG001A.INSERT, cg001A);
......
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