Commit fb2ddc9d by yukang

Merge remote-tracking branch 'origin/dev' into dev

# Conflicts:
#	src/main/webapp/HP/SC/HPSC005.js
parents 8e2ab56f 1647b8b5
package com.baosight.hpjx.common;
/**
* @author:songx
* @date:2024/2/5,11:33
*/
public enum ProdOrderStatusEnum {
NOT_ASSIGN(0, "未分派"),
PART_ASSIGN(1, "部分分派"),
ALL_ASSIGN(1, "全部分派");
private Integer code;
private String value;
ProdOrderStatusEnum(Integer code, String value) {
this.code = code;
this.value = value;
}
public Integer getCode() {
return code;
}
public void setCode(Integer code) {
this.code = code;
}
public String getValue() {
return value;
}
public void setValue(String value) {
this.value = value;
}
}
......@@ -54,7 +54,8 @@ public class HPConstant {
//生产订单
public static final String HPSC005_PROD_NO = "HPSC005_PROD_NO";
//生产任务订单
public static final String PROD_TASK_NO = "PROD_TASK_NO";
}
......
......@@ -44,6 +44,8 @@ public class HPSqlConstant {
// 统计
public static final String STAT_DATE = "HPKC003.statDate";
// 锁
public static final String LOCK = "HPKC003.lock";
}
/**
......@@ -79,6 +81,18 @@ public class HPSqlConstant {
}
/**
* HPKC005A SQL 定义
*
* @author:songx
* @date:2024/1/20,16:45
*/
public class HPKC005A {
// 锁
public static final String LOCK = "HPKC005A.lock";
}
/**
* HPKC006 SQL 定义
*
* @author:songx
......@@ -202,14 +216,31 @@ public class HPSqlConstant {
public static final String GET = "HPPZ011.get";
}
/**
* @author:songx
* @date:2024/2/5,10:16
*/
public class HPSC005 {
// 锁
public static final String LOCK = "HPSC005.lock";
// 查询
public static final String UPDATE_ASSIGN_NUM = "HPSC005.updateAssignNum";
}
/**
* @author:songx
* @date:2024/2/5,10:16
*/
public class HPSC005A {
// 锁
public static final String LOCK = "HPSC005A.lock";
// 更新完成数量
public static final String UPDATE_COMPLETE_NUM = "HPSC005A.updateCompleteNum";
}
/**
* 质量巡检单
*
* @author:songx
......
......@@ -9,12 +9,15 @@ import com.baosight.hpjx.hp.kc.domain.HPKC003;
import com.baosight.hpjx.hp.kc.tools.HPKCTools;
import com.baosight.hpjx.hp.pz.tools.HPPZTools;
import com.baosight.hpjx.hp.sc.domain.HPSC004;
import com.baosight.hpjx.hp.sc.tools.HPSCTools;
import com.baosight.hpjx.hp.zl.domain.HPZL001;
import com.baosight.hpjx.hp.zl.tools.HPZLTools;
import com.baosight.hpjx.util.AssertUtils;
import com.baosight.hpjx.util.BeanUtils;
import com.baosight.hpjx.util.CommonMethod;
import com.baosight.hpjx.util.EiInfoUtils;
import com.baosight.hpjx.util.LogUtils;
import com.baosight.hpjx.util.ObjectUtils;
import com.baosight.hpjx.util.StringUtil;
import com.baosight.iplat4j.core.ei.EiBlock;
import com.baosight.iplat4j.core.ei.EiConstant;
......@@ -43,7 +46,7 @@ public class ServiceHPKC003 extends ServiceBase {
*/
public EiInfo initLoad(EiInfo inInfo) {
try {
CommonMethod.initBlock(inInfo, Arrays.asList(DdynamicEnum.WH_RECORD_BLOCK_ID), null);
CommonMethod.initBlock(inInfo, Arrays.asList(DdynamicEnum.WH_RECORD_BLOCK_ID), null, false);
CommonMethod.initBlock(inInfo, Arrays.asList(DdynamicEnum.INVENT_NAME_BLOCK_ID), null);
inInfo.addBlock(EiConstant.resultBlock).addBlockMeta(new HPKC003().eiMetadata);
} catch (Exception e) {
......@@ -73,115 +76,39 @@ public class ServiceHPKC003 extends ServiceBase {
}
/**
* 新增操作
*
* @param inInfo
* @return
*/
@Override
public EiInfo insert(EiInfo inInfo) {
try {
List<Map> resultRows = inInfo.getBlock(EiConstant.resultBlock).getRows();
// 数据校验
for (Map resultRow : resultRows) {
HPKC003 fKc003 = new HPKC003();
fKc003.fromMap(resultRow);
// 校验是否存在巡检单
Map queryMap = new HashMap();
queryMap.put("prodNo", fKc003.getProductionOrderNo());
queryMap.put("status", CommonConstant.YesNo.NO_0);
List<HPZL001> dbZl001s = dao.query(HPZL001.QUERY, queryMap);
AssertUtils.isNotEmpty(dbZl001s, String.format("入库失败,生产订单号[%s]有未处理的巡检单,请先处理巡检单",
fKc003.getProductionOrderNo()));
}
// 数据写入
for (int i = 0; i < resultRows.size(); i++) {
HPKC003 fKc003 = new HPKC003();
fKc003.fromMap(resultRows.get(i));
fKc003.setDocumentDate(StringUtil.removeHorizontalLine(fKc003.getDocumentDate()));
// 仓库名称
fKc003.setWhName(HPPZTools.getPz007ByCode(fKc003.getWhCode()).getWhName());
// 存货名称
// fKc003.setInventName(HPPZTools.getPz004ByCode(fKc003.getInventCode()).getInventName());
// 生成入库单号
fKc003.setProdNo(SequenceGenerator.getNextSequence(HPConstant.SequenceId.HPKC003_PROD_NO));
// fKc003.setPrdtCode(HPPZTools.checkAndSavePZ04(fKc003.getPrdtType(),fKc003.getPrdtName()));
// fKc003.setPartCode(HPPZTools.checkAndSavePZ04(fKc003.getPartType(),fKc003.getPartName()));
DaoUtils.insert("HPKC003.insert", fKc003);
//同步生产计划
DaoUtils.update("HPSC004.update",this.synchronousPlan(fKc003));
//产品库存更新接口
HPKCTools.updateProdStock(fKc003.getWhCode(),fKc003.getProdNo(),fKc003.getAmount(),fKc003.getWeight());
}
inInfo = this.query(inInfo);
inInfo.setStatus(EiConstant.STATUS_DEFAULT);
inInfo.setMsg("操作成功!本次对[" + resultRows.size() + "]条数据新增成功!");
} catch (Exception e) {
LogUtils.setDetailMsg(inInfo, e, "新增失败");
}
return inInfo;
}
/**
* 修改操作
*
* @param inInfo
* @return
*/
public EiInfo update(EiInfo inInfo) {
try {
CommonMethod.creatorInfo(inInfo, EiConstant.resultBlock);
List<Map> resultRows = inInfo.getBlock(EiConstant.resultBlock).getRows();
for (int i = 0; i < resultRows.size(); i++) {
HPKC003 fKc003 = new HPKC003();
fKc003.fromMap(resultRows.get(i));
fKc003.setDocumentDate(StringUtil.removeHorizontalLine(fKc003.getDocumentDate()));
// 仓库名称
fKc003.setWhName(HPPZTools.getPz007ByCode(fKc003.getWhCode()).getWhName());
// 存货名称
fKc003.setInventName(HPPZTools.getPz004ByCode(fKc003.getInventCode()).getInventName());
DaoUtils.update("HPKC003.update", fKc003);
}
inInfo = this.query(inInfo);
inInfo.setStatus(EiConstant.STATUS_DEFAULT);
inInfo.setMsg("操作成功!本次对[" + resultRows.size() + "]条数据新增成功!");
} catch (Exception e) {
LogUtils.setDetailMsg(inInfo, e, "修改失败");
}
return inInfo;
}
/**
* 删除操作
*
* @param eiInfo
* @return
*/
public EiInfo delete(EiInfo eiInfo) {
HPKC003 hpkc003 = new HPKC003();
EiBlock eiBlock = eiInfo.getBlock(EiConstant.resultBlock);
try {
for (int i = 0; i < eiBlock.getRowCount(); i++) {
Map<?, ?> map = eiBlock.getRow(i);
hpkc003.fromMap(map);
this.dao.delete("HPKC003.delete", hpkc003.toMap());
List<Map> resultRows = eiInfo.getBlock(EiConstant.resultBlock).getRows();
List<String> prodNos = ObjectUtils.listKey(resultRows, "prodNo");
// 锁
HPKCTools.HpKc003.lock(prodNos);
// 查询数据
Map<String, HPKC003> dbKc003Map = HPKCTools.HpKc003.map(prodNos);
for (Map resultRow : resultRows) {
HPKC003 fKc003 = new HPKC003();
fKc003.fromMap(resultRow);
DaoUtils.update(HPKC003.DELETE, fKc003);
//生产一条负数量和产量的红冲记录
hpkc003.setAmount(hpkc003.getAmount().multiply(new BigDecimal(-1.000)));
hpkc003.setWeight(hpkc003.getWeight().multiply(new BigDecimal(-1.000)));
hpkc003.setDeleteFlag(1);
hpkc003.setProdNoOld(hpkc003.getProdNo());
hpkc003.setProdNo(SequenceGenerator.getNextSequence(HPConstant.SequenceId.HPKC003_PROD_NO));
DaoUtils.insert("HPKC003.insert", hpkc003);
//同步生产计划
DaoUtils.update("HPSC004.update",this.synchronousPlan(hpkc003));
HPKC003 dbKc003 = dbKc003Map.get(fKc003.getProdNo());
HPKC003 newKc003 = BeanUtils.copy(dbKc003, HPKC003.class);
newKc003.setAmount(dbKc003.getAmount().negate());
newKc003.setWeight(dbKc003.getWeight().negate());
newKc003.setDeleteFlag(1);
newKc003.setProdNoOld(fKc003.getProdNo());
newKc003.setProdNo(SequenceGenerator.getNextSequence(HPConstant.SequenceId.HPKC003_PROD_NO));
DaoUtils.insert(HPKC003.INSERT, newKc003);
// 同步生产计划
DaoUtils.update("HPSC004.update", this.synchronousPlan(newKc003));
// 更新生产任务已完成数量
HPSCTools.HpSc005a.updateCompleteNum(newKc003.getProdTaskNo(), newKc003.getAmount());
// 修改库存
HPKCTools.updateStock(hpkc003.getWhCode(), hpkc003.getInventRecordId(), hpkc003.getAmount().negate(),
hpkc003.getWeight().negate());
HPKCTools.updateProdStock(newKc003.getWhCode(), newKc003.getProdOrderNo(),
newKc003.getAmount(), newKc003.getWeight());
}
eiInfo.setStatus(EiConstant.STATUS_SUCCESS);
eiInfo.setMsg("删除成功!");
......@@ -197,8 +124,8 @@ public class ServiceHPKC003 extends ServiceBase {
* @param hpkc003
*/
public HPSC004 synchronousPlan(HPKC003 hpkc003) {
HPSC004 hpsc004 = (HPSC004) this.dao.get("HPSC004.queryDetail","productionOrderNo",hpkc003.getProductionOrderNo());
if (hpsc004 != null) {
HPSC004 hpsc004 = (HPSC004) this.dao.get("HPSC004.queryDetail", "productionOrderNo", hpkc003.getProdOrderNo());
AssertUtils.isNull(hpsc004, String.format("生产订单[%s]对应的任务计划不存在", hpkc003.getProdOrderNo()));
BigDecimal actualCompletionNum = hpkc003.getAmount().add(hpsc004.getActualCompletionNum());
BigDecimal actualCompletionUnitWt = hpkc003.getWeight().add(hpsc004.getActualCompletionUnitWt());
hpsc004.setActualCompletionNum(actualCompletionNum);
......@@ -211,7 +138,6 @@ public class ServiceHPKC003 extends ServiceBase {
} else {
hpsc004.setActualCompletionDate("");
}
}
return hpsc004;
}
......
package com.baosight.hpjx.hp.kc.service;
import com.baosight.hpjx.common.DdynamicEnum;
import com.baosight.hpjx.common.ProdOrderStatusEnum;
import com.baosight.hpjx.core.constant.CommonConstant;
import com.baosight.hpjx.core.dao.DaoUtils;
import com.baosight.hpjx.hp.constant.HPConstant;
import com.baosight.hpjx.hp.kc.domain.HPKC003;
import com.baosight.hpjx.hp.kc.tools.HPKCTools;
import com.baosight.hpjx.hp.pz.tools.HPPZTools;
import com.baosight.hpjx.hp.sc.domain.HPSC005;
import com.baosight.hpjx.hp.sc.domain.HPSC005A;
import com.baosight.hpjx.hp.sc.domain.HPSC005B;
import com.baosight.hpjx.hp.sc.tools.HPSCTools;
import com.baosight.hpjx.hp.zl.domain.HPZL001;
import com.baosight.hpjx.util.AssertUtils;
import com.baosight.hpjx.util.BeanUtils;
import com.baosight.hpjx.util.CommonMethod;
import com.baosight.hpjx.util.DateUtils;
import com.baosight.hpjx.util.EiInfoUtils;
import com.baosight.hpjx.util.LogUtils;
import com.baosight.hpjx.util.MapUtils;
import com.baosight.hpjx.util.ObjectUtils;
import com.baosight.iplat4j.core.ei.EiConstant;
import com.baosight.iplat4j.core.ei.EiInfo;
import com.baosight.iplat4j.core.service.impl.ServiceEPBase;
import com.baosight.iplat4j.ed.util.SequenceGenerator;
import java.math.BigDecimal;
import java.util.Arrays;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
/**
* 选择生产任务
*
* @author:songx
* @date:2022/7/11,11:08
*/
public class ServiceHPKC003A extends ServiceEPBase {
/**
* 初始化
*
* @param inInfo
* @return
*/
@Override
public EiInfo initLoad(EiInfo inInfo) {
try {
CommonMethod.initBlock(inInfo, Arrays.asList(DdynamicEnum.WH_RECORD_BLOCK_ID), null, false);
inInfo.addBlock(EiConstant.resultBlock).addBlockMeta(new HPSC005B().eiMetadata);
} catch (Exception e) {
LogUtils.setDetailMsg(inInfo, e, "初始化失败");
}
return inInfo;
}
/**
* 查询数据列表
*
* @param inInfo
* @return
*/
@Override
public EiInfo query(EiInfo inInfo) {
try {
Map queryMap = EiInfoUtils.getFirstRow(inInfo);
inInfo = super.query(inInfo, HPSC005B.QUERY, new HPSC005B());
} catch (Exception e) {
LogUtils.setDetailMsg(inInfo, e, "查询失败");
}
return inInfo;
}
/**
* 生成巡检单
*
* @param inInfo
* @return
*/
public EiInfo select(EiInfo inInfo) {
try {
List<Map> resultRows = inInfo.getBlock(EiConstant.resultBlock).getRows();
// 订单号
List<String> prodOrderNos = ObjectUtils.listKey(resultRows, "prodOrderNo");
// 任务号
List<String> prodTaskNos = ObjectUtils.listKey(resultRows, "prodTaskNo");
// 锁订单
HPSCTools.HpSc005.lock(prodOrderNos);
// 锁任务
HPSCTools.HpSc005a.lock(prodTaskNos);
// 查询任务信息
Map<String, HPSC005B> dbSc005bMap = HPSCTools.HpSc005b.map(prodTaskNos);
// 数据校验
for (Map row : resultRows) {
String whCode = MapUtils.getString(row, "whCode");
BigDecimal applyNum = MapUtils.getBigDecimal(row, "applyNum");
HPSC005B fSc005b = new HPSC005B();
fSc005b.fromMap(row);
AssertUtils.isEmpty(whCode, String.format("任务号[%s]的仓库不存在为空",
fSc005b.getProdTaskNo()));
HPSC005B dbSc005b = dbSc005bMap.get(fSc005b.getProdTaskNo());
AssertUtils.isTrue(ProdOrderStatusEnum.NOT_ASSIGN.getCode().equals(dbSc005b.getStatus()),
String.format("生产任务ID[%s]状态不是已分派,不允许操作", fSc005b.getId()));
BigDecimal subNum = dbSc005b.getNum().subtract(dbSc005b.getCompleteNum());
AssertUtils.isGt(applyNum, subNum, String.format("任务号[%s]申请数量[%s]不能大于未入库的数量[%s]",
fSc005b.getProdTaskNo(), applyNum, subNum));
// 校验是否存在巡检单
Map queryMap = new HashMap();
queryMap.put("prodTaskNo", fSc005b.getProdTaskNo());
queryMap.put("status", CommonConstant.YesNo.NO_0);
List<HPZL001> dbZl001s = dao.query(HPZL001.QUERY, queryMap);
AssertUtils.isNotEmpty(dbZl001s, String.format("任务号[%s]存在未处理的质量巡检单,请先处理质量巡检单",
fSc005b.getProdTaskNo()));
}
// 生成入库单
for (Map row : resultRows) {
String whCode = MapUtils.getString(row, "whCode");
BigDecimal applyNum = MapUtils.getBigDecimal(row, "applyNum");
HPSC005B fSc005b = new HPSC005B();
fSc005b.fromMap(row);
HPSC005B dbSc005b = dbSc005bMap.get(fSc005b.getProdTaskNo());
HPKC003 newKc003 = BeanUtils.copy(dbSc005b, HPKC003.class);
newKc003.setProdNo(SequenceGenerator.getNextSequence(HPConstant.SequenceId.HPKC003_PROD_NO));
newKc003.setDocumentDate(DateUtils.shortDate());
newKc003.setWhCode(whCode);
newKc003.setWhName(HPPZTools.getPz007ByCode(whCode).getWhName());
newKc003.setAmount(applyNum);
newKc003.setWeight(applyNum.multiply(dbSc005b.getUnitWt()));
newKc003.setDeleteFlag(CommonConstant.YesNo.NO_0);
DaoUtils.insert(HPKC003.INSERT, newKc003);
// 更新生产任务已完成数量
HPSCTools.HpSc005a.updateCompleteNum(fSc005b.getProdTaskNo(), applyNum);
// 修改库存
HPKCTools.updateProdStock(newKc003.getWhCode(), newKc003.getProdOrderNo(),
newKc003.getAmount(), newKc003.getWeight());
}
} catch (Exception e) {
LogUtils.setDetailMsg(inInfo, e, "生成入库单失败");
}
return inInfo;
}
}
......@@ -180,8 +180,8 @@ public class ServiceHPKC009 extends ServiceBase {
// 1.3、生产入库
List<HPKC003> scRks = dao.query(HPSqlConstant.HPKC003.STAT_DATE, queryMap);
Map<String, HPKC003> scRkMap = scRks.stream().collect(Collectors.toMap(item ->
buildKey(item.getCompanyCode(), item.getDepCode(), item.getInventType(), item.getInventCode(),
item.getWhCode(), item.getInventRecordId()), item -> item));
buildKey(item.getCompanyCode(), item.getDepCode(), item.getPartType(), item.getPartCode(),
item.getWhCode(), null), item -> item));
// 1.4、其他入库
List<HPKC006> qtRks = dao.query(HPSqlConstant.HPKC006.STAT_DATE, queryMap);
Map<String, HPKC006> qtRkMap = qtRks.stream().collect(Collectors.toMap(item ->
......
......@@ -10,10 +10,6 @@
PROD_NO as "prodNo", <!-- 生产单号 -->
WH_CODE as "whCode", <!-- 仓库编码 -->
WH_NAME as "whName", <!-- 仓库名称 -->
INVENT_TYPE as "inventType", <!-- 存货类型 -->
INVENT_CODE as "inventCode", <!-- 存货编码 -->
INVENT_NAME as "inventName", <!-- 存货名称 -->
INVENT_RECORD_ID as "inventRecordId", <!-- 存货档案ID -->
AMOUNT as "amount", <!-- 数量 -->
WEIGHT as "weight", <!-- 重量 -->
REMARK as "remark", <!-- 备注 -->
......@@ -23,7 +19,8 @@
UPDATED_BY as "updatedBy", <!-- 修改人 -->
UPDATED_TIME as "updatedTime", <!-- 修改人名称 -->
UPDATED_NAME as "updatedName", <!-- 修改时间 -->
PRODUCTION_ORDER_NO as "productionOrderNo", <!-- 生产订单号 -->
PROD_ORDER_NO as "prodOrderNo", <!-- 生产订单号 -->
PROD_TASK_NO as "prodTaskNo", <!-- 生产任务号 -->
DELETE_FLAG as "deleteFlag", <!-- 是否删除0:否1.是 -->
PROD_NO_OLD as "prodNoOld", <!-- 生产单号(旧) -->
PROJ_CODE as "projCode", <!-- 项目编码 -->
......@@ -46,6 +43,12 @@
</sql>
<sql id="condition">
<isNotEmpty prepend=" AND " property="companyCode">
COMPANY_CODE = #companyCode#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="depCode">
DEP_CODE = #depCode#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="id">
ID = #id#
</isNotEmpty>
......@@ -55,8 +58,8 @@
<isNotEmpty prepend=" AND " property="prodNo">
PROD_NO LIKE ('%$prodNo$%')
</isNotEmpty>
<isNotEmpty prepend=" AND " property="productionOrderNo">
PRODUCTION_ORDER_NO LIKE ('%$productionOrderNo$%')
<isNotEmpty prepend=" AND " property="prodOrderNo">
PROD_ORDER_NO LIKE ('%prodOrderNo%')
</isNotEmpty>
<isNotEmpty prepend=" AND " property="whCode">
WH_CODE = #whCode#
......@@ -64,21 +67,6 @@
<isNotEmpty prepend=" AND " property="whName">
WH_NAME = #whName#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="inventType">
INVENT_TYPE = #inventType#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="inventCode">
INVENT_CODE = #inventCode#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="inventName">
INVENT_NAME = #inventName#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="inventRecordId">
INVENT_RECORD_ID = #inventRecordId#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="companyCode">
COMPANY_CODE = #companyCode#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="deleteFlag">
DELETE_FLAG = #deleteFlag#
</isNotEmpty>
......@@ -134,20 +122,14 @@
PROD_NO, <!-- 生产单号 -->
WH_CODE, <!-- 仓库编码 -->
WH_NAME, <!-- 仓库名称 -->
INVENT_TYPE, <!-- 存货类型 -->
INVENT_CODE, <!-- 存货编码 -->
INVENT_NAME, <!-- 存货名称 -->
INVENT_RECORD_ID, <!-- 存货档案ID -->
AMOUNT, <!-- 数量 -->
WEIGHT, <!-- 重量 -->
REMARK, <!-- 备注 -->
CREATED_BY, <!-- 创建人 -->
CREATED_NAME, <!-- 创建人名称 -->
CREATED_TIME, <!-- 创建时间 -->
UPDATED_BY, <!-- 修改人 -->
UPDATED_TIME, <!-- 修改人名称 -->
UPDATED_NAME, <!-- 修改时间 -->
PRODUCTION_ORDER_NO, <!-- 生产订单号 -->
PROD_ORDER_NO, <!-- 生产订单号 -->
PROD_TASK_NO, <!-- 生产任务号 -->
DELETE_FLAG, <!-- 是否删除0:否1.是 -->
PROD_NO_OLD, <!-- 生产单号(旧) -->
PROJ_CODE, <!-- 项目编码 -->
......@@ -167,59 +149,32 @@
PART_THICK, <!-- 零件-厚 -->
PART_SPEC, <!-- 零件规格 -->
REMARK1 <!-- 备注 -->
) VALUES (
#companyCode#, #depCode#, #documentDate#, #prodNo#, #whCode#, #whName#, #amount#,
#weight#, #remark#, #createdBy#, #createdName#, #createdTime#, #prodOrderNo#,
#prodTaskNo#, #deleteFlag#, #prodNoOld#, #projCode#, #projName#, #prdtType#,
#prdtCode#, #prdtName#, #prdtLength#, #prdtWidth#, #prdtThick#, #prdtSpec#,
#partType#, #partCode#, #partName#, #partLength#, #partWidth#, #partThick#,
#partSpec#, #remark1#
)
VALUES (#companyCode#, #depCode#, #documentDate#, #prodNo#, #whCode#, #whName#, #inventType#, #inventCode#, #inventName#, #inventRecordId#, #amount#, #weight#, #remark#, #createdBy#, #createdName#, #createdTime#, #updatedBy#, #updatedTime#, #updatedName#, #productionOrderNo#, #deleteFlag#, #prodNoOld#, #projCode#, #projName#, #prdtType#, #prdtCode#, #prdtName#, #prdtLength#, #prdtWidth#, #prdtThick#, #prdtSpec#, #partType#, #partCode#, #partName#, #partLength#, #partWidth#, #partThick#, #partSpec#, #remark1#)
</insert>
<!-- 逻辑删除 -->
<update id="delete">
UPDATE ${hpjxSchema}.T_HPKC003
SET DELETE_FLAG = 1 WHERE ID = #id#
UPDATE ${hpjxSchema}.T_HPKC003 SET DELETE_FLAG = 1 WHERE ID = #id#
</update>
<update id="update">
<!-- 行锁 -->
<update id="lock">
UPDATE ${hpjxSchema}.T_HPKC003
SET
COMPANY_CODE = #companyCode#, <!-- 企业编码 预留 -->
DEP_CODE = #depCode#, <!-- 部门编码 预留 -->
DOCUMENT_DATE = #documentDate#, <!-- 票据日期 -->
PROD_NO = #prodNo#, <!-- 生产单号 -->
WH_CODE = #whCode#, <!-- 仓库编码 -->
WH_NAME = #whName#, <!-- 仓库名称 -->
INVENT_TYPE = #inventType#, <!-- 存货类型 -->
INVENT_CODE = #inventCode#, <!-- 存货编码 -->
INVENT_NAME = #inventName#, <!-- 存货名称 -->
INVENT_RECORD_ID = #inventRecordId#, <!-- 存货档案ID -->
AMOUNT = #amount#, <!-- 数量 -->
WEIGHT = #weight#, <!-- 重量 -->
REMARK = #remark#, <!-- 备注 -->
CREATED_BY = #createdBy#, <!-- 创建人 -->
CREATED_NAME = #createdName#, <!-- 创建人名称 -->
CREATED_TIME = #createdTime#, <!-- 创建时间 -->
UPDATED_BY = #updatedBy#, <!-- 修改人 -->
UPDATED_TIME = #updatedTime#, <!-- 修改人名称 -->
UPDATED_NAME = #updatedName#, <!-- 修改时间 -->
PRODUCTION_ORDER_NO = #productionOrderNo#, <!-- 生产订单号 -->
DELETE_FLAG = #deleteFlag#, <!-- 是否删除0:否1.是 -->
PROD_NO_OLD = #prodNoOld#, <!-- 生产单号(旧) -->
PROJ_CODE = #projCode#, <!-- 项目编码 -->
PROJ_NAME = #projName#, <!-- 项目名称 -->
PRDT_TYPE = #prdtType#, <!-- 产品类型 -->
PRDT_CODE = #prdtCode#, <!-- 产品编码 -->
PRDT_NAME = #prdtName#, <!-- 产品名称 -->
PRDT_LENGTH = #prdtLength#, <!-- 产品-长 -->
PRDT_WIDTH = #prdtWidth#, <!-- 产品-宽 -->
PRDT_THICK = #prdtThick#, <!-- 产品-厚 -->
PRDT_SPEC = #prdtSpec#, <!-- 产品规格 -->
PART_TYPE = #partType#, <!-- 零件类型 -->
PART_CODE = #partCode#, <!-- 零件编码 -->
PART_NAME = #partName#, <!-- 零件名称 -->
PART_LENGTH = #partLength#, <!-- 零件-长 -->
PART_WIDTH = #partWidth#, <!-- 零件-宽 -->
PART_THICK = #partThick#, <!-- 零件-厚 -->
PART_SPEC = #partSpec#, <!-- 零件规格 -->
REMARK1 = #remark1# <!-- 备注 -->
WHERE
ID = #id#
SET CREATED_TIME = CREATED_TIME
WHERE 1=1
<isNotEmpty prepend=" AND " property="prodNo">
PROD_NO = #prodNo#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="prodNos">
PROD_NO IN <iterate close=")" open="(" conjunction="," property="prodNos">#prodNos[]#</iterate>
</isNotEmpty>
</update>
<!-- 统计库存 -->
......
......@@ -129,6 +129,75 @@ public class HPKCTools {
}
/**
* HPKC003 公共方法定义
*
* @author:songx
* @date:2024/1/31,16:36
*/
public static class HpKc003 {
/**
* 锁
*
* @param prodNos
* @return
*/
public static void lock(List<String> prodNos) {
if (CollectionUtils.isEmpty(prodNos)) {
return;
}
Map queryMap = new HashMap();
queryMap.put("prodNos", prodNos);
DaoBase.getInstance().update(HPSqlConstant.HPKC003.LOCK, queryMap);
}
/**
* 查询销售出库信息
*
* @param ids
* @return
*/
public static List<HPKC003> listById(List<Long> ids) {
if (CollectionUtils.isEmpty(ids)) {
return null;
}
Map queryMap = new HashMap();
queryMap.put("ids", ids);
return DaoBase.getInstance().query(HPKC003.QUERY, queryMap);
}
/**
* 查询信息
*
* @param prodNos
* @return
*/
public static List<HPKC003> list(List<String> prodNos) {
if (CollectionUtils.isEmpty(prodNos)) {
return null;
}
Map queryMap = new HashMap();
queryMap.put("prodNos", prodNos);
return DaoBase.getInstance().query(HPKC003.QUERY, queryMap);
}
/**
* 查询信息
*
* @param prodNos
* @return
*/
public static Map<String, HPKC003> map(List<String> prodNos) {
List<HPKC003> results = list(prodNos);
if (CollectionUtils.isEmpty(results)) {
return null;
}
return results.stream().collect(Collectors.toMap(HPKC003::getProdNo, item -> item));
}
}
/**
* HPKC004 公共方法定义
*
......
......@@ -4,6 +4,7 @@ import com.baosight.hpjx.common.InventTypeEnum;
import com.baosight.hpjx.core.constant.CommonConstant;
import com.baosight.hpjx.core.dao.DaoBase;
import com.baosight.hpjx.hp.constant.HPSqlConstant;
import com.baosight.hpjx.hp.kc.domain.HPKC006;
import com.baosight.hpjx.hp.pz.domain.HPPZ004;
import com.baosight.hpjx.hp.pz.domain.HPPZ006;
import com.baosight.hpjx.hp.pz.domain.HPPZ007;
......@@ -31,6 +32,30 @@ import java.util.stream.Collectors;
public class HPPZTools {
/**
* HPPZ011公共DAO方法定义
*
* @author:songx
* @date:2024/2/5,11:18
*/
public static class HpPz011 {
/**
* 查询其他入库信息
*
* @param id
* @return
*/
public static HPPZ011 get(Long id) {
AssertUtils.isNull(id, String.format("厂区生产组ID[%s]不能为空", id));
Map queryMap = new HashMap();
queryMap.put("id", id);
List<HPPZ011> results = DaoBase.getInstance().query(HPPZ011.QUERY, queryMap);
AssertUtils.isEmpty(results, String.format("厂区生产组ID[%s]不存在", id));
return results.get(0);
}
}
/**
* 查询存货
*
* @param inventCode
......
......@@ -24,8 +24,14 @@ public class HPSC005B extends HPSC005 {
private static final long serialVersionUID = 1L;
public static final String FIELD_CHILD_ID = "childId";
public static final String FIELD_PROD_TASK_NO = "prodTaskNo";
public static final String FIELD_PROD_ORDER_NO = "prodOrderNo";
public static final String FIELD_COMPLETE_NUM = "completeNum"; /* 已完成数量*/
public static final String COL_CHILD_ID = "CHILD_ID";
public static final String COL_PROD_TASK_NO = "PROD_TASK_NO";
public static final String COL_PROD_ORDER_NO = "PROD_ORDER_NO";
public static final String COL_COMPLETE_NUM = "COMPLETE_NUM"; /* 已完成数量*/
public static final String QUERY = "HPSC005B.query";
public static final String COUNT = "HPSC005B.count";
......@@ -34,6 +40,9 @@ public class HPSC005B extends HPSC005 {
public static final String DELETE = "HPSC005B.delete";
private Long childId;
private String prodTaskNo = " ";
private String prodOrderNo = " ";
private BigDecimal completeNum = new BigDecimal(0.000); /* 已完成数量*/
/**
* the constructor.
......@@ -53,6 +62,20 @@ public class HPSC005B extends HPSC005 {
eiColumn.setDescName(" ");
eiMetadata.addMeta(eiColumn);
eiColumn = new EiColumn(FIELD_PROD_TASK_NO);
eiColumn.setDescName("生产任务号");
eiMetadata.addMeta(eiColumn);
eiColumn = new EiColumn(FIELD_PROD_ORDER_NO);
eiColumn.setDescName("生产订单号");
eiMetadata.addMeta(eiColumn);
eiColumn = new EiColumn(FIELD_COMPLETE_NUM);
eiColumn.setType("N");
eiColumn.setScaleLength(3);
eiColumn.setFieldLength(15);
eiColumn.setDescName("已完成数量");
eiMetadata.addMeta(eiColumn);
}
/**
......@@ -73,6 +96,38 @@ public class HPSC005B extends HPSC005 {
this.childId = childId;
}
public String getProdTaskNo() {
return prodTaskNo;
}
public void setProdTaskNo(String prodTaskNo) {
this.prodTaskNo = prodTaskNo;
}
public String getProdOrderNo() {
return prodOrderNo;
}
public void setProdOrderNo(String prodOrderNo) {
this.prodOrderNo = prodOrderNo;
}
/**
* get the completeNum - 已完成数量.
* @return the completeNum
*/
public BigDecimal getCompleteNum() {
return this.completeNum;
}
/**
* set the completeNum - 已完成数量.
*
* @param completeNum - 已完成数量
*/
public void setCompleteNum(BigDecimal completeNum) {
this.completeNum = completeNum;
}
/**
* get the value from Map.
*
......@@ -82,6 +137,9 @@ public class HPSC005B extends HPSC005 {
public void fromMap(Map map) {
super.fromMap(map);
setChildId(NumberUtils.toLong(StringUtils.toString(map.get(FIELD_CHILD_ID)), childId));
setProdTaskNo(StringUtils.defaultIfEmpty(StringUtils.toString(map.get(FIELD_PROD_TASK_NO)), prodTaskNo));
setProdOrderNo(StringUtils.defaultIfEmpty(StringUtils.toString(map.get(FIELD_PROD_ORDER_NO)), prodOrderNo));
setCompleteNum(NumberUtils.toBigDecimal(StringUtils.toString(map.get(FIELD_COMPLETE_NUM)), completeNum));
}
/**
......@@ -92,6 +150,9 @@ public class HPSC005B extends HPSC005 {
Map map = super.toMap();
map.put(FIELD_CHILD_ID, StringUtils.toString(childId, eiMetadata.getMeta(FIELD_CHILD_ID)));
map.put(FIELD_PROD_TASK_NO, StringUtils.toString(prodTaskNo, eiMetadata.getMeta(FIELD_PROD_TASK_NO)));
map.put(FIELD_PROD_ORDER_NO, StringUtils.toString(prodOrderNo, eiMetadata.getMeta(FIELD_PROD_ORDER_NO)));
map.put(FIELD_COMPLETE_NUM, StringUtils.toString(completeNum, eiMetadata.getMeta(FIELD_COMPLETE_NUM)));
return map;
}
......
package com.baosight.hpjx.hp.sc.service;
import com.baosight.hpjx.common.ProdOrderStatusEnum;
import com.baosight.hpjx.core.dao.DaoUtils;
import com.baosight.hpjx.hp.constant.HPConstant;
import com.baosight.hpjx.hp.pz.domain.HPPZ011;
import com.baosight.hpjx.hp.pz.tools.HPPZTools;
import com.baosight.hpjx.hp.sc.domain.HPSC005;
import com.baosight.hpjx.hp.sc.domain.HPSC005A;
import com.baosight.hpjx.hp.sc.domain.HPSC005B;
import com.baosight.hpjx.hp.sc.tools.HPSCTools;
import com.baosight.hpjx.util.AssertUtils;
import com.baosight.hpjx.util.EiInfoUtils;
import com.baosight.hpjx.util.LogUtils;
import com.baosight.hpjx.util.MapUtils;
import com.baosight.hpjx.util.ObjectUtils;
import com.baosight.iplat4j.core.ei.EiConstant;
import com.baosight.iplat4j.core.ei.EiInfo;
import com.baosight.iplat4j.core.service.impl.ServiceBase;
import com.baosight.iplat4j.ed.util.SequenceGenerator;
import java.math.BigDecimal;
import java.util.List;
import java.util.Map;
/**
* 生产任务
*
* @author:songx
* @date:2024/2/5,9:55
*/
public class ServiceHPSC005B extends ServiceBase {
/**
* 画面初始化.
*
* @param inInfo
* @return
*/
public EiInfo initLoad(EiInfo inInfo) {
try {
inInfo.addBlock(EiConstant.resultBlock).addBlockMeta(new HPSC005B().eiMetadata);
} catch (Exception e) {
LogUtils.setMsg(inInfo, e, "初始化失败");
}
return inInfo;
}
/**
* 查询操作.
*
* @param inInfo
* @return
*/
@Override
public EiInfo query(EiInfo inInfo) {
try {
inInfo = super.query(inInfo, HPSC005B.QUERY, new HPSC005B());
} catch (Throwable e) {
LogUtils.setDetailMsg(inInfo, e, "查询失败");
}
return inInfo;
}
}
......@@ -41,6 +41,12 @@ public class ServiceHPSC098 extends ServiceBase {
return inInfo;
}
/**
* 查询
*
* @param inInfo
* @return
*/
@Override
public EiInfo query(EiInfo inInfo) {
try {
......
......@@ -126,6 +126,13 @@
</isNotEmpty>
</sql>
<!-- 公共修改字段 -->
<sql id="updateRevise">
UPDATED_BY = #updatedBy#, <!-- 修改人 -->
UPDATED_NAME = #updatedName#, <!-- 修改人名称 -->
UPDATED_TIME = #updatedTime# <!-- 修改时间 -->
</sql>
<select id="query" parameterClass="java.util.HashMap"
resultClass="com.baosight.hpjx.hp.sc.domain.HPSC005">
SELECT
......@@ -148,66 +155,6 @@
<include refid="condition" />
</select>
<!--
<isNotEmpty prepend=" AND " property="id">
ID = #id#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="companyCode">
COMPANY_CODE = #companyCode#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="projCode">
PROJ_CODE = #projCode#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="projName">
PROJ_NAME = #projName#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="productionOrderNo">
PRODUCTION_ORDER_NO = #productionOrderNo#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="prdtCode">
PRDT_CODE = #prdtCode#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="prdtName">
PRDT_NAME = #prdtName#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="planCompletionDate">
PLAN_COMPLETION_DATE = #planCompletionDate#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="num">
NUM = #num#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="totalWt">
TOTAL_WT = #totalWt#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="status">
STATUS = #status#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="orgNo">
ORG_NO = #orgNo#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="orgName">
ORG_NAME = #orgName#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="createdBy">
CREATED_BY = #createdBy#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="createdTime">
CREATED_TIME = #createdTime#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="updatedBy">
UPDATED_BY = #updatedBy#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="updatedTime">
UPDATED_TIME = #updatedTime#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="depCode">
DEP_CODE = #depCode#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="remark">
REMARK = #remark#
</isNotEmpty>
-->
<insert id="insert">
INSERT INTO ${hpjxSchema}.T_HPSC005 (ID,
COMPANY_CODE, <!-- 企业编码 预留 -->
......@@ -318,11 +265,9 @@
STATUS = #status#, <!-- 状态 0-未派工,1-部分派工,2-全部派工 -->
ASSIGNED_NUM = #assignedNum#, <!-- 已派工数量 -->
UNASSIGNED_NUM = #unassignedNum#, <!-- 待派工数量 -->
UPDATED_BY = #updatedBy#, <!-- 更新人 -->
UPDATED_TIME = #updatedTime#, <!-- 更新时间 -->
DOCUMENT_TYPE = 1
WHERE
ID = #id#
DOCUMENT_TYPE = 1,
<include refid="updateRevise"/>
WHERE ID = #id#
</update>
<select id="getEntity" parameterClass="java.util.HashMap"
......@@ -335,6 +280,19 @@
</isNotEmpty>
</select>
<!-- 行锁 -->
<update id="lock">
UPDATE ${hpjxSchema}.T_HPSC005
SET CREATED_TIME = CREATED_TIME
WHERE 1=1
<isNotEmpty prepend=" AND " property="prodOrderNo">
PRODUCTION_ORDER_NO = #prodOrderNo#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="prodOrderNos">
PRODUCTION_ORDER_NO IN <iterate close=")" open="(" conjunction="," property="prodOrderNos">#prodOrderNos[]#</iterate>
</isNotEmpty>
</update>
<!-- 项目下拉框 -->
<select id="queryProjComboBox" parameterClass="java.util.HashMap" resultClass="java.util.HashMap">
SELECT DISTINCT
......
<?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-02-01 10:19:32
Version : 1.0
schema : hpjx
tableName : T_HPSC005A
ID BIGINT NOT NULL primarykey,
PRODUCTION_ORDER_NO VARCHAR,
NUM DECIMAL,
TOTAL_WT DECIMAL,
ORG_NO VARCHAR,
ORG_NAME VARCHAR,
FACTORY_CODE VARCHAR,
FACTORY_NAME VARCHAR,
CREATED_BY VARCHAR,
CREATED_TIME VARCHAR,
UPDATED_BY VARCHAR,
UPDATED_TIME VARCHAR
-->
<!DOCTYPE sqlMap PUBLIC "-//iBATIS.com//DTD SQL Map 2.0//EN" "http://www.ibatis.com/dtd/sql-map-2.dtd">
<sqlMap namespace="HPSC005A">
<sql id="column">
ID as "id",
COMPANY_CODE as "companyCode", <!-- 企业编码 预留 -->
DEP_CODE as "depCode", <!-- 部门编码 预留 -->
PROD_TASK_NO as "prodTaskNo", <!-- 生产任务单号 -->
PROD_ORDER_NO as "prodOrderNo", <!-- 生产订单号 -->
NUM as "num", <!-- 计划数量 -->
TOTAL_WT as "totalWt", <!-- 计划重量 -->
COMPLETE_NUM as "completeNum", <!-- 已完成数量 -->
ORG_NO as "orgNo", <!-- 生产组编码 -->
ORG_NAME as "orgName", <!-- 生产组名称 -->
FACTORY_CODE as "factoryCode", <!-- 厂区编码 -->
FACTORY_NAME as "factoryName", <!-- 厂区名称 -->
CREATED_BY as "createdBy", <!-- 创建人 -->
CREATED_NAME as "createdName", <!-- 创建人名称 -->
CREATED_TIME as "createdTime", <!-- 创建时间 -->
UPDATED_BY as "updatedBy", <!-- 更新人 -->
UPDATED_NAME as "updatedName", <!-- 修改人名称 -->
UPDATED_TIME as "updatedTime" <!-- 更新时间 -->
</sql>
<sql id="condition">
<isNotEmpty prepend=" AND " property="id">
ID = #id#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="productionOrderNo">
PRODUCTION_ORDER_NO = #productionOrderNo#
<isNotEmpty prepend=" AND " property="companyCode">
COMPANY_CODE = #companyCode#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="num">
NUM = #num#
<isNotEmpty prepend=" AND " property="depCode">
DEP_CODE = #depCode#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="totalWt">
TOTAL_WT = #totalWt#
<isNotEmpty prepend=" AND " property="prodTaskNo">
PROD_TASK_NO = #prodTaskNo#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="prodOrderNo">
PROD_ORDER_NO = #prodOrderNo#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="orgNo">
ORG_NO = #orgNo#
......@@ -47,127 +54,109 @@
<isNotEmpty prepend=" AND " property="createdBy">
CREATED_BY = #createdBy#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="createdName">
CREATED_NAME = #createdName#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="createdTime">
CREATED_TIME = #createdTime#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="updatedBy">
UPDATED_BY = #updatedBy#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="updatedName">
UPDATED_NAME = #updatedName#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="updatedTime">
UPDATED_TIME = #updatedTime#
</isNotEmpty>
</sql>
<select id="query" parameterClass="java.util.HashMap"
resultClass="com.baosight.hpjx.hp.sc.domain.HPSC005A">
SELECT
ID as "id",
PRODUCTION_ORDER_NO as "productionOrderNo", <!-- 生产订单号 -->
NUM as "num", <!-- 计划数量 -->
TOTAL_WT as "totalWt", <!-- 计划重量 -->
ORG_NO as "orgNo", <!-- 生产组编码 -->
ORG_NAME as "orgName", <!-- 生产组名称 -->
FACTORY_CODE as "factoryCode", <!-- 厂区编码 -->
FACTORY_NAME as "factoryName", <!-- 厂区名称 -->
CREATED_BY as "createdBy", <!-- 创建人 -->
CREATED_TIME as "createdTime", <!-- 创建时间 -->
UPDATED_BY as "updatedBy", <!-- 更新人 -->
UPDATED_TIME as "updatedTime" <!-- 更新时间 -->
FROM ${hpjxSchema}.T_HPSC005A WHERE 1=1
<include refid="condition" />
<sql id="customCondition">
<isNotEmpty prepend=" AND " property="prodTaskNos">
PROD_TASK_NO IN <iterate close=")" open="(" conjunction="," property="prodTaskNos">#prodTaskNos[]#</iterate>
</isNotEmpty>
</sql>
<!-- 公共修改字段 -->
<sql id="updateRevise">
UPDATED_BY = #updatedBy#, <!-- 修改人 -->
UPDATED_NAME = #updatedName#, <!-- 修改人名称 -->
UPDATED_TIME = #updatedTime# <!-- 修改时间 -->
</sql>
<sql id="order">
<dynamic prepend="ORDER BY">
<isNotEmpty property="orderBy">
<isNotEmpty property="order">
$orderBy$
</isNotEmpty>
<isEmpty property="orderBy">
<isEmpty property="order">
ID asc
</isEmpty>
</dynamic>
</sql>
<select id="query" resultClass="com.baosight.hpjx.hp.sc.domain.HPSC005A">
SELECT
<include refid="column"/>
FROM ${hpjxSchema}.T_HPSC005A
WHERE 1=1
<include refid="condition"/>
<include refid="customCondition"/>
<include refid="order"/>
</select>
<select id="count" resultClass="int">
SELECT COUNT(*) FROM ${hpjxSchema}.T_HPSC005A WHERE 1=1
<include refid="condition" />
<include refid="condition"/>
<include refid="customCondition"/>
</select>
<!--
<isNotEmpty prepend=" AND " property="id">
ID = #id#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="productionOrderNo">
PRODUCTION_ORDER_NO = #productionOrderNo#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="num">
NUM = #num#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="totalWt">
TOTAL_WT = #totalWt#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="orgNo">
ORG_NO = #orgNo#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="orgName">
ORG_NAME = #orgName#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="factoryCode">
FACTORY_CODE = #factoryCode#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="factoryName">
FACTORY_NAME = #factoryName#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="createdBy">
CREATED_BY = #createdBy#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="createdTime">
CREATED_TIME = #createdTime#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="updatedBy">
UPDATED_BY = #updatedBy#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="updatedTime">
UPDATED_TIME = #updatedTime#
</isNotEmpty>
-->
<insert id="insert">
INSERT INTO ${hpjxSchema}.T_HPSC005A (ID,
PRODUCTION_ORDER_NO, <!-- 生产订单号 -->
INSERT INTO ${hpjxSchema}.T_HPSC005A (
COMPANY_CODE, <!-- 企业编码 预留 -->
DEP_CODE, <!-- 部门编码 预留 -->
PROD_TASK_NO, <!-- 生产任务单号 -->
PROD_ORDER_NO, <!-- 生产订单号 -->
NUM, <!-- 计划数量 -->
TOTAL_WT, <!-- 计划重量 -->
COMPLETE_NUM, <!-- 已完成数量 -->
ORG_NO, <!-- 生产组编码 -->
ORG_NAME, <!-- 生产组名称 -->
FACTORY_CODE, <!-- 厂区编码 -->
FACTORY_NAME, <!-- 厂区名称 -->
CREATED_BY, <!-- 创建人 -->
CREATED_TIME, <!-- 创建时间 -->
UPDATED_BY, <!-- 更新人 -->
UPDATED_TIME <!-- 更新时间 -->
CREATED_NAME, <!-- 创建人名称 -->
CREATED_TIME <!-- 创建时间 -->
) VALUES (
#companyCode#, #depCode#, #prodTaskNo#, #prodOrderNo#, #num#, #totalWt#,
#completeNum#, #orgNo#, #orgName#, #factoryCode#, #factoryName#, #createdBy#,
#createdName#, #createdTime#
)
VALUES (#id#, #productionOrderNo#, #num#, #totalWt#, #orgNo#, #orgName#, #factoryCode#, #factoryName#, #createdBy#, #createdTime#, #updatedBy#, #updatedTime#)
</insert>
<delete id="delete">
DELETE FROM ${hpjxSchema}.T_HPSC005A WHERE
ID = #id#
DELETE FROM ${hpjxSchema}.T_HPSC005A WHERE ID = #id#
</delete>
<update id="update">
<!-- 行锁 -->
<update id="lock">
UPDATE ${hpjxSchema}.T_HPSC005A
SET
PRODUCTION_ORDER_NO = #productionOrderNo#, <!-- 生产订单号 -->
NUM = #num#, <!-- 计划数量 -->
TOTAL_WT = #totalWt#, <!-- 计划重量 -->
ORG_NO = #orgNo#, <!-- 生产组编码 -->
ORG_NAME = #orgName#, <!-- 生产组名称 -->
FACTORY_CODE = #factoryCode#, <!-- 厂区编码 -->
FACTORY_NAME = #factoryName#, <!-- 厂区名称 -->
CREATED_BY = #createdBy#, <!-- 创建人 -->
CREATED_TIME = #createdTime#, <!-- 创建时间 -->
UPDATED_BY = #updatedBy#, <!-- 更新人 -->
UPDATED_TIME = #updatedTime# <!-- 更新时间 -->
WHERE
ID = #id#
SET CREATED_TIME = CREATED_TIME
WHERE 1=1
<isNotEmpty prepend=" AND " property="prodTaskNo">
PROD_TASK_NO = #prodTaskNo#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="prodTaskNos">
PROD_TASK_NO IN <iterate close=")" open="(" conjunction="," property="prodTaskNos">#prodTaskNos[]#</iterate>
</isNotEmpty>
</update>
<!-- 已完成数量 -->
<update id="updateCompleteNum">
UPDATE ${hpjxSchema}.T_HPSC005A
SET
COMPLETE_NUM = COMPLETE_NUM + #completeNum#,
<include refid="updateRevise"/>
WHERE PROD_TASK_NO = #prodTaskNo#
</update>
</sqlMap>
......@@ -4,7 +4,6 @@
<sql id="column">
A.ID as "id",
B.ID as "childId",
A.PROJ_CODE as "projCode", <!-- 项目编码 -->
A.PROJ_NAME as "projName", <!-- 项目名称 -->
A.PRODUCTION_ORDER_NO as "productionOrderNo", <!-- 生产订单号 -->
......@@ -20,13 +19,20 @@
A.PART_LENGTH as "partLength", <!-- 长 -->
A.PART_WIDTH as "partWidth", <!-- 宽 -->
A.PART_THICK as "partThick", <!-- 厚 -->
A.FACTORY_CODE as "factoryCode", <!-- 厂区编码 -->
A.FACTORY_NAME as "factoryName", <!-- 厂区名称 -->
A.UNIT_WT as "unitWt", <!-- 单重 -->
A.STATUS as "status", <!-- 状态 -->
(CASE WHEN A.DOCUMENT_TYPE = 1 THEN B.NUM ELSE A.NUM END) AS "num",
(CASE WHEN A.DOCUMENT_TYPE = 1 THEN B.TOTAL_WT ELSE A.TOTAL_WT END) AS "totalWt",
(CASE WHEN A.DOCUMENT_TYPE = 1 THEN B.ORG_NO ELSE A.ORG_NO END) AS "orgNo",
(CASE WHEN A.DOCUMENT_TYPE = 1 THEN B.ORG_NAME ELSE A.ORG_NAME END) AS "orgName"
A.PLAN_COMPLETION_DATE as "planCompletionDate", <!-- 计划完成日期 -->
A.FILE_PATH1 as "filePath1",
B.ID as "childId",
B.PROD_TASK_NO as "prodTaskNo",
B.PROD_ORDER_NO as "prodOrderNo",
B.NUM as "num",
B.TOTAL_WT as "totalWt",
B.COMPLETE_NUM as "completeNum",
B.FACTORY_CODE as "factoryCode", <!-- 厂区编码 -->
B.FACTORY_NAME as "factoryName", <!-- 厂区名称 -->
B.ORG_NO as "orgNo",
B.ORG_NAME as "orgName"
</sql>
<sql id="condition">
......@@ -36,9 +42,6 @@
<isNotEmpty prepend=" AND " property="id">
A.ID = #id#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="childId">
B.ID = #childId#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="productionOrderNo">
A.PRODUCTION_ORDER_NO LIKE CONCAT('%', #productionOrderNo#, '%')
</isNotEmpty>
......@@ -60,23 +63,63 @@
<isNotEmpty prepend=" AND " property="partName">
A.PART_NAME LIKE CONCAT('%', #partName#, '%')
</isNotEmpty>
<isNotEmpty prepend=" AND " property="childId">
B.ID = #childId#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="prodTaskNo">
B.PROD_TASK_NO = #prodTaskNo#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="prodOrderNo">
B.PROD_ORDER_NO = #prodOrderNo#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="factoryName">
B.FACTORY_NAME LIKE CONCAT('%', #factoryName#, '%')
</isNotEmpty>
<isNotEmpty prepend=" AND " property="orgName">
B.ORG_NAME LIKE CONCAT('%', #orgName#, '%')
</isNotEmpty>
</sql>
<sql id="customCondition">
<isNotEmpty prepend=" AND " property="ids">
A.ID IN <iterate close=")" open="(" conjunction="," property="statuses">#statuses[]#</iterate>
</isNotEmpty>
<isNotEmpty prepend=" AND " property="prodTaskNos">
B.PROD_TASK_NO IN <iterate close=")" open="(" conjunction="," property="prodTaskNos">#prodTaskNos[]#</iterate>
</isNotEmpty>
<isNotEmpty prepend=" AND " property="statuses">
A.STATUS IN <iterate close=")" open="(" conjunction="," property="statuses">#statuses[]#</iterate>
</isNotEmpty>
</sql>
<sql id="order">
<dynamic prepend="ORDER BY">
<isNotEmpty property="order">
$orderBy$
</isNotEmpty>
<isEmpty property="order">
ID ASC
</isEmpty>
</dynamic>
</sql>
<!-- 选择生产任务 -->
<select id="query" resultClass="com.baosight.hpjx.hp.sc.domain.HPSC005B">
SELECT
<include refid="column"/>
FROM HPJX.T_HPSC005 A
LEFT JOIN HPJX.T_HPSC005A B ON A.PRODUCTION_ORDER_NO = B.PRODUCTION_ORDER_NO
INNER JOIN HPJX.T_HPSC005A B ON A.PRODUCTION_ORDER_NO = B.PROD_ORDER_NO
WHERE 1=1
<include refid="condition"/>
<include refid="customCondition"/>
<include refid="order"/>
</select>
<!-- 选择生产任务 -->
<select id="count" resultClass="int">
SELECT COUNT(*)
FROM HPJX.T_HPSC005 A
INNER JOIN HPJX.T_HPSC005A B ON A.PRODUCTION_ORDER_NO = B.PROD_ORDER_NO
WHERE 1=1
<include refid="condition"/>
<include refid="customCondition"/>
......
......@@ -3,6 +3,7 @@ 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.HPKC001;
import com.baosight.hpjx.hp.kc.domain.HPKC005;
import com.baosight.hpjx.hp.kc.domain.HPKC010;
import com.baosight.hpjx.hp.pz.domain.HPPZ004;
import com.baosight.hpjx.hp.sc.domain.HPSC001;
......@@ -11,6 +12,7 @@ import com.baosight.hpjx.hp.sc.domain.HPSC005;
import com.baosight.hpjx.hp.sc.domain.HPSC005A;
import com.baosight.hpjx.hp.sc.domain.HPSC005B;
import com.baosight.hpjx.util.AssertUtils;
import com.baosight.hpjx.util.StringUtils;
import com.baosight.iplat4j.core.exception.PlatException;
import org.apache.commons.collections.CollectionUtils;
......@@ -20,45 +22,47 @@ import java.util.List;
import java.util.Map;
import java.util.stream.Collectors;
/**
* @author:songx
* @date:2024/2/5,10:15
*/
public class HPSCTools {
/**
* 拆单数量校正
* @param productionOrderNo
*
* @param prodOrderNo 生产订单号
* @param assignNum 分派数量
*/
public static void checkAssignedNum(String productionOrderNo) {
//生产订单
HPSC005 HPSC005 = (HPSC005)DaoBase.getInstance().get("HPSC005.getEntity","productionOrderNo",productionOrderNo);
BigDecimal jhNum = HPSC005.getNum();
//子单
public static void checkAssignedNum(String prodOrderNo, BigDecimal assignNum) {
// 生产订单
HPSC005 dbSc005 = HPSCTools.HpSc005.get(prodOrderNo);
BigDecimal jhNum = dbSc005.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");
queryMap.put("prodOrderNo", prodOrderNo);
List<HPSC005A> dbSc005as = DaoBase.getInstance().query(HPSC005A.QUERY, queryMap, 0, -999999);
BigDecimal totalNum = assignNum;
if (CollectionUtils.isNotEmpty(dbSc005as)) {
for (HPSC005A dbSc005a : dbSc005as) {
totalNum = totalNum.add(dbSc005a.getNum());
}
DaoBase.getInstance().update(HPSqlConstant.HPSC005.UPDATE_ASSIGN_NUM, map);
}
// 判断重量是否超过订单重量
AssertUtils.isGt(totalNum, jhNum, "拆单的分派数量不能大于计划数量!");
Map updateMap = new HashMap();
updateMap.put("id", dbSc005.getId());
updateMap.put("assignedNum", totalNum);
updateMap.put("unassignedNum", jhNum.subtract(totalNum));
// 0.未派工,1.部分派工,2.全部派工
if (jhNum.compareTo(assignNum) == 0) {
updateMap.put("status", 2);
} else if (totalNum.compareTo(BigDecimal.ZERO) == 1) {
updateMap.put("status", 1);
} else {
updateMap.put("status", 0);
}
DaoBase.getInstance().update(HPSqlConstant.HPSC005.UPDATE_ASSIGN_NUM, updateMap);
}
/**
......@@ -119,6 +123,36 @@ public class HPSCTools {
public static class HpSc005 {
/**
* 锁
*
* @param prodOrderNo
* @return
*/
public static void lock(String prodOrderNo) {
if (StringUtils.isBlank(prodOrderNo)) {
return;
}
Map queryMap = new HashMap();
queryMap.put("prodOrderNo", prodOrderNo);
DaoBase.getInstance().update(HPSqlConstant.HPSC005.LOCK, queryMap);
}
/**
* 锁
*
* @param prodOrderNos
* @return
*/
public static void lock(List<String> prodOrderNos) {
if (CollectionUtils.isEmpty(prodOrderNos)) {
return;
}
Map queryMap = new HashMap();
queryMap.put("prodOrderNos", prodOrderNos);
DaoBase.getInstance().update(HPSqlConstant.HPSC005.LOCK, queryMap);
}
/**
* 查询
*
* @param id
......@@ -179,5 +213,142 @@ public class HPSCTools {
return results.stream().collect(Collectors.toMap(HPSC005::getId, item -> item));
}
/**
* 查询
*
* @param prodOrderNo
* @return
*/
public static HPSC005 get(String prodOrderNo) {
AssertUtils.isNull(prodOrderNo, "生产订单号不能为空");
Map queryMap = new HashMap();
queryMap.put("productionOrderNo", prodOrderNo);
List<HPSC005> results = DaoBase.getInstance().query(HPSC005.QUERY, queryMap);
AssertUtils.isNull(results, String.format("生产订单[%s]信息不存在", prodOrderNo));
return results.get(0);
}
}
/**
* HPSC005A公共DAO定义
*
* @author:songx
* @date:2024/2/5,10:53
*/
public static class HpSc005a {
/**
* 更新已完成数量
*
* @param prodTaskNo
* @param completeNum
*/
public static void updateCompleteNum(String prodTaskNo, BigDecimal completeNum) {
AssertUtils.isEmpty(prodTaskNo, "生产任务单号不能为空");
Map queryMap = new HashMap();
queryMap.put("prodTaskNo", prodTaskNo);
queryMap.put("completeNum", completeNum);
DaoBase.getInstance().update(HPSqlConstant.HPSC005A.UPDATE_COMPLETE_NUM, queryMap);
}
/**
* 锁
*
* @param prodTaskNos
* @return
*/
public static void lock(List<String> prodTaskNos) {
if (CollectionUtils.isEmpty(prodTaskNos)) {
return;
}
Map queryMap = new HashMap();
queryMap.put("prodTaskNos", prodTaskNos);
DaoBase.getInstance().update(HPSqlConstant.HPSC005A.LOCK, queryMap);
}
/**
* 查询信息
*
* @param id
* @return
*/
public static HPSC005A getById(Long id) {
AssertUtils.isNull(id, "生产任务ID不能为空");
Map queryMap = new HashMap();
queryMap.put("id", id);
List<HPSC005A> results = DaoBase.getInstance().query(HPSC005A.QUERY, queryMap);
AssertUtils.isEmpty(results, String.format("生产任务[%s]信息不存在", id));
return results.get(0);
}
/**
* 查询信息
*
* @param prodTaskNos
* @return
*/
public static List<HPSC005A> list(List<String> prodTaskNos) {
if (CollectionUtils.isEmpty(prodTaskNos)) {
return null;
}
Map queryMap = new HashMap();
queryMap.put("prodTaskNos", prodTaskNos);
return DaoBase.getInstance().query(HPSC005A.QUERY, queryMap);
}
/**
* 查询盘点单信息
*
* @param prodTaskNos
* @return
*/
public static Map<String, HPSC005A> map(List<String> prodTaskNos) {
List<HPSC005A> results = list(prodTaskNos);
if (CollectionUtils.isEmpty(results)) {
return null;
}
return results.stream().collect(Collectors.toMap(HPSC005A::getProdTaskNo, item -> item));
}
}
/**
* HPSC005B公共DAO定义
*
* @author:songx
* @date:2024/2/5,10:53
*/
public static class HpSc005b {
/**
* 查询盘点单信息
*
* @param prodTaskNos
* @return
*/
public static List<HPSC005B> list(List<String> prodTaskNos) {
if (CollectionUtils.isEmpty(prodTaskNos)) {
return null;
}
Map queryMap = new HashMap();
queryMap.put("prodTaskNos", prodTaskNos);
return DaoBase.getInstance().query(HPSC005B.QUERY, queryMap);
}
/**
* 查询盘点单信息
*
* @param prodTaskNos
* @return
*/
public static Map<String, HPSC005B> map(List<String> prodTaskNos) {
List<HPSC005B> results = list(prodTaskNos);
if (CollectionUtils.isEmpty(results)) {
return null;
}
return results.stream().collect(Collectors.toMap(HPSC005B::getProdTaskNo, item -> item));
}
}
}
......@@ -15,7 +15,7 @@ import com.baosight.iplat4j.core.util.StringUtils;
* Copyrigth:Baosight Software LTD.co Copyright (c) 2019. <br>
*
* @version 1.0
* @history 2024-02-02 14:09:26 create
* @history 2024-02-05 16:53:35 create
*/
public class HPZL001 extends DaoEPBase {
......@@ -26,7 +26,8 @@ public class HPZL001 extends DaoEPBase {
public static final String FIELD_DEP_CODE = "depCode"; /* 部门编码*/
public static final String FIELD_RECEIPT_DATE = "receiptDate"; /* 单据日期*/
public static final String FIELD_CHECK_NO = "checkNo"; /* 检查单号*/
public static final String FIELD_PROD_NO = "prodNo"; /* 生产任务号*/
public static final String FIELD_PROD_ORDER_NO = "prodOrderNo"; /* 生产订单号*/
public static final String FIELD_PROD_TASK_NO = "prodTaskNo"; /* 生产任务号*/
public static final String FIELD_PROJ_CODE = "projCode"; /* 项目号*/
public static final String FIELD_PROJ_NAME = "projName"; /* 项目名称*/
public static final String FIELD_INVENT_CODE = "inventCode"; /* 部件编码*/
......@@ -46,14 +47,15 @@ public class HPZL001 extends DaoEPBase {
public static final String FIELD_UPDATED_BY = "updatedBy"; /* 更新人*/
public static final String FIELD_UPDATED_NAME = "updatedName"; /* 更新人名称*/
public static final String FIELD_UPDATED_TIME = "updatedTime"; /* 更新时间*/
public static final String FIELD_DELETE_FLAG = "deleteFlag"; /* 是否删除:1.是,0.否*/
public static final String FIELD_DELETE_FLAG = "deleteFlag"; /* 是否删除*/
public static final String COL_ID = "ID";
public static final String COL_COMPANY_CODE = "COMPANY_CODE"; /* 企业编码 预留*/
public static final String COL_DEP_CODE = "DEP_CODE"; /* 部门编码*/
public static final String COL_RECEIPT_DATE = "RECEIPT_DATE"; /* 单据日期*/
public static final String COL_CHECK_NO = "CHECK_NO"; /* 检查单号*/
public static final String COL_PROD_NO = "PROD_NO"; /* 生产任务号*/
public static final String COL_PROD_ORDER_NO = "PROD_ORDER_NO"; /* 生产订单号*/
public static final String COL_PROD_TASK_NO = "PROD_TASK_NO"; /* 生产任务号*/
public static final String COL_PROJ_CODE = "PROJ_CODE"; /* 项目号*/
public static final String COL_PROJ_NAME = "PROJ_NAME"; /* 项目名称*/
public static final String COL_INVENT_CODE = "INVENT_CODE"; /* 部件编码*/
......@@ -73,7 +75,7 @@ public class HPZL001 extends DaoEPBase {
public static final String COL_UPDATED_BY = "UPDATED_BY"; /* 更新人*/
public static final String COL_UPDATED_NAME = "UPDATED_NAME"; /* 更新人名称*/
public static final String COL_UPDATED_TIME = "UPDATED_TIME"; /* 更新时间*/
public static final String COL_DELETE_FLAG = "DELETE_FLAG"; /* 是否删除:1.是,0.否*/
public static final String COL_DELETE_FLAG = "DELETE_FLAG"; /* 是否删除*/
public static final String QUERY = "HPZL001.query";
public static final String COUNT = "HPZL001.count";
......@@ -86,7 +88,8 @@ public class HPZL001 extends DaoEPBase {
private String depCode = " "; /* 部门编码*/
private String receiptDate = " "; /* 单据日期*/
private String checkNo = " "; /* 检查单号*/
private String prodNo = " "; /* 生产任务号*/
private String prodOrderNo = " "; /* 生产订单号*/
private String prodTaskNo = " "; /* 生产任务号*/
private String projCode = " "; /* 项目号*/
private String projName = " "; /* 项目名称*/
private String inventCode = " "; /* 部件编码*/
......@@ -106,7 +109,7 @@ public class HPZL001 extends DaoEPBase {
private String updatedBy = " "; /* 更新人*/
private String updatedName = " "; /* 更新人名称*/
private String updatedTime = " "; /* 更新时间*/
private Integer deleteFlag; /* 是否删除:1.是,0.否*/
private Integer deleteFlag; /* 是否删除*/
/**
* initialize the metadata.
......@@ -135,7 +138,11 @@ public class HPZL001 extends DaoEPBase {
eiColumn.setDescName("检查单号");
eiMetadata.addMeta(eiColumn);
eiColumn = new EiColumn(FIELD_PROD_NO);
eiColumn = new EiColumn(FIELD_PROD_ORDER_NO);
eiColumn.setDescName("生产订单号");
eiMetadata.addMeta(eiColumn);
eiColumn = new EiColumn(FIELD_PROD_TASK_NO);
eiColumn.setDescName("生产任务号");
eiMetadata.addMeta(eiColumn);
......@@ -216,8 +223,10 @@ public class HPZL001 extends DaoEPBase {
eiMetadata.addMeta(eiColumn);
eiColumn = new EiColumn(FIELD_DELETE_FLAG);
eiColumn.setDescName("是否删除:1.是,0.否");
eiColumn.setDescName("是否删除");
eiMetadata.addMeta(eiColumn);
}
/**
......@@ -307,16 +316,39 @@ public class HPZL001 extends DaoEPBase {
public void setCheckNo(String checkNo) {
this.checkNo = checkNo;
}
public String getProdNo() {
return prodNo;
/**
* get the prodOrderNo - 生产订单号.
* @return the prodOrderNo
*/
public String getProdOrderNo() {
return this.prodOrderNo;
}
public void setProdNo(String prodNo) {
this.prodNo = prodNo;
/**
* set the prodOrderNo - 生产订单号.
*
* @param prodOrderNo - 生产订单号
*/
public void setProdOrderNo(String prodOrderNo) {
this.prodOrderNo = prodOrderNo;
}
/**
* get the prodTaskNo - 生产任务号.
* @return the prodTaskNo
*/
public String getProdTaskNo() {
return this.prodTaskNo;
}
/**
* set the prodTaskNo - 生产任务号.
*
* @param prodTaskNo - 生产任务号
*/
public void setProdTaskNo(String prodTaskNo) {
this.prodTaskNo = prodTaskNo;
}
/**
* get the projCode - 项目号.
* @return the projCode
*/
......@@ -621,7 +653,7 @@ public class HPZL001 extends DaoEPBase {
this.updatedTime = updatedTime;
}
/**
* get the deleteFlag - 是否删除:1.是,0.否.
* get the deleteFlag - 是否删除.
* @return the deleteFlag
*/
public Integer getDeleteFlag() {
......@@ -629,9 +661,9 @@ public class HPZL001 extends DaoEPBase {
}
/**
* set the deleteFlag - 是否删除:1.是,0.否.
* set the deleteFlag - 是否删除.
*
* @param deleteFlag - 是否删除:1.是,0.否
* @param deleteFlag - 是否删除
*/
public void setDeleteFlag(Integer deleteFlag) {
this.deleteFlag = deleteFlag;
......@@ -649,7 +681,8 @@ public class HPZL001 extends DaoEPBase {
setDepCode(StringUtils.defaultIfEmpty(StringUtils.toString(map.get(FIELD_DEP_CODE)), depCode));
setReceiptDate(StringUtils.defaultIfEmpty(StringUtils.toString(map.get(FIELD_RECEIPT_DATE)), receiptDate));
setCheckNo(StringUtils.defaultIfEmpty(StringUtils.toString(map.get(FIELD_CHECK_NO)), checkNo));
setProdNo(StringUtils.defaultIfEmpty(StringUtils.toString(map.get(FIELD_PROD_NO)), prodNo));
setProdOrderNo(StringUtils.defaultIfEmpty(StringUtils.toString(map.get(FIELD_PROD_ORDER_NO)), prodOrderNo));
setProdTaskNo(StringUtils.defaultIfEmpty(StringUtils.toString(map.get(FIELD_PROD_TASK_NO)), prodTaskNo));
setProjCode(StringUtils.defaultIfEmpty(StringUtils.toString(map.get(FIELD_PROJ_CODE)), projCode));
setProjName(StringUtils.defaultIfEmpty(StringUtils.toString(map.get(FIELD_PROJ_NAME)), projName));
setInventCode(StringUtils.defaultIfEmpty(StringUtils.toString(map.get(FIELD_INVENT_CODE)), inventCode));
......@@ -684,7 +717,8 @@ public class HPZL001 extends DaoEPBase {
map.put(FIELD_DEP_CODE, StringUtils.toString(depCode, eiMetadata.getMeta(FIELD_DEP_CODE)));
map.put(FIELD_RECEIPT_DATE, StringUtils.toString(receiptDate, eiMetadata.getMeta(FIELD_RECEIPT_DATE)));
map.put(FIELD_CHECK_NO, StringUtils.toString(checkNo, eiMetadata.getMeta(FIELD_CHECK_NO)));
map.put(FIELD_PROD_NO, StringUtils.toString(prodNo, eiMetadata.getMeta(FIELD_PROD_NO)));
map.put(FIELD_PROD_ORDER_NO, StringUtils.toString(prodOrderNo, eiMetadata.getMeta(FIELD_PROD_ORDER_NO)));
map.put(FIELD_PROD_TASK_NO, StringUtils.toString(prodTaskNo, eiMetadata.getMeta(FIELD_PROD_TASK_NO)));
map.put(FIELD_PROJ_CODE, StringUtils.toString(projCode, eiMetadata.getMeta(FIELD_PROJ_CODE)));
map.put(FIELD_PROJ_NAME, StringUtils.toString(projName, eiMetadata.getMeta(FIELD_PROJ_NAME)));
map.put(FIELD_INVENT_CODE, StringUtils.toString(inventCode, eiMetadata.getMeta(FIELD_INVENT_CODE)));
......
package com.baosight.hpjx.hp.zl.service;
import com.baosight.hpjx.common.ProdOrderStatusEnum;
import com.baosight.hpjx.core.constant.CommonConstant;
import com.baosight.hpjx.core.dao.DaoUtils;
import com.baosight.hpjx.hp.constant.HPConstant;
import com.baosight.hpjx.hp.kc.domain.HPKC003;
import com.baosight.hpjx.hp.kc.domain.HPKC004;
import com.baosight.hpjx.hp.kc.domain.HPKC011;
import com.baosight.hpjx.hp.kc.tools.HPKCTools;
......@@ -79,35 +81,49 @@ public class ServiceHPZL001B extends ServiceEPBase {
public EiInfo select(EiInfo inInfo) {
try {
List<Map> resultRows = inInfo.getBlock(EiConstant.resultBlock).getRows();
Map<String, HPSC005B> dbSc005bMap = new HashMap<>();
// 订单号
List<String> prodOrderNos = ObjectUtils.listKey(resultRows, "prodOrderNo");
// 任务号
List<String> prodTaskNos = ObjectUtils.listKey(resultRows, "prodTaskNo");
// 锁订单
HPSCTools.HpSc005.lock(prodOrderNos);
// 锁任务
HPSCTools.HpSc005a.lock(prodTaskNos);
// 查询任务信息
Map<String, HPSC005B> dbSc005bMap = HPSCTools.HpSc005b.map(prodTaskNos);
// 数据校验
for (Map row : resultRows) {
HPSC005B fSc005b = new HPSC005B();
fSc005b.fromMap(row);
HPSC005B dbSc005b = HPSCTools.HpSc005.getById(fSc005b.getId(), fSc005b.getChildId());
AssertUtils.isTrue(dbSc005b.getStatus() != 1 && dbSc005b.getStatus() != 2,
HPSC005B dbSc005b = dbSc005bMap.get(fSc005b.getProdTaskNo());
AssertUtils.isTrue(ProdOrderStatusEnum.NOT_ASSIGN.getCode().equals(dbSc005b.getStatus()),
String.format("生产任务ID[%s]状态不是已分派,不允许操作", fSc005b.getId()));
dbSc005bMap.put(dbSc005b.getId() + "@#@" + dbSc005b.getChildId(), dbSc005b);
}
// 生成巡检单
for (Map row : resultRows) {
Integer poorType = MapUtils.getInteger(row, "poorType");
String problemDesc = MapUtils.getString(row, "problemDesc");
HPSC005B fSc005b = new HPSC005B();
fSc005b.fromMap(row);
HPSC005 dbSc005 = dbSc005bMap.get(fSc005b.getId() + "@#@" + fSc005b.getChildId());
HPZL001 newZl001 = BeanUtils.copy(dbSc005, HPZL001.class);
// 生成新数据
HPSC005B dbSc005b = dbSc005bMap.get(fSc005b.getProdTaskNo());
HPZL001 newZl001 = BeanUtils.copy(dbSc005b, HPZL001.class);
newZl001.setCheckNo(SequenceGenerator.getNextSequence(HPConstant.SequenceId.HPZL001_NUMBER));
newZl001.setReceiptDate(DateUtils.shortDate());
newZl001.setStatus(CommonConstant.YesNo.NO_0);
newZl001.setInventCode(dbSc005.getPrdtCode());
newZl001.setInventName(dbSc005.getPrdtName());
newZl001.setSubInventCode(dbSc005.getPartCode());
newZl001.setSubInventName(dbSc005.getPartName());
newZl001.setProdNo(dbSc005.getProductionOrderNo());
newZl001.setInventCode(dbSc005b.getPrdtCode());
newZl001.setInventName(dbSc005b.getPrdtName());
newZl001.setSubInventCode(dbSc005b.getPartCode());
newZl001.setSubInventName(dbSc005b.getPartName());
newZl001.setPoorType(poorType);
newZl001.setProblemDesc(problemDesc);
newZl001.setProdOrderNo(dbSc005b.getProdOrderNo());
newZl001.setProdTaskNo(dbSc005b.getProdTaskNo());
newZl001.setDeleteFlag(CommonConstant.YesNo.NO_0);
DaoUtils.insert(HPZL001.INSERT, newZl001);
}
} catch (Exception e) {
LogUtils.setDetailMsg(inInfo, e, "生成出库单失败");
LogUtils.setDetailMsg(inInfo, e, "生成巡检单失败");
}
return inInfo;
}
......
......@@ -8,7 +8,8 @@
DEP_CODE as "depCode", <!-- 部门编码 -->
RECEIPT_DATE as "receiptDate", <!-- 单据日期 -->
CHECK_NO as "checkNo", <!-- 检查单号 -->
PROD_NO as "prodNo", <!-- 生产任务号 -->
PROD_ORDER_NO as "prodOrderNo", <!-- 生产订单号 -->
PROD_TASK_NO as "prodTaskNo", <!-- 生产任务号 -->
PROJ_CODE as "projCode", <!-- 项目号 -->
PROJ_NAME as "projName", <!-- 项目名称 -->
INVENT_CODE as "inventCode", <!-- 部件编码 -->
......@@ -27,7 +28,8 @@
CREATED_TIME as "createdTime", <!-- 创建时间 -->
UPDATED_BY as "updatedBy", <!-- 更新人 -->
UPDATED_NAME as "updatedName", <!-- 更新人名称 -->
UPDATED_TIME as "updatedTime" <!-- 更新时间 -->
UPDATED_TIME as "updatedTime", <!-- 更新时间 -->
DELETE_FLAG as "deleteFlag" <!-- 是否删除 -->
</sql>
<sql id="condition">
......@@ -47,8 +49,11 @@
<isNotEmpty prepend=" AND " property="checkNo">
CHECK_NO = #checkNo#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="prodNo">
PROD_NO = #prodNo#
<isNotEmpty prepend=" AND " property="prodOrderNo">
PROD_ORDER_NO = #prodOrderNo#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="prodTaskNo">
PROD_TASK_NO = #prodTaskNo#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="projCode">
PROJ_CODE = #projCode#
......@@ -125,7 +130,8 @@
DEP_CODE, <!-- 部门编码 -->
RECEIPT_DATE, <!-- 单据日期 -->
CHECK_NO, <!-- 检查单号 -->
PROD_NO, <!-- 生产任务号 -->
PROD_ORDER_NO, <!-- 生产订单号 -->
PROD_TASK_NO, <!-- 生产任务号 -->
PROJ_CODE, <!-- 项目号 -->
PROJ_NAME, <!-- 项目名称 -->
INVENT_CODE, <!-- 部件编码 -->
......@@ -136,19 +142,16 @@
ORG_NAME, <!-- 生产组名称 -->
POOR_TYPE, <!-- 不良品类 -->
PROBLEM_DESC, <!-- 质量问题描述 -->
CHECK_USER, <!-- 检查人 -->
CHECK_USER_NAME, <!-- 检查人名称 -->
STATUS, <!-- 单据状态 0未处理 1已处理 -->
CREATED_BY, <!-- 创建人 -->
CREATED_NAME, <!-- 创建人名称 -->
CREATED_TIME, <!-- 创建时间 -->
DELETE_FLAG
DELETE_FLAG <!-- 是否删除 -->
) VALUES (
#companyCode#, #depCode#, #receiptDate#, #checkNo#, #prodNo#, #projCode#, #projName#,
#inventCode#, #inventName#, #subInventCode#, #subInventName#, #orgNo#, #orgName#,
#poorType#, #problemDesc#, #checkUser#, #checkUserName#, #status#, #createdBy#,
#createdName#, #createdTime#, #deleteFlag#
)
#companyCode#, #depCode#, #receiptDate#, #checkNo#, #prodOrderNo#, #prodTaskNo#,
#projCode#, #projName#, #inventCode#, #inventName#, #subInventCode#, #subInventName#,
#orgNo#, #orgName#, #poorType#, #problemDesc#, #status#,
#createdBy#, #createdName#, #createdTime#, #deleteFlag#)
</insert>
<!-- 逻辑删除-->
......
let inventNameGlobalData = [];
let whNameGlobalData = [];
$(function () {
// 查询
$("#QUERY").on("click", query);
// 选择生产任务
$("#GENERATE").on("click", generate);
IPLATUI.EFGrid.result = {
......@@ -12,29 +11,8 @@ $(function () {
pageSize: 20,
pageSizes: [10, 20, 30, 50, 100, 200],
},
columns: [{
field: "whCode",
template: function (dataItem) {
for (let i = 0; i < whNameGlobalData.length; i++) {
if (whNameGlobalData[i]['valueField'] === dataItem['whCode']) {
return whNameGlobalData[i]['textField'];
}
}
return "";
},
editor: function (container, options) {
let inInfo = new EiInfo();
inInfo.set("inqu_status-0-inventTypes", [3, 4]);
inInfo.set("inqu_status-0-whType", options.model["inventType"]);
inInfo.set("serviceName", "HPPZ007");
inInfo.set("methodName", "queryComboBox");
inInfo.set("blockId", "wh_record_block_id");
inInfo.set("field", options.field);
refreshSelect(container, inInfo);
}
}],
columns: [],
loadComplete: function (grid) {
// 此grid对象
}
}
......@@ -44,25 +22,6 @@ $(function () {
* 页面加载时执行
*/
$(window).load(function () {
// 仓库名称
let inInfo = new EiInfo();
inInfo.set("inqu_status-0-inventTypes", [3, 4]);
EiCommunicator.send("HPPZ007", "queryComboBox", inInfo, {
onSuccess: function (ei) {
whNameGlobalData = ei.getBlock("wh_record_block_id").getMappedRows();
},
onFail: function (ei) {
}
}, {async: false});
// 存货名称
EiCommunicator.send("HPPZ004", "queryComboBox", inInfo, {
onSuccess: function (ei) {
inventNameGlobalData = ei.getBlock("invent_name_block_id").getMappedRows();
},
onFail: function (ei) {
}
}, {async: false});
// 查
query();
});
......@@ -72,58 +31,26 @@ $(window).load(function () {
let query = function () {
resultGrid.dataSource.page(1);
}
/**
* 选择生产订单
* 选择生产任务
*/
let generate = function () {
JSColorbox.open({
href: "HPKC099?methodName=initLoad",
title: "<div style='text-align: center;'>生产订单查询</div>",
href: "HPKC003A?methodName=initLoad",
title: "<div style='text-align: center;'>生产任务查询</div>",
width: "80%",
height: "80%",
callbackName: productionOrderQueryCallback
callbackName: generateCallback
});
}
/**
* 生产订单回调方法
*
* @param rowDatas
* @param win
* 挑选库存回调
*/
let productionOrderQueryCallback = function (row) {
console.log(row)
var lists = [];// new Array();
// 增加一个元素
for (var i = 0; i < row.length; i++) {
resultGrid.dataSource.insert();
var rowsdata = resultGrid.getCheckedRows();
resultGrid.setCellValue(0, "productionOrderNo", row[i]["productionOrderNo"]);
resultGrid.setCellValue(0, "amount", row[i]["num"]);
resultGrid.setCellValue(0, "weight", row[i]["totalWt"]);
resultGrid.setCellValue(0, "projCode", row[i]["projCode"]);
resultGrid.setCellValue(0, "projName", row[i]["projName"]);
resultGrid.setCellValue(0, "prdtType", row[i]["prdtType"]);
resultGrid.setCellValue(0, "prdtCode", row[i]["prdtCode"]);
resultGrid.setCellValue(0, "prdtName", row[i]["prdtName"]);
resultGrid.setCellValue(0, "prdtSpec", row[i]["prdtSpec"]);
resultGrid.setCellValue(0, "prdtLength", row[i]["prdtLength"]);
resultGrid.setCellValue(0, "prdtWidth", row[i]["prdtWidth"]);
resultGrid.setCellValue(0, "prdtThick", row[i]["prdtThick"]);
resultGrid.setCellValue(0, "partType", row[i]["partType"]);
resultGrid.setCellValue(0, "partCode", row[i]["partCode"]);
resultGrid.setCellValue(0, "partName", row[i]["partName"]);
resultGrid.setCellValue(0, "partSpec", row[i]["partSpec"]);
resultGrid.setCellValue(0, "partLength", row[i]["partLength"]);
resultGrid.setCellValue(0, "partWidth", row[i]["partWidth"]);
resultGrid.setCellValue(0, "partThick", row[i]["partThick"]);
resultGrid.setCellValue(0, "remark", row[i]["remark"]);
resultGrid.setCellValue(0, "remark1", row[i]["remark1"]);
lists[i] = i;
}
resultGrid.setCheckedRows(lists);
let generateCallback = function () {
// 刷新页面
query();
// 关闭弹窗
JSColorbox.close();
}
......
......@@ -8,7 +8,6 @@
<EF:EFPage title="生产入库单">
<EF:EFRegion id="inqu" title="查询条件">
<div class="row">
<EF:EFInput ename="inqu_status-0-productionOrderNo" cname="生产订单号" colWidth="3"/>
<EF:EFInput ename="inqu_status-0-prodNo" cname="生产入库单号" colWidth="3"/>
<EF:EFDatePicker ename="inqu_status-0-documentDate" cname="单据日期" colWidth="3" format="yyyy-MM-dd"
......@@ -42,41 +41,24 @@
<EF:EFRegion id="result" title="明细信息">
<EF:EFGrid blockId="result" autoDraw="override" isFloat="true" checkMode="row">
<EF:EFColumn ename="id" cname="内码" hidden="true"/>
<EF:EFColumn enable="false" ename="projCode" cname="项目号" align="center"/>
<EF:EFColumn enable="false" ename="projName" cname="项目名称" align="center"/>
<EF:EFColumn ename="prodNo" cname="生产入库单号" enable="false" width="130" align="center"/>
<EF:EFColumn ename="productionOrderNo" cname="生产订单号" enable="false" width="130" align="center"/>
<EF:EFColumn ename="documentDate" cname="单据日期" width="100" align="center" editType="date" readonly="true"
dateFormat="yyyy-MM-dd" parseFormats="['yyyyMMdd']" required="true"/>
<EF:EFColumn ename="whCode" cname="仓库名称" width="120" align="center" required="true" readonly="true"/>
<EF:EFColumn cname="数量" ename="amount" width="100" align="right" format="{0:N3}"
sumType="all" readonly="true"/>
<EF:EFColumn cname="重量" ename="weight" width="100" align="right" format="{0:N3}"
sumType="all" 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="部件编码" align="center"/>
<EF:EFColumn enable="false" ename="prdtName" cname="部件名称" align="center"/>
<EF:EFColumn hidden="true" enable="false" ename="prdtSpec" cname="部件规格" align="center"/>
<EF:EFColumn hidden="true" enable="false" ename="prdtLength" cname="部件-长"/>
<EF:EFColumn hidden="true" enable="false" ename="prdtWidth" cname="部件-宽"/>
<EF:EFColumn hidden="true" enable="false" ename="prdtThick" cname="部件-厚"/>
<EF:EFColumn enable="false" ename="remark" cname="部件备注"/>
<EF:EFComboColumn ename="partType" cname="零件类型" width="90" align="center" enable="false">
<EF:EFCodeOption codeName="hpjx.hpkc.inventType" />
<EF:EFColumn ename="projName" cname="项目名称" enable="false" width="140" align="center"/>
<EF:EFComboColumn ename="whCode" cname="仓库编码" enable="false" width="120" align="center"
blockName="wh_record_block_id" textField="textField" valueField="valueField"
columnTemplate="#=textField#" itemTemplate="#=textField#">
</EF:EFComboColumn>
<EF:EFColumn enable="false" ename="partCode" cname="零件编码" align="center"/>
<EF:EFColumn enable="false" ename="partName" cname="零件名称" align="center"/>
<EF:EFColumn enable="false" ename="partSpec" cname="零件规格" align="center"/>
<EF:EFColumn hidden="true" enable="false" ename="partLength" cname="零件-长"/>
<EF:EFColumn hidden="true" enable="false" ename="partWidth" cname="零件-宽"/>
<EF:EFColumn hidden="true" enable="false" ename="partThick" cname="零件-厚"/>
<EF:EFColumn enable="false" ename="remark1" cname="零件备注"/>
<EF:EFColumn cname="原生产单号" ename="prodNoOld" enable="false" width="140" align="center" hidden="true"/>
<EF:EFColumn cname="创建人名称" ename="createdName" enable="false" width="120" align="center"/>
<EF:EFColumn cname="创建时间" ename="createdTime" enable="false" width="140" align="center"
editType="datetime" parseFormats="['yyyyMMddHHmmss','yyyy-MM-dd HH:mm:ss']"/>
<EF:EFColumn ename="prdtName" cname="部件名称" enable="false" width="120" align="center"/>
<EF:EFColumn ename="partName" cname="零部件名称" enable="false" width="120" align="center"/>
<EF:EFColumn ename="partSpec" cname="零部件规格" enable="false" width="150" align="center"/>
<EF:EFColumn ename="amount" cname="数量" enable="false" width="120" align="right" format="{0:N3}"/>
<EF:EFColumn ename="weight" cname="重量" enable="false" width="120" align="right" format="{0:N3}"/>
<EF:EFColumn ename="remark" cname="备注" enable="false" width="150"/>
<EF:EFColumn ename="projCode" cname="项目号" enable="false" width="140" align="center"/>
<EF:EFColumn ename="prdtCode" cname="部件编码" enable="false" width="120" align="center"/>
<EF:EFColumn ename="partCode" cname="零部件编码" enable="false" width="120" align="center"/>
<EF:EFColumn ename="prodTaskNo" cname="生产任务号" enable="false" width="150" align="center"/>
<EF:EFColumn ename="prodOrderNo" cname="生产订单号" enable="false" width="140" align="center"/>
</EF:EFGrid>
</EF:EFRegion>
......
$(function () {
IPLATUI.EFGrid = {
"result": {
columns: [],
dataBound: function () {
}
}
};
$("#ef_form_head").hide();
// 查询
$("#QUERY").on("click", query);
// 选择
$("#BTN_SELECT").on("click", select);
});
/**
* 页面加载时执行
*/
$(window).load(function () {
// 初始化查询
query();
});
/**
* 查询
*/
var query = function (e) {
resultGrid.dataSource.page(1);
};
/**
* 选择库存
*/
let select = function () {
let rows = resultGrid.getCheckedRows();
if (rows.length < 1) {
message("请选择数据")
return;
}
for (let i = 0; i < rows.length; i++) {
let applyNum = rows[i]['applyNum'];
let num = rows[i]['num'];
let completeNum = rows[i]['completeNum'];
if (isBlank(applyNum) || !isNumber(applyNum) || !(applyNum > 0)) {
message("第" + (i + 1) + "行申请数量必须大于0");
return;
}
if (parseFloat(applyNum) > parseFloat(num) - parseFloat(completeNum)) {
message("第" + (i + 1) + "行申请数量不能大于未入库的数量");
return;
}
}
JSUtils.confirm("确定对勾选中的[" + rows.length + "]条数据生成入库单吗? ", {
ok: function () {
JSUtils.submitGridsData("result", "HPKC003A", "select",
true, function (e) {
var status = e.getStatus();
if (status !== -1) {
parent.JSColorbox.setValueCallback();
}
}
);
}
});
}
<!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" %>
<c:set var="ctx" value="${pageContext.request.contextPath}"/>
<EF:EFPage title="生产任务查询">
<EF:EFRegion id="inqu" title="查询区域" type="query">
<div class="row">
<div class="row">
<EF:EFInput cname="生产订单号" ename="prodOrderNo" blockId="inqu_status" row="0" colWidth="3"/>
<EF:EFInput cname="生产任务号" ename="prodTaskNo" blockId="inqu_status" row="0" colWidth="3"/>
<EF:EFInput cname="项目名称" ename="projName" blockId="inqu_status" row="0" colWidth="3"/>
<EF:EFInput cname="部件名称" ename="prdtName" blockId="inqu_status" row="0" colWidth="3"/>
</div>
<div class="row">
<EF:EFInput cname="零部件名称" ename="partName" blockId="inqu_status" row="0" colWidth="3"/>
</div>
</div>
</EF:EFRegion>
<EF:EFRegion id="result" title="记录集">
<EF:EFGrid blockId="result" autoDraw="override" checkMode="row">
<EF:EFColumn ename="id" cname="生产订单ID" enable="false" width="90" align="center" hidden="true"/>
<EF:EFColumn ename="childId" cname="生产任务ID" enable="false" width="90" align="center" hidden="true"/>
<EF:EFColumn ename="projName" cname="项目名称" enable="false" width="140" align="center"/>
<EF:EFColumn ename="prdtName" cname="部件名称" enable="false" width="120" align="center"/>
<EF:EFColumn ename="partName" cname="零部件名称" enable="false" width="120" align="center"/>
<EF:EFColumn ename="partSpec" cname="零部件规格" enable="false" width="150" align="center"/>
<EF:EFComboColumn ename="whCode" cname="仓库名称" width="120" align="center"
blockName="wh_record_block_id" textField="textField" valueField="valueField"
columnTemplate="#=textField#" itemTemplate="#=textField#" required="true">
</EF:EFComboColumn>
<EF:EFColumn ename="applyNum" cname="入库数量" width="120" align="right" format="{0:N3}" required="true"/>
<EF:EFColumn ename="completeNum" cname="已入库数量" enable="false" width="120" align="right" format="{0:N3}"/>
<EF:EFColumn ename="num" cname="任务数量" enable="false" width="120" align="right" format="{0:N3}"/>
<EF:EFColumn ename="totalWt" cname="任务重量" enable="false" width="120" align="right" format="{0:N3}"/>
<EF:EFColumn ename="factoryName" cname="厂区名称" enable="false" width="150" align="center"/>
<EF:EFColumn ename="orgName" cname="生产组名称" enable="false" width="150" align="center"/>
<EF:EFColumn ename="remark" cname="备注" enable="false" width="150"/>
<EF:EFColumn ename="projCode" cname="项目号" enable="false" width="140" align="center"/>
<EF:EFColumn ename="prdtCode" cname="部件编码" enable="false" width="120" align="center"/>
<EF:EFColumn ename="partCode" cname="零部件编码" enable="false" width="120" align="center"/>
<EF:EFColumn ename="factoryCode" cname="厂区编码" enable="false" width="150"/>
<EF:EFColumn ename="orgNo" cname="生产组编码" enable="false" width="150"/>
<EF:EFColumn ename="prodTaskNo" cname="生产任务号" enable="false" width="140" align="center"/>
<EF:EFColumn ename="prodOrderNo" cname="生产订单号" enable="false" width="140" align="center"/>
</EF:EFGrid>
</EF:EFRegion>
</EF:EFPage>
let ids = [];
$(function () {
$("#QUERY").on("click", function () {
resultGrid.dataSource.page(1);
});
// 查询
$("#QUERY").on("click", query);
// 拆单派工
$("#TEAR_ASSIGN").on("click", tearAssign);
// 批量分派
$("#ASSIGN").on("click", assign);
IPLATUI.EFGrid.result = {
pageable: {
pageSize: 20,
pageSizes: [10, 20, 50, 70, 100],
},
columns: [{
field: "operator",
template: function (item) {
let productionOrderNo = item.productionOrderNo;
let filePath1 = item.filePath1;
let template = '';
if (filePath1) {
template += '<a style="cursor: pointer;display: inline-flex;justify-content: center;margin:auto 5px" '
+ 'onclick="showUploadFile(' + filePath1 + ')" >附件</a>&nbsp;';
}
template += '<a style="cursor: pointer;display: inline-flex;justify-content: center;margin:auto 5px" '
+ 'onclick="showGroupDetail(\'' + productionOrderNo + '\')" >详情</a>';
return template
}
}]
}
});
$("#TEAR_ASSIGN").on("click", function () {
/**
* 查询
*/
function query() {
resultGrid.dataSource.page(1);
}
/**
* 拆单派工
*/
function tearAssign() {
//重置全局变量
let productionOrderNo;
let rows = resultGrid.getCheckedRows()
if (rows.length != 1) {
message("只能选择一条需要拆单分派的数据");
return;
}
productionOrderNo = rows[0].productionOrderNo
let productionOrderNo = rows[0].productionOrderNo
JSColorbox.open({
href: "HPSC005A?methodName=initLoad&inqu_status-0-productionOrderNo=" + productionOrderNo,
href: "HPSC005A?methodName=initLoad&inqu_status-0-prodOrderNo=" + productionOrderNo,
title: "<div style='text-align: center;'>拆单派工</div>",
width: "70%",
height: "80%",
callbackName: assignCallback
callbackName: tearAssignCallback
});
}
});
/**
* 拆单分派回调
*/
function tearAssignCallback() {
// 刷新列表
resultGrid.dataSource.page(1);
// 关闭弹窗
JSColorbox.close();
}
$("#ASSIGN").on("click", function () {
//重置全局变量
ids = [];
/**
* 批量分派
*/
function assign() {
let rows = resultGrid.getCheckedRows()
if (rows.length < 1) {
message("请至少选择一条需要分派的数据");
return;
}
JSColorbox.open({
href: "HPSC098?methodName=initLoad",
title: "<div style='text-align: center;'>选择组织</div>",
width: "40%",
width: "70%",
height: "70%",
callbackName: assignCallback
});
//分派可修改,不做判断
let num = 0;
rows.forEach(function(element) {
if (element.status == 1) {
num++;
callbackName: function (id) {
let saleIds = [];
for (let i = 0; i < rows.length; i++) {
saleIds.push(rows[i]['id']);
}
ids.push(element.id)
});
// if (num > 0) {
// message("勾选的数据中有已经分派的数据!");
// return;
// } else {
//
// }
});
IPLATUI.EFGrid.result = {
pageable: {
pageSize: 20,
pageSizes: [10, 20, 50, 70, 100],
},
columns: [
{
field: "operator",
template: function (item) {
let filePath1 = item.filePath1;
let status = item.status;
let template = '';
if (filePath1) {
template += '<a style="cursor: pointer;display: inline-flex;justify-content: center;margin:auto 5px" '
+ 'onclick="showUploadFile(' + filePath1 + ')" >附件清单</a>';
}
if (status != 0) {
template += '<a style="cursor: pointer;display: inline-flex;justify-content: center;margin:auto 5px" ' +
'onclick="jump(\'' + item.productionOrderNo + '\')" >下料清单</a>';
}
return template
}
}
],
}
});
function jump(productionOrderNo) {
var herf= ctx + "\\web\\"+ "HPSC006?inqu_status-0-productionOrderNo=" + productionOrderNo;
window.open(herf);
}
function showUploadFile(id) {
JSColorbox.open({
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%",
});
}
let assignCallback = function (id) {
var info = new EiInfo()
info.set("ids",ids.join(','));
info.set("id",id);
EiCommunicator.send("HPSC005","assign",info,{
onSuccess:function(ei){//返回结果集
info.set("ids", saleIds);
info.set("id", id);
EiCommunicator.send("HPSC005A", "assign", info, {
onSuccess: function (ei) {
if (ei["status"] == -1) {
NotificationUtil(ei, "error");
} else {
NotificationUtil({
msg: '修改成功'
msg: ei.msg
});
// 刷新列表
resultGrid.dataSource.page(1);
// 关闭弹窗
JSColorbox.close();
}
}, onFail: function (ei) {
}
}, {async: false});
}
});
}
},onFail:function(ei){}
},{async:false});
/**
* 附件清单
*
* @param id
*/
function showUploadFile(id) {
JSColorbox.open({
href: "HPSC002B?methodName=initLoad&inqu_status-0-id=" + id,
title: "<div style='text-align: center;'>附件清单</div>",
width: "80%",
height: "80%",
});
}
/**
* 生产组详情
*
* @param let
*/
function showGroupDetail(prodOrderNo) {
window.open("HPSC005B?methodName=initLoad&inqu_status-0-prodOrderNo=" + prodOrderNo)
}
......@@ -5,71 +5,55 @@
<c:set var="ctx" value="${pageContext.request.contextPath}"/>
<script>
var ctx = "${ctx}";
</script>
<head>
<%-- <link rel="stylesheet" href="${ctx}/css/simulatedOperation.css"/>--%>
</head>
<EF:EFPage title="生产任务">
<EF:EFRegion id="inqu" title="查询条件"><%-- type="query" efRegionShowClear="true" efRegionSave="true"--%>
<div class="row"> <%-- blockId="inqu_status" row="0" --%>
<EF:EFInput blockId="inqu_status" ename="projCode" cname="项目号:" row="0"/>
<EF:EFInput blockId="inqu_status" ename="projName" cname="项目名称:" row="0"/>
<EF:EFInput blockId="inqu_status" ename="productionOrderNo" cname="生产订单号:" row="0"/>
<EF:EFDatePicker blockId="inqu_status" ename="planCompletionDate" cname="计划完成日期:" row="0" format="yyyy-MM-dd" />
<EF:EFInput blockId="inqu_status" ename="orgNo" cname="生产组:" row="0"/>
<EF:EFSelect cname="状态:" optionLabel="全部" blockId="inqu_status" ename="status" row="0">
<EF:EFPage title="生产订单">
<EF:EFRegion id="inqu" title="查询条件">
<div class="row">
<EF:EFInput blockId="inqu_status" ename="productionOrderNo" cname="生产订单号:" row="0" colWidth="3"/>
<EF:EFInput blockId="inqu_status" ename="projCode" cname="项目号:" row="0" colWidth="3"/>
<EF:EFInput blockId="inqu_status" ename="projName" cname="项目名称:" row="0" colWidth="3"/>
<EF:EFInput blockId="inqu_status" ename="orgNo" cname="生产组:" row="0" colWidth="3"/>
</div>
<div class="row">
<EF:EFDatePicker blockId="inqu_status" ename="planCompletionDate" cname="计划完成日期:" row="0" colWidth="3"
format="yyyy-MM-dd"/>
<EF:EFSelect cname="状态:" optionLabel="全部" blockId="inqu_status" ename="status" row="0" colWidth="3">
<EF:EFOption label="未派工" value="0"/>
<EF:EFOption label="部分派工" value="1"/>
<EF:EFOption label="全部派工" value="2"/>
</EF:EFSelect>
</div>
<%-- <EF:EFButton ename="QUERY" cname="查询" row="1" class="btn-align-right"></EF:EFButton>--%>
</EF:EFRegion>
<EF:EFRegion id="result" title="记录集">
<EF:EFGrid blockId="result" autoDraw="no">
<EF:EFGrid blockId="result" autoDraw="override" checkMode="row">
<EF:EFColumn ename="id" cname="主键" hidden="true"/>
<EF:EFColumn enable="false" ename="projCode" cname="项目号" />
<EF:EFColumn enable="false" ename="projName" cname="项目名称"/>
<EF:EFColumn enable="false" ename="productionOrderNo" cname="生产订单号"/>
<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="部件编码"/>
<EF:EFColumn enable="false" ename="prdtName" cname="部件名称"/>
<%-- <EF:EFColumn enable="false" ename="prdtSpec" cname="部件规格"/>--%>
<EF:EFColumn enable="false" ename="remark" cname="部件备注"/>
<EF:EFComboColumn ename="partType" cname="零件类型" width="90" align="center" enable="false">
<EF:EFCodeOption codeName="hpjx.hpkc.inventType" />
</EF:EFComboColumn>
<EF:EFColumn enable="false" ename="partCode" cname="零件编码"/>
<EF:EFColumn enable="false" ename="partName" cname="零件名称"/>
<EF:EFColumn enable="false" ename="partSpec" cname="零件规格"/>
<EF:EFColumn enable="false" ename="remark1" cname="零件备注"/>
<EF:EFColumn enable="false" ename="planCompletionDate" cname="计划完成日期"/>
<EF:EFColumn enable="false" ename="num" cname="计划数量"/>
<EF:EFColumn enable="false" ename="totalWt" cname="计划重量"/>
<EF:EFComboColumn enable="false" align="center" ename="status" cname="状态">
<EF:EFColumn ename="operator" cname="操作" enable="false" width="110" align="center"/>
<EF:EFColumn ename="productionOrderNo" cname="生产订单号" enable="false" width="140" align="center"/>
<EF:EFComboColumn ename="status" cname="状态" enable="false" width="90" align="center">
<EF:EFOption label="未派工" value="0"/>
<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="生产组"/>
<EF:EFColumn ename="operator" cname="操作" width="100" enable="false" readonly="false"/>
<EF:EFColumn ename="projName" cname="项目名称" enable="false" width="140" align="center"/>
<EF:EFComboColumn ename="prdtType" cname="部件类型" enable="false" width="90" align="center">
<EF:EFCodeOption codeName="hpjx.hpkc.inventType"/>
</EF:EFComboColumn>
<EF:EFColumn ename="prdtName" cname="部件名称" enable="false" width="120" align="center"/>
<EF:EFColumn ename="prdtSpec" cname="部件规格" enable="false" width="120" align="center"/>
<EF:EFColumn ename="remark" cname="部件备注" enable="false"/>
<EF:EFComboColumn ename="partType" cname="零件类型" enable="false" width="90" align="center">
<EF:EFCodeOption codeName="hpjx.hpkc.inventType"/>
</EF:EFComboColumn>
<EF:EFColumn ename="partName" cname="零件名称" enable="false" width="120" align="center"/>
<EF:EFColumn ename="partSpec" cname="零件规格" enable="false" width="120" align="center"/>
<EF:EFColumn ename="remark1" cname="零件备注"/>
<EF:EFColumn ename="planCompletionDate" cname="计划完成日期" enable="false" width="120" align="center"/>
<EF:EFColumn ename="assignedNum" cname="已派工数量" enable="false" width="120" align="right" format="{0:N3}"/>
<EF:EFColumn ename="num" cname="计划数量" enable="false" width="120" align="right" format="{0:N3}"/>
<EF:EFColumn ename="totalWt" cname="计划重量" enable="false" width="120" align="right" format="{0:N3}"/>
<EF:EFColumn ename="projCode" cname="项目号" enable="false" width="140" align="center"/>
<EF:EFColumn ename="prdtCode" cname="部件编码" enable="false" width="120" align="center"/>
<EF:EFColumn ename="partCode" cname="零件编码" enable="false" width="120" align="center"/>
</EF:EFGrid>
</EF:EFRegion>
</EF:EFPage>
<script>
var ctx = "${ctx}";
</script>
<script src="${ctx}/HP/SC/HPSC005.js"></script>
\ No newline at end of file
$(function () {
$("#QUERY").on("click", function () {
resultGrid.dataSource.page(1);
});
IPLATUI.EFGrid = {
"result" : {
pageable: {
pageSize: 20,
pageSizes: [10, 20, 50, 70, 100],
},
columns: [
columns: [{
field: "factoryName",
attributes: {
class: "i-input-readonly"
}
}],
],
onSuccess: function (e) {
if(e.eiInfo.extAttr.methodName == 'update'
||e.eiInfo.extAttr.methodName == 'insert'){
query();
}
},
}
},
$("#QUERY").on("click", query);
}
});
/**
* 页面加载时执行
*/
$(window).load(function () {
// 查询
query();
});
/**
* 查询
*/
function query() {
resultGrid.dataSource.page(1);
}
......@@ -4,30 +4,28 @@
<%@ taglib prefix="EF" tagdir="/WEB-INF/tags/EF" %>
<c:set var="ctx" value="${pageContext.request.contextPath}"/>
<head>
<%-- <link rel="stylesheet" href="${ctx}/css/simulatedOperation.css"/>--%>
</head>
<EF:EFPage title="拆单派工">
<EF:EFRegion id="detail" title="订单详情">
<EF:EFPage title="拆单派工">
<EF:EFRegion id="inqu" title="订单详情">
<EF:EFInput ename="inqu_status-0-prodOrderNo" cname="项目号" type="hidden"/>
<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"/>
<EF:EFInput ename="detail-0-projCode" cname="项目号" readonly="true"/>
<EF:EFInput ename="detail-0-projName" cname="项目名称" readonly="true"/>
<EF:EFInput 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"/>
<EF:EFInput ename="detail-0-prdtName" cname="部件名称" readonly="true"/>
<EF:EFInput ename="detail-0-partName" cname="零部件名称" readonly="true"/>
<EF:EFInput 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"/>
<EF:EFInput ename="detail-0-num" cname="计划数量" readonly="true"/>
<EF:EFInput ename="detail-0-totalWt" cname="计划重量" readonly="true"/>
<EF:EFInput 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:EFInput ename="detail-0-unassignedNum" cname="待派工数量" readonly="true"/>
<EF:EFSelect ename="detail-0-status" cname="状态" readonly="true">
<EF:EFOption label="未派工" value="0"/>
<EF:EFOption label="部分派工" value="1"/>
<EF:EFOption label="全部派工" value="2"/>
......@@ -35,26 +33,22 @@
</div>
</EF:EFRegion>
<EF:EFRegion id="result" title="明细信息">
<EF:EFGrid blockId="result" autoDraw="no">
<EF:EFGrid blockId="result" autoDraw="override">
<EF:EFColumn ename="id" cname="主键" hidden="true"/>
<EF:EFColumn enable="false" ename="factoryCode" cname="厂区编码" hidden="true"/>
<EF:EFPopupColumn ename="factoryName" cname="厂区" width="200" popupType="ServiceGrid"
popupTitle="厂区信息" serviceName="HPPZ011" methodName="queryComboBoxAll" resultId="factory_group_ecord_block_id"
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}"/>
valueField="textField" textField="textField" required="true"/>
<EF:EFColumn ename="orgNo" cname="生产组代码" enable="false" hidden="true"/>
<EF:EFColumn ename="orgName" cname="生产组" enable="false" align="center"/>
<EF:EFColumn ename="num" cname="分派数量" format="{0:N3}" required="true"/>
<EF:EFColumn ename="totalWt" cname="分派重量" enable="false" format="{0:N3}"/>
</EF:EFGrid>
</EF:EFRegion>
</EF:EFPage>
<script>
var ctx = "${ctx}";
</script>
<script src="${ctx}/HP/SC/HPSC005A.js"></script>
$(function () {
IPLATUI.EFGrid = {
"result" : {
pageable: {
pageSize: 20,
pageSizes: [10, 20, 50, 70, 100],
},
columns: [{
field: "operator",
template: function (item) {
let filePath1 = item.filePath1;
let template = '';
if (filePath1) {
template += '<a style="cursor: pointer;display: inline-flex;justify-content: center;margin:auto 5px" '
+ 'onclick="showUploadFile(' + filePath1 + ')" >附件</a>&nbsp;';
}
return template
}
}]
}
}
// 查询
$("#QUERY").on("click", query);
});
/**
* 页面加载时执行
*/
$(window).load(function () {
// 查询
query();
});
/**
* 查询
*/
function query() {
resultGrid.dataSource.page(1);
}
/**
* 附件清单
*
* @param id
*/
function showUploadFile(id) {
JSColorbox.open({
href: "HPSC002B?methodName=initLoad&inqu_status-0-id=" + id,
title: "<div style='text-align: center;'>附件清单</div>",
width: "80%",
height: "80%",
});
}
<!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" %>
<c:set var="ctx" value="${pageContext.request.contextPath}"/>
<EF:EFPage title="生产任务">
<EF:EFRegion id="inqu" title="查询条件">
<div class="row">
<EF:EFInput cname="生产订单号" ename="prodOrderNo" blockId="inqu_status" row="0" colWidth="3"/>
<EF:EFInput cname="生产任务号" ename="prodTaskNo" blockId="inqu_status" row="0" colWidth="3"/>
<EF:EFInput cname="项目名称" ename="projName" blockId="inqu_status" row="0" colWidth="3"/>
<EF:EFInput cname="部件名称" ename="prdtName" blockId="inqu_status" row="0" colWidth="3"/>
</div>
<div class="row">
<EF:EFInput cname="零部件名称" ename="partName" blockId="inqu_status" row="0" colWidth="3"/>
<EF:EFInput cname="厂区名称" ename="factoryName" blockId="inqu_status" row="0" colWidth="3"/>
<EF:EFInput cname="生产组名称" ename="orgName" blockId="inqu_status" row="0" colWidth="3"/>
</div>
</EF:EFRegion>
<EF:EFRegion id="result" title="记录集">
<EF:EFGrid blockId="result" autoDraw="override">
<EF:EFColumn ename="id" cname="主键" hidden="true"/>
<EF:EFColumn ename="childId" cname="主键" hidden="true"/>
<EF:EFColumn ename="operator" cname="操作" enable="false" width="110" align="center"/>
<EF:EFColumn ename="prodTaskNo" cname="生产任务号" enable="false" width="150" align="center"/>
<EF:EFColumn ename="projName" cname="项目名称" enable="false" width="140" align="center"/>
<EF:EFColumn ename="prdtName" cname="部件名称" enable="false" width="120" align="center"/>
<EF:EFColumn ename="partName" cname="零件名称" enable="false" width="120" align="center"/>
<EF:EFColumn ename="partSpec" cname="零件规格" enable="false" width="120" align="center"/>
<EF:EFColumn ename="remark1" cname="零件备注"/>
<EF:EFColumn ename="planCompletionDate" cname="计划完成日期" enable="false" width="120" align="center"/>
<EF:EFColumn ename="completeNum" cname="已完成数量" enable="false" width="120" align="right" format="{0:N3}"/>
<EF:EFColumn ename="num" cname="任务数量" enable="false" width="120" align="right" format="{0:N3}"/>
<EF:EFColumn ename="totalWt" cname="任务重量" enable="false" width="120" align="right" format="{0:N3}"/>
<EF:EFColumn ename="factoryName" cname="厂区名称" enable="false" width="140" align="center"/>
<EF:EFColumn ename="orgName" cname="生产组名称" enable="false" width="140" align="center"/>
<EF:EFColumn ename="prodOrderNo" cname="生产订单号" enable="false" width="140" align="center"/>
<EF:EFColumn ename="projCode" cname="项目号" enable="false" width="140" align="center"/>
<EF:EFColumn ename="prdtCode" cname="部件编码" enable="false" width="120" align="center"/>
<EF:EFColumn ename="partCode" cname="零件编码" enable="false" width="120" align="center"/>
</EF:EFGrid>
</EF:EFRegion>
</EF:EFPage>
......@@ -8,11 +8,8 @@
<EF:EFPage title="组织机构">
<EF:EFRegion id="inqu" title="查询条件">
<div class="row">
<EF:EFInput cname="厂区名称:" ename="factoryName" blockId="inqu_status" row="0" colWidth="3"/>
<EF:EFSelect cname="生产组名称" ename="groupCode" blockId="inqu_status" row="0" colWidth="3" filter="contains">
<EF:EFOption label="全部" value=""/>
<EF:EFOptions blockId="group_record_block_id" textField="textField" valueField="valueField"/>
</EF:EFSelect>
<EF:EFInput cname="厂区名称" ename="factoryName" blockId="inqu_status" row="0" colWidth="3"/>
<EF:EFInput cname="生产组名称" ename="groupName" blockId="inqu_status" row="0" colWidth="3"/>
</div>
</EF:EFRegion>
......@@ -20,16 +17,9 @@
<EF:EFGrid blockId="result" autoDraw="override" isFloat="true" checkMode="single,row">
<EF:EFColumn ename="id" cname="内码" hidden="true"/>
<EF:EFColumn ename="factoryCode" cname="厂区编码" enable="false" width="120" align="center"/>
<EF:EFPopupColumn ename="factoryName" cname="厂区名称" enable="false" width="120" align="center"/>
<EF:EFComboColumn ename="groupCode" cname="生产组名称" width="120" align="center"
blockName="org_record_block_id" textField="textField" valueField="valueField"
columnTemplate="#=textField#" itemTemplate="#=textField#"
required="true">
</EF:EFComboColumn>
<EF:EFColumn ename="factoryName" cname="厂区名称" enable="false" width="120" align="center"/>
<EF:EFColumn ename="groupCode" cname="生产组编码" enable="false" width="120" align="center"/>
<EF:EFColumn ename="groupName" cname="生产组名称" enable="false" width="120" align="center"/>
</EF:EFGrid>
</EF:EFRegion>
</EF:EFPage>
<script>
var ctx = "${ctx}";
</script>
<script src="${ctx}/HP/SC/HPSC098.js"></script>
......@@ -31,7 +31,6 @@ $(function () {
}, {
field: "problemPhoto",
template: function (item) {
let status = item.status;
if (!isBlank(item.checkNo)) {
return '<a style="cursor: pointer;display: inline-flex;justify-content: center;margin:auto 5px" '
+ 'onclick="showUploadFile(' + item.id + ', 1)" >附件清单</a>';
......@@ -42,7 +41,6 @@ $(function () {
}, {
field: "processPhoto",
template: function (item) {
let status = item.status;
if (!isBlank(item.checkNo)) {
return '<a style="cursor: pointer;display: inline-flex;justify-content: center;margin:auto 5px" '
+ 'onclick="showUploadFile(' + item.id + ', 2)" >附件清单</a>';
......
......@@ -27,13 +27,21 @@
<EF:EFOption label="0-未处理" value="0"></EF:EFOption>
</EF:EFSelect>
</div>
<div class="row">
<EF:EFInput cname="生产订单号" ename="prodOrderNo" blockId="inqu_status" row="0" colWidth="3"/>
<EF:EFInput cname="生产任务号" ename="prodTaskNo" blockId="inqu_status" row="0" colWidth="3"/>
</div>
</EF:EFRegion>
<EF:EFRegion id="result" title="明细信息">
<EF:EFGrid blockId="result" autoDraw="override" isFloat="true" checkMode="row">
<EF:EFColumn ename="id" cname="内码" hidden="true"/>
<EF:EFColumn ename="operator" cname="操作" locked="true" enable="false" width="100" readonly="false"/>
<EF:EFColumn ename="checkNo" cname="检查单号" locked="true" enable="false" width="130" align="center"/>
<EF:EFColumn ename="operator" cname="操作" locked="true" enable="false" width="100" align="center"/>
<EF:EFColumn ename="problemPhoto" cname="问题照片" locked="true" enable="false" width="100" align="center"
required="true"/>
<EF:EFColumn ename="processPhoto" cname="处理照片" locked="true" enable="false" width="100" align="center"
required="true"/>
<EF:EFColumn ename="checkNo" cname="检查单号" enable="false" width="130" align="center"/>
<EF:EFComboColumn ename="status" cname="状态" enable="false" width="100" align="center">
<EF:EFOption label="1-已处理" value="1"></EF:EFOption>
<EF:EFOption label="0-未处理" value="0"></EF:EFOption>
......@@ -44,18 +52,16 @@
<EF:EFColumn ename="inventName" cname="部件名称" enable="false" width="130" align="center"/>
<EF:EFColumn ename="subInventName" cname="零部件名称" enable="false" width="130" align="center"/>
<EF:EFColumn ename="orgName" cname="生产组名称" enable="false" width="130" align="center"/>
<EF:EFComboColumn ename="poorType" cname="不良品类" width="100" align="center" required="true">
<EF:EFComboColumn ename="poorType" cname="不良品类" enable="false" width="100" align="center">
<EF:EFCodeOption codeName="hpjx.hpjx.poorType"/>
</EF:EFComboColumn>
<EF:EFColumn ename="problemDesc" cname="质量问题描述" width="140" align="center" required="true"/>
<EF:EFColumn ename="problemPhoto" cname="问题照片" enable="false" width="100" align="center" required="true"/>
<EF:EFColumn ename="processPhoto" cname="处理照片" enable="false" width="100" align="center" required="true"/>
<EF:EFColumn ename="problemDesc" cname="质量问题描述" enable="false" width="140" align="center"/>
<EF:EFComboColumn ename="checkUser" cname="检查人" enable="false" width="120" align="center"
blockName="user_block_id" textField="textField" valueField="valueField"
columnTemplate="#=textField#" itemTemplate="#=textField#">
</EF:EFComboColumn>
<EF:EFColumn ename="prodNo" cname="生产单号" width="140" align="center" required="true"/>
<EF:EFColumn ename="prodOrderNo" cname="生产订单号" enable="false" width="140" align="center"/>
<EF:EFColumn ename="prodTaskNo" cname="生产任务号" enable="false" width="150" align="center"/>
<EF:EFColumn ename="projCode" cname="项目编码" enable="false" width="130" align="center"/>
<EF:EFColumn ename="inventCode" cname="部件编码" enable="false" width="130" align="center"/>
<EF:EFColumn ename="subInventCode" cname="零部件编码" enable="false" width="130" align="center"/>
......
......@@ -41,6 +41,18 @@ let select = function () {
message("请选择数据")
return;
}
for (let i = 0; i < rows.length; i++) {
let poorType = rows[i]['poorType'];
let problemDesc = rows[i]['problemDesc'];
if (isBlank(poorType)) {
message("第" + (i + 1) + "行不良品类不能为空");
return;
}
if (isBlank(problemDesc)) {
message("第" + (i + 1) + "行质量问题描述不能为空");
return;
}
}
JSUtils.confirm("确定对勾选中的[" + rows.length + "]条数据生成巡检单吗? ", {
ok: function () {
JSUtils.submitGridsData("result", "HPZL001B", "select",
......
......@@ -9,14 +9,12 @@
<EF:EFRegion id="inqu" title="查询区域" type="query">
<div class="row">
<div class="row">
<EF:EFInput cname="项目号" ename="projCode" blockId="inqu_status" row="0" colWidth="3"/>
<EF:EFInput cname="生产订单号" ename="prodOrderNo" blockId="inqu_status" row="0" colWidth="3"/>
<EF:EFInput cname="生产任务号" ename="prodTaskNo" blockId="inqu_status" row="0" colWidth="3"/>
<EF:EFInput cname="项目名称" ename="projName" blockId="inqu_status" row="0" colWidth="3"/>
<EF:EFInput cname="部件编码" ename="prdtCode" blockId="inqu_status" row="0" colWidth="3"/>
<EF:EFInput cname="部件名称" ename="prdtName" blockId="inqu_status" row="0" colWidth="3"/>
</div>
<div class="row">
<EF:EFInput cname="生产订单号" ename="productionOrderNo" blockId="inqu_status" row="0" colWidth="3"/>
<EF:EFInput cname="零部件编码" ename="partCode" blockId="inqu_status" row="0" colWidth="3"/>
<EF:EFInput cname="零部件名称" ename="partName" blockId="inqu_status" row="0" colWidth="3"/>
</div>
</div>
......@@ -24,21 +22,29 @@
<EF:EFRegion id="result" title="记录集">
<EF:EFGrid blockId="result" autoDraw="override" checkMode="row">
<EF:EFColumn ename="id" cname="生产任务ID" enable="false" width="90" align="center"/>
<EF:EFColumn ename="childId" cname="生产任务ID" enable="false" width="90" align="center" hidden="true"/>
<EF:EFColumn ename="id" cname="生产订单ID" enable="false" width="90" align="center" hidden="true"/>
<EF:EFColumn ename="childId" cname="生产任务ID" enable="false" width="90" align="center" hidden="true"/>
<EF:EFColumn ename="projName" cname="项目名称" enable="false" width="140" align="center"/>
<EF:EFColumn ename="prdtName" cname="部件名称" enable="false" width="120" align="center"/>
<EF:EFColumn ename="partName" cname="零部件名称" enable="false" width="120" align="center"/>
<EF:EFColumn ename="partSpec" cname="零部件规格" enable="false" width="150" align="center"/>
<EF:EFColumn ename="orgName" cname="生产组" enable="false" width="150" align="center"/>
<EF:EFColumn ename="num" cname="计划数量" enable="false" width="120" align="right" format="{0:N3}"/>
<EF:EFColumn ename="totalWt" cname="计划重量" enable="false" width="120" align="right" format="{0:N3}"/>
<EF:EFComboColumn ename="poorType" cname="不良品类" width="100" align="center" required="true">
<EF:EFCodeOption codeName="hpjx.hpjx.poorType"/>
</EF:EFComboColumn>
<EF:EFColumn ename="problemDesc" cname="质量问题描述" width="140" required="true"/>
<EF:EFColumn ename="completeNum" cname="已入库数量" enable="false" width="120" align="right" format="{0:N3}"/>
<EF:EFColumn ename="num" cname="任务数量" enable="false" width="120" align="right" format="{0:N3}"/>
<EF:EFColumn ename="totalWt" cname="任务重量" enable="false" width="120" align="right" format="{0:N3}"/>
<EF:EFColumn ename="factoryName" cname="厂区名称" enable="false" width="150" align="center"/>
<EF:EFColumn ename="orgName" cname="生产组名称" enable="false" width="150" align="center"/>
<EF:EFColumn ename="remark" cname="备注" enable="false" width="150"/>
<EF:EFColumn ename="projCode" cname="项目号" enable="false" width="140" align="center"/>
<EF:EFColumn ename="prdtCode" cname="部件编码" enable="false" width="120" align="center"/>
<EF:EFColumn ename="partCode" cname="零部件编码" enable="false" width="120" align="center"/>
<EF:EFColumn ename="factoryCode" cname="厂区编码" enable="false" width="150"/>
<EF:EFColumn ename="orgNo" cname="生产组编码" enable="false" width="150"/>
<EF:EFColumn ename="productionOrderNo" cname="生产订单号" enable="false" width="140" align="center"/>
<EF:EFColumn ename="prodTaskNo" cname="生产任务号" enable="false" width="140" align="center"/>
<EF:EFColumn ename="prodOrderNo" cname="生产订单号" enable="false" width="140" align="center"/>
</EF:EFGrid>
</EF:EFRegion>
</EF:EFPage>
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