Commit 2d529a84 by liuyang

2024-04-08 报工管理功能调整

parent dce7ab27
......@@ -52,7 +52,7 @@ public class ServiceHPSC010 extends ServiceEPBase {
Map<?, ?> map = eiBlock.getRow(i);
hpxs010.fromMap(map);
hpxs010.setDeleteFlag(CommonConstant.YesNo.YES_1);
this.delRows(hpxs010.getId().toString());
delRows(hpxs010.getId().toString());
DaoUtils.update(HPSC010.DELETE_FLAG, hpxs010.toMap());
}
inInfo.setStatus(EiConstant.STATUS_SUCCESS);
......@@ -100,10 +100,12 @@ public class ServiceHPSC010 extends ServiceEPBase {
List<Map> list = eiBlock.getRows();
list.addAll(inInfo.getBlock(CommonConstant.Field.DETAIL).getRows());
double weight = 0;
//BigDecimal weight = new BigDecimal("0");
for (i = 0; i < list.size(); i++) {
Map<?, ?> map = list.get(i);
BigDecimal bigDecimal = new BigDecimal(map.get(HPSC008.FIELD_WEIGHT).toString());
weight = weight+bigDecimal.doubleValue();
HPSC008 hpsc008 = new HPSC008();
hpsc008.fromMap(map);
weight = weight+hpsc008.getWeight().doubleValue();
}
hpxs010.fromMap(eiBlock.getRow(0));
hpxs010.setDeleteFlag(CommonConstant.YesNo.NO_0);
......@@ -126,6 +128,6 @@ public class ServiceHPSC010 extends ServiceEPBase {
HPSC008 hpxs001 = new HPSC008();
hpxs001.setRemark(id);
hpxs001.setDeleteFlag(CommonConstant.YesNo.YES_1);
DaoUtils.update(HPSC008.DELETE_REMARK, hpxs001.toMap());
DaoUtils.update(HPSC008.DELETE_REMARK, hpxs001);
}
}
\ No newline at end of file
......@@ -44,7 +44,6 @@ public class ServiceHPSC096 extends ServiceEPBase {
inInfo.setCell(EiConstant.queryBlock,ACConstants.ROW_CODE_0,HPSC010.FIELD_USER_COUNT,
eiInfo.getCellStr(EiConstant.resultBlock,ACConstants.ROW_CODE_0,HPSC010.FIELD_USER_COUNT));
}
inInfo.addBlock(EiConstant.resultBlock).setRows(listFactoryCode);
}else {
List<Map> listResult = new ArrayList<>();
......@@ -67,7 +66,7 @@ public class ServiceHPSC096 extends ServiceEPBase {
//listFactoryCode.get(i).put(HPSC096.FIELD_GROUP_TYPE,listProducTionType.get(j).get(HPSC096.FIELD_GROUP_TYPE));
listResult.add(result);
}
}else {
}else if ("cutGroup".equals(listFactoryCode.get(i).get(HPSC096.FIELD_ORG_TYPE))){
Map detailMap = new HashMap();
detailMap.putAll(listFactoryCode.get(i));
detailMap.put("rowNo",detrowNo);
......
......@@ -304,12 +304,6 @@
UPDATED_TIME = #updatedTime#, <!-- 修改人名称 -->
UPDATED_NAME = #updatedName# <!-- 修改时间 -->
WHERE REMARK = #remark#
<isNotEmpty prepend=" AND " property="companyCode">
COMPANY_CODE = #companyCode#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="depCode">
DEP_CODE = #depCode#
</isNotEmpty>
</update>
<update id="update">
......
......@@ -227,19 +227,26 @@
ORG_TYPE AS "orgType",
FACTORY_CODE as "factoryCode"
FROM iplat.txsog01
WHERE IS_DELETED = '0' AND ORG_TYPE != 'synGroup'
WHERE IS_DELETED = '0'
<isNotEmpty prepend=" AND " property="companyCode">
COMPANY_CODE = #companyCode#
</isNotEmpty>
<isNotEmpty property="AND" prepend="orgTypes">
ORG_TYPE NOT IN <iterate close=")" open="(" conjunction="," property="depCodes">#orgTypes[]#</iterate>
</isNotEmpty>
<isEmpty prepend="AND" property="orgTypes">
ORG_TYPE NOT IN ('factory','dept')
</isEmpty>
<isNotEmpty prepend=" AND " property="loginName">
PARENT_ORG_ID IN (
FACTORY_CODE IN (
SELECT FACTORY_CODE FROM iplat.txsog01
WHERE IS_DELETED = '0'
and COMPANY_CODE = #companyCode#
and ORG_ID in (
select ORG_ID from iplat.txsog02 T2
INNER JOIN iplat.xs_user xu ON t2.USER_ID = xu.USER_ID
where xu.LOGIN_NAME = #loginName#
WHERE IS_DELETED = '0' and COMPANY_CODE = #companyCode#
and ORG_ID = (
select ORG_ID from iplat.txsog02 T2
INNER JOIN iplat.xs_user xu ON t2.USER_ID = xu.USER_ID
where xu.LOGIN_NAME = #loginName#
order by T2.REC_CREATE_TIME desc
limit 1
)
)
</isNotEmpty>
......
......@@ -135,7 +135,7 @@ function showUploadFile(id) {
href: "HPSC002B?methodName=initLoad&inqu_status-0-bizType=WL&inqu_status-0-id=" + id,
title: "<div style='text-align: center;'>附件清单</div>",
width: "80%",
height: "80%",
height: "90%",
});
}
function check(id, auditStatus,planInfoNo) {
......@@ -344,7 +344,7 @@ function addWindowOpen(id) {
href: "HPSC096?methodName=initLoad&inqu_status-0-methodType=insert&inqu_status-0-id=" + id,
title: "<div style='text-align: center;'>新增</div>",
width: "80%",
height: "80%",
height: "90%",
callbackName: windowOpenCallback
});
}
......
......@@ -12,10 +12,12 @@ $(function () {
IPLATUI.EFGrid = {
"result": {
pageable: {
/*pageable: {
pageSize: 20,
pageSizes: [20, 30, 50, 100, 200],
},
},*/
pageable:false,
exportGrid:false,
columns: [/*{
field: "operator",
template: function (item) {
......
......@@ -42,7 +42,7 @@
</div>
</EF:EFRegion>--%>
<EF:EFRegion id="result" title="明细信息">
<EF:EFRegion id="result" title="生产明细信息">
<EF:EFGrid blockId="result" autoDraw="override" isFloat="true" checkMode="row">
<EF:EFColumn ename="id" primaryKey="true" cname="内码" hidden="true"/>
<EF:EFColumn ename="companyCode" cname="企业编码" hidden="true"/>
......@@ -75,6 +75,8 @@
/>
<%--<EF:EFColumn ename="remark" cname="备注" enable="true" width="200" align="center"/>--%>
</EF:EFGrid>
</EF:EFRegion>
<EF:EFRegion id="detail" title="下料明细信息">
<EF:EFGrid blockId="detail" autoDraw="override" toolbarConfig="{hidden:'all'}" isFloat="true" checkMode="row">
<EF:EFColumn ename="id" primaryKey="true" cname="内码" hidden="true"/>
<EF:EFColumn ename="companyCode" cname="企业编码" hidden="true"/>
......@@ -92,21 +94,20 @@
maxLength="16" readonly="true" width="120" required="true"
align="center" filter="contains" sort="true">
</EF:EFComboColumn>
<EF:EFComboColumn ename="groupType" cname="下料类型"
<%--<EF:EFComboColumn ename="groupType" cname="下料类型"
columnTemplate="#=textField#" itemTemplate="#=textField#"
textField="textField" valueField="valueField"
maxLength="16" readonly="true" width="80" required="true"
align="center" filter="contains" sort="true">
<EF:EFCodeOption codeName="hpjx.hpjx.productionType" />
</EF:EFComboColumn>
</EF:EFComboColumn>--%>
<EF:EFColumn ename="prdtName" cname="产品" enable="false" width="160" align="center" required="true"/>
<EF:EFColumn ename="weight" cname="产量(T)" width="120" enable="false" format="{0:N3}" editType="text"
<%--<EF:EFColumn ename="weight" cname="产量(T)" width="120" enable="false" format="{0:N3}" editType="text"
displayType="0.000" sort="true" align="right"
data-regex="/^-?[0-9]{1,16}([.][0-9]{1,3})?$/" maxLength="20" required="true"
data-errorprompt="请输入数字,该值最大可设置17位整数和3位小数!"
/>
/>--%>
</EF:EFGrid>
</EF:EFRegion>
</EF:EFPage>
$(function (){
var queryBlock = __eiInfo.getBlock("inqu_status").getMappedRows();
//$(".row").children().attr("class", "col-md-3");
$("#inqu").children().children().children().eq(0).hide();
$("#inqu").children().children().children().eq(1).hide();
$("#result").children().children().children().eq(0).hide();
$("#result").children().children().children().eq(1).hide();
$("#detail").children().children().children().eq(0).hide();
$("#detail").children().children().children().eq(1).hide();
IPLATUI.EFGrid = {
"result": {
pageable:false,
exportGrid:false,
toolbarConfig:{
hidden: false,
},
/*pageable: {
pageSize: 10,
pageSizes: [10, 20, 30, 50, 100, 200],
......@@ -29,6 +38,8 @@ $(function (){
}
}],
loadComplete: function(grid) {
$("#ef_grid_result .k-grid-toolbar").attr("style","display: none;");
//$("#delete").attr("style","display: none;");
// 此 grid 对象
if (queryBlock[0]["userCount"] !== undefined || queryBlock[0]["userCount"] != null){
$("#inqu_status-0-userCount").val(queryBlock[0]["userCount"]);
......@@ -75,8 +86,84 @@ $(function (){
}
}],
}
}
};
/**
* 取消
*/
$('#cancel').on('click', function () {
// 关闭弹窗
parent.JSColorbox.close();
});
/**
* 确认
*/
$('#confirm').on('click', function () {
let rows = resultGrid.getCheckedRows();
if (rows.length < 1) {
message("请选择数据");
return;
}
let methodType = $("#inqu_status-0-methodType").val();
let flag = true;
$.each(rows, function(index, item) {
let prdtName= item.get("prdtName");
if(isBlank(prdtName)){
message("选中的第"+(index+1)+"行\"产品\",不能为空!");
flag = false;
return false;
}
let weight= item.get("weight");
if(isBlank(weight)){
message("选中的第"+(index+1)+"行\"产量(T)\",不能为空!");
flag = false;
return false;
}
});
if(flag) {
JSUtils.confirm("确定对勾选中的[" + rows.length + "]条数据做\"保存\"操作? ", {
ok: function () {
var info = new EiInfo();
info.set("inqu_status-0-userCount",$("#inqu_status-0-userCount").val());
info.addBlock(JSUtils.checkedRows2Block("result"));
info.addBlock(JSUtils.checkedRows2Block("detail"))
EiCommunicator.send("HPSC010", methodType, info, {
onSuccess: function (ei) {
if (ei.getStatus() >= 0) {
try {
EiCommunicator.send("HPSC096", methodType, info, {
onSuccess: function (ei) {
parent.JSColorbox.setValueCallback(ei);
parent.JSColorbox.close();
},
onFail: function (ei) {
// 发生异常
NotificationUtil("操作失败,原因[" + ei + "]", "error");
}
})
} catch (e) {
// TODO: handle exception
}
if (ei.getStatus() == 0) {
NotificationUtil(ei, 'warning');
} else {
NotificationUtil(ei);
}
} else {
NotificationUtil(ei, "error");
}
},
onFail: function (ei) {
// 发生异常
NotificationUtil("操作失败,原因[" + ei + "]", "error");
}
});
}
});
}
});
})
/**
......
......@@ -13,7 +13,7 @@
<c:set var="ctx" value="${pageContext.request.contextPath}"/>
<EF:EFPage title="报工管理">
<EF:EFRegion id="result" title="明细信息">
<EF:EFRegion id="result" title="生产明细信息">
<EF:EFGrid blockId="result" autoDraw="override" isFloat="true" checkMode="row">
<EF:EFColumn ename="rowNo" cname="行号" hidden="true"/>
<EF:EFColumn ename="remark" cname="上级ID" hidden="true"/>
......@@ -41,11 +41,13 @@
</EF:EFComboColumn>
<EF:EFColumn ename="prdtName" cname="产品" enable="true" width="160" align="center"/>
<EF:EFColumn ename="weight" cname="产量(T)" width="120" enable="true" format="{0:N3}" editType="text"
displayType="0.000" sort="true" align="right"
displayType="0.000" sort="true" align="right" defaultValue="0"
data-regex="/^-?[0-9]{1,16}([.][0-9]{1,3})?$/" maxLength="20"
data-errorprompt="请输入数字,该值最大可设置17位整数和3位小数!"
/>
</EF:EFGrid>
</EF:EFRegion>
<EF:EFRegion id="detail" title="下料明细信息">
<EF:EFGrid blockId="detail" autoDraw="override" toolbarConfig="{hidden:'all'}" isFloat="true" checkMode="row">
<EF:EFColumn ename="rowNo" cname="行号" hidden="true"/>
<EF:EFColumn ename="remark" cname="上级ID" hidden="true"/>
......@@ -64,7 +66,7 @@
maxLength="16" readonly="true" width="120" required="true"
align="center" filter="contains" sort="true">
</EF:EFComboColumn>
<EF:EFComboColumn ename="groupType" cname="下料类型"
<EF:EFComboColumn ename="groupType" cname="下料类型" hidden="true"
columnTemplate="#=textField#" itemTemplate="#=textField#"
textField="textField" valueField="valueField"
maxLength="16" readonly="true" width="80" required="true"
......@@ -73,16 +75,20 @@
</EF:EFComboColumn>
<EF:EFColumn ename="prdtName" cname="产品" enable="true" width="160" align="center"/>
<EF:EFColumn ename="weight" cname="产量(T)" width="120" enable="true" format="{0:N3}" editType="text"
displayType="0.000" sort="true" align="right"
displayType="0.000" sort="true" align="right" hidden="true" defaultValue="0"
data-regex="/^-?[0-9]{1,16}([.][0-9]{1,3})?$/" maxLength="20"
data-errorprompt="请输入数字,该值最大可设置17位整数和3位小数!"
/>
</EF:EFGrid>
<EF:EFRegion id="inqu">
<div class="row">
<EF:EFInput cname="用工总人数" blockId="inqu_status" ename="userCount" row="0" type="number" colWidth="5" value="0"/>
<EF:EFInput cname="" blockId="inqu_status" ename="methodType" row="0" colWidth="3" hidden="true"/>
</div>
</EF:EFRegion>
</EF:EFRegion>
<EF:EFRegion id="inqu">
<div class="row">
<EF:EFInput cname="用工总人数" blockId="inqu_status" ename="userCount" row="0" type="number" colWidth="5" value="0"/>
<EF:EFInput cname="" blockId="inqu_status" ename="methodType" row="0" colWidth="3" hidden="true"/>
</div>
</EF:EFRegion>
<div class="row">
<EF:EFButton ename="cancel" cname="取消" type="button" class="btn-align-right"/>
<EF:EFButton ename="confirm" cname="确认" type="button" class="btn-align-right"/>
</div>
</EF:EFPage>
\ No newline at end of file
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