Commit 7236844f by 宋祥

Merge remote-tracking branch 'origin/dev' into dev

parents e175a729 00281a1d
...@@ -249,9 +249,14 @@ public enum DdynamicEnum { ...@@ -249,9 +249,14 @@ public enum DdynamicEnum {
* 用途:厂区查询 * 用途:厂区查询
* 编写:ly * 编写:ly
*/ */
FACTORY_CODE_BLOCK_ID("factory_code_block_id","factoryCode","factoryName","HPXS001.queryFactoryCode"); FACTORY_CODE_BLOCK_ID("factory_code_block_id","factoryCode","factoryName","HPXS001.queryFactoryCode"),
/**
* 模块:工人管理
* 用途:工人管理下拉框
* 编写:wwl
*/
WORKER_BLOCK_ID("worker_block_id","userId","userName","HPPZ013.queryComboBox");
/** 将结果集放入的块名 */ /** 将结果集放入的块名 */
......
...@@ -168,4 +168,21 @@ ...@@ -168,4 +168,21 @@
WHERE ID = #id# WHERE ID = #id#
</update> </update>
<select id="queryComboBox" parameterClass="java.util.HashMap"
resultClass="java.util.HashMap">
SELECT DISTINCT
USER_ID as "userId",
USER_NAME as "userName"
FROM ${hpjxSchema}.T_HPPZ013 WHERE STATUS = 1 AND DELETE_FLAG = '0'
<isNotEmpty prepend=" AND " property="companyCode">
COMPANY_CODE = #companyCode#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="factoryCode">
FACTORY_CODE = #factoryCode#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="groupCode">
GROUP_CODE = #groupCode#
</isNotEmpty>
ORDER BY USER_ID
</select>
</sqlMap> </sqlMap>
...@@ -6,11 +6,7 @@ import com.baosight.hpjx.core.dao.DaoBase; ...@@ -6,11 +6,7 @@ import com.baosight.hpjx.core.dao.DaoBase;
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.constant.HPConstant;
import com.baosight.hpjx.hp.constant.HPSqlConstant; import com.baosight.hpjx.hp.constant.HPSqlConstant;
import com.baosight.hpjx.hp.pz.domain.HPPZ004; import com.baosight.hpjx.hp.pz.domain.*;
import com.baosight.hpjx.hp.pz.domain.HPPZ006;
import com.baosight.hpjx.hp.pz.domain.HPPZ007;
import com.baosight.hpjx.hp.pz.domain.HPPZ009;
import com.baosight.hpjx.hp.pz.domain.HPPZ011;
import com.baosight.hpjx.util.AssertUtils; import com.baosight.hpjx.util.AssertUtils;
import com.baosight.hpjx.util.MapUtils; import com.baosight.hpjx.util.MapUtils;
import com.baosight.hpjx.util.ObjectUtils; import com.baosight.hpjx.util.ObjectUtils;
...@@ -534,6 +530,18 @@ public class HPPZTools { ...@@ -534,6 +530,18 @@ public class HPPZTools {
} }
} }
public static class HpPz013 {
public static HPPZ013 get(String userId) {
AssertUtils.isNull(userId, "工人ID不能为空");
Map queryMap = new HashMap();
queryMap.put("userId", userId);
List<HPPZ013> results = DaoBase.getInstance().query(HPPZ013.QUERY, queryMap);
AssertUtils.isEmpty(results, String.format("工人ID[%s]不存在", userId));
return results.get(0);
}
}
/** /**
* 判断存货档案是否存在,如果存在返回存货档案,否则新增并返回存货档案 * 判断存货档案是否存在,如果存在返回存货档案,否则新增并返回存货档案
* *
......
...@@ -6,6 +6,7 @@ import com.baosight.hpjx.core.constant.CommonConstant; ...@@ -6,6 +6,7 @@ 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.core.security.UserSessionUtils; import com.baosight.hpjx.core.security.UserSessionUtils;
import com.baosight.hpjx.hp.constant.HPConstant; import com.baosight.hpjx.hp.constant.HPConstant;
import com.baosight.hpjx.hp.pz.tools.HPPZTools;
import com.baosight.hpjx.hp.sc.domain.HPSC004; import com.baosight.hpjx.hp.sc.domain.HPSC004;
import com.baosight.hpjx.hp.sc.domain.HPSC005; import com.baosight.hpjx.hp.sc.domain.HPSC005;
import com.baosight.hpjx.hp.sc.domain.HPSC006; import com.baosight.hpjx.hp.sc.domain.HPSC006;
...@@ -46,7 +47,10 @@ public class ServiceHPSC007 extends ServiceBase { ...@@ -46,7 +47,10 @@ public class ServiceHPSC007 extends ServiceBase {
HPSC006.setPartName(HPSC005.getPartName()); HPSC006.setPartName(HPSC005.getPartName());
inInfo.addBlock("detail").addRow(HPSC006); inInfo.addBlock("detail").addRow(HPSC006);
inInfo.addBlock(EiConstant.resultBlock).addBlockMeta(new HPSC007().eiMetadata); inInfo.addBlock(EiConstant.resultBlock).addBlockMeta(new HPSC007().eiMetadata);
CommonMethod.initBlock(inInfo, Arrays.asList(DdynamicEnum.USER_BLOCK_ID), null, false); Map map = new HashMap();
map.put("factoryCode", HPSC006.getFactoryCode());
map.put("groupCode", HPSC006.getOrgNo());
CommonMethod.initBlock(inInfo, Arrays.asList(DdynamicEnum.WORKER_BLOCK_ID), map, false);
} catch (Exception e) { } catch (Exception e) {
LogUtils.setMsg(inInfo, e, "初始化失败"); LogUtils.setMsg(inInfo, e, "初始化失败");
} }
...@@ -112,8 +116,7 @@ public class ServiceHPSC007 extends ServiceBase { ...@@ -112,8 +116,7 @@ public class ServiceHPSC007 extends ServiceBase {
BigDecimal totalWt = new BigDecimal(decimalFormat.format(num.multiply(unitWt).floatValue())); BigDecimal totalWt = new BigDecimal(decimalFormat.format(num.multiply(unitWt).floatValue()));
actualCompletionTotalWt = actualCompletionTotalWt.add(totalWt); actualCompletionTotalWt = actualCompletionTotalWt.add(totalWt);
HPSC007.setactualCompletionTotalWt(totalWt); HPSC007.setactualCompletionTotalWt(totalWt);
Map<String,String> user = (Map<String, String>) this.dao.get("HPXSUser.queryComboBox", "userId", HPSC007.getUserId()); HPSC007.setUserName(HPPZTools.HpPz013.get(HPSC007.getUserId()).getUserName());
HPSC007.setUserName(user.get("userName"));
DaoUtils.insert("HPSC007.insert",HPSC007); DaoUtils.insert("HPSC007.insert",HPSC007);
} }
// 修改下料表中的字段 // 修改下料表中的字段
...@@ -178,6 +181,7 @@ public class ServiceHPSC007 extends ServiceBase { ...@@ -178,6 +181,7 @@ public class ServiceHPSC007 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())));
actualCompletionTotalWt = actualCompletionTotalWt.add(new BigDecimal(decimalFormat.format(Math.round(totalNum.multiply(unitWt).floatValue())))); actualCompletionTotalWt = actualCompletionTotalWt.add(new BigDecimal(decimalFormat.format(Math.round(totalNum.multiply(unitWt).floatValue()))));
HPSC007.setactualCompletionTotalWt(totalWt); HPSC007.setactualCompletionTotalWt(totalWt);
HPSC007.setUserName(HPPZTools.HpPz013.get(HPSC007.getUserId()).getUserName());
DaoUtils.insert("HPSC007.update",HPSC007); DaoUtils.insert("HPSC007.update",HPSC007);
} }
// 修改下料表中的字段 // 修改下料表中的字段
......
...@@ -47,7 +47,7 @@ ...@@ -47,7 +47,7 @@
<EF:EFColumn ename="hpsc006Id" cname="生产下料ID" hidden="true"/> <EF:EFColumn ename="hpsc006Id" cname="生产下料ID" hidden="true"/>
<EF:EFComboColumn ename="userId" cname="完成人" width="100" align="center" <EF:EFComboColumn ename="userId" cname="完成人" width="100" align="center"
filter="contains" readonly="true"> filter="contains" readonly="true">
<EF:EFOptions blockId="user_block_id" valueField="valueField" textField="textField"/> <EF:EFOptions blockId="worker_block_id" valueField="valueField" textField="textField"/>
</EF:EFComboColumn> </EF:EFComboColumn>
<EF:EFColumn ename="userName" cname="完成名称" hidden="true"/> <EF:EFColumn ename="userName" cname="完成名称" hidden="true"/>
<EF:EFColumn ename="actualCompletionNum" cname="完成数量" format="{0:N3}" maxLength="12" displayType="0.000" <EF:EFColumn ename="actualCompletionNum" cname="完成数量" format="{0:N3}" maxLength="12" displayType="0.000"
......
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