Commit 6e3c82a8 by liuyang

Merge branch 'dev' of https://gitlab.baocloud.cn/bggf/smart/hp-smart into dev

 Conflicts:
	src/main/webapp/HP/SC/HPSC006.js
parents 4358a893 a047bd71
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;
}
}
...@@ -392,7 +392,7 @@ public class HPBI001 extends DaoEPBase { ...@@ -392,7 +392,7 @@ public class HPBI001 extends DaoEPBase {
* @param novValue * @param novValue
*/ */
public void setnovValue(String novValue) { public void setnovValue(String novValue) {
this.octValue = novValue; this.novValue = novValue;
} }
/** /**
...@@ -409,7 +409,7 @@ public class HPBI001 extends DaoEPBase { ...@@ -409,7 +409,7 @@ public class HPBI001 extends DaoEPBase {
* @param decValue * @param decValue
*/ */
public void setdecValue(String decValue) { public void setdecValue(String decValue) {
this.octValue = decValue; this.decValue = decValue;
} }
/** /**
......
...@@ -7,6 +7,7 @@ import com.baosight.hpjx.core.dao.DaoUtils; ...@@ -7,6 +7,7 @@ import com.baosight.hpjx.core.dao.DaoUtils;
import com.baosight.hpjx.hp.bi.domain.HPBI001; import com.baosight.hpjx.hp.bi.domain.HPBI001;
import com.baosight.hpjx.hp.constant.HPConstant; import com.baosight.hpjx.hp.constant.HPConstant;
import com.baosight.hpjx.hp.kc.domain.HPKC001; import com.baosight.hpjx.hp.kc.domain.HPKC001;
import com.baosight.hpjx.hp.kc.domain.HPKC007;
import com.baosight.hpjx.hp.kc.tools.HPKCTools; import com.baosight.hpjx.hp.kc.tools.HPKCTools;
import com.baosight.hpjx.hp.pz.tools.HPPZTools; import com.baosight.hpjx.hp.pz.tools.HPPZTools;
import com.baosight.hpjx.util.*; import com.baosight.hpjx.util.*;
...@@ -40,9 +41,18 @@ public class ServiceHPBI001 extends ServiceBase { ...@@ -40,9 +41,18 @@ public class ServiceHPBI001 extends ServiceBase {
* @param inInfo * @param inInfo
* @return * @return
*/ */
/* public EiInfo initLoad(EiInfo inInfo) { public EiInfo initLoad(EiInfo inInfo) {
return query(inInfo); try {
}*/ Map queryMap = new HashMap();
queryMap.put("inventTypes", DEFAULT_INVENT_CODE);
CommonMethod.initBlock(inInfo, Arrays.asList(DdynamicEnum.WH_RECORD_BLOCK_ID), queryMap);
CommonMethod.initBlock(inInfo, Arrays.asList(DdynamicEnum.FACTORY_RECORD_BLOCK_ID), queryMap);
//inInfo.addBlock(EiConstant.resultBlock).addBlockMeta(new HPKC007().eiMetadata);
} catch (PlatException e) {
LogUtils.setDetailMsg(inInfo, e, "初始化失败");
}
return inInfo;
}
/** /**
* 查询操作 * 查询操作
......
...@@ -59,7 +59,7 @@ ...@@ -59,7 +59,7 @@
'' AS DATE '' AS DATE
FROM DUAL FROM DUAL
UNION ALL UNION ALL
SELECT '人均产量(kg)' AS INDNAME,'' AS DAYVALUE, SELECT '人均产量(kg)' AS INDNAME,111 AS DAYVALUE,
14 AS MONVALUE, 14 AS YEARVALUE, 14 AS MONVALUE, 14 AS YEARVALUE,
14 AS JANVALUE, 14 AS FEBVALUE, 14 AS JANVALUE, 14 AS FEBVALUE,
14 AS MARVLAUE, 14 AS APRVALUE, 14 AS MARVLAUE, 14 AS APRVALUE,
...@@ -72,12 +72,12 @@ ...@@ -72,12 +72,12 @@
FROM DUAL FROM DUAL
) A ) A
WHERE 1=1 WHERE 1=1
<isNotEmpty prepend=" AND " property="factory"> <!-- <isNotEmpty prepend=" AND " property="factory">
FACTORY LIKE CONCAT('%',CONCAT( #factory#,'%')) FACTORY LIKE CONCAT('%',CONCAT( #factory#,'%'))
</isNotEmpty> </isNotEmpty>-->
<isNotEmpty prepend=" AND " property="date"> <!-- <isNotEmpty prepend=" AND " property="date">
DATE = #date# DATE = #date#
</isNotEmpty> </isNotEmpty>-->
<dynamic prepend="ORDER BY"> <dynamic prepend="ORDER BY">
<isEmpty property="orderBy"> <isEmpty property="orderBy">
INDNAME desc INDNAME desc
...@@ -102,12 +102,12 @@ ...@@ -102,12 +102,12 @@
SELECT '人均日产' AS SERIES,'585kg' AS VALUE,NULL AS FACTORY,NULL AS DATE, 5 AS SORT FROM DUAL SELECT '人均日产' AS SERIES,'585kg' AS VALUE,NULL AS FACTORY,NULL AS DATE, 5 AS SORT FROM DUAL
) A ) A
WHERE 1=1 WHERE 1=1
<isNotEmpty prepend=" AND " property="factory"> <!-- <isNotEmpty prepend=" AND " property="factory">
FACTORY LIKE CONCAT('%',CONCAT( #factory#,'%')) FACTORY LIKE CONCAT('%',CONCAT( #factory#,'%'))
</isNotEmpty> </isNotEmpty>
<isNotEmpty prepend=" AND " property="date"> <isNotEmpty prepend=" AND " property="date">
DATE = #date# DATE = #date#
</isNotEmpty> </isNotEmpty>-->
<dynamic prepend="ORDER BY"> <dynamic prepend="ORDER BY">
<isEmpty property="orderBy"> <isEmpty property="orderBy">
SORT asc SORT asc
......
...@@ -54,7 +54,8 @@ public class HPConstant { ...@@ -54,7 +54,8 @@ public class HPConstant {
//生产订单 //生产订单
public static final String HPSC005_PROD_NO = "HPSC005_PROD_NO"; 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 { ...@@ -44,6 +44,8 @@ public class HPSqlConstant {
// 统计 // 统计
public static final String STAT_DATE = "HPKC003.statDate"; public static final String STAT_DATE = "HPKC003.statDate";
// 锁
public static final String LOCK = "HPKC003.lock";
} }
/** /**
...@@ -79,6 +81,18 @@ public class HPSqlConstant { ...@@ -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 定义 * HPKC006 SQL 定义
* *
* @author:songx * @author:songx
...@@ -202,14 +216,31 @@ public class HPSqlConstant { ...@@ -202,14 +216,31 @@ public class HPSqlConstant {
public static final String GET = "HPPZ011.get"; public static final String GET = "HPPZ011.get";
} }
/**
* @author:songx
* @date:2024/2/5,10:16
*/
public class HPSC005 { public class HPSC005 {
// 锁
public static final String LOCK = "HPSC005.lock";
// 查询 // 查询
public static final String UPDATE_ASSIGN_NUM = "HPSC005.updateAssignNum"; 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 * @author:songx
......
...@@ -9,12 +9,15 @@ import com.baosight.hpjx.hp.kc.domain.HPKC003; ...@@ -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.kc.tools.HPKCTools;
import com.baosight.hpjx.hp.pz.tools.HPPZTools; import com.baosight.hpjx.hp.pz.tools.HPPZTools;
import com.baosight.hpjx.hp.sc.domain.HPSC004; 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.domain.HPZL001;
import com.baosight.hpjx.hp.zl.tools.HPZLTools; import com.baosight.hpjx.hp.zl.tools.HPZLTools;
import com.baosight.hpjx.util.AssertUtils; import com.baosight.hpjx.util.AssertUtils;
import com.baosight.hpjx.util.BeanUtils;
import com.baosight.hpjx.util.CommonMethod; import com.baosight.hpjx.util.CommonMethod;
import com.baosight.hpjx.util.EiInfoUtils; import com.baosight.hpjx.util.EiInfoUtils;
import com.baosight.hpjx.util.LogUtils; import com.baosight.hpjx.util.LogUtils;
import com.baosight.hpjx.util.ObjectUtils;
import com.baosight.hpjx.util.StringUtil; import com.baosight.hpjx.util.StringUtil;
import com.baosight.iplat4j.core.ei.EiBlock; import com.baosight.iplat4j.core.ei.EiBlock;
import com.baosight.iplat4j.core.ei.EiConstant; import com.baosight.iplat4j.core.ei.EiConstant;
...@@ -43,7 +46,7 @@ public class ServiceHPKC003 extends ServiceBase { ...@@ -43,7 +46,7 @@ public class ServiceHPKC003 extends ServiceBase {
*/ */
public EiInfo initLoad(EiInfo inInfo) { public EiInfo initLoad(EiInfo inInfo) {
try { 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); CommonMethod.initBlock(inInfo, Arrays.asList(DdynamicEnum.INVENT_NAME_BLOCK_ID), null);
inInfo.addBlock(EiConstant.resultBlock).addBlockMeta(new HPKC003().eiMetadata); inInfo.addBlock(EiConstant.resultBlock).addBlockMeta(new HPKC003().eiMetadata);
} catch (Exception e) { } catch (Exception e) {
...@@ -73,115 +76,39 @@ public class ServiceHPKC003 extends ServiceBase { ...@@ -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 * @param eiInfo
* @return * @return
*/ */
public EiInfo delete(EiInfo eiInfo) { public EiInfo delete(EiInfo eiInfo) {
HPKC003 hpkc003 = new HPKC003();
EiBlock eiBlock = eiInfo.getBlock(EiConstant.resultBlock);
try { try {
for (int i = 0; i < eiBlock.getRowCount(); i++) { List<Map> resultRows = eiInfo.getBlock(EiConstant.resultBlock).getRows();
Map<?, ?> map = eiBlock.getRow(i); List<String> prodNos = ObjectUtils.listKey(resultRows, "prodNo");
hpkc003.fromMap(map); // 锁
this.dao.delete("HPKC003.delete", hpkc003.toMap()); HPKCTools.HpKc003.lock(prodNos);
// 查询数据
//生产一条负数量和产量的红冲记录 Map<String, HPKC003> dbKc003Map = HPKCTools.HpKc003.map(prodNos);
hpkc003.setAmount(hpkc003.getAmount().multiply(new BigDecimal(-1.000))); for (Map resultRow : resultRows) {
hpkc003.setWeight(hpkc003.getWeight().multiply(new BigDecimal(-1.000))); HPKC003 fKc003 = new HPKC003();
hpkc003.setDeleteFlag(1); fKc003.fromMap(resultRow);
hpkc003.setProdNoOld(hpkc003.getProdNo()); DaoUtils.update(HPKC003.DELETE, fKc003);
hpkc003.setProdNo(SequenceGenerator.getNextSequence(HPConstant.SequenceId.HPKC003_PROD_NO)); // 生产一条负数量和产量的红冲记录
DaoUtils.insert("HPKC003.insert", hpkc003); HPKC003 dbKc003 = dbKc003Map.get(fKc003.getProdNo());
//同步生产计划 HPKC003 newKc003 = BeanUtils.copy(dbKc003, HPKC003.class);
DaoUtils.update("HPSC004.update",this.synchronousPlan(hpkc003)); 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(), HPKCTools.updateProdStock(newKc003.getWhCode(), newKc003.getProdOrderNo(),
hpkc003.getWeight().negate()); newKc003.getAmount(), newKc003.getWeight());
} }
eiInfo.setStatus(EiConstant.STATUS_SUCCESS); eiInfo.setStatus(EiConstant.STATUS_SUCCESS);
eiInfo.setMsg("删除成功!"); eiInfo.setMsg("删除成功!");
...@@ -197,8 +124,8 @@ public class ServiceHPKC003 extends ServiceBase { ...@@ -197,8 +124,8 @@ public class ServiceHPKC003 extends ServiceBase {
* @param hpkc003 * @param hpkc003
*/ */
public HPSC004 synchronousPlan(HPKC003 hpkc003) { public HPSC004 synchronousPlan(HPKC003 hpkc003) {
HPSC004 hpsc004 = (HPSC004) this.dao.get("HPSC004.queryDetail","productionOrderNo",hpkc003.getProductionOrderNo()); HPSC004 hpsc004 = (HPSC004) this.dao.get("HPSC004.queryDetail", "productionOrderNo", hpkc003.getProdOrderNo());
if (hpsc004 != null) { AssertUtils.isNull(hpsc004, String.format("生产订单[%s]对应的任务计划不存在", hpkc003.getProdOrderNo()));
BigDecimal actualCompletionNum = hpkc003.getAmount().add(hpsc004.getActualCompletionNum()); BigDecimal actualCompletionNum = hpkc003.getAmount().add(hpsc004.getActualCompletionNum());
BigDecimal actualCompletionUnitWt = hpkc003.getWeight().add(hpsc004.getActualCompletionUnitWt()); BigDecimal actualCompletionUnitWt = hpkc003.getWeight().add(hpsc004.getActualCompletionUnitWt());
hpsc004.setActualCompletionNum(actualCompletionNum); hpsc004.setActualCompletionNum(actualCompletionNum);
...@@ -211,7 +138,6 @@ public class ServiceHPKC003 extends ServiceBase { ...@@ -211,7 +138,6 @@ public class ServiceHPKC003 extends ServiceBase {
} else { } else {
hpsc004.setActualCompletionDate(""); hpsc004.setActualCompletionDate("");
} }
}
return hpsc004; 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);
queryMap.put("isComplete", CommonConstant.YesNo.NO_0);
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 { ...@@ -180,8 +180,8 @@ public class ServiceHPKC009 extends ServiceBase {
// 1.3、生产入库 // 1.3、生产入库
List<HPKC003> scRks = dao.query(HPSqlConstant.HPKC003.STAT_DATE, queryMap); List<HPKC003> scRks = dao.query(HPSqlConstant.HPKC003.STAT_DATE, queryMap);
Map<String, HPKC003> scRkMap = scRks.stream().collect(Collectors.toMap(item -> Map<String, HPKC003> scRkMap = scRks.stream().collect(Collectors.toMap(item ->
buildKey(item.getCompanyCode(), item.getDepCode(), item.getInventType(), item.getInventCode(), buildKey(item.getCompanyCode(), item.getDepCode(), item.getPartType(), item.getPartCode(),
item.getWhCode(), item.getInventRecordId()), item -> item)); item.getWhCode(), null), item -> item));
// 1.4、其他入库 // 1.4、其他入库
List<HPKC006> qtRks = dao.query(HPSqlConstant.HPKC006.STAT_DATE, queryMap); List<HPKC006> qtRks = dao.query(HPSqlConstant.HPKC006.STAT_DATE, queryMap);
Map<String, HPKC006> qtRkMap = qtRks.stream().collect(Collectors.toMap(item -> Map<String, HPKC006> qtRkMap = qtRks.stream().collect(Collectors.toMap(item ->
......
...@@ -10,10 +10,6 @@ ...@@ -10,10 +10,6 @@
PROD_NO as "prodNo", <!-- 生产单号 --> PROD_NO as "prodNo", <!-- 生产单号 -->
WH_CODE as "whCode", <!-- 仓库编码 --> WH_CODE as "whCode", <!-- 仓库编码 -->
WH_NAME as "whName", <!-- 仓库名称 --> 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", <!-- 数量 --> AMOUNT as "amount", <!-- 数量 -->
WEIGHT as "weight", <!-- 重量 --> WEIGHT as "weight", <!-- 重量 -->
REMARK as "remark", <!-- 备注 --> REMARK as "remark", <!-- 备注 -->
...@@ -23,7 +19,8 @@ ...@@ -23,7 +19,8 @@
UPDATED_BY as "updatedBy", <!-- 修改人 --> UPDATED_BY as "updatedBy", <!-- 修改人 -->
UPDATED_TIME as "updatedTime", <!-- 修改人名称 --> UPDATED_TIME as "updatedTime", <!-- 修改人名称 -->
UPDATED_NAME as "updatedName", <!-- 修改时间 --> 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.是 --> DELETE_FLAG as "deleteFlag", <!-- 是否删除0:否1.是 -->
PROD_NO_OLD as "prodNoOld", <!-- 生产单号(旧) --> PROD_NO_OLD as "prodNoOld", <!-- 生产单号(旧) -->
PROJ_CODE as "projCode", <!-- 项目编码 --> PROJ_CODE as "projCode", <!-- 项目编码 -->
...@@ -46,6 +43,12 @@ ...@@ -46,6 +43,12 @@
</sql> </sql>
<sql id="condition"> <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"> <isNotEmpty prepend=" AND " property="id">
ID = #id# ID = #id#
</isNotEmpty> </isNotEmpty>
...@@ -53,31 +56,28 @@ ...@@ -53,31 +56,28 @@
DOCUMENT_DATE = #documentDate# DOCUMENT_DATE = #documentDate#
</isNotEmpty> </isNotEmpty>
<isNotEmpty prepend=" AND " property="prodNo"> <isNotEmpty prepend=" AND " property="prodNo">
PROD_NO LIKE ('%$prodNo$%') PROD_NO LIKE LIKE CONCAT('%', #prodNo#, '%')
</isNotEmpty> </isNotEmpty>
<isNotEmpty prepend=" AND " property="productionOrderNo"> <isNotEmpty prepend=" AND " property="projName">
PRODUCTION_ORDER_NO LIKE ('%$productionOrderNo$%') PROJ_NAME like CONCAT('%', #projName#, '%')
</isNotEmpty> </isNotEmpty>
<isNotEmpty prepend=" AND " property="whCode"> <isNotEmpty prepend=" AND " property="partName">
WH_CODE = #whCode# PART_NAME LIKE CONCAT('%', #partName#, '%')
</isNotEmpty> </isNotEmpty>
<isNotEmpty prepend=" AND " property="whName"> <isNotEmpty prepend=" AND " property="prdtName">
WH_NAME = #whName# PRDT_NAME LIKE CONCAT('%', #prdtName#, '%')
</isNotEmpty>
<isNotEmpty prepend=" AND " property="inventType">
INVENT_TYPE = #inventType#
</isNotEmpty> </isNotEmpty>
<isNotEmpty prepend=" AND " property="inventCode"> <isNotEmpty prepend=" AND " property="prodOrderNo">
INVENT_CODE = #inventCode# PROD_ORDER_NO LIKE CONCAT('%', #prodOrderNo#, '%')
</isNotEmpty> </isNotEmpty>
<isNotEmpty prepend=" AND " property="inventName"> <isNotEmpty prepend=" AND " property="prodTaskNo">
INVENT_NAME = #inventName# PROD_TASK_NO LIKE CONCAT('%', #prodTaskNo#, '%')
</isNotEmpty> </isNotEmpty>
<isNotEmpty prepend=" AND " property="inventRecordId"> <isNotEmpty prepend=" AND " property="whCode">
INVENT_RECORD_ID = #inventRecordId# WH_CODE = #whCode#
</isNotEmpty> </isNotEmpty>
<isNotEmpty prepend=" AND " property="companyCode"> <isNotEmpty prepend=" AND " property="whName">
COMPANY_CODE = #companyCode# WH_NAME = #whName#
</isNotEmpty> </isNotEmpty>
<isNotEmpty prepend=" AND " property="deleteFlag"> <isNotEmpty prepend=" AND " property="deleteFlag">
DELETE_FLAG = #deleteFlag# DELETE_FLAG = #deleteFlag#
...@@ -85,14 +85,6 @@ ...@@ -85,14 +85,6 @@
</sql> </sql>
<sql id="customCondition"> <sql id="customCondition">
<isNotEmpty prepend=" AND " property="spec">
<isEqual property="spec" compareValue="无规格">
INVENT_RECORD_ID IN (SELECT ID FROM ${hpjxSchema}.T_HPPZ006 WHERE SPEC = '')
</isEqual>
<isNotEqual property="spec" compareValue="无规格">
INVENT_RECORD_ID IN (SELECT ID FROM ${hpjxSchema}.T_HPPZ006 WHERE SPEC = #spec#)
</isNotEqual>
</isNotEmpty>
<isNotEmpty prepend=" AND " property="createdDateFrom"> <isNotEmpty prepend=" AND " property="createdDateFrom">
CREATED_TIME &gt;= CONCAT(REPLACE(#createdDateFrom#, '-', ''), '000000') CREATED_TIME &gt;= CONCAT(REPLACE(#createdDateFrom#, '-', ''), '000000')
</isNotEmpty> </isNotEmpty>
...@@ -134,20 +126,14 @@ ...@@ -134,20 +126,14 @@
PROD_NO, <!-- 生产单号 --> PROD_NO, <!-- 生产单号 -->
WH_CODE, <!-- 仓库编码 --> WH_CODE, <!-- 仓库编码 -->
WH_NAME, <!-- 仓库名称 --> WH_NAME, <!-- 仓库名称 -->
INVENT_TYPE, <!-- 存货类型 -->
INVENT_CODE, <!-- 存货编码 -->
INVENT_NAME, <!-- 存货名称 -->
INVENT_RECORD_ID, <!-- 存货档案ID -->
AMOUNT, <!-- 数量 --> AMOUNT, <!-- 数量 -->
WEIGHT, <!-- 重量 --> WEIGHT, <!-- 重量 -->
REMARK, <!-- 备注 --> REMARK, <!-- 备注 -->
CREATED_BY, <!-- 创建人 --> CREATED_BY, <!-- 创建人 -->
CREATED_NAME, <!-- 创建人名称 --> CREATED_NAME, <!-- 创建人名称 -->
CREATED_TIME, <!-- 创建时间 --> CREATED_TIME, <!-- 创建时间 -->
UPDATED_BY, <!-- 修改人 --> PROD_ORDER_NO, <!-- 生产订单号 -->
UPDATED_TIME, <!-- 修改人名称 --> PROD_TASK_NO, <!-- 生产任务号 -->
UPDATED_NAME, <!-- 修改时间 -->
PRODUCTION_ORDER_NO, <!-- 生产订单号 -->
DELETE_FLAG, <!-- 是否删除0:否1.是 --> DELETE_FLAG, <!-- 是否删除0:否1.是 -->
PROD_NO_OLD, <!-- 生产单号(旧) --> PROD_NO_OLD, <!-- 生产单号(旧) -->
PROJ_CODE, <!-- 项目编码 --> PROJ_CODE, <!-- 项目编码 -->
...@@ -167,59 +153,32 @@ ...@@ -167,59 +153,32 @@
PART_THICK, <!-- 零件-厚 --> PART_THICK, <!-- 零件-厚 -->
PART_SPEC, <!-- 零件规格 --> PART_SPEC, <!-- 零件规格 -->
REMARK1 <!-- 备注 --> 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> </insert>
<!-- 逻辑删除 -->
<update id="delete"> <update id="delete">
UPDATE ${hpjxSchema}.T_HPKC003 UPDATE ${hpjxSchema}.T_HPKC003 SET DELETE_FLAG = 1 WHERE ID = #id#
SET DELETE_FLAG = 1 WHERE ID = #id#
</update> </update>
<update id="update"> <!-- 行锁 -->
<update id="lock">
UPDATE ${hpjxSchema}.T_HPKC003 UPDATE ${hpjxSchema}.T_HPKC003
SET SET CREATED_TIME = CREATED_TIME
COMPANY_CODE = #companyCode#, <!-- 企业编码 预留 --> WHERE 1=1
DEP_CODE = #depCode#, <!-- 部门编码 预留 --> <isNotEmpty prepend=" AND " property="prodNo">
DOCUMENT_DATE = #documentDate#, <!-- 票据日期 --> PROD_NO = #prodNo#
PROD_NO = #prodNo#, <!-- 生产单号 --> </isNotEmpty>
WH_CODE = #whCode#, <!-- 仓库编码 --> <isNotEmpty prepend=" AND " property="prodNos">
WH_NAME = #whName#, <!-- 仓库名称 --> PROD_NO IN <iterate close=")" open="(" conjunction="," property="prodNos">#prodNos[]#</iterate>
INVENT_TYPE = #inventType#, <!-- 存货类型 --> </isNotEmpty>
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#
</update> </update>
<!-- 统计库存 --> <!-- 统计库存 -->
......
...@@ -141,15 +141,17 @@ ...@@ -141,15 +141,17 @@
WEIGHT, <!-- 重量 --> WEIGHT, <!-- 重量 -->
REMARK, <!-- 备注 --> REMARK, <!-- 备注 -->
CREATED_BY, <!-- 创建人 --> CREATED_BY, <!-- 创建人 -->
CREATED_NAME, <!-- 创建人 -->
CREATED_TIME, <!-- 创建时间 --> CREATED_TIME, <!-- 创建时间 -->
UPDATED_BY, <!-- 更新人 --> UPDATED_BY, <!-- 更新人 -->
UPDATED_NAME, <!-- 更新人 -->
UPDATED_TIME, <!-- 更新时间 --> UPDATED_TIME, <!-- 更新时间 -->
VERSION VERSION
) VALUES ( ) VALUES (
#companyCode#, #depCode#, #whCode#, #whName#, #prodNo#, #projCode#, #projName#, #companyCode#, #depCode#, #whCode#, #whName#, #prodNo#, #projCode#, #projName#,
#inventCode#, #inventName#, #subInventCode#, #subInventName#, #length#, #width#, #thick#, #inventCode#, #inventName#, #subInventCode#, #subInventName#, #length#, #width#, #thick#,
#amount#, #unitWeight#, #weight#, #remark#, #amount#, #unitWeight#, #weight#, #remark#,
#createdBy#, #createdTime#, #updatedBy#, #createdBy#, #createdName#, #createdTime#, #updatedBy#, #updatedName#,
#updatedTime#, #version# #updatedTime#, #version#
) )
</insert> </insert>
......
...@@ -129,6 +129,75 @@ public class HPKCTools { ...@@ -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 公共方法定义 * HPKC004 公共方法定义
* *
......
...@@ -178,7 +178,7 @@ public class ServiceHPPZ004 extends ServiceBase { ...@@ -178,7 +178,7 @@ public class ServiceHPPZ004 extends ServiceBase {
map.put("inventType", eiInfo.getString("inventType")); map.put("inventType", eiInfo.getString("inventType"));
List<DdynamicEnum> list = new ArrayList<>(); List<DdynamicEnum> list = new ArrayList<>();
list.add(DdynamicEnum.INVENT_NAME_BLOCK_ID); list.add(DdynamicEnum.INVENT_NAME_BLOCK_ID);
boolean isSplicingSymbol = true; boolean isSplicingSymbol = false;
if (eiInfo.getString("isSplicingSymbol") != null) { if (eiInfo.getString("isSplicingSymbol") != null) {
isSplicingSymbol = Boolean.parseBoolean(eiInfo.getString("isSplicingSymbol")); isSplicingSymbol = Boolean.parseBoolean(eiInfo.getString("isSplicingSymbol"));
} }
......
...@@ -174,7 +174,6 @@ public class ServiceHPPZ011 extends ServiceBase { ...@@ -174,7 +174,6 @@ public class ServiceHPPZ011 extends ServiceBase {
return inInfo; return inInfo;
} }
public EiInfo queryComboBoxAll(EiInfo inInfo) { public EiInfo queryComboBoxAll(EiInfo inInfo) {
try { try {
List<DdynamicEnum> list = new ArrayList<>(); List<DdynamicEnum> list = new ArrayList<>();
......
...@@ -3,59 +3,60 @@ ...@@ -3,59 +3,60 @@
<sqlMap namespace="HPPZ011"> <sqlMap namespace="HPPZ011">
<sql id="column"> <sql id="column">
ID as "id", A.ID as "id",
COMPANY_CODE as "companyCode", <!-- 企业编码 预留 --> A.COMPANY_CODE as "companyCode", <!-- 企业编码 预留 -->
DEP_CODE as "depCode", <!-- 部门编码 预留 --> A.DEP_CODE as "depCode", <!-- 部门编码 预留 -->
CREATED_BY as "createdBy", <!-- 创建人 --> A.CREATED_BY as "createdBy", <!-- 创建人 -->
CREATED_NAME as "createdName", <!-- 创建人名称 --> A.CREATED_NAME as "createdName", <!-- 创建人名称 -->
CREATED_TIME as "createdTime", <!-- 创建时间 --> A.CREATED_TIME as "createdTime", <!-- 创建时间 -->
UPDATED_BY as "updatedBy", <!-- 更新人 --> A.UPDATED_BY as "updatedBy", <!-- 更新人 -->
UPDATED_NAME as "updatedName", <!-- 更新人名称 --> A.UPDATED_NAME as "updatedName", <!-- 更新人名称 -->
UPDATED_TIME as "updatedTime", <!-- 更新时间 --> A.UPDATED_TIME as "updatedTime", <!-- 更新时间 -->
FACTORY_CODE as "factoryCode", <!-- 厂区编码 --> A.FACTORY_CODE as "factoryCode", <!-- 厂区编码 -->
FACTORY_NAME as "factoryName", <!-- 厂区名称 --> A.FACTORY_NAME as "factoryName", <!-- 厂区名称 -->
GROUP_CODE as "groupCode", <!-- 生产组编码 --> A.GROUP_CODE as "groupCode", <!-- 生产组编码 -->
GROUP_NAME as "groupName", <!-- 生产组名称 --> A.GROUP_TYPE as "groupType", <!-- 组类型 -->
GROUP_TYPE as "groupType" <!-- 组类型 --> B.ORG_CNAME as "groupName" <!-- 生产组名称 -->
</sql> </sql>
<sql id="condition"> <sql id="condition">
AND DELETE_FLAG = 0 AND A.DELETE_FLAG = 0
AND A.GROUP_CODE = B.ORG_ID
<isNotEmpty prepend=" AND " property="id"> <isNotEmpty prepend=" AND " property="id">
ID = #id# A.ID = #id#
</isNotEmpty> </isNotEmpty>
<isNotEmpty prepend=" AND " property="companyCode"> <isNotEmpty prepend=" AND " property="companyCode">
COMPANY_CODE = #companyCode# A.COMPANY_CODE = #companyCode#
</isNotEmpty> </isNotEmpty>
<isNotEmpty prepend=" AND " property="depCode"> <isNotEmpty prepend=" AND " property="depCode">
DEP_CODE = #depCode# A.DEP_CODE = #depCode#
</isNotEmpty> </isNotEmpty>
<isNotEmpty prepend=" AND " property="factoryCode"> <isNotEmpty prepend=" AND " property="factoryCode">
FACTORY_CODE = #factoryCode# A.FACTORY_CODE = #factoryCode#
</isNotEmpty> </isNotEmpty>
<isNotEmpty prepend=" AND " property="groupCode"> <isNotEmpty prepend=" AND " property="groupCode">
GROUP_CODE = #groupCode# A.GROUP_CODE = #groupCode#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="groupName">
GROUP_NAME LIKE CONCAT('%', #groupName#, '%')
</isNotEmpty> </isNotEmpty>
<isNotEmpty prepend=" AND " property="groupType"> <isNotEmpty prepend=" AND " property="groupType">
GROUP_TYPE = #groupType# A.GROUP_TYPE = #groupType#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="groupName">
B.ORG_CNAME LIKE CONCAT('%', #groupName#, '%')
</isNotEmpty> </isNotEmpty>
</sql> </sql>
<sql id="getCondition"> <sql id="getCondition">
<isNotEmpty prepend=" AND " property="id"> <isNotEmpty prepend=" AND " property="id">
ID = #id# A.ID = #id#
</isNotEmpty> </isNotEmpty>
<isNotEmpty prepend=" AND " property="factoryName"> <isNotEmpty prepend=" AND " property="factoryName">
FACTORY_NAME = #factoryName# A.FACTORY_NAME = #factoryName#
</isNotEmpty> </isNotEmpty>
</sql> </sql>
<sql id="queryCondition"> <sql id="queryCondition">
<isNotEmpty prepend=" AND " property="factoryName"> <isNotEmpty prepend=" AND " property="factoryName">
FACTORY_NAME LIKE CONCAT('%', #factoryName#, '%') A.FACTORY_NAME LIKE CONCAT('%', #factoryName#, '%')
</isNotEmpty> </isNotEmpty>
</sql> </sql>
...@@ -65,7 +66,7 @@ ...@@ -65,7 +66,7 @@
$orderBy$ $orderBy$
</isNotEmpty> </isNotEmpty>
<isEmpty property="order"> <isEmpty property="order">
ID ASC A.ID ASC
</isEmpty> </isEmpty>
</dynamic> </dynamic>
</sql> </sql>
...@@ -73,7 +74,7 @@ ...@@ -73,7 +74,7 @@
<select id="query" resultClass="com.baosight.hpjx.hp.pz.domain.HPPZ011"> <select id="query" resultClass="com.baosight.hpjx.hp.pz.domain.HPPZ011">
SELECT SELECT
<include refid="column"/> <include refid="column"/>
FROM ${hpjxSchema}.T_HPPZ011 FROM ${hpjxSchema}.T_HPPZ011 A, ${platSchema}.TXSOG01 B
WHERE 1=1 WHERE 1=1
<include refid="condition"/> <include refid="condition"/>
<include refid="queryCondition"/> <include refid="queryCondition"/>
...@@ -81,7 +82,9 @@ ...@@ -81,7 +82,9 @@
</select> </select>
<select id="count" resultClass="int"> <select id="count" resultClass="int">
SELECT COUNT(*) FROM ${hpjxSchema}.T_HPPZ011 WHERE 1=1 SELECT COUNT(*)
FROM ${hpjxSchema}.T_HPPZ011 A, ${platSchema}.TXSOG01 B
WHERE 1=1
<include refid="condition"/> <include refid="condition"/>
<include refid="queryCondition"/> <include refid="queryCondition"/>
</select> </select>
...@@ -90,7 +93,7 @@ ...@@ -90,7 +93,7 @@
<select id="get" resultClass="com.baosight.hpjx.hp.pz.domain.HPPZ011"> <select id="get" resultClass="com.baosight.hpjx.hp.pz.domain.HPPZ011">
SELECT SELECT
<include refid="column"/> <include refid="column"/>
FROM ${hpjxSchema}.T_HPPZ011 FROM ${hpjxSchema}.T_HPPZ011 A, ${platSchema}.TXSOG01 B
WHERE 1=1 WHERE 1=1
<include refid="getCondition"/> <include refid="getCondition"/>
</select> </select>
...@@ -166,6 +169,12 @@ ...@@ -166,6 +169,12 @@
FROM ${hpjxSchema}.T_HPPZ011 A, ${platSchema}.TXSOG01 B FROM ${hpjxSchema}.T_HPPZ011 A, ${platSchema}.TXSOG01 B
WHERE A.DELETE_FLAG = 0 WHERE A.DELETE_FLAG = 0
AND A.GROUP_CODE = B.ORG_ID AND A.GROUP_CODE = B.ORG_ID
<isNotEmpty prepend=" AND " property="companyCode">
A.COMPANY_CODE = #companyCode#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="factoryCode">
A.FACTORY_CODE = #factoryCode#
</isNotEmpty>
ORDER BY FACTORY_CODE ASC ORDER BY FACTORY_CODE ASC
</select> </select>
......
...@@ -4,6 +4,7 @@ import com.baosight.hpjx.common.InventTypeEnum; ...@@ -4,6 +4,7 @@ import com.baosight.hpjx.common.InventTypeEnum;
import com.baosight.hpjx.core.constant.CommonConstant; import com.baosight.hpjx.core.constant.CommonConstant;
import com.baosight.hpjx.core.dao.DaoBase; import com.baosight.hpjx.core.dao.DaoBase;
import com.baosight.hpjx.hp.constant.HPSqlConstant; 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.HPPZ004;
import com.baosight.hpjx.hp.pz.domain.HPPZ006; import com.baosight.hpjx.hp.pz.domain.HPPZ006;
import com.baosight.hpjx.hp.pz.domain.HPPZ007; import com.baosight.hpjx.hp.pz.domain.HPPZ007;
...@@ -31,6 +32,30 @@ import java.util.stream.Collectors; ...@@ -31,6 +32,30 @@ import java.util.stream.Collectors;
public class HPPZTools { 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 * @param inventCode
......
...@@ -66,6 +66,8 @@ public class HPSC002A extends DaoEPBase { ...@@ -66,6 +66,8 @@ public class HPSC002A extends DaoEPBase {
private String updatedName = " "; /* 修改人名称*/ private String updatedName = " "; /* 修改人名称*/
private String updatedTime = " "; /* 修改时间*/ private String updatedTime = " "; /* 修改时间*/
private String bizType = " "; /* 业务类型*/
/** /**
* initialize the metadata. * initialize the metadata.
*/ */
...@@ -121,7 +123,9 @@ public class HPSC002A extends DaoEPBase { ...@@ -121,7 +123,9 @@ public class HPSC002A extends DaoEPBase {
eiColumn.setDescName("修改时间"); eiColumn.setDescName("修改时间");
eiMetadata.addMeta(eiColumn); eiMetadata.addMeta(eiColumn);
eiColumn = new EiColumn("bizType");
eiColumn.setDescName("业务类型");
eiMetadata.addMeta(eiColumn);
} }
/** /**
...@@ -324,6 +328,22 @@ public class HPSC002A extends DaoEPBase { ...@@ -324,6 +328,22 @@ public class HPSC002A extends DaoEPBase {
this.updatedTime = updatedTime; this.updatedTime = updatedTime;
} }
/** /**
* get the bizType - .
* @return the bizType
*/
public String getBizType() {
return this.bizType;
}
/**
* set the bizType -
*
* @param bizType -
*/
public void setBizType(String bizType) {
this.bizType = bizType;
}
/**
* get the value from Map. * get the value from Map.
* *
* @param map - source data map * @param map - source data map
...@@ -343,6 +363,7 @@ public class HPSC002A extends DaoEPBase { ...@@ -343,6 +363,7 @@ public class HPSC002A extends DaoEPBase {
setUpdatedBy(StringUtils.defaultIfEmpty(StringUtils.toString(map.get(FIELD_UPDATED_BY)), updatedBy)); setUpdatedBy(StringUtils.defaultIfEmpty(StringUtils.toString(map.get(FIELD_UPDATED_BY)), updatedBy));
setUpdatedName(StringUtils.defaultIfEmpty(StringUtils.toString(map.get(FIELD_UPDATED_NAME)), updatedName)); setUpdatedName(StringUtils.defaultIfEmpty(StringUtils.toString(map.get(FIELD_UPDATED_NAME)), updatedName));
setUpdatedTime(StringUtils.defaultIfEmpty(StringUtils.toString(map.get(FIELD_UPDATED_TIME)), updatedTime)); setUpdatedTime(StringUtils.defaultIfEmpty(StringUtils.toString(map.get(FIELD_UPDATED_TIME)), updatedTime));
setBizType(StringUtils.defaultIfEmpty(StringUtils.toString(map.get("bizType")), bizType));
} }
/** /**
...@@ -364,6 +385,7 @@ public class HPSC002A extends DaoEPBase { ...@@ -364,6 +385,7 @@ public class HPSC002A extends DaoEPBase {
map.put(FIELD_UPDATED_BY, StringUtils.toString(updatedBy, eiMetadata.getMeta(FIELD_UPDATED_BY))); map.put(FIELD_UPDATED_BY, StringUtils.toString(updatedBy, eiMetadata.getMeta(FIELD_UPDATED_BY)));
map.put(FIELD_UPDATED_NAME, StringUtils.toString(updatedName, eiMetadata.getMeta(FIELD_UPDATED_NAME))); map.put(FIELD_UPDATED_NAME, StringUtils.toString(updatedName, eiMetadata.getMeta(FIELD_UPDATED_NAME)));
map.put(FIELD_UPDATED_TIME, StringUtils.toString(updatedTime, eiMetadata.getMeta(FIELD_UPDATED_TIME))); map.put(FIELD_UPDATED_TIME, StringUtils.toString(updatedTime, eiMetadata.getMeta(FIELD_UPDATED_TIME)));
map.put("bizType", StringUtils.toString(bizType, eiMetadata.getMeta("bizType")));
return map; return map;
} }
......
...@@ -48,11 +48,11 @@ public class HPSC002B extends DaoEPBase { ...@@ -48,11 +48,11 @@ public class HPSC002B extends DaoEPBase {
public static final String COL_UPDATED_NAME = "UPDATED_NAME"; /* 修改人名称*/ public static final String COL_UPDATED_NAME = "UPDATED_NAME"; /* 修改人名称*/
public static final String COL_UPDATED_TIME = "UPDATED_TIME"; /* 修改时间*/ public static final String COL_UPDATED_TIME = "UPDATED_TIME"; /* 修改时间*/
public static final String QUERY = "HPSC002B.query"; public static final String QUERY = "HPSC002A.query";
public static final String COUNT = "HPSC002B.count"; public static final String COUNT = "HPSC002A.count";
public static final String INSERT = "HPSC002B.insert"; public static final String INSERT = "HPSC002A.insert";
public static final String UPDATE = "HPSC002B.update"; public static final String UPDATE = "HPSC002A.update";
public static final String DELETE = "HPSC002B.delete"; public static final String DELETE = "HPSC002A.delete";
private Long id = null; /* 主键ID*/ private Long id = null; /* 主键ID*/
private String companyCode = " "; /* 企业编码 预留*/ private String companyCode = " "; /* 企业编码 预留*/
...@@ -67,6 +67,8 @@ public class HPSC002B extends DaoEPBase { ...@@ -67,6 +67,8 @@ public class HPSC002B extends DaoEPBase {
private String updatedName = " "; /* 修改人名称*/ private String updatedName = " "; /* 修改人名称*/
private String updatedTime = " "; /* 修改时间*/ private String updatedTime = " "; /* 修改时间*/
private String bizType = " "; /* 业务类型*/
/** /**
* initialize the metadata. * initialize the metadata.
*/ */
...@@ -122,7 +124,9 @@ public class HPSC002B extends DaoEPBase { ...@@ -122,7 +124,9 @@ public class HPSC002B extends DaoEPBase {
eiColumn.setDescName("修改时间"); eiColumn.setDescName("修改时间");
eiMetadata.addMeta(eiColumn); eiMetadata.addMeta(eiColumn);
eiColumn = new EiColumn("bizType");
eiColumn.setDescName("业务类型");
eiMetadata.addMeta(eiColumn);
} }
/** /**
...@@ -325,6 +329,22 @@ public class HPSC002B extends DaoEPBase { ...@@ -325,6 +329,22 @@ public class HPSC002B extends DaoEPBase {
this.updatedTime = updatedTime; this.updatedTime = updatedTime;
} }
/** /**
* get the bizType - .
* @return the bizType
*/
public String getBizType() {
return this.bizType;
}
/**
* set the bizType -
*
* @param bizType -
*/
public void setBizType(String bizType) {
this.bizType = bizType;
}
/**
* get the value from Map. * get the value from Map.
* *
* @param map - source data map * @param map - source data map
...@@ -344,6 +364,7 @@ public class HPSC002B extends DaoEPBase { ...@@ -344,6 +364,7 @@ public class HPSC002B extends DaoEPBase {
setUpdatedBy(StringUtils.defaultIfEmpty(StringUtils.toString(map.get(FIELD_UPDATED_BY)), updatedBy)); setUpdatedBy(StringUtils.defaultIfEmpty(StringUtils.toString(map.get(FIELD_UPDATED_BY)), updatedBy));
setUpdatedName(StringUtils.defaultIfEmpty(StringUtils.toString(map.get(FIELD_UPDATED_NAME)), updatedName)); setUpdatedName(StringUtils.defaultIfEmpty(StringUtils.toString(map.get(FIELD_UPDATED_NAME)), updatedName));
setUpdatedTime(StringUtils.defaultIfEmpty(StringUtils.toString(map.get(FIELD_UPDATED_TIME)), updatedTime)); setUpdatedTime(StringUtils.defaultIfEmpty(StringUtils.toString(map.get(FIELD_UPDATED_TIME)), updatedTime));
setBizType(StringUtils.defaultIfEmpty(StringUtils.toString(map.get("bizType")), bizType));
} }
/** /**
...@@ -365,6 +386,7 @@ public class HPSC002B extends DaoEPBase { ...@@ -365,6 +386,7 @@ public class HPSC002B extends DaoEPBase {
map.put(FIELD_UPDATED_BY, StringUtils.toString(updatedBy, eiMetadata.getMeta(FIELD_UPDATED_BY))); map.put(FIELD_UPDATED_BY, StringUtils.toString(updatedBy, eiMetadata.getMeta(FIELD_UPDATED_BY)));
map.put(FIELD_UPDATED_NAME, StringUtils.toString(updatedName, eiMetadata.getMeta(FIELD_UPDATED_NAME))); map.put(FIELD_UPDATED_NAME, StringUtils.toString(updatedName, eiMetadata.getMeta(FIELD_UPDATED_NAME)));
map.put(FIELD_UPDATED_TIME, StringUtils.toString(updatedTime, eiMetadata.getMeta(FIELD_UPDATED_TIME))); map.put(FIELD_UPDATED_TIME, StringUtils.toString(updatedTime, eiMetadata.getMeta(FIELD_UPDATED_TIME)));
map.put("bizType", StringUtils.toString(bizType, eiMetadata.getMeta("bizType")));
return map; return map;
} }
......
...@@ -24,8 +24,14 @@ public class HPSC005B extends HPSC005 { ...@@ -24,8 +24,14 @@ public class HPSC005B extends HPSC005 {
private static final long serialVersionUID = 1L; private static final long serialVersionUID = 1L;
public static final String FIELD_CHILD_ID = "childId"; 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_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 QUERY = "HPSC005B.query";
public static final String COUNT = "HPSC005B.count"; public static final String COUNT = "HPSC005B.count";
...@@ -34,6 +40,9 @@ public class HPSC005B extends HPSC005 { ...@@ -34,6 +40,9 @@ public class HPSC005B extends HPSC005 {
public static final String DELETE = "HPSC005B.delete"; public static final String DELETE = "HPSC005B.delete";
private Long childId; private Long childId;
private String prodTaskNo = " ";
private String prodOrderNo = " ";
private BigDecimal completeNum = new BigDecimal(0.000); /* 已完成数量*/
/** /**
* the constructor. * the constructor.
...@@ -53,6 +62,20 @@ public class HPSC005B extends HPSC005 { ...@@ -53,6 +62,20 @@ public class HPSC005B extends HPSC005 {
eiColumn.setDescName(" "); eiColumn.setDescName(" ");
eiMetadata.addMeta(eiColumn); 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 { ...@@ -73,6 +96,38 @@ public class HPSC005B extends HPSC005 {
this.childId = childId; 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. * get the value from Map.
* *
...@@ -82,6 +137,9 @@ public class HPSC005B extends HPSC005 { ...@@ -82,6 +137,9 @@ public class HPSC005B extends HPSC005 {
public void fromMap(Map map) { public void fromMap(Map map) {
super.fromMap(map); super.fromMap(map);
setChildId(NumberUtils.toLong(StringUtils.toString(map.get(FIELD_CHILD_ID)), childId)); 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 { ...@@ -92,6 +150,9 @@ public class HPSC005B extends HPSC005 {
Map map = super.toMap(); Map map = super.toMap();
map.put(FIELD_CHILD_ID, StringUtils.toString(childId, eiMetadata.getMeta(FIELD_CHILD_ID))); 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; return map;
} }
......
...@@ -88,14 +88,13 @@ public class ServiceHPSC001 extends ServiceBase { ...@@ -88,14 +88,13 @@ public class ServiceHPSC001 extends ServiceBase {
* 修改操作. * 修改操作.
*/ */
public EiInfo update(EiInfo inInfo) { public EiInfo update(EiInfo inInfo) {
SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
try { try {
HPSC001 hpsc001 = new HPSC001(); HPSC001 hpsc001 = new HPSC001();
EiBlock eiBlock = inInfo.getBlock(EiConstant.resultBlock); EiBlock eiBlock = inInfo.getBlock(EiConstant.resultBlock);
for (int i = 0; i < eiBlock.getRowCount(); i++) { for (int i = 0; i < eiBlock.getRowCount(); i++) {
Map<?, ?> map = eiBlock.getRow(i); Map<?, ?> map = eiBlock.getRow(i);
hpsc001.fromMap(map); hpsc001.fromMap(map);
DaoUtils.update("HPSC001.insert",hpsc001); DaoUtils.update("HPSC001.update",hpsc001);
} }
inInfo.setStatus(EiConstant.STATUS_SUCCESS); inInfo.setStatus(EiConstant.STATUS_SUCCESS);
inInfo.setMsg("修改成功!"); inInfo.setMsg("修改成功!");
......
...@@ -335,6 +335,7 @@ public class ServiceHPSC002 extends ServiceBase { ...@@ -335,6 +335,7 @@ public class ServiceHPSC002 extends ServiceBase {
Map sqlMap = new HashMap(); Map sqlMap = new HashMap();
sqlMap.put("id",hppz002.getId()); sqlMap.put("id",hppz002.getId());
sqlMap.put("filePath1",hppz002.getFilePath1()); sqlMap.put("filePath1",hppz002.getFilePath1());
sqlMap.put("bizType","WL");
DaoUtils.update("HPSC002.bindDocIdById", hppz002.toMap()); DaoUtils.update("HPSC002.bindDocIdById", hppz002.toMap());
} }
} catch (PlatException e) { } catch (PlatException e) {
......
...@@ -8,6 +8,7 @@ import com.baosight.hpjx.hp.kc.domain.HPKC005; ...@@ -8,6 +8,7 @@ import com.baosight.hpjx.hp.kc.domain.HPKC005;
import com.baosight.hpjx.hp.kc.tools.HPKCTools; import com.baosight.hpjx.hp.kc.tools.HPKCTools;
import com.baosight.hpjx.hp.sc.domain.HPSC002; import com.baosight.hpjx.hp.sc.domain.HPSC002;
import com.baosight.hpjx.hp.sc.domain.HPSC002A; import com.baosight.hpjx.hp.sc.domain.HPSC002A;
import com.baosight.hpjx.hp.sc.domain.HPSC006;
import com.baosight.hpjx.util.BeanUtils; import com.baosight.hpjx.util.BeanUtils;
import com.baosight.hpjx.util.CommonMethod; import com.baosight.hpjx.util.CommonMethod;
import com.baosight.hpjx.util.EiInfoUtils; import com.baosight.hpjx.util.EiInfoUtils;
...@@ -20,6 +21,7 @@ import com.baosight.iplat4j.core.service.impl.ServiceEPBase; ...@@ -20,6 +21,7 @@ import com.baosight.iplat4j.core.service.impl.ServiceEPBase;
import com.baosight.iplat4j.ed.util.SequenceGenerator; import com.baosight.iplat4j.ed.util.SequenceGenerator;
import org.apache.commons.collections.CollectionUtils; import org.apache.commons.collections.CollectionUtils;
import java.util.ArrayList;
import java.util.HashMap; import java.util.HashMap;
import java.util.List; import java.util.List;
import java.util.Map; import java.util.Map;
...@@ -40,12 +42,26 @@ public class ServiceHPSC002A extends ServiceEPBase { ...@@ -40,12 +42,26 @@ public class ServiceHPSC002A extends ServiceEPBase {
try { try {
// 查询物料ID所对应的项目名称和部件名称 // 查询物料ID所对应的项目名称和部件名称
Map queryMap = EiInfoUtils.getFirstRow(inInfo); Map queryMap = EiInfoUtils.getFirstRow(inInfo);
List<HPSC002> dbSc002s = dao.query("HPSC002.query", queryMap); String bizType = inInfo.getString("inqu_status-0-bizType");
if (CollectionUtils.isNotEmpty(dbSc002s)) { List<HPSC002> dbSc002s = new ArrayList<HPSC002>();
HPSC002 dbSc002 = dbSc002s.get(0); List<HPSC006> HPSC006 = new ArrayList<HPSC006>();
if (bizType.equals("WL")) {
dbSc002s = dao.query("HPSC002.query", queryMap);
} else if (bizType.equals("XL")) {
HPSC006 = dao.query("HPSC006.query", queryMap);
}
if (CollectionUtils.isNotEmpty(dbSc002s) || CollectionUtils.isNotEmpty(HPSC006)) {
inInfo.set("inqu_status-0-bizType", queryMap.get("bizType"));
inInfo.set("inqu_status-0-matId", queryMap.get("id")); inInfo.set("inqu_status-0-matId", queryMap.get("id"));
if (bizType.equals("WL")) {
HPSC002 dbSc002 = dbSc002s.get(0);
inInfo.set("inqu_status-0-projName", dbSc002.getProjName()); inInfo.set("inqu_status-0-projName", dbSc002.getProjName());
inInfo.set("inqu_status-0-prdtName", dbSc002.getPrdtName()); inInfo.set("inqu_status-0-prdtName", dbSc002.getPrdtName());
} else if (bizType.equals("XL")) {
HPSC006 dbSc002 = HPSC006.get(0);
inInfo.set("inqu_status-0-projName", dbSc002.getProjName());
inInfo.set("inqu_status-0-prdtName", dbSc002.getInventName());
}
inInfo.addBlock(EiConstant.resultBlock).addBlockMeta(new HPSC002A().eiMetadata); inInfo.addBlock(EiConstant.resultBlock).addBlockMeta(new HPSC002A().eiMetadata);
} }
} catch (PlatException e) { } catch (PlatException e) {
......
...@@ -5,8 +5,11 @@ import com.baosight.hpjx.core.dao.DaoUtils; ...@@ -5,8 +5,11 @@ import com.baosight.hpjx.core.dao.DaoUtils;
import com.baosight.hpjx.hp.pz.domain.HPPZ011; import com.baosight.hpjx.hp.pz.domain.HPPZ011;
import com.baosight.hpjx.hp.sc.domain.HPSC004; import com.baosight.hpjx.hp.sc.domain.HPSC004;
import com.baosight.hpjx.hp.sc.domain.HPSC005; import com.baosight.hpjx.hp.sc.domain.HPSC005;
import com.baosight.hpjx.hp.sc.domain.HPSC005A;
import com.baosight.hpjx.util.CommonMethod; import com.baosight.hpjx.util.CommonMethod;
import com.baosight.hpjx.util.EiInfoUtils; import com.baosight.hpjx.util.EiInfoUtils;
import com.baosight.hpjx.util.LogUtils;
import com.baosight.hpjx.util.StringUtil;
import com.baosight.iplat4j.core.ei.EiBlock; import com.baosight.iplat4j.core.ei.EiBlock;
import com.baosight.iplat4j.core.ei.EiConstant; import com.baosight.iplat4j.core.ei.EiConstant;
import com.baosight.iplat4j.core.ei.EiInfo; import com.baosight.iplat4j.core.ei.EiInfo;
...@@ -17,17 +20,22 @@ import com.baosight.iplat4j.core.util.NumberUtils; ...@@ -17,17 +20,22 @@ import com.baosight.iplat4j.core.util.NumberUtils;
import com.baosight.iplat4j.core.web.threadlocal.UserSession; import com.baosight.iplat4j.core.web.threadlocal.UserSession;
import com.baosight.xservices.xs.og.domain.XSOG01; import com.baosight.xservices.xs.og.domain.XSOG01;
import org.apache.commons.collections.MapUtils;
import java.text.SimpleDateFormat; import java.text.SimpleDateFormat;
import java.util.*; import java.util.*;
/** /**
* * @author:songx
* @date:2024/2/6,10:39
*/ */
public class ServiceHPSC005 extends ServiceBase { public class ServiceHPSC005 extends ServiceBase {
/** /**
* 画面初始化. * 画面初始化
*
* @param inInfo
* @return
*/ */
public EiInfo initLoad(EiInfo inInfo) { public EiInfo initLoad(EiInfo inInfo) {
HPSC005 HPSC005 = new HPSC005(); HPSC005 HPSC005 = new HPSC005();
...@@ -36,16 +44,21 @@ public class ServiceHPSC005 extends ServiceBase { ...@@ -36,16 +44,21 @@ public class ServiceHPSC005 extends ServiceBase {
return inInfo; return inInfo;
} }
/** /**
* 查询操作. * 查询操作.
*
* @param inInfo
* @return
*/ */
@Override @Override
public EiInfo query(EiInfo inInfo) { public EiInfo query(EiInfo inInfo) {
/* 调用EI查询方法.*/ try {
EiInfo outInfo = super.query(inInfo, "HPSC005.query", new HPSC005()); Map queryRow = EiInfoUtils.getFirstRow(inInfo);
return outInfo; inInfo = super.query(inInfo, HPSC005.QUERY, new HPSC005());
} catch (Throwable e) {
LogUtils.setDetailMsg(inInfo, e, "查询失败");
}
return inInfo;
} }
/** /**
......
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 { ...@@ -41,6 +41,12 @@ public class ServiceHPSC098 extends ServiceBase {
return inInfo; return inInfo;
} }
/**
* 查询
*
* @param inInfo
* @return
*/
@Override @Override
public EiInfo query(EiInfo inInfo) { public EiInfo query(EiInfo inInfo) {
try { try {
......
...@@ -458,7 +458,7 @@ ...@@ -458,7 +458,7 @@
</update> </update>
<update id="bindDocIdById"> <update id="bindDocIdById">
UPDATE hpjx.t_hpsc002 SET FILE_PATH1 = #filePath1# WHERE ID = #id# UPDATE hpjx.t_hpsc002 SET FILE_PATH1 = #filePath1# WHERE ID = #id# AND BIZ_TYPE = #bizType#
</update> </update>
......
...@@ -6,6 +6,7 @@ ...@@ -6,6 +6,7 @@
A.ID as "id", A.ID as "id",
A.COMPANY_CODE as "companyCode", <!-- 企业编码 预留 --> A.COMPANY_CODE as "companyCode", <!-- 企业编码 预留 -->
A.DEPT_CODE as "deptCode", <!-- 部门编码 预留 --> A.DEPT_CODE as "deptCode", <!-- 部门编码 预留 -->
A.BIZ_TYPE as "bizType", <!-- 物料ID -->
A.MAT_ID as "matId", <!-- 物料ID --> A.MAT_ID as "matId", <!-- 物料ID -->
A.DOC_ID as "docId", <!-- 文件ID --> A.DOC_ID as "docId", <!-- 文件ID -->
B.DOC_NAME as "docName", <!-- 文件名称 --> B.DOC_NAME as "docName", <!-- 文件名称 -->
...@@ -27,6 +28,9 @@ ...@@ -27,6 +28,9 @@
<isNotEmpty prepend=" AND " property="deptCode"> <isNotEmpty prepend=" AND " property="deptCode">
A.DEPT_CODE = #deptCode# A.DEPT_CODE = #deptCode#
</isNotEmpty> </isNotEmpty>
<isNotEmpty prepend=" AND " property="bizType">
A.BIZ_TYPE = #bizType#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="matId"> <isNotEmpty prepend=" AND " property="matId">
A.MAT_ID = #matId# A.MAT_ID = #matId#
</isNotEmpty> </isNotEmpty>
...@@ -95,13 +99,14 @@ ...@@ -95,13 +99,14 @@
INSERT INTO ${hpjxSchema}.T_HPSC002A ( INSERT INTO ${hpjxSchema}.T_HPSC002A (
COMPANY_CODE, <!-- 企业编码 预留 --> COMPANY_CODE, <!-- 企业编码 预留 -->
DEPT_CODE, <!-- 部门编码 预留 --> DEPT_CODE, <!-- 部门编码 预留 -->
BIZ_TYPE,
MAT_ID, <!-- 物料ID --> MAT_ID, <!-- 物料ID -->
DOC_ID, <!-- 文件ID --> DOC_ID, <!-- 文件ID -->
CREATED_BY, <!-- 创建人 --> CREATED_BY, <!-- 创建人 -->
CREATED_NAME, <!-- 创建人名称 --> CREATED_NAME, <!-- 创建人名称 -->
CREATED_TIME <!-- 创建时间 --> CREATED_TIME <!-- 创建时间 -->
) VALUES ( ) VALUES (
#companyCode#, #deptCode#, #matId#, #docId#, #createdBy#, #companyCode#, #deptCode#, #bizType#, #matId#, #docId#, #createdBy#,
#createdName#, #createdTime# #createdName#, #createdTime#
) )
</insert> </insert>
......
...@@ -6,6 +6,7 @@ ...@@ -6,6 +6,7 @@
A.ID as "id", A.ID as "id",
A.COMPANY_CODE as "companyCode", <!-- 企业编码 预留 --> A.COMPANY_CODE as "companyCode", <!-- 企业编码 预留 -->
A.DEPT_CODE as "deptCode", <!-- 部门编码 预留 --> A.DEPT_CODE as "deptCode", <!-- 部门编码 预留 -->
A.BIZ_TYPE as "bizType", <!-- 物料ID -->
A.MAT_ID as "matId", <!-- 物料ID --> A.MAT_ID as "matId", <!-- 物料ID -->
A.DOC_ID as "docId", <!-- 文件ID --> A.DOC_ID as "docId", <!-- 文件ID -->
B.DOC_NAME as "docName", <!-- 文件名称 --> B.DOC_NAME as "docName", <!-- 文件名称 -->
...@@ -27,6 +28,9 @@ ...@@ -27,6 +28,9 @@
<isNotEmpty prepend=" AND " property="deptCode"> <isNotEmpty prepend=" AND " property="deptCode">
A.DEPT_CODE = #deptCode# A.DEPT_CODE = #deptCode#
</isNotEmpty> </isNotEmpty>
<isNotEmpty prepend=" AND " property="bizType">
A.BIZ_TYPE = #bizType#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="matId"> <isNotEmpty prepend=" AND " property="matId">
A.MAT_ID = #matId# A.MAT_ID = #matId#
</isNotEmpty> </isNotEmpty>
...@@ -98,13 +102,14 @@ ...@@ -98,13 +102,14 @@
INSERT INTO ${hpjxSchema}.T_HPSC002A ( INSERT INTO ${hpjxSchema}.T_HPSC002A (
COMPANY_CODE, <!-- 企业编码 预留 --> COMPANY_CODE, <!-- 企业编码 预留 -->
DEPT_CODE, <!-- 部门编码 预留 --> DEPT_CODE, <!-- 部门编码 预留 -->
BIZ_TYPE,
MAT_ID, <!-- 物料ID --> MAT_ID, <!-- 物料ID -->
DOC_ID, <!-- 文件ID --> DOC_ID, <!-- 文件ID -->
CREATED_BY, <!-- 创建人 --> CREATED_BY, <!-- 创建人 -->
CREATED_NAME, <!-- 创建人名称 --> CREATED_NAME, <!-- 创建人名称 -->
CREATED_TIME <!-- 创建时间 --> CREATED_TIME <!-- 创建时间 -->
) VALUES ( ) VALUES (
#companyCode#, #deptCode#, #matId#, #docId#, #createdBy#, #companyCode#, #deptCode#, #bizType#, #matId#, #docId#, #createdBy#,
#createdName#, #createdTime# #createdName#, #createdTime#
) )
</insert> </insert>
......
...@@ -62,7 +62,7 @@ ...@@ -62,7 +62,7 @@
PROJ_NAME like CONCAT('%', #projName#, '%') PROJ_NAME like CONCAT('%', #projName#, '%')
</isNotEmpty> </isNotEmpty>
<isNotEmpty prepend=" AND " property="productionOrderNo"> <isNotEmpty prepend=" AND " property="productionOrderNo">
PRODUCTION_ORDER_NO like CONCAT('%', #productionOrderNo#, '%') PRODUCTION_ORDER_NO LIKE CONCAT('%', #productionOrderNo#, '%')
</isNotEmpty> </isNotEmpty>
<isNotEmpty prepend=" AND " property="prdtType"> <isNotEmpty prepend=" AND " property="prdtType">
PRDT_TYPE = #prdtType# PRDT_TYPE = #prdtType#
...@@ -70,11 +70,14 @@ ...@@ -70,11 +70,14 @@
<isNotEmpty prepend=" AND " property="prdtCode"> <isNotEmpty prepend=" AND " property="prdtCode">
PRDT_CODE = #prdtCode# PRDT_CODE = #prdtCode#
</isNotEmpty> </isNotEmpty>
<isNotEmpty prepend=" AND " property="partName">
PART_NAME LIKE CONCAT('%', #partName#, '%')
</isNotEmpty>
<isNotEmpty prepend=" AND " property="prdtName"> <isNotEmpty prepend=" AND " property="prdtName">
PRDT_NAME = #prdtName# PRDT_NAME LIKE CONCAT('%', #prdtName#, '%')
</isNotEmpty> </isNotEmpty>
<isNotEmpty prepend=" AND " property="planCompletionDate"> <isNotEmpty prepend=" AND " property="planCompletionDate">
PLAN_COMPLETION_DATE like CONCAT('%', #planCompletionDate#, '%') PLAN_COMPLETION_DATE = #planCompletionDate#
</isNotEmpty> </isNotEmpty>
<isNotEmpty prepend=" AND " property="num"> <isNotEmpty prepend=" AND " property="num">
NUM = #num# NUM = #num#
...@@ -126,6 +129,13 @@ ...@@ -126,6 +129,13 @@
</isNotEmpty> </isNotEmpty>
</sql> </sql>
<!-- 公共修改字段 -->
<sql id="updateRevise">
UPDATED_BY = #updatedBy#, <!-- 修改人 -->
UPDATED_NAME = #updatedName#, <!-- 修改人名称 -->
UPDATED_TIME = #updatedTime# <!-- 修改时间 -->
</sql>
<select id="query" parameterClass="java.util.HashMap" <select id="query" parameterClass="java.util.HashMap"
resultClass="com.baosight.hpjx.hp.sc.domain.HPSC005"> resultClass="com.baosight.hpjx.hp.sc.domain.HPSC005">
SELECT SELECT
...@@ -148,66 +158,6 @@ ...@@ -148,66 +158,6 @@
<include refid="condition" /> <include refid="condition" />
</select> </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 id="insert">
INSERT INTO ${hpjxSchema}.T_HPSC005 (ID, INSERT INTO ${hpjxSchema}.T_HPSC005 (ID,
COMPANY_CODE, <!-- 企业编码 预留 --> COMPANY_CODE, <!-- 企业编码 预留 -->
...@@ -318,11 +268,9 @@ ...@@ -318,11 +268,9 @@
STATUS = #status#, <!-- 状态 0-未派工,1-部分派工,2-全部派工 --> STATUS = #status#, <!-- 状态 0-未派工,1-部分派工,2-全部派工 -->
ASSIGNED_NUM = #assignedNum#, <!-- 已派工数量 --> ASSIGNED_NUM = #assignedNum#, <!-- 已派工数量 -->
UNASSIGNED_NUM = #unassignedNum#, <!-- 待派工数量 --> UNASSIGNED_NUM = #unassignedNum#, <!-- 待派工数量 -->
UPDATED_BY = #updatedBy#, <!-- 更新人 --> DOCUMENT_TYPE = 1,
UPDATED_TIME = #updatedTime#, <!-- 更新时间 --> <include refid="updateRevise"/>
DOCUMENT_TYPE = 1 WHERE ID = #id#
WHERE
ID = #id#
</update> </update>
<select id="getEntity" parameterClass="java.util.HashMap" <select id="getEntity" parameterClass="java.util.HashMap"
...@@ -335,6 +283,19 @@ ...@@ -335,6 +283,19 @@
</isNotEmpty> </isNotEmpty>
</select> </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 id="queryProjComboBox" parameterClass="java.util.HashMap" resultClass="java.util.HashMap">
SELECT DISTINCT SELECT DISTINCT
......
...@@ -4,7 +4,6 @@ ...@@ -4,7 +4,6 @@
<sql id="column"> <sql id="column">
A.ID as "id", A.ID as "id",
B.ID as "childId",
A.PROJ_CODE as "projCode", <!-- 项目编码 --> A.PROJ_CODE as "projCode", <!-- 项目编码 -->
A.PROJ_NAME as "projName", <!-- 项目名称 --> A.PROJ_NAME as "projName", <!-- 项目名称 -->
A.PRODUCTION_ORDER_NO as "productionOrderNo", <!-- 生产订单号 --> A.PRODUCTION_ORDER_NO as "productionOrderNo", <!-- 生产订单号 -->
...@@ -20,13 +19,20 @@ ...@@ -20,13 +19,20 @@
A.PART_LENGTH as "partLength", <!-- 长 --> A.PART_LENGTH as "partLength", <!-- 长 -->
A.PART_WIDTH as "partWidth", <!-- 宽 --> A.PART_WIDTH as "partWidth", <!-- 宽 -->
A.PART_THICK as "partThick", <!-- 厚 --> A.PART_THICK as "partThick", <!-- 厚 -->
A.FACTORY_CODE as "factoryCode", <!-- 厂区编码 --> A.UNIT_WT as "unitWt", <!-- 单重 -->
A.FACTORY_NAME as "factoryName", <!-- 厂区名称 -->
A.STATUS as "status", <!-- 状态 --> A.STATUS as "status", <!-- 状态 -->
(CASE WHEN A.DOCUMENT_TYPE = 1 THEN B.NUM ELSE A.NUM END) AS "num", A.PLAN_COMPLETION_DATE as "planCompletionDate", <!-- 计划完成日期 -->
(CASE WHEN A.DOCUMENT_TYPE = 1 THEN B.TOTAL_WT ELSE A.TOTAL_WT END) AS "totalWt", A.FILE_PATH1 as "filePath1",
(CASE WHEN A.DOCUMENT_TYPE = 1 THEN B.ORG_NO ELSE A.ORG_NO END) AS "orgNo", B.ID as "childId",
(CASE WHEN A.DOCUMENT_TYPE = 1 THEN B.ORG_NAME ELSE A.ORG_NAME END) AS "orgName" 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>
<sql id="condition"> <sql id="condition">
...@@ -36,9 +42,6 @@ ...@@ -36,9 +42,6 @@
<isNotEmpty prepend=" AND " property="id"> <isNotEmpty prepend=" AND " property="id">
A.ID = #id# A.ID = #id#
</isNotEmpty> </isNotEmpty>
<isNotEmpty prepend=" AND " property="childId">
B.ID = #childId#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="productionOrderNo"> <isNotEmpty prepend=" AND " property="productionOrderNo">
A.PRODUCTION_ORDER_NO LIKE CONCAT('%', #productionOrderNo#, '%') A.PRODUCTION_ORDER_NO LIKE CONCAT('%', #productionOrderNo#, '%')
</isNotEmpty> </isNotEmpty>
...@@ -60,15 +63,47 @@ ...@@ -60,15 +63,47 @@
<isNotEmpty prepend=" AND " property="partName"> <isNotEmpty prepend=" AND " property="partName">
A.PART_NAME LIKE CONCAT('%', #partName#, '%') A.PART_NAME LIKE CONCAT('%', #partName#, '%')
</isNotEmpty> </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>
<sql id="customCondition"> <sql id="customCondition">
<isNotEmpty prepend=" AND " property="ids"> <isNotEmpty prepend=" AND " property="ids">
A.ID IN <iterate close=")" open="(" conjunction="," property="statuses">#statuses[]#</iterate> A.ID IN <iterate close=")" open="(" conjunction="," property="statuses">#statuses[]#</iterate>
</isNotEmpty> </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"> <isNotEmpty prepend=" AND " property="statuses">
A.STATUS IN <iterate close=")" open="(" conjunction="," property="statuses">#statuses[]#</iterate> A.STATUS IN <iterate close=")" open="(" conjunction="," property="statuses">#statuses[]#</iterate>
</isNotEmpty> </isNotEmpty>
<isEqual prepend=" AND " property="isComplete" compareValue="0">
B.NUM - B.COMPLETE_NUM &gt; 0
</isEqual>
</sql>
<sql id="order">
<dynamic prepend="ORDER BY">
<isNotEmpty property="order">
$orderBy$
</isNotEmpty>
<isEmpty property="order">
ID ASC
</isEmpty>
</dynamic>
</sql> </sql>
<!-- 选择生产任务 --> <!-- 选择生产任务 -->
...@@ -76,7 +111,18 @@ ...@@ -76,7 +111,18 @@
SELECT SELECT
<include refid="column"/> <include refid="column"/>
FROM HPJX.T_HPSC005 A 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 WHERE 1=1
<include refid="condition"/> <include refid="condition"/>
<include refid="customCondition"/> <include refid="customCondition"/>
......
...@@ -3,6 +3,7 @@ package com.baosight.hpjx.hp.sc.tools; ...@@ -3,6 +3,7 @@ package com.baosight.hpjx.hp.sc.tools;
import com.baosight.hpjx.core.dao.DaoBase; import com.baosight.hpjx.core.dao.DaoBase;
import com.baosight.hpjx.hp.constant.HPSqlConstant; import com.baosight.hpjx.hp.constant.HPSqlConstant;
import com.baosight.hpjx.hp.kc.domain.HPKC001; 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.kc.domain.HPKC010;
import com.baosight.hpjx.hp.pz.domain.HPPZ004; import com.baosight.hpjx.hp.pz.domain.HPPZ004;
import com.baosight.hpjx.hp.sc.domain.HPSC001; import com.baosight.hpjx.hp.sc.domain.HPSC001;
...@@ -11,6 +12,7 @@ import com.baosight.hpjx.hp.sc.domain.HPSC005; ...@@ -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.HPSC005A;
import com.baosight.hpjx.hp.sc.domain.HPSC005B; import com.baosight.hpjx.hp.sc.domain.HPSC005B;
import com.baosight.hpjx.util.AssertUtils; import com.baosight.hpjx.util.AssertUtils;
import com.baosight.hpjx.util.StringUtils;
import com.baosight.iplat4j.core.exception.PlatException; import com.baosight.iplat4j.core.exception.PlatException;
import org.apache.commons.collections.CollectionUtils; import org.apache.commons.collections.CollectionUtils;
...@@ -20,45 +22,47 @@ import java.util.List; ...@@ -20,45 +22,47 @@ import java.util.List;
import java.util.Map; import java.util.Map;
import java.util.stream.Collectors; import java.util.stream.Collectors;
/**
* @author:songx
* @date:2024/2/5,10:15
*/
public class HPSCTools { public class HPSCTools {
/** /**
* 拆单数量校正 * 拆单数量校正
* @param productionOrderNo *
* @param prodOrderNo 生产订单号
* @param assignNum 分派数量
*/ */
public static void checkAssignedNum(String productionOrderNo) { public static void checkAssignedNum(String prodOrderNo, BigDecimal assignNum) {
//生产订单 // 生产订单
HPSC005 HPSC005 = (HPSC005)DaoBase.getInstance().get("HPSC005.getEntity","productionOrderNo",productionOrderNo); HPSC005 dbSc005 = HPSCTools.HpSc005.get(prodOrderNo);
BigDecimal jhNum = HPSC005.getNum(); BigDecimal jhNum = dbSc005.getNum();
//子单 // 子单
Map queryMap = new HashMap(); Map queryMap = new HashMap();
queryMap.put("productionOrderNo", productionOrderNo); queryMap.put("prodOrderNo", prodOrderNo);
List<HPSC005A> hpsc005AList = DaoBase.getInstance().query(HPSC005A.QUERY,queryMap,0, -999999); List<HPSC005A> dbSc005as = DaoBase.getInstance().query(HPSC005A.QUERY, queryMap, 0, -999999);
if (CollectionUtils.isNotEmpty(hpsc005AList)) { BigDecimal totalNum = assignNum;
BigDecimal num = new BigDecimal(0.000); if (CollectionUtils.isNotEmpty(dbSc005as)) {
for(HPSC005A hpsc005A : hpsc005AList) { for (HPSC005A dbSc005a : dbSc005as) {
num = num.add(hpsc005A.getNum()); totalNum = totalNum.add(dbSc005a.getNum());
}
int i = jhNum.compareTo(num);
Map map = new HashMap();
map.put("id",HPSC005.getId());
if (i < 0) {
//子单的数量大于母单
throw new PlatException("拆单的分派数量大于计划数量!");
} else if (i == 0) {
//子单数量跟母单数量一样
map.put("assignedNum",jhNum);
map.put("unassignedNum", new BigDecimal(0.000));
map.put("status","2");
} else {
//子单的数量小于母单
map.put("assignedNum", num);
map.put("unassignedNum", jhNum.subtract(num));
map.put("status", "1");
} }
DaoBase.getInstance().update(HPSqlConstant.HPSC005.UPDATE_ASSIGN_NUM, map);
} }
// 判断重量是否超过订单重量
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 { ...@@ -119,6 +123,36 @@ public class HPSCTools {
public static class HpSc005 { 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 * @param id
...@@ -179,5 +213,142 @@ public class HPSCTools { ...@@ -179,5 +213,142 @@ public class HPSCTools {
return results.stream().collect(Collectors.toMap(HPSC005::getId, item -> item)); 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; ...@@ -15,7 +15,7 @@ import com.baosight.iplat4j.core.util.StringUtils;
* Copyrigth:Baosight Software LTD.co Copyright (c) 2019. <br> * Copyrigth:Baosight Software LTD.co Copyright (c) 2019. <br>
* *
* @version 1.0 * @version 1.0
* @history 2024-02-02 14:09:26 create * @history 2024-02-05 16:53:35 create
*/ */
public class HPZL001 extends DaoEPBase { public class HPZL001 extends DaoEPBase {
...@@ -26,7 +26,8 @@ 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_DEP_CODE = "depCode"; /* 部门编码*/
public static final String FIELD_RECEIPT_DATE = "receiptDate"; /* 单据日期*/ public static final String FIELD_RECEIPT_DATE = "receiptDate"; /* 单据日期*/
public static final String FIELD_CHECK_NO = "checkNo"; /* 检查单号*/ 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_CODE = "projCode"; /* 项目号*/
public static final String FIELD_PROJ_NAME = "projName"; /* 项目名称*/ public static final String FIELD_PROJ_NAME = "projName"; /* 项目名称*/
public static final String FIELD_INVENT_CODE = "inventCode"; /* 部件编码*/ public static final String FIELD_INVENT_CODE = "inventCode"; /* 部件编码*/
...@@ -46,14 +47,15 @@ public class HPZL001 extends DaoEPBase { ...@@ -46,14 +47,15 @@ public class HPZL001 extends DaoEPBase {
public static final String FIELD_UPDATED_BY = "updatedBy"; /* 更新人*/ public static final String FIELD_UPDATED_BY = "updatedBy"; /* 更新人*/
public static final String FIELD_UPDATED_NAME = "updatedName"; /* 更新人名称*/ public static final String FIELD_UPDATED_NAME = "updatedName"; /* 更新人名称*/
public static final String FIELD_UPDATED_TIME = "updatedTime"; /* 更新时间*/ 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_ID = "ID";
public static final String COL_COMPANY_CODE = "COMPANY_CODE"; /* 企业编码 预留*/ public static final String COL_COMPANY_CODE = "COMPANY_CODE"; /* 企业编码 预留*/
public static final String COL_DEP_CODE = "DEP_CODE"; /* 部门编码*/ public static final String COL_DEP_CODE = "DEP_CODE"; /* 部门编码*/
public static final String COL_RECEIPT_DATE = "RECEIPT_DATE"; /* 单据日期*/ public static final String COL_RECEIPT_DATE = "RECEIPT_DATE"; /* 单据日期*/
public static final String COL_CHECK_NO = "CHECK_NO"; /* 检查单号*/ 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_CODE = "PROJ_CODE"; /* 项目号*/
public static final String COL_PROJ_NAME = "PROJ_NAME"; /* 项目名称*/ public static final String COL_PROJ_NAME = "PROJ_NAME"; /* 项目名称*/
public static final String COL_INVENT_CODE = "INVENT_CODE"; /* 部件编码*/ public static final String COL_INVENT_CODE = "INVENT_CODE"; /* 部件编码*/
...@@ -73,7 +75,7 @@ public class HPZL001 extends DaoEPBase { ...@@ -73,7 +75,7 @@ public class HPZL001 extends DaoEPBase {
public static final String COL_UPDATED_BY = "UPDATED_BY"; /* 更新人*/ public static final String COL_UPDATED_BY = "UPDATED_BY"; /* 更新人*/
public static final String COL_UPDATED_NAME = "UPDATED_NAME"; /* 更新人名称*/ public static final String COL_UPDATED_NAME = "UPDATED_NAME"; /* 更新人名称*/
public static final String COL_UPDATED_TIME = "UPDATED_TIME"; /* 更新时间*/ 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 QUERY = "HPZL001.query";
public static final String COUNT = "HPZL001.count"; public static final String COUNT = "HPZL001.count";
...@@ -86,7 +88,8 @@ public class HPZL001 extends DaoEPBase { ...@@ -86,7 +88,8 @@ public class HPZL001 extends DaoEPBase {
private String depCode = " "; /* 部门编码*/ private String depCode = " "; /* 部门编码*/
private String receiptDate = " "; /* 单据日期*/ private String receiptDate = " "; /* 单据日期*/
private String checkNo = " "; /* 检查单号*/ private String checkNo = " "; /* 检查单号*/
private String prodNo = " "; /* 生产任务号*/ private String prodOrderNo = " "; /* 生产订单号*/
private String prodTaskNo = " "; /* 生产任务号*/
private String projCode = " "; /* 项目号*/ private String projCode = " "; /* 项目号*/
private String projName = " "; /* 项目名称*/ private String projName = " "; /* 项目名称*/
private String inventCode = " "; /* 部件编码*/ private String inventCode = " "; /* 部件编码*/
...@@ -106,7 +109,7 @@ public class HPZL001 extends DaoEPBase { ...@@ -106,7 +109,7 @@ public class HPZL001 extends DaoEPBase {
private String updatedBy = " "; /* 更新人*/ private String updatedBy = " "; /* 更新人*/
private String updatedName = " "; /* 更新人名称*/ private String updatedName = " "; /* 更新人名称*/
private String updatedTime = " "; /* 更新时间*/ private String updatedTime = " "; /* 更新时间*/
private Integer deleteFlag; /* 是否删除:1.是,0.否*/ private Integer deleteFlag; /* 是否删除*/
/** /**
* initialize the metadata. * initialize the metadata.
...@@ -135,7 +138,11 @@ public class HPZL001 extends DaoEPBase { ...@@ -135,7 +138,11 @@ public class HPZL001 extends DaoEPBase {
eiColumn.setDescName("检查单号"); eiColumn.setDescName("检查单号");
eiMetadata.addMeta(eiColumn); 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("生产任务号"); eiColumn.setDescName("生产任务号");
eiMetadata.addMeta(eiColumn); eiMetadata.addMeta(eiColumn);
...@@ -216,8 +223,10 @@ public class HPZL001 extends DaoEPBase { ...@@ -216,8 +223,10 @@ public class HPZL001 extends DaoEPBase {
eiMetadata.addMeta(eiColumn); eiMetadata.addMeta(eiColumn);
eiColumn = new EiColumn(FIELD_DELETE_FLAG); eiColumn = new EiColumn(FIELD_DELETE_FLAG);
eiColumn.setDescName("是否删除:1.是,0.否"); eiColumn.setDescName("是否删除");
eiMetadata.addMeta(eiColumn); eiMetadata.addMeta(eiColumn);
} }
/** /**
...@@ -307,16 +316,39 @@ public class HPZL001 extends DaoEPBase { ...@@ -307,16 +316,39 @@ public class HPZL001 extends DaoEPBase {
public void setCheckNo(String checkNo) { public void setCheckNo(String checkNo) {
this.checkNo = checkNo; this.checkNo = checkNo;
} }
/**
public String getProdNo() { * get the prodOrderNo - 生产订单号.
return prodNo; * @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 - 项目号. * get the projCode - 项目号.
* @return the projCode * @return the projCode
*/ */
...@@ -621,7 +653,7 @@ public class HPZL001 extends DaoEPBase { ...@@ -621,7 +653,7 @@ public class HPZL001 extends DaoEPBase {
this.updatedTime = updatedTime; this.updatedTime = updatedTime;
} }
/** /**
* get the deleteFlag - 是否删除:1.是,0.否. * get the deleteFlag - 是否删除.
* @return the deleteFlag * @return the deleteFlag
*/ */
public Integer getDeleteFlag() { public Integer getDeleteFlag() {
...@@ -629,9 +661,9 @@ public class HPZL001 extends DaoEPBase { ...@@ -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) { public void setDeleteFlag(Integer deleteFlag) {
this.deleteFlag = deleteFlag; this.deleteFlag = deleteFlag;
...@@ -649,7 +681,8 @@ public class HPZL001 extends DaoEPBase { ...@@ -649,7 +681,8 @@ public class HPZL001 extends DaoEPBase {
setDepCode(StringUtils.defaultIfEmpty(StringUtils.toString(map.get(FIELD_DEP_CODE)), depCode)); setDepCode(StringUtils.defaultIfEmpty(StringUtils.toString(map.get(FIELD_DEP_CODE)), depCode));
setReceiptDate(StringUtils.defaultIfEmpty(StringUtils.toString(map.get(FIELD_RECEIPT_DATE)), receiptDate)); setReceiptDate(StringUtils.defaultIfEmpty(StringUtils.toString(map.get(FIELD_RECEIPT_DATE)), receiptDate));
setCheckNo(StringUtils.defaultIfEmpty(StringUtils.toString(map.get(FIELD_CHECK_NO)), checkNo)); 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)); setProjCode(StringUtils.defaultIfEmpty(StringUtils.toString(map.get(FIELD_PROJ_CODE)), projCode));
setProjName(StringUtils.defaultIfEmpty(StringUtils.toString(map.get(FIELD_PROJ_NAME)), projName)); setProjName(StringUtils.defaultIfEmpty(StringUtils.toString(map.get(FIELD_PROJ_NAME)), projName));
setInventCode(StringUtils.defaultIfEmpty(StringUtils.toString(map.get(FIELD_INVENT_CODE)), inventCode)); setInventCode(StringUtils.defaultIfEmpty(StringUtils.toString(map.get(FIELD_INVENT_CODE)), inventCode));
...@@ -684,7 +717,8 @@ public class HPZL001 extends DaoEPBase { ...@@ -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_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_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_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_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_PROJ_NAME, StringUtils.toString(projName, eiMetadata.getMeta(FIELD_PROJ_NAME)));
map.put(FIELD_INVENT_CODE, StringUtils.toString(inventCode, eiMetadata.getMeta(FIELD_INVENT_CODE))); map.put(FIELD_INVENT_CODE, StringUtils.toString(inventCode, eiMetadata.getMeta(FIELD_INVENT_CODE)));
......
package com.baosight.hpjx.hp.zl.service; 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.constant.CommonConstant;
import com.baosight.hpjx.core.dao.DaoUtils; import com.baosight.hpjx.core.dao.DaoUtils;
import com.baosight.hpjx.hp.constant.HPConstant; 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.HPKC004;
import com.baosight.hpjx.hp.kc.domain.HPKC011; import com.baosight.hpjx.hp.kc.domain.HPKC011;
import com.baosight.hpjx.hp.kc.tools.HPKCTools; import com.baosight.hpjx.hp.kc.tools.HPKCTools;
...@@ -79,35 +81,49 @@ public class ServiceHPZL001B extends ServiceEPBase { ...@@ -79,35 +81,49 @@ public class ServiceHPZL001B extends ServiceEPBase {
public EiInfo select(EiInfo inInfo) { public EiInfo select(EiInfo inInfo) {
try { try {
List<Map> resultRows = inInfo.getBlock(EiConstant.resultBlock).getRows(); 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) { for (Map row : resultRows) {
HPSC005B fSc005b = new HPSC005B(); HPSC005B fSc005b = new HPSC005B();
fSc005b.fromMap(row); fSc005b.fromMap(row);
HPSC005B dbSc005b = HPSCTools.HpSc005.getById(fSc005b.getId(), fSc005b.getChildId()); HPSC005B dbSc005b = dbSc005bMap.get(fSc005b.getProdTaskNo());
AssertUtils.isTrue(dbSc005b.getStatus() != 1 && dbSc005b.getStatus() != 2, AssertUtils.isTrue(ProdOrderStatusEnum.NOT_ASSIGN.getCode().equals(dbSc005b.getStatus()),
String.format("生产任务ID[%s]状态不是已分派,不允许操作", fSc005b.getId())); String.format("生产任务ID[%s]状态不是已分派,不允许操作", fSc005b.getId()));
dbSc005bMap.put(dbSc005b.getId() + "@#@" + dbSc005b.getChildId(), dbSc005b);
} }
// 生成巡检单 // 生成巡检单
for (Map row : resultRows) { for (Map row : resultRows) {
Integer poorType = MapUtils.getInteger(row, "poorType");
String problemDesc = MapUtils.getString(row, "problemDesc");
HPSC005B fSc005b = new HPSC005B(); HPSC005B fSc005b = new HPSC005B();
fSc005b.fromMap(row); 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.setCheckNo(SequenceGenerator.getNextSequence(HPConstant.SequenceId.HPZL001_NUMBER));
newZl001.setReceiptDate(DateUtils.shortDate()); newZl001.setReceiptDate(DateUtils.shortDate());
newZl001.setStatus(CommonConstant.YesNo.NO_0); newZl001.setStatus(CommonConstant.YesNo.NO_0);
newZl001.setInventCode(dbSc005.getPrdtCode()); newZl001.setInventCode(dbSc005b.getPrdtCode());
newZl001.setInventName(dbSc005.getPrdtName()); newZl001.setInventName(dbSc005b.getPrdtName());
newZl001.setSubInventCode(dbSc005.getPartCode()); newZl001.setSubInventCode(dbSc005b.getPartCode());
newZl001.setSubInventName(dbSc005.getPartName()); newZl001.setSubInventName(dbSc005b.getPartName());
newZl001.setProdNo(dbSc005.getProductionOrderNo()); newZl001.setPoorType(poorType);
newZl001.setProblemDesc(problemDesc);
newZl001.setProdOrderNo(dbSc005b.getProdOrderNo());
newZl001.setProdTaskNo(dbSc005b.getProdTaskNo());
newZl001.setDeleteFlag(CommonConstant.YesNo.NO_0); newZl001.setDeleteFlag(CommonConstant.YesNo.NO_0);
DaoUtils.insert(HPZL001.INSERT, newZl001); DaoUtils.insert(HPZL001.INSERT, newZl001);
} }
} catch (Exception e) { } catch (Exception e) {
LogUtils.setDetailMsg(inInfo, e, "生成出库单失败"); LogUtils.setDetailMsg(inInfo, e, "生成巡检单失败");
} }
return inInfo; return inInfo;
} }
......
...@@ -8,7 +8,8 @@ ...@@ -8,7 +8,8 @@
DEP_CODE as "depCode", <!-- 部门编码 --> DEP_CODE as "depCode", <!-- 部门编码 -->
RECEIPT_DATE as "receiptDate", <!-- 单据日期 --> RECEIPT_DATE as "receiptDate", <!-- 单据日期 -->
CHECK_NO as "checkNo", <!-- 检查单号 --> CHECK_NO as "checkNo", <!-- 检查单号 -->
PROD_NO as "prodNo", <!-- 生产任务号 --> PROD_ORDER_NO as "prodOrderNo", <!-- 生产订单号 -->
PROD_TASK_NO as "prodTaskNo", <!-- 生产任务号 -->
PROJ_CODE as "projCode", <!-- 项目号 --> PROJ_CODE as "projCode", <!-- 项目号 -->
PROJ_NAME as "projName", <!-- 项目名称 --> PROJ_NAME as "projName", <!-- 项目名称 -->
INVENT_CODE as "inventCode", <!-- 部件编码 --> INVENT_CODE as "inventCode", <!-- 部件编码 -->
...@@ -27,7 +28,8 @@ ...@@ -27,7 +28,8 @@
CREATED_TIME as "createdTime", <!-- 创建时间 --> CREATED_TIME as "createdTime", <!-- 创建时间 -->
UPDATED_BY as "updatedBy", <!-- 更新人 --> UPDATED_BY as "updatedBy", <!-- 更新人 -->
UPDATED_NAME as "updatedName", <!-- 更新人名称 --> UPDATED_NAME as "updatedName", <!-- 更新人名称 -->
UPDATED_TIME as "updatedTime" <!-- 更新时间 --> UPDATED_TIME as "updatedTime", <!-- 更新时间 -->
DELETE_FLAG as "deleteFlag" <!-- 是否删除 -->
</sql> </sql>
<sql id="condition"> <sql id="condition">
...@@ -47,8 +49,11 @@ ...@@ -47,8 +49,11 @@
<isNotEmpty prepend=" AND " property="checkNo"> <isNotEmpty prepend=" AND " property="checkNo">
CHECK_NO = #checkNo# CHECK_NO = #checkNo#
</isNotEmpty> </isNotEmpty>
<isNotEmpty prepend=" AND " property="prodNo"> <isNotEmpty prepend=" AND " property="prodOrderNo">
PROD_NO = #prodNo# PROD_ORDER_NO = #prodOrderNo#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="prodTaskNo">
PROD_TASK_NO = #prodTaskNo#
</isNotEmpty> </isNotEmpty>
<isNotEmpty prepend=" AND " property="projCode"> <isNotEmpty prepend=" AND " property="projCode">
PROJ_CODE = #projCode# PROJ_CODE = #projCode#
...@@ -125,7 +130,8 @@ ...@@ -125,7 +130,8 @@
DEP_CODE, <!-- 部门编码 --> DEP_CODE, <!-- 部门编码 -->
RECEIPT_DATE, <!-- 单据日期 --> RECEIPT_DATE, <!-- 单据日期 -->
CHECK_NO, <!-- 检查单号 --> CHECK_NO, <!-- 检查单号 -->
PROD_NO, <!-- 生产任务号 --> PROD_ORDER_NO, <!-- 生产订单号 -->
PROD_TASK_NO, <!-- 生产任务号 -->
PROJ_CODE, <!-- 项目号 --> PROJ_CODE, <!-- 项目号 -->
PROJ_NAME, <!-- 项目名称 --> PROJ_NAME, <!-- 项目名称 -->
INVENT_CODE, <!-- 部件编码 --> INVENT_CODE, <!-- 部件编码 -->
...@@ -136,19 +142,16 @@ ...@@ -136,19 +142,16 @@
ORG_NAME, <!-- 生产组名称 --> ORG_NAME, <!-- 生产组名称 -->
POOR_TYPE, <!-- 不良品类 --> POOR_TYPE, <!-- 不良品类 -->
PROBLEM_DESC, <!-- 质量问题描述 --> PROBLEM_DESC, <!-- 质量问题描述 -->
CHECK_USER, <!-- 检查人 -->
CHECK_USER_NAME, <!-- 检查人名称 -->
STATUS, <!-- 单据状态 0未处理 1已处理 --> STATUS, <!-- 单据状态 0未处理 1已处理 -->
CREATED_BY, <!-- 创建人 --> CREATED_BY, <!-- 创建人 -->
CREATED_NAME, <!-- 创建人名称 --> CREATED_NAME, <!-- 创建人名称 -->
CREATED_TIME, <!-- 创建时间 --> CREATED_TIME, <!-- 创建时间 -->
DELETE_FLAG DELETE_FLAG <!-- 是否删除 -->
) VALUES ( ) VALUES (
#companyCode#, #depCode#, #receiptDate#, #checkNo#, #prodNo#, #projCode#, #projName#, #companyCode#, #depCode#, #receiptDate#, #checkNo#, #prodOrderNo#, #prodTaskNo#,
#inventCode#, #inventName#, #subInventCode#, #subInventName#, #orgNo#, #orgName#, #projCode#, #projName#, #inventCode#, #inventName#, #subInventCode#, #subInventName#,
#poorType#, #problemDesc#, #checkUser#, #checkUserName#, #status#, #createdBy#, #orgNo#, #orgName#, #poorType#, #problemDesc#, #status#,
#createdName#, #createdTime#, #deleteFlag# #createdBy#, #createdName#, #createdTime#, #deleteFlag#)
)
</insert> </insert>
<!-- 逻辑删除--> <!-- 逻辑删除-->
......
package com.baosight.hpjx.util; package com.baosight.hpjx.util;
import org.apache.commons.collections.MapUtils;
import org.apache.commons.lang.StringUtils;
import org.apache.poi.ss.formula.functions.T;
import java.util.List; import java.util.List;
import java.util.Map; import java.util.Map;
import java.util.stream.Collectors; import java.util.stream.Collectors;
...@@ -94,6 +90,19 @@ public class ObjectUtils extends org.apache.commons.lang.ObjectUtils { ...@@ -94,6 +90,19 @@ public class ObjectUtils extends org.apache.commons.lang.ObjectUtils {
} }
/** /**
* 检查object是empty或null
*
* @param object
* @return
*/
public static boolean isNotBlank(Object object) {
if (object == null) {
return true;
}
return StringUtils.isNotBlank(object.toString());
}
/**
* 从集合MAP中取KEY * 从集合MAP中取KEY
* *
* @param items * @param items
...@@ -101,7 +110,8 @@ public class ObjectUtils extends org.apache.commons.lang.ObjectUtils { ...@@ -101,7 +110,8 @@ public class ObjectUtils extends org.apache.commons.lang.ObjectUtils {
* @return * @return
*/ */
public static <T> List<T> listKey(List<Map> items, String keyName) { public static <T> List<T> listKey(List<Map> items, String keyName) {
return items.stream().map(item -> (T) item.get(keyName)).collect(Collectors.toList()); return items.stream().map(item -> (T) item.get(keyName)).filter(ObjectUtils::isNotBlank).distinct()
.collect(Collectors.toList());
} }
} }
$(function () { $(function () {
$(document).ready(function() {
$("#inqu_status-0-date").data("kendoDatePicker").value(new Date());
});
//$("#inqu_status-date").data("kendoDatePicker").value(new Date());
//$(element) .data("kendoDatePicker").value(Date)
$("#QUERY").click();
/* $("#QUERY").on("click", function () { /* $("#QUERY").on("click", function () {
resultGrid.dataSource.page(1); resultGrid.dataSource.page(1);
buildOption("scrb"); buildOption("scrb");
...@@ -21,6 +26,7 @@ $(function () { ...@@ -21,6 +26,7 @@ $(function () {
$('#mrsj').append(str); $('#mrsj').append(str);
}) })
buildOption("scrb"); buildOption("scrb");
resultGrid.dataSource.page(1);
}, },
// 服务调用失败后的回调函数 onFail // 服务调用失败后的回调函数 onFail
onFail: function(errorMsg, status, e) { onFail: function(errorMsg, status, e) {
...@@ -28,8 +34,8 @@ $(function () { ...@@ -28,8 +34,8 @@ $(function () {
console.log(errorMsg) console.log(errorMsg)
} }
}, {async: true}); }, {async: true});
resultGrid.dataSource.page(1); //resultGrid.dataSource.page(1);
buildOption("scrb"); //buildOption("scrb");
}); });
// 导出 // 导出
$("#EXPORT").on("click", function () { $("#EXPORT").on("click", function () {
...@@ -39,30 +45,7 @@ $(function () { ...@@ -39,30 +45,7 @@ $(function () {
$(".k-menu-link").click(); $(".k-menu-link").click();
}); });
IPLATUI.EFGrid.result = {
pageable: {
pageSize: 20,
pageSizes: [10, 20, 50, 70, 100],
},
columns: [
{
field: "operator",
template: function (item) {
let auditStatus = item.status;
let template = '';
if (auditStatus == 0) {
template += '<a style="cursor: pointer;display: inline-flex;justify-content: center;" ' +
'onclick="check(' + item.id + ',1)" >提交</a>';
}
// else if (auditStatus == 1) {
// template += '<a style="cursor: pointer;display: inline-flex;justify-content: center;" ' +
// 'onclick="check(' + item.id + ',0)" >撤回</a>';
// }
return template;
}
}
],
}
}); });
function check(id, auditStatus) { function check(id, auditStatus) {
...@@ -89,7 +72,8 @@ function buildOption(vid){ ...@@ -89,7 +72,8 @@ function buildOption(vid){
var colors = ['#5470C6', '#91CC75', '#EE6666']; var colors = ['#5470C6', '#91CC75', '#EE6666'];
var option = { var option = {
title: { title: {
text: '柱状图与折线图' text: '生产月报',
left: 'center'
}, },
tooltip: { tooltip: {
trigger: 'axis', trigger: 'axis',
...@@ -106,7 +90,7 @@ function buildOption(vid){ ...@@ -106,7 +90,7 @@ function buildOption(vid){
xAxis: { xAxis: {
type: 'category', type: 'category',
//boundaryGap: false, //boundaryGap: false,
data: ['Mon', 'Tue', 'Wed', 'Thu', 'Fri', 'Sat', 'Sun'] data: ['1月', '2月', '3月', '4月', '5月', '6月', '7月', '8月', '9月', '10月', '11月', '12月']
}, },
yAxis: [ yAxis: [
{ {
...@@ -127,7 +111,7 @@ function buildOption(vid){ ...@@ -127,7 +111,7 @@ function buildOption(vid){
color: '#4874CB', color: '#4874CB',
yAxisIndex: 0, yAxisIndex: 0,
barWidth: 15, barWidth: 15,
data: [120, 200, 150, 80, 70, 110, 130] data: [120, 200, 150, 80, 70, 110, 130,120, 200, 150, 80, 70]
}, },
{ {
name: '生产人数(吨)', name: '生产人数(吨)',
...@@ -135,14 +119,14 @@ function buildOption(vid){ ...@@ -135,14 +119,14 @@ function buildOption(vid){
color: '#EE822F', color: '#EE822F',
yAxisIndex: 0, yAxisIndex: 0,
barWidth: 15, barWidth: 15,
data: [130, 120, 200, 160, 80, 70, 140] data: [130, 120, 200, 160, 80, 70, 140,130, 120, 200, 160, 80]
}, },
{ {
name: '人均产量(kg)', name: '人均产量(kg)',
type: 'line', type: 'line',
color:'#F2BA03', color:'#F2BA03',
yAxisIndex: 1, // 指定该系列在y轴上的位置,默认是0,可选为:0 | 1 | 2 | ... | n (正整数) yAxisIndex: 1, // 指定该系列在y轴上的位置,默认是0,可选为:0 | 1 | 2 | ... | n (正整数)
data: [130, 120, 200, 160, 80, 70, 140] data: [130, 120, 200, 160, 80, 70, 140,130, 120, 200, 160, 80]
} }
] ]
}; };
......
...@@ -13,11 +13,20 @@ ...@@ -13,11 +13,20 @@
<EF:EFRegion id="inqu" title="查询条件"> <EF:EFRegion id="inqu" title="查询条件">
<div class="row"> <div class="row">
<EF:EFSelect cname="工厂" defaultValue="0" ename="inqu_status-0-factory" colWidth="3"> <%-- <EF:EFSelect cname="工厂" defaultValue="0" ename="inqu_status-0-factory" colWidth="3">
<EF:EFOption label="黄陂" value="黄陂"/> <EF:EFOption label="黄陂" value="黄陂"/>
<EF:EFOption label="红安" value="红安"/> <EF:EFOption label="红安" value="红安"/>
</EF:EFSelect>--%>
<EF:EFSelect cname="工厂" ename="inqu_status-0-factory" colWidth="3" filter="contains">
<%--<EF:EFOption label="全部" value=""/>--%>
<EF:EFOptions blockId="factory_record_block_id" textField="textField" valueField="valueField"/>
</EF:EFSelect> </EF:EFSelect>
<EF:EFDatePicker ename="inqu_status-date" colWidth="3" cname="日期:" <%-- <EF:EFSelect cname="仓库名称" ename="inqu_status-0-whCode" colWidth="3" filter="contains">
<EF:EFOption label="全部" value=""/>
<EF:EFOptions blockId="wh_record_block_id" textField="textField" valueField="valueField"/>
</EF:EFSelect>--%>
<EF:EFDatePicker ename="inqu_status-0-date" colWidth="3" cname="日期:"
format="yyyy-MM-dd"/> format="yyyy-MM-dd"/>
</div> </div>
<%-- <EF:EFButton ename="QUERY" cname="查询" row="1" class="btn-align-right"></EF:EFButton>--%> <%-- <EF:EFButton ename="QUERY" cname="查询" row="1" class="btn-align-right"></EF:EFButton>--%>
...@@ -32,7 +41,7 @@ ...@@ -32,7 +41,7 @@
<EF:EFRegion id="result" title="汇总数据"> <EF:EFRegion id="result" title="汇总数据">
<EF:EFGrid blockId="result" autoDraw="no"> <EF:EFGrid blockId="result" autoDraw="no">
<EF:EFColumn ename="id" cname="主键" hidden="true"/> <%-- <EF:EFColumn ename="id" cname="主键" hidden="true"/>--%>
<EF:EFColumn ename="indNmae" cname="指标名称" readonly="true"/> <EF:EFColumn ename="indNmae" cname="指标名称" readonly="true"/>
<EF:EFColumn ename="dayValue" cname="日" readonly="true"/> <EF:EFColumn ename="dayValue" cname="日" readonly="true"/>
<EF:EFColumn ename="monValue" cname="月" readonly="true"/> <EF:EFColumn ename="monValue" cname="月" readonly="true"/>
......
let inventNameGlobalData = [];
let whNameGlobalData = [];
$(function () { $(function () {
// 查询
$("#QUERY").on("click", query); $("#QUERY").on("click", query);
// 选择生产任务
$("#GENERATE").on("click", generate); $("#GENERATE").on("click", generate);
IPLATUI.EFGrid.result = { IPLATUI.EFGrid.result = {
...@@ -12,29 +11,8 @@ $(function () { ...@@ -12,29 +11,8 @@ $(function () {
pageSize: 20, pageSize: 20,
pageSizes: [10, 20, 30, 50, 100, 200], pageSizes: [10, 20, 30, 50, 100, 200],
}, },
columns: [{ 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);
}
}],
loadComplete: function (grid) { loadComplete: function (grid) {
// 此grid对象
} }
} }
...@@ -44,25 +22,6 @@ $(function () { ...@@ -44,25 +22,6 @@ $(function () {
* 页面加载时执行 * 页面加载时执行
*/ */
$(window).load(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(); query();
}); });
...@@ -72,58 +31,26 @@ $(window).load(function () { ...@@ -72,58 +31,26 @@ $(window).load(function () {
let query = function () { let query = function () {
resultGrid.dataSource.page(1); resultGrid.dataSource.page(1);
} }
/** /**
* 选择生产订单 * 选择生产任务
*/ */
let generate = function () { let generate = function () {
JSColorbox.open({ JSColorbox.open({
href: "HPKC099?methodName=initLoad", href: "HPKC003A?methodName=initLoad",
title: "<div style='text-align: center;'>生产订单查询</div>", title: "<div style='text-align: center;'>生产任务查询</div>",
width: "80%", width: "80%",
height: "80%", height: "80%",
callbackName: productionOrderQueryCallback callbackName: generateCallback
}); });
} }
/** /**
* 生产订单回调方法 * 挑选库存回调
*
* @param rowDatas
* @param win
*/ */
let productionOrderQueryCallback = function (row) { let generateCallback = function () {
console.log(row) // 刷新页面
var lists = [];// new Array(); query();
// 增加一个元素
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);
// 关闭弹窗 // 关闭弹窗
JSColorbox.close(); JSColorbox.close();
} }
......
...@@ -8,75 +8,55 @@ ...@@ -8,75 +8,55 @@
<EF:EFPage title="生产入库单"> <EF:EFPage title="生产入库单">
<EF:EFRegion id="inqu" title="查询条件"> <EF:EFRegion id="inqu" title="查询条件">
<div class="row"> <div class="row">
<EF:EFDatePicker cname="单据日期" ename="documentDate" blockId="inqu_status" row="0" colWidth="3"
<EF:EFInput ename="inqu_status-0-productionOrderNo" cname="生产订单号" colWidth="3"/> format="yyyy-MM-dd" readonly="true"/>
<EF:EFInput ename="inqu_status-0-prodNo" cname="生产入库单号" colWidth="3"/> <EF:EFInput cname="入库单号" ename="prodNo" blockId="inqu_status" row="0" colWidth="3"/>
<EF:EFDatePicker ename="inqu_status-0-documentDate" cname="单据日期" colWidth="3" format="yyyy-MM-dd" <EF:EFInput cname="项目名称" ename="projName" blockId="inqu_status" row="0" colWidth="3"/>
/> <EF:EFSelect cname="仓库名称" ename="whCode" blockId="inqu_status" row="0" colWidth="3"
<EF:EFSelect cname="存货类型" ename="inqu_status-0-inventType" colWidth="3" filter="contains"> filter="contains" defultValue="">
<EF:EFOption label="全部" value=""/> <EF:EFOption label="全部" value=""/>
<EF:EFCodeOption codeName="hpjx.hpkc.inventType"/> <EF:EFOptions blockId="wh_record_block_id" textField="textField" valueField="valueField"/>
</EF:EFSelect> </EF:EFSelect>
</div> </div>
<div class="row"> <div class="row">
<EF:EFSelect cname="仓库名称" ename="inqu_status-0-whCode" colWidth="3" filter="contains" defultValue=""> <EF:EFInput cname="部件名称" ename="prdtName" blockId="inqu_status" row="0" colWidth="3"/>
<EF:EFOption label="全部" value=""/> <EF:EFInput cname="零部件名称" ename="partName" blockId="inqu_status" row="0" colWidth="3"/>
<EF:EFOptions blockId="wh_record_block_id" textField="textField" valueField="valueField"/> <EF:EFInput cname="生产订单号" ename="prodOrderNo" blockId="inqu_status" row="0" colWidth="3"/>
</EF:EFSelect> <EF:EFInput cname="生产任务号" ename="prodTaskNo" blockId="inqu_status" row="0" colWidth="3"/>
<EF:EFSelect cname="存货名称" ename="inqu_status-0-inventCode" colWidth="3" filter="contains" defultValue=""> </div>
<div class="row">
<EF:EFSelect cname="是否删除" ename="deleteFlag" blockId="inqu_status" row="0" colWidth="3" defaultValue="0">
<EF:EFOption label="全部" value=""/> <EF:EFOption label="全部" value=""/>
<EF:EFOptions blockId="invent_name_block_id" textField="textField" valueField="valueField"/> <EF:EFCodeOption codeName="hpjx.hpjx.deleteFlag"/>
</EF:EFSelect> </EF:EFSelect>
<%-- <EF:EFSelect cname="是否删除" ename="inqu_status-0-deleteFlag" colWidth="3" defaultValue="0">--%> <EF:EFDateSpan startCname="创建日期(从)" endCname="至" blockId="inqu_status"
<%-- <EF:EFOption label="全部" value=""/>--%> startName="createdDateFrom" endName="createdDateTo" row="0" role="date"
<%-- <EF:EFCodeOption codeName="hpjx.hpjx.deleteFlag"/>--%> format="yyyy-MM-dd" ratio="3:3" satrtRatio="4:8" endRatio="4:8" readonly="true">
<%-- </EF:EFSelect>--%> </EF:EFDateSpan>
<%-- <EF:EFDateSpan startCname="创建日期(从)" endCname="至" blockId="inqu_status"--%>
<%-- startName="createdDateFrom" endName="createdDateTo" row="0" role="date"--%>
<%-- format="yyyy-MM-dd" ratio="3:3" satrtRatio="4:8" endRatio="4:8" readonly="true">--%>
<%-- </EF:EFDateSpan>--%>
</div> </div>
</EF:EFRegion> </EF:EFRegion>
<EF:EFRegion id="result" title="明细信息"> <EF:EFRegion id="result" title="明细信息">
<EF:EFGrid blockId="result" autoDraw="override" isFloat="true" checkMode="row"> <EF:EFGrid blockId="result" autoDraw="override" isFloat="true" checkMode="row">
<EF:EFColumn ename="id" cname="内码" hidden="true"/> <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" <EF:EFColumn ename="documentDate" cname="单据日期" width="100" align="center" editType="date" readonly="true"
dateFormat="yyyy-MM-dd" parseFormats="['yyyyMMdd']" required="true"/> dateFormat="yyyy-MM-dd" parseFormats="['yyyyMMdd']" required="true"/>
<EF:EFColumn ename="whCode" cname="仓库名称" width="120" align="center" required="true" readonly="true"/> <EF:EFColumn ename="projCode" cname="项目号" enable="false" width="140" align="center"/>
<EF:EFColumn cname="数量" ename="amount" width="100" align="right" format="{0:N3}" <EF:EFColumn ename="projName" cname="项目名称" enable="false" width="140" align="center"/>
sumType="all" readonly="true"/> <EF:EFComboColumn ename="whCode" cname="仓库编码" enable="false" width="120" align="center"
<EF:EFColumn cname="重量" ename="weight" width="100" align="right" format="{0:N3}" blockName="wh_record_block_id" textField="textField" valueField="valueField"
sumType="all" readonly="true"/> columnTemplate="#=textField#" itemTemplate="#=textField#">
<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:EFComboColumn> </EF:EFComboColumn>
<EF:EFColumn enable="false" ename="partCode" cname="零件编码" align="center"/> <EF:EFColumn ename="prdtName" cname="部件名称" enable="false" width="120" align="center"/>
<EF:EFColumn enable="false" ename="partName" cname="零件名称" align="center"/> <EF:EFColumn ename="partName" cname="零部件名称" enable="false" width="120" align="center"/>
<EF:EFColumn enable="false" ename="partSpec" cname="零件规格" align="center"/> <EF:EFColumn ename="partSpec" cname="零部件规格" enable="false" width="150" align="center"/>
<EF:EFColumn hidden="true" enable="false" ename="partLength" cname="零件-长"/> <EF:EFColumn ename="amount" cname="数量" enable="false" width="120" align="right" format="{0:N3}"/>
<EF:EFColumn hidden="true" enable="false" ename="partWidth" cname="零件-宽"/> <EF:EFColumn ename="weight" cname="重量" enable="false" width="120" align="right" format="{0:N3}"/>
<EF:EFColumn hidden="true" enable="false" ename="partThick" cname="零件-厚"/> <EF:EFColumn ename="remark" cname="备注" enable="false" width="150"/>
<EF:EFColumn enable="false" ename="remark1" cname="零件备注"/> <EF:EFColumn ename="prdtCode" cname="部件编码" enable="false" width="120" align="center" hidden="true"/>
<EF:EFColumn cname="原生产单号" ename="prodNoOld" enable="false" width="140" align="center" hidden="true"/> <EF:EFColumn ename="partCode" cname="零部件编码" enable="false" width="120" align="center" hidden="true"/>
<EF:EFColumn cname="创建人名称" ename="createdName" enable="false" width="120" align="center"/> <EF:EFColumn ename="prodTaskNo" cname="生产任务号" enable="false" width="150" align="center"/>
<EF:EFColumn cname="创建时间" ename="createdTime" enable="false" width="140" align="center" <EF:EFColumn ename="prodOrderNo" cname="生产订单号" enable="false" width="140" align="center"/>
editType="datetime" parseFormats="['yyyyMMddHHmmss','yyyy-MM-dd HH:mm:ss']"/>
</EF:EFGrid> </EF:EFGrid>
</EF:EFRegion> </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"/>
<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>
</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="150" align="center"/>
<EF:EFColumn ename="prodOrderNo" cname="生产订单号" enable="false" width="140" align="center"/>
</EF:EFGrid>
</EF:EFRegion>
</EF:EFPage>
...@@ -10,7 +10,7 @@ ...@@ -10,7 +10,7 @@
<div class="row"> <div class="row">
<EF:EFInput blockId="inqu_status" ename="projCode" colWidth="3" cname="项目编号:" /> <EF:EFInput blockId="inqu_status" ename="projCode" colWidth="3" cname="项目编号:" />
<EF:EFInput blockId="inqu_status" ename="projName" colWidth="3" cname="项目名称:" /> <EF:EFInput blockId="inqu_status" ename="projName" colWidth="3" cname="项目名称:" />
<EF:EFInput blockId="inqu_status" ename="prodNo" colWidth="3" cname="生产单号:" /> <%-- <EF:EFInput blockId="inqu_status" ename="prodNo" colWidth="3" cname="生产单号:" />--%>
<EF:EFSelect ename="inqu_status-0-whCode" cname="仓库名称" colWidth="3" filter="contains" defultValue=""> <EF:EFSelect ename="inqu_status-0-whCode" cname="仓库名称" colWidth="3" filter="contains" defultValue="">
<EF:EFOption label="全部" value=""/> <EF:EFOption label="全部" value=""/>
<EF:EFOptions blockId="wh_record_block_id" textField="textField" valueField="valueField"/> <EF:EFOptions blockId="wh_record_block_id" textField="textField" valueField="valueField"/>
...@@ -31,8 +31,8 @@ ...@@ -31,8 +31,8 @@
<EF:EFRegion id="result" title="明细信息"> <EF:EFRegion id="result" title="明细信息">
<EF:EFGrid blockId="result" autoDraw="override" isFloat="true" checkMode="row"> <EF:EFGrid blockId="result" autoDraw="override" isFloat="true" checkMode="row">
<EF:EFColumn ename="id" cname="内码" hidden="true"/> <EF:EFColumn ename="id" cname="内码" hidden="true"/>
<EF:EFColumn ename="prodNo" cname="生产单号" width="120" align="center" required="true" enable="false"/> <%-- <EF:EFColumn ename="prodNo" cname="生产单号" width="120" align="center" required="true" enable="false"/>--%>
<EF:EFComboColumn ename="whCode" cname="仓库编码" width="120" columnTemplate="#=textField#" <EF:EFComboColumn ename="whCode" cname="仓库名称" width="120" columnTemplate="#=textField#"
itemTemplate="#=textField#" blockName="wh_record_block_id" itemTemplate="#=textField#" blockName="wh_record_block_id"
textField="textField" valueField="valueField" textField="textField" valueField="valueField"
align="center" filter="contains" required="true" enable="false"> align="center" filter="contains" required="true" enable="false">
...@@ -43,7 +43,7 @@ ...@@ -43,7 +43,7 @@
<EF:EFColumn ename="subInventCode" cname="零部件名称" width="120" align="center" required="true" enable="false"/> <EF:EFColumn ename="subInventCode" cname="零部件名称" width="120" align="center" required="true" enable="false"/>
<EF:EFColumn ename="length" cname="长" format="{0:N3}" maxLength="20" width="90" align="right" enable="false"/> <EF:EFColumn ename="length" cname="长" format="{0:N3}" maxLength="20" width="90" align="right" enable="false"/>
<EF:EFColumn ename="width" cname="宽" format="{0:N3}" maxLength="20" width="90" align="right" enable="false"/> <EF:EFColumn ename="width" cname="宽" format="{0:N3}" maxLength="20" width="90" align="right" enable="false"/>
<EF:EFColumn ename="thich" cname="厚" format="{0:N3}" maxLength="20" width="90" align="right" enable="false"/> <EF:EFColumn ename="thick" cname="厚" format="{0:N3}" maxLength="20" width="90" align="right" enable="false"/>
<EF:EFColumn ename="amount" cname="数量" format="{0:N3}" maxLength="20" width="90" align="right" required="true" enable="false"/> <EF:EFColumn ename="amount" cname="数量" format="{0:N3}" maxLength="20" width="90" align="right" required="true" enable="false"/>
<EF:EFColumn ename="unitWeight" cname="单重" format="{0:N3}" maxLength="20" width="90" align="right" enable="false"/> <EF:EFColumn ename="unitWeight" cname="单重" format="{0:N3}" maxLength="20" width="90" align="right" enable="false"/>
<EF:EFColumn ename="weight" cname="重量" format="{0:N3}" maxLength="20" width="90" align="right" enable="false"/> <EF:EFColumn ename="weight" cname="重量" format="{0:N3}" maxLength="20" width="90" align="right" enable="false"/>
......
...@@ -418,7 +418,7 @@ function openUploadFile(id) { ...@@ -418,7 +418,7 @@ function openUploadFile(id) {
*/ */
function showUploadFile(id) { function showUploadFile(id) {
JSColorbox.open({ JSColorbox.open({
href: "HPSC002A?methodName=initLoad&inqu_status-0-id=" + id, href: "HPSC002A?methodName=initLoad&inqu_status-0-bizType=WL&inqu_status-0-id=" + id,
title: "<div style='text-align: center;'>附件清单</div>", title: "<div style='text-align: center;'>附件清单</div>",
width: "80%", width: "80%",
height: "80%", height: "80%",
......
...@@ -184,7 +184,7 @@ $(function () { ...@@ -184,7 +184,7 @@ $(function () {
function showUploadFile(id) { function showUploadFile(id) {
JSColorbox.open({ JSColorbox.open({
href: "HPSC002B?methodName=initLoad&inqu_status-0-id=" + id, href: "HPSC002B?methodName=initLoad&inqu_status-0-bizType=WL&inqu_status-0-id=" + id,
title: "<div style='text-align: center;'>附件清单</div>", title: "<div style='text-align: center;'>附件清单</div>",
width: "80%", width: "80%",
height: "80%", height: "80%",
......
let ids = []; let ids = [];
$(function () { $(function () {
$("#QUERY").on("click", function () { // 查询
resultGrid.dataSource.page(1); $("#QUERY").on("click", query);
});
$("#TEAR_ASSIGN").on("click", function () {
//重置全局变量
let productionOrderNo;
let rows = resultGrid.getCheckedRows()
if (rows.length != 1) {
message("只能选择一条需要拆单分派的数据");
return;
}
productionOrderNo = rows[0].productionOrderNo
JSColorbox.open({
href: "HPSC005A?methodName=initLoad&inqu_status-0-productionOrderNo=" + productionOrderNo,
title: "<div style='text-align: center;'>拆单派工</div>",
width: "70%",
height: "80%",
callbackName: assignCallback
});
});
$("#ASSIGN").on("click", function () {
//重置全局变量
ids = [];
let rows = resultGrid.getCheckedRows()
if (rows.length < 1) {
message("请至少选择一条需要分派的数据");
return;
}
JSColorbox.open({ // 拆单派工
href: "HPSC098?methodName=initLoad", // $("#TEAR_ASSIGN").on("click", tearAssign);
title: "<div style='text-align: center;'>选择组织</div>",
width: "40%",
height: "70%",
callbackName: assignCallback
});
//分派可修改,不做判断
let num = 0;
rows.forEach(function(element) {
if (element.status == 1) {
num++;
}
ids.push(element.id)
});
// if (num > 0) {
// message("勾选的数据中有已经分派的数据!");
// return;
// } else {
//
// }
});
// 批量分派
$("#ASSIGN").on("click", assign);
IPLATUI.EFGrid.result = { IPLATUI.EFGrid.result = {
pageable: { pageable: {
pageSize: 20, pageSize: 20,
pageSizes: [10, 20, 50, 70, 100], pageSizes: [10, 20, 50, 70, 100],
}, },
columns: [ columns: [{
{
field: "operator", field: "operator",
template: function (item) { template: function (item) {
let prodOrderNo = item.productionOrderNo;
let filePath1 = item.filePath1; let filePath1 = item.filePath1;
let template = ''; let template = '<a style="cursor: pointer;display: inline-flex;justify-content: center;margin:auto 5px" '
+ 'onclick="tearAssign(\'' + prodOrderNo + '\')" >拆单派工</a>';
template += '<a style="cursor: pointer;display: inline-flex;justify-content: center;margin:auto 5px" '
+ 'onclick="showGroupDetail(\'' + prodOrderNo + '\')" >详情</a>';
if (filePath1) { if (filePath1) {
template += '<a style="cursor: pointer;display: inline-flex;justify-content: center;margin:auto 5px" ' template += '<a style="cursor: pointer;display: inline-flex;justify-content: center;margin:auto 5px" '
+ 'onclick="showUploadFile(' + filePath1 + ')" >附件清单</a>'; + 'onclick="showUploadFile(' + filePath1 + ')" >附件</a>';
} }
return template return template
} }
} }]
],
} }
}); });
function showUploadFile(id) {
/**
* 查询
*/
function query() {
resultGrid.dataSource.page(1);
}
/**
* 拆单派工
*
* @param productionOrderNo
*/
function tearAssign(prodOrderNo) {
JSColorbox.open({ JSColorbox.open({
href: "HPSC002B?methodName=initLoad&inqu_status-0-id=" + id, href: "HPSC005A?methodName=initLoad&inqu_status-0-prodOrderNo=" + prodOrderNo,
title: "<div style='text-align: center;'>附件清单</div>", title: "<div style='text-align: center;'>拆单派工</div>",
width: "80%", width: "80%",
height: "80%", height: "80%",
callbackName: tearAssignCallback
}); });
} }
let assignCallback = function (id) {
/**
* 拆单分派回调
*/
function tearAssignCallback() {
// 刷新列表
resultGrid.dataSource.page(1);
// 关闭弹窗
JSColorbox.close();
}
/**
* 批量分派
*/
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: "70%",
height: "70%",
callbackName: function (id) {
let saleIds = [];
for (let i = 0; i < rows.length; i++) {
saleIds.push(rows[i]['id']);
}
var info = new EiInfo() var info = new EiInfo()
info.set("ids",ids.join(',')); info.set("ids", saleIds);
info.set("id",id); info.set("id", id);
EiCommunicator.send("HPSC005","assign",info,{ EiCommunicator.send("HPSC005A", "assign", info, {
onSuccess:function(ei){//返回结果集 onSuccess: function (ei) {
if (ei["status"] == -1) { if (ei["status"] == -1) {
NotificationUtil(ei, "error"); NotificationUtil(ei, "error");
} else { } else {
NotificationUtil({ NotificationUtil({
msg: '修改成功' msg: ei.msg
}); });
// 刷新列表 // 刷新列表
resultGrid.dataSource.page(1); resultGrid.dataSource.page(1);
// 关闭弹窗 // 关闭弹窗
JSColorbox.close(); 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-bizType=WL&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,50 @@ ...@@ -5,71 +5,50 @@
<c:set var="ctx" value="${pageContext.request.contextPath}"/> <c:set var="ctx" value="${pageContext.request.contextPath}"/>
<script> <EF:EFPage title="生产订单">
var ctx = "${ctx}"; <EF:EFRegion id="inqu" title="查询条件">
</script> <div class="row">
<head> <EF:EFInput cname="生产订单号" blockId="inqu_status" ename="productionOrderNo" row="0" colWidth="3"/>
<%-- <link rel="stylesheet" href="${ctx}/css/simulatedOperation.css"/>--%> <EF:EFInput cname="项目号" blockId="inqu_status" ename="projCode" row="0" colWidth="3"/>
</head> <EF:EFInput cname="项目名称" blockId="inqu_status" ename="projName" row="0" colWidth="3"/>
<EF:EFPage title="生产任务"> <EF:EFInput cname="部件名称" blockId="inqu_status" ename="prdtName" row="0" colWidth="3"/>
</div>
<EF:EFRegion id="inqu" title="查询条件"><%-- type="query" efRegionShowClear="true" efRegionSave="true"--%> <div class="row">
<EF:EFInput cname="零部件名称" blockId="inqu_status" ename="partName" row="0" colWidth="3"/>
<div class="row"> <%-- blockId="inqu_status" row="0" --%> <EF:EFDatePicker cname="计划完成日期:" blockId="inqu_status" ename="planCompletionDate" row="0" colWidth="3"
<EF:EFInput blockId="inqu_status" ename="projCode" cname="项目号:" row="0"/> format="yyyy/MM/dd" readonly="true"/>
<EF:EFInput blockId="inqu_status" ename="projName" cname="项目名称:" row="0"/> <EF:EFSelect cname="状态:" optionLabel="全部" blockId="inqu_status" ename="status" row="0" colWidth="3">
<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:EFOption label="未派工" value="0"/> <EF:EFOption label="未派工" value="0"/>
<EF:EFOption label="部分派工" value="1"/> <EF:EFOption label="部分派工" value="1"/>
<EF:EFOption label="全部派工" value="2"/> <EF:EFOption label="全部派工" value="2"/>
</EF:EFSelect> </EF:EFSelect>
</div> </div>
<%-- <EF:EFButton ename="QUERY" cname="查询" row="1" class="btn-align-right"></EF:EFButton>--%>
</EF:EFRegion> </EF:EFRegion>
<EF:EFRegion id="result" title="记录集"> <EF:EFRegion id="result" title="记录集">
<EF:EFGrid blockId="result" autoDraw="override">
<EF:EFGrid blockId="result" autoDraw="no">
<EF:EFColumn ename="id" cname="主键" hidden="true"/> <EF:EFColumn ename="id" cname="主键" hidden="true"/>
<EF:EFColumn enable="false" ename="projCode" cname="项目号" /> <EF:EFColumn ename="operator" cname="操作" enable="false" width="150" align="center"/>
<EF:EFColumn enable="false" ename="projName" cname="项目名称"/> <EF:EFColumn ename="productionOrderNo" cname="生产订单号" enable="false" width="140" align="center"/>
<EF:EFColumn enable="false" ename="productionOrderNo" cname="生产订单号"/> <EF:EFComboColumn ename="status" cname="状态" enable="false" width="90" align="center">
<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:EFOption label="未派工" value="0"/> <EF:EFOption label="未派工" value="0"/>
<EF:EFOption label="部分派工" value="1"/> <EF:EFOption label="部分派工" value="1"/>
<EF:EFOption label="全部派工" value="2"/> <EF:EFOption label="全部派工" value="2"/>
</EF:EFComboColumn> </EF:EFComboColumn>
<EF:EFColumn enable="false" ename="factoryName" cname="厂区名称"/> <EF:EFColumn ename="projCode" cname="项目号" enable="false" width="140" align="center"/>
<EF:EFColumn enable="false" ename="orgName" cname="生产组"/> <EF:EFColumn ename="projName" cname="项目名称" enable="false" width="140" align="center"/>
<EF:EFColumn ename="operator" cname="操作" width="100" enable="false" readonly="false"/> <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: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="prdtCode" cname="部件编码" enable="false" width="120" align="center" hidden="true"/>
<EF:EFColumn ename="partCode" cname="零件编码" enable="false" width="120" align="center" hidden="true"/>
</EF:EFGrid> </EF:EFGrid>
</EF:EFRegion> </EF:EFRegion>
</EF:EFPage> </EF:EFPage>
<script>
var ctx = "${ctx}";
</script>
<script src="${ctx}/HP/SC/HPSC005.js"></script>
\ No newline at end of file
$(function () { $(function () {
$("#QUERY").on("click", function () {
resultGrid.dataSource.page(1);
});
IPLATUI.EFGrid = { IPLATUI.EFGrid = {
"result" : { "result" : {
pageable: { pageable: {
pageSize: 20, pageSize: 20,
pageSizes: [10, 20, 50, 70, 100], pageSizes: [10, 20, 50, 70, 100],
}, },
columns: [ columns: [{
field: "factoryName",
], attributes: {
onSuccess: function (e) { class: "i-input-readonly"
if(e.eiInfo.extAttr.methodName == 'update'
||e.eiInfo.extAttr.methodName == 'insert'){
query();
} }
}],
onSave: function (e) {
// 阻止后台保存请求,使用自定义保存
e.preventDefault();
save();
}, },
onDelete: function (e) {
// 阻止后台删除请求,使用自定义删除
e.preventDefault();
deleteFunc();
}
}
}
}, $("#QUERY").on("click", query);
}
}); });
/**
* 页面加载时执行
*/
$(window).load(function () {
// 查询
query();
});
/**
* 查询
*/
function query() {
resultGrid.dataSource.page(1);
}
/**
* 保存
*/
let save = function () {
let rows = resultGrid.getCheckedRows();
if (rows.length < 1) {
message("请选择数据");
return;
}
JSUtils.confirm("确定对勾选中的[" + rows.length + "]条数据做\"保存\"操作? ", {
ok: function () {
JSUtils.submitGridsData("result", "HPSC005A", "save", true);
}
});
}
/**
* 删除
*/
let deleteFunc = function () {
let rows = resultGrid.getCheckedRows();
if (rows.length < 1) {
message("请选择数据");
return;
}
JSUtils.confirm("确定对勾选中的[" + rows.length + "]条数据做\"删除\"操作? ", {
ok: function () {
JSUtils.submitGridsData("result", "HPSC005A", "delete", true);
}
});
}
...@@ -4,30 +4,28 @@ ...@@ -4,30 +4,28 @@
<%@ taglib prefix="EF" tagdir="/WEB-INF/tags/EF" %> <%@ taglib prefix="EF" tagdir="/WEB-INF/tags/EF" %>
<c:set var="ctx" value="${pageContext.request.contextPath}"/> <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"> <div class="row">
<EF:EFInput type="text" ename="detail-0-projCode" cname="项目号" readonly="true"/> <EF:EFInput ename="detail-0-projCode" cname="项目号" colWidth="4" readonly="true"/>
<EF:EFInput type="text" ename="detail-0-projName" cname="项目名称" readonly="true"/> <EF:EFInput ename="detail-0-projName" cname="项目名称" colWidth="4" readonly="true"/>
<EF:EFInput type="text" ename="detail-0-productionOrderNo" cname="生产订单号" readonly="true"/> <EF:EFInput ename="detail-0-productionOrderNo" cname="生产订单号" colWidth="4" readonly="true"/>
</div> </div>
<div class="row"> <div class="row">
<EF:EFInput type="text" ename="detail-0-prdtName" cname="部件名称" readonly="true"/> <EF:EFInput ename="detail-0-prdtName" cname="部件名称" colWidth="4" readonly="true"/>
<EF:EFInput type="text" ename="detail-0-partName" cname="零部件名称" readonly="true"/> <EF:EFInput ename="detail-0-partName" cname="零部件名称" colWidth="4" readonly="true"/>
<EF:EFInput type="text" ename="detail-0-planCompletionDate" cname="计划完成日期" readonly="true"/> <EF:EFInput ename="detail-0-planCompletionDate" cname="计划完成日期" colWidth="4" readonly="true"/>
</div> </div>
<div class="row"> <div class="row">
<EF:EFInput type="text" ename="detail-0-num" cname="计划数量" readonly="true"/> <EF:EFInput ename="detail-0-num" cname="计划数量" colWidth="4" readonly="true"/>
<EF:EFInput type="text" ename="detail-0-totalWt" cname="计划重量" readonly="true"/> <EF:EFInput ename="detail-0-totalWt" cname="计划重量" colWidth="4" readonly="true"/>
<EF:EFInput type="text" ename="detail-0-assignedNum" cname="已派工数量" readonly="true"/> <EF:EFInput ename="detail-0-assignedNum" cname="已派工数量" colWidth="4" readonly="true"/>
</div> </div>
<div class="row"> <div class="row">
<EF:EFInput type="text" ename="detail-0-unassignedNum" cname="待派工数量" readonly="true"/> <EF:EFInput ename="detail-0-unassignedNum" cname="待派工数量" colWidth="4" readonly="true"/>
<EF:EFSelect enable="false" align="center" ename="detail-0-status" cname="状态" readonly="true"> <EF:EFSelect ename="detail-0-status" cname="状态" colWidth="4" readonly="true">
<EF:EFOption label="未派工" value="0"/> <EF:EFOption label="未派工" value="0"/>
<EF:EFOption label="部分派工" value="1"/> <EF:EFOption label="部分派工" value="1"/>
<EF:EFOption label="全部派工" value="2"/> <EF:EFOption label="全部派工" value="2"/>
...@@ -35,26 +33,24 @@ ...@@ -35,26 +33,24 @@
</div> </div>
</EF:EFRegion> </EF:EFRegion>
<EF:EFRegion id="result" title="明细信息"> <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 ename="id" cname="任务ID" enable="false" width="80" align="center"/>
<EF:EFPopupColumn ename="factoryName" cname="厂区" width="200" popupType="ServiceGrid" <EF:EFColumn ename="prodTaskNo" cname="任务单号" enable="false" hidden="true"/>
popupTitle="厂区信息" serviceName="HPPZ011" methodName="queryComboBoxAll" resultId="factory_group_ecord_block_id" <EF:EFColumn ename="factoryCode" cname="厂区编码" enable="false" hidden="true"/>
<EF:EFPopupColumn ename="factoryName" cname="厂区" width="200" align="center" popupType="ServiceGrid"
popupTitle="厂区信息" serviceName="HPPZ011" methodName="queryComboBoxAll"
resultId="factory_group_ecord_block_id"
columnEnames="textField,param2Field" columnEnames="textField,param2Field"
columnCnames="厂区,生产组" columnCnames="厂区,生产组"
backFillColumnIds="param2Field,param1Field,valueField,textField" backFillColumnIds="param2Field,param1Field,valueField,textField"
backFillFieldIds="orgName,orgNo,factoryCode,factoryName" backFillFieldIds="orgName,orgNo,factoryCode,factoryName"
valueField="textField" textField="textField"/> valueField="textField" textField="textField" readonly="true" required="true"/>
<EF:EFColumn enable="false" ename="factoryCode" cname="厂区编码" hidden="true"/> <EF:EFColumn ename="orgNo" cname="生产组代码" enable="false" hidden="true"/>
<EF:EFColumn enable="false" ename="orgNo" readonly="true" cname="生产组代码" hidden="true"/> <EF:EFColumn ename="orgName" cname="生产组" enable="false" align="center"/>
<EF:EFColumn enable="false" ename="orgName" cname="生产组"/> <EF:EFColumn ename="num" cname="分派数量" format="{0:N3}" required="true"/>
<EF:EFColumn ename="num" cname="分派数量" format="{0:N3}"/> <EF:EFColumn ename="totalWt" cname="分派重量" enable="false" format="{0:N3}"/>
<EF:EFColumn ename="totalWt" cname="分派重量" format="{0:N3}"/> <EF:EFColumn ename="completeNum" cname="已完工数量" enable="false" format="{0:N3}"/>
</EF:EFGrid> </EF:EFGrid>
</EF:EFRegion> </EF:EFRegion>
</EF:EFPage> </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>
...@@ -17,6 +17,7 @@ $(function () { ...@@ -17,6 +17,7 @@ $(function () {
template: function (item) { template: function (item) {
let template = '<a style="cursor: pointer;display: inline-flex;justify-content: center;margin:auto 5px" ' + let template = '<a style="cursor: pointer;display: inline-flex;justify-content: center;margin:auto 5px" ' +
'onclick="jump(' + item.id + ')" >物料清单</a>'; 'onclick="jump(' + item.id + ')" >物料清单</a>';
return template; return template;
} }
} }
...@@ -29,7 +30,4 @@ function jump(id) { ...@@ -29,7 +30,4 @@ function jump(id) {
window.open(herf); window.open(herf);
} }
function jump2(id) {
var herf= ctx + "\\web\\"+ "HPSC006?inqu_status-0-projId=" + id;
window.open(herf);
}
...@@ -8,11 +8,8 @@ ...@@ -8,11 +8,8 @@
<EF:EFPage title="组织机构"> <EF:EFPage title="组织机构">
<EF:EFRegion id="inqu" title="查询条件"> <EF:EFRegion id="inqu" title="查询条件">
<div class="row"> <div class="row">
<EF:EFInput cname="厂区名称:" ename="factoryName" blockId="inqu_status" row="0" colWidth="3"/> <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:EFInput cname="生产组名称" ename="groupName" blockId="inqu_status" row="0" colWidth="3"/>
<EF:EFOption label="全部" value=""/>
<EF:EFOptions blockId="group_record_block_id" textField="textField" valueField="valueField"/>
</EF:EFSelect>
</div> </div>
</EF:EFRegion> </EF:EFRegion>
...@@ -20,16 +17,9 @@ ...@@ -20,16 +17,9 @@
<EF:EFGrid blockId="result" autoDraw="override" isFloat="true" checkMode="single,row"> <EF:EFGrid blockId="result" autoDraw="override" isFloat="true" checkMode="single,row">
<EF:EFColumn ename="id" cname="内码" hidden="true"/> <EF:EFColumn ename="id" cname="内码" hidden="true"/>
<EF:EFColumn ename="factoryCode" cname="厂区编码" enable="false" width="120" align="center"/> <EF:EFColumn ename="factoryCode" cname="厂区编码" enable="false" width="120" align="center"/>
<EF:EFPopupColumn ename="factoryName" cname="厂区名称" enable="false" width="120" align="center"/> <EF:EFColumn ename="factoryName" cname="厂区名称" enable="false" width="120" align="center"/>
<EF:EFComboColumn ename="groupCode" cname="生产组名称" width="120" align="center" <EF:EFColumn ename="groupCode" cname="生产组编码" enable="false" width="120" align="center"/>
blockName="org_record_block_id" textField="textField" valueField="valueField" <EF:EFColumn ename="groupName" cname="生产组名称" enable="false" width="120" align="center"/>
columnTemplate="#=textField#" itemTemplate="#=textField#"
required="true">
</EF:EFComboColumn>
</EF:EFGrid> </EF:EFGrid>
</EF:EFRegion> </EF:EFRegion>
</EF:EFPage> </EF:EFPage>
<script>
var ctx = "${ctx}";
</script>
<script src="${ctx}/HP/SC/HPSC098.js"></script>
...@@ -31,7 +31,6 @@ $(function () { ...@@ -31,7 +31,6 @@ $(function () {
}, { }, {
field: "problemPhoto", field: "problemPhoto",
template: function (item) { template: function (item) {
let status = item.status;
if (!isBlank(item.checkNo)) { if (!isBlank(item.checkNo)) {
return '<a style="cursor: pointer;display: inline-flex;justify-content: center;margin:auto 5px" ' return '<a style="cursor: pointer;display: inline-flex;justify-content: center;margin:auto 5px" '
+ 'onclick="showUploadFile(' + item.id + ', 1)" >附件清单</a>'; + 'onclick="showUploadFile(' + item.id + ', 1)" >附件清单</a>';
...@@ -42,7 +41,6 @@ $(function () { ...@@ -42,7 +41,6 @@ $(function () {
}, { }, {
field: "processPhoto", field: "processPhoto",
template: function (item) { template: function (item) {
let status = item.status;
if (!isBlank(item.checkNo)) { if (!isBlank(item.checkNo)) {
return '<a style="cursor: pointer;display: inline-flex;justify-content: center;margin:auto 5px" ' return '<a style="cursor: pointer;display: inline-flex;justify-content: center;margin:auto 5px" '
+ 'onclick="showUploadFile(' + item.id + ', 2)" >附件清单</a>'; + 'onclick="showUploadFile(' + item.id + ', 2)" >附件清单</a>';
......
...@@ -27,13 +27,21 @@ ...@@ -27,13 +27,21 @@
<EF:EFOption label="0-未处理" value="0"></EF:EFOption> <EF:EFOption label="0-未处理" value="0"></EF:EFOption>
</EF:EFSelect> </EF:EFSelect>
</div> </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>
<EF:EFRegion id="result" title="明细信息"> <EF:EFRegion id="result" title="明细信息">
<EF:EFGrid blockId="result" autoDraw="override" isFloat="true" checkMode="row"> <EF:EFGrid blockId="result" autoDraw="override" isFloat="true" checkMode="row">
<EF:EFColumn ename="id" cname="内码" hidden="true"/> <EF:EFColumn ename="id" cname="内码" hidden="true"/>
<EF:EFColumn ename="operator" cname="操作" locked="true" enable="false" width="100" readonly="false"/> <EF:EFColumn ename="operator" cname="操作" locked="true" enable="false" width="100" align="center"/>
<EF:EFColumn ename="checkNo" cname="检查单号" locked="true" enable="false" width="130" 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:EFComboColumn ename="status" cname="状态" enable="false" width="100" align="center">
<EF:EFOption label="1-已处理" value="1"></EF:EFOption> <EF:EFOption label="1-已处理" value="1"></EF:EFOption>
<EF:EFOption label="0-未处理" value="0"></EF:EFOption> <EF:EFOption label="0-未处理" value="0"></EF:EFOption>
...@@ -44,18 +52,16 @@ ...@@ -44,18 +52,16 @@
<EF:EFColumn ename="inventName" cname="部件名称" enable="false" width="130" align="center"/> <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="subInventName" cname="零部件名称" enable="false" width="130" align="center"/>
<EF:EFColumn ename="orgName" cname="生产组名称" enable="false" width="130" align="center"/> <EF:EFColumn ename="orgName" cname="生产组名称" enable="false" width="130" align="center"/>
<EF:EFComboColumn ename="poorType" cname="不良品类" enable="false" width="100" align="center">
<EF:EFComboColumn ename="poorType" cname="不良品类" width="100" align="center" required="true">
<EF:EFCodeOption codeName="hpjx.hpjx.poorType"/> <EF:EFCodeOption codeName="hpjx.hpjx.poorType"/>
</EF:EFComboColumn> </EF:EFComboColumn>
<EF:EFColumn ename="problemDesc" cname="质量问题描述" width="140" align="center" required="true"/> <EF:EFColumn ename="problemDesc" cname="质量问题描述" enable="false" width="140" align="center"/>
<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:EFComboColumn ename="checkUser" cname="检查人" enable="false" width="120" align="center" <EF:EFComboColumn ename="checkUser" cname="检查人" enable="false" width="120" align="center"
blockName="user_block_id" textField="textField" valueField="valueField" blockName="user_block_id" textField="textField" valueField="valueField"
columnTemplate="#=textField#" itemTemplate="#=textField#"> columnTemplate="#=textField#" itemTemplate="#=textField#">
</EF:EFComboColumn> </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="projCode" cname="项目编码" enable="false" width="130" align="center"/>
<EF:EFColumn ename="inventCode" 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"/> <EF:EFColumn ename="subInventCode" cname="零部件编码" enable="false" width="130" align="center"/>
......
...@@ -41,6 +41,18 @@ let select = function () { ...@@ -41,6 +41,18 @@ let select = function () {
message("请选择数据") message("请选择数据")
return; 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 + "]条数据生成巡检单吗? ", { JSUtils.confirm("确定对勾选中的[" + rows.length + "]条数据生成巡检单吗? ", {
ok: function () { ok: function () {
JSUtils.submitGridsData("result", "HPZL001B", "select", JSUtils.submitGridsData("result", "HPZL001B", "select",
......
...@@ -9,14 +9,12 @@ ...@@ -9,14 +9,12 @@
<EF:EFRegion id="inqu" title="查询区域" type="query"> <EF:EFRegion id="inqu" title="查询区域" type="query">
<div class="row"> <div class="row">
<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="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"/> <EF:EFInput cname="部件名称" ename="prdtName" blockId="inqu_status" row="0" colWidth="3"/>
</div> </div>
<div class="row"> <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"/> <EF:EFInput cname="零部件名称" ename="partName" blockId="inqu_status" row="0" colWidth="3"/>
</div> </div>
</div> </div>
...@@ -24,21 +22,29 @@ ...@@ -24,21 +22,29 @@
<EF:EFRegion id="result" title="记录集"> <EF:EFRegion id="result" title="记录集">
<EF:EFGrid blockId="result" autoDraw="override" checkMode="row"> <EF:EFGrid blockId="result" autoDraw="override" checkMode="row">
<EF:EFColumn ename="id" cname="生产任务ID" enable="false" width="90" align="center"/> <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="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="projName" cname="项目名称" enable="false" width="140" align="center"/>
<EF:EFColumn ename="prdtName" cname="部件名称" enable="false" width="120" 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="partName" cname="零部件名称" enable="false" width="120" align="center"/>
<EF:EFColumn ename="partSpec" cname="零部件规格" enable="false" width="150" 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:EFComboColumn ename="poorType" cname="不良品类" width="100" align="center" required="true">
<EF:EFColumn ename="num" cname="计划数量" enable="false" width="120" align="right" format="{0:N3}"/> <EF:EFCodeOption codeName="hpjx.hpjx.poorType"/>
<EF:EFColumn ename="totalWt" cname="计划重量" enable="false" width="120" align="right" format="{0:N3}"/> </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="remark" cname="备注" enable="false" width="150"/>
<EF:EFColumn ename="projCode" 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="prdtCode" cname="部件编码" enable="false" width="120" align="center"/>
<EF:EFColumn ename="partCode" 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="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:EFGrid>
</EF:EFRegion> </EF:EFRegion>
</EF:EFPage> </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