Commit 7b7e5e66 by wuwenlong

生产订单bugfix

parent cdb1d491
......@@ -80,7 +80,8 @@ public class ServiceHGSC005A extends ServiceBase {
@OperationLogAnnotation(operModul = "生产计划详情", operType = "排产", operDesc = "排产")
public EiInfo schedule(EiInfo inInfo) {
try {
String planCode = inInfo.getString("inqu_status-0-planCode");
Map queryMap = EiInfoUtils.getFirstRow(inInfo);
String planCode = MapUtils.getString(queryMap, "planCode");
HGSC005 hgsc005 = HGSCTools.THGSC005.queryByPlanCode(planCode);
this.checkScheduleData(hgsc005);
int count = HGSCTools.THGSC005A.schedule(planCode);
......
......@@ -30,7 +30,7 @@ public class ServiceHGSC006A extends ServiceBase {
@OperationLogAnnotation(operModul = "生产订单详情", operType = "查询", operDesc = "查询")
public EiInfo query(EiInfo inInfo) {
try {
inInfo = super.query(inInfo, HGSC005A.QUERY, new HGSC005A());
inInfo = super.query(inInfo, HGSC006A.QUERY, new HGSC006A());
inInfo.setStatus(EiConstant.STATUS_DEFAULT);
} catch (PlatException e) {
LogUtils.setDetailMsg(inInfo, e, "查询失败");
......@@ -38,5 +38,15 @@ public class ServiceHGSC006A extends ServiceBase {
return inInfo;
}
@OperationLogAnnotation(operModul = "生产订单详情", operType = "派工", operDesc = "派工")
public EiInfo assign(EiInfo inInfo) {
try {
inInfo = super.query(inInfo, HGSC005A.QUERY, new HGSC005A());
inInfo.setStatus(EiConstant.STATUS_DEFAULT);
} catch (PlatException e) {
LogUtils.setDetailMsg(inInfo, e, "查询失败");
}
return inInfo;
}
}
......@@ -3,6 +3,7 @@ package com.baosight.hggp.hg.sc.service;
import com.baosight.hggp.aspect.annotation.OperationLogAnnotation;
import com.baosight.hggp.common.DdynamicEnum;
import com.baosight.hggp.common.ProductTypeEnum;
import com.baosight.hggp.core.dao.DaoBase;
import com.baosight.hggp.core.enums.OrgTypeEnum;
import com.baosight.hggp.core.security.UserSessionUtils;
import com.baosight.hggp.hg.sc.domain.HGSC001;
......@@ -19,6 +20,7 @@ import com.baosight.iplat4j.core.ei.EiInfo;
import com.baosight.iplat4j.core.exception.PlatException;
import com.baosight.iplat4j.core.service.impl.ServiceBase;
import org.apache.commons.collections.CollectionUtils;
import org.apache.commons.lang3.StringUtils;
import java.util.*;
import java.util.stream.Collectors;
......@@ -41,6 +43,9 @@ public class ServiceHGSC098 extends ServiceBase {
String companyCode = inInfo.getString("inqu_status-0-companyCode");
String productType = inInfo.getString("inqu_status-0-productType");
List<Org> orgList = HGXSTools.XsOrg.queryByParent(companyCode, OrgTypeEnum.FACTORY.getCode());
orgList.forEach(o -> {
o.setFactoryCode(o.getFactoryCode()+"#"+productType);
});
EiInfoUtils.addBlock(inInfo,"factory_record_block_id", orgList, Org.class);
inInfo.addBlock(EiConstant.resultBlock).addBlockMeta(new HGSC098().eiMetadata);
inInfo.set("inqu_status-0-productType", productType);
......@@ -61,28 +66,37 @@ public class ServiceHGSC098 extends ServiceBase {
public EiInfo query(EiInfo inInfo) {
try {
//查询项目所属公司下面的所有厂区
String companyCode = inInfo.getString("inqu_status-0-companyCode");
String productType = inInfo.getString("inqu_status-0-productType");
List<Org> orgList = HGXSTools.XsOrg.queryByParent(companyCode, OrgTypeEnum.FACTORY.getCode());
if(CollectionUtils.isNotEmpty(orgList)) {
inInfo.set("inqu_status-0-companyCode", null);
List<String> factoryCodes = orgList.stream().map(Org::getFactoryCode).collect(Collectors.toList());
inInfo.set("inqu_status-0-factoryCodes", factoryCodes);
ProductTypeEnum productTypeEnum = ProductTypeEnum.getEnumByCode(Integer.valueOf(productType));
OrgTypeEnum orgType;
switch (productTypeEnum) {
case STRUCT:
orgType = OrgTypeEnum.PROD_GROUP;
break;
case PART:
orgType = OrgTypeEnum.CUT_GROUP;
break;
default:
throw new PlatException("产品类型异常!");
Map queryMap = EiInfoUtils.getFirstRow(inInfo);
String companyCode = MapUtils.getString(queryMap, "companyCode");
String productType = MapUtils.getString(queryMap, "productType");
String factoryCode = MapUtils.getString(queryMap, "factoryCode");
ProductTypeEnum productTypeEnum = ProductTypeEnum.getEnumByCode(Integer.valueOf(productType));
OrgTypeEnum orgType;
switch (productTypeEnum) {
case STRUCT:
orgType = OrgTypeEnum.PROD_GROUP;
break;
case PART:
orgType = OrgTypeEnum.CUT_GROUP;
break;
default:
throw new PlatException("产品类型异常!");
}
inInfo.set("inqu_status-0-orgType", orgType.getCode());
inInfo.set("inqu_status-0-companyCode", null);
if(StringUtils.isBlank(factoryCode)) {
List<Org> orgList = HGXSTools.XsOrg.queryByParent(companyCode, OrgTypeEnum.FACTORY.getCode());
if (CollectionUtils.isNotEmpty(orgList)) {
List<String> factoryCodes = orgList.stream().map(Org::getFactoryCode).collect(Collectors.toList());
inInfo.set("inqu_status-0-factoryCodes", factoryCodes);
inInfo = super.query(inInfo, "HGSC098.query", new HGSC098());
}
inInfo.set("inqu_status-0-orgType", orgType.getCode());
} else {
inInfo.set("inqu_status-0-factoryCode", factoryCode.split("#")[0]);
inInfo = super.query(inInfo, "HGSC098.query", new HGSC098());
inInfo.set("inqu_status-0-factoryCode", factoryCode);
}
inInfo.setStatus(EiConstant.STATUS_DEFAULT);
} catch (Exception e) {
LogUtils.setDetailMsg(inInfo, e, "查询失败");
}
......@@ -98,7 +112,8 @@ public class ServiceHGSC098 extends ServiceBase {
try {
Map queryMap = EiInfoUtils.getFirstRow(inInfo);
String factoryCode = MapUtils.getString(queryMap, "factoryCode");
String productType = inInfo.getString("inqu_status-0-productType");
String productType = factoryCode.split("#")[1];
factoryCode = factoryCode.split("#")[0];
ProductTypeEnum productTypeEnum = ProductTypeEnum.getEnumByCode(Integer.valueOf(productType));
OrgTypeEnum orgType;
switch (productTypeEnum){
......@@ -111,9 +126,12 @@ public class ServiceHGSC098 extends ServiceBase {
default:
throw new PlatException("产品类型异常!");
}
List<Org> orgList = HGXSTools.XsOrg.queryByParent(factoryCode, orgType.getCode());
EiInfoUtils.addBlock(inInfo,"workGroup", orgList, Org.class);
CommonMethod.comboBoxDefaultValue(inInfo,"depByCompany","orgEname","orgCname");
Map paramMap = new HashMap();
paramMap.put("factoryCode",factoryCode);
paramMap.put("orgType",orgType.getCode());
List<HGSC098> orgList = dao.query("HGSC098.query",paramMap);
EiInfoUtils.addBlock(inInfo,"workGroup", orgList, HGSC098.class);
CommonMethod.comboBoxDefaultValue(inInfo,"workGroup","groupCode","groupName","全部");
} catch (InstantiationException e) {
e.printStackTrace();
} catch (IllegalAccessException e) {
......
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE sqlMap PUBLIC "-//iBATIS.com//DTD SQL Map 2.0//EN" "http://www.ibatis.com/dtd/sql-map-2.dtd">
<sqlMap namespace="HPSC098">
<sqlMap namespace="HGSC098">
<select id="query" parameterClass="java.util.HashMap"
resultClass="com.baosight.hpjx.hp.sc.domain.HPSC098">
resultClass="com.baosight.hggp.hg.sc.domain.HGSC098">
SELECT
ORG_ENAME AS "groupCode",
ORG_CNAME AS "groupName",
COMPANY_CODE AS "companyCode",
COMPANY_NAME AS "companyName"
FROM iplat.TXSOG01
FACTORY_CODE AS "factoryCode",
FACTORY_NAME AS "factoryName"
FROM ${platSchema}.TXSOG01
WHERE 1 = 1 AND IS_DELETED = 0
AND ACCOUNTT_CODE = #accountCode#
AND ACCOUNT_CODE = #accountCode#
<isNotEmpty prepend=" AND " property="orgType">
ORG_TYPE = #orgType#
</isNotEmpty>
......@@ -32,11 +32,9 @@
<select id="count" resultClass="int">
SELECT
COUNT(*)
FROM iplat.TXSOG01
WHERE 1 = 1
FROM iplat.TXSOG01
FROM ${platSchema}.TXSOG01
WHERE 1 = 1 AND IS_DELETED = 0
AND ACCOUNTT_CODE = #accountCode#
AND ACCOUNT_CODE = #accountCode#
<isNotEmpty prepend=" AND " property="orgType">
ORG_TYPE = #orgType#
</isNotEmpty>
......
......@@ -465,6 +465,7 @@ public class HGSCTools {
hgsc006a.setTechFlowName(o.getTechFlowName());
hgsc006a.setProcessCode(o.getProcessCode());
hgsc006a.setProcessName(o.getProcessName());
hgsc006a.setProductType(o.getProductType());
hgsc006a.setProductCode(o.getProductCode());
hgsc006a.setProductName(o.getProductName());
hgsc006a.setPlanStartDate(o.getPlanStartDate());
......
......@@ -33,10 +33,10 @@ $(function () {
});
function showInfo(planCode) {
function showInfo(orderCode) {
JSColorbox.open({
href: "HGSC005A?methodName=initLoad&inqu_status-0-planCode=" + planCode + "&efParentFormEname=HGSC005",
title: "<div style='text-align: center;'>生产计划详情</div>",
href: "HGSC006A?methodName=initLoad&inqu_status-0-orderCode=" + orderCode + "&efParentFormEname=HGSC006",
title: "<div style='text-align: center;'>生产订单详情</div>",
width: "90%",
height: "90%"
});
......
......@@ -34,7 +34,7 @@
<EF:EFColumn ename="createdTime" cname="生产订单日期" editType="date"
dateFormat="yyyy-MM-dd" parseFormats="['yyyyMMdd']" enable="true" width="120" align="center" readOnly="true"/>
<EF:EFColumn ename="orderCode" cname="生产订单编号" enable="true" width="120" align="center" readOnly="true"/>
<EF:EFComboColumn ename="assignStatus" cname="派工状态" width="80" align="center" required="true"
<EF:EFComboColumn ename="assignStatus" cname="派工状态" width="80" align="center"
readonly="true">
<EF:EFCodeOption codeName="hggp.assignStatus"/>
</EF:EFComboColumn>
......
......@@ -25,7 +25,7 @@ $(function () {
}],
loadComplete: function(grid) {
// 批量分派
$("#ASSIGN").on("click", assign);
$("#BNT_ASSIGN").on("click", assign);
},
onSuccess: function (e) {
if(e.eiInfo.extAttr.methodName == 'save'||e.eiInfo.extAttr.methodName == 'delete' ){
......@@ -64,43 +64,45 @@ function assign() {
return false;
}
});
let companyCode = rows[0].companyCode;
JSColorbox.open({
href: "HPSC098?methodName=initLoad&inqu_status-0-companyCode="+companyCode+"&inqu_status-0-productType="+productType,
title: "<div style='text-align: center;'>选择组织</div>",
width: "70%",
height: "70%",
callbackName: function (row) {
var info = new EiInfo()
info.set("ids",ids.join(','));
info.set("factoryCode",row.factoryCode);
info.set("factoryName",row.factoryName);
info.set("groupCode",row.groupCode);
info.set("groupName",row.groupName);
EiCommunicator.send("HPSC006A", "assign", info, {
onSuccess: function (ei) {
if (ei["status"] == -1) {
NotificationUtil(ei, "error");
} else {
NotificationUtil({
msg: ei.msg
});
// 刷新列表
resultGrid.dataSource.page(1);
// 关闭弹窗
JSColorbox.close();
if(flag) {
let companyCode = rows[0].companyCode;
JSColorbox.open({
href: "HGSC098?methodName=initLoad&inqu_status-0-companyCode=" + companyCode + "&inqu_status-0-productType=" + productType,
title: "<div style='text-align: center;'>选择组织</div>",
width: "70%",
height: "70%",
callbackName: function (row) {
var info = new EiInfo()
info.set("ids", ids.join(','));
info.set("factoryCode", row.factoryCode);
info.set("factoryName", row.factoryName);
info.set("groupCode", row.groupCode);
info.set("groupName", row.groupName);
EiCommunicator.send("HGSC006A", "assign", info, {
onSuccess: function (ei) {
if (ei["status"] == -1) {
NotificationUtil(ei, "error");
} else {
NotificationUtil({
msg: ei.msg
});
// 刷新列表
resultGrid.dataSource.page(1);
// 关闭弹窗
JSColorbox.close();
}
}, onFail: function (ei) {
}
}, onFail: function (ei) {
}
}, {async: false});
}
});
}, {async: false});
}
});
}
}
function separateAssign(id){
JSColorbox.open({
href: "HPSC006B?methodName=initLoad&inqu_status-0-orderCode=" + orderCode,
href: "HGSC006B?methodName=initLoad&inqu_status-0-orderCode=" + orderCode,
title: "<div style='text-align: center;'>拆单派工</div>",
width: "80%",
height: "90%",
......
......@@ -10,7 +10,7 @@
</script>
<head>
</head>
<EF:EFPage title="生产计划详情">
<EF:EFPage title="生产订单详情">
<EF:EFRegion id="inqu" title="查询条件">
<div class="row">
<EF:EFInput ename="inqu_status-0-orderCode" cname="订单编码" type="hidden"/>
......@@ -25,7 +25,7 @@
<EF:EFRegion id="result" title="记录集">
<EF:EFGrid blockId="result" autoDraw="override" isFloat="true">
<EF:EFColumn ename="id" cname="主键" hidden="true"/>
<EF:EFColumn ename="operator" cname="操作" locked="true" enable="true" width="100" align="center" />
<EF:EFColumn ename="operator" cname="操作" locked="true" enable="true" width="160" align="center" />
<EF:EFColumn ename="companyName" cname="公司名称" enable="true" width="120" align="center" readOnly="true"/>
<EF:EFColumn ename="projName" cname="项目名称" width="120" enable="true" align="center" readOnly="true"/>
<EF:EFColumn ename="createdTime" editType="date"
......@@ -35,10 +35,10 @@
<EF:EFColumn ename="productName" cname="产品名称" width="120" enable="true" align="center" readOnly="true"/>
<EF:EFColumn ename="processName" cname="工序" width="120" enable="true" align="center" readOnly="true"/>
<EF:EFColumn ename="planEndDate" cname="计划完工日期" width="120" enable="true" align="center" editType="date"
dateFormat="yyyy-MM-dd" parseFormats="['yyyyMMdd']" required="true"/>
dateFormat="yyyy-MM-dd" parseFormats="['yyyy-MM-dd']" />
<EF:EFColumn ename="quantity" cname="订单数量" width="120" enable="true" align="center" readOnly="true"/>
<EF:EFColumn ename="assignDate" cname="派工日期" width="120" enable="true" align="center" editType="date"
dateFormat="yyyy-MM-dd" parseFormats="['yyyyMMdd']" required="true"/>
dateFormat="yyyy-MM-dd" parseFormats="['yyyy-MM-dd']" />
<EF:EFColumn ename="assignQuantity" cname="派工数量" width="120" enable="true" align="center" readOnly="true"/>
<EF:EFColumn ename="unassignQuantity" cname="待派工数量" width="120" enable="true" align="center" readOnly="true"/>
</EF:EFGrid>
......
HPSC098.js<!DOCTYPE html>
<!DOCTYPE html>
<%@ page contentType="text/html; charset=UTF-8" %>
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %>
<%@ taglib prefix="EF" tagdir="/WEB-INF/tags/EF" %>
......@@ -18,7 +18,7 @@ HPSC098.js<!DOCTYPE html>
<EF:EFCascadeSelect cascadeFrom="inqu_status-0-factoryCode" cname="工作组" ename="inqu_status-0-groupCode"
colWidth="4" required="true" filter="contains" defaultValue=""
serviceName="HGSC098" methodName="workGroupComboBox" resultId="workGroup"
textField="orgCname" valueField="orgEname" >
textField="groupName" valueField="groupCode" >
</EF:EFCascadeSelect>
</div>
</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