Commit 5b393644 by 宋祥

1.优化代码,存货新增时校验逻辑

parent fca2f656
...@@ -131,15 +131,17 @@ public class ServiceHPKC006 extends ServiceBase { ...@@ -131,15 +131,17 @@ public class ServiceHPKC006 extends ServiceBase {
this.setBaseInfo(fKc006); this.setBaseInfo(fKc006);
// 生成入库单号 // 生成入库单号
fKc006.setOtherEnterNo(SequenceGenerator.getNextSequence(HPConstant.SequenceId.OTHER_ENTER_NO)); fKc006.setOtherEnterNo(SequenceGenerator.getNextSequence(HPConstant.SequenceId.OTHER_ENTER_NO));
HPPZ006 hppz006 = HPPZTools.checkAndSavePZ06(fKc006.getInventType(), fKc006.getInventName(), fKc006.getLength(), // 检查规格,如果不存在就新增
fKc006.getWidth(), fKc006.getThick(), fKc006.getCoefficient(), fKc006.getMaterial(), fKc006.getUnit() HPPZ006 dbPz006 = HPPZTools.HpPz006.checkAndSave(fKc006.getInventType(), fKc006.getInventName(),
fKc006.getLength(), fKc006.getWidth(), fKc006.getThick(), fKc006.getCoefficient(), fKc006.getMaterial(),
fKc006.getUnit()
); );
// 根据规格计算单重 // 根据规格计算单重
fKc006.setUnitWeight(HPPZTools.HpPz006.calcUnitWeight(hppz006.getId())); fKc006.setUnitWeight(HPPZTools.HpPz006.calcUnitWeight(dbPz006));
// 计算总重 // 计算总重
fKc006.setWeight(fKc006.getAmount().multiply(fKc006.getUnitWeight())); fKc006.setWeight(fKc006.getAmount().multiply(fKc006.getUnitWeight()));
fKc006.setInventRecordId(hppz006.getId()); fKc006.setInventRecordId(dbPz006.getId());
fKc006.setInventCode(hppz006.getInventCode()); fKc006.setInventCode(dbPz006.getInventCode());
fKc006.setDeleteFlag(CommonConstant.YesNo.NO_0); fKc006.setDeleteFlag(CommonConstant.YesNo.NO_0);
DaoUtils.insert(HPKC006.INSERT, fKc006); DaoUtils.insert(HPKC006.INSERT, fKc006);
// 修改库存 // 修改库存
......
...@@ -116,39 +116,6 @@ public class ServiceHPPZ004 extends ServiceBase { ...@@ -116,39 +116,6 @@ public class ServiceHPPZ004 extends ServiceBase {
} }
return inInfo; return inInfo;
} }
/**
* 判断存货名称是否存在,如果存在返回编码,否则新增并返回编码
* @param inInfo
* @return
*/
@OperationLogAnnotation(operModul = "存货类型",operType = "查询",operDesc = "判断存货名称是否存在,如果存在返回编码,否则新增并返回编码")
public EiInfo checkAndSave(EiInfo inInfo){
String inventType = inInfo.getString("inventType");
String inventName = inInfo.getString("inventName");
List<Map> list = dao.query("HPPZ004.queryByCondition",new HashMap<String,Object>(){{
put("inventType",inventType);
put("inventName",inventName);
}});
HPPZ004 hppz004 = new HPPZ004();
if(CollectionUtils.isNotEmpty(list)){
hppz004.fromMap(list.get(0));
if(hppz004.getDeleteFlag()== CommonConstant.YesNo.YES_1) {
hppz004.setDeleteFlag(CommonConstant.YesNo.NO_0);
DaoUtils.update(HPPZ004.DELETE_BACK, hppz004);
}
}else{
// 生成编码
hppz004.setInventCode(SequenceGenerator.getNextSequence(HPConstant.SequenceId.INVENT_CODE));
hppz004.setInventType(Integer.parseInt(inventType));
hppz004.setInventName(inventName);
hppz004.setStatus(CommonConstant.YesNo.YES_1.intValue());
DaoUtils.insert(HPPZ004.INSERT, hppz004);
}
inInfo.setAttr(new HashMap(){{put("inventCode",hppz004.getInventCode());}});
inInfo.setStatus(EiConstant.STATUS_SUCCESS);
return inInfo;
}
/** /**
* 删除操作 * 删除操作
......
...@@ -5,7 +5,6 @@ import com.baosight.hpjx.common.DdynamicEnum; ...@@ -5,7 +5,6 @@ import com.baosight.hpjx.common.DdynamicEnum;
import com.baosight.hpjx.common.InitiateModeEnum; import com.baosight.hpjx.common.InitiateModeEnum;
import com.baosight.hpjx.core.constant.CommonConstant; import com.baosight.hpjx.core.constant.CommonConstant;
import com.baosight.hpjx.core.dao.DaoUtils; import com.baosight.hpjx.core.dao.DaoUtils;
import com.baosight.hpjx.hp.constant.HPConstant;
import com.baosight.hpjx.hp.kc.domain.HPKC010; import com.baosight.hpjx.hp.kc.domain.HPKC010;
import com.baosight.hpjx.hp.kc.tools.HPKCTools; import com.baosight.hpjx.hp.kc.tools.HPKCTools;
import com.baosight.hpjx.hp.pz.domain.HPPZ006; import com.baosight.hpjx.hp.pz.domain.HPPZ006;
...@@ -20,11 +19,9 @@ import com.baosight.iplat4j.core.ei.EiConstant; ...@@ -20,11 +19,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.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 com.baosight.iplat4j.ed.util.SequenceGenerator;
import org.apache.commons.collections.CollectionUtils; import org.apache.commons.collections.CollectionUtils;
import org.apache.commons.lang.StringUtils; import org.apache.commons.lang.StringUtils;
import java.math.BigDecimal;
import java.util.ArrayList; import java.util.ArrayList;
import java.util.Arrays; import java.util.Arrays;
import java.util.HashMap; import java.util.HashMap;
...@@ -88,7 +85,7 @@ public class ServiceHPPZ006 extends ServiceBase { ...@@ -88,7 +85,7 @@ public class ServiceHPPZ006 extends ServiceBase {
fPz006.fromMap(resultRows.get(i)); fPz006.fromMap(resultRows.get(i));
// 存货名称 // 存货名称
fPz006.setInventName(HPPZTools.HpPz004.getByCode(fPz006.getInventCode()).getInventName()); fPz006.setInventName(HPPZTools.HpPz004.getByCode(fPz006.getInventCode()).getInventName());
fPz006.setSpec(HPPZTools.jointSpec(fPz006.getLength(),fPz006.getWidth(),fPz006.getThick())); fPz006.setSpec(HPPZTools.HpPz006.jointSpec(fPz006.getLength(),fPz006.getWidth(),fPz006.getThick()));
DaoUtils.insert(HPPZ006.INSERT, fPz006); DaoUtils.insert(HPPZ006.INSERT, fPz006);
} }
inInfo = this.query(inInfo); inInfo = this.query(inInfo);
...@@ -141,7 +138,7 @@ public class ServiceHPPZ006 extends ServiceBase { ...@@ -141,7 +138,7 @@ public class ServiceHPPZ006 extends ServiceBase {
fPz006.fromMap(resultRows.get(i)); fPz006.fromMap(resultRows.get(i));
// 存货名称 // 存货名称
fPz006.setInventName(HPPZTools.HpPz004.getByCode(fPz006.getInventCode()).getInventName()); fPz006.setInventName(HPPZTools.HpPz004.getByCode(fPz006.getInventCode()).getInventName());
fPz006.setSpec(HPPZTools.jointSpec(fPz006.getLength(), fPz006.getWidth(), fPz006.getThick())); fPz006.setSpec(HPPZTools.HpPz006.jointSpec(fPz006.getLength(), fPz006.getWidth(), fPz006.getThick()));
DaoUtils.update(HPPZ006.UPDATE, fPz006); DaoUtils.update(HPPZ006.UPDATE, fPz006);
} }
inInfo = this.query(inInfo); inInfo = this.query(inInfo);
...@@ -190,48 +187,6 @@ public class ServiceHPPZ006 extends ServiceBase { ...@@ -190,48 +187,6 @@ public class ServiceHPPZ006 extends ServiceBase {
return inInfo; return inInfo;
} }
/**
* 判断存货档案是否存在,如果存在返回ID,否则新增并返回ID
* @param inInfo
* @return
*/
@OperationLogAnnotation(operModul = "存货档案",operType = "查询",operDesc = "判断存货档案是否存在,如果存在返回ID,否则新增并返回ID")
public EiInfo checkAndSave(EiInfo inInfo){
inInfo.setCell(EiConstant.queryBlock,0,HPPZ006.FIELD_INVENT_TYPE,inInfo.getString("inventType"));
inInfo.setCell(EiConstant.queryBlock,0,HPPZ006.FIELD_INVENT_CODE,inInfo.getString("inventCode"));
inInfo.setCell(EiConstant.queryBlock,0,HPPZ006.FIELD_INVENT_NAME,inInfo.getString("inventName"));
inInfo.setCell(EiConstant.queryBlock,0,HPPZ006.FIELD_LENGTH,inInfo.getString("length"));
inInfo.setCell(EiConstant.queryBlock,0,HPPZ006.FIELD_WIDTH,inInfo.getString("width"));
inInfo.setCell(EiConstant.queryBlock,0,HPPZ006.FIELD_THICK,inInfo.getString("thick"));
inInfo.setCell(EiConstant.queryBlock,0,HPPZ006.FIELD_MATERIAL,inInfo.getString("material"));
inInfo.setCell(EiConstant.queryBlock,0,HPPZ006.FIELD_COEFFICIENT,inInfo.getString("coefficient"));
inInfo.setCell(EiConstant.queryBlock,0,HPPZ006.FIELD_UNIT,inInfo.getString("unit"));
EiInfo eiInfo = super.query(inInfo,"HPPZ006.queryByCondition", new HPPZ006());
HPPZ006 hppz006 = new HPPZ006();
if(CollectionUtils.isNotEmpty(eiInfo.getBlock(EiConstant.resultBlock).getRows())){
Map map = (Map) eiInfo.getBlock(EiConstant.resultBlock).getRows().get(0);
hppz006.fromMap(map);
}else{
// 生成编码
hppz006.setInventType(Integer.parseInt(inInfo.getString("inventType")));
hppz006.setInventCode(inInfo.getString("inventCode"));
hppz006.setInventName(inInfo.getString("inventName"));
hppz006.setLength(new BigDecimal(inInfo.getString("length")));
hppz006.setWidth(new BigDecimal(inInfo.getString("width")));
hppz006.setThick(new BigDecimal(inInfo.getString("thick")));
hppz006.setMaterial(inInfo.getString("material"));
hppz006.setCoefficient(new BigDecimal(inInfo.getString("coefficient")));
hppz006.setUnit(inInfo.getString("unit"));
hppz006.setStatus(CommonConstant.YesNo.YES_1.intValue());
hppz006.setSpec(HPPZTools.jointSpec(hppz006.getLength(),hppz006.getWidth(),hppz006.getThick()));
DaoUtils.insert(HPPZ006.INSERT, hppz006);
}
inInfo.setAttr(new HashMap(){{put("obj",hppz006);}});
inInfo.setStatus(EiConstant.STATUS_SUCCESS);
return inInfo;
}
/** /**
* 规格下拉框 * 规格下拉框
* *
......
...@@ -36,15 +36,21 @@ ...@@ -36,15 +36,21 @@
<isNotEmpty prepend=" AND " property="inventCode"> <isNotEmpty prepend=" AND " property="inventCode">
INVENT_CODE = #inventCode# INVENT_CODE = #inventCode#
</isNotEmpty> </isNotEmpty>
<isNotEmpty prepend=" AND " property="inventName">
INVENT_NAME LIKE CONCAT('%', #inventName#, '%')
</isNotEmpty>
<isNotEmpty prepend=" AND " property="status"> <isNotEmpty prepend=" AND " property="status">
STATUS = #status# STATUS = #status#
</isNotEmpty> </isNotEmpty>
</sql> </sql>
<sql id="getCondition">
<isNotEmpty prepend=" AND " property="inventName">
INVENT_NAME = #inventName#
</isNotEmpty>
</sql>
<sql id="customCondition"> <sql id="customCondition">
<isNotEmpty prepend=" AND " property="inventName">
INVENT_NAME LIKE CONCAT('%', #inventName#, '%')
</isNotEmpty>
<isNotEmpty prepend=" AND " property="inventTypes"> <isNotEmpty prepend=" AND " property="inventTypes">
INVENT_TYPE IN <iterate close=")" open="(" conjunction="," property="inventTypes">#inventTypes[]#</iterate> INVENT_TYPE IN <iterate close=")" open="(" conjunction="," property="inventTypes">#inventTypes[]#</iterate>
</isNotEmpty> </isNotEmpty>
...@@ -73,6 +79,15 @@ ...@@ -73,6 +79,15 @@
<include refid="order"/> <include refid="order"/>
</select> </select>
<select id="get" resultClass="com.baosight.hpjx.hp.pz.domain.HPPZ004">
SELECT
<include refid="column"/>
FROM hpjx.t_hppz004 WHERE 1=1
<include refid="condition"/>
<include refid="getCondition"/>
<include refid="order"/>
</select>
<select id="queryByCondition" resultClass="java.util.HashMap"> <select id="queryByCondition" resultClass="java.util.HashMap">
SELECT SELECT
<include refid="column"/> <include refid="column"/>
......
...@@ -45,6 +45,24 @@ ...@@ -45,6 +45,24 @@
<isNotEmpty prepend=" AND " property="inventName"> <isNotEmpty prepend=" AND " property="inventName">
INVENT_NAME = #inventName# INVENT_NAME = #inventName#
</isNotEmpty> </isNotEmpty>
<isNotNull prepend=" AND " property="length">
LENGTH = #length#
</isNotNull>
<isNotNull prepend=" AND " property="width">
WIDTH = #width#
</isNotNull>
<isNotNull prepend=" AND " property="thick">
THICK = #thick#
</isNotNull>
<isNotNull prepend=" AND " property="material">
MATERIAL = #material#
</isNotNull>
<isNotNull prepend=" AND " property="coefficient">
COEFFICIENT = #coefficient#
</isNotNull>
<isNotNull prepend=" AND " property="unit">
UNIT = #unit#
</isNotNull>
<isNotEmpty prepend=" AND " property="status"> <isNotEmpty prepend=" AND " property="status">
STATUS = #status# STATUS = #status#
</isNotEmpty> </isNotEmpty>
...@@ -53,6 +71,10 @@ ...@@ -53,6 +71,10 @@
</isNotNull> </isNotNull>
</sql> </sql>
<sql id="getCondition">
</sql>
<sql id="customCondition"> <sql id="customCondition">
<isNotEmpty prepend=" AND " property="inventTypes"> <isNotEmpty prepend=" AND " property="inventTypes">
INVENT_TYPE IN <iterate close=")" open="(" conjunction="," property="inventTypes">#inventTypes[]#</iterate> INVENT_TYPE IN <iterate close=")" open="(" conjunction="," property="inventTypes">#inventTypes[]#</iterate>
......
...@@ -99,11 +99,11 @@ public class ServiceHPSC002 extends ServiceBase { ...@@ -99,11 +99,11 @@ public class ServiceHPSC002 extends ServiceBase {
// if (StringUtils.isNotEmpty(hppz002.getPrdtCode()) && !hppz002.getParentId().equals("root")) { // if (StringUtils.isNotEmpty(hppz002.getPrdtCode()) && !hppz002.getParentId().equals("root")) {
// hppz002.setPrdtName(HPPZTools.getPz004ByCode(hppz002.getPrdtCode()).getInventName()); // hppz002.setPrdtName(HPPZTools.getPz004ByCode(hppz002.getPrdtCode()).getInventName());
// } // }
hppz002.setSpec(HPPZTools.jointSpec(hppz002.getLength(),hppz002.getWidth(),hppz002.getThick())); hppz002.setSpec(HPPZTools.HpPz006.jointSpec(hppz002.getLength(),hppz002.getWidth(),hppz002.getThick()));
if(hppz002.getParentId().equals("root")){ if(hppz002.getParentId().equals("root")){
hppz002.setLv(new Integer(1)); hppz002.setLv(new Integer(1));
}else{ }else{
hppz002.setPrdtCode(HPPZTools.checkAndSavePZ04(hppz002.getPrdtType(),hppz002.getPrdtName())); hppz002.setPrdtCode(HPPZTools.HpPz004.checkAndSave(hppz002.getPrdtType(),hppz002.getPrdtName()));
Integer lv = (Integer) this.dao.get("HPSC002.queryLv","id",hppz002.getParentId()); Integer lv = (Integer) this.dao.get("HPSC002.queryLv","id",hppz002.getParentId());
hppz002.setLv(lv.intValue()+1); hppz002.setLv(lv.intValue()+1);
} }
...@@ -171,7 +171,7 @@ public class ServiceHPSC002 extends ServiceBase { ...@@ -171,7 +171,7 @@ public class ServiceHPSC002 extends ServiceBase {
hpsc005.setPrdtLength(hppz002.getLength()); hpsc005.setPrdtLength(hppz002.getLength());
hpsc005.setPrdtWidth(hppz002.getWidth()); hpsc005.setPrdtWidth(hppz002.getWidth());
hpsc005.setPrdtThick(hppz002.getThick()); hpsc005.setPrdtThick(hppz002.getThick());
hpsc005.setPrdtSpec(HPPZTools.jointSpec(hpsc005.getPrdtLength(),hpsc005.getPrdtWidth(),hpsc005.getPrdtThick())); hpsc005.setPrdtSpec(HPPZTools.HpPz006.jointSpec(hpsc005.getPrdtLength(),hpsc005.getPrdtWidth(),hpsc005.getPrdtThick()));
DaoUtils.update("HPSC005.update", hpsc005.toMap()); DaoUtils.update("HPSC005.update", hpsc005.toMap());
} }
} }
...@@ -210,7 +210,7 @@ public class ServiceHPSC002 extends ServiceBase { ...@@ -210,7 +210,7 @@ public class ServiceHPSC002 extends ServiceBase {
HPSC005.setNum(hppz002.getNum()); HPSC005.setNum(hppz002.getNum());
HPSC005.setUnitWt(hppz002.getUnitWt()); HPSC005.setUnitWt(hppz002.getUnitWt());
HPSC005.setTotalWt(hppz002.getTotalWt()); HPSC005.setTotalWt(hppz002.getTotalWt());
HPSC005.setPartSpec(HPPZTools.jointSpec(HPSC005.getPartLength(),HPSC005.getPartWidth(),HPSC005.getPartThick())); HPSC005.setPartSpec(HPPZTools.HpPz006.jointSpec(HPSC005.getPartLength(),HPSC005.getPartWidth(),HPSC005.getPartThick()));
DaoUtils.update("HPSC005.update", HPSC005.toMap()); DaoUtils.update("HPSC005.update", HPSC005.toMap());
} }
} else { } else {
...@@ -243,7 +243,7 @@ public class ServiceHPSC002 extends ServiceBase { ...@@ -243,7 +243,7 @@ public class ServiceHPSC002 extends ServiceBase {
BigDecimal totalWt = new BigDecimal(decimalFormat.format(Math.round(num.multiply(unitWt).floatValue()))); BigDecimal totalWt = new BigDecimal(decimalFormat.format(Math.round(num.multiply(unitWt).floatValue())));
hppz002.setDelStatus(CommonConstant.YesNo.NO_0.intValue()); hppz002.setDelStatus(CommonConstant.YesNo.NO_0.intValue());
hppz002.setTotalWt(totalWt); hppz002.setTotalWt(totalWt);
hppz002.setSpec(HPPZTools.jointSpec(hppz002.getLength(),hppz002.getWidth(),hppz002.getThick())); hppz002.setSpec(HPPZTools.HpPz006.jointSpec(hppz002.getLength(),hppz002.getWidth(),hppz002.getThick()));
DaoUtils.update("HPSC002.update", hppz002.toMap()); DaoUtils.update("HPSC002.update", hppz002.toMap());
} }
...@@ -251,7 +251,7 @@ public class ServiceHPSC002 extends ServiceBase { ...@@ -251,7 +251,7 @@ public class ServiceHPSC002 extends ServiceBase {
HPSC003.setLength(hppz002.getLength()); HPSC003.setLength(hppz002.getLength());
HPSC003.setWidth(hppz002.getWidth()); HPSC003.setWidth(hppz002.getWidth());
HPSC003.setThick(hppz002.getThick()); HPSC003.setThick(hppz002.getThick());
HPSC003.setSpec(HPPZTools.jointSpec(HPSC003.getLength(),HPSC003.getWidth(),HPSC003.getThick())); HPSC003.setSpec(HPPZTools.HpPz006.jointSpec(HPSC003.getLength(),HPSC003.getWidth(),HPSC003.getThick()));
DaoUtils.update("HPSC003.update", HPSC003.toMap()); DaoUtils.update("HPSC003.update", HPSC003.toMap());
} }
...@@ -262,7 +262,7 @@ public class ServiceHPSC002 extends ServiceBase { ...@@ -262,7 +262,7 @@ public class ServiceHPSC002 extends ServiceBase {
HPSC004.setNum(hppz002.getNum()); HPSC004.setNum(hppz002.getNum());
HPSC004.setUnitWt(hppz002.getUnitWt()); HPSC004.setUnitWt(hppz002.getUnitWt());
HPSC004.setTotalWt(hppz002.getTotalWt()); HPSC004.setTotalWt(hppz002.getTotalWt());
HPSC004.setSpec(HPPZTools.jointSpec(HPSC004.getLength(),HPSC004.getWidth(),HPSC004.getThick())); HPSC004.setSpec(HPPZTools.HpPz006.jointSpec(HPSC004.getLength(),HPSC004.getWidth(),HPSC004.getThick()));
DaoUtils.update("HPSC004.update", HPSC004.toMap()); DaoUtils.update("HPSC004.update", HPSC004.toMap());
} }
......
...@@ -106,13 +106,13 @@ public class ServiceHPSC006 extends ServiceBase { ...@@ -106,13 +106,13 @@ public class ServiceHPSC006 extends ServiceBase {
BigDecimal unitWt = HPSC006.getUnitWt(); BigDecimal unitWt = HPSC006.getUnitWt();
DecimalFormat decimalFormat = new DecimalFormat("#.000"); DecimalFormat decimalFormat = new DecimalFormat("#.000");
BigDecimal totalWt = new BigDecimal(decimalFormat.format(Math.round(num.multiply(unitWt).floatValue()))); BigDecimal totalWt = new BigDecimal(decimalFormat.format(Math.round(num.multiply(unitWt).floatValue())));
HPSC006.setInventSpec(HPPZTools.jointSpec(HPSC006.getInventLength(),HPSC006.getInventWidth(),HPSC006.getInventThick())); HPSC006.setInventSpec(HPPZTools.HpPz006.jointSpec(HPSC006.getInventLength(),HPSC006.getInventWidth(),HPSC006.getInventThick()));
HPSC006.setProjCode(projCode); HPSC006.setProjCode(projCode);
HPSC006.setProjName(projName); HPSC006.setProjName(projName);
HPSC006.setProductionOrderNo(productionOrderNo); HPSC006.setProductionOrderNo(productionOrderNo);
HPSC006.setStatus(CommonConstant.YesNo.NO_0.intValue()); HPSC006.setStatus(CommonConstant.YesNo.NO_0.intValue());
HPSC006.setTotalWt(totalWt); HPSC006.setTotalWt(totalWt);
HPSC006.setInventCode(HPPZTools.checkAndSavePZ04(HPSC006.getInventType(),HPSC006.getInventName())); HPSC006.setInventCode(HPPZTools.HpPz004.checkAndSave(HPSC006.getInventType(),HPSC006.getInventName()));
if(HPSC006.getFactoryCode()!=null && !(HPSC006.getFactoryCode().equals(" "))) { if(HPSC006.getFactoryCode()!=null && !(HPSC006.getFactoryCode().equals(" "))) {
AssertUtils.isEmpty(HPSC006.getOrgNo(), "已选择厂区,下料组不能为空"); AssertUtils.isEmpty(HPSC006.getOrgNo(), "已选择厂区,下料组不能为空");
HPSC006.setStatus(1); HPSC006.setStatus(1);
...@@ -152,12 +152,12 @@ public class ServiceHPSC006 extends ServiceBase { ...@@ -152,12 +152,12 @@ public class ServiceHPSC006 extends ServiceBase {
BigDecimal unitWt = HPSC006.getUnitWt(); BigDecimal unitWt = HPSC006.getUnitWt();
DecimalFormat decimalFormat = new DecimalFormat("#.000"); DecimalFormat decimalFormat = new DecimalFormat("#.000");
BigDecimal totalWt = new BigDecimal(decimalFormat.format(Math.round(num.multiply(unitWt).floatValue()))); BigDecimal totalWt = new BigDecimal(decimalFormat.format(Math.round(num.multiply(unitWt).floatValue())));
HPSC006.setInventSpec(HPPZTools.jointSpec(HPSC006.getInventLength(),HPSC006.getInventWidth(),HPSC006.getInventThick())); HPSC006.setInventSpec(HPPZTools.HpPz006.jointSpec(HPSC006.getInventLength(),HPSC006.getInventWidth(),HPSC006.getInventThick()));
HPSC006.setProjCode(projCode); HPSC006.setProjCode(projCode);
HPSC006.setProjName(projName); HPSC006.setProjName(projName);
HPSC006.setProductionOrderNo(productionOrderNo); HPSC006.setProductionOrderNo(productionOrderNo);
HPSC006.setTotalWt(totalWt); HPSC006.setTotalWt(totalWt);
HPSC006.setInventCode(HPPZTools.checkAndSavePZ04(HPSC006.getInventType(),HPSC006.getInventName())); HPSC006.setInventCode(HPPZTools.HpPz004.checkAndSave(HPSC006.getInventType(),HPSC006.getInventName()));
DaoUtils.update("HPSC006.update",HPSC006); DaoUtils.update("HPSC006.update",HPSC006);
} }
inInfo.setStatus(EiConstant.STATUS_SUCCESS); inInfo.setStatus(EiConstant.STATUS_SUCCESS);
......
...@@ -282,8 +282,8 @@ public class ExcelUtils { ...@@ -282,8 +282,8 @@ public class ExcelUtils {
HPSC002.setDelStatus(CommonConstant.YesNo.NO_0.intValue()); HPSC002.setDelStatus(CommonConstant.YesNo.NO_0.intValue());
HPSC002.setStatus(CommonConstant.YesNo.NO_0.intValue()); HPSC002.setStatus(CommonConstant.YesNo.NO_0.intValue());
HPSC002.setTotalWt(totalWt); HPSC002.setTotalWt(totalWt);
HPSC002.setSpec(HPPZTools.jointSpec(HPSC002.getLength(),HPSC002.getWidth(),HPSC002.getThick())); HPSC002.setSpec(HPPZTools.HpPz006.jointSpec(HPSC002.getLength(),HPSC002.getWidth(),HPSC002.getThick()));
HPSC002.setPrdtCode(HPPZTools.checkAndSavePZ04(HPSC002.getPrdtType(),HPSC002.getPrdtName())); HPSC002.setPrdtCode(HPPZTools.HpPz004.checkAndSave(HPSC002.getPrdtType(),HPSC002.getPrdtName()));
if (!checkStatus) { if (!checkStatus) {
checkOkBlock.addRow(HPSC002.toMap()); checkOkBlock.addRow(HPSC002.toMap());
} }
...@@ -317,10 +317,10 @@ public class ExcelUtils { ...@@ -317,10 +317,10 @@ public class ExcelUtils {
BigDecimal unitWt = HPSC006.getUnitWt(); BigDecimal unitWt = HPSC006.getUnitWt();
DecimalFormat decimalFormat = new DecimalFormat("#.000"); DecimalFormat decimalFormat = new DecimalFormat("#.000");
BigDecimal totalWt = new BigDecimal(decimalFormat.format(Math.round(num.multiply(unitWt).floatValue()))); BigDecimal totalWt = new BigDecimal(decimalFormat.format(Math.round(num.multiply(unitWt).floatValue())));
HPSC006.setInventSpec(HPPZTools.jointSpec(HPSC006.getInventLength(),HPSC006.getInventWidth(),HPSC006.getInventThick())); HPSC006.setInventSpec(HPPZTools.HpPz006.jointSpec(HPSC006.getInventLength(),HPSC006.getInventWidth(),HPSC006.getInventThick()));
HPSC006.setStatus(CommonConstant.YesNo.NO_0.intValue()); HPSC006.setStatus(CommonConstant.YesNo.NO_0.intValue());
HPSC006.setTotalWt(totalWt); HPSC006.setTotalWt(totalWt);
HPSC006.setInventCode(HPPZTools.checkAndSavePZ04(HPSC006.getInventType(),HPSC006.getInventName())); HPSC006.setInventCode(HPPZTools.HpPz004.checkAndSave(HPSC006.getInventType(),HPSC006.getInventName()));
if (!checkStatus) { if (!checkStatus) {
checkOkBlock.addRow(HPSC006.toMap()); checkOkBlock.addRow(HPSC006.toMap());
} }
......
...@@ -56,7 +56,7 @@ ...@@ -56,7 +56,7 @@
<EF:EFColumn ename="inventCode" cname="存货名称" width="120" align="center" required="true" readonly="true" <EF:EFColumn ename="inventCode" cname="存货名称" width="120" align="center" required="true" readonly="true"
hidden="true"/> hidden="true"/>
<EF:EFColumn ename="inventName" cname="存货名称" width="120" align="center" required="true" readonly="true"/> <EF:EFColumn ename="inventName" cname="存货名称" width="120" align="center" required="true" readonly="true"/>
<EF:EFColumn ename="inventRecordId" cname="规格" width="120" align="center" required="false" readonly="true"/> <EF:EFColumn ename="inventRecordId" cname="规格" width="120" align="center" required="true" readonly="true"/>
<EF:EFColumn ename="amount" cname="数量" format="{0:N3}" maxLength="20" width="100" align="right" <EF:EFColumn ename="amount" cname="数量" format="{0:N3}" maxLength="20" width="100" align="right"
sumType="all" required="true" readonly="true"/> sumType="all" required="true" readonly="true"/>
<EF:EFColumn ename="unitWeight" cname="单重" enable="false" width="100" align="right" format="{0:N3}"/> <EF:EFColumn ename="unitWeight" cname="单重" enable="false" width="100" align="right" format="{0:N3}"/>
......
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