Commit f009ca32 by liulei

下料登记、下料清单优化

parent 568fe980
......@@ -19,6 +19,24 @@
B.ORG_CNAME as "groupName" <!-- 生产组名称 -->
</sql>
<sql id="column2">
A.ID as "id",
A.COMPANY_CODE as "companyCode", <!-- 企业编码 预留 -->
A.DEP_CODE as "depCode", <!-- 部门编码 预留 -->
A.CREATED_BY as "createdBy", <!-- 创建人 -->
A.CREATED_NAME as "createdName", <!-- 创建人名称 -->
A.CREATED_TIME as "createdTime", <!-- 创建时间 -->
A.UPDATED_BY as "updatedBy", <!-- 更新人 -->
A.UPDATED_NAME as "updatedName", <!-- 更新人名称 -->
A.UPDATED_TIME as "updatedTime", <!-- 更新时间 -->
A.FACTORY_CODE as "factoryCode", <!-- 厂区编码 -->
A.FACTORY_NAME as "factoryName", <!-- 厂区名称 -->
A.GROUP_CODE as "groupCode", <!-- 生产组编码 -->
A.GROUP_TYPE as "groupType", <!-- 组类型 -->
A.GROUP_NAME as "groupName" <!-- 生产组名称 -->
</sql>
<sql id="condition">
AND A.DELETE_FLAG = 0
AND A.GROUP_CODE = B.ORG_ID
......@@ -45,6 +63,28 @@
</isNotEmpty>
</sql>
<sql id="condition2">
AND A.DELETE_FLAG = 0
<isNotEmpty prepend=" AND " property="id">
A.ID = #id#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="companyCode">
A.COMPANY_CODE = #companyCode#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="depCode">
A.DEP_CODE = #depCode#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="factoryCode">
A.FACTORY_CODE = #factoryCode#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="groupCode">
A.GROUP_CODE = #groupCode#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="groupType">
A.GROUP_TYPE = #groupType#
</isNotEmpty>
</sql>
<sql id="getCondition">
<isNotEmpty prepend=" AND " property="id">
A.ID = #id#
......@@ -81,6 +121,7 @@
<include refid="order"/>
</select>
<select id="count" resultClass="int">
SELECT COUNT(*)
FROM ${hpjxSchema}.T_HPPZ011 A, ${platSchema}.TXSOG01 B
......@@ -98,6 +139,15 @@
<include refid="getCondition"/>
</select>
<!-- 查询 -->
<select id="get2" resultClass="com.baosight.hpjx.hp.pz.domain.HPPZ011">
SELECT
<include refid="column2"/>
FROM ${hpjxSchema}.T_HPPZ011 A
WHERE 1=1
<include refid="condition2"/>
</select>
<insert id="insert">
INSERT INTO ${hpjxSchema}.T_HPPZ011 (
COMPANY_CODE, <!-- 企业编码 预留 -->
......
......@@ -254,11 +254,11 @@ public class HPSC006 extends DaoEPBase {
eiMetadata.addMeta(eiColumn);
eiColumn = new EiColumn(FIELD_ORG_NO);
eiColumn.setDescName("生产组编码");
eiColumn.setDescName("下料组编码");
eiMetadata.addMeta(eiColumn);
eiColumn = new EiColumn(FIELD_ORG_NAME);
eiColumn.setDescName("生产组名称");
eiColumn.setDescName("下料组名称");
eiMetadata.addMeta(eiColumn);
eiColumn = new EiColumn(FIELD_FACTORY_CODE);
......
......@@ -106,13 +106,13 @@ public class ServiceHPSC006 extends ServiceBase {
BigDecimal unitWt = HPSC006.getUnitWt();
DecimalFormat decimalFormat = new DecimalFormat("#.000");
BigDecimal totalWt = new BigDecimal(decimalFormat.format(Math.round(num.multiply(unitWt).floatValue())));
HPSC006.setInventSpec(HPPZTools.HpPz006.jointSpec(HPSC006.getInventLength(),HPSC006.getInventWidth(),HPSC006.getInventThick()));
HPSC006.setInventSpec(HPPZTools.jointSpec(HPSC006.getInventLength(),HPSC006.getInventWidth(),HPSC006.getInventThick()));
HPSC006.setProjCode(projCode);
HPSC006.setProjName(projName);
HPSC006.setProductionOrderNo(productionOrderNo);
HPSC006.setStatus(CommonConstant.YesNo.NO_0.intValue());
HPSC006.setTotalWt(totalWt);
HPSC006.setInventCode(HPPZTools.HpPz004.checkAndSave(HPSC006.getInventType(),HPSC006.getInventName()));
HPSC006.setInventCode(HPPZTools.checkAndSavePZ04(HPSC006.getInventType(),HPSC006.getInventName()));
if(HPSC006.getFactoryCode()!=null && !(HPSC006.getFactoryCode().equals(" "))) {
AssertUtils.isEmpty(HPSC006.getOrgNo(), "已选择厂区,下料组不能为空");
HPSC006.setStatus(1);
......@@ -152,12 +152,12 @@ public class ServiceHPSC006 extends ServiceBase {
BigDecimal unitWt = HPSC006.getUnitWt();
DecimalFormat decimalFormat = new DecimalFormat("#.000");
BigDecimal totalWt = new BigDecimal(decimalFormat.format(Math.round(num.multiply(unitWt).floatValue())));
HPSC006.setInventSpec(HPPZTools.HpPz006.jointSpec(HPSC006.getInventLength(),HPSC006.getInventWidth(),HPSC006.getInventThick()));
HPSC006.setInventSpec(HPPZTools.jointSpec(HPSC006.getInventLength(),HPSC006.getInventWidth(),HPSC006.getInventThick()));
HPSC006.setProjCode(projCode);
HPSC006.setProjName(projName);
HPSC006.setProductionOrderNo(productionOrderNo);
HPSC006.setTotalWt(totalWt);
HPSC006.setInventCode(HPPZTools.HpPz004.checkAndSave(HPSC006.getInventType(),HPSC006.getInventName()));
HPSC006.setInventCode(HPPZTools.checkAndSavePZ04(HPSC006.getInventType(),HPSC006.getInventName()));
DaoUtils.update("HPSC006.update",HPSC006);
}
inInfo.setStatus(EiConstant.STATUS_SUCCESS);
......
......@@ -38,7 +38,7 @@ public class ServiceHPSC006B extends ServiceBase {
public EiInfo initLoad(EiInfo inInfo) {
try {
Map queryMap = EiInfoUtils.getFirstRow(inInfo);
String prodOrderNo = MapUtils.getString(queryMap, CommonConstant.Field.PROD_ORDER_NO);
String prodOrderNo = MapUtils.getString(queryMap, CommonConstant.Field.ID);
HPSC006 dbSc006 = HPSCTools.HpSc005.getHPSC006(prodOrderNo);
inInfo.addBlock(CommonConstant.Field.DETAIL).addRow(dbSc006);
inInfo.addBlock(EiConstant.resultBlock).addBlockMeta(new HPSC006().eiMetadata);
......
......@@ -11,6 +11,7 @@ import com.baosight.hpjx.hp.sc.domain.HPSC005;
import com.baosight.hpjx.hp.sc.domain.HPSC006;
import com.baosight.hpjx.hp.sc.domain.HPSC007;
import com.baosight.hpjx.hp.sc.tools.HPSCTools;
import com.baosight.hpjx.hp.xs.domain.User;
import com.baosight.hpjx.util.*;
import com.baosight.iplat4j.core.ei.EiBlock;
import com.baosight.iplat4j.core.ei.EiConstant;
......@@ -45,6 +46,7 @@ public class ServiceHPSC007 extends ServiceBase {
HPSC006.setPartName(HPSC005.getPartName());
inInfo.addBlock("detail").addRow(HPSC006);
inInfo.addBlock(EiConstant.resultBlock).addBlockMeta(new HPSC007().eiMetadata);
CommonMethod.initBlock(inInfo, Arrays.asList(DdynamicEnum.USER_BLOCK_ID), null, false);
} catch (Exception e) {
LogUtils.setMsg(inInfo, e, "初始化失败");
}
......@@ -65,6 +67,22 @@ public class ServiceHPSC007 extends ServiceBase {
}
/**
* 查询操作.
*/
@OperationLogAnnotation(operModul = "下料登记",operType = "查询",operDesc = "查询")
public EiInfo queryNum(EiInfo inInfo) {
Map queryMap = EiInfoUtils.getFirstRow(inInfo);
Long hpsc006Id = MapUtils.getLong(queryMap, "hpsc006Id");
HPSC006 HPSC006 = HPSCTools.Hpsc006.getById(hpsc006Id);
HashMap<String, BigDecimal> map = new HashMap<>();
map.put("num", HPSC006.getActualCompletionNum());
map.put("wt", HPSC006.getActualCompletionTotalWt());
inInfo.addBlock("detail").addRow(map);
return inInfo;
}
/**
* 新增操作.
*/
@OperationLogAnnotation(operModul = "下料登记",operType = "新增",operDesc = "新增")
......@@ -91,9 +109,11 @@ public class ServiceHPSC007 extends ServiceBase {
totalNum = totalNum.add(num);
BigDecimal unitWt = HPSC006.getUnitWt();
DecimalFormat decimalFormat = new DecimalFormat("#.000");
BigDecimal totalWt = new BigDecimal(decimalFormat.format(Math.round(num.multiply(unitWt).floatValue())));
BigDecimal totalWt = new BigDecimal(decimalFormat.format(num.multiply(unitWt).floatValue()));
actualCompletionTotalWt = actualCompletionTotalWt.add(totalWt);
HPSC007.setactualCompletionTotalWt(totalWt);
Map<String,String> user = (Map<String, String>) this.dao.get("HPXSUser.queryComboBox", "userId", HPSC007.getUserId());
HPSC007.setUserName(user.get("userName"));
DaoUtils.insert("HPSC007.insert",HPSC007);
}
// 修改下料表中的字段
......
......@@ -178,7 +178,7 @@
$orderBy$
</isNotEmpty>
<isEmpty property="orderBy">
ID asc
CREATED_TIME asc
</isEmpty>
</dynamic>
</sql>
......
......@@ -120,7 +120,7 @@
<sql id="condition">
<isNotEmpty prepend=" AND " property="id">
ID = #id#
A.ID = #id#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="companyCode">
A.COMPANY_CODE = #companyCode#
......
......@@ -576,12 +576,12 @@ public class HPSCTools {
return results.get(0);
}
public static HPSC006 getHPSC006(String prodOrderNo) {
AssertUtils.isEmpty(prodOrderNo, "生产订单号不能为空");
public static HPSC006 getHPSC006(String id) {
AssertUtils.isEmpty(id, "id号不能为空");
Map queryMap = new HashMap();
queryMap.put("productionOrderNo", prodOrderNo);
queryMap.put("id", id);
List<HPSC006> results = DaoBase.getInstance().query(HPSC006.QUERY2, queryMap);
AssertUtils.isNull(results, String.format("生产订单[%s]信息不存在", prodOrderNo));
AssertUtils.isNull(results, String.format("生产id[%s]信息不存在", id));
return results.get(0);
}
......
......@@ -41,8 +41,8 @@ $(function () {
IPLATUI.EFGrid = {
"result" : {
pageable: {
pageSize: 20,
pageSizes: [10, 20, 50, 70, 100],
pageSize: 5,
pageSizes: [5, 10, 50, 70, 100],
},
onSuccess: function (e) {
......@@ -182,6 +182,12 @@ $(function () {
||e.eiInfo.extAttr.methodName == 'delete' ){
query();
}
},
onSave: function (e) {
// 阻止默认请求,使用自定义保存
e.preventDefault();
saveFunc();
}
}
......@@ -259,7 +265,6 @@ query = function () {
}
/**
* 页面加载时执行
*/
......@@ -321,3 +326,58 @@ assignCallback = function (id) {
}
/**
* 保存
*/
function saveFunc() {
let rows = detailGrid.getCheckedRows();
if (rows.length < 1) {
message("请选择数据");
return;
}
let flag = true;
$.each(rows, function(index, item) {
let status= item.get("status");
let inventName= item.get("inventName");
let planCompletionDate= item.get("planCompletionDate");
if(status==="1"){
IPLAT.alert({
message : "选中的第"+(index+1)+"行\"生产中的项目\",不能修改!",
okFn : function(e) {
},
title : '错误'
});
flag = false;
return false;
}
if(inventName===""){
IPLAT.alert({
message : "选中的第"+(index+1)+"行\"材料名称\",不能为空!",
okFn : function(e) {
},
title : '错误'
});
flag = false;
return false;
}
if(planCompletionDate===""){
IPLAT.alert({
message : "选中的第"+(index+1)+"行\"计划完成时间\",不能为空!",
okFn : function(e) {
},
title : '错误'
});
flag = false;
return false;
}
});
if(flag) {
JSUtils.confirm("确定对勾选中的[" + rows.length + "]条数据做\"保存\"操作? ", {
ok: function () {
JSUtils.submitGridsData("detail", "HPSC006", "insert", true);
query();
}
});
}
}
......@@ -65,7 +65,7 @@
<EF:EFColumn ename="inventThick" width="80" cname="厚" format="{0:N3}"/>
<EF:EFColumn ename="material" width="80" cname="材质" />
<EF:EFColumn ename="remark" cname="备注" />
<EF:EFColumn ename="num" width="80" cname="数量" format="{0:N0}"/>
<EF:EFColumn ename="num" width="80" cname="数量"/>
<EF:EFColumn ename="unitWt" format="{0:N3}" width="80" cname="单重"/>
<EF:EFColumn enable="false" format="{0:N3}" ename="totalWt" width="80" cname="总重"/>
<EF:EFComboColumn ename="factoryCode" cname="厂区" width="110" align="center"
......
......@@ -9,10 +9,10 @@ $(function () {
columns: [{
field: "operator",
template: function (item) {
let prodOrderNo = item.productionOrderNo;
let id = item.id;
let template = '';
template += '<a style="cursor: pointer;display: inline-flex;justify-content: center;margin:auto 5px" '
+ 'onclick="tearDetails(\'' + prodOrderNo + '\')" >查看详情</a>';
+ 'onclick="tearDetails(\'' + id + '\')" >查看详情</a>';
return template
}
}]
......@@ -67,9 +67,9 @@ $('input[name="inqu_status-0-factoryCode"]').change(function () {
*
* @param prodOrderNo
*/
function tearDetails(prodTaskNo) {
function tearDetails(id) {
JSColorbox.open({
href: "HPSC006B?methodName=initLoad&inqu_status-0-prodOrderNo=" + prodTaskNo,
href: "HPSC006B?methodName=initLoad&inqu_status-0-id=" + id,
title: "<div style='text-align: center;'>下料订单详情</div>",
width: "80%",
height: "90%"
......
......@@ -40,7 +40,7 @@
<EF:EFColumn ename="prdtName" cname="部件名称" enable="false" width="100" align="center"/>
<EF:EFColumn ename="partName" cname="零件名称" enable="false" width="100" align="center"/>
<EF:EFColumn ename="inventName" cname="材料名称" enable="false" width="100" align="center"/>
<EF:EFColumn ename="orgName" cname="生产组名称" enable="false" width="100" align="center"/>
<EF:EFColumn ename="orgName" cname="下料组" enable="false" width="100" align="center"/>
<EF:EFColumn ename="planCompletionDate" cname="计划完成日期" enable="false" width="120" align="center"
editType="date" dateFormat="yyyy-MM-dd" parseFormats="['yyyyMMdd']"/>
<EF:EFColumn enable="false" ename="cutSchedule" cname="下料进度" format="{0:N2}" width="80" readonly="true" align="center"/>
......
......@@ -10,22 +10,37 @@
<EF:EFInput ename="inqu_status-0-prodOrderNo" cname="项目号" type="hidden"/>
<div class="row">
<EF:EFInput ename="detail-0-productionOrderNo" cname="项目号" colWidth="4" readonly="true"/>
<EF:EFInput ename="detail-0-projName" cname="项目名称" colWidth="4" readonly="true"/>
<EF:EFInput ename="detail-0-productionOrderNo" cname="生产订单号" colWidth="4" readonly="true"/>
<EF:EFInput ename="detail-0-inventName" cname="材料名称" colWidth="4" readonly="true"/>
<EF:EFInput ename="detail-0-prdtName" cname="产品名称" colWidth="4" readonly="true"/>
</div>
<div class="row">
<EF:EFInput ename="detail-0-factoryName" cname="厂区名称" colWidth="4" readonly="true"/>
<EF:EFInput ename="detail-0-orgName" cname="下料组" colWidth="4" readonly="true"/>
<EF:EFInput ename="detail-0-partName" cname="零件名称" colWidth="4" readonly="true"/>
</div>
<div class="row">
<EF:EFInput ename="detail-0-inventName" cname="材料名称" colWidth="4" readonly="true"/>
<EF:EFInput ename="detail-0-inventLength" cname="长" colWidth="4" readonly="true"/>
<EF:EFInput ename="detail-0-inventWidth" cname="宽" colWidth="4" readonly="true"/>
<EF:EFInput ename="detail-0-inventThick" cname="厚" colWidth="4" readonly="true"/>
</div>
<div class="row">
<EF:EFInput ename="detail-0-inventThick" cname="厚" colWidth="4" readonly="true"/>
<EF:EFInput ename="detail-0-inventSpec" cname="材料规格" colWidth="4" readonly="true"/>
<EF:EFInput ename="detail-0-material" cname="材质" colWidth="4" readonly="true"/>
<EF:EFInput ename="detail-0-totalWt" cname="总量" colWidth="4" readonly="true"/>
<EF:EFInput ename="detail-0-actualCompletionTotalWt" cname="完成重量" colWidth="4" readonly="true"/>
</div>
<div class="row">
<EF:EFInput ename="detail-0-num" cname="计划数量" colWidth="4" readonly="true"/>
<EF:EFInput ename="detail-0-unitWt" cname="计划单重" colWidth="4" readonly="true"/>
<EF:EFInput ename="detail-0-totalWt" cname="计划重量" colWidth="4" readonly="true"/>
</div>
<div class="row">
<EF:EFInput ename="detail-0-actualCompletionNum" cname="完成数量" colWidth="4" readonly="true"/>
<EF:EFInput ename="detail-0-actualCompletionTotalWt" cname="完成重量" colWidth="4" readonly="true"/>
<EF:EFInput ename="detail-0-cutSchedule" cname="下料进度" format="{0:N2}" colWidth="4" readonly="true"/>
</div>
<div class="row">
<EF:EFSelect ename="detail-0-status" cname="状态" colWidth="4" readonly="true">
<EF:EFOption label="计划中" value="0"/>
<EF:EFOption label="生产中" value="1"/>
......
......@@ -16,6 +16,7 @@ $(function () {
||e.eiInfo.extAttr.methodName == 'insert'
||e.eiInfo.extAttr.methodName == 'delete' ){
query();
queryNum()
}
}
}
......@@ -40,6 +41,28 @@ function query() {
resultGrid.dataSource.page(1);
}
/**
* 查询完成数量、重量
*/
function queryNum() {
let inEiInfo = new EiInfo();
inEiInfo.set("inqu_status-0-hpsc006Id", $("#inqu_status-0-hpsc006Id").val());
EiCommunicator.send('HPSC007', 'queryNum', inEiInfo, {
onSuccess(ei) {
var Num = ei.blocks.detail.rows[0][0] ;
var Wt = ei.blocks.detail.rows[0][1] ;
$("#detail-0-actualCompletionNum").val(Num);
$("#detail-0-actualCompletionTotalWt").val(Wt);
},
onFail(errorMessage, status, e) {
NotificationUtil("执行失败!", "error");
}
}, {
async: false
});
}
/**
* 删除
*/
......
......@@ -52,7 +52,7 @@
backFillFieldIds="userName,userId"
valueField="valueField" textField="valueField"/>
<EF:EFColumn ename="userName" cname="完成名称" hidden="true"/>
<EF:EFColumn ename="actualCompletionNum" cname="完成数量" format="{0:N0}" />
<EF:EFColumn ename="actualCompletionNum" cname="完成数量" format="{0:N3}" />
<EF:EFColumn ename="actualCompletionTotalWt" cname="完成重量" enable="false" format="{0:N3}"/>
</EF:EFGrid>
</EF:EFRegion>
......
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