Commit 02060db6 by wuwenlong

派工bugfix

parent 3b0d4d14
...@@ -71,6 +71,12 @@ public class ServiceHGSC005A extends ServiceBase { ...@@ -71,6 +71,12 @@ public class ServiceHGSC005A extends ServiceBase {
} }
private void checkSaveData(List<HGSC005A> hgsc005AList) { private void checkSaveData(List<HGSC005A> hgsc005AList) {
AssertUtils.isEmpty(hgsc005AList,"保存数据为空,请勾选后修改保存!");
AssertUtils.isEmpty(hgsc005AList.get(0).getPlanCode(),"生产计划详情数据异常,请联系管理员!");
HGSC005 hgsc005 = HGSCTools.THGSC005.queryByPlanCode(hgsc005AList.get(0).getPlanCode());
AssertUtils.isTrue(Objects.isNull(hgsc005.getCommitStatus()),"生产计划状态异常,请联系管理员!");
AssertUtils.isTrue(hgsc005.getCommitStatus().compareTo(CommonConstant.YesNo.NO_0)>0,"生产计划已提交,不可修改!");
for (HGSC005A hgsc005a : hgsc005AList) { for (HGSC005A hgsc005a : hgsc005AList) {
AssertUtils.isEmpty(hgsc005a.getPlanStartDate(), String.format("产品[%s]计划开工日期为空!", hgsc005a.getProductName())); AssertUtils.isEmpty(hgsc005a.getPlanStartDate(), String.format("产品[%s]计划开工日期为空!", hgsc005a.getProductName()));
AssertUtils.isEmpty(hgsc005a.getPlanEndDate(), String.format("产品[%s]计划完工日期为空!", hgsc005a.getProductName())); AssertUtils.isEmpty(hgsc005a.getPlanEndDate(), String.format("产品[%s]计划完工日期为空!", hgsc005a.getProductName()));
......
...@@ -481,10 +481,10 @@ ...@@ -481,10 +481,10 @@
assign_quantity = #assignQuantity#, <!-- 派工数量 --> assign_quantity = #assignQuantity#, <!-- 派工数量 -->
unassign_quantity = #unassignQuantity#, <!-- 未派工数量 --> unassign_quantity = #unassignQuantity#, <!-- 未派工数量 -->
<isNotEmpty property="assignWeight"> <isNotEmpty property="assignWeight">
assign_weight = #assignWeight# assign_weight = #assignWeight#,
</isNotEmpty> </isNotEmpty>
<isNotEmpty property="unassignWeight"> <isNotEmpty property="unassignWeight">
unassign_weight = #unassignWeight# unassign_weight = #unassignWeight#,
</isNotEmpty> </isNotEmpty>
<include refid="updateRevise"/> <include refid="updateRevise"/>
WHERE id = #id# WHERE id = #id#
......
...@@ -64,7 +64,7 @@ public class HGSCTools { ...@@ -64,7 +64,7 @@ public class HGSCTools {
AssertUtils.isGt(new BigDecimal(totalNum), new BigDecimal(jhNum), "拆单的分派数量不能大于生产订单数量!"); AssertUtils.isGt(new BigDecimal(totalNum), new BigDecimal(jhNum), "拆单的分派数量不能大于生产订单数量!");
Map updateMap = new HashMap(); Map updateMap = new HashMap();
updateMap.put(hgsc006A.FIELD_id, hgsc006A.getId()); updateMap.put(hgsc006A.FIELD_id, hgsc006A.getId());
updateMap.put(HGSC006A.FIELD_quantity, totalNum); updateMap.put(HGSC006A.FIELD_assign_quantity, totalNum);
updateMap.put(HGSC006A.FIELD_unassign_quantity, jhNum - totalNum); updateMap.put(HGSC006A.FIELD_unassign_quantity, jhNum - totalNum);
if(Objects.nonNull(hgsc006A.getSingleWeight())&&hgsc006A.getSingleWeight().compareTo(BigDecimal.ZERO)>0) { if(Objects.nonNull(hgsc006A.getSingleWeight())&&hgsc006A.getSingleWeight().compareTo(BigDecimal.ZERO)>0) {
BigDecimal assignWeight = hgsc006A.getSingleWeight().multiply(new BigDecimal(totalNum)); BigDecimal assignWeight = hgsc006A.getSingleWeight().multiply(new BigDecimal(totalNum));
...@@ -524,7 +524,7 @@ public class HGSCTools { ...@@ -524,7 +524,7 @@ public class HGSCTools {
ComputeTypeEnum computeType = ComputeTypeEnum.getEnumByCode(sj.getComputeType()); ComputeTypeEnum computeType = ComputeTypeEnum.getEnumByCode(sj.getComputeType());
switch (computeType){ switch (computeType){
case CD: case CD:
workHour.set(product.getLength().multiply(new BigDecimal(planInfo.getQuantity())).multiply(unitConver).multiply(composingCoeff) workHour.set(product.getLength().multiply(new BigDecimal(planInfo.getQuantity())).divide(unitConver, 2, ROUND_DOWN).multiply(composingCoeff)
.divide(timing,2, ROUND_DOWN) .divide(timing,2, ROUND_DOWN)
.multiply(baseWorkHour).add(finalRemainder)); .multiply(baseWorkHour).add(finalRemainder));
break; break;
...@@ -545,7 +545,7 @@ public class HGSCTools { ...@@ -545,7 +545,7 @@ public class HGSCTools {
BigDecimal day = workHour.get().divide(baseWorkHour, 0, ROUND_DOWN); BigDecimal day = workHour.get().divide(baseWorkHour, 0, ROUND_DOWN);
remainder = workHour.get().remainder(baseWorkHour); remainder = workHour.get().remainder(baseWorkHour);
if(day.compareTo(new BigDecimal(0))>0) { if(day.compareTo(new BigDecimal(0))>0) {
endDate = DateUtil.toDateStr(DateUtils.addDays(DateUtil.toDate(endDate,DateUtil.DATE10_PATTERN),day.intValue()),DateUtil.DATE10_PATTERN); endDate = DateUtil.toDateStr(DateUtils.addDays(DateUtil.toDate(endDate,DateUtil.DATE10_PATTERN),day.negate().intValue()),DateUtil.DATE10_PATTERN);
} }
planInfo.setPlanStartDate(endDate); planInfo.setPlanStartDate(endDate);
return remainder; return remainder;
......
...@@ -16,7 +16,7 @@ $(function () { ...@@ -16,7 +16,7 @@ $(function () {
let template = ""; let template = "";
if(item.unassignQuantity > 0 ){ if(item.unassignQuantity > 0 ){
template += '<a style="cursor: pointer;display: inline-flex;justify-content: center;margin:auto 5px" ' template += '<a style="cursor: pointer;display: inline-flex;justify-content: center;margin:auto 5px" '
+ 'onclick="separateAssign(\'' + item.orderCode + '\')" >拆单派工</a>'; + 'onclick="separateAssign(' + item.id + ')" >拆单派工</a>';
} }
template += '<a style="cursor: pointer;display: inline-flex;justify-content: center;margin:auto 5px" ' + template += '<a style="cursor: pointer;display: inline-flex;justify-content: center;margin:auto 5px" ' +
'onclick="showTaskInfo(' + item.id + ')" >任务详情</a>'; 'onclick="showTaskInfo(' + item.id + ')" >任务详情</a>';
...@@ -102,11 +102,11 @@ function assign() { ...@@ -102,11 +102,11 @@ function assign() {
} }
function separateAssign(id){ function separateAssign(orderDetailId){
JSColorbox.open({ JSColorbox.open({
href: "HGSC006B?methodName=initLoad&inqu_status-0-orderCode=" + orderCode, href: "HGSC006B?methodName=initLoad&inqu_status-0-id=" + orderDetailId,
title: "<div style='text-align: center;'>拆单派工</div>", title: "<div style='text-align: center;'>拆单派工</div>",
width: "80%", width: "90%",
height: "90%", height: "90%",
callbackName: separateAssignCallback callbackName: separateAssignCallback
}); });
......
...@@ -18,8 +18,6 @@ ...@@ -18,8 +18,6 @@
<EF:EFInput ename="inqu_status-0-projName" cname="项目名称" colWidth="3"/> <EF:EFInput ename="inqu_status-0-projName" cname="项目名称" colWidth="3"/>
<EF:EFDatePicker cname="生产订单" ename="inqu_status-0-createdTime" colWidth="3" <EF:EFDatePicker cname="生产订单" ename="inqu_status-0-createdTime" colWidth="3"
format="yyyy-MM-dd" readonly="false"/> format="yyyy-MM-dd" readonly="false"/>
<EF:EFDatePicker cname="派工日期" ename="inqu_status-0-assignDate" colWidth="3"
format="yyyy-MM-dd" readonly="false"/>
</div> </div>
</EF:EFRegion> </EF:EFRegion>
<EF:EFRegion id="result" title="记录集"> <EF:EFRegion id="result" title="记录集">
......
$(function () { $(function () {
var factoryGlobalData = __eiInfo.getBlock("factory_record_block_id").getMappedRows(); let factoryGlobalData = __eiInfo.getBlock("factory_record_block_id").getMappedRows();
let groupGlobalData = __eiInfo.getBlock("group_record_block_id").getMappedRows(); let groupGlobalData = __eiInfo.getBlock("group_record_block_id").getMappedRows();
IPLATUI.EFGrid = { IPLATUI.EFGrid = {
...@@ -18,6 +18,7 @@ $(function () { ...@@ -18,6 +18,7 @@ $(function () {
template: function (dataItem) { template: function (dataItem) {
for (let i = 0; i < factoryGlobalData.length; i++) { for (let i = 0; i < factoryGlobalData.length; i++) {
if (factoryGlobalData[i]['factoryCode'] === dataItem['factoryCode']) { if (factoryGlobalData[i]['factoryCode'] === dataItem['factoryCode']) {
dataItem['factoryName'] = factoryGlobalData[i]['factoryName'];
return factoryGlobalData[i]['factoryName']; return factoryGlobalData[i]['factoryName'];
} }
} }
...@@ -44,18 +45,19 @@ $(function () { ...@@ -44,18 +45,19 @@ $(function () {
template: function (dataItem) { template: function (dataItem) {
for (let i = 0; i < groupGlobalData.length; i++) { for (let i = 0; i < groupGlobalData.length; i++) {
if (groupGlobalData[i]['groupCode'] === dataItem['groupCode']) { if (groupGlobalData[i]['groupCode'] === dataItem['groupCode']) {
return groupGlobalData[i]['groupName']; dataItem['groupName'] = groupGlobalData[i]['groupName'];
return groupGlobalData[i]['groupName'];
} }
} }
return ""; return "";
}, },
editor: function (container, options) { editor: function (container, options) {
let dataSource; let dataSource;
let inInfo = new EiInfo(); let inInfo = new EiInfo();
inInfo.set("inqu_status-0-factoryCode", options.model["factoryCode"]); inInfo.set("inqu_status-0-factoryCode", options.model["factoryCode"]);
inInfo.set("inqu_status-0-productType", $("#detail-0-productType").val()); inInfo.set("inqu_status-0-productType", $("#detail-0-productType").val());
inInfo.set("field", options.field); inInfo.set("field", options.field);
EiCommunicator.send(HGSC006B, groupRecordComboBox, inInfo, { EiCommunicator.send("HGSC006B", "groupRecordComboBox", inInfo, {
onSuccess: function (ei) { onSuccess: function (ei) {
dataSource = ei.getBlock("group_record_block_id").getMappedRows(); dataSource = ei.getBlock("group_record_block_id").getMappedRows();
}, },
...@@ -106,7 +108,7 @@ $(function () { ...@@ -106,7 +108,7 @@ $(function () {
} }
} }
$("#QUERY").on("click", query); // $("#QUERY").on("click", query);
downKeyUp(); downKeyUp();
}); });
......
...@@ -15,7 +15,7 @@ ...@@ -15,7 +15,7 @@
<div class="row"> <div class="row">
<EF:EFInput ename="detail-0-projCode" cname="项目号" colWidth="4" readonly="true"/> <EF:EFInput ename="detail-0-projCode" cname="项目号" colWidth="4" readonly="true"/>
<EF:EFInput ename="detail-0-projName" cname="项目名称" colWidth="4" readonly="true"/> <EF:EFInput ename="detail-0-projName" cname="项目名称" colWidth="4" readonly="true"/>
<EF:EFInput ename="detail-0-orderNo" cname="生产订单号" colWidth="4" readonly="true"/> <EF:EFInput ename="detail-0-orderCode" cname="生产订单号" colWidth="4" readonly="true"/>
</div> </div>
<div class="row"> <div class="row">
<EF:EFInput ename="detail-0-productCode" cname="产品编码" colWidth="4" readonly="true"/> <EF:EFInput ename="detail-0-productCode" cname="产品编码" colWidth="4" readonly="true"/>
...@@ -23,7 +23,7 @@ ...@@ -23,7 +23,7 @@
<EF:EFInput ename="detail-0-processName" cname="工序" colWidth="4" readonly="true"/> <EF:EFInput ename="detail-0-processName" cname="工序" colWidth="4" readonly="true"/>
</div> </div>
<div class="row"> <div class="row">
<EF:EFInput ename="detail-0-planCompletionDate" cname="计划完成日期" colWidth="4" readonly="true"/> <EF:EFInput ename="detail-0-planEndDate" cname="计划完成日期" colWidth="4" readonly="true"/>
<EF:EFInput ename="detail-0-singleWeight" cname="单量(kg)" format="{0:0.00}" colWidth="4" readonly="true"/> <EF:EFInput ename="detail-0-singleWeight" cname="单量(kg)" format="{0:0.00}" colWidth="4" readonly="true"/>
<EF:EFInput ename="detail-0-totalWeight" cname="订单重量(kg)" format="{0:0.00}" colWidth="4" readonly="true"/> <EF:EFInput ename="detail-0-totalWeight" cname="订单重量(kg)" format="{0:0.00}" colWidth="4" readonly="true"/>
</div> </div>
...@@ -43,17 +43,19 @@ ...@@ -43,17 +43,19 @@
<EF:EFRegion id="result" title="明细信息"> <EF:EFRegion id="result" title="明细信息">
<EF:EFGrid blockId="result" autoDraw="override" checkMode="row" isFloat="true"> <EF:EFGrid blockId="result" autoDraw="override" checkMode="row" isFloat="true">
<EF:EFColumn ename="id" cname="任务ID" enable="false" width="80" align="center"/> <EF:EFColumn ename="id" cname="任务ID" hidden="true"/>
<EF:EFColumn ename="taskCode" cname="任务单号" enable="false" hidden="true"/> <EF:EFColumn ename="taskCode" cname="任务单号" enable="false" hidden="true"/>
<EF:EFComboColumn ename="factoryCode" cname="厂区" width="110" align="center" defaultValue="" required="true" <%-- <EF:EFComboColumn ename="factoryCode" cname="厂区" width="110" align="center" defaultValue="" required="true"--%>
filter="contains" readonly="true"> <%-- filter="contains" readonly="true">--%>
<EF:EFOptions blockId="factory_record_block_id" valueField="valueField" textField="textField"/> <%-- <EF:EFOptions blockId="factory_record_block_id" valueField="factoryCode" textField="factoryName"/>--%>
</EF:EFComboColumn> <%-- </EF:EFComboColumn>--%>
<EF:EFColumn ename="factoryName" cname="工厂" enable="false" align="center" hidden="true"/> <EF:EFColumn ename="factoryCode" cname="厂区" width="100" align="center" />
<EF:EFComboColumn ename="groupCode" cname="生产组" width="110" align="center" defaultValue="" required="true" <EF:EFColumn ename="factoryName" cname="工厂名称" enable="false" align="center" hidden="true"/>
filter="contains" readonly="true"> <%-- <EF:EFComboColumn ename="groupCode" cname="生产组" width="110" align="center" defaultValue="" required="true"--%>
<EF:EFOptions blockId="group_record_block_id" valueField="valueField" textField="textField"/> <%-- filter="contains" readonly="true">--%>
</EF:EFComboColumn> <%-- <EF:EFOptions blockId="group_record_block_id" valueField="groupCode" textField="groupName"/>--%>
<%-- </EF:EFComboColumn>--%>
<EF:EFColumn ename="groupCode" cname="生产组" width="100" align="center" />
<EF:EFColumn ename="groupName" cname="生产组名称" enable="false" align="center" hidden="true"/> <EF:EFColumn ename="groupName" cname="生产组名称" enable="false" align="center" hidden="true"/>
<EF:EFColumn ename="createdTime" cname="派工时间" enable="false" width="100" align="center" <EF:EFColumn ename="createdTime" cname="派工时间" enable="false" width="100" align="center"
editType="date" dateFormat="yyyy-MM-dd" parseFormats="['yyyyMMdd']" required="true"/> editType="date" dateFormat="yyyy-MM-dd" parseFormats="['yyyyMMdd']" required="true"/>
......
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