Commit 02060db6 by wuwenlong

派工bugfix

parent 3b0d4d14
......@@ -71,6 +71,12 @@ public class ServiceHGSC005A extends ServiceBase {
}
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) {
AssertUtils.isEmpty(hgsc005a.getPlanStartDate(), String.format("产品[%s]计划开工日期为空!", hgsc005a.getProductName()));
AssertUtils.isEmpty(hgsc005a.getPlanEndDate(), String.format("产品[%s]计划完工日期为空!", hgsc005a.getProductName()));
......
......@@ -481,10 +481,10 @@
assign_quantity = #assignQuantity#, <!-- 派工数量 -->
unassign_quantity = #unassignQuantity#, <!-- 未派工数量 -->
<isNotEmpty property="assignWeight">
assign_weight = #assignWeight#
assign_weight = #assignWeight#,
</isNotEmpty>
<isNotEmpty property="unassignWeight">
unassign_weight = #unassignWeight#
unassign_weight = #unassignWeight#,
</isNotEmpty>
<include refid="updateRevise"/>
WHERE id = #id#
......
......@@ -64,7 +64,7 @@ public class HGSCTools {
AssertUtils.isGt(new BigDecimal(totalNum), new BigDecimal(jhNum), "拆单的分派数量不能大于生产订单数量!");
Map updateMap = new HashMap();
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);
if(Objects.nonNull(hgsc006A.getSingleWeight())&&hgsc006A.getSingleWeight().compareTo(BigDecimal.ZERO)>0) {
BigDecimal assignWeight = hgsc006A.getSingleWeight().multiply(new BigDecimal(totalNum));
......@@ -524,7 +524,7 @@ public class HGSCTools {
ComputeTypeEnum computeType = ComputeTypeEnum.getEnumByCode(sj.getComputeType());
switch (computeType){
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)
.multiply(baseWorkHour).add(finalRemainder));
break;
......@@ -545,7 +545,7 @@ public class HGSCTools {
BigDecimal day = workHour.get().divide(baseWorkHour, 0, ROUND_DOWN);
remainder = workHour.get().remainder(baseWorkHour);
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);
return remainder;
......
......@@ -16,7 +16,7 @@ $(function () {
let template = "";
if(item.unassignQuantity > 0 ){
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" ' +
'onclick="showTaskInfo(' + item.id + ')" >任务详情</a>';
......@@ -102,11 +102,11 @@ function assign() {
}
function separateAssign(id){
function separateAssign(orderDetailId){
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>",
width: "80%",
width: "90%",
height: "90%",
callbackName: separateAssignCallback
});
......
......@@ -18,8 +18,6 @@
<EF:EFInput ename="inqu_status-0-projName" cname="项目名称" colWidth="3"/>
<EF:EFDatePicker cname="生产订单" ename="inqu_status-0-createdTime" colWidth="3"
format="yyyy-MM-dd" readonly="false"/>
<EF:EFDatePicker cname="派工日期" ename="inqu_status-0-assignDate" colWidth="3"
format="yyyy-MM-dd" readonly="false"/>
</div>
</EF:EFRegion>
<EF:EFRegion id="result" title="记录集">
......
$(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();
IPLATUI.EFGrid = {
......@@ -18,6 +18,7 @@ $(function () {
template: function (dataItem) {
for (let i = 0; i < factoryGlobalData.length; i++) {
if (factoryGlobalData[i]['factoryCode'] === dataItem['factoryCode']) {
dataItem['factoryName'] = factoryGlobalData[i]['factoryName'];
return factoryGlobalData[i]['factoryName'];
}
}
......@@ -44,18 +45,19 @@ $(function () {
template: function (dataItem) {
for (let i = 0; i < groupGlobalData.length; i++) {
if (groupGlobalData[i]['groupCode'] === dataItem['groupCode']) {
return groupGlobalData[i]['groupName'];
dataItem['groupName'] = groupGlobalData[i]['groupName'];
return groupGlobalData[i]['groupName'];
}
}
return "";
},
editor: function (container, options) {
editor: function (container, options) {
let dataSource;
let inInfo = new EiInfo();
inInfo.set("inqu_status-0-factoryCode", options.model["factoryCode"]);
inInfo.set("inqu_status-0-productType", $("#detail-0-productType").val());
inInfo.set("field", options.field);
EiCommunicator.send(HGSC006B, groupRecordComboBox, inInfo, {
EiCommunicator.send("HGSC006B", "groupRecordComboBox", inInfo, {
onSuccess: function (ei) {
dataSource = ei.getBlock("group_record_block_id").getMappedRows();
},
......@@ -106,7 +108,7 @@ $(function () {
}
}
$("#QUERY").on("click", query);
// $("#QUERY").on("click", query);
downKeyUp();
});
......
......@@ -15,7 +15,7 @@
<div class="row">
<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-orderNo" cname="生产订单号" colWidth="4" readonly="true"/>
<EF:EFInput ename="detail-0-orderCode" cname="生产订单号" colWidth="4" readonly="true"/>
</div>
<div class="row">
<EF:EFInput ename="detail-0-productCode" cname="产品编码" colWidth="4" readonly="true"/>
......@@ -23,7 +23,7 @@
<EF:EFInput ename="detail-0-processName" cname="工序" colWidth="4" readonly="true"/>
</div>
<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-totalWeight" cname="订单重量(kg)" format="{0:0.00}" colWidth="4" readonly="true"/>
</div>
......@@ -43,17 +43,19 @@
<EF:EFRegion id="result" title="明细信息">
<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:EFComboColumn ename="factoryCode" cname="厂区" width="110" align="center" defaultValue="" required="true"
filter="contains" readonly="true">
<EF:EFOptions blockId="factory_record_block_id" valueField="valueField" textField="textField"/>
</EF:EFComboColumn>
<EF:EFColumn ename="factoryName" cname="工厂" enable="false" align="center" hidden="true"/>
<EF:EFComboColumn ename="groupCode" cname="生产组" width="110" align="center" defaultValue="" required="true"
filter="contains" readonly="true">
<EF:EFOptions blockId="group_record_block_id" valueField="valueField" textField="textField"/>
</EF:EFComboColumn>
<%-- <EF:EFComboColumn ename="factoryCode" cname="厂区" width="110" align="center" defaultValue="" required="true"--%>
<%-- filter="contains" readonly="true">--%>
<%-- <EF:EFOptions blockId="factory_record_block_id" valueField="factoryCode" textField="factoryName"/>--%>
<%-- </EF:EFComboColumn>--%>
<EF:EFColumn ename="factoryCode" cname="厂区" width="100" align="center" />
<EF:EFColumn ename="factoryName" cname="工厂名称" enable="false" align="center" hidden="true"/>
<%-- <EF:EFComboColumn ename="groupCode" cname="生产组" width="110" align="center" defaultValue="" required="true"--%>
<%-- filter="contains" readonly="true">--%>
<%-- <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="createdTime" cname="派工时间" enable="false" width="100" align="center"
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