Commit cce8f813 by wancheng

pc销售管理和物料清单更新

parent 6f0e87b6
......@@ -110,6 +110,7 @@ public class HPSC002 extends DaoEPBase {
public static final String INSERT = "HPSC002.insert";
public static final String UPDATE = "HPSC002.update";
public static final String DELETE = "HPSC002.delete";
public static final String QUERY_SUM = "HPSC002.querySum";
private Long id;
private String companyCode = " "; /* 企业编码 预留*/
......
......@@ -6,7 +6,9 @@ import com.baosight.hpjx.core.constant.CommonConstant;
import com.baosight.hpjx.core.dao.DaoUtils;
import com.baosight.hpjx.core.security.UserSessionUtils;
import com.baosight.hpjx.hp.constant.HPConstant;
import com.baosight.hpjx.hp.constant.HPSqlConstant;
import com.baosight.hpjx.hp.ds.domain.HPDS002;
import com.baosight.hpjx.hp.kc.domain.HPKC006;
import com.baosight.hpjx.hp.pz.tools.HPPZTools;
import com.baosight.hpjx.hp.sc.domain.*;
import com.baosight.hpjx.hp.sc.tools.HPSCTools;
......@@ -66,7 +68,10 @@ public class ServiceHPSC002 extends ServiceBase {
@Override
public EiInfo query(EiInfo inInfo) {
try {
Map queryRow = EiInfoUtils.getFirstRow(inInfo);
inInfo = super.query(inInfo, HPSC002.QUERY, new HPSC002());
List sum = dao.query(HPSC002.QUERY_SUM, queryRow);
inInfo.getBlock(EiConstant.resultBlock).set(EiConstant.COLUMN_TOTAL_SUM, sum.get(0));
} catch (Exception e) {
LogUtils.setDetailMsg(inInfo, e, "查询失败");
}
......@@ -154,13 +159,13 @@ public class ServiceHPSC002 extends ServiceBase {
hpsc002.setDeliveryDate(DateUtils.formatShort(hpsc002.getDeliveryDate()));
if (hpsc002.getId() == null || hpsc002.getId() == 0) {
hpsc002.setDeliveryDate(DateUtils.formatShort(hpsc002.getDeliveryDate()));
this.add(hpsc002);
inInfo=this.add(hpsc002);
} else {
this.modify(hpsc002);
inInfo=this.modify(hpsc002);
}
}
inInfo.setStatus(EiConstant.STATUS_DEFAULT);
inInfo.setMsg("操作成功!本次对[" + resultRows.size() + "]条数据保存成功!");
/* inInfo.setStatus(EiConstant.STATUS_DEFAULT);
inInfo.setMsg("操作成功!本次对[" + resultRows.size() + "]条数据保存成功!");*/
} catch (Exception e) {
LogUtils.setDetailMsg(inInfo, e, "保存失败");
}
......@@ -198,6 +203,10 @@ public class ServiceHPSC002 extends ServiceBase {
}
DaoUtils.insert("HPSC002.insert", hpsc002.toMap());
//更新零件后,更新部件重量
if(hpsc002.getPrdtType()==3){
this.updatePrdtWt(hpsc002.getParentId());
}
if (!hpsc002.getParentId().equals("root")) {
this.checkTreeNodeLeaf(hpsc002.getParentId());
}
......@@ -490,6 +499,10 @@ public class ServiceHPSC002 extends ServiceBase {
hppz002.setTotalWt(totalWt);
hppz002.setSpec(HPPZTools.HpPz006.jointSpec(hppz002.getLength(),hppz002.getWidth(),hppz002.getThick()));
DaoUtils.update("HPSC002.update", hppz002.toMap());
//更新零件后,更新部件重量
if(hppz002.getPrdtType()==3){
this.updatePrdtWt(hppz002.getParentId());
}
}
public void updateHPSC003(HPSC002 hppz002, HPSC003 HPSC003) {
......@@ -705,6 +718,19 @@ public class ServiceHPSC002 extends ServiceBase {
}
/**
* 更新零件后,更新部件重量
*
* @param parentId
*/
@OperationLogAnnotation(operModul = "物料清单",operType = "修改",operDesc = "更新零件后,更新部件重量")
public void updatePrdtWt(String parentId) {
//1 获取参数
Map queryMap = new HashMap();
queryMap.put("parentId", parentId);
DaoUtils.update("HPSC002.updatePrdtWt", queryMap);
}
/**
* 提交 撤回.
*/
@OperationLogAnnotation(operModul = "物料清单",operType = "提交",operDesc = "提交 撤回")
......
......@@ -202,8 +202,20 @@
<include refid="order"/>
</select>
<!-- 查询统计 -->
<select id="querySum" resultClass="com.baosight.hpjx.hp.kc.domain.HPKC006">
SELECT
COALESCE(SUM(NUM), 0) AS "num", <!-- 数量 -->
COALESCE(SUM(TOTAL_WT), 0) AS "totalWt" <!-- 重量 -->
FROM hpjx.t_hpsc002 WHERE 1=1
AND PARENT_ID NOT IN ('root')
AND DEL_STATUS = 0
<include refid="condition"/>
</select>
<select id="count" resultClass="int">
SELECT COUNT(*) FROM hpjx.t_hpsc002 WHERE 1=1
SELECT COUNT(*)
FROM hpjx.t_hpsc002 WHERE 1=1
AND PARENT_ID NOT IN ('root')
AND DEL_STATUS = 0
<include refid="condition"/>
......@@ -453,6 +465,13 @@
UPDATE hpjx.t_hpsc002 SET FILE_PATH1 = #filePath1# WHERE ID = #id# AND BIZ_TYPE = #bizType#
</update>
<!--更新零件后,更新部件重量-->
<update id="updatePrdtWt">
update hpjx.t_hpsc002
set TOTAL_WT = (select TOTAL_WT from (select sum(TOTAL_WT) as TOTAL_WT from hpjx.t_hpsc002 where PARENT_ID = #parentId#) a),
UNIT_WT = (select TOTAL_WT from (select sum(TOTAL_WT) as TOTAL_WT from hpjx.t_hpsc002 where PARENT_ID = #parentId#) a)/NUM*1000
where ID = #parentId#
</update>
<select id="checkExamineNum1" resultClass="int">
SELECT COUNT(1) from hpjx.t_hpsc002
......
......@@ -68,11 +68,11 @@
<EF:EFColumn enable="false" ename="parentPrdtName" hidden="true" cname="上级部件名称"/>
<EF:EFColumn ename="num" cname="数量" maxLength="15" displayType="0.000" format="{0:N0}"
data-regex="/^-?[0-9]{1,12}([.][0-9]{1,3})?$/"
data-errorprompt="请输入数字,该值最大可设置12位整数和3位小数!"/>
data-errorprompt="请输入数字,该值最大可设置12位整数和3位小数!" sumType="all"/>
<EF:EFColumn ename="unitWt" format="{0:N1}" cname="单重(KG)" maxLength="15" displayType="0.0"
data-regex="/^-?[0-9]{1,12}([.][0-9])?$/"
data-errorprompt="请输入数字,该值最大可设置12位整数和1位小数!"/>
<EF:EFColumn ename="totalWt" cname="总重(T)" enable="false" width="100" align="right" format="{0:N3}"/>
<EF:EFColumn ename="totalWt" cname="总重(T)" enable="false" width="100" align="right" format="{0:N3}" sumType="all"/>
<EF:EFComboColumn enable="false" ename="status" align="center"
columnTemplate="#=textField#" optionLabel=" "
itemTemplate="#=textField#" textField="textField"
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment