Commit fbbc36a5 by yukang

生产任务拆分,一个零部件的生产可以分给多个生产组

1)生产组多选,输入分配各组生产任务量,生成多个生产任务子单号
2)新增生产任务功能
parent 3b7bd287
......@@ -113,14 +113,18 @@ public enum DdynamicEnum {
* 编写:songx
*/
FACTORY_RECORD_BLOCK_ID("factory_record_block_id","factoryCode","factoryName","HPPZ011.queryComboBox"),
/**
* 模块:组管理
* 用途:组管理下拉框
* 编写:songx
*/
GROUP_RECORD_BLOCK_ID("group_record_block_id","groupCode","groupName","HPPZ011.queryGroupComboBox"),
/**
* 分厂与组一起查出,用于生产任务分派
*/
FACTORY_GROUP_ECORD_BLOCK_ID("factory_group_ecord_block_id","factoryCode","factoryName","groupCode","groupName","HPPZ011.queryComboBoxAll"),
//------------------------------------生产管理-----------------------------------
/**
* 模块:项目档案
......
......@@ -201,5 +201,12 @@ public class HPSqlConstant {
// 查询
public static final String GET = "HPPZ011.get";
}
public class HPSC005 {
// 查询
public static final String UPDATE_ASSIGN_NUM = "HPSC005.updateAssignNum";
}
}
......@@ -125,7 +125,7 @@ public class ServiceHPPZ004 extends ServiceBase {
put("inventName",inventName);
}});
HPPZ004 hppz004 = new HPPZ004();
if(CollectionUtils.isEmpty(list)){
if(CollectionUtils.isNotEmpty(list)){
hppz004.fromMap(list.get(0));
}else{
// 生成编码
......
......@@ -173,5 +173,17 @@ public class ServiceHPPZ011 extends ServiceBase {
}
return inInfo;
}
public EiInfo queryComboBoxAll(EiInfo inInfo) {
try {
List<DdynamicEnum> list = new ArrayList<>();
list.add(DdynamicEnum.FACTORY_GROUP_ECORD_BLOCK_ID);
CommonMethod.initBlock(inInfo, list, new HashMap<>(), false);
} catch (Exception e) {
LogUtils.setMsg(inInfo, e, "查询厂区失败");
}
return inInfo;
}
}
......@@ -157,4 +157,16 @@
ORDER BY A.GROUP_CODE ASC
</select>
<select id="queryComboBoxAll" parameterClass="java.util.HashMap" resultClass="java.util.HashMap">
SELECT DISTINCT
A.FACTORY_CODE as "factoryCode", <!-- 厂区编码 -->
A.FACTORY_NAME as "factoryName", <!-- 厂区名称 -->
A.GROUP_CODE as "groupCode", <!-- 组编码 -->
B.ORG_CNAME as "groupName" <!-- 组名称 -->
FROM ${hpjxSchema}.T_HPPZ011 A, ${platSchema}.TXSOG01 B
WHERE A.DELETE_FLAG = 0
AND A.GROUP_CODE = B.ORG_ID
ORDER BY FACTORY_CODE ASC
</select>
</sqlMap>
......@@ -586,7 +586,7 @@ public class HPSC003 extends DaoEPBase {
setUpdatedTime(StringUtils.toString(map.get(FIELD_UPDATED_TIME)));
setDepCode(StringUtils.defaultIfEmpty(StringUtils.toString(map.get(FIELD_DEP_CODE)), depCode));
setRemark(StringUtils.defaultIfEmpty(StringUtils.toString(map.get(FIELD_REMARK)), remark));
setRemark(StringUtils.defaultIfEmpty(StringUtils.toString(map.get(FIELD_SCHEDULE)), schedule));
setSchedule(StringUtils.defaultIfEmpty(StringUtils.toString(map.get(FIELD_SCHEDULE)), schedule));
setInventRecordId(NumberUtils.toLong(StringUtils.toString(map.get(FIELD_INVENT_RECORD_ID)), inventRecordId));
setSpec(StringUtils.defaultIfEmpty(StringUtils.toString(map.get("spec")), spec));
setLength(NumberUtils.toBigDecimal(StringUtils.toString(map.get("length")), length));
......
......@@ -134,6 +134,12 @@ public class HPSC005 extends DaoEPBase {
private String factoryCode = " "; /* 厂区编码*/
private String factoryName = " "; /* 厂区名称*/
private BigDecimal assignedNum = new BigDecimal(0.00); /* 已派工数量*/
private BigDecimal unassignedNum = new BigDecimal(0.00); /* 待派工数量*/
private Integer documentType = new Integer(0); /* 单据类型 0-非子母单;1-子母单 */
/**
* initialize the metadata.
*/
......@@ -328,8 +334,77 @@ public class HPSC005 extends DaoEPBase {
eiColumn = new EiColumn(FIELD_FACTORY_NAME);
eiColumn.setDescName("厂区名称");
eiMetadata.addMeta(eiColumn);
eiColumn = new EiColumn("assignedNum");
eiColumn.setType("N");
eiColumn.setScaleLength(3);
eiColumn.setFieldLength(15);
eiColumn.setDescName("已派工数量");
eiMetadata.addMeta(eiColumn);
eiColumn = new EiColumn("unassignedNum");
eiColumn.setType("N");
eiColumn.setScaleLength(3);
eiColumn.setFieldLength(15);
eiColumn.setDescName("待派工数量");
eiMetadata.addMeta(eiColumn);
eiColumn = new EiColumn("documentType");
eiColumn.setDescName("单据类型 0-非子母单;1-子母单");
eiMetadata.addMeta(eiColumn);
}
/**
* get the documentType - 单据类型 0-非子母单;1-子母单.
* @return the documentType
*/
public Integer getDocumentType() {
return this.documentType;
}
/**
* set the documentType - 单据类型 0-非子母单;1-子母单.
*
* @param documentType - 单据类型 0-非子母单;1-子母单
*/
public void setDocumentType(Integer documentType) {
this.documentType = documentType;
}
/**
* get the unassignedNum - 待派工数量.
* @return the unassignedNum
*/
public BigDecimal getUnassignedNum() {
return this.unassignedNum;
}
/**
* set the unassignedNum - 待派工数量.
*
* @param unassignedNum - 待派工数量
*/
public void setUnassignedNum(BigDecimal unassignedNum) {
this.unassignedNum = unassignedNum;
}
/**
* get the assignedNum - 已派工数量.
* @return the assignedNum
*/
public BigDecimal getAssignedNum() {
return this.assignedNum;
}
/**
* set the assignedNum - 已派工数量.
*
* @param assignedNum - 已派工数量
*/
public void setAssignedNum(BigDecimal assignedNum) {
this.assignedNum = assignedNum;
}
/**
* get the unitWt - 单重.
* @return the unitWt
*/
......@@ -965,7 +1040,9 @@ public class HPSC005 extends DaoEPBase {
setUnitWt(NumberUtils.toBigDecimal(StringUtils.toString(map.get(FIELD_UNIT_WT)), unitWt));
setFactoryCode(StringUtils.defaultIfEmpty(StringUtils.toString(map.get(FIELD_FACTORY_CODE)), factoryCode));
setFactoryName(StringUtils.defaultIfEmpty(StringUtils.toString(map.get(FIELD_FACTORY_NAME)), factoryName));
setAssignedNum(NumberUtils.toBigDecimal(StringUtils.toString(map.get("assignedNum")), assignedNum));
setUnassignedNum(NumberUtils.toBigDecimal(StringUtils.toString(map.get("unassignedNum")), unassignedNum));
setDocumentType(NumberUtils.toInteger(StringUtils.toString(map.get("documentType")), documentType));
}
/**
......@@ -1016,6 +1093,9 @@ public class HPSC005 extends DaoEPBase {
map.put(FIELD_UNIT_WT, StringUtils.toString(unitWt, eiMetadata.getMeta(FIELD_UNIT_WT)));
map.put(FIELD_FACTORY_CODE, StringUtils.toString(factoryCode, eiMetadata.getMeta(FIELD_FACTORY_CODE)));
map.put(FIELD_FACTORY_NAME, StringUtils.toString(factoryName, eiMetadata.getMeta(FIELD_FACTORY_NAME)));
map.put("assignedNum", StringUtils.toString(assignedNum, eiMetadata.getMeta("assignedNum")));
map.put("unassignedNum", StringUtils.toString(unassignedNum, eiMetadata.getMeta("unassignedNum")));
map.put("documentType", StringUtils.toString(documentType, eiMetadata.getMeta("documentType")));
return map;
}
......
......@@ -48,11 +48,11 @@ public class HPSC005A extends DaoEPBase {
public static final String COL_UPDATED_BY = "UPDATED_BY"; /* 更新人*/
public static final String COL_UPDATED_TIME = "UPDATED_TIME"; /* 更新时间*/
public static final String QUERY = "t_hpsc005a.query";
public static final String COUNT = "t_hpsc005a.count";
public static final String INSERT = "t_hpsc005a.insert";
public static final String UPDATE = "t_hpsc005a.update";
public static final String DELETE = "t_hpsc005a.delete";
public static final String QUERY = "HPSC005A.query";
public static final String COUNT = "HPSC005A.count";
public static final String INSERT = "HPSC005A.insert";
public static final String UPDATE = "HPSC005A.update";
public static final String DELETE = "HPSC005A.delete";
private Long id = new Long(0);
private String productionOrderNo = " "; /* 生产订单号*/
......
......@@ -97,8 +97,6 @@ public class ServiceHPSC002 extends ServiceBase {
}
DaoUtils.insert("HPSC002.insert", hppz002.toMap());
DaoUtils.insert("HPSC006.insert", hppz002.toMap());
if (!hppz002.getParentId().equals("root")) {
this.checkTreeNodeLeaf(new Long(hppz002.getParentId()));
}
......
......@@ -139,7 +139,7 @@ public class ServiceHPSC005 extends ServiceBase {
// 更新HPSC005的数据
HPSC005 HPSC005 = new HPSC005();
HPSC005.setId(NumberUtils.toLong(id[i]));
HPSC005.setStatus(1);
HPSC005.setStatus(2);
HPSC005.setOrgNo(HPPZ011.getGroupCode());
HPSC005.setFactoryCode(HPPZ011.getFactoryCode());
HPSC005.setFactoryName(HPPZ011.getFactoryName());
......
package com.baosight.hpjx.hp.sc.service;
import com.baosight.hpjx.common.HPConstants;
import com.baosight.hpjx.core.dao.DaoUtils;
import com.baosight.hpjx.hp.pz.domain.HPPZ011;
import com.baosight.hpjx.hp.sc.domain.HPSC005;
import com.baosight.hpjx.hp.sc.domain.HPSC005A;
import com.baosight.hpjx.hp.sc.tools.HPSCTools;
import com.baosight.iplat4j.core.ei.EiBlock;
import com.baosight.iplat4j.core.ei.EiConstant;
import com.baosight.iplat4j.core.ei.EiInfo;
......@@ -10,6 +13,7 @@ import com.baosight.iplat4j.core.exception.PlatException;
import com.baosight.iplat4j.core.service.impl.ServiceBase;
import com.baosight.iplat4j.core.util.NumberUtils;
import java.util.HashMap;
import java.util.Map;
/**
......@@ -24,7 +28,11 @@ public class ServiceHPSC005A extends ServiceBase {
public EiInfo initLoad(EiInfo inInfo) {
HPSC005A HPSC005A = new HPSC005A();
EiInfo outInfo = super.initLoad(inInfo, HPSC005A);
HPSC005 HPSC005 = (HPSC005) dao.get("HPSC005.getEntity","productionOrderNo",inInfo.get("inqu_status-0-productionOrderNo").toString());
outInfo.addBlock(EiConstant.resultBlock).addBlockMeta(HPSC005A.eiMetadata);
EiBlock detail = new EiBlock(HPConstants.BLOCK_DETAIL);
detail.addRow(HPSC005);
inInfo.setBlock(detail);
return inInfo;
}
......@@ -48,14 +56,18 @@ public class ServiceHPSC005A extends ServiceBase {
try {
HPSC005A HPSC005A = new HPSC005A();
EiBlock eiBlock = inInfo.getBlock(EiConstant.resultBlock);
EiBlock detailBlock = inInfo.getBlock("detail");
Map detail = detailBlock.getRow(0);
String productionOrderNo = detail.get("productionOrderNo").toString();
for (int i = 0; i < eiBlock.getRowCount(); i++) {
Map<?, ?> map = eiBlock.getRow(i);
HPSC005A.fromMap(map);
HPSC005A.setProductionOrderNo(productionOrderNo);
DaoUtils.insert("HPSC005A.insert", HPSC005A.toMap());
}
inInfo.setStatus(EiConstant.STATUS_SUCCESS);
inInfo.setMsg("新增成功!");
HPSCTools.checkAssignedNum(productionOrderNo);
} catch (PlatException e) {
e.printStackTrace();
inInfo.setStatus(EiConstant.STATUS_FAILURE);
......@@ -74,6 +86,9 @@ public class ServiceHPSC005A extends ServiceBase {
try {
HPSC005A HPSC005A = new HPSC005A();
EiBlock eiBlock = inInfo.getBlock(EiConstant.resultBlock);
EiBlock detailBlock = inInfo.getBlock("detail");
Map detail = detailBlock.getRow(0);
String productionOrderNo = detail.get("productionOrderNo").toString();
for (int i = 0; i < eiBlock.getRowCount(); i++) {
Map<?, ?> map = eiBlock.getRow(i);
HPSC005A.fromMap(map);
......@@ -81,6 +96,7 @@ public class ServiceHPSC005A extends ServiceBase {
}
inInfo.setStatus(EiConstant.STATUS_SUCCESS);
inInfo.setMsg("修改成功!");
HPSCTools.checkAssignedNum(productionOrderNo);
} catch (PlatException e) {
inInfo.setStatus(EiConstant.STATUS_FAILURE);
inInfo.setMsg("操作失败!原因参见详细错误描述!");
......
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE sqlMap PUBLIC "-//ibatis.apache.org//DTD SQL Map 2.0//EN" "http://ibatis.apache.org/dtd/sql-map-2.dtd"> <!-- table information
Generate time : 2024-01-22 15:35:04
Version : 1.0
schema : hpjx
tableName : T_HPSC005
ID BIGINT NOT NULL primarykey,
COMPANY_CODE VARCHAR,
PROJ_CODE VARCHAR,
PROJ_NAME VARCHAR,
PRODUCTION_ORDER_NO VARCHAR,
PRDT_CODE VARCHAR,
PRDT_NAME VARCHAR,
PLAN_COMPLETION_DATE VARCHAR,
NUM INTEGER,
TOTAL_WT DECIMAL,
STATUS TINYINT,
ORG_NO VARCHAR,
ORG_NAME VARCHAR,
CREATED_BY VARCHAR,
CREATED_TIME DATETIME,
UPDATED_BY VARCHAR,
UPDATED_TIME DATETIME,
DEP_CODE VARCHAR,
REMARK VARCHAR,
FILE_PATH1 VARCHAR,
FILE_PATH2 VARCHAR,
FILE_PATH3 VARCHAR,
FILE_PATH4 VARCHAR,
FILE_PATH5 VARCHAR
-->
<!DOCTYPE sqlMap PUBLIC "-//ibatis.apache.org//DTD SQL Map 2.0//EN" "http://ibatis.apache.org/dtd/sql-map-2.dtd">
<sqlMap namespace="HPSC005">
<sql id="column">
ID as "id",
COMPANY_CODE as "companyCode", <!-- 企业编码 预留 -->
PROJ_CODE as "projCode", <!-- 项目编码 -->
PROJ_NAME as "projName", <!-- 项目名称 -->
PRODUCTION_ORDER_NO as "productionOrderNo", <!-- 生产订单号 -->
INVENT_RECORD_ID as "inventRecordId",
PRDT_TYPE as "prdtType",
PRDT_CODE as "prdtCode", <!-- 部件编码 -->
PRDT_NAME as "prdtName", <!-- 部件名称 -->
PLAN_COMPLETION_DATE as "planCompletionDate", <!-- 计划完成日期 -->
NUM as "num", <!-- 计划数量 -->
UNIT_WT as "unitWt", <!-- 单重 -->
TOTAL_WT as "totalWt", <!-- 计划重量 -->
STATUS as "status", <!-- 状态 0-未派工,1-已派工 -->
ORG_NO as "orgNo", <!-- 生产组编码 -->
ORG_NAME as "orgName", <!-- 生产组名称 -->
CREATED_BY as "createdBy", <!-- 创建人 -->
CREATED_TIME as "createdTime", <!-- 创建时间 -->
UPDATED_BY as "updatedBy", <!-- 更新人 -->
UPDATED_TIME as "updatedTime", <!-- 更新时间 -->
DEP_CODE as "depCode", <!-- 部门编码 -->
REMARK as "remark", <!-- 备注 -->
FILE_PATH1 as "filePath1", <!-- 文件地址1 -->
FILE_PATH2 as "filePath2", <!-- 文件地址2 -->
FILE_PATH3 as "filePath3", <!-- 文件地址3 -->
FILE_PATH4 as "filePath4", <!-- 文件地址4 -->
FILE_PATH5 as "filePath5", <!-- 文件地址5 -->
PRDT_SPEC as "prdtSpec",
PART_TYPE as "partType",
PART_CODE as "partCode",
PART_NAME as "partName",
PART_SPEC as "partSpec",
REMARK1 as "remark1",
PRDT_LENGTH as "prdtLength", <!-- 长 -->
PRDT_WIDTH as "prdtWidth", <!-- 宽 -->
PRDT_THICK as "prdtThick", <!-- 厚 -->
PART_LENGTH as "partLength", <!-- 长 -->
PART_WIDTH as "partWidth", <!-- 宽 -->
PART_THICK as "partThick", <!-- 厚 -->
FACTORY_CODE as "factoryCode", <!-- 厂区编码 -->
FACTORY_NAME as "factoryName", <!-- 厂区名称 -->
ASSIGNED_NUM as "assignedNum", <!-- 已派工数量 -->
UNASSIGNED_NUM as "unassignedNum", <!-- 待派工数量 -->
DOCUMENT_TYPE as "documentType" <!-- 单据类型 0-非子母单;1-子母单 -->
</sql>
<sql id="condition">
<isNotEmpty prepend=" AND " property="id">
......@@ -112,47 +129,7 @@
<select id="query" parameterClass="java.util.HashMap"
resultClass="com.baosight.hpjx.hp.sc.domain.HPSC005">
SELECT
ID as "id",
COMPANY_CODE as "companyCode", <!-- 企业编码 预留 -->
PROJ_CODE as "projCode", <!-- 项目编码 -->
PROJ_NAME as "projName", <!-- 项目名称 -->
PRODUCTION_ORDER_NO as "productionOrderNo", <!-- 生产订单号 -->
INVENT_RECORD_ID as "inventRecordId",
PRDT_TYPE as "prdtType",
PRDT_CODE as "prdtCode", <!-- 部件编码 -->
PRDT_NAME as "prdtName", <!-- 部件名称 -->
PLAN_COMPLETION_DATE as "planCompletionDate", <!-- 计划完成日期 -->
NUM as "num", <!-- 计划数量 -->
UNIT_WT as "unitWt", <!-- 单重 -->
TOTAL_WT as "totalWt", <!-- 计划重量 -->
STATUS as "status", <!-- 状态 0-未派工,1-已派工 -->
ORG_NO as "orgNo", <!-- 生产组编码 -->
ORG_NAME as "orgName", <!-- 生产组名称 -->
CREATED_BY as "createdBy", <!-- 创建人 -->
CREATED_TIME as "createdTime", <!-- 创建时间 -->
UPDATED_BY as "updatedBy", <!-- 更新人 -->
UPDATED_TIME as "updatedTime", <!-- 更新时间 -->
DEP_CODE as "depCode", <!-- 部门编码 -->
REMARK as "remark", <!-- 备注 -->
FILE_PATH1 as "filePath1", <!-- 文件地址1 -->
FILE_PATH2 as "filePath2", <!-- 文件地址2 -->
FILE_PATH3 as "filePath3", <!-- 文件地址3 -->
FILE_PATH4 as "filePath4", <!-- 文件地址4 -->
FILE_PATH5 as "filePath5", <!-- 文件地址5 -->
PRDT_SPEC as "prdtSpec",
PART_TYPE as "partType",
PART_CODE as "partCode",
PART_NAME as "partName",
PART_SPEC as "partSpec",
REMARK1 as "remark1",
PRDT_LENGTH as "prdtLength", <!-- 长 -->
PRDT_WIDTH as "prdtWidth", <!-- 宽 -->
PRDT_THICK as "prdtThick", <!-- 厚 -->
PART_LENGTH as "partLength", <!-- 长 -->
PART_WIDTH as "partWidth", <!-- 宽 -->
PART_THICK as "partThick", <!-- 厚 -->
FACTORY_CODE as "factoryCode", <!-- 厂区编码 -->
FACTORY_NAME as "factoryName" <!-- 厂区名称 -->
<include refid="column"/>
FROM ${hpjxSchema}.T_HPSC005 WHERE 1=1
<include refid="condition" />
<dynamic prepend="ORDER BY">
......@@ -272,12 +249,14 @@
PART_WIDTH, <!-- 宽 -->
PART_THICK, <!-- 厚 -->
FACTORY_CODE, <!-- 厂区编码 -->
FACTORY_NAME <!-- 厂区名称 --> )
FACTORY_NAME, <!-- 厂区名称 -->
ASSIGNED_NUM,UNASSIGNED_NUM,DOCUMENT_TYPE)
VALUES (#id#, #companyCode#, #projCode#, #projName#, #productionOrderNo#,#inventRecordId#, #prdtType#, #prdtCode#,
#prdtName#, #planCompletionDate#, #num#,#unitWt#, #totalWt#, #status#, #orgNo#, #orgName#, #createdBy#, #createdTime#,
#updatedBy#, #updatedTime#, #depCode#, #remark#, #filePath1#, #filePath2#, #filePath3#, #filePath4#, #filePath5#,
#prdtSpec#,#partType#,#partCode#,#partName#,#partSpec#,#remark1#,
#prdtLength#,#prdtWidth#,#prdtThick#,#partLength#,#partWidth#,#partThick#, #factoryCode#, #factoryName#)
#prdtLength#,#prdtWidth#,#prdtThick#,#partLength#,#partWidth#,#partThick#, #factoryCode#, #factoryName#,
0, #num#,0)
</insert>
<delete id="delete">
......@@ -332,4 +311,27 @@
WHERE
ID = #id#
</update>
<update id="updateAssignNum">
UPDATE ${hpjxSchema}.T_HPSC005
SET
STATUS = #status#, <!-- 状态 0-未派工,1-部分派工,2-全部派工 -->
ASSIGNED_NUM = #assignedNum#, <!-- 已派工数量 -->
UNASSIGNED_NUM = #unassignedNum#, <!-- 待派工数量 -->
UPDATED_BY = #updatedBy#, <!-- 更新人 -->
UPDATED_TIME = #updatedTime#, <!-- 更新时间 -->
DOCUMENT_TYPE = 1
WHERE
ID = #id#
</update>
<select id="getEntity" parameterClass="java.util.HashMap"
resultClass="com.baosight.hpjx.hp.sc.domain.HPSC005">
SELECT
<include refid="column"/>
FROM ${hpjxSchema}.T_HPSC005 WHERE 1=1
<isNotEmpty prepend=" AND " property="productionOrderNo">
PRODUCTION_ORDER_NO like CONCAT('%', #productionOrderNo#, '%')
</isNotEmpty>
</select>
</sqlMap>
package com.baosight.hpjx.hp.sc.tools;
import com.baosight.hpjx.core.dao.DaoBase;
import com.baosight.hpjx.hp.constant.HPSqlConstant;
import com.baosight.hpjx.hp.kc.domain.HPKC010;
import com.baosight.hpjx.hp.sc.domain.HPSC005;
import com.baosight.hpjx.hp.sc.domain.HPSC005A;
import com.baosight.iplat4j.core.exception.PlatException;
import org.apache.commons.collections.CollectionUtils;
import java.math.BigDecimal;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
public class HPSCTools {
/**
* 拆单数量校正
* @param productionOrderNo
*/
public static void checkAssignedNum(String productionOrderNo) {
//生产订单
HPSC005 HPSC005 = (HPSC005)DaoBase.getInstance().get("HPSC005.getEntity","productionOrderNo",productionOrderNo);
BigDecimal jhNum = HPSC005.getNum();
//子单
Map queryMap = new HashMap();
queryMap.put("productionOrderNo", productionOrderNo);
List<HPSC005A> hpsc005AList = DaoBase.getInstance().query(HPSC005A.QUERY,queryMap,0, -999999);
if (CollectionUtils.isNotEmpty(hpsc005AList)) {
BigDecimal num = new BigDecimal(0.000);
for(HPSC005A hpsc005A : hpsc005AList) {
num = num.add(hpsc005A.getNum());
}
int i = jhNum.compareTo(num);
Map map = new HashMap();
map.put("id",HPSC005.getId());
if (i < 0) {
//子单的数量大于母单
throw new PlatException("拆单的分派数量大于计划数量!");
} else if (i == 0) {
//子单数量跟母单数量一样
map.put("assignedNum",jhNum);
map.put("unassignedNum", new BigDecimal(0.000));
map.put("status","2");
} else {
//子单的数量小于母单
map.put("assignedNum",num);
map.put("unassignedNum", jhNum.subtract(num));
map.put("status","1");
}
DaoBase.getInstance().update(HPSqlConstant.HPSC005.UPDATE_ASSIGN_NUM, map);
}
}
}
$(function () {
$("#QUERY").on("click", function () {
resultGrid.dataSource.page(1);
query();
});
......@@ -238,7 +238,9 @@ function check(id, auditStatus) {
}
let query = function () {
resultGrid.dataSource.page(1);
}
function check_time(model,rows){
for (var i=0;i<rows.length;i++){
......
......@@ -9,18 +9,18 @@ $(function () {
$("#TEAR_ASSIGN").on("click", function () {
//重置全局变量
ids = [];
let productionOrderNo;
let rows = resultGrid.getCheckedRows()
if (rows.length != 1) {
message("只能选择一条需要拆单分派的数据");
return;
}
productionOrderNo = rows[0].productionOrderNo
JSColorbox.open({
href: "HPSC006?methodName=initLoad",
href: "HPSC005A?methodName=initLoad&inqu_status-0-productionOrderNo=" + productionOrderNo,
title: "<div style='text-align: center;'>拆单派工</div>",
width: "40%",
height: "70%",
width: "70%",
height: "80%",
callbackName: assignCallback
});
......
......@@ -57,7 +57,8 @@
<EF:EFColumn enable="false" ename="totalWt" cname="计划重量"/>
<EF:EFComboColumn enable="false" align="center" ename="status" cname="状态">
<EF:EFOption label="未派工" value="0"/>
<EF:EFOption label="已派工" value="1"/>
<EF:EFOption label="部分派工" value="1"/>
<EF:EFOption label="全部派工" value="2"/>
</EF:EFComboColumn>
<EF:EFColumn enable="false" ename="factoryName" cname="厂区名称"/>
<EF:EFColumn enable="false" ename="orgName" cname="生产组"/>
......
......@@ -10,50 +10,47 @@
<EF:EFPage title="拆单派工">
<EF:EFRegion id="detail" title="订单详情">
<EF:EFGrid blockId="result" autoDraw="no">
<EF:EFColumn ename="id" cname="主键" hidden="true"/>
<EF:EFColumn enable="false" ename="projCode" cname="项目号" readonly="true"/>
<EF:EFColumn enable="false" ename="projName" cname="项目名称" readonly="true"/>
<EF:EFColumn enable="false" ename="planInfoNo" cname="生产计划单号" readonly="true"/>
<EF:EFComboColumn ename="prdtType" cname="部件类型" width="90" align="center" enable="false">
<EF:EFCodeOption codeName="hpjx.hpkc.inventType" />
</EF:EFComboColumn>
<EF:EFColumn enable="false" ename="prdtCode" cname="部件编码" readonly="true"/>
<EF:EFColumn enable="false" ename="prdtName" cname="部件名称" readonly="true"/>
<EF:EFColumn hidden="true" enable="false" ename="spec" cname="规格" readonly="true"/>
<EF:EFColumn enable="false" ename="remark" cname="备注" readonly="true"/>
<EF:EFColumn ename="planCompletionDate" cname="计划完成日期" editType="date" dateFormat="yyyy/MM/dd" width="150"
required='true' readonly="true"/>
<EF:EFColumn enable="false" ename="schedule" cname="生产完工进度" format="{0:N2}" readonly="true"/>
<EF:EFComboColumn enable="false" ename="status" cname="状态">
<EF:EFOption label="未提交" value="0"/>
<EF:EFOption label="已提交" value="1"/>
</EF:EFComboColumn>
<EF:EFColumn ename="operator" cname="操作" width="100" enable="false" readonly="false"/>
</EF:EFGrid>
<div class="row">
<EF:EFInput type="text" ename="detail-0-projCode" cname="项目号" readonly="true"/>
<EF:EFInput type="text" ename="detail-0-projName" cname="项目名称" readonly="true"/>
<EF:EFInput type="text" ename="detail-0-productionOrderNo" cname="生产订单号" readonly="true"/>
</div>
<div class="row">
<EF:EFInput type="text" ename="detail-0-prdtName" cname="部件名称" readonly="true"/>
<EF:EFInput type="text" ename="detail-0-partName" cname="零部件名称" readonly="true"/>
<EF:EFInput type="text" ename="detail-0-planCompletionDate" cname="计划完成日期" readonly="true"/>
</div>
<div class="row">
<EF:EFInput type="text" ename="detail-0-num" cname="计划数量" readonly="true"/>
<EF:EFInput type="text" ename="detail-0-totalWt" cname="计划重量" readonly="true"/>
<EF:EFInput type="text" ename="detail-0-assignedNum" cname="已派工数量" readonly="true"/>
</div>
<div class="row">
<EF:EFInput type="text" ename="detail-0-unassignedNum" cname="待派工数量" readonly="true"/>
<EF:EFSelect enable="false" align="center" ename="detail-0-status" cname="状态" readonly="true">
<EF:EFOption label="未派工" value="0"/>
<EF:EFOption label="部分派工" value="1"/>
<EF:EFOption label="全部派工" value="2"/>
</EF:EFSelect>
</div>
</EF:EFRegion>
<EF:EFRegion id="result" title="明细信息">
<EF:EFGrid blockId="detail" autoDraw="no">
<EF:EFGrid blockId="result" autoDraw="no">
<EF:EFColumn ename="id" cname="主键" hidden="true"/>
<EF:EFColumn ename="parentId" cname="父ID" hidden="true"/>
<EF:EFComboColumn ename="prdtType" cname="零件类型" width="90" align="center" readonly="true">
<EF:EFCodeOption codeName="hpjx.hpkc.inventType" />
</EF:EFComboColumn>
<EF:EFColumn enable="false" ename="prdtCode" cname="零件编码"/>
<EF:EFColumn enable="false" ename="prdtName" readonly="true" cname="零件名称"/>
<EF:EFColumn enable="false" ename="spec" cname="规格" readonly="true"/>
<EF:EFColumn enable="false" ename="remark" cname="备注" readonly="true"/>
<EF:EFColumn enable="false" ename="num" readonly="true" cname="计划数量"/>
<EF:EFColumn enable="false" ename="unitWt" readonly="true" cname="计划重量"/>
<EF:EFColumn ename="planCommentDate" required='true' cname="计划开始时间" editType="date" dateFormat="yyyy/MM/dd" width="150"/>
<EF:EFColumn ename="planCompletionDate" required='true' cname="计划结束时间" editType="date" dateFormat="yyyy/MM/dd" width="150"/>
<EF:EFColumn ename="actualCompletionDate" cname="实际完成时间" editType="date" dateFormat="yyyy/MM/dd" width="150"
enable="false"/>
<EF:EFColumn enable="false" ename="actualCompletionNum" cname="实际完工数量" readonly="true"/>
<EF:EFColumn enable="false" ename="actualCompletionUnitWt" cname="实际完工重量" readonly="true"/>
<EF:EFColumn ename="operator" cname="操作" width="100" enable="false" readonly="false"/>
<EF:EFPopupColumn ename="factoryName" cname="厂区" width="200" popupType="ServiceGrid"
popupTitle="厂区信息" serviceName="HPPZ011" methodName="queryComboBoxAll" resultId="factory_group_ecord_block_id"
columnEnames="textField,param2Field"
columnCnames="厂区,生产组"
backFillColumnIds="param2Field,param1Field,valueField,textField"
backFillFieldIds="orgName,orgNo,factoryCode,factoryName"
valueField="textField" textField="textField"/>
<EF:EFColumn enable="false" ename="factoryCode" cname="厂区编码" hidden="true"/>
<EF:EFColumn enable="false" ename="orgNo" readonly="true" cname="生产组代码" hidden="true"/>
<EF:EFColumn enable="false" ename="orgName" cname="生产组"/>
<EF:EFColumn ename="num" cname="分派数量" format="{0:N3}"/>
<EF:EFColumn ename="totalWt" cname="分派重量" format="{0:N3}"/>
</EF:EFGrid>
</EF:EFRegion>
</EF:EFPage>
......
......@@ -17,8 +17,6 @@ $(function () {
template: function (item) {
let template = '<a style="cursor: pointer;display: inline-flex;justify-content: center;margin:auto 5px" ' +
'onclick="jump(' + item.id + ')" >物料清单</a>';
template += '<a style="cursor: pointer;display: inline-flex;justify-content: center;margin:auto 5px" ' +
'onclick="jump2(' + item.id + ')" >下料清单</a>';
return template;
}
}
......
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