Commit b22eefd2 by yukang

Merge branch 'dev' of http://git.pseer.com:8800/platform/hg-smart into dev

# Conflicts:
#	src/main/java/com/baosight/hggp/common/DdynamicEnum.java
#	src/main/java/com/baosight/hggp/hg/constant/HGConstant.java
#	src/main/java/com/baosight/hggp/hg/pz/tools/HGPZTools.java
#	src/main/resources/resources/ibatis/sqlmap-config.xml
parents c13e830a 1aff9cbe
...@@ -29,21 +29,21 @@ public enum DdynamicEnum { ...@@ -29,21 +29,21 @@ public enum DdynamicEnum {
* 编写:wwl * 编写:wwl
*/ */
PROJ_TYPE_BLOCK_ID("proj_type_block_id", "natCode", "natName", "HGPZ008.queryComboBox"), PROJ_TYPE_BLOCK_ID("proj_type_block_id", "natCode", "natName", "HGPZ008.queryComboBox"),
/** /**
* 模块:客户类型 * 模块:客户类型
* 用途:客户类型下拉框 * 用途:客户类型下拉框
* 编写: * 编写:
*/ */
CUSTOMER_TYPE_BLOCK_ID("customer_type_block_id", "custType", "custTypeName", "HGPZ001.queryComboBox"), CUSTOMER_TYPE_BLOCK_ID("customer_type_block_id", "custType", "custTypeName", "HGPZ001.queryComboBox"),
/** /**
* 模块:客户档案 * 模块:客户档案
* 用途:客户档案下拉框 * 用途:客户档案下拉框
* 编写:wwl * 编写:wwl
*/ */
CUSTOMER_RECORD_BLOCK_ID("customer_record_block_id", "custCode", "custName", "HGPZ002.queryComboBox"), CUSTOMER_RECORD_BLOCK_ID("customer_record_block_id", "custCode", "custName", "HGPZ002.queryComboBox"),
/** /**
* 模块:供应商档案 * 模块:供应商档案
* 用途:供应商档案下拉框 * 用途:供应商档案下拉框
...@@ -85,42 +85,43 @@ public enum DdynamicEnum { ...@@ -85,42 +85,43 @@ public enum DdynamicEnum {
* 编写: * 编写:
*/ */
SPEC_RECORD_BLOCK_ID("spec_record_block_id", "id", "spec", "HGPZ005.queryComboBoxAll"), SPEC_RECORD_BLOCK_ID("spec_record_block_id", "id", "spec", "HGPZ005.queryComboBoxAll"),
/** /**
* 模块:规格(无ID) * 模块:规格(无ID)
* 用途:存货档案下拉框 * 用途:存货档案下拉框
* 编写: * 编写:
*/ */
SPEC_NAME_BLOCK_ID("spec_name_block_id", "spec", "spec", "HGPZ005.queryComboBoxSpecName"), SPEC_NAME_BLOCK_ID("spec_name_block_id", "spec", "spec", "HGPZ005.queryComboBoxSpecName"),
/** /**
* 模块:仓库类型 * 模块:仓库类型
* 用途:仓库类型下拉框 * 用途:仓库类型下拉框
* 编写: * 编写:
*/ */
WH_TYPE_BLOCK_ID("wh_type_block_id","whType","whTypeName","HGPZ006.queryComboBox"), WH_TYPE_BLOCK_ID("wh_type_block_id", "whType", "whTypeName", "HGPZ006.queryComboBox"),
/** /**
* 模块:仓库档案 * 模块:仓库档案
* 用途:仓库档案下拉框 * 用途:仓库档案下拉框
* 编写: * 编写:
*/ */
WH_RECORD_BLOCK_ID("wh_record_block_id","whCode","whName","HGPZ007.queryComboBox"), WH_RECORD_BLOCK_ID("wh_record_block_id", "whCode", "whName", "HGPZ007.queryComboBox"),
/**
* 模块:厂区管理 /**
* 用途:厂区管理下拉框 * 模块:厂区管理
* 编写:songx * 用途:厂区管理下拉框
*/ * 编写:songx
FACTORY_RECORD_BLOCK_ID("factory_record_block_id","orgId","orgCname","HGXSOrg.queryFactoryComboBox"), */
FACTORY_RECORD_BLOCK_ID("factory_record_block_id", "orgId", "orgCname", "HGXSOrg.queryFactoryComboBox"),
/**
* 模块:组管理 /**
* 用途:组管理下拉框 * 模块:组管理
* 用途:组管理下拉框
* 编写:songx * 编写:songx
*/ */
GROUP_RECORD_BLOCK_ID("group_record_block_id","orgId","orgCname","HPXSOrg.queryGroupComboBox"), GROUP_RECORD_BLOCK_ID("group_record_block_id","orgId","orgCname","HGXSOrg.queryGroupComboBox"),
/** /**
* 模块:组管理 * 模块:组管理
...@@ -218,6 +219,8 @@ public enum DdynamicEnum { ...@@ -218,6 +219,8 @@ public enum DdynamicEnum {
*/ */
PROJ_RECORD_BLOCK_ID("proj_record_block_id", "projCode", "projName", "HGSC001.queryComboBox"), PROJ_RECORD_BLOCK_ID("proj_record_block_id", "projCode", "projName", "HGSC001.queryComboBox"),
ITEM_CODE_BOX_BLOCK_ID("item_code_box_block_id", "itemCode", "itemCname", "HGPZ005A.queryEdcm01"),
/** /**
* *
*/ */
......
...@@ -5,6 +5,7 @@ import com.baosight.hggp.hg.cg.domain.HGCG002; ...@@ -5,6 +5,7 @@ import com.baosight.hggp.hg.cg.domain.HGCG002;
import com.baosight.hggp.hg.cg.domain.HGCG002A; import com.baosight.hggp.hg.cg.domain.HGCG002A;
import com.baosight.hggp.hg.cg.domain.HGCG003; import com.baosight.hggp.hg.cg.domain.HGCG003;
import com.baosight.hggp.hg.cg.tools.HGCGTools; import com.baosight.hggp.hg.cg.tools.HGCGTools;
import com.baosight.hggp.hg.utils.HGUtils;
import com.baosight.hggp.util.DateUtils; import com.baosight.hggp.util.DateUtils;
import com.baosight.hggp.util.MapUtils; import com.baosight.hggp.util.MapUtils;
import com.baosight.hggp.util.ObjectUtils; import com.baosight.hggp.util.ObjectUtils;
...@@ -20,23 +21,6 @@ import java.util.Map; ...@@ -20,23 +21,6 @@ import java.util.Map;
public class HGCGUtils { public class HGCGUtils {
/** /**
* 设置查询条件
*
* @param queryRow
*/
public static void setCondition(Map queryRow) {
// 创建时间
String createdTimeFrom = MapUtils.getString(queryRow, "createdTimeFrom");
if (StringUtils.isNotBlank(createdTimeFrom)) {
queryRow.put("createdTimeFrom", DateUtils.formatShort(createdTimeFrom));
}
String createdTimeTo = MapUtils.getString(queryRow, "createdTimeTo");
if (StringUtils.isNotBlank(createdTimeTo)) {
queryRow.put("createdTimeTo", DateUtils.formatShort(createdTimeTo));
}
}
/**
* HGCG001 工具类 * HGCG001 工具类
* *
* @author:songx * @author:songx
...@@ -51,7 +35,7 @@ public class HGCGUtils { ...@@ -51,7 +35,7 @@ public class HGCGUtils {
* @return * @return
*/ */
public static void setCondition(Map queryRow) { public static void setCondition(Map queryRow) {
HGCGUtils.setCondition(queryRow); HGUtils.setCondition(queryRow);
// 计划日期 // 计划日期
String planDate = MapUtils.getString(queryRow, HGCG001.FIELD_PLAN_DATE); String planDate = MapUtils.getString(queryRow, HGCG001.FIELD_PLAN_DATE);
if (StringUtils.isNotBlank(planDate)) { if (StringUtils.isNotBlank(planDate)) {
...@@ -76,7 +60,7 @@ public class HGCGUtils { ...@@ -76,7 +60,7 @@ public class HGCGUtils {
* @return * @return
*/ */
public static void setCondition(Map queryRow) { public static void setCondition(Map queryRow) {
HGCGUtils.setCondition(queryRow); HGUtils.setCondition(queryRow);
// 合同日期 // 合同日期
String contractDate = MapUtils.getString(queryRow, HGCG002.FIELD_CONTRACT_DATE); String contractDate = MapUtils.getString(queryRow, HGCG002.FIELD_CONTRACT_DATE);
if (StringUtils.isNotBlank(contractDate)) { if (StringUtils.isNotBlank(contractDate)) {
...@@ -124,7 +108,7 @@ public class HGCGUtils { ...@@ -124,7 +108,7 @@ public class HGCGUtils {
* @return * @return
*/ */
public static void setCondition(Map queryRow) { public static void setCondition(Map queryRow) {
HGCGUtils.setCondition(queryRow); HGUtils.setCondition(queryRow);
// 收货日期 // 收货日期
String receiveDate = MapUtils.getString(queryRow, HGCG003.FIELD_RECEIVE_DATE); String receiveDate = MapUtils.getString(queryRow, HGCG003.FIELD_RECEIVE_DATE);
if (StringUtils.isNotBlank(receiveDate)) { if (StringUtils.isNotBlank(receiveDate)) {
......
...@@ -51,10 +51,10 @@ public class HGConstant { ...@@ -51,10 +51,10 @@ public class HGConstant {
public static final String HPZL001_NUMBER = "HPZL001_NUMBER"; public static final String HPZL001_NUMBER = "HPZL001_NUMBER";
//采购入库单号 //采购入库单号
public static final String HPKC001_NUMBER = "HPKC001_NUMBER"; public static final String HPKC001_NUMBER = "HPKC001_NUMBER";
//生产领料单号 // 生产领料单号
public static final String HPKC002_NUMBER = "HPKC002_NUMBER"; public static final String PROD_REQ_NO = "PROD_REQ_NO";
// 生产入库单号 // 生产入库单号
public static final String HPKC003_PROD_NO = "HPKC003_PROD_NO"; public static final String PROD_DEPOSIT_NO = "PROD_DEPOSIT_NO";
// 生产销售单号 // 生产销售单号
public static final String HPKC004_SALE_NO = "HPKC004_SALE_NO"; public static final String HPKC004_SALE_NO = "HPKC004_SALE_NO";
// 供应商编码 // 供应商编码
...@@ -66,7 +66,7 @@ public class HGConstant { ...@@ -66,7 +66,7 @@ public class HGConstant {
// 其他出库单号 // 其他出库单号
public static final String OTHER_OUTER_NO = "OTHER_OUTER_NO"; public static final String OTHER_OUTER_NO = "OTHER_OUTER_NO";
//生产计划单 //生产计划单
public static final String HPSC003_PROD_NO = "HPSC003_PROD_NO"; public static final String HGSC005_PLAN_CODE = "HGSC005_PLAN_CODE";
//生产订单 //生产订单
public static final String HPSC005_PROD_NO = "HPSC005_PROD_NO"; public static final String HPSC005_PROD_NO = "HPSC005_PROD_NO";
//生产任务订单 //生产任务订单
...@@ -101,10 +101,12 @@ public class HGConstant { ...@@ -101,10 +101,12 @@ public class HGConstant {
public static final String INSPEC_CODE = "INSPEC_CODE"; public static final String INSPEC_CODE = "INSPEC_CODE";
// 保养单号 // 保养单号
public static final String UPKEEP_CODE = "UPKEEP_CODE"; public static final String UPKEEP_CODE = "UPKEEP_CODE";
// 蓝图编号
public static final String BLUEPRINT_CODE = "BLUEPRINT_CODE";
public static final String CW_CONTRACT_NO = "CW_CONTRACT_NO"; public static final String CW_CONTRACT_NO = "CW_CONTRACT_NO";
} }
/** /**
* 采购计划状态 * 采购计划状态
* *
...@@ -182,5 +184,33 @@ public class HGConstant { ...@@ -182,5 +184,33 @@ public class HGConstant {
// 其他 // 其他
public static final String QT = "QT"; public static final String QT = "QT";
} }
/**
* 停用状态
*
* @author:songx
* @date:2024/1/20,15:18
*/
public static class EnablingStatus {
// 停用
public static final Integer TY = 0;
// 启用
public static final Integer QY = 1;
}
/**
* 审批状态
*
* @author:songx
* @date:2024/5/15,15:18
*/
public static class ApprovalStatus {
// 待审
public static final Integer DS = 0;
// 审批中
public static final Integer SPZ = 1;
// 已审
public static final Integer YS = 2;
}
} }
...@@ -97,7 +97,21 @@ public class HGSqlConstant { ...@@ -97,7 +97,21 @@ public class HGSqlConstant {
} }
/** /**
* HGKC001 SQL 定义 * HGKC003 SQL 定义
*
* @author:songx
* @date:2024/1/20,16:45
*/
public class HgKc003 {
// 模块名称
private static final String MODULE_NAME = "HGKC003.";
// 锁
public static final String LOCK = MODULE_NAME + "lock";
}
/**
* HGKC010 SQL 定义
* *
* @author:songx * @author:songx
* @date:2024/1/20,16:45 * @date:2024/1/20,16:45
...@@ -115,6 +129,24 @@ public class HGSqlConstant { ...@@ -115,6 +129,24 @@ public class HGSqlConstant {
} }
/** /**
* HGKC011 SQL 定义
*
* @author:songx
* @date:2024/1/20,16:45
*/
public class HgKc011 {
// 模块名称
private static final String MODULE_NAME = "HGKC011.";
// 锁
public static final String LOCK = MODULE_NAME + "lock";
// 锁
public static final String LOCKS = MODULE_NAME + "locks";
// 修改库存
public static final String UPDATE_INV = MODULE_NAME + "updateInv";
}
/**
* HPKC001 SQL 定义 * HPKC001 SQL 定义
* *
* @author:songx * @author:songx
......
package com.baosight.hggp.hg.kc.domain;
import com.baosight.iplat4j.core.ei.EiColumn;
import com.baosight.iplat4j.core.util.NumberUtils;
import com.baosight.iplat4j.core.util.StringUtils;
import java.math.BigDecimal;
import java.util.Map;
/**
* @author LiuYang
* @version 1.0 2024/5/16
*/
public class HGKC012 extends HGKC010{
private static final long serialVersionUID = 1L;
public static final String FIELD_WARN_NUM = "warnNum"; /* 预警数量*/
public static final String FIELD_PRINC = "princ"; /* 负责人*/
public static final String COL_WARN_NUM = "WARN_NUM"; /* 预警数量*/
public static final String COL_PRINC = "PRINC"; /* 负责人*/
public static final String QUERY = "HGKC012.query";
private BigDecimal warnNum = new BigDecimal("0"); /* 预警数量*/
private String princ = " "; /* 负责人*/
/**
* initialize the metadata.
*/
public void initMetaData() {
EiColumn eiColumn;
eiColumn = new EiColumn(FIELD_WARN_NUM);
eiColumn.setType("N");
eiColumn.setScaleLength(0);
eiColumn.setFieldLength(12);
eiColumn.setDescName("预警数量");
eiMetadata.addMeta(eiColumn);
eiColumn = new EiColumn(FIELD_PRINC);
eiColumn.setDescName("负责人");
eiMetadata.addMeta(eiColumn);
}
/**
* the constructor.
*/
public HGKC012() {
super.initMetaData();
initMetaData();
}
/**
* get the warnNum - 预警数量.
* @return the warnNum
*/
public BigDecimal getWarnNum() {
return this.warnNum;
}
/**
* set the warnNum - 预警数量.
*
* @param warnNum - 预警数量
*/
public void setWarnNum(BigDecimal warnNum) {
this.warnNum = warnNum;
}
/**
* get the value from Map.
*
* @param map - source data map
*/
/**
* get the princ - 负责人.
* @return the princ
*/
public String getPrinc() {
return this.princ;
}
/**
* set the princ - 负责人.
*
* @param princ - 负责人
*/
public void setPrinc(String princ) {
this.princ = princ;
}
@Override
public void fromMap(Map map) {
super.fromMap(map);
setWarnNum(NumberUtils.toBigDecimal(StringUtils.toString(map.get(FIELD_WARN_NUM)), warnNum));
setPrinc(StringUtils.defaultIfEmpty(StringUtils.toString(map.get(FIELD_PRINC)), princ));
}
/**
* set the value to Map.
*/
@Override
public Map toMap() {
Map map = super.toMap();
map.put(FIELD_WARN_NUM, StringUtils.toString(warnNum, eiMetadata.getMeta(FIELD_WARN_NUM)));
map.put(FIELD_PRINC, StringUtils.toString(princ, eiMetadata.getMeta(FIELD_PRINC)));
return map;
}
}
...@@ -125,7 +125,7 @@ public class ServiceHGKC002 extends ServiceBase { ...@@ -125,7 +125,7 @@ public class ServiceHGKC002 extends ServiceBase {
// 生成红冲记录 // 生成红冲记录
HGKC002 dbKc002 = dbKc002Map.get(fKc002.getReqNo()); HGKC002 dbKc002 = dbKc002Map.get(fKc002.getReqNo());
HGKC002 newKc002 = BeanUtils.copy(dbKc002, HGKC002.class); HGKC002 newKc002 = BeanUtils.copy(dbKc002, HGKC002.class);
newKc002.setReqNo(SequenceGenerator.getNextSequence(HGConstant.SequenceId.HPKC002_NUMBER)); newKc002.setReqNo(SequenceGenerator.getNextSequence(HGConstant.SequenceId.PROD_REQ_NO));
newKc002.setApplyQty(dbKc002.getApplyQty().negate()); newKc002.setApplyQty(dbKc002.getApplyQty().negate());
newKc002.setApplyWeight(dbKc002.getApplyWeight().negate()); newKc002.setApplyWeight(dbKc002.getApplyWeight().negate());
newKc002.setOldReqNo(dbKc002.getReqNo()); newKc002.setOldReqNo(dbKc002.getReqNo());
......
...@@ -127,7 +127,7 @@ public class ServiceHGKC002A extends ServiceEPBase { ...@@ -127,7 +127,7 @@ public class ServiceHGKC002A extends ServiceEPBase {
Long invId = fKc010a.getId(); Long invId = fKc010a.getId();
HGKC010 dbKc010 = dbKc010Map.get(invId); HGKC010 dbKc010 = dbKc010Map.get(invId);
HGKC002 newKc002 = BeanUtils.copy(dbKc010, HGKC002.class); HGKC002 newKc002 = BeanUtils.copy(dbKc010, HGKC002.class);
newKc002.setReqNo(SequenceGenerator.getNextSequence(HGConstant.SequenceId.HPKC002_NUMBER)); newKc002.setReqNo(SequenceGenerator.getNextSequence(HGConstant.SequenceId.PROD_REQ_NO));
newKc002.setReceiptDate(DateUtils.shortDate()); newKc002.setReceiptDate(DateUtils.shortDate());
newKc002.setApplyQty(applyQty); newKc002.setApplyQty(applyQty);
newKc002.setUnitWeight(dbKc010.getInvUnitWeight()); newKc002.setUnitWeight(dbKc010.getInvUnitWeight());
......
package com.baosight.hggp.hg.kc.service;
import com.baosight.hggp.aspect.annotation.OperationLogAnnotation;
import com.baosight.hggp.common.DdynamicEnum;
import com.baosight.hggp.core.dao.DaoUtils;
import com.baosight.hggp.core.enums.DeleteFlagEnum;
import com.baosight.hggp.hg.constant.HGConstant;
import com.baosight.hggp.hg.kc.domain.HGKC003;
import com.baosight.hggp.hg.kc.utils.HGKCUtils;
import com.baosight.hggp.util.AssertUtils;
import com.baosight.hggp.util.BeanUtils;
import com.baosight.hggp.util.CommonMethod;
import com.baosight.hggp.util.EiInfoUtils;
import com.baosight.hggp.util.LogUtils;
import com.baosight.hggp.util.MapUtils;
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.util.Arrays;
import java.util.List;
import java.util.Map;
/**
* @author:songx
* @date:2024/1/22,10:48
*/
public class ServiceHGKC003 extends ServiceBase {
/**
* 画面初始化
*
* @param inInfo
* @return
*/
@Override
@OperationLogAnnotation(operModul = "生产入库单", operType = "查询", operDesc = "初始化")
public EiInfo initLoad(EiInfo inInfo) {
try {
CommonMethod.initBlock(inInfo, Arrays.asList(DdynamicEnum.WH_RECORD_BLOCK_ID));
CommonMethod.initBlock(inInfo, Arrays.asList(DdynamicEnum.INVENT_RECORD_BLOCK_ID));
CommonMethod.initBlock(inInfo, Arrays.asList(DdynamicEnum.FACTORY_RECORD_BLOCK_ID));
inInfo.addBlock(EiConstant.resultBlock).addBlockMeta(new HGKC003().eiMetadata);
} catch (Exception e) {
LogUtils.setDetailMsg(inInfo, e, "初始化失败");
}
return inInfo;
}
/**
* 查询操作
*
* @param inInfo
* @return
*/
@Override
@OperationLogAnnotation(operModul = "生产入库单", operType = "查询", operDesc = "查询")
public EiInfo query(EiInfo inInfo) {
try {
Map queryRow = EiInfoUtils.getFirstRow(inInfo);
HGKCUtils.HgKc003.setCondition(queryRow);
inInfo = super.query(inInfo, HGKC003.QUERY, new HGKC003());
} catch (Exception e) {
LogUtils.setDetailMsg(inInfo, e, "查询失败");
}
return inInfo;
}
/**
* 删除操作
*
* @param inInfo
* @return
*/
@OperationLogAnnotation(operModul = "生产入库单", operType = "删除", operDesc = "删除")
public EiInfo delete(EiInfo inInfo) {
try {
List<HGKC003> fKc003s = MapUtils.toDaoEPBase(inInfo, HGKC003.class);
// 锁库存
Map<String, HGKC003> dbKc003Map = HGKCUtils.HgKc003.lockGetDataEp(fKc003s);
// 锁生产计划明细
// HPSCTools.HpSc004.lock(prodOrderNos);
// 校验数据
this.checkDeleteData(fKc003s, dbKc003Map);
// 查询数据
this.deleteData(fKc003s, dbKc003Map);
inInfo.setMsg("删除成功!");
} catch (Exception e) {
LogUtils.setDetailMsg(inInfo, e, "删除失败");
}
return inInfo;
}
/**
* @param fKc003s
* @param dbKc003Map
*/
private void checkDeleteData(List<HGKC003> fKc003s, Map<String, HGKC003> dbKc003Map) {
for (HGKC003 fKc003 : fKc003s) {
String depositNo = fKc003.getDepositNo();
HGKC003 dbKc003 = dbKc003Map.get(depositNo);
AssertUtils.isEquals(DeleteFlagEnum.REMOVE.getCode(), dbKc003.getDeleteFlag(),
String.format("入库单【%s】已删除,请勿重复操作", depositNo));
}
}
/**
* 删除数据
*
* @param fKc003s
* @param dbKc003Map
*/
private void deleteData(List<HGKC003> fKc003s, Map<String, HGKC003> dbKc003Map) {
for (HGKC003 fKc003 : fKc003s) {
fKc003.setDeleteFlag(DeleteFlagEnum.REMOVE.getCode());
DaoUtils.update(HGKC003.DELETE, fKc003);
// 生产一条负数量和产量的红冲记录
HGKC003 dbKc003 = dbKc003Map.get(fKc003.getDepositNo());
HGKC003 newKc003 = BeanUtils.copy(dbKc003, HGKC003.class);
newKc003.setInvQty(dbKc003.getInvQty().negate());
newKc003.setInvWeight(dbKc003.getInvWeight().negate());
newKc003.setDeleteFlag(DeleteFlagEnum.REMOVE.getCode());
newKc003.setDepositNoOld(fKc003.getDepositNo());
newKc003.setDepositNo(SequenceGenerator.getNextSequence(HGConstant.SequenceId.PROD_DEPOSIT_NO));
DaoUtils.insert(HGKC003.INSERT, newKc003);
// 同步生产计划
// HPSCTools.syncPlan(newKc003.getProdOrderNo(), newKc003.getAmount());
// 更新生产任务已完成数量
// HPSCTools.HpSc005a.updateCompleteNum(newKc003.getProdTaskNo(), newKc003.getAmount());
// 修改库存
HGKCUtils.HgKc011.updateInv(newKc003.getCompanyCode(), newKc003.getWhCode(), newKc003.getProdOrderNo(),
newKc003.getInvQty(), newKc003.getInvWeight());
}
}
}
package com.baosight.hggp.hg.kc.service;
import com.baosight.hggp.aspect.annotation.OperationLogAnnotation;
import com.baosight.hggp.common.DdynamicEnum;
import com.baosight.hggp.core.constant.CommonConstant;
import com.baosight.hggp.util.CommonMethod;
import com.baosight.hggp.util.EiInfoUtils;
import com.baosight.hggp.util.LogUtils;
import com.baosight.hggp.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 java.util.Arrays;
import java.util.List;
import java.util.Map;
/**
* 选择生产任务
*
* @author:songx
* @date:2022/7/11,11:08
*/
public class ServiceHGKC003A extends ServiceEPBase {
/**
* 初始化
*
* @param inInfo
* @return
*/
@Override
@OperationLogAnnotation(operModul = "生产任务查询", operType = "查询", operDesc = "生产入库单-生产任务查询-初始化")
public EiInfo initLoad(EiInfo inInfo) {
try {
CommonMethod.initBlock(inInfo, Arrays.asList(DdynamicEnum.WH_RECORD_BLOCK_ID));
CommonMethod.initBlock(inInfo, Arrays.asList(DdynamicEnum.FACTORY_RECORD_BLOCK_ID));
CommonMethod.initBlock(inInfo, Arrays.asList(DdynamicEnum.GROUP_RECORD_BLOCK_ID));
// inInfo.addBlock(EiConstant.resultBlock).addBlockMeta(new HPSC005().eiMetadata);
} catch (Exception e) {
LogUtils.setDetailMsg(inInfo, e, "初始化失败");
}
return inInfo;
}
/**
* 查询数据列表
*
* @param inInfo
* @return
*/
@Override
@OperationLogAnnotation(operModul = "生产任务查询", operType = "查询", operDesc = "生产入库单-生产任务查询-查询")
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
*/
@OperationLogAnnotation(operModul = "生产任务查询", operType = "插入", operDesc = "生产入库单-生产任务查询-生成入库单")
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.HpSc004.lock(prodOrderNos);
// 锁生产订单
// HPSCTools.HpSc005.lock(prodOrderNos);
// 锁生产任务
// HPSCTools.HpSc005a.lock(prodTaskNos);
// 查询生产任务信息
// Map<String, HPSC005B> dbSc005bMap = HPSCTools.HpSc005b.map(prodTaskNos);
// 数据校验
this.checkSelectData();
// 生成入库单
this.saveSelectData();
} catch (Exception e) {
LogUtils.setDetailMsg(inInfo, e, "生成入库单失败");
inInfo.setStatus(500);
}
return inInfo;
}
/**
* 数据检查
*/
private void checkSelectData() {
// 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()));*/
// }
}
/**
* 数据写入
*/
private void saveSelectData() {
// 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.setRemark(MapUtils.getString(row, "remark1"));
// newKc003.setWhName(HPPZTools.HpPz007.getByCode(whCode).getWhName());
// newKc003.setAmount(applyNum);
// newKc003.setWeight(applyNum.multiply(dbSc005b.getUnitWt()).divide(new BigDecimal("1000")));
// newKc003.setDeleteFlag(CommonConstant.YesNo.NO_0);
// DaoUtils.insert(HPKC003.INSERT, newKc003);
// // 同步生产计划
// HPSCTools.syncPlan(newKc003.getProdOrderNo(), newKc003.getAmount());
// // 更新生产任务已完成数量
// HPSCTools.HpSc005a.updateCompleteNum(fSc005b.getProdTaskNo(), applyNum);
// // 修改库存
// HPKCTools.updateProdStock(newKc003.getWhCode(), newKc003.getProdOrderNo(),
// newKc003.getAmount(), newKc003.getWeight(), fSc005b.getFactoryCode());
// }
}
}
...@@ -2,7 +2,6 @@ package com.baosight.hggp.hg.kc.service; ...@@ -2,7 +2,6 @@ package com.baosight.hggp.hg.kc.service;
import com.baosight.hggp.aspect.annotation.OperationLogAnnotation; import com.baosight.hggp.aspect.annotation.OperationLogAnnotation;
import com.baosight.hggp.common.DdynamicEnum; import com.baosight.hggp.common.DdynamicEnum;
import com.baosight.hggp.hg.cg.domain.HGCG001;
import com.baosight.hggp.hg.kc.domain.HGKC010; import com.baosight.hggp.hg.kc.domain.HGKC010;
import com.baosight.hggp.util.CommonMethod; import com.baosight.hggp.util.CommonMethod;
import com.baosight.hggp.util.EiInfoUtils; import com.baosight.hggp.util.EiInfoUtils;
......
package com.baosight.hggp.hg.kc.service;
import com.baosight.hggp.aspect.annotation.OperationLogAnnotation;
import com.baosight.hggp.common.DdynamicEnum;
import com.baosight.hggp.hg.kc.domain.HGKC011;
import com.baosight.hggp.util.CommonMethod;
import com.baosight.hggp.util.EiInfoUtils;
import com.baosight.hggp.util.LogUtils;
import com.baosight.iplat4j.core.ei.EiConstant;
import com.baosight.iplat4j.core.ei.EiInfo;
import com.baosight.iplat4j.core.exception.PlatException;
import com.baosight.iplat4j.core.service.impl.ServiceBase;
import java.util.Arrays;
import java.util.Map;
/**
* @author:songx
* @date:2024/5/9,11:04
*/
public class ServiceHGKC011 extends ServiceBase {
/**
* 画面初始化
*
* @param inInfo
* @return
*/
@Override
@OperationLogAnnotation(operModul = "综合库存", operType = "查询", operDesc = "初始化")
public EiInfo initLoad(EiInfo inInfo) {
try {
CommonMethod.initBlock(inInfo, Arrays.asList(DdynamicEnum.COMPANY_CODE_BLOCK_ID));
CommonMethod.initBlock(inInfo, Arrays.asList(DdynamicEnum.INVENT_TYPE_BLOCK_ID));
CommonMethod.initBlock(inInfo, Arrays.asList(DdynamicEnum.INVENT_RECORD_BLOCK_ID));
CommonMethod.initBlock(inInfo, Arrays.asList(DdynamicEnum.SPEC_NAME_BLOCK_ID));
CommonMethod.initBlock(inInfo, Arrays.asList(DdynamicEnum.WH_RECORD_BLOCK_ID));
inInfo.addBlock(EiConstant.resultBlock).addBlockMeta(new HGKC011().eiMetadata);
} catch (PlatException e) {
LogUtils.setDetailMsg(inInfo, e, "初始化失败");
}
return inInfo;
}
/**
* 查询操作
*
* @param inInfo
* @return
*/
@Override
@OperationLogAnnotation(operModul = "综合库存", operType = "查询", operDesc = "查询")
public EiInfo query(EiInfo inInfo) {
try {
Map queryRow = EiInfoUtils.getFirstRow(inInfo);
inInfo = super.query(inInfo, HGKC011.QUERY, new HGKC011());
} catch (Exception e) {
LogUtils.setDetailMsg(inInfo, e, "查询失败");
}
return inInfo;
}
}
package com.baosight.hggp.hg.kc.service;
import com.baosight.hggp.common.DdynamicEnum;
import com.baosight.hggp.common.InventTypeEnum;
import com.baosight.hggp.hg.kc.domain.HGKC012;
import com.baosight.hggp.util.CommonMethod;
import com.baosight.iplat4j.core.ei.EiConstant;
import com.baosight.iplat4j.core.ei.EiInfo;
import com.baosight.iplat4j.core.service.impl.ServiceEPBase;
import java.util.Arrays;
import java.util.HashMap;
import java.util.Map;
/**
* @author LiuYang
* @version 1.0 2024/5/16
*/
public class ServiceHGKC012 extends ServiceEPBase {
// 指定存货类型
private static final Integer[] DEFAULT_INVENT_CODE = {InventTypeEnum.RAW.getCode(),
InventTypeEnum.CONSUMABLE.getCode()};
@Override
public EiInfo initLoad(EiInfo inInfo) {
inInfo = super.query(inInfo, HGKC012.QUERY);
Map queryMap = new HashMap();
queryMap.put("inventTypes", DEFAULT_INVENT_CODE);
CommonMethod.initBlock(inInfo, Arrays.asList(DdynamicEnum.USER_BLOCK_ID), null,true);
CommonMethod.initBlock(inInfo, Arrays.asList(
DdynamicEnum.WH_RECORD_BLOCK_ID,
DdynamicEnum.INVENT_RECORD_BLOCK_ID,
DdynamicEnum.SPEC_NAME_BLOCK_ID,
DdynamicEnum.INVENT_TYPE_BLOCK_ID), queryMap);
inInfo.getBlock(EiConstant.resultBlock).setBlockMeta(new HGKC012().eiMetadata);
return inInfo;
}
@Override
public EiInfo query(EiInfo inInfo) {
return super.query(inInfo,HGKC012.QUERY,new HGKC012());
}
}
...@@ -35,33 +35,15 @@ ...@@ -35,33 +35,15 @@
</sql> </sql>
<sql id="condition"> <sql id="condition">
<isNotEmpty prepend=" AND " property="id"> <include refid="HGXSDataAuth.authCondition"/>
ID = #id# <include refid="idCondition"/>
</isNotEmpty> <include refid="customCondition"/>
<isNotEmpty prepend=" AND " property="accountCode"> <isNotEmpty prepend=" AND " property="accountCode">
ACCOUNT_CODE = #accountCode# ACCOUNT_CODE = #accountCode#
</isNotEmpty> </isNotEmpty>
<isNotEmpty prepend=" AND " property="depCode"> <isNotEmpty prepend=" AND " property="depCode">
DEP_CODE = #depCode# DEP_CODE = #depCode#
</isNotEmpty> </isNotEmpty>
<isNotEmpty prepend=" AND " property="createdBy">
CREATED_BY = #createdBy#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="createdName">
CREATED_NAME = #createdName#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="createdTime">
CREATED_TIME = #createdTime#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="updatedBy">
UPDATED_BY = #updatedBy#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="updatedName">
UPDATED_NAME = #updatedName#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="updatedTime">
UPDATED_TIME = #updatedTime#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="deleteFlag"> <isNotEmpty prepend=" AND " property="deleteFlag">
DELETE_FLAG = #deleteFlag# DELETE_FLAG = #deleteFlag#
</isNotEmpty> </isNotEmpty>
...@@ -98,24 +80,6 @@ ...@@ -98,24 +80,6 @@
<isNotEmpty prepend=" AND " property="unit"> <isNotEmpty prepend=" AND " property="unit">
UNIT = #unit# UNIT = #unit#
</isNotEmpty> </isNotEmpty>
<isNotEmpty prepend=" AND " property="length">
LENGTH = #length#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="width">
WIDTH = #width#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="thick">
THICK = #thick#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="invQty">
INV_QTY = #invQty#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="invUnitWeight">
INV_UNIT_WEIGHT = #invUnitWeight#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="invWeight">
INV_WEIGHT = #invWeight#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="factoryCode"> <isNotEmpty prepend=" AND " property="factoryCode">
FACTORY_CODE = #factoryCode# FACTORY_CODE = #factoryCode#
</isNotEmpty> </isNotEmpty>
...@@ -133,6 +97,11 @@ ...@@ -133,6 +97,11 @@
</isNotEmpty> </isNotEmpty>
</sql> </sql>
<sql id="customCondition">
<include refid="BaseCondition.specCondition"/>
<include refid="BaseCondition.createdTimeCondition"/>
</sql>
<sql id="orderBy"> <sql id="orderBy">
<dynamic prepend="ORDER BY"> <dynamic prepend="ORDER BY">
<isNotEmpty property="orderBy"> <isNotEmpty property="orderBy">
......
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE sqlMap PUBLIC "-//iBATIS.com//DTD SQL Map 2.0//EN" "http://www.ibatis.com/dtd/sql-map-2.dtd">
<sqlMap namespace="HGKC011">
<sql id="column">
ID as "id",
ACCOUNT_CODE as "accountCode", <!-- 企业编码 -->
DEP_CODE as "depCode", <!-- 部门编码 -->
CREATED_BY as "createdBy", <!-- 记录创建者 -->
CREATED_NAME as "createdName", <!-- 记录创建名称 -->
CREATED_TIME as "createdTime", <!-- 记录创建时间 -->
UPDATED_BY as "updatedBy", <!-- 记录修改者 -->
UPDATED_NAME as "updatedName", <!-- 记录修改名称 -->
UPDATED_TIME as "updatedTime", <!-- 记录修改时间 -->
DELETE_FLAG as "deleteFlag", <!-- 0-未删除,1-已删除 -->
COMPANY_CODE as "companyCode", <!-- 公司编码 -->
COMPANY_NAME as "companyName", <!-- 公司名称 -->
WH_CODE as "whCode", <!-- 仓库编码 -->
WH_NAME as "whName", <!-- 仓库名称 -->
PROD_ORDER_NO as "prodOrderNo", <!-- 生产订单号 -->
PROJ_CODE as "projCode", <!-- 项目编码 -->
PROJ_NAME as "projName", <!-- 项目名称 -->
INVENT_CODE as "inventCode", <!-- 部件编码 -->
INVENT_NAME as "inventName", <!-- 部件名称 -->
SUB_INVENT_CODE as "subInventCode", <!-- 零部件编码 -->
SUB_INVENT_NAME as "subInventName", <!-- 零部件名称 -->
SPEC as "spec", <!-- 规格 -->
LENGTH as "length", <!-- 长 -->
WIDTH as "width", <!-- 宽 -->
THICK as "thick", <!-- 厚 -->
INV_QTY as "invQty", <!-- 数量 -->
INV_UNIT_WEIGHT as "invUnitWeight", <!-- 单重 -->
INV_WEIGHT as "invWeight", <!-- 重量 -->
REMARK as "remark", <!-- 备注 -->
FACTORY_CODE as "factoryCode", <!-- 厂区编码 -->
FACTORY_NAME as "factoryName" <!-- 厂区名称 -->
</sql>
<sql id="condition">
AND DELETE_FLAG = 0
<include refid="HGXSDataAuth.authCondition"/>
<include refid="idCondition"/>
<include refid="customCondition"/>
<isNotEmpty prepend=" AND " property="accountCode">
ACCOUNT_CODE = #accountCode#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="depCode">
DEP_CODE = #depCode#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="companyCode">
COMPANY_CODE = #companyCode#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="companyName">
COMPANY_NAME = #companyName#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="whCode">
WH_CODE = #whCode#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="whName">
WH_NAME = #whName#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="prodOrderNo">
PROD_ORDER_NO = #prodOrderNo#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="projCode">
PROJ_CODE = #projCode#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="projName">
PROJ_NAME = #projName#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="inventCode">
INVENT_CODE = #inventCode#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="inventName">
INVENT_NAME = #inventName#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="subInventCode">
SUB_INVENT_CODE = #subInventCode#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="subInventName">
SUB_INVENT_NAME = #subInventName#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="spec">
SPEC = #spec#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="factoryCode">
FACTORY_CODE = #factoryCode#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="factoryName">
FACTORY_NAME = #factoryName#
</isNotEmpty>
</sql>
<sql id="idCondition">
<isNotEmpty prepend=" AND " property="id">
ID = #id#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="ids">
ID IN <iterate close=")" open="(" conjunction="," property="ids">#ids[]#</iterate>
</isNotEmpty>
</sql>
<sql id="customCondition">
<include refid="BaseCondition.specCondition"/>
<include refid="BaseCondition.createdTimeCondition"/>
</sql>
<sql id="orderBy">
<dynamic prepend="ORDER BY">
<isNotEmpty property="orderBy">
$orderBy$
</isNotEmpty>
<isEmpty property="orderBy">
ID DESC
</isEmpty>
</dynamic>
</sql>
<select id="query" resultClass="com.baosight.hggp.hg.kc.domain.HGKC011">
SELECT
<include refid="column"/>
FROM ${hggpSchema}.HGKC011 WHERE 1=1
<include refid="condition"/>
<include refid="orderBy"/>
</select>
<select id="count" resultClass="int">
SELECT COUNT(*) FROM ${hggpSchema}.HGKC011 WHERE 1=1
<include refid="condition"/>
</select>
<insert id="insert">
INSERT INTO ${hggpSchema}.HGKC011 (
ACCOUNT_CODE, <!-- 企业编码 -->
DEP_CODE, <!-- 部门编码 -->
CREATED_BY, <!-- 记录创建者 -->
CREATED_NAME, <!-- 记录创建名称 -->
CREATED_TIME, <!-- 记录创建时间 -->
DELETE_FLAG, <!-- 0-未删除,1-已删除 -->
COMPANY_CODE, <!-- 公司编码 -->
COMPANY_NAME, <!-- 公司名称 -->
WH_CODE, <!-- 仓库编码 -->
WH_NAME, <!-- 仓库名称 -->
PROD_ORDER_NO, <!-- 生产订单号 -->
PROJ_CODE, <!-- 项目编码 -->
PROJ_NAME, <!-- 项目名称 -->
INVENT_CODE, <!-- 部件编码 -->
INVENT_NAME, <!-- 部件名称 -->
SUB_INVENT_CODE, <!-- 零部件编码 -->
SUB_INVENT_NAME, <!-- 零部件名称 -->
SPEC, <!-- 规格 -->
LENGTH, <!-- 长 -->
WIDTH, <!-- 宽 -->
THICK, <!-- 厚 -->
INV_QTY, <!-- 数量 -->
INV_UNIT_WEIGHT, <!-- 单重 -->
INV_WEIGHT, <!-- 重量 -->
REMARK, <!-- 备注 -->
FACTORY_CODE, <!-- 厂区编码 -->
FACTORY_NAME <!-- 厂区名称 -->
) VALUES (
#id#, #accountCode#, #depCode#, #createdBy#, #createdName#, #createdTime#,
#deleteFlag#, #companyCode#, #companyName#, #whCode#, #whName#, #prodOrderNo#, #projCode#,
#projName#, #inventCode#, #inventName#, #subInventCode#, #subInventName#,
#spec#, #length#, #width#, #thick#, #invQty#, #invUnitWeight#, #invWeight#,
#remark#, #factoryCode#, #factoryName#
)
</insert>
<delete id="delete">
DELETE FROM ${hggpSchema}.HGKC011 WHERE ID = #id#
</delete>
<!-- 锁 -->
<update id="lock">
UPDATE ${hggpSchema}.HGKC011
SET CREATED_TIME = CREATED_TIME
WHERE 1=1
AND ACCOUNT_CODE = #accountCode#
AND COMPANY_CODE = #companyCode#
AND WH_CODE = #whCode#
AND PROD_ORDER_NO = #prodOrderNo#
</update>
<!-- 锁 -->
<update id="locks">
UPDATE ${hggpSchema}.HGKC011
SET CREATED_TIME = CREATED_TIME
WHERE 1=1
<include refid="idCondition"/>
</update>
<!-- 更新库存 -->
<update id="updateInv">
UPDATE ${hggpSchema}.HGKC011
SET
INV_QTY = #invQty#, <!-- 库存数量 -->
INV_UNIT_WEIGHT = #invUnitWeight#, <!-- 库存单重 -->
INV_WEIGHT = #invWeight# <!-- 库存重量 -->
WHERE ID = #id#
</update>
</sqlMap>
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE sqlMap PUBLIC "-//ibatis.apache.org//DTD SQL Map 2.0//EN" "http://ibatis.apache.org/dtd/sql-map-2.dtd">
<sqlMap namespace="HGKC012">
<sql id="column">
A.ID as "id",
A.COMPANY_CODE as "companyCode", <!-- 企业编码 -->
A.DEP_CODE as "depCode", <!-- 部门编码 -->
A.CREATED_BY as "createdBy", <!-- 记录创建者 -->
A.CREATED_NAME as "createdName", <!-- 记录创建名称 -->
A.CREATED_TIME as "createdTime", <!-- 记录创建时间 -->
A.UPDATED_BY as "updatedBy", <!-- 记录修改者 -->
A.UPDATED_NAME as "updatedName", <!-- 记录修改名称 -->
A.UPDATED_TIME as "updatedTime", <!-- 记录修改时间 -->
A.COMPANY_CODE as "companyCode", <!-- 公司编码 -->
A.COMPANY_NAME as "companyName", <!-- 公司名称 -->
A.WH_CODE as "whCode", <!-- 仓库编码 -->
A.WH_NAME as "whName", <!-- 仓库名称 -->
A.INVENT_TYPE as "inventType", <!-- 存货类型 -->
A.INVENT_CODE as "inventCode", <!-- 存货编码 -->
A.INVENT_NAME as "inventName", <!-- 存货名称 -->
A.SPEC_ID as "specId", <!-- 规格ID -->
A.SPEC as "spec", <!-- 规格 -->
A.MATERIAL as "material", <!-- 材质 -->
A.UNIT as "unit", <!-- 单位 -->
A.LENGTH as "length", <!-- 长度 -->
A.WIDTH as "width", <!-- 宽度 -->
A.THICK as "thick", <!-- 厚度 -->
A.INV_QTY as "invQty", <!-- 库存数量 -->
A.INV_UNIT_WEIGHT as "invUnitWeight", <!-- 库存单重 -->
A.INV_WEIGHT as "invWeight", <!-- 库存重量 -->
A.FACTORY_CODE as "factoryCode", <!-- 厂区编码 -->
A.FACTORY_NAME as "factoryName", <!-- 厂区名称 -->
B.WARN_NUM as warnNum, <!-- 预警值 -->
C.PRINC as "princ" <!-- 负责人 -->
</sql>
<sql id="authCondition">
<!-- 无权限时使用 -->
<isNotEmpty prepend=" AND " property="authDepCode">
A.DEP_CODE = #authDepCode#
</isNotEmpty>
<!-- 仅本人和部门组合 -->
<isEqual prepend=" AND " property="authCombination" compareValue="1">
(A.CREATED_BY = #authOnlyPeople# OR A.DEP_CODE IN <iterate close=")" open="(" conjunction="," property="authDepCodes">#authDepCodes[]#</iterate>)
</isEqual>
<!-- 仅本人或部门 -->
<isNotEqual prepend=" AND " property="authCombination" compareValue="1">
<isNotEmpty property="authOnlyPeople">
A.CREATED_BY = #authOnlyPeople#
</isNotEmpty>
<isNotEmpty property="authDepCodes">
A.DEP_CODE IN <iterate close=")" open="(" conjunction="," property="authDepCodes">#authDepCodes[]#</iterate>
</isNotEmpty>
</isNotEqual>
</sql>
<sql id="condition">
<include refid="authCondition"/>
<isNotEmpty prepend=" AND " property="specId">
A.SPEC_ID = #specId#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="whCode">
A.WH_CODE = #whCode#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="whName">
A.WH_NAME LIKE '%' || #whName# || '%'
</isNotEmpty>
<isNotEmpty prepend=" AND " property="inventType">
A.INVENT_TYPE = #inventType#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="inventCode">
A.INVENT_CODE = #inventCode#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="inventName">
A.INVENT_NAME = #inventName#
</isNotEmpty>
</sql>
<!--<sql id="customCondition">
<isNotEmpty prepend=" AND " property="inventTypes">
A.INVENT_TYPE IN <iterate close=")" open="(" conjunction="," property="inventTypes">#inventTypes[]#</iterate>
</isNotEmpty>
<isNotEmpty prepend=" AND " property="spec">
<isEqual property="spec" compareValue="无规格">
A.SPEC_ID IN (SELECT ID FROM ${hggpSchema}.HGPZ006 WHERE SPEC = '')
</isEqual>
<isNotEqual property="spec" compareValue="无规格">
A.SPEC_ID IN (SELECT ID FROM ${hggpSchema}.HGPZ006 WHERE SPEC = #spec#)
</isNotEqual>
</isNotEmpty>
</sql>-->
<sql id="order">
<dynamic prepend="ORDER BY">
<isNotEmpty property="order">
$order$
</isNotEmpty>
<isEmpty property="order">
A.CREATED_TIME DESC, A.ID DESC
</isEmpty>
</dynamic>
</sql>
<select id="query" parameterClass="java.util.HashMap" resultClass="com.baosight.hggp.hg.kc.domain.HGKC012">
SELECT <include refid="column"/>
FROM ${hggpSchema}.HGKC010 A
INNER JOIN ${hggpSchema}.HGPZ010 B ON A.SPEC_ID = B.INVENT_RECORD_ID
LEFT JOIN ${hggpSchema}.hgpz007 C ON A.WH_CODE = C.WH_CODE
WHERE A.INV_QTY &lt;= B.WARN_NUM
<include refid="authCondition"/>
<isNotEmpty prepend=" AND " property="spec">
A.SPEC = #spec#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="specId">
A.SPEC_ID = #specId#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="whCode">
A.WH_CODE = #whCode#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="whName">
A.WH_NAME LIKE '%' || #whName# || '%'
</isNotEmpty>
<isNotEmpty prepend=" AND " property="inventType">
A.INVENT_TYPE = #inventType#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="inventCode">
A.INVENT_CODE = #inventCode#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="inventName">
A.INVENT_NAME = #inventName#
</isNotEmpty>
<include refid="order"/>
</select>
</sqlMap>
\ No newline at end of file
...@@ -4,7 +4,9 @@ import com.baosight.hggp.core.dao.DaoBase; ...@@ -4,7 +4,9 @@ import com.baosight.hggp.core.dao.DaoBase;
import com.baosight.hggp.hg.constant.HGSqlConstant; import com.baosight.hggp.hg.constant.HGSqlConstant;
import com.baosight.hggp.hg.kc.domain.HGKC001; import com.baosight.hggp.hg.kc.domain.HGKC001;
import com.baosight.hggp.hg.kc.domain.HGKC002; import com.baosight.hggp.hg.kc.domain.HGKC002;
import com.baosight.hggp.hg.kc.domain.HGKC003;
import com.baosight.hggp.hg.kc.domain.HGKC010; import com.baosight.hggp.hg.kc.domain.HGKC010;
import com.baosight.hggp.hg.kc.domain.HGKC011;
import com.baosight.hggp.util.AssertUtils; import com.baosight.hggp.util.AssertUtils;
import com.baosight.hggp.util.StringUtils; import com.baosight.hggp.util.StringUtils;
import org.apache.commons.collections.CollectionUtils; import org.apache.commons.collections.CollectionUtils;
...@@ -118,6 +120,55 @@ public class HGKCTools { ...@@ -118,6 +120,55 @@ public class HGKCTools {
} }
/**
* HGKC003 工具类
*
* @author:songx
* @date:2024/5/15,9:49
*/
public static class HgKc003 {
/**
* 锁
*
* @param depositNos
* @return
*/
public static void lock(List<String> depositNos) {
if (CollectionUtils.isEmpty(depositNos)) {
return;
}
Map paramMap = new HashMap();
paramMap.put("depositNos", depositNos);
DaoBase.getInstance().update(HGSqlConstant.HgKc003.LOCK, paramMap);
}
/**
* 查询
*
* @param depositNos
* @return
*/
public static List<HGKC003> list(List<String> depositNos) {
AssertUtils.isEmpty(depositNos, "领用单号不能为空");
Map<String, Object> paramMap = new HashMap();
paramMap.put("depositNos", depositNos);
return DaoBase.getInstance().query(HGKC003.QUERY, paramMap);
}
/**
* 查询
*
* @param depositNos
* @return
*/
public static Map<String, HGKC003> map(List<String> depositNos) {
List<HGKC003> results = list(depositNos);
return results.stream().collect(Collectors.toMap(HGKC003::getDepositNo, item -> item));
}
}
/** /**
* HGKC010 工具类 * HGKC010 工具类
* *
...@@ -204,4 +255,89 @@ public class HGKCTools { ...@@ -204,4 +255,89 @@ public class HGKCTools {
} }
/**
* HGKC010 工具类
*
* @author:songx
* @date:2024/5/9,14:33
*/
public static class HgKc011 {
/**
* 锁
*
* @param ids
* @return
*/
public static void lock(List<Long> ids) {
if (CollectionUtils.isEmpty(ids)) {
return;
}
Map paramMap = new HashMap();
paramMap.put("ids", ids);
DaoBase.getInstance().update(HGSqlConstant.HgKc011.LOCKS, paramMap);
}
/**
* 锁
*
* @param companyCode
* @param whCode
* @param prodOrderNo
* @return
*/
public static void lock(String companyCode, String whCode, String prodOrderNo) {
if (StringUtils.isBlank(companyCode) || StringUtils.isBlank(whCode) || StringUtils.isBlank(prodOrderNo)) {
return;
}
Map paramMap = new HashMap();
paramMap.put("companyCode", companyCode);
paramMap.put("whCode", whCode);
paramMap.put("prodOrderNo", prodOrderNo);
DaoBase.getInstance().update(HGSqlConstant.HgKc011.LOCK, paramMap);
}
/**
* @param companyCode
* @param whCode
* @param prodOrderNo
*/
public static HGKC011 get(String companyCode, String whCode, String prodOrderNo) {
AssertUtils.isEmpty(companyCode, "公司编码不能为空");
AssertUtils.isEmpty(whCode, "仓库编码不能为空");
AssertUtils.isEmpty(prodOrderNo, "生产订单号不能为空");
Map paramMap = new HashMap();
paramMap.put("companyCode", companyCode);
paramMap.put("whCode", whCode);
paramMap.put("prodOrderNo", prodOrderNo);
List<HGKC011> results = DaoBase.getInstance().query(HGKC011.QUERY, paramMap);
return CollectionUtils.isEmpty(results) ? null : results.get(0);
}
/**
* 查询
*
* @param ids
* @return
*/
public static List<HGKC011> list(List<Long> ids) {
AssertUtils.isEmpty(ids, "库存ID不能为空");
Map<String, Object> paramMap = new HashMap();
paramMap.put("ids", ids);
return DaoBase.getInstance().query(HGKC011.QUERY, paramMap);
}
/**
* 查询
*
* @param ids
* @return
*/
public static Map<Long, HGKC011> map(List<Long> ids) {
List<HGKC011> results = list(ids);
return results.stream().collect(Collectors.toMap(HGKC011::getId, item -> item));
}
}
} }
...@@ -2,14 +2,16 @@ package com.baosight.hggp.hg.kc.utils; ...@@ -2,14 +2,16 @@ package com.baosight.hggp.hg.kc.utils;
import com.baosight.hggp.core.dao.DaoUtils; import com.baosight.hggp.core.dao.DaoUtils;
import com.baosight.hggp.core.enums.DeleteFlagEnum; import com.baosight.hggp.core.enums.DeleteFlagEnum;
import com.baosight.hggp.hg.cg.utils.HGCGUtils;
import com.baosight.hggp.hg.constant.HGSqlConstant; import com.baosight.hggp.hg.constant.HGSqlConstant;
import com.baosight.hggp.hg.kc.domain.HGKC001; import com.baosight.hggp.hg.kc.domain.HGKC001;
import com.baosight.hggp.hg.kc.domain.HGKC002; import com.baosight.hggp.hg.kc.domain.HGKC002;
import com.baosight.hggp.hg.kc.domain.HGKC003;
import com.baosight.hggp.hg.kc.domain.HGKC010; import com.baosight.hggp.hg.kc.domain.HGKC010;
import com.baosight.hggp.hg.kc.domain.HGKC011;
import com.baosight.hggp.hg.kc.tools.HGKCTools; import com.baosight.hggp.hg.kc.tools.HGKCTools;
import com.baosight.hggp.hg.pz.domain.HGPZ005; import com.baosight.hggp.hg.pz.domain.HGPZ005;
import com.baosight.hggp.hg.pz.tools.HGPZTools; import com.baosight.hggp.hg.pz.tools.HGPZTools;
import com.baosight.hggp.hg.utils.HGUtils;
import com.baosight.hggp.hg.xs.tools.HGXSTools; import com.baosight.hggp.hg.xs.tools.HGXSTools;
import com.baosight.hggp.util.AssertUtils; import com.baosight.hggp.util.AssertUtils;
import com.baosight.hggp.util.DateUtils; import com.baosight.hggp.util.DateUtils;
...@@ -43,7 +45,7 @@ public class HGKCUtils { ...@@ -43,7 +45,7 @@ public class HGKCUtils {
* @return * @return
*/ */
public static void setCondition(Map queryRow) { public static void setCondition(Map queryRow) {
HGCGUtils.setCondition(queryRow); HGUtils.setCondition(queryRow);
// 入库日期 // 入库日期
String depositDate = MapUtils.getString(queryRow, HGKC001.FIELD_DEPOSIT_DATE); String depositDate = MapUtils.getString(queryRow, HGKC001.FIELD_DEPOSIT_DATE);
if (StringUtils.isNotBlank(depositDate)) { if (StringUtils.isNotBlank(depositDate)) {
...@@ -90,7 +92,7 @@ public class HGKCUtils { ...@@ -90,7 +92,7 @@ public class HGKCUtils {
* @return * @return
*/ */
public static void setCondition(Map queryRow) { public static void setCondition(Map queryRow) {
HGCGUtils.setCondition(queryRow); HGUtils.setCondition(queryRow);
// 单据日期 // 单据日期
String receiptDate = MapUtils.getString(queryRow, HGKC002.FIELD_RECEIPT_DATE); String receiptDate = MapUtils.getString(queryRow, HGKC002.FIELD_RECEIPT_DATE);
if (StringUtils.isNotBlank(receiptDate)) { if (StringUtils.isNotBlank(receiptDate)) {
...@@ -123,6 +125,53 @@ public class HGKCUtils { ...@@ -123,6 +125,53 @@ public class HGKCUtils {
} }
/** /**
* HGKC003 工具类
*
* @author:songx
* @date:2024/5/9,16:58
*/
public static class HgKc003 {
/**
* 设置查询条件
*
* @param queryRow 集合
* @return
*/
public static void setCondition(Map queryRow) {
HGUtils.setCondition(queryRow);
// 收货日期
String depositDate = MapUtils.getString(queryRow, HGKC003.FIELD_DEPOSIT_DATE);
if (StringUtils.isNotBlank(depositDate)) {
queryRow.put(HGKC003.FIELD_DEPOSIT_DATE, DateUtils.formatShort(depositDate));
}
}
/**
* 锁并且获取数据
*
* @param kc003s
* @return
*/
public static Map<String, HGKC003> lockGetDataEp(List<? extends HGKC003> kc003s) {
return lockGetData(ObjectUtils.listEpKey(kc003s, HGKC003.FIELD_DEPOSIT_NO));
}
/**
* 锁并且获取数据
*
* @param depositNos
* @return
*/
public static Map<String, HGKC003> lockGetData(List<String> depositNos) {
// 锁
HGKCTools.HgKc003.lock(depositNos);
// db数据
return HGKCTools.HgKc003.map(depositNos);
}
}
/**
* HGKC010 工具类 * HGKC010 工具类
* *
* @author:songx * @author:songx
...@@ -280,4 +329,162 @@ public class HGKCUtils { ...@@ -280,4 +329,162 @@ public class HGKCUtils {
} }
} }
/**
* HGKC011 工具类
*
* @author:songx
* @date:2024/5/9,16:58
*/
public static class HgKc011 {
/**
* 更新库存
*
* @param companyCode
* @param whCode
* @param prodOrderNo
* @param qty
* @param weight
*/
public static void updateInv(String companyCode, String whCode, String prodOrderNo, BigDecimal qty,
BigDecimal weight) {
updateInv(companyCode, whCode, prodOrderNo, qty, null, weight);
}
/**
* 更新库存
*
* @param companyCode
* @param whCode
* @param prodOrderNo
* @param qty
* @param unitWeight
* @param weight
*/
public static void updateInv(String companyCode, String whCode, String prodOrderNo, BigDecimal qty,
BigDecimal unitWeight, BigDecimal weight) {
HGKC011 newKc011 = buildBean(companyCode, whCode, prodOrderNo, qty, unitWeight, weight);
// 参数校验
checkUpdateInv(companyCode, whCode, prodOrderNo, qty, weight);
// 锁库存
HGKCTools.HgKc011.lock(companyCode, whCode, prodOrderNo);
// 获取DB数据
HGKC011 dbKc011 = HGKCTools.HgKc011.get(companyCode, whCode, prodOrderNo);
if (dbKc011 == null) {
addInvData(newKc011);
} else {
updateInvData(newKc011, dbKc011);
}
}
/**
* 构建对象
*
* @param companyCode
* @param whCode
* @param prodOrderNo
* @param qty
* @param unitWeight
* @param weight
* @return
*/
private static HGKC011 buildBean(String companyCode, String whCode, String prodOrderNo, BigDecimal qty,
BigDecimal unitWeight, BigDecimal weight) {
HGKC011 newKc011 = new HGKC011();
newKc011.setCompanyCode(companyCode);
newKc011.setWhCode(whCode);
newKc011.setProdOrderNo(prodOrderNo);
newKc011.setInvQty(qty);
newKc011.setInvUnitWeight(unitWeight);
newKc011.setInvWeight(weight);
return newKc011;
}
/**
* 参数校验
*
* @param companyCode
* @param whCode
* @param prodOrderNo
* @param qty
* @param weight
*/
private static void checkUpdateInv(String companyCode, String whCode, String prodOrderNo, BigDecimal qty,
BigDecimal weight) {
AssertUtils.isEmpty(companyCode, "公司编码不能为空");
AssertUtils.isEmpty(whCode, "仓库编码不能为空");
AssertUtils.isEmpty(prodOrderNo, "生产订单号不能为空");
AssertUtils.isNull(qty, "库存变更数量不能为空");
AssertUtils.isNull(weight, "库存变更重量不能为空");
AssertUtils.isTrue(qty.compareTo(BigDecimal.ZERO) == 0
&& weight.compareTo(BigDecimal.ZERO) == 0, "库存变更数量和重量不能为0");
}
/**
* 新增库存
*
* @param newKc011
*/
private static void addInvData(HGKC011 newKc011) {
// 公司
newKc011.setCompanyName(HGXSTools.XsOrg.get(newKc011.getCompanyCode()).getOrgCname());
// 仓库
newKc011.setWhName(HGPZTools.HgPz007.get(newKc011.getWhCode()).getWhName());
// 生产订单信息
// HGPZ005 dbPz005 = HGPZTools.HgPz005.get(newKc011.getProdOrderNo());
// newKc011.setInventType(dbPz005.getInventType());
// newKc011.setInventCode(dbPz005.getInventCode());
// newKc011.setInventName(dbPz005.getInventName());
// newKc011.setSpec(dbPz005.getSpec());
// newKc011.setLength(dbPz005.getLength());
// newKc011.setWidth(dbPz005.getWidth());
// newKc011.setThick(dbPz005.getThick());
newKc011.setDeleteFlag(DeleteFlagEnum.UN_REMOVE.getCode());
DaoUtils.insert(HGKC011.INSERT, newKc011);
}
/**
* 修改库存
*
* @param newKc011
* @param dbKc011
*/
private static void updateInvData(HGKC011 newKc011, HGKC011 dbKc011) {
BigDecimal newQty = newKc011.getInvQty().add(dbKc011.getInvQty());
AssertUtils.isGt(BigDecimal.ZERO, newQty, String.format("更新后的库存数量小于0(%s),请检查", newQty));
BigDecimal newWeight = newKc011.getInvWeight().add(dbKc011.getInvWeight());
AssertUtils.isGt(BigDecimal.ZERO, newWeight, String.format("更新后的库存重量小于0(%s),请检查", newWeight));
BigDecimal newUnitWeight = newQty.compareTo(BigDecimal.ZERO) == 0 ? BigDecimal.ZERO
: newWeight.divide(newQty, 3, RoundingMode.HALF_UP);
dbKc011.setInvQty(newQty);
dbKc011.setInvWeight(newWeight);
dbKc011.setInvUnitWeight(newUnitWeight);
DaoUtils.update(HGSqlConstant.HgKc011.UPDATE_INV, dbKc011);
}
/**
* 锁并且获取数据
*
* @param kc010s
* @return
*/
public static Map<Long, HGKC010> lockGetDataEp(List<? extends HGKC010> kc010s) {
return lockGetData(ObjectUtils.listEpKey(kc010s, HGKC010.FIELD_ID));
}
/**
* 锁并且获取数据
*
* @param ids
* @return
*/
public static Map<Long, HGKC010> lockGetData(List<Long> ids) {
// 锁
HGKCTools.HgKc010.lock(ids);
// db数据
return HGKCTools.HgKc010.map(ids);
}
}
} }
...@@ -43,6 +43,7 @@ public class HGPZ005 extends DaoEPBase { ...@@ -43,6 +43,7 @@ public class HGPZ005 extends DaoEPBase {
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"; /* 是否删除0.否1.是*/ public static final String FIELD_DELETE_FLAG = "deleteFlag"; /* 是否删除0.否1.是*/
public static final String FIELD_FLOW_ID = "flowId";
public static final String COL_ID = "ID"; public static final String COL_ID = "ID";
public static final String COL_ACCOUNT_CODE = "ACCOUNT_CODE"; /* 帐套编码*/ public static final String COL_ACCOUNT_CODE = "ACCOUNT_CODE"; /* 帐套编码*/
...@@ -70,6 +71,7 @@ public class HGPZ005 extends DaoEPBase { ...@@ -70,6 +71,7 @@ public class HGPZ005 extends DaoEPBase {
public static final String COUNT = "HGPZ005.count"; public static final String COUNT = "HGPZ005.count";
public static final String INSERT = "HGPZ005.insert"; public static final String INSERT = "HGPZ005.insert";
public static final String UPDATE = "HGPZ005.update"; public static final String UPDATE = "HGPZ005.update";
public static final String UPDATE_FLOW_ID = "HGPZ005.updateFlowId";
public static final String DELETE = "HGPZ005.delete"; public static final String DELETE = "HGPZ005.delete";
private Long id = new Long(0); private Long id = new Long(0);
...@@ -93,6 +95,7 @@ public class HGPZ005 extends DaoEPBase { ...@@ -93,6 +95,7 @@ public class HGPZ005 extends DaoEPBase {
private String updatedName = " "; /* 更新人名称*/ private String updatedName = " "; /* 更新人名称*/
private String updatedTime = " "; /* 更新时间*/ private String updatedTime = " "; /* 更新时间*/
private Integer deleteFlag = 0; /* 是否删除0.否1.是*/ private Integer deleteFlag = 0; /* 是否删除0.否1.是*/
private Long flowId = new Long(0); /*工艺流程ID*/
/** /**
* initialize the metadata. * initialize the metadata.
...@@ -197,6 +200,9 @@ public class HGPZ005 extends DaoEPBase { ...@@ -197,6 +200,9 @@ public class HGPZ005 extends DaoEPBase {
eiColumn.setDescName("是否删除0.否1.是"); eiColumn.setDescName("是否删除0.否1.是");
eiMetadata.addMeta(eiColumn); eiMetadata.addMeta(eiColumn);
eiColumn = new EiColumn(FIELD_FLOW_ID);
eiColumn.setDescName("工艺流程ID");
eiMetadata.addMeta(eiColumn);
} }
...@@ -543,6 +549,15 @@ public class HGPZ005 extends DaoEPBase { ...@@ -543,6 +549,15 @@ public class HGPZ005 extends DaoEPBase {
public void setDeleteFlag(Integer deleteFlag) { public void setDeleteFlag(Integer deleteFlag) {
this.deleteFlag = deleteFlag; this.deleteFlag = deleteFlag;
} }
public Long getFlowId() {
return flowId;
}
public void setFlowId(Long flowId) {
this.flowId = flowId;
}
/** /**
* get the value from Map. * get the value from Map.
* *
...@@ -572,6 +587,7 @@ public class HGPZ005 extends DaoEPBase { ...@@ -572,6 +587,7 @@ public class HGPZ005 extends DaoEPBase {
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));
setDeleteFlag(NumberUtils.toInteger(StringUtils.toString(map.get(FIELD_DELETE_FLAG)), deleteFlag)); setDeleteFlag(NumberUtils.toInteger(StringUtils.toString(map.get(FIELD_DELETE_FLAG)), deleteFlag));
setFlowId(NumberUtils.toLong(StringUtils.toString(map.get(FIELD_FLOW_ID)), flowId));
} }
/** /**
...@@ -602,6 +618,7 @@ public class HGPZ005 extends DaoEPBase { ...@@ -602,6 +618,7 @@ public class HGPZ005 extends DaoEPBase {
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(FIELD_DELETE_FLAG, StringUtils.toString(deleteFlag, eiMetadata.getMeta(FIELD_DELETE_FLAG))); map.put(FIELD_DELETE_FLAG, StringUtils.toString(deleteFlag, eiMetadata.getMeta(FIELD_DELETE_FLAG)));
map.put(FIELD_FLOW_ID, StringUtils.toString(flowId, eiMetadata.getMeta(FIELD_FLOW_ID)));
return map; return map;
} }
......
...@@ -4,9 +4,17 @@ import com.baosight.hggp.aspect.annotation.OperationLogAnnotation; ...@@ -4,9 +4,17 @@ import com.baosight.hggp.aspect.annotation.OperationLogAnnotation;
import com.baosight.hggp.common.DdynamicEnum; import com.baosight.hggp.common.DdynamicEnum;
import com.baosight.hggp.core.constant.CommonConstant; import com.baosight.hggp.core.constant.CommonConstant;
import com.baosight.hggp.core.dao.DaoUtils; import com.baosight.hggp.core.dao.DaoUtils;
import com.baosight.hggp.core.enums.OrgTypeEnum;
import com.baosight.hggp.core.security.UserSessionUtils;
import com.baosight.hggp.hg.constant.HGConstant; import com.baosight.hggp.hg.constant.HGConstant;
import com.baosight.hggp.hg.pz.domain.HGPZ005; import com.baosight.hggp.hg.pz.domain.HGPZ005;
import com.baosight.hggp.hg.pz.domain.HGPZ005A;
import com.baosight.hggp.hg.sb.domain.HGSB002;
import com.baosight.hggp.hg.pz.tools.HGPZTools; import com.baosight.hggp.hg.pz.tools.HGPZTools;
import com.baosight.hggp.hg.sj.domain.HGSJ002;
import com.baosight.hggp.hg.sj.domain.HGSJ002A;
import com.baosight.hggp.hg.sj.domain.HGSJ003;
import com.baosight.hggp.hg.sj.tools.HGSJTools;
import com.baosight.hggp.hg.xs.tools.HGXSTools; import com.baosight.hggp.hg.xs.tools.HGXSTools;
import com.baosight.hggp.util.*; import com.baosight.hggp.util.*;
import com.baosight.hggp.util.contants.ACConstants; import com.baosight.hggp.util.contants.ACConstants;
...@@ -19,6 +27,7 @@ import com.baosight.iplat4j.core.service.soa.XLocalManager; ...@@ -19,6 +27,7 @@ import com.baosight.iplat4j.core.service.soa.XLocalManager;
import com.baosight.iplat4j.core.web.threadlocal.UserSession; import com.baosight.iplat4j.core.web.threadlocal.UserSession;
import com.baosight.iplat4j.ed.util.SequenceGenerator; import com.baosight.iplat4j.ed.util.SequenceGenerator;
import java.math.BigDecimal;
import java.util.*; import java.util.*;
/** /**
...@@ -238,7 +247,6 @@ public class ServiceHGPZ005 extends ServiceBase { ...@@ -238,7 +247,6 @@ public class ServiceHGPZ005 extends ServiceBase {
return inInfo; return inInfo;
} }
/** /**
* 下拉框 * 下拉框
* *
...@@ -256,5 +264,63 @@ public class ServiceHGPZ005 extends ServiceBase { ...@@ -256,5 +264,63 @@ public class ServiceHGPZ005 extends ServiceBase {
} }
return inInfo; return inInfo;
} }
@OperationLogAnnotation(operModul = "存货档案",operType = "导入",operDesc = "导入操作")
public EiInfo importDate(EiInfo inInfo) {
try {
Map<String, Object> params = new HashMap<>(10);
String fileName = inInfo.getString("fileName");
params.put(HGPZ005.FIELD_ACCOUNT_CODE, UserSessionUtils.getAccountCode());
//解析文件,将文件中数据传入到inInfo中
ExcelUtils.importFromExcel(inInfo, fileName, params, new HGPZ005());
}catch (Exception e){
inInfo.setStatus(EiConstant.STATUS_FAILURE);
LogUtils.setDetailMsg(inInfo, e, "导入失败");
}
return inInfo;
}
@OperationLogAnnotation(operModul = "存货档案", operType = "修改", operDesc = "绑定流程")
public EiInfo updateFlowId(EiInfo inInfo) {
try {
List<Map> resultRows = inInfo.getBlock(EiConstant.resultBlock).getRows();
for (Map resultRow : resultRows) {
HGPZ005 hgpz005 = new HGPZ005();
hgpz005.fromMap(resultRow);
HGSJ002 hgsj002 = new HGSJ002();
hgsj002.fromMap((Map) resultRow.get("flow"));
hgpz005.setFlowId(hgsj002.getId());
DaoUtils.update(HGPZ005.UPDATE_FLOW_ID, hgpz005);
addHgpz005a(hgpz005,hgsj002);
}
inInfo.setStatus(EiConstant.STATUS_DEFAULT);
inInfo.setMsg("操作成功!本次对[" + resultRows.size() + "]条数据修改成功!");
} catch (Exception e) {
LogUtils.setDetailMsg(inInfo, e, "修改失败");
}
return inInfo;
}
/**
* 添加流程详情
* @param hppz005
*/
public void addHgpz005a (HGPZ005 hppz005,HGSJ002 hgsj002){
DaoUtils.update(HGPZ005A.DELETE_PARENT_ID,new HashMap<String,Object>(){{put(HGPZ005A.FIELD_PARENT_ID,hppz005.getId());}});
//流程详情
List<HGSJ002A> hgsb002AList = HGSJTools.Hgsj002a.list(hgsj002.getId());
for (HGSJ002A hgsj002a: hgsb002AList) {
HGPZ005A hgpz005A = new HGPZ005A();
hgpz005A.setCompanyCode(hgsj002.getFactoryCode());
hgpz005A.setCompanyName(hgsj002.getFactoryName());
hgpz005A.setProcessCode(hgsj002a.getProcessCode());
hgpz005A.setProcessName(hgsj002a.getProcessName());
hgpz005A.setInventCode(hppz005.getInventCode());
hgpz005A.setUnitCoeff(BigDecimal.ONE);
hgpz005A.setComposingCoeff(BigDecimal.ONE);
hgpz005A.setParentId(hppz005.getId());
DaoUtils.insert(HGPZ005A.INSERT,hgpz005A.toMap());
}
}
} }
package com.baosight.hggp.hg.pz.service;
import com.baosight.hggp.aspect.annotation.OperationLogAnnotation;
import com.baosight.hggp.common.DdynamicEnum;
import com.baosight.hggp.core.constant.CommonConstant;
import com.baosight.hggp.core.dao.DaoUtils;
import com.baosight.hggp.hg.constant.HGConstant;
import com.baosight.hggp.hg.pz.domain.HGPZ005A;
import com.baosight.hggp.hg.sj.domain.HGSJ003;
import com.baosight.hggp.util.CommonMethod;
import com.baosight.hggp.util.ErrorCodeUtils;
import com.baosight.hggp.util.LogUtils;
import com.baosight.hggp.util.contants.ACConstants;
import com.baosight.iplat4j.core.ei.EiBlock;
import com.baosight.iplat4j.core.ei.EiConstant;
import com.baosight.iplat4j.core.ei.EiInfo;
import com.baosight.iplat4j.core.exception.PlatException;
import com.baosight.iplat4j.core.resource.I18nMessages;
import com.baosight.iplat4j.core.service.impl.ServiceEPBase;
import com.baosight.iplat4j.ed.util.SequenceGenerator;
import org.springframework.security.core.parameters.P;
import java.util.*;
import java.util.stream.Collectors;
/**
* @author LiuYang
* @version 1.0 2024/5/15
*/
public class ServiceHGPZ005A extends ServiceEPBase {
@Override
public EiInfo initLoad(EiInfo inInfo) {
inInfo.setCell(EiConstant.queryBlock, ACConstants.ROW_CODE_0, HGPZ005A.FIELD_DELETE_FLAG, CommonConstant.YesNo.NO_0);
inInfo = super.query(inInfo, HGPZ005A.QUERY, new HGPZ005A());
CommonMethod.initBlock(inInfo,
Arrays.asList(DdynamicEnum.PROCESS_CODE_BLOCK_ID,DdynamicEnum.ITEM_CODE_BOX_BLOCK_ID),
new HashMap<String,Object>(){{put("codesetCode","hggp.hgsj.processClass");}}
);
return inInfo;
}
@Override
public EiInfo query(EiInfo inInfo) {
inInfo.setCell(EiConstant.queryBlock, ACConstants.ROW_CODE_0, HGPZ005A.FIELD_DELETE_FLAG,CommonConstant.YesNo.NO_0);
return super.query(inInfo, HGPZ005A.QUERY);
}
@OperationLogAnnotation(operModul = "工序设置",operType = "删除",operDesc = "删除操作")
@Override
public EiInfo delete(EiInfo inInfo) {
int i = 0;
try {
HGPZ005A hgpz005A = new HGPZ005A();
EiBlock eiBlock = inInfo.getBlock(EiConstant.resultBlock);
for (i = 0; i < eiBlock.getRowCount(); i++) {
Map<?, ?> map = eiBlock.getRow(i);
hgpz005A.fromMap(map);
hgpz005A.setDeleteFlag(CommonConstant.YesNo.YES_1);
DaoUtils.update(HGPZ005A.DELETE, hgpz005A.toMap());
}
inInfo.setStatus(EiConstant.STATUS_SUCCESS);
inInfo.setMsgByKey("ep.1000", new String[]{String.valueOf(i), I18nMessages.getText("label.delete", "删除")});
} catch (PlatException e) {
e.printStackTrace();
inInfo.setStatus(EiConstant.STATUS_FAILURE);
ErrorCodeUtils.handleDeleteException(inInfo,i,e);
logError("删除失败", e.getMessage());
return inInfo;
}
return inInfo;
}
/**
* 保存操作
*/
@OperationLogAnnotation(operModul = "工序设置",operType = "保存",operDesc = "保存操作")
public EiInfo save(EiInfo inInfo) {
try {
List<Map> resultRows = inInfo.getBlock(EiConstant.resultBlock).getRows();
// 写入数据
for (Map resultRow : resultRows) {
HGPZ005A hgpz005a = new HGPZ005A();
hgpz005a.fromMap(resultRow);
if (hgpz005a.getId() == null || hgpz005a.getId() == 0) {
Long parentId = Long.valueOf(inInfo.getCellStr(EiConstant.queryBlock, ACConstants.ROW_CODE_0, HGPZ005A.FIELD_PARENT_ID));
hgpz005a.setParentId(parentId);
this.add(hgpz005a);
} else {
this.modify(hgpz005a);
}
}
inInfo.setStatus(EiConstant.STATUS_DEFAULT);
inInfo.setMsg("操作成功!本次对[" + resultRows.size() + "]条数据保存成功!");
} catch (Exception e) {
LogUtils.setDetailMsg(inInfo, e, "保存失败");
}
return inInfo;
}
/**
* 新增操作
*/
public void add(HGPZ005A hgpz005A) {
DaoUtils.insert(HGPZ005A.INSERT, hgpz005A);
}
/**
* 修改操作
*/
public void modify(HGPZ005A hgpz005A) {
DaoUtils.update(HGPZ005A.UPDATE, hgpz005A);
}
public EiInfo queryEdcm01(EiInfo inInfo){
inInfo = super.query(inInfo, HGSJ003.QUERY,new HGSJ003());
List<Object> integerList = new ArrayList<>();
List<Map> hgsj003s = inInfo.getBlock(EiConstant.resultBlock).getRows();
for (Map map:hgsj003s) {
integerList.add(map.get(HGSJ003.FIELD_PROCESS_CLASS));
}
CommonMethod.initBlock(inInfo,Arrays.asList(DdynamicEnum.ITEM_CODE_BOX_BLOCK_ID),
new HashMap<String,Object>(){{
put("codesetCode","hggp.hgsj.processClass");
put("itemCodes",integerList);
}}
);
return inInfo;
}
}
package com.baosight.hggp.hg.pz.service;
import com.baosight.hggp.common.DdynamicEnum;
import com.baosight.hggp.core.constant.CommonConstant;
import com.baosight.hggp.hg.sj.domain.HGSJ002;
import com.baosight.hggp.util.CommonMethod;
import com.baosight.hggp.util.contants.ACConstants;
import com.baosight.iplat4j.core.ei.EiConstant;
import com.baosight.iplat4j.core.ei.EiInfo;
import com.baosight.iplat4j.core.service.impl.ServiceEPBase;
import java.util.Arrays;
/**
* @author LiuYang
* @version 1.0 2024/5/15
*/
public class ServiceHGPZ005B extends ServiceEPBase {
@Override
public EiInfo initLoad(EiInfo inInfo) {
inInfo.setCell(EiConstant.queryBlock, ACConstants.ROW_CODE_0, HGSJ002.FIELD_DELETE_FLAG, CommonConstant.YesNo.NO_0);
inInfo.setCell(EiConstant.queryBlock, ACConstants.ROW_CODE_0, HGSJ002.FIELD_STATUS, CommonConstant.YesNo.YES_1);
inInfo = super.query(inInfo, HGSJ002.QUERY, new HGSJ002());
CommonMethod.initBlock(inInfo, Arrays.asList(DdynamicEnum.COMPANY_BOX_BLOCK_ID),null);
return inInfo;
}
@Override
public EiInfo query(EiInfo inInfo) {
inInfo.setCell(EiConstant.queryBlock, ACConstants.ROW_CODE_0, HGSJ002.FIELD_DELETE_FLAG,CommonConstant.YesNo.NO_0);
inInfo.setCell(EiConstant.queryBlock, ACConstants.ROW_CODE_0, HGSJ002.FIELD_STATUS, CommonConstant.YesNo.YES_1);
return super.query(inInfo, HGSJ002.QUERY, new HGSJ002());
}
}
...@@ -92,6 +92,9 @@ ...@@ -92,6 +92,9 @@
<isNotEmpty prepend=" AND " property="deleteFlag"> <isNotEmpty prepend=" AND " property="deleteFlag">
DELETE_FLAG = #deleteFlag# DELETE_FLAG = #deleteFlag#
</isNotEmpty> </isNotEmpty>
<isNotEmpty prepend=" AND " property="flowId">
FLOW_ID = #flowId#
</isNotEmpty>
</sql> </sql>
<sql id="authCondition"> <sql id="authCondition">
...@@ -137,7 +140,8 @@ ...@@ -137,7 +140,8 @@
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" <!-- 是否删除0.否1.是 --> DELETE_FLAG as "deleteFlag", <!-- 是否删除0.否1.是 -->
FLOW_ID as "flowId"
FROM ${hggpSchema}.HGPZ005 WHERE 1=1 AND DELETE_FLAG = 0 FROM ${hggpSchema}.HGPZ005 WHERE 1=1 AND DELETE_FLAG = 0
<include refid="condition" /> <include refid="condition" />
<include refid="authCondition" /> <include refid="authCondition" />
...@@ -245,9 +249,10 @@ ...@@ -245,9 +249,10 @@
UPDATED_BY, <!-- 更新人 --> UPDATED_BY, <!-- 更新人 -->
UPDATED_NAME, <!-- 更新人名称 --> UPDATED_NAME, <!-- 更新人名称 -->
UPDATED_TIME, <!-- 更新时间 --> UPDATED_TIME, <!-- 更新时间 -->
DELETE_FLAG <!-- 是否删除0.否1.是 --> DELETE_FLAG, <!-- 是否删除0.否1.是 -->
FLOW_ID
) )
VALUES (#id#, #accountCode#, #depCode#, #inventType#, #inventCode#, #inventName#, #spec#, #length#, #width#, #thick#, #material#, #coefficient#, #unit#, #status#, #createdBy#, #createdName#, #createdTime#, #updatedBy#, #updatedName#, #updatedTime#, #deleteFlag#) VALUES (#id#, #accountCode#, #depCode#, #inventType#, #inventCode#, #inventName#, #spec#, #length#, #width#, #thick#, #material#, #coefficient#, #unit#, #status#, #createdBy#, #createdName#, #createdTime#, #updatedBy#, #updatedName#, #updatedTime#, #deleteFlag#,#flowId#)
</insert> </insert>
<delete id="delete"> <delete id="delete">
...@@ -276,11 +281,23 @@ ...@@ -276,11 +281,23 @@
UPDATED_BY = #updatedBy#, <!-- 更新人 --> UPDATED_BY = #updatedBy#, <!-- 更新人 -->
UPDATED_NAME = #updatedName#, <!-- 更新人名称 --> UPDATED_NAME = #updatedName#, <!-- 更新人名称 -->
UPDATED_TIME = #updatedTime#, <!-- 更新时间 --> UPDATED_TIME = #updatedTime#, <!-- 更新时间 -->
DELETE_FLAG = #deleteFlag# <!-- 是否删除0.否1.是 --> DELETE_FLAG = #deleteFlag#, <!-- 是否删除0.否1.是 -->
FLOW_ID = #flowId#
WHERE WHERE
ID = #id# ID = #id#
</update> </update>
<update id="updateFlowId">
UPDATE ${hggpSchema}.HGPZ005
SET
UPDATED_BY = #updatedBy#, <!-- 更新人 -->
UPDATED_NAME = #updatedName#, <!-- 更新人名称 -->
UPDATED_TIME = #updatedTime#, <!-- 更新时间 -->
FLOW_ID = #flowId#
WHERE
ID = #id#
</update>
<select id="queryComboBox" parameterClass="java.util.HashMap" <select id="queryComboBox" parameterClass="java.util.HashMap"
resultClass="java.util.HashMap"> resultClass="java.util.HashMap">
SELECT DISTINCT SELECT DISTINCT
......
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE sqlMap PUBLIC "-//ibatis.apache.org//DTD SQL Map 2.0//EN" "http://ibatis.apache.org/dtd/sql-map-2.dtd">
<!-- table information
Generate time : 2024-05-15 18:59:20
Version : 1.0
schema : hggp
tableName : HGPZ005A
ID BIGINT NOT NULL primarykey,
ACCOUNT_CODE VARCHAR,
DEP_CODE VARCHAR,
CREATED_BY VARCHAR,
CREATED_NAME VARCHAR,
CREATED_TIME VARCHAR,
UPDATED_BY VARCHAR,
UPDATED_NAME VARCHAR,
UPDATED_TIME VARCHAR,
DELETE_FLAG TINYINT,
PROCESS_CODE VARCHAR NOT NULL,
PROCESS_NAME VARCHAR NOT NULL,
COMPOSING_COEFF VARCHAR,
UNIT_COEFF VARCHAR,
PARENT_ID BIGINT
-->
<sqlMap namespace="HGPZ005A">
<sql id="condition">
<isNotEmpty prepend=" AND " property="id">
ID = #id#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="accountCode">
ACCOUNT_CODE = #accountCode#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="depCode">
DEP_CODE = #depCode#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="createdBy">
CREATED_BY = #createdBy#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="createdName">
CREATED_NAME = #createdName#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="createdTime">
CREATED_TIME = #createdTime#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="updatedBy">
UPDATED_BY = #updatedBy#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="updatedName">
UPDATED_NAME = #updatedName#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="updatedTime">
UPDATED_TIME = #updatedTime#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="deleteFlag">
DELETE_FLAG = #deleteFlag#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="companyCode">
COMPANY_CODE = #companyCode#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="companyName">
COMPANY_NAME LIKE CONCAT('%', #companyName#, '%')
</isNotEmpty>
<isNotEmpty prepend=" AND " property="inventCode">
INVENT_CODE = #inventCode#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="processCode">
PROCESS_CODE = #processCode#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="processName">
PROCESS_NAME LIKE CONCAT('%', #processName#, '%')
</isNotEmpty>
<isNotEmpty prepend=" AND " property="composingCoeff">
COMPOSING_COEFF = #composingCoeff#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="unitCoeff">
UNIT_COEFF = #unitCoeff#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="processClass">
PROCESS_CLASS = #processClass#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="parentId">
PARENT_ID = #parentId#
</isNotEmpty>
</sql>
<select id="query" parameterClass="java.util.HashMap"
resultClass="com.baosight.hggp.hg.pz.domain.HGPZ005A">
SELECT
ID as "id",
ACCOUNT_CODE as "accountCode", <!-- 帐套编码 -->
DEP_CODE as "depCode", <!-- 部门编码 -->
CREATED_BY as "createdBy", <!-- 创建人 -->
CREATED_NAME as "createdName", <!-- 创建人名称 -->
CREATED_TIME as "createdTime", <!-- 创建时间 -->
UPDATED_BY as "updatedBy", <!-- 更新人 -->
UPDATED_NAME as "updatedName", <!-- 更新人名称 -->
UPDATED_TIME as "updatedTime", <!-- 更新时间 -->
DELETE_FLAG as "deleteFlag", <!-- 是否删除0.否1.是 -->
COMPANY_CODE as "companyCode", <!-- 公司编码 -->
COMPANY_NAME as "companyName", <!-- 公司名称 -->
INVENT_CODE as "inventCode", <!-- 存货编码 -->
PROCESS_CODE as "processCode", <!-- 工序编码 -->
PROCESS_NAME as "processName", <!-- 工序名称 -->
COMPOSING_COEFF as "composingCoeff", <!-- 排产系数 -->
UNIT_COEFF as "unitCoeff", <!-- 单价系数 -->
PROCESS_CLASS as "processClass", <!-- 工序类别 -->
PARENT_ID as "parentId" <!-- 上级ID -->
FROM ${hggpSchema}.HGPZ005A WHERE 1=1
<include refid="condition" />
<dynamic prepend="ORDER BY">
<isNotEmpty property="orderBy">
$orderBy$
</isNotEmpty>
<isEmpty property="orderBy">
CREATED_TIME asc, ID asc
</isEmpty>
</dynamic>
</select>
<select id="count" resultClass="int">
SELECT COUNT(*) FROM ${hggpSchema}.HGPZ005A WHERE 1=1
<include refid="condition" />
</select>
<!--
<isNotEmpty prepend=" AND " property="id">
ID = #id#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="accountCode">
ACCOUNT_CODE = #accountCode#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="depCode">
DEP_CODE = #depCode#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="createdBy">
CREATED_BY = #createdBy#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="createdName">
CREATED_NAME = #createdName#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="createdTime">
CREATED_TIME = #createdTime#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="updatedBy">
UPDATED_BY = #updatedBy#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="updatedName">
UPDATED_NAME = #updatedName#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="updatedTime">
UPDATED_TIME = #updatedTime#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="deleteFlag">
DELETE_FLAG = #deleteFlag#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="processCode">
PROCESS_CODE = #processCode#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="processName">
PROCESS_NAME = #processName#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="composingCoeff">
COMPOSING_COEFF = #composingCoeff#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="unitCoeff">
UNIT_COEFF = #unitCoeff#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="processClass">
PROCESS_CLASS = #processClass#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="parentId">
PARENT_ID = #parentId#
</isNotEmpty>
-->
<insert id="insert">
INSERT INTO ${hggpSchema}.HGPZ005A (ID,
ACCOUNT_CODE, <!-- 帐套编码 -->
DEP_CODE, <!-- 部门编码 -->
CREATED_BY, <!-- 创建人 -->
CREATED_NAME, <!-- 创建人名称 -->
CREATED_TIME, <!-- 创建时间 -->
UPDATED_BY, <!-- 更新人 -->
UPDATED_NAME, <!-- 更新人名称 -->
UPDATED_TIME, <!-- 更新时间 -->
DELETE_FLAG, <!-- 是否删除0.否1.是 -->
COMPANY_CODE, <!-- 公司编码 -->
COMPANY_NAME, <!-- 公司名称 -->
INVENT_CODE,
PROCESS_CODE, <!-- 工序编码 -->
PROCESS_NAME, <!-- 工序名称 -->
COMPOSING_COEFF, <!-- 排产系数 -->
UNIT_COEFF, <!-- 单价系数 -->
PROCESS_CLASS, <!-- 工序类别 -->
PARENT_ID <!-- 上级ID -->
)
VALUES (#id#, #accountCode#, #depCode#, #createdBy#, #createdName#, #createdTime#, #updatedBy#, #updatedName#, #updatedTime#, #deleteFlag#, #companyCode#, #companyName#, #inventCode#, #processCode#, #processName#, #composingCoeff#, #unitCoeff#, #processClass#, #parentId#)
</insert>
<delete id="delete">
DELETE FROM ${hggpSchema}.HGPZ005A WHERE
ID = #id#
</delete>
<delete id="deleteByParentId">
DELETE FROM ${hggpSchema}.HGPZ005A WHERE PARENT_ID = #parentId#
</delete>
<update id="update">
UPDATE ${hggpSchema}.HGPZ005A
SET
ACCOUNT_CODE = #accountCode#, <!-- 帐套编码 -->
DEP_CODE = #depCode#, <!-- 部门编码 -->
CREATED_BY = #createdBy#, <!-- 创建人 -->
CREATED_NAME = #createdName#, <!-- 创建人名称 -->
CREATED_TIME = #createdTime#, <!-- 创建时间 -->
UPDATED_BY = #updatedBy#, <!-- 更新人 -->
UPDATED_NAME = #updatedName#, <!-- 更新人名称 -->
UPDATED_TIME = #updatedTime#, <!-- 更新时间 -->
DELETE_FLAG = #deleteFlag#, <!-- 是否删除0.否1.是 -->
COMPANY_CODE = #companyCode#, <!-- 公司编码 -->
COMPANY_NAME = #companyName#, <!-- 公司名称 -->
INVENT_CODE = #inventCode#,
PROCESS_CODE = #processCode#, <!-- 工序编码 -->
PROCESS_NAME = #processName#, <!-- 工序名称 -->
COMPOSING_COEFF = #composingCoeff#, <!-- 排产系数 -->
UNIT_COEFF = #unitCoeff#, <!-- 单价系数 -->
PROCESS_CLASS = #processClass#, <!-- 工序类别 -->
PARENT_ID = #parentId# <!-- 上级ID -->
WHERE
ID = #id#
</update>
<select id="queryEdcm01" parameterClass="java.util.HashMap" resultClass="java.util.HashMap">
select
ITEM_CODE as "itemCode",
ITEM_CNAME as "itemCname"
from ${platSchema}.TEDCM01
where CODESET_CODE = #codesetCode#
<isNotEmpty prepend=" AND " property="itemCode">
ITEM_CODE = #itemCode#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="itemCodes">
ITEM_CODE in <iterate property="itemCodes" open="(" close=")" conjunction=","> #itemCodes[]# </iterate>
</isNotEmpty>
</select>
</sqlMap>
package com.baosight.hggp.hg.pz.tools; package com.baosight.hggp.hg.pz.tools;
import com.baosight.hggp.common.DdynamicEnum;
import com.baosight.hggp.core.constant.CommonConstant; import com.baosight.hggp.core.constant.CommonConstant;
import com.baosight.hggp.core.dao.DaoBase; import com.baosight.hggp.core.dao.DaoBase;
import com.baosight.hggp.core.dao.DaoUtils; import com.baosight.hggp.core.dao.DaoUtils;
import com.baosight.hggp.core.enums.ValidFlagEnum; import com.baosight.hggp.core.enums.ValidFlagEnum;
import com.baosight.hggp.hg.constant.HGConstant;
import com.baosight.hggp.hg.pz.domain.*;
import com.baosight.hggp.hg.sc.domain.HGSC001A;
import com.baosight.hggp.hg.sc.domain.HGSC005A;
import com.baosight.hggp.hg.sj.domain.HGSJ003;
import com.baosight.hggp.util.*;
import com.baosight.iplat4j.common.ed.domain.TEDCM01;
import com.baosight.hggp.hg.pz.domain.HGPZ002; import com.baosight.hggp.hg.pz.domain.HGPZ002;
import com.baosight.hggp.hg.pz.domain.HGPZ003; import com.baosight.hggp.hg.pz.domain.HGPZ003;
import com.baosight.hggp.hg.pz.domain.HGPZ005; import com.baosight.hggp.hg.pz.domain.HGPZ005;
...@@ -16,11 +24,13 @@ import com.baosight.hggp.util.StringUtils; ...@@ -16,11 +24,13 @@ import com.baosight.hggp.util.StringUtils;
import com.baosight.iplat4j.core.data.DaoEPBase; import com.baosight.iplat4j.core.data.DaoEPBase;
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;
import com.baosight.iplat4j.ed.util.SequenceGenerator;
import org.apache.commons.beanutils.BeanUtils; import org.apache.commons.beanutils.BeanUtils;
import org.apache.commons.collections.CollectionUtils; import org.apache.commons.collections.CollectionUtils;
import java.math.BigDecimal; import java.math.BigDecimal;
import java.math.RoundingMode; import java.math.RoundingMode;
import java.util.Arrays;
import java.util.HashMap; import java.util.HashMap;
import java.util.List; import java.util.List;
import java.util.Map; import java.util.Map;
...@@ -69,7 +79,7 @@ public class HGPZTools { ...@@ -69,7 +79,7 @@ public class HGPZTools {
return DaoBase.getInstance().query(HGPZ003.QUERY, queryMap); return DaoBase.getInstance().query(HGPZ003.QUERY, queryMap);
} }
} }
/** /**
* 仓库管理 * 仓库管理
* HPPZ007 公共DAO定义 * HPPZ007 公共DAO定义
...@@ -397,7 +407,47 @@ public class HGPZTools { ...@@ -397,7 +407,47 @@ public class HGPZTools {
log.warn("设置规格失败:{}", e.getMessage(), e); log.warn("设置规格失败:{}", e.getMessage(), e);
} }
} }
/**
* 导入添加存货档案
* @param list
*/
public static void add(List<Map> list){
List<HGPZ004> hgpz004s = DaoBase.getInstance().query(HGPZ004.QUERY, new HashMap<>());
Map parmap = hgpz004s.stream().collect(Collectors.toMap(HGPZ004::getInventTypeName, HGPZ004::getInventType));
for (Map map:list) {
String inventType = MapUtils.getString(parmap, StringUtils.trimToEmpty(map.get(HGPZ005.FIELD_INVENT_TYPE).toString()));
AssertUtils.isEmpty(inventType, String.format("存货类型[%s]代码不存在,添加失败!", inventType));
HGPZ005 hgpz005 = new HGPZ005();
hgpz005.fromMap(map);
hgpz005.setInventType(inventType);
hgpz005.setStatus(1); //默认启用
hgpz005.setInventCode(SequenceGenerator.getNextSequence(HGConstant.SequenceId.INVENT_CODE));
// 设置规格
if (StringUtils.isBlank(hgpz005.getSpec())) {
hgpz005.setSpec(HGPZTools.HgPz005.jointSpec(hgpz005.getLength(), hgpz005.getWidth(), hgpz005.getThick()));
}
// 去除空格
hgpz005.setSpec(StringUtils.trimToEmpty(hgpz005.getSpec()));
DaoUtils.insert(HGPZ005.INSERT,hgpz005);
}
}
} }
public static class HgPz005A{
/**
* 通过存货编码查询存货工序*
* @param inventCode
* @return
*/
public static List<HGPZ005A> queryByInventCode(String inventCode){
AssertUtils.isEmpty(inventCode, "存货编码不能为空!");
Map paramMap = new HashMap();
paramMap.put(HGPZ005A.FIELD_INVENT_CODE, inventCode);
List<HGPZ005A> results = DaoBase.getInstance().query(HGPZ005A.QUERY, paramMap);
return CollectionUtils.isEmpty(results) ? null : results;
}
} }
package com.baosight.hggp.hg.sb.service;
import com.baosight.hggp.common.DdynamicEnum;
import com.baosight.hggp.core.constant.CommonConstant;
import com.baosight.hggp.hg.sb.domain.HGSB006;
import com.baosight.hggp.util.CommonMethod;
import com.baosight.hggp.util.contants.ACConstants;
import com.baosight.iplat4j.core.ei.EiConstant;
import com.baosight.iplat4j.core.ei.EiInfo;
import com.baosight.iplat4j.core.service.impl.ServiceEPBase;
import java.util.Arrays;
import java.util.HashMap;
/**
* @author LiuYang
* @version 1.0 2024/5/15
*/
public class ServiceHGSB006 extends ServiceEPBase {
@Override
public EiInfo initLoad(EiInfo inInfo) {
inInfo.setCell(EiConstant.queryBlock, ACConstants.ROW_CODE_0, HGSB006.FIELD_DELETE_FLAG, CommonConstant.YesNo.NO_0);
inInfo = super.query(inInfo, HGSB006.QUERY, new HGSB006());
CommonMethod.initBlock(inInfo,
Arrays.asList(DdynamicEnum.COMPANY_BOX_BLOCK_ID,DdynamicEnum.DEVICE_CODE_BOX_BLOCK_ID),null
);
return inInfo;
}
@Override
public EiInfo query(EiInfo inInfo) {
inInfo.setCell(EiConstant.queryBlock, ACConstants.ROW_CODE_0, HGSB006.FIELD_DELETE_FLAG, CommonConstant.YesNo.NO_0);
return super.query(inInfo,HGSB006.QUERY,new HGSB006());
}
}
package com.baosight.hggp.hg.sb.service;
import com.baosight.hggp.common.DdynamicEnum;
import com.baosight.hggp.core.constant.CommonConstant;
import com.baosight.hggp.hg.sb.domain.HGSB007;
import com.baosight.hggp.util.CommonMethod;
import com.baosight.hggp.util.contants.ACConstants;
import com.baosight.iplat4j.core.ei.EiBlockMeta;
import com.baosight.iplat4j.core.ei.EiConstant;
import com.baosight.iplat4j.core.ei.EiInfo;
import com.baosight.iplat4j.core.service.impl.ServiceEPBase;
import java.util.Arrays;
/**
* @author LiuYang
* @version 1.0 2024/5/15
*/
public class ServiceHGSB007 extends ServiceEPBase {
@Override
public EiInfo initLoad(EiInfo inInfo) {
inInfo.setCell(EiConstant.queryBlock, ACConstants.ROW_CODE_0, HGSB007.FIELD_DELETE_FLAG, CommonConstant.YesNo.NO_0);
inInfo = super.query(inInfo, HGSB007.QUERY, new HGSB007(),false, new EiBlockMeta(), EiConstant.queryBlock, CommonConstant.Field.DETAIL, CommonConstant.Field.DETAIL);
CommonMethod.initBlock(inInfo,
Arrays.asList(DdynamicEnum.COMPANY_BOX_BLOCK_ID,DdynamicEnum.DEVICE_CODE_BOX_BLOCK_ID),null
);
return inInfo;
}
@Override
public EiInfo query(EiInfo inInfo) {
inInfo.setCell(EiConstant.queryBlock, ACConstants.ROW_CODE_0, HGSB007.FIELD_DELETE_FLAG, CommonConstant.YesNo.NO_0);
return super.query(inInfo,HGSB007.QUERY,new HGSB007(),false, new EiBlockMeta(), EiConstant.queryBlock, CommonConstant.Field.DETAIL, CommonConstant.Field.DETAIL);
}
}
...@@ -245,7 +245,7 @@ ...@@ -245,7 +245,7 @@
</isNotEmpty> </isNotEmpty>
</sql> </sql>
<select id="resultQuery" parameterClass="java.util.HashMap" resultClass="com.baosight.hggp.hg.sb.domain.HGSB001A"> <select id="resultQuery" parameterClass="HashMap" resultClass="HGSB001A">
SELECT SELECT
<include refid="resultColumn"/> <include refid="resultColumn"/>
FROM ${hggpSchema}.HGSB004A A FROM ${hggpSchema}.HGSB004A A
...@@ -256,7 +256,7 @@ ...@@ -256,7 +256,7 @@
$orderBy$ $orderBy$
</isNotEmpty> </isNotEmpty>
<isEmpty property="orderBy"> <isEmpty property="orderBy">
A.CREATED_TIME desc, A.ID asc B.INSPEC_DATE,A.CREATED_TIME desc, A.ID asc
</isEmpty> </isEmpty>
</dynamic> </dynamic>
...@@ -279,7 +279,7 @@ ...@@ -279,7 +279,7 @@
$orderBy$ $orderBy$
</isNotEmpty> </isNotEmpty>
<isEmpty property="orderBy"> <isEmpty property="orderBy">
A.CREATED_TIME desc, A.ID asc B.UPKEEP_DATE,A.CREATED_TIME desc, A.ID asc
</isEmpty> </isEmpty>
</dynamic> </dynamic>
......
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE sqlMap PUBLIC "-//ibatis.apache.org//DTD SQL Map 2.0//EN" "http://ibatis.apache.org/dtd/sql-map-2.dtd">
<sqlMap namespace="HGSB006">
<typeAlias alias="HGSB006" type="com.baosight.hggp.hg.sb.domain.HGSB006"/>
<typeAlias alias="HashMap" type="java.util.HashMap"/>
<sql id="column">
A.ID as "id", <!-- ID -->
A.ACCOUNT_CODE as "accountCode", <!-- 账套 -->
A.DEP_CODE as "depCode", <!-- 部门编码 -->
A.CREATED_BY as "createdBy", <!-- 创建人 -->
A.CREATED_NAME as "createdName", <!-- 创建人名称 -->
A.CREATED_TIME as "createdTime", <!-- 创建时间 -->
A.UPDATED_BY as "updatedBy", <!-- 修改人 -->
A.UPDATED_NAME as "updatedName", <!-- 修改人名称 -->
A.UPDATED_TIME as "updatedTime", <!-- 修改时间 -->
A.DELETE_FLAG as "deleteFlag", <!-- 是否删除 0-否1-是 -->
A.PARENT_ID as "parentId", <!-- 父级ID -->
B.COMPANY_CODE as "companyCode", <!-- 公司编码 -->
B.COMPANY_NAME as "companyName", <!-- 公司名称 -->
B.INSPEC_DATE as "inspecDate", <!-- 点检日期 -->
B.INSPEC_CODE as "inspecCode", <!-- 点检单号 -->
A.GROUP_CODE as "groupCode", <!-- 设备区域编码 -->
A.GROUP_NAME as "groupName", <!-- 设备区域名称 -->
B.PLAN_CODE as "planCode", <!-- 计划单号 -->
B.PLAN_START_DATE as "planStartDate", <!-- 计划开始日期 -->
B.PLAN_END_DATE as "planEndDate", <!-- 计划结束日期 -->
A.DEVICE_TYPE as "deviceType", <!-- 设备类型 -->
A.DEVICE_CODE as "deviceCode", <!-- 设备编码 -->
A.DEVICE_NAME as "deviceName", <!-- 设备名称 -->
A.DEVICE_MODEL as "deviceModel", <!-- 设备型号 -->
A.CHECK_ITEM as "checkItem", <!-- 检查项 -->
A.CHECK_DESCRIP as "checkDescrip", <!-- 检查描述 -->
A.CHECK_RESULT as "checkResult", <!-- 检查描述结果 -->
DATEDIFF(DATE_FORMAT(B.PLAN_END_DATE, '%Y-%m-%d'), CURDATE()) as "remainderDays",
A.DOC_ID as "docId", <!-- 附件ID -->
A.DOC_NAME as "docName"
</sql>
<sql id="authCondition">
<!-- 无权限时使用 -->
<isNotEmpty prepend=" AND " property="authDepCode">
A.DEP_CODE = #authDepCode#
</isNotEmpty>
<!-- 仅本人和部门组合 -->
<isEqual prepend=" AND " property="authCombination" compareValue="1">
(A.CREATED_BY = #authOnlyPeople# OR A.DEP_CODE IN <iterate close=")" open="(" conjunction="," property="authDepCodes">#authDepCodes[]#</iterate>)
</isEqual>
<!-- 仅本人或部门 -->
<isNotEqual prepend=" AND " property="authCombination" compareValue="1">
<isNotEmpty property="authOnlyPeople">
A.CREATED_BY = #authOnlyPeople#
</isNotEmpty>
<isNotEmpty property="authDepCodes">
A.DEP_CODE IN <iterate close=")" open="(" conjunction="," property="authDepCodes">#authDepCodes[]#</iterate>
</isNotEmpty>
</isNotEqual>
</sql>
<sql id="condition">
<include refid="authCondition"/>
<isNotEmpty prepend=" AND " property="id">
A.ID = #id#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="accountCode">
A.ACCOUNT_CODE = #accountCode#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="depCode">
A.DEP_CODE = #depCode#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="createdBy">
A.CREATED_BY = #createdBy#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="createdName">
A.CREATED_NAME = #createdName#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="createdTime">
A.CREATED_TIME = #createdTime#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="updatedBy">
A.UPDATED_BY = #updatedBy#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="updatedName">
A.UPDATED_NAME = #updatedName#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="updatedTime">
A.UPDATED_TIME = #updatedTime#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="deleteFlag">
A.DELETE_FLAG = #deleteFlag#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="parentId">
A.PARENT_ID = #parentId#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="companyCode">
B.COMPANY_CODE = #companyCode#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="companyName">
B.COMPANY_NAME LIKE CONCAT('%', #companyName#, '%')
</isNotEmpty>
<isNotEmpty prepend=" AND " property="groupCode">
A.GROUP_CODE = #groupCode#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="groupName">
A.GROUP_NAME LIKE CONCAT('%', #groupName#, '%')
</isNotEmpty>
<isNotEmpty prepend=" AND " property="deviceType">
A.DEVICE_TYPE = #deviceType#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="deviceCode">
A.DEVICE_CODE = #deviceCode#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="deviceName">
A.DEVICE_NAME LIKE CONCAT('%', #deviceName#, '%')
</isNotEmpty>
<isNotEmpty prepend=" AND " property="deviceModel">
A.DEVICE_MODEL LIKE CONCAT('%', #deviceModel#, '%')
</isNotEmpty>
<isNotEmpty prepend=" AND " property="checkItem">
A.CHECK_ITEM LIKE CONCAT('%', #checkItem#, '%')
</isNotEmpty>
<isNotEmpty prepend=" AND " property="checkDescrip">
A.CHECK_DESCRIP = #checkDescrip#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="checkResult">
A.CHECK_RESULT = #checkResult#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="docId">
A.DOC_ID = #docId#
</isNotEmpty>
<isEqual prepend=" AND " property="checkStatus" compareValue="1">
trim(A.DOC_ID) ='' and trim(A.CHECK_RESULT) = ''
</isEqual>
<isEqual prepend=" AND " property="checkStatus" compareValue="2">
(trim(A.DOC_ID) !='' or trim(A.CHECK_RESULT) != '')
</isEqual>
</sql>
<select id="query" parameterClass="HashMap" resultClass="HGSB006">
SELECT
<include refid="column"/>
FROM ${hggpSchema}.HGSB004A A
LEFT JOIN ${hggpSchema}.HGSB004 B ON A.PARENT_ID = B.ID WHERE 1=1
<include refid="condition" />
<dynamic prepend="ORDER BY">
<isNotEmpty property="orderBy">
$orderBy$
</isNotEmpty>
<isEmpty property="orderBy">
B.PLAN_START_DATE desc,B.PLAN_END_DATE desc, A.ID asc
</isEmpty>
</dynamic>
</select>
<select id="count" resultClass="int">
SELECT COUNT(*) FROM ${hggpSchema}.HGSB004A A
LEFT JOIN ${hggpSchema}.HGSB004 B ON A.PARENT_ID = B.ID WHERE 1=1
<include refid="condition" />
</select>
</sqlMap>
\ No newline at end of file
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE sqlMap PUBLIC "-//ibatis.apache.org//DTD SQL Map 2.0//EN" "http://ibatis.apache.org/dtd/sql-map-2.dtd">
<sqlMap namespace="HGSB007">
<typeAlias alias="HGSB007" type="com.baosight.hggp.hg.sb.domain.HGSB007"/>
<typeAlias alias="HashMap" type="java.util.HashMap"/>
<sql id="column">
A.ID as "id", <!-- ID -->
A.ACCOUNT_CODE as "accountCode", <!-- 账套 -->
A.DEP_CODE as "depCode", <!-- 部门编码 -->
A.CREATED_BY as "createdBy", <!-- 创建人 -->
A.CREATED_NAME as "createdName", <!-- 创建人名称 -->
A.CREATED_TIME as "createdTime", <!-- 创建时间 -->
A.UPDATED_BY as "updatedBy", <!-- 修改人 -->
A.UPDATED_NAME as "updatedName", <!-- 修改人名称 -->
A.UPDATED_TIME as "updatedTime", <!-- 修改时间 -->
A.DELETE_FLAG as "deleteFlag", <!-- 是否删除 0-否1-是 -->
A.PARENT_ID as "parentId", <!-- 父级ID -->
B.COMPANY_CODE as "companyCode", <!-- 公司编码 -->
B.COMPANY_NAME as "companyName", <!-- 公司名称 -->
A.GROUP_CODE as "groupCode", <!-- 设备区域编码 -->
A.GROUP_NAME as "groupName", <!-- 设备区域名称 -->
B.UPKEEP_DATE as "upkeepDate", <!-- 保养日期 -->
B.UPKEEP_CODE as "upkeepCode", <!-- 保养单号 -->
B.PLAN_START_DATE as "planStartDate", <!-- 计划开始日期 -->
B.PLAN_END_DATE as "planEndDate", <!-- 计划结束日期 -->
A.DEVICE_TYPE as "deviceType", <!-- 设备类型 -->
A.DEVICE_CODE as "deviceCode", <!-- 设备编码 -->
A.DEVICE_NAME as "deviceName", <!-- 设备名称 -->
A.DEVICE_MODEL as "deviceModel", <!-- 设备型号 -->
A.CHECK_ITEM as "checkItem", <!-- 检查项 -->
A.CHECK_DESCRIP as "checkDescrip", <!-- 检查描述 -->
A.CHECK_RESULT as "checkResult", <!-- 检查描述结果 -->
A.DOC_ID as "docId", <!-- 附件ID -->
A.DOC_NAME as "docName",
DATEDIFF(DATE_FORMAT(B.PLAN_END_DATE, '%Y-%m-%d'), CURDATE()) as "remainderDays"
</sql>
<sql id="authCondition">
<!-- 无权限时使用 -->
<isNotEmpty prepend=" AND " property="authDepCode">
A.DEP_CODE = #authDepCode#
</isNotEmpty>
<!-- 仅本人和部门组合 -->
<isEqual prepend=" AND " property="authCombination" compareValue="1">
(A.CREATED_BY = #authOnlyPeople# OR A.DEP_CODE IN <iterate close=")" open="(" conjunction="," property="authDepCodes">#authDepCodes[]#</iterate>)
</isEqual>
<!-- 仅本人或部门 -->
<isNotEqual prepend=" AND " property="authCombination" compareValue="1">
<isNotEmpty property="authOnlyPeople">
A.CREATED_BY = #authOnlyPeople#
</isNotEmpty>
<isNotEmpty property="authDepCodes">
A.DEP_CODE IN <iterate close=")" open="(" conjunction="," property="authDepCodes">#authDepCodes[]#</iterate>
</isNotEmpty>
</isNotEqual>
</sql>
<sql id="condition">
<include refid="authCondition"/>
<isNotEmpty prepend=" AND " property="id">
A.ID = #id#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="accountCode">
A.ACCOUNT_CODE = #accountCode#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="depCode">
DEP_CODE = #depCode#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="createdBy">
A.CREATED_BY = #createdBy#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="createdName">
A.CREATED_NAME = #createdName#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="createdTime">
A.CREATED_TIME = #createdTime#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="updatedBy">
A.UPDATED_BY = #updatedBy#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="updatedName">
A.UPDATED_NAME = #updatedName#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="updatedTime">
A.UPDATED_TIME = #updatedTime#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="deleteFlag">
A.DELETE_FLAG = #deleteFlag#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="parentId">
A.PARENT_ID = #parentId#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="companyCode">
B.COMPANY_CODE = #companyCode#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="companyName">
B.COMPANY_NAME LIKE CONCAT('%', #companyName#, '%')
</isNotEmpty>
<isNotEmpty prepend=" AND " property="groupCode">
A.GROUP_CODE = #groupCode#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="groupName">
A.GROUP_NAME LIKE CONCAT('%', #groupName#, '%')
</isNotEmpty>
<isNotEmpty prepend=" AND " property="upkeepDate">
B.UPKEEP_DATE = #upkeepDate#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="upkeepCode">
B.UPKEEP_CODE = #upkeepCode#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="deviceType">
A.DEVICE_TYPE = #deviceType#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="deviceCode">
A.DEVICE_CODE = #deviceCode#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="deviceName">
A.DEVICE_NAME LIKE CONCAT('%', #deviceName#, '%')
</isNotEmpty>
<isNotEmpty prepend=" AND " property="deviceModel">
A.DEVICE_MODEL LIKE CONCAT('%', #deviceModel#, '%')
</isNotEmpty>
<isNotEmpty prepend=" AND " property="checkItem">
A.CHECK_ITEM LIKE CONCAT('%', #checkItem#, '%')
</isNotEmpty>
<isNotEmpty prepend=" AND " property="checkDescrip">
A.CHECK_DESCRIP = #checkDescrip#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="checkResult">
A.CHECK_RESULT = #checkResult#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="docId">
A.DOC_ID = #docId#
</isNotEmpty>
<isEqual prepend=" AND " property="upkeepStatus" compareValue="1">
trim(A.DOC_ID) ='' and trim(A.CHECK_RESULT) = ''
</isEqual>
<isEqual prepend=" AND " property="upkeepStatus" compareValue="2">
(trim(A.DOC_ID) !='' or trim(A.CHECK_RESULT) != '')
</isEqual>
</sql>
<select id="query" parameterClass="HashMap" resultClass="HGSB007">
SELECT
<include refid="column"/>
FROM ${hggpSchema}.HGSB005A A
LEFT JOIN ${hggpSchema}.HGSB005 B ON A.PARENT_ID = B.ID WHERE 1=1
<include refid="condition" />
<dynamic prepend="ORDER BY">
<isNotEmpty property="orderBy">
$orderBy$
</isNotEmpty>
<isEmpty property="orderBy">
B.UPKEEP_DATE desc, A.CREATED_TIME desc, A.ID asc
</isEmpty>
</dynamic>
</select>
<select id="count" resultClass="int">
SELECT COUNT(*) FROM ${hggpSchema}.HGSB005A A
LEFT JOIN ${hggpSchema}.HGSB005 B ON A.PARENT_ID = B.ID WHERE 1=1
<include refid="condition" />
</select>
</sqlMap>
\ No newline at end of file
package com.baosight.hggp.hg.sc.service;
import com.baosight.hggp.common.DdynamicEnum;
import com.baosight.hggp.core.dao.DaoUtils;
import com.baosight.hggp.core.security.UserSessionUtils;
import com.baosight.hggp.hg.constant.HGConstant;
import com.baosight.hggp.hg.sc.domain.HGSC001;
import com.baosight.hggp.hg.sc.domain.HGSC003;
import com.baosight.hggp.util.*;
import com.baosight.iplat4j.core.ei.EiBlock;
import com.baosight.iplat4j.core.ei.EiConstant;
import com.baosight.iplat4j.core.ei.EiInfo;
import com.baosight.iplat4j.core.exception.PlatException;
import com.baosight.iplat4j.core.resource.I18nMessages;
import com.baosight.iplat4j.core.service.impl.ServiceBase;
import com.baosight.iplat4j.ed.util.SequenceGenerator;
import java.util.*;
/**
* @Author jhs
* @Date 2024/5/14 14:46
*/
public class ServiceHGSC003 extends ServiceBase {
public EiInfo initLoad(EiInfo inInfo) {
try {
inInfo = super.query(inInfo, HGSC003.QUERY, new HGSC003());
Map map = new HashMap();
map.put(HGSC003.FIELD_account_code, UserSessionUtils.getAccountCode());
CommonMethod.initBlock(inInfo,
Arrays.asList(DdynamicEnum.COMPANY_BOX_BLOCK_ID,DdynamicEnum.PROJ_RECORD_BLOCK_ID),map,false
);
} catch (PlatException e) {
LogUtils.setDetailMsg(inInfo, e, "初始化失败");
}
return inInfo;
}
public EiInfo query(EiInfo inInfo) {
try {
inInfo = super.query(inInfo, HGSC003.QUERY, new HGSC003());
Map map = new HashMap();
map.put(HGSC003.FIELD_account_code, UserSessionUtils.getAccountCode());
CommonMethod.initBlock(inInfo,
Arrays.asList(DdynamicEnum.COMPANY_BOX_BLOCK_ID,DdynamicEnum.PROJ_RECORD_BLOCK_ID),map,false
);
inInfo.setStatus(EiConstant.STATUS_DEFAULT);
} catch (PlatException e) {
LogUtils.setDetailMsg(inInfo, e, "查询失败");
}
return inInfo;
}
@Override
public EiInfo delete(EiInfo inInfo) {
try {
List<Map> resultRows = inInfo.getBlock(EiConstant.resultBlock).getRows();
// 蓝图ids
List<Long> ids = ObjectUtils.listKey(resultRows, HGSC003.FIELD_id);
DaoUtils.update(HGSC003.BATCH_DELETE, new HashMap<String,Object>(){{put("ids",ids);}});
// HGSCTools.THGSC003A.deleteByProIds(ids);
inInfo = this.query(inInfo);
inInfo.setStatus(EiConstant.STATUS_DEFAULT);
inInfo.setMsg("操作成功!本次对[" + resultRows.size() + "]条数据删除成功!");
} catch (Exception e) {
LogUtils.setDetailMsg(inInfo, e, "删除失败");
}
return inInfo;
}
public EiInfo deactivate(EiInfo inInfo) {
try {
List<Map> resultRows = inInfo.getBlock(EiConstant.resultBlock).getRows();
// 蓝图ids
List<Long> ids = ObjectUtils.listKey(resultRows, "id");
DaoUtils.update(HGSC003.BATCH_DEACTIVATE, new HashMap<String,Object>(){{put("ids",ids);}});
inInfo = this.query(inInfo);
inInfo.setStatus(EiConstant.STATUS_DEFAULT);
inInfo.setMsg("操作成功!本次对[" + resultRows.size() + "]条数据停用成功!");
} catch (Exception e) {
LogUtils.setDetailMsg(inInfo, e, "操作失败");
}
return inInfo;
}
public EiInfo save(EiInfo inInfo){
try {
Map resultMap = EiInfoUtils.getFirstRow(inInfo,EiConstant.resultBlock);
HGSC003 hgsc003 = new HGSC003();
hgsc003.fromMap(resultMap);
this.checkSaveData(hgsc003);
if(Objects.nonNull(hgsc003.getId())&&hgsc003.getId()!=0){
DaoUtils.update(HGSC003.UPDATE, hgsc003);
}else {
//生成蓝图编号
hgsc003.setBlueprintCode(SequenceGenerator.getNextSequence(HGConstant.SequenceId.BLUEPRINT_CODE));
hgsc003.setBlueprintStatus(HGConstant.EnablingStatus.QY);
DaoUtils.insert(HGSC003.INSERT, hgsc003);
}
inInfo.setStatus(EiConstant.STATUS_DEFAULT);
inInfo.setMsg("保存成功!");
} catch (Exception e) {
LogUtils.setDetailMsg(inInfo, e, "保存失败");
}
return inInfo;
}
/**
* 校验保存的数据
*
* @param hgsc003
*/
private void checkSaveData(HGSC003 hgsc003) {
if(Objects.nonNull(hgsc003.getId())&&hgsc003.getId()>0){
HGSC003 oldHgsc003 = (HGSC003) super.dao.get(HGSC003.QUERY,HGSC003.FIELD_id,hgsc003.getId());
AssertUtils.isTrue(oldHgsc003.getBlueprintStatus().compareTo(HGConstant.EnablingStatus.QY) == 0,"蓝图启用中不可修改!");
}
Map<String,Object> map = new HashMap<>();
map.put("projCode",hgsc003.getProjCode());
List<HGSC003> oldHgsc003List = this.dao.query(HGSC003.QUERY,map);
for(HGSC003 o : oldHgsc003List){
AssertUtils.isTrue(!(o.getId().intValue() == hgsc003.getId().intValue()),"已存在此项目号的蓝图!");
}
AssertUtils.isEmpty(UserSessionUtils.getAccountCode(), "当前用户未绑定公司,无法操作数据,请联系管理员!");
AssertUtils.isEmpty(UserSessionUtils.getOrgId(), "当前用户未绑定部门,无法操作数据,请联系管理员!");
AssertUtils.isEmpty(hgsc003.getCompanyCode(), "请选择公司!");
AssertUtils.isEmpty(hgsc003.getProjCode(), "请填写项目编号!");
AssertUtils.isEmpty(hgsc003.getProjName(), "请填写项目名称!");
AssertUtils.isEmpty(hgsc003.getBlueprintName(), "请填写蓝图名称!");
}
/**
* 修改启用状态
* @param inInfo
* @return
*/
public EiInfo updateBlueprintStatus(EiInfo inInfo){
int i = 0;
try {
HGSC003 hgsc003 = new HGSC003();
EiBlock eiBlock = inInfo.getBlock(EiConstant.resultBlock);
for (i = 0; i < eiBlock.getRowCount(); i++) {
Map<?, ?> map = eiBlock.getRow(i);
hgsc003.fromMap(map);
DaoUtils.update(HGSC003.UPDATE_BLUEPRINT_STATUS, hgsc003);
}
inInfo.setStatus(EiConstant.STATUS_SUCCESS);
inInfo.setMsgByKey("ep.1000", new String[]{String.valueOf(i), I18nMessages.getText("label.update", "修改")});
} catch (PlatException e) {
e.printStackTrace();
inInfo.setStatus(EiConstant.STATUS_FAILURE);
ErrorCodeUtils.handleUpdateException(inInfo,i,e);
logError("修改失败", e.getMessage());
return inInfo;
}
return inInfo;
}
/**
* 项目档案下拉框
* @param inInfo
* @return
*/
public EiInfo projComboBox(EiInfo inInfo){
Map queryMap = EiInfoUtils.getFirstRow(inInfo);
String companyCode = MapUtils.getString(queryMap, HGSC001.FIELD_company_code);
String approvalStatus = MapUtils.getString(queryMap, HGSC001.FIELD_approval_status);
Map map = new HashMap();
map.put(HGSC001.FIELD_account_code, UserSessionUtils.getAccountCode());
map.put(HGSC001.FIELD_company_code, companyCode);
map.put(HGSC001.FIELD_approval_status, approvalStatus);
CommonMethod.initBlock(inInfo, Arrays.asList(DdynamicEnum.PROJ_RECORD_BLOCK_ID), map,false);
return inInfo;
}
}
package com.baosight.hggp.hg.sc.service;
import com.baosight.hggp.hg.sc.domain.HGSC005;
import com.baosight.hggp.hg.sc.tools.HGSCTools;
import com.baosight.hggp.util.*;
import com.baosight.iplat4j.core.ei.EiConstant;
import com.baosight.iplat4j.core.ei.EiInfo;
import com.baosight.iplat4j.core.exception.PlatException;
import com.baosight.iplat4j.core.service.impl.ServiceBase;
import org.apache.commons.collections.CollectionUtils;
import java.util.*;
/**
* @Author wwl
* @Date 2024/5/6 19:48
*/
public class ServiceHGSC005 extends ServiceBase {
public EiInfo initLoad(EiInfo inInfo) {
try {
inInfo = super.query(inInfo, HGSC005.QUERY, new HGSC005());
List<Map> rows = inInfo.getBlock(EiConstant.resultBlock).getRows();
if(CollectionUtils.isNotEmpty(rows)){
List<HGSC005> hgsc005List = HGSCTools.THGSC005.buildFinishRate(HGSCTools.THGSC005.convertToObj(rows));
inInfo.setRows(EiConstant.resultBlock,hgsc005List);
}
} catch (PlatException e) {
LogUtils.setDetailMsg(inInfo, e, "初始化失败");
}
return inInfo;
}
public EiInfo query(EiInfo inInfo) {
try {
inInfo = super.query(inInfo, HGSC005.QUERY, new HGSC005());
List<Map> rows = inInfo.getBlock(EiConstant.resultBlock).getRows();
if(CollectionUtils.isNotEmpty(rows)){
List<HGSC005> hgsc005List = HGSCTools.THGSC005.buildFinishRate(HGSCTools.THGSC005.convertToObj(rows));
inInfo.setRows(EiConstant.resultBlock,hgsc005List);
}
inInfo.setStatus(EiConstant.STATUS_DEFAULT);
} catch (PlatException e) {
LogUtils.setDetailMsg(inInfo, e, "查询失败");
}
return inInfo;
}
}
...@@ -4,33 +4,33 @@ ...@@ -4,33 +4,33 @@
Version : 1.0 Version : 1.0
schema : hggp schema : hggp
tableName : HGSC001 tableName : HGSC001
id BIGINT NOT NULL primarykey, id BIGINT NOT NULL primarykey,
company_code VARCHAR NOT NULL, company_code VARCHAR NOT NULL,
company_name VARCHAR NOT NULL, company_name VARCHAR NOT NULL,
dep_code VARCHAR, dep_code VARCHAR,
dep_name VARCHAR, dep_name VARCHAR,
subcontract_code VARCHAR NOT NULL, subcontract_code VARCHAR NOT NULL,
subcontract_name VARCHAR NOT NULL, subcontract_name VARCHAR NOT NULL,
genral_contract_code VARCHAR NOT NULL, genral_contract_code VARCHAR NOT NULL,
genral_contract_name VARCHAR NOT NULL, genral_contract_name VARCHAR NOT NULL,
party_pm_name VARCHAR, party_pm_name VARCHAR,
party_pm_hpone VARCHAR, party_pm_hpone VARCHAR,
contract_name VARCHAR, contract_name VARCHAR,
contract_work_txt VARCHAR, contract_work_txt VARCHAR,
proj_code VARCHAR, proj_code VARCHAR,
proj_name VARCHAR, proj_name VARCHAR,
proj_type VARCHAR, proj_type VARCHAR,
proj_status TINYINT, proj_status TINYINT,
approval_status TINYINT, approval_status TINYINT,
permiss_start_date VARCHAR, permiss_start_date VARCHAR,
start_date VARCHAR, start_date VARCHAR,
end_date VARCHAR, end_date VARCHAR,
account_code VARCHAR NOT NULL, account_code VARCHAR NOT NULL,
created_by VARCHAR, created_by VARCHAR,
created_name VARCHAR, created_name VARCHAR,
created_time VARCHAR, created_time VARCHAR,
updated_by VARCHAR, updated_by VARCHAR,
updated_name VARCHAR, updated_name VARCHAR,
updated_time VARCHAR updated_time VARCHAR
--> -->
<sqlMap namespace="HGSC001"> <sqlMap namespace="HGSC001">
...@@ -127,7 +127,7 @@ ...@@ -127,7 +127,7 @@
<select id="query" parameterClass="java.util.HashMap" <select id="query" parameterClass="java.util.HashMap"
resultClass="com.baosight.hggp.hg.sc.domain.HGSC001"> resultClass="com.baosight.hggp.hg.sc.domain.HGSC001">
SELECT SELECT
id as "id", id as "id",
company_code as "companyCode", <!-- 公司编码 --> company_code as "companyCode", <!-- 公司编码 -->
company_name as "companyName", <!-- 公司名称 --> company_name as "companyName", <!-- 公司名称 -->
dep_code as "depCode", <!-- 部门编码 --> dep_code as "depCode", <!-- 部门编码 -->
...@@ -376,6 +376,9 @@ ...@@ -376,6 +376,9 @@
<isNotEmpty prepend=" AND " property="companyCodes"> <isNotEmpty prepend=" AND " property="companyCodes">
COMPANY_CODE IN <iterate close=")" open="(" conjunction="," property="companyCodes">#companyCodes[]#</iterate> COMPANY_CODE IN <iterate close=")" open="(" conjunction="," property="companyCodes">#companyCodes[]#</iterate>
</isNotEmpty> </isNotEmpty>
<isNotEmpty prepend=" AND " property="approvalStatus">
approval_status = #approvalStatus#
</isNotEmpty>
ORDER BY PROJ_CODE ORDER BY PROJ_CODE
</select> </select>
<select id="queryProjectCodeBox" parameterClass="java.util.HashMap" resultClass="java.util.HashMap"> <select id="queryProjectCodeBox" parameterClass="java.util.HashMap" resultClass="java.util.HashMap">
......
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE sqlMap PUBLIC "-//ibatis.apache.org//DTD SQL Map 2.0//EN" "http://ibatis.apache.org/dtd/sql-map-2.dtd">
<sqlMap namespace="HGSC003">
<sql id="condition">
<isNotEmpty prepend=" AND " property="id">
id = #id#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="companyCode">
company_code = #companyCode#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="companyName">
company_name like ('%$companyName$%')
</isNotEmpty>
<isNotEmpty prepend=" AND " property="blueprintCode">
blueprint_code = #blueprintCode#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="blueprintName">
blueprint_name like ('%$blueprintName$%')
</isNotEmpty>
<isNotEmpty prepend=" AND " property="projCode">
proj_code = #projCode#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="projName">
proj_name like ('%$projName$%')
</isNotEmpty>
<isNotEmpty prepend=" AND " property="blueprintStatus">
blueprint_status = #blueprintStatus#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="approvalStatus">
approval_status = #approvalStatus#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="accountCode">
account_code = #accountCode#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="createdBy">
created_by = #createdBy#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="createdName">
created_name = #createdName#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="createdTime">
created_time = #createdTime#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="updatedBy">
updated_by = #updatedBy#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="updatedName">
updated_name = #updatedName#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="updatedTime">
updated_time = #updatedTime#
</isNotEmpty>
</sql>
<select id="query" parameterClass="java.util.HashMap"
resultClass="com.baosight.hggp.hg.sc.domain.HGSC003">
SELECT
id as "id", <!-- 主键 -->
company_code as "companyCode", <!-- 公司编码 -->
company_name as "companyName", <!-- 公司名称 -->
dep_code as "depCode", <!-- 部门编码 -->
dep_name as "depName", <!-- 部门名称 -->
blueprint_code as "blueprintCode", <!-- 蓝图编号 -->
blueprint_name as "blueprintName", <!-- 蓝图名称 -->
proj_code as "projCode", <!-- 项目编码 -->
proj_name as "projName", <!-- 项目名称 -->
blueprint_status as "blueprintStatus", <!-- 蓝图状态 0:停用,1:启用 -->
approval_status as "approvalStatus", <!-- 审批状态 0:待审;1:审核中;2:已审 -->
account_code as "accountCode", <!-- 帐套 -->
created_by as "createdBy", <!-- 创建人 -->
created_name as "createdName", <!-- 创建人名称 -->
created_time as "createdTime", <!-- 创建时间 -->
updated_by as "updatedBy", <!-- 更新人 -->
updated_name as "updatedName", <!-- 修改人名称 -->
updated_time as "updatedTime" <!-- 更新时间 -->
FROM ${hggpSchema}.HGSC003 WHERE 1=1
<include refid="condition" />
<dynamic prepend="ORDER BY">
<isNotEmpty property="orderBy">
$orderBy$
</isNotEmpty>
</dynamic>
</select>
<select id="count" resultClass="int">
SELECT COUNT(*) FROM ${hggpSchema}.HGSC003 WHERE 1=1
<include refid="condition" />
</select>
<insert id="insert">
INSERT INTO ${hggpSchema}.HGSC003 (id, <!-- 主键 -->
company_code, <!-- 公司编码 -->
company_name, <!-- 公司名称 -->
dep_code, <!-- 部门编码 -->
dep_name, <!-- 部门名称 -->
blueprint_code, <!-- 蓝图编号 -->
blueprint_name, <!-- 蓝图名称 -->
proj_code, <!-- 项目编码 -->
proj_name, <!-- 项目名称 -->
blueprint_status, <!-- 蓝图状态 0:停用,1:启用 -->
approval_status, <!-- 审批状态 0:待审;1:审核中;2:已审 -->
account_code, <!-- 帐套 -->
created_by, <!-- 创建人 -->
created_name, <!-- 创建人名称 -->
created_time, <!-- 创建时间 -->
updated_by, <!-- 更新人 -->
updated_name, <!-- 修改人名称 -->
updated_time <!-- 更新时间 -->
)
VALUES (#id#, #companyCode#, #companyName#, #depCode#, #depName#, #blueprintCode#, #blueprintName#, #projCode#, #projName#, #blueprintStatus#, #approvalStatus#, #accountCode#, #createdBy#, #createdName#, #createdTime#, #updatedBy#, #updatedName#, #updatedTime#)
</insert>
<delete id="delete">
DELETE FROM ${hggpSchema}.HGSC003 WHERE
</delete>
<update id="update">
UPDATE ${hggpSchema}.HGSC003
SET
id = #id#, <!-- 主键 -->
company_code = #companyCode#, <!-- 公司编码 -->
company_name = #companyName#, <!-- 公司名称 -->
dep_code = #depCode#, <!-- 部门编码 -->
dep_name = #depName#, <!-- 部门名称 -->
blueprint_code = #blueprintCode#, <!-- 蓝图编号 -->
blueprint_name = #blueprintName#, <!-- 蓝图名称 -->
proj_code = #projCode#, <!-- 项目编码 -->
proj_name = #projName#, <!-- 项目名称 -->
blueprint_status = #blueprintStatus#, <!-- 蓝图状态 0:停用,1:启用 -->
approval_status = #approvalStatus#, <!-- 审批状态 0:待审;1:审核中;2:已审 -->
account_code = #accountCode#, <!-- 帐套 -->
created_by = #createdBy#, <!-- 创建人 -->
created_name = #createdName#, <!-- 创建人名称 -->
created_time = #createdTime#, <!-- 创建时间 -->
updated_by = #updatedBy#, <!-- 更新人 -->
updated_name = #updatedName#, <!-- 修改人名称 -->
updated_time = #updatedTime# <!-- 更新时间 -->
WHERE
</update>
<delete id="batchDelete">
DELETE FROM ${hggpSchema}.HGSC003 WHERE
id IN <iterate close=")" open="(" conjunction="," property="ids">#ids[]#</iterate>
</delete>
<update id="batchDeactivate">
UPDATE ${hggpSchema}.HGSC003
SET
blueprint_status = 0, <!-- 蓝图状态 0:停用,1:启用 -->
updated_by = #updatedBy#, <!-- 更新人 -->
updated_name = #updatedName#, <!-- 修改人名称 -->
updated_time = #updatedTime# <!-- 更新时间 -->
WHERE
id IN <iterate close=")" open="(" conjunction="," property="ids">#ids[]#</iterate>
</update>
<update id="updateBlueprintStatus">
UPDATE ${hggpSchema}.HGSC003
SET
UPDATED_BY = #updatedBy#, <!-- 更新人 -->
UPDATED_NAME = #updatedName#, <!-- 更新人名称 -->
UPDATED_TIME = #updatedTime#, <!-- 更新时间 -->
BLUEPRINT_STATUS = #blueprintStatus# <!-- 状态0.启用1.停止 -->
WHERE
ID = #id#
</update>
</sqlMap>
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE sqlMap PUBLIC "-//ibatis.apache.org//DTD SQL Map 2.0//EN" "http://ibatis.apache.org/dtd/sql-map-2.dtd"> <!-- table information
Generate time : 2024-05-16 16:50:12
Version : 1.0
schema : hggp
tableName : HGSC005
id BIGINT NOT NULL primarykey,
mat_id BIGINT NOT NULL,
company_code VARCHAR NOT NULL,
company_name VARCHAR NOT NULL,
proj_code VARCHAR,
proj_name VARCHAR,
plan_code VARCHAR,
commit_status TINYINT,
finish_date VARCHAR,
account_code VARCHAR NOT NULL,
dep_code VARCHAR,
dep_name VARCHAR,
created_by VARCHAR,
created_name VARCHAR,
created_time VARCHAR,
updated_by VARCHAR,
updated_name VARCHAR,
updated_time VARCHAR
-->
<sqlMap namespace="HGSC005">
<sql id="condition">
<isNotEmpty prepend=" AND " property="id">
id = #id#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="matId">
mat_id = #matId#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="companyCode">
company_code = #companyCode#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="companyName">
company_name = #companyName#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="projCode">
proj_code = #projCode#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="projName">
proj_name = #projName#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="planCode">
plan_code = #planCode#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="commitStatus">
commit_status = #commitStatus#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="finishDate">
finish_date = #finishDate#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="accountCode">
account_code = #accountCode#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="depCode">
dep_code = #depCode#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="depName">
dep_name = #depName#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="createdBy">
created_by = #createdBy#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="createdName">
created_name = #createdName#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="createdTime">
created_time = #createdTime#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="updatedBy">
updated_by = #updatedBy#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="updatedName">
updated_name = #updatedName#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="updatedTime">
updated_time = #updatedTime#
</isNotEmpty>
</sql>
<select id="query" parameterClass="java.util.HashMap"
resultClass="com.baosight.hggp.hg.sc.domain.HGSC005">
SELECT
id as "id",
mat_id as "matId", <!-- 物料清单ID -->
company_code as "companyCode", <!-- 公司编码 -->
company_name as "companyName", <!-- 公司名称 -->
proj_code as "projCode", <!-- 项目编码 -->
proj_name as "projName", <!-- 项目名称 -->
plan_code as "planCode", <!-- 计划编码 -->
commit_status as "commitStatus", <!-- 提交状态 0:未提交;2:已提交 -->
finish_date as "finishDate", <!-- 完工日期 -->
account_code as "accountCode", <!-- 帐套 -->
dep_code as "depCode", <!-- 部门编码 -->
dep_name as "depName", <!-- 部门名称 -->
created_by as "createdBy", <!-- 创建人 -->
created_name as "createdName", <!-- 创建人名称 -->
created_time as "createdTime", <!-- 创建时间 -->
updated_by as "updatedBy", <!-- 更新人 -->
updated_name as "updatedName", <!-- 修改人名称 -->
updated_time as "updatedTime" <!-- 更新时间 -->
FROM ${hggpSchema}.HGSC005 WHERE 1=1
<include refid="condition" />
<dynamic prepend="ORDER BY">
<isNotEmpty property="orderBy">
$orderBy$
</isNotEmpty>
<isEmpty property="orderBy">
id asc
</isEmpty>
</dynamic>
</select>
<select id="count" resultClass="int">
SELECT COUNT(*) FROM ${hggpSchema}.HGSC005 WHERE 1=1
<include refid="condition" />
</select>
<!--
<isNotEmpty prepend=" AND " property="id">
id = #id#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="matId">
mat_id = #matId#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="companyCode">
company_code = #companyCode#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="companyName">
company_name = #companyName#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="projCode">
proj_code = #projCode#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="projName">
proj_name = #projName#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="planCode">
plan_code = #planCode#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="commitStatus">
commit_status = #commitStatus#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="finishDate">
finish_date = #finishDate#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="accountCode">
account_code = #accountCode#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="depCode">
dep_code = #depCode#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="depName">
dep_name = #depName#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="createdBy">
created_by = #createdBy#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="createdName">
created_name = #createdName#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="createdTime">
created_time = #createdTime#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="updatedBy">
updated_by = #updatedBy#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="updatedName">
updated_name = #updatedName#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="updatedTime">
updated_time = #updatedTime#
</isNotEmpty>
-->
<insert id="insert">
INSERT INTO ${hggpSchema}.HGSC005 (id,
mat_id, <!-- 物料清单ID -->
company_code, <!-- 公司编码 -->
company_name, <!-- 公司名称 -->
proj_code, <!-- 项目编码 -->
proj_name, <!-- 项目名称 -->
plan_code, <!-- 计划编码 -->
commit_status, <!-- 提交状态 0:未提交;2:已提交 -->
finish_date, <!-- 完工日期 -->
account_code, <!-- 帐套 -->
dep_code, <!-- 部门编码 -->
dep_name, <!-- 部门名称 -->
created_by, <!-- 创建人 -->
created_name, <!-- 创建人名称 -->
created_time, <!-- 创建时间 -->
updated_by, <!-- 更新人 -->
updated_name, <!-- 修改人名称 -->
updated_time <!-- 更新时间 -->
)
VALUES (#id#, #matId#, #companyCode#, #companyName#, #projCode#, #projName#, #planCode#, #commitStatus#, #finishDate#, #accountCode#, #depCode#, #depName#, #createdBy#, #createdName#, #createdTime#, #updatedBy#, #updatedName#, #updatedTime#)
</insert>
<delete id="delete">
DELETE FROM ${hggpSchema}.HGSC005 WHERE
id = #id#
</delete>
<update id="update">
UPDATE ${hggpSchema}.HGSC005
SET
mat_id = #matId#, <!-- 物料清单ID -->
company_code = #companyCode#, <!-- 公司编码 -->
company_name = #companyName#, <!-- 公司名称 -->
proj_code = #projCode#, <!-- 项目编码 -->
proj_name = #projName#, <!-- 项目名称 -->
plan_code = #planCode#, <!-- 计划编码 -->
commit_status = #commitStatus#, <!-- 提交状态 0:未提交;2:已提交 -->
finish_date = #finishDate#, <!-- 完工日期 -->
account_code = #accountCode#, <!-- 帐套 -->
dep_code = #depCode#, <!-- 部门编码 -->
dep_name = #depName#, <!-- 部门名称 -->
created_by = #createdBy#, <!-- 创建人 -->
created_name = #createdName#, <!-- 创建人名称 -->
created_time = #createdTime#, <!-- 创建时间 -->
updated_by = #updatedBy#, <!-- 更新人 -->
updated_name = #updatedName#, <!-- 修改人名称 -->
updated_time = #updatedTime# <!-- 更新时间 -->
WHERE
id = #id#
</update>
</sqlMap>
...@@ -36,7 +36,7 @@ public class HGSJ002 extends DaoEPBase { ...@@ -36,7 +36,7 @@ public class HGSJ002 extends DaoEPBase {
public static final String FIELD_FACTORY_NAME = "factoryName"; /* 厂区名称*/ public static final String FIELD_FACTORY_NAME = "factoryName"; /* 厂区名称*/
public static final String FIELD_FLOW_CODE = "flowCode"; /* 流程编码*/ public static final String FIELD_FLOW_CODE = "flowCode"; /* 流程编码*/
public static final String FIELD_FLOW_NAME = "flowName"; /* 流程名称*/ public static final String FIELD_FLOW_NAME = "flowName"; /* 流程名称*/
public static final String FIELD_STATUS = "status"; /* 状态 0.启用 1.停止*/ public static final String FIELD_STATUS = "status"; /* 状态 1.启用 0.停止*/
public static final String COL_ID = "ID"; /* 主键id*/ public static final String COL_ID = "ID"; /* 主键id*/
public static final String COL_ACCOUNT_CODE = "ACCOUNT_CODE"; /* 企业编码 预留*/ public static final String COL_ACCOUNT_CODE = "ACCOUNT_CODE"; /* 企业编码 预留*/
...@@ -76,7 +76,7 @@ public class HGSJ002 extends DaoEPBase { ...@@ -76,7 +76,7 @@ public class HGSJ002 extends DaoEPBase {
private String factoryName = " "; /* 厂区名称*/ private String factoryName = " "; /* 厂区名称*/
private String flowCode = " "; /* 流程编码*/ private String flowCode = " "; /* 流程编码*/
private String flowName = " "; /* 流程名称*/ private String flowName = " "; /* 流程名称*/
private Integer status = 0; /* 状态 0.启用 1.停止*/ private Integer status = 0; /* 状态 1.启用 0.停止*/
/** /**
* initialize the metadata. * initialize the metadata.
...@@ -142,7 +142,7 @@ public class HGSJ002 extends DaoEPBase { ...@@ -142,7 +142,7 @@ public class HGSJ002 extends DaoEPBase {
eiMetadata.addMeta(eiColumn); eiMetadata.addMeta(eiColumn);
eiColumn = new EiColumn(FIELD_STATUS); eiColumn = new EiColumn(FIELD_STATUS);
eiColumn.setDescName("状态 0.启用 1.停止"); eiColumn.setDescName("状态 1.启用 0.停止");
eiMetadata.addMeta(eiColumn); eiMetadata.addMeta(eiColumn);
......
...@@ -47,6 +47,7 @@ public class HGSJ003 extends DaoEPBase { ...@@ -47,6 +47,7 @@ public class HGSJ003 extends DaoEPBase {
public static final String FIELD_WIDTH = "width"; /* 宽*/ public static final String FIELD_WIDTH = "width"; /* 宽*/
public static final String FIELD_THICK = "thick"; /* 厚*/ public static final String FIELD_THICK = "thick"; /* 厚*/
public static final String FIELD_COEFFICIENT = "coefficient"; /* 系数*/ public static final String FIELD_COEFFICIENT = "coefficient"; /* 系数*/
public static final String FIELD_PRICE = "price"; /* 单价*/
public static final String FIELD_STATUS = "status"; /* 状态 0-启用 1-停止*/ public static final String FIELD_STATUS = "status"; /* 状态 0-启用 1-停止*/
public static final String COL_ID = "ID"; /* 主键id*/ public static final String COL_ID = "ID"; /* 主键id*/
...@@ -106,6 +107,7 @@ public class HGSJ003 extends DaoEPBase { ...@@ -106,6 +107,7 @@ public class HGSJ003 extends DaoEPBase {
private BigDecimal width = new BigDecimal(0.000); /* 宽*/ private BigDecimal width = new BigDecimal(0.000); /* 宽*/
private BigDecimal thick = new BigDecimal(0.000); /* 厚*/ private BigDecimal thick = new BigDecimal(0.000); /* 厚*/
private BigDecimal coefficient = new BigDecimal(0.000); /* 系数*/ private BigDecimal coefficient = new BigDecimal(0.000); /* 系数*/
private BigDecimal price = new BigDecimal(0.000); /* 单价*/
private Integer status = 0; /* 状态 0-启用 1-停止*/ private Integer status = 0; /* 状态 0-启用 1-停止*/
/** /**
...@@ -223,6 +225,13 @@ public class HGSJ003 extends DaoEPBase { ...@@ -223,6 +225,13 @@ public class HGSJ003 extends DaoEPBase {
eiColumn.setDescName("系数"); eiColumn.setDescName("系数");
eiMetadata.addMeta(eiColumn); eiMetadata.addMeta(eiColumn);
eiColumn = new EiColumn(FIELD_PRICE);
eiColumn.setType("N");
eiColumn.setScaleLength(3);
eiColumn.setFieldLength(15);
eiColumn.setDescName("单价");
eiMetadata.addMeta(eiColumn);
eiColumn = new EiColumn(FIELD_STATUS); eiColumn = new EiColumn(FIELD_STATUS);
eiColumn.setDescName("状态 0-启用 1-停止"); eiColumn.setDescName("状态 0-启用 1-停止");
eiMetadata.addMeta(eiColumn); eiMetadata.addMeta(eiColumn);
...@@ -607,6 +616,15 @@ public class HGSJ003 extends DaoEPBase { ...@@ -607,6 +616,15 @@ public class HGSJ003 extends DaoEPBase {
public void setCoefficient(BigDecimal coefficient) { public void setCoefficient(BigDecimal coefficient) {
this.coefficient = coefficient; this.coefficient = coefficient;
} }
public BigDecimal getPrice() {
return price;
}
public void setPrice(BigDecimal price) {
this.price = price;
}
/** /**
* get the status - 状态 0-启用 1-停止. * get the status - 状态 0-启用 1-停止.
* @return the status * @return the status
...@@ -655,6 +673,7 @@ public class HGSJ003 extends DaoEPBase { ...@@ -655,6 +673,7 @@ public class HGSJ003 extends DaoEPBase {
setWidth(NumberUtils.toBigDecimal(StringUtils.toString(map.get(FIELD_WIDTH)), width)); setWidth(NumberUtils.toBigDecimal(StringUtils.toString(map.get(FIELD_WIDTH)), width));
setThick(NumberUtils.toBigDecimal(StringUtils.toString(map.get(FIELD_THICK)), thick)); setThick(NumberUtils.toBigDecimal(StringUtils.toString(map.get(FIELD_THICK)), thick));
setCoefficient(NumberUtils.toBigDecimal(StringUtils.toString(map.get(FIELD_COEFFICIENT)), coefficient)); setCoefficient(NumberUtils.toBigDecimal(StringUtils.toString(map.get(FIELD_COEFFICIENT)), coefficient));
setPrice(NumberUtils.toBigDecimal(StringUtils.toString(map.get(FIELD_PRICE)), price));
setStatus(NumberUtils.toInteger(StringUtils.toString(map.get(FIELD_STATUS)), status)); setStatus(NumberUtils.toInteger(StringUtils.toString(map.get(FIELD_STATUS)), status));
} }
...@@ -689,6 +708,7 @@ public class HGSJ003 extends DaoEPBase { ...@@ -689,6 +708,7 @@ public class HGSJ003 extends DaoEPBase {
map.put(FIELD_WIDTH, StringUtils.toString(width, eiMetadata.getMeta(FIELD_WIDTH))); map.put(FIELD_WIDTH, StringUtils.toString(width, eiMetadata.getMeta(FIELD_WIDTH)));
map.put(FIELD_THICK, StringUtils.toString(thick, eiMetadata.getMeta(FIELD_THICK))); map.put(FIELD_THICK, StringUtils.toString(thick, eiMetadata.getMeta(FIELD_THICK)));
map.put(FIELD_COEFFICIENT, StringUtils.toString(coefficient, eiMetadata.getMeta(FIELD_COEFFICIENT))); map.put(FIELD_COEFFICIENT, StringUtils.toString(coefficient, eiMetadata.getMeta(FIELD_COEFFICIENT)));
map.put(FIELD_PRICE, StringUtils.toString(price, eiMetadata.getMeta(FIELD_PRICE)));
map.put(FIELD_STATUS, StringUtils.toString(status, eiMetadata.getMeta(FIELD_STATUS))); map.put(FIELD_STATUS, StringUtils.toString(status, eiMetadata.getMeta(FIELD_STATUS)));
return map; return map;
......
...@@ -36,11 +36,6 @@ public class ServiceHGSJ002A extends ServiceEPBase { ...@@ -36,11 +36,6 @@ public class ServiceHGSJ002A extends ServiceEPBase {
String factoryCode = inInfo.getCell(EiConstant.queryBlock,ACConstants.ROW_CODE_0,HGSJ002A.FIELD_FACTORY_CODE).toString(); String factoryCode = inInfo.getCell(EiConstant.queryBlock,ACConstants.ROW_CODE_0,HGSJ002A.FIELD_FACTORY_CODE).toString();
inInfo = super.query(inInfo, HGSJ002A.QUERY, new HGSJ002A()); inInfo = super.query(inInfo, HGSJ002A.QUERY, new HGSJ002A());
CommonMethod.initBlock(inInfo, Arrays.asList(DdynamicEnum.COMPANY_BOX_BLOCK_ID,DdynamicEnum.PROCESS_CODE_BLOCK_ID),null); CommonMethod.initBlock(inInfo, Arrays.asList(DdynamicEnum.COMPANY_BOX_BLOCK_ID,DdynamicEnum.PROCESS_CODE_BLOCK_ID),null);
CommonMethod.initBlock(inInfo, Arrays.asList(),
new HashMap<String,Object>(){{
//put(HGSJ002A.FIELD_FACTORY_CODE,factoryCode);
put(HGSJ002A.FIELD_DELETE_FLAG,CommonConstant.YesNo.NO_0);}}
);
return inInfo; return inInfo;
} }
......
...@@ -90,10 +90,7 @@ public class ServiceHGSJ003 extends ServiceEPBase { ...@@ -90,10 +90,7 @@ public class ServiceHGSJ003 extends ServiceEPBase {
hgsj003.setSpec(StringUtils.trimToEmpty(hgsj003.getSpec())); hgsj003.setSpec(StringUtils.trimToEmpty(hgsj003.getSpec()));
this.add(hgsj003); this.add(hgsj003);
} else { } else {
// 设置规格
hgsj003.setSpec(HGSJTools.Hgsj003.jointSpec(hgsj003.getLength(), hgsj003.getWidth(), hgsj003.getThick()));
// 去除空格
hgsj003.setSpec(StringUtils.trimToEmpty(hgsj003.getSpec()));
this.modify(hgsj003); this.modify(hgsj003);
} }
} }
...@@ -118,8 +115,14 @@ public class ServiceHGSJ003 extends ServiceEPBase { ...@@ -118,8 +115,14 @@ public class ServiceHGSJ003 extends ServiceEPBase {
* 修改操作 * 修改操作
*/ */
public void modify(HGSJ003 hgsj003) { public void modify(HGSJ003 hgsj003) {
// 校验数据 String spec = HGSJTools.Hgsj003.jointSpec(hgsj003.getLength(), hgsj003.getWidth(), hgsj003.getThick());
this.checkAddData(hgsj003); if (!StringUtils.trimToEmpty(hgsj003.getSpec()).equals(StringUtils.trimToEmpty(spec))){
// 设置规格,去除空格
hgsj003.setSpec(StringUtils.trimToEmpty(spec));
// 校验数据
this.checkAddData(hgsj003);
}
DaoUtils.update(HGSJ003.UPDATE, hgsj003); DaoUtils.update(HGSJ003.UPDATE, hgsj003);
} }
......
...@@ -293,8 +293,8 @@ ...@@ -293,8 +293,8 @@
select select
a.ORG_ENAME as "orgEname", a.ORG_ENAME as "orgEname",
a.ORG_CNAME as "orgCname" a.ORG_CNAME as "orgCname"
from iplat_hggp.txsog01 a from ${platSchema}.txsog01 a
left join iplat_hggp.txsog02 b on a.ORG_ID = b.ORG_ID left join ${platSchema}.txsog02 b on a.ORG_ID = b.ORG_ID
where where
a.ACCOUNT_CODE = #accountCode# a.ACCOUNT_CODE = #accountCode#
and a.ORG_TYPE = #orgType# and a.ORG_TYPE = #orgType#
......
...@@ -33,7 +33,7 @@ ...@@ -33,7 +33,7 @@
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", <!-- 是否删除:0-否 1-是 --> DELETE_FLAG as "deleteFlag", <!-- 状态 1.启用 0.停止 -->
FACTORY_CODE as "factoryCode", <!-- 厂区编码 --> FACTORY_CODE as "factoryCode", <!-- 厂区编码 -->
FACTORY_NAME as "factoryName", <!-- 厂区名称 --> FACTORY_NAME as "factoryName", <!-- 厂区名称 -->
FLOW_CODE as "flowCode", <!-- 流程编码 --> FLOW_CODE as "flowCode", <!-- 流程编码 -->
...@@ -190,12 +190,12 @@ ...@@ -190,12 +190,12 @@
UPDATED_BY, <!-- 更新人 --> UPDATED_BY, <!-- 更新人 -->
UPDATED_NAME, <!-- 更新人名称 --> UPDATED_NAME, <!-- 更新人名称 -->
UPDATED_TIME, <!-- 更新时间 --> UPDATED_TIME, <!-- 更新时间 -->
DELETE_FLAG, <!-- 是否删除:0-否 1-是 --> DELETE_FLAG, <!-- 状态 1.启用 0.停止 -->
FACTORY_CODE, <!-- 厂区编码 --> FACTORY_CODE, <!-- 厂区编码 -->
FACTORY_NAME, <!-- 厂区名称 --> FACTORY_NAME, <!-- 厂区名称 -->
FLOW_CODE, <!-- 流程编码 --> FLOW_CODE, <!-- 流程编码 -->
FLOW_NAME, <!-- 流程名称 --> FLOW_NAME, <!-- 流程名称 -->
STATUS <!-- 状态 0.启用 1.停止 --> STATUS <!-- 状态 1.启用 0.停止 -->
) )
VALUES (#id#, #accountCode#, #depCode#, #createdBy#, #createdName#, #createdTime#, #updatedBy#, #updatedName#, #updatedTime#, #deleteFlag#, #factoryCode#, #factoryName#, #flowCode#, #flowName#, #status#) VALUES (#id#, #accountCode#, #depCode#, #createdBy#, #createdName#, #createdTime#, #updatedBy#, #updatedName#, #updatedTime#, #deleteFlag#, #factoryCode#, #factoryName#, #flowCode#, #flowName#, #status#)
</insert> </insert>
...@@ -211,7 +211,7 @@ ...@@ -211,7 +211,7 @@
UPDATED_BY = #updatedBy#, <!-- 更新人 --> UPDATED_BY = #updatedBy#, <!-- 更新人 -->
UPDATED_NAME = #updatedName#, <!-- 更新人名称 --> UPDATED_NAME = #updatedName#, <!-- 更新人名称 -->
UPDATED_TIME = #updatedTime#, <!-- 更新时间 --> UPDATED_TIME = #updatedTime#, <!-- 更新时间 -->
DELETE_FLAG = #deleteFlag# <!-- 是否删除:0-否 1-是 --> DELETE_FLAG = #deleteFlag# <!-- 状态 1.启用 0.停止 -->
WHERE WHERE
ID = #id# ID = #id#
</update> </update>
...@@ -238,7 +238,7 @@ ...@@ -238,7 +238,7 @@
UPDATED_BY = #updatedBy#, <!-- 更新人 --> UPDATED_BY = #updatedBy#, <!-- 更新人 -->
UPDATED_NAME = #updatedName#, <!-- 更新人名称 --> UPDATED_NAME = #updatedName#, <!-- 更新人名称 -->
UPDATED_TIME = #updatedTime#, <!-- 更新时间 --> UPDATED_TIME = #updatedTime#, <!-- 更新时间 -->
DELETE_FLAG = #deleteFlag#, <!-- 是否删除:0-否 1-是 --> DELETE_FLAG = #deleteFlag#, <!-- 状态 1.启用 0.停止 -->
FACTORY_CODE = #factoryCode#, <!-- 厂区编码 --> FACTORY_CODE = #factoryCode#, <!-- 厂区编码 -->
FACTORY_NAME = #factoryName#, <!-- 厂区名称 --> FACTORY_NAME = #factoryName#, <!-- 厂区名称 -->
FLOW_CODE = #flowCode#, <!-- 流程编码 --> FLOW_CODE = #flowCode#, <!-- 流程编码 -->
......
...@@ -55,6 +55,7 @@ ...@@ -55,6 +55,7 @@
WIDTH as "width", <!-- 宽 --> WIDTH as "width", <!-- 宽 -->
THICK as "thick", <!-- 厚 --> THICK as "thick", <!-- 厚 -->
COEFFICIENT as "coefficient", <!-- 系数 --> COEFFICIENT as "coefficient", <!-- 系数 -->
PRICE as "price",
STATUS as "status" <!-- 状态 0-启用 1-停止 --> STATUS as "status" <!-- 状态 0-启用 1-停止 -->
</sql> </sql>
...@@ -291,9 +292,10 @@ ...@@ -291,9 +292,10 @@
WIDTH, <!-- 宽 --> WIDTH, <!-- 宽 -->
THICK, <!-- 厚 --> THICK, <!-- 厚 -->
COEFFICIENT, <!-- 系数 --> COEFFICIENT, <!-- 系数 -->
PRICE,
STATUS <!-- 状态 0-启用 1-停止 --> STATUS <!-- 状态 0-启用 1-停止 -->
) )
VALUES (#id#, #accountCode#, #depCode#, #createdBy#, #createdName#, #createdTime#, #updatedBy#, #updatedName#, #updatedTime#, #deleteFlag#, #factoryCode#, #factoryName#, #flowCode#, #flowName#, #processCode#, #processName#, #unit#, #processClass#, #spec#, #length#, #width#, #thick#, #coefficient#, #status#) VALUES (#id#, #accountCode#, #depCode#, #createdBy#, #createdName#, #createdTime#, #updatedBy#, #updatedName#, #updatedTime#, #deleteFlag#, #factoryCode#, #factoryName#, #flowCode#, #flowName#, #processCode#, #processName#, #unit#, #processClass#, #spec#, #length#, #width#, #thick#, #coefficient#, #price#, #status#)
</insert> </insert>
<delete id="delete"> <delete id="delete">
...@@ -337,6 +339,7 @@ ...@@ -337,6 +339,7 @@
WIDTH = #width#, <!-- 宽 --> WIDTH = #width#, <!-- 宽 -->
THICK = #thick#, <!-- 厚 --> THICK = #thick#, <!-- 厚 -->
COEFFICIENT = #coefficient#, <!-- 系数 --> COEFFICIENT = #coefficient#, <!-- 系数 -->
PRICE = #price#,
STATUS = #status# <!-- 状态 0-启用 1-停止 --> STATUS = #status# <!-- 状态 0-启用 1-停止 -->
WHERE WHERE
ID = #id# ID = #id#
...@@ -362,7 +365,7 @@ ...@@ -362,7 +365,7 @@
'' as "length", '' as "length",
'' as "width", '' as "width",
'' as "thick" '' as "thick"
from hggp.hggy001 from ${hggpSchema}.hggy001
where ACCOUNT_CODE = #accountCode# where ACCOUNT_CODE = #accountCode#
<isNotEmpty prepend=" AND " property="deleteFlag"> <isNotEmpty prepend=" AND " property="deleteFlag">
DELETE_FLAG = #deleteFlag# DELETE_FLAG = #deleteFlag#
...@@ -378,8 +381,8 @@ ...@@ -378,8 +381,8 @@
FACTORY_NAME as "factoryName", FACTORY_NAME as "factoryName",
COMPANY_CODE as "companyCode", COMPANY_CODE as "companyCode",
COMPANY_NAME as "companyName" COMPANY_NAME as "companyName"
from iplat_hggp.txsog01 A from ${platSchema}.txsog01 A
inner join iplat_hggp.txsog02 B ON A.ORG_ID = B.ORG_ID inner join ${platSchema}.txsog02 B ON A.ORG_ID = B.ORG_ID
where A.ACCOUNT_CODE = #accountCode# and A.ORG_TYPE in (#orgType#) AND B.USER_ID = #loginName# and A.IS_DELETED = '0' where A.ACCOUNT_CODE = #accountCode# and A.ORG_TYPE in (#orgType#) AND B.USER_ID = #loginName# and A.IS_DELETED = '0'
</select> </select>
......
...@@ -2,6 +2,8 @@ package com.baosight.hggp.hg.sj.tools; ...@@ -2,6 +2,8 @@ package com.baosight.hggp.hg.sj.tools;
import com.baosight.hggp.core.dao.DaoBase; import com.baosight.hggp.core.dao.DaoBase;
import com.baosight.hggp.core.security.UserSessionUtils; import com.baosight.hggp.core.security.UserSessionUtils;
import com.baosight.hggp.hg.sb.domain.HGSB002A;
import com.baosight.hggp.hg.sj.domain.HGSJ002A;
import com.baosight.hggp.hg.sj.domain.HGSJ003; import com.baosight.hggp.hg.sj.domain.HGSJ003;
import com.baosight.hggp.util.AssertUtils; import com.baosight.hggp.util.AssertUtils;
import com.baosight.iplat4j.common.ed.domain.TEDCM01; import com.baosight.iplat4j.common.ed.domain.TEDCM01;
...@@ -21,8 +23,26 @@ import java.util.stream.Collectors; ...@@ -21,8 +23,26 @@ import java.util.stream.Collectors;
public class HGSJTools { public class HGSJTools {
/** /**
* Hgsj002a公共DAO方法定义
*/
public static class Hgsj002a {
/**
* 查询
* @param parentId
* @return
*/
public static List<HGSJ002A> list(Long parentId){
AssertUtils.isNull(parentId, "parentId不能为空");
Map queryMap = new HashMap();
queryMap.put(HGSJ002A.FIELD_PAREND_ID, parentId);
List<HGSJ002A> results = DaoBase.getInstance().query(HGSJ002A.QUERY, queryMap);
AssertUtils.isEmpty(results, String.format("流程ID[%s]没有添加流程详情不存在", parentId));
return results;
}
}
/**
* Hgsj003公共DAO方法定义 * Hgsj003公共DAO方法定义
*
*/ */
public static class Hgsj003 { public static class Hgsj003 {
/** /**
......
package com.baosight.hggp.hg.utils;
import com.baosight.hggp.hg.cg.domain.HGCG001;
import com.baosight.hggp.hg.cg.domain.HGCG002;
import com.baosight.hggp.hg.cg.domain.HGCG003;
import com.baosight.hggp.hg.kc.domain.HGKC001;
import com.baosight.hggp.util.DateUtils;
import com.baosight.hggp.util.MapUtils;
import com.baosight.hggp.util.StringUtils;
import java.util.Map;
/**
* @author:songx
* @date:2024/5/15,9:45
*/
public class HGUtils {
/**
* 设置查询条件
*
* @param queryRow
*/
public static void setCondition(Map queryRow) {
// 创建时间
String createdTimeFrom = MapUtils.getString(queryRow, "createdTimeFrom");
if (StringUtils.isNotBlank(createdTimeFrom)) {
queryRow.put("createdTimeFrom", DateUtils.formatShort(createdTimeFrom));
}
String createdTimeTo = MapUtils.getString(queryRow, "createdTimeTo");
if (StringUtils.isNotBlank(createdTimeTo)) {
queryRow.put("createdTimeTo", DateUtils.formatShort(createdTimeTo));
}
}
}
package com.baosight.hggp.hg.zl.service;
import com.baosight.hggp.aspect.annotation.OperationLogAnnotation;
import com.baosight.hggp.common.DdynamicEnum;
import com.baosight.hggp.hg.zl.domain.HGZL001;
import com.baosight.hggp.hg.zl.utils.HGZLUtils;
import com.baosight.hggp.util.CommonMethod;
import com.baosight.hggp.util.EiInfoUtils;
import com.baosight.hggp.util.LogUtils;
import com.baosight.iplat4j.core.ei.EiConstant;
import com.baosight.iplat4j.core.ei.EiInfo;
import com.baosight.iplat4j.core.service.impl.ServiceBase;
import java.util.Arrays;
import java.util.List;
import java.util.Map;
/**
* @author ZJH
* @date 2024年01月09日 10:18
*/
public class ServiceHGZL001 extends ServiceBase {
/**
* 画面初始化
*
* @param inInfo
* @return
*/
@Override
@OperationLogAnnotation(operModul = "入库质检单", operType = "查询", operDesc = "初始化")
public EiInfo initLoad(EiInfo inInfo) {
try {
CommonMethod.initBlock(inInfo, Arrays.asList(DdynamicEnum.PROJ_RECORD_BLOCK_ID), null);
CommonMethod.initBlock(inInfo, Arrays.asList(DdynamicEnum.INVENT_RECORD_BLOCK_ID), null);
CommonMethod.initBlock(inInfo, Arrays.asList(DdynamicEnum.USER_BLOCK_ID), null);
inInfo.addBlock(EiConstant.resultBlock).addBlockMeta(new HGZL001().eiMetadata);
} catch (Exception e) {
LogUtils.setDetailMsg(inInfo, e, "初始化失败");
}
return inInfo;
}
/**
* 查询操作
*
* @param inInfo
* @return
*/
@Override
@OperationLogAnnotation(operModul = "质量巡检单", operType = "查询", operDesc = "查询")
public EiInfo query(EiInfo inInfo) {
try {
Map queryMap = EiInfoUtils.getFirstRow(inInfo);
HGZLUtils.HgZl001.setCondition(queryMap);
inInfo = super.query(inInfo, HGZL001.QUERY, new HGZL001());
} catch (Exception e) {
LogUtils.setDetailMsg(inInfo, e, "查询失败");
}
return inInfo;
}
/**
* 新增操作
*
* @param inInfo
* @return
*/
@OperationLogAnnotation(operModul = "质量巡检单",operType = "新增",operDesc = "新增")
public EiInfo insert(EiInfo inInfo) {
try {
List<Map> resultRows = inInfo.getBlock(EiConstant.resultBlock).getRows();
for (int i = 0; i < resultRows.size(); i++) {
// HPZL001 fZl001 = new HPZL001();
// fZl001.fromMap(resultRows.get(i));
// // 去除日期字符串中的-
// fZl001.setReceiptDate(StringUtil.removeHorizontalLine(fZl001.getReceiptDate()));
// // 设置基础信息
// this.setBaseInfo(fZl001);
// // 生成单据号
// fZl001.setCheckNo(SequenceGenerator.getNextSequence(
// HGConstant.SequenceId.HPZL001_NUMBER));
// fZl001.setDeleteFlag(CommonConstant.YesNo.NO_0);
// DaoUtils.insert(HPZL001.INSERT, fZl001);
}
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
*/
@OperationLogAnnotation(operModul = "质量巡检单",operType = "修改",operDesc = "修改")
public EiInfo update(EiInfo inInfo) {
try {
List<Map> resultRows = inInfo.getBlock(EiConstant.resultBlock).getRows();
for (int i = 0; i < resultRows.size(); i++) {
// HPZL001 fZl001 = new HPZL001();
// fZl001.fromMap(resultRows.get(i));
// AssertUtils.isTrue(CommonConstant.YesNo.YES_1.equals(fZl001.getStatus()),
// String.format("单号[%s]的状态为\"已处理\"不允许修改", fZl001.getCheckNo()));
// // 去除日期字符串中的-
// fZl001.setReceiptDate(StringUtil.removeHorizontalLine(fZl001.getReceiptDate()));
// // 设置基础信息
// this.setBaseInfo(fZl001);
// DaoUtils.update(HPZL001.UPDATE, fZl001);
}
inInfo = this.query(inInfo);
inInfo.setStatus(EiConstant.STATUS_DEFAULT);
inInfo.setMsg("操作成功!本次对[" + resultRows.size() + "]条数据修改成功!");
} catch (Exception e) {
LogUtils.setDetailMsg(inInfo, e, "修改失败");
}
return inInfo;
}
/**
* 设置基础信息
*
* @param fZl001
*/
private void setBaseInfo(HGZL001 fZl001) {
// 项目名称
// fZl001.setProjName(HPSCTools.HpSc001.get(fZl001.getProjCode()).getProjName());
// 部件名称
// fZl001.setInventName(HPSCTools.HpSc002.get(fZl001.getInventCode()).getPrdtName());
// 零件名称
// fZl001.setSubInventName(HPSCTools.HpSc002.get(fZl001.getSubInventCode()).getPrdtName());
// 生产组名称
// fZl001.setOrgName(HPXSTools.XsOrg.get(fZl001.getOrgNo()).getOrgCname());
// 检查人名称
// fZl001.setCheckUser(UserSession.getLoginName());
// fZl001.setCheckUserName(UserSession.getLoginCName());
}
/**
* 删除操作
*
* @param inInfo
* @return
*/
@OperationLogAnnotation(operModul = "质量巡检单",operType = "删除",operDesc = "删除")
public EiInfo delete(EiInfo inInfo) {
try {
List<Map> resultRows = inInfo.getBlock(EiConstant.resultBlock).getRows();
for (int i = 0; i < resultRows.size(); i++) {
// HPZL001 fZl001 = new HPZL001();
// fZl001.fromMap(resultRows.get(i));
// AssertUtils.isTrue(CommonConstant.YesNo.YES_1.equals(fZl001.getStatus()),
// String.format("单号[%s]的状态为\"已处理\"不允许删除", fZl001.getCheckNo()));
// DaoUtils.update(HPZL001.DELETE, resultRows.get(i));
}
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
*/
@OperationLogAnnotation(operModul = "质量巡检单",operType = "修改",operDesc = "已处理")
public EiInfo doProcess(EiInfo inInfo) {
try {
List<Map> resultRows = inInfo.getBlock(EiConstant.resultBlock).getRows();
for (int i = 0; i < resultRows.size(); i++) {
// HPZL001 fZl001 = new HPZL001();
// fZl001.fromMap(resultRows.get(i));
///* fZl001.setCheckUser(UserSession.getLoginName());
// fZl001.setCheckUserName(UserSession.getLoginCName());*/
// fZl001.setStatus(CommonConstant.YesNo.YES_1);
// DaoUtils.update(HGSqlConstant.HPZL001.DO_PROCESS, fZl001);
}
inInfo = this.query(inInfo);
inInfo.setStatus(EiConstant.STATUS_DEFAULT);
inInfo.setMsg("操作成功!本次对[" + resultRows.size() + "]条数据处理成功!");
} catch (Exception e) {
LogUtils.setDetailMsg(inInfo, e, "提交失败");
}
return inInfo;
}
}
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE sqlMap PUBLIC "-//iBATIS.com//DTD SQL Map 2.0//EN" "http://www.ibatis.com/dtd/sql-map-2.dtd">
<sqlMap namespace="HGZL001">
<sql id="column">
ID as "id",
ACCOUNT_CODE as "accountCode", <!-- 企业编码 -->
DEP_CODE as "depCode", <!-- 部门编码 -->
CREATED_BY as "createdBy", <!-- 记录创建者 -->
CREATED_NAME as "createdName", <!-- 记录创建名称 -->
CREATED_TIME as "createdTime", <!-- 记录创建时间 -->
UPDATED_BY as "updatedBy", <!-- 记录修改者 -->
UPDATED_NAME as "updatedName", <!-- 记录修改名称 -->
UPDATED_TIME as "updatedTime", <!-- 记录修改时间 -->
DELETE_FLAG as "deleteFlag", <!-- 0-未删除,1-已删除 -->
COMPANY_CODE as "companyCode", <!-- 公司编码 -->
COMPANY_NAME as "companyName", <!-- 公司名称 -->
RECEIPT_DATE as "receiptDate", <!-- 单据日期 -->
CHECK_NO as "checkNo", <!-- 检查单号 -->
RECEIVE_NO as "receiveNo", <!-- 收货单号 -->
INVENT_TYPE as "inventType", <!-- 存货类型 -->
INVENT_CODE as "inventCode", <!-- 存货编码 -->
INVENT_NAME as "inventName", <!-- 存货名称 -->
SPEC_ID as "specId", <!-- 规格ID -->
SPEC as "spec", <!-- 规格 -->
MATERIAL as "material", <!-- 材质 -->
UNIT as "unit", <!-- 单位 -->
LENGTH as "length", <!-- 长度 -->
WIDTH as "width", <!-- 宽度 -->
THICK as "thick", <!-- 厚度 -->
RECEIVE_QTY as "receiveQty", <!-- 收货数量 -->
QUALIFY_QTY as "qualifyQty", <!-- 合格数量 -->
UNQUALIFY_QTY as "unqualifyQty", <!-- 不合格数量 -->
RECEIVE_UNIT_WEIGHT as "receiveUnitWeight", <!-- 收货单重 -->
RECEIVE_WEIGHT as "receiveWeight", <!-- 收货重量 -->
STATUS as "status" <!-- 状态:0-质检中,1-质检完成 -->
</sql>
<sql id="condition">
<include refid="HGXSDataAuth.authCondition"/>
<include refid="idCondition"/>
<include refid="customCondition"/>
<isNotEmpty prepend=" AND " property="accountCode">
ACCOUNT_CODE = #accountCode#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="depCode">
DEP_CODE = #depCode#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="deleteFlag">
DELETE_FLAG = #deleteFlag#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="companyCode">
COMPANY_CODE = #companyCode#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="companyName">
COMPANY_NAME = #companyName#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="receiptDate">
RECEIPT_DATE = #receiptDate#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="checkNo">
CHECK_NO = #checkNo#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="receiveNo">
RECEIVE_NO = #receiveNo#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="inventType">
INVENT_TYPE = #inventType#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="inventCode">
INVENT_CODE = #inventCode#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="inventName">
INVENT_NAME = #inventName#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="specId">
SPEC_ID = #specId#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="spec">
SPEC = #spec#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="material">
MATERIAL = #material#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="unit">
UNIT = #unit#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="status">
STATUS = #status#
</isNotEmpty>
</sql>
<sql id="idCondition">
<isNotEmpty prepend=" AND " property="id">
ID = #id#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="reqNo">
REQ_NO = #reqNo#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="reqNos">
REQ_NO IN <iterate open="(" close=")" conjunction="," property="reqNos">#reqNos[]#</iterate>
</isNotEmpty>
</sql>
<sql id="customCondition">
<include refid="BaseCondition.specCondition"/>
<include refid="BaseCondition.createdTimeCondition"/>
</sql>
<!-- 公共修改字段 -->
<sql id="updateRevise">
UPDATED_BY = #updatedBy#,
UPDATED_NAME = #updatedName#,
UPDATED_TIME = #updatedTime#
</sql>
<sql id="orderBy">
<dynamic prepend="ORDER BY">
<isNotEmpty property="orderBy">
$orderBy$
</isNotEmpty>
<isEmpty property="orderBy">
ID DESC
</isEmpty>
</dynamic>
</sql>
<select id="query" resultClass="com.baosight.hggp.hg.zl.domain.HGZL001">
SELECT
<include refid="column"/>
FROM ${hggpSchema}.HGZL001 WHERE 1=1
<include refid="condition"/>
<include refid="orderBy"/>
</select>
<select id="count" resultClass="int">
SELECT COUNT(*) FROM ${hggpSchema}.HGZL001 WHERE 1=1
<include refid="condition"/>
</select>
<insert id="insert">
INSERT INTO ${hggpSchema}.HGZL001 (
ACCOUNT_CODE, <!-- 企业编码 -->
DEP_CODE, <!-- 部门编码 -->
CREATED_BY, <!-- 记录创建者 -->
CREATED_NAME, <!-- 记录创建名称 -->
CREATED_TIME, <!-- 记录创建时间 -->
DELETE_FLAG, <!-- 0-未删除,1-已删除 -->
COMPANY_CODE, <!-- 公司编码 -->
COMPANY_NAME, <!-- 公司名称 -->
RECEIPT_DATE, <!-- 单据日期 -->
CHECK_NO, <!-- 检查单号 -->
RECEIVE_NO, <!-- 收货单号 -->
INVENT_TYPE, <!-- 存货类型 -->
INVENT_CODE, <!-- 存货编码 -->
INVENT_NAME, <!-- 存货名称 -->
SPEC_ID, <!-- 规格ID -->
SPEC, <!-- 规格 -->
MATERIAL, <!-- 材质 -->
UNIT, <!-- 单位 -->
LENGTH, <!-- 长度 -->
WIDTH, <!-- 宽度 -->
THICK, <!-- 厚度 -->
RECEIVE_QTY, <!-- 收货数量 -->
QUALIFY_QTY, <!-- 合格数量 -->
UNQUALIFY_QTY, <!-- 不合格数量 -->
RECEIVE_UNIT_WEIGHT, <!-- 收货单重 -->
RECEIVE_WEIGHT, <!-- 收货重量 -->
STATUS <!-- 状态:0-质检中,1-质检完成 -->
) VALUES (
#id#, #accountCode#, #depCode#, #createdBy#, #createdName#, #createdTime#,
#deleteFlag#, #companyCode#, #companyName#, #receiptDate#, #checkNo#, #receiveNo#, #inventType#,
#inventCode#, #inventName#, #specId#, #spec#, #material#, #unit#, #length#, #width#, #thick#, #receiveQty#,
#qualifyQty#, #unqualifyQty#, #receiveUnitWeight#, #receiveWeight#, #status#
)
</insert>
<delete id="delete">
UPDATE ${hggpSchema}.HGZL001
SET
DELETE_FLAG = #deleteFlag#,
<include refid="updateRevise"/>
WHERE CHECK_NO = #checkNo#
</delete>
</sqlMap>
package com.baosight.hggp.hg.zl.utils;
import com.baosight.hggp.hg.utils.HGUtils;
import com.baosight.hggp.hg.zl.domain.HGZL001;
import com.baosight.hggp.util.DateUtils;
import com.baosight.hggp.util.MapUtils;
import com.baosight.hggp.util.StringUtils;
import java.util.Map;
/**
* @author:songx
* @date:2024/5/16,11:26
*/
public class HGZLUtils {
/**
* HGZL001 工具类
*
* @author:songx
* @date:2024/5/9,16:58
*/
public static class HgZl001 {
/**
* 设置查询条件
*
* @param queryRow 集合
* @return
*/
public static void setCondition(Map queryRow) {
HGUtils.setCondition(queryRow);
// 单据日期
String receiptDate = MapUtils.getString(queryRow, HGZL001.FIELD_RECEIPT_DATE);
if (StringUtils.isNotBlank(receiptDate)) {
queryRow.put(HGZL001.FIELD_RECEIPT_DATE, DateUtils.formatShort(receiptDate));
}
}
}
}
package com.baosight.hggp.util; package com.baosight.hggp.util;
import com.baosight.hggp.common.DdynamicEnum;
import com.baosight.hggp.core.constant.CommonConstant; import com.baosight.hggp.core.constant.CommonConstant;
import com.baosight.hggp.core.dao.DaoUtils; import com.baosight.hggp.core.dao.DaoUtils;
import com.baosight.hggp.hg.pz.tools.HGPZTools;
import com.baosight.hggp.hg.sj.domain.HGSJ003; import com.baosight.hggp.hg.sj.domain.HGSJ003;
import com.baosight.hggp.hg.sj.tools.HGSJTools; import com.baosight.hggp.hg.sj.tools.HGSJTools;
import com.baosight.hggp.util.importer.Importer; import com.baosight.hggp.util.importer.Importer;
...@@ -238,6 +240,11 @@ public class ExcelUtils { ...@@ -238,6 +240,11 @@ public class ExcelUtils {
inInfo.setStatus(EiConstant.STATUS_DEFAULT); inInfo.setStatus(EiConstant.STATUS_DEFAULT);
inInfo.setMsg("导入成功" + arrayList.size() + "条"); inInfo.setMsg("导入成功" + arrayList.size() + "条");
break; break;
case "HGPZ005":
HGPZTools.HgPz005.add(arrayList);
inInfo.setStatus(EiConstant.STATUS_DEFAULT);
inInfo.setMsg("导入成功" + arrayList.size() + "条");
break;
default: default:
} }
......
...@@ -19,7 +19,11 @@ ...@@ -19,7 +19,11 @@
<!-- 库存 --> <!-- 库存 -->
<sqlMap resource="com/baosight/hggp/hg/kc/sql/HGKC001.xml"/> <sqlMap resource="com/baosight/hggp/hg/kc/sql/HGKC001.xml"/>
<sqlMap resource="com/baosight/hggp/hg/kc/sql/HGKC002.xml"/> <sqlMap resource="com/baosight/hggp/hg/kc/sql/HGKC002.xml"/>
<sqlMap resource="com/baosight/hggp/hg/kc/sql/HGKC003.xml"/>
<sqlMap resource="com/baosight/hggp/hg/kc/sql/HGKC010.xml"/> <sqlMap resource="com/baosight/hggp/hg/kc/sql/HGKC010.xml"/>
<sqlMap resource="com/baosight/hggp/hg/kc/sql/HGKC011.xml"/>
<!-- 质量 -->
<sqlMap resource="com/baosight/hggp/hg/zl/sql/HGZL001.xml"/>
<!-- 生产 --> <!-- 生产 -->
<sqlMap resource="com/baosight/hggp/hg/sc/sql/HGSC001.xml"/> <sqlMap resource="com/baosight/hggp/hg/sc/sql/HGSC001.xml"/>
<sqlMap resource="com/baosight/hggp/hg/sc/sql/HGSC001A.xml"/> <sqlMap resource="com/baosight/hggp/hg/sc/sql/HGSC001A.xml"/>
...@@ -30,4 +34,7 @@ ...@@ -30,4 +34,7 @@
<sqlMap resource="com/baosight/hggp/hg/cw/sql/HGCW002.xml"/> <sqlMap resource="com/baosight/hggp/hg/cw/sql/HGCW002.xml"/>
<sqlMap resource="com/baosight/hggp/hg/cw/sql/HGCW003.xml"/> <sqlMap resource="com/baosight/hggp/hg/cw/sql/HGCW003.xml"/>
<!--配置-->
<sqlMap resource="com/baosight/hggp/hg/pz/sql/HGPZ005A.xml"/>
</sqlMapConfig> </sqlMapConfig>
...@@ -33,7 +33,7 @@ ...@@ -33,7 +33,7 @@
filter="contains"> filter="contains">
<EF:EFOptions blockId="spec_name_block_id" textField="textField" valueField="valueField"/> <EF:EFOptions blockId="spec_name_block_id" textField="textField" valueField="valueField"/>
</EF:EFSelect> </EF:EFSelect>
<EF:EFSelect cname="是否删除" blockId="inqu_status" ename="deleteFlag" row="0" colWidth="3" optionlabel="全部" <EF:EFSelect cname="是否删除" blockId="inqu_status" ename="deleteFlag" row="0" colWidth="3" optionLabel="全部"
defaultValue="0"> defaultValue="0">
<EF:EFCodeOption codeName="hpjx.hpjx.deleteFlag"/> <EF:EFCodeOption codeName="hpjx.hpjx.deleteFlag"/>
</EF:EFSelect> </EF:EFSelect>
......
$(function () {
IPLATUI.EFGrid.result = {
pageable: {
pageSize: 20,
pageSizes: [10, 20, 30, 50, 100, 200],
},
columns: [],
loadComplete: function (grid) {
},
onSuccess: function (e) {
if(e.eiInfo.extAttr.methodName == 'delete' ){
query();
}
}
}
// 查询
$("#QUERY").on("click", query);
// 选择生产任务
$("#SELECT_TASK").on("click", selectTask);
});
/**
* 页面加载时执行
*/
$(window).load(function () {
query();
});
/**
* 查询
*/
let query = function () {
resultGrid.dataSource.page(1);
}
/**
* 选择生产任务
*/
let selectTask = function () {
JSColorbox.open({
href: "HGKC003A?methodName=initLoad",
title: "<div style='text-align: center;'>生产任务查询</div>",
width: "80%",
height: "80%",
callbackName: selectTaskCallback
});
}
/**
* 挑选库存回调
*/
let selectTaskCallback = function () {
// 刷新页面
query();
// 关闭弹窗
JSColorbox.close();
}
<!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:EFDatePicker cname="单据日期" ename="documentDate" blockId="inqu_status" row="0" colWidth="3"
format="yyyy-MM-dd" readonly="true"/>
<EF:EFInput cname="项目名称" ename="projName" blockId="inqu_status" row="0" colWidth="3"/>
<EF:EFSelect cname="仓库名称" ename="whCode" blockId="inqu_status" row="0" colWidth="3"
filter="contains" defultValue="">
<EF:EFOption label="全部" value=""/>
<EF:EFOptions blockId="wh_record_block_id" textField="textField" valueField="valueField"/>
</EF:EFSelect>
<EF:EFSelect cname="是否删除" ename="deleteFlag" blockId="inqu_status" row="0" colWidth="3" defaultValue="0">
<EF:EFOption label="全部" value=""/>
<EF:EFCodeOption codeName="hpjx.hpjx.deleteFlag"/>
</EF:EFSelect>
</div>
<div class="row">
<EF:EFInput cname="部件名称" ename="prdtName" blockId="inqu_status" row="0" colWidth="3"/>
<EF:EFInput cname="零件名称" ename="partName" blockId="inqu_status" row="0" colWidth="3"/>
<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>
</EF:EFRegion>
<EF:EFRegion id="result" title="明细信息">
<EF:EFGrid blockId="result" autoDraw="override" isFloat="true" checkMode="row">
<EF:EFColumn ename="id" cname="内码" hidden="true"/>
<EF:EFColumn ename="prodNo" cname="生产单号" enable="false" width="140" align="center"/>
<EF:EFColumn ename="depositDate" cname="单据日期" enable="false" width="100" align="center" editType="date"
dateFormat="yyyy-MM-dd" parseFormats="['yyyyMMdd']" required="true"/>
<EF:EFColumn ename="projName" cname="项目名称" enable="false" width="140" align="center"/>
<EF:EFComboColumn ename="whCode" cname="仓库名称" enable="false" width="120" align="center"
blockName="wh_record_block_id" textField="textField" valueField="valueField"
columnTemplate="#=textField#" itemTemplate="#=textField#">
</EF:EFComboColumn>
<EF:EFColumn ename="prdtName" cname="部件名称" enable="false" width="120" align="center"/>
<EF:EFColumn ename="partName" cname="零件名称" enable="false" width="120" align="center"/>
<EF:EFColumn ename="partSpec" cname="零件规格" enable="false" width="150" align="center"/>
<EF:EFColumn ename="invQty" cname="数量" enable="false" width="120" align="right" format="{0:N0}"/>
<EF:EFColumn ename="invQeight" cname="总重(T)" enable="false" width="120" align="right" format="{0:N3}"/>
<EF:EFColumn ename="remark" cname="备注" enable="false" width="150"/>
<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:EFRegion>
</EF:EFPage>
let whNameGlobalData = [];
$(function () {
IPLATUI.EFGrid = {
"result": {
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();
// 1.原料,2.耗材
inInfo.set("inqu_status-0-inventTypes", [3]);
inInfo.set("inqu_status-0-whType", options.model["inventType"]);
inInfo.set("inqu_status-0-isSplicingSymbol", false);
inInfo.set("serviceName", "HPPZ007");
inInfo.set("methodName", "queryComboBox");
inInfo.set("blockId", "wh_record_block_id");
inInfo.set("field", options.field);
refreshSelect(container, inInfo);
}
},],
dataBound: function () {
}
}
};
$("#ef_form_head").hide();
// 查询
$("#QUERY").on("click", query);
// 确认选择
$("#CONFIRM").on("click", select);
});
/**
* 页面加载时执行
*/
$(window).load(function () {
// 初始化查询
query();
// 仓库名称
initWh()
});
/**
* 初始化仓库
*/
let initWh = function () {
let inInfo = new EiInfo();
// 1.原料,2.耗材
inInfo.set("inqu_status-0-inventTypes", [3]);
inInfo.set("inqu_status-0-isSplicingSymbol", false);
EiCommunicator.send("HPPZ007", "queryComboBox", inInfo, {
onSuccess: function (ei) {
whNameGlobalData = ei.getBlock("wh_record_block_id").getMappedRows();
},
onFail: function (ei) {
}
}, {async: false});
}
/**
* 查询
*/
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 whCode = rows[i]['whCode'];
let applyNum = rows[i]['applyNum'];
let num = rows[i]['num'];
let completeNum = rows[i]['completeNum'];
if (isBlank(whCode)) {
message("第" + (i + 1) + "行请选择仓库名称");
return;
}
if (!isPositiveInteger(applyNum)) {
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">
<EF:EFInput cname="项目名称" ename="projName" blockId="inqu_status" row="0" colWidth="4"/>
<EF:EFInput cname="部件名称" ename="prdtName" blockId="inqu_status" row="0" colWidth="4"/>
<EF:EFInput cname="零件名称" ename="partName" blockId="inqu_status" row="0" colWidth="4"/>
</div>
<div class="row">
<EF:EFSelect cname="工厂" blockId="inqu_status" ename="factoryCode" row="0" colWidth="4"
filter="contains">
<EF:EFOption label="全部" value=""/>
<EF:EFOptions blockId="factory_record_block_id" textField="textField" valueField="valueField"/>
</EF:EFSelect>
<EF:EFSelect cname="生产组" blockId="inqu_status" ename="groupCode" row="0" colWidth="4" filter="contains">
<EF:EFOption label="全部" value=""/>
<EF:EFOptions blockId="group_record_block_id" textField="textField" valueField="valueField"/>
</EF:EFSelect>
</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:EFColumn ename="whCode" cname="仓库名称" width="120" align="center" required="true"/>
<EF:EFColumn ename="applyNum" cname="入库数量" width="120" align="right" format="{0:N0}" required="true"/>
<EF:EFColumn ename="remark1" cname="入库说明" width="150"/>
<EF:EFColumn ename="completeNum" cname="已入库数量" enable="false" width="120" align="right" format="{0:N0}"
hidden="true"/>
<EF:EFColumn ename="unCompleteNum" cname="待入库数量" enable="false" width="120" align="right" format="{0:N0}"/>
<EF:EFColumn ename="num" cname="任务数量" enable="false" width="120" align="right" format="{0:N0}"/>
<EF:EFColumn ename="totalWt" cname="任务重量(T)" 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="prdtCode" cname="部件编码" enable="false" width="120" align="center" hidden="true"/>
<EF:EFColumn ename="partCode" cname="零件编码" enable="false" width="120" align="center" hidden="true"/>
<EF:EFColumn ename="factoryCode" cname="厂区编码" enable="false" width="150" hidden="true"/>
<EF:EFColumn ename="orgNo" cname="生产组编码" enable="false" width="150" hidden="true"/>
</EF:EFGrid>
</EF:EFRegion>
</EF:EFPage>
$(function () { $(function () {
IPLATUI.EFGrid = { IPLATUI.EFGrid = {
exportGrid: false, // 隐藏右侧自定义导出按钮
"result": { "result": {
exportGrid: false, // 隐藏右侧自定义导出按钮
columns: [] columns: []
}, },
}; };
......
...@@ -8,20 +8,26 @@ ...@@ -8,20 +8,26 @@
<EF:EFPage title="综合库存管理"> <EF:EFPage title="综合库存管理">
<EF:EFRegion id="inqu" title="查询条件"> <EF:EFRegion id="inqu" title="查询条件">
<div class="row"> <div class="row">
<EF:EFSelect cname="公司名称" blockId="inqu_status" ename="companyCode" row="0" colWidth="3"
optionLabel="全部" defultValue="" filter="contains">
<EF:EFOptions blockId="company_code_block_id" textField="textField" valueField="valueField"/>
</EF:EFSelect>
<EF:EFSelect cname="仓库名称" blockId="inqu_status" ename="whCode" row="0" colWidth="3" <EF:EFSelect cname="仓库名称" blockId="inqu_status" ename="whCode" row="0" colWidth="3"
optionLabel="全部" filter="contains" defultValue=""> optionLabel="全部" defultValue="" filter="contains">
<EF:EFOptions blockId="wh_record_block_id" textField="textField" valueField="valueField"/> <EF:EFOptions blockId="wh_record_block_id" textField="textField" valueField="valueField"/>
</EF:EFSelect> </EF:EFSelect>
<EF:EFSelect cname="存货类型" blockId="inqu_status" ename="incentType" row="0" colWidth="3" optionLabel="全部" <EF:EFSelect cname="存货类型" blockId="inqu_status" ename="incentType" row="0" colWidth="3"
filter="contains" defultValue=""> optionLabel="全部" defultValue="" filter="contains">
<EF:EFOptions blockId="invent_type_block_id" textField="textField" valueField="valueField"/> <EF:EFOptions blockId="invent_type_block_id" textField="textField" valueField="valueField"/>
</EF:EFSelect> </EF:EFSelect>
<EF:EFSelect cname="存货名称" blockId="inqu_status" ename="incentCode" row="0" colWidth="3" optionLabel="全部" <EF:EFSelect cname="存货名称" blockId="inqu_status" ename="incentCode" row="0" colWidth="3"
filter="contains" defultValue=""> optionLabel="全部" defultValue="" filter="contains">
<EF:EFOptions blockId="invent_record_block_id" textField="textField" valueField="valueField"/> <EF:EFOptions blockId="invent_record_block_id" textField="textField" valueField="valueField"/>
</EF:EFSelect> </EF:EFSelect>
<EF:EFSelect cname="规格" blockId="inqu_status" ename="spec" row="0" colWidth="3" optionLabel="全部" </div>
filter="contains" defultValue=""> <div class="row">
<EF:EFSelect cname="规格" blockId="inqu_status" ename="spec" row="0" colWidth="3"
optionLabel="全部" defultValue="" filter="contains">
<EF:EFOptions blockId="spec_name_block_id" textField="textField" valueField="valueField"/> <EF:EFOptions blockId="spec_name_block_id" textField="textField" valueField="valueField"/>
</EF:EFSelect> </EF:EFSelect>
</div> </div>
......
$(function () {
IPLATUI.EFGrid = {
"result": {
exportGrid: false, // 隐藏右侧自定义导出按钮
columns: []
},
};
// 查询
$("#QUERY").on("click", query);
});
/**
* 页面加载时执行
*/
$(window).load(function () {
// 查询
query();
});
/**
* 查询
*/
let query = function () {
resultGrid.dataSource.page(1); // 点击查询按钮,从第1页开始查询
}
<!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:EFSelect cname="公司名称" blockId="inqu_status" ename="companyCode" row="0" colWidth="3"
optionLabel="全部" defultValue="" filter="contains">
<EF:EFOptions blockId="company_code_block_id" textField="textField" valueField="valueField"/>
</EF:EFSelect>
<EF:EFSelect cname="仓库名称" blockId="inqu_status" ename="whCode" row="0" colWidth="3"
optionLabel="全部" defultValue="" filter="contains">
<EF:EFOptions blockId="wh_record_block_id" textField="textField" valueField="valueField"/>
</EF:EFSelect>
<EF:EFSelect cname="部件名称" blockId="inqu_status" ename="inventCode" row="0" colWidth="3"
optionLabel="全部" defultValue="" filter="contains">
<EF:EFOptions blockId="material_record_block_id" textField="textField" valueField="valueField"/>
</EF:EFSelect>
<EF:EFSelect cname="零件名称" blockId="inqu_status" ename="subInventCode" colWidth="3"
optionLabel="全部" defultValue="" filter="contains">
<EF:EFOptions blockId="material_record_block_id" textField="textField" valueField="valueField"/>
</EF:EFSelect>
</div>
</EF:EFRegion>
<EF:EFRegion id="result" title="明细信息">
<EF:EFGrid blockId="result" autoDraw="override" isFloat="true" checkMode="row">
<EF:EFColumn ename="id" cname="内码" hidden="true"/>
<EF:EFColumn ename="companyCode" cname="公司编码" enable="false" width="100" align="center" hidden="true"/>
<EF:EFColumn ename="companyName" cname="公司名称" enable="false" width="130" align="center"/>
<EF:EFComboColumn ename="factoryCode" cname="厂区" enable="false" width="110" align="center">
<EF:EFOptions blockId="factory_record_block_id" valueField="valueField" textField="textField"/>
</EF:EFComboColumn>
<EF:EFComboColumn ename="whCode" cname="仓库名称" enable="false" width="120" align="center">
<EF:EFOptions blockId="wh_record_block_id" valueField="valueField" textField="textField"/>
</EF:EFComboColumn>
<EF:EFColumn ename="projName" cname="项目名称" enable="false" width="120" align="center"/>
<EF:EFColumn ename="inventName" cname="部件名称" enable="false" width="120" align="center"/>
<EF:EFColumn ename="subInventName" cname="零件名称" enable="false" width="120" align="center"/>
<EF:EFColumn ename="spec" cname="规格" enable="false" width="150" align="center"/>
<EF:EFColumn ename="invQty" cname="数量" enable="false" width="100" align="right" format="{0:N0}"/>
<EF:EFColumn ename="unitWeight" cname="单重(KG)" enable="false" width="90" align="right" format="{0:N3}"/>
<EF:EFColumn ename="invWeight" cname="总重(T)" enable="false" width="90" align="right" format="{0:N3}"/>
<EF:EFColumn ename="createdBy" cname="创建人" enable="false" width="100" align="center"/>
<EF:EFColumn ename="createdTime" cname="创建时刻" enable="false" width="140" align="center"
editType="datetime" parseFormats="['yyyyMMddHHmmss']"/>
<EF:EFColumn ename="updatedBy" cname="更新人" enable="false" width="100" align="center"/>
<EF:EFColumn ename="updatedTime" cname="更新时刻" enable="false" width="140" align="center"
editType="datetime" parseFormats="['yyyyMMddHHmmss']"/>
</EF:EFGrid>
</EF:EFRegion>
</EF:EFPage>
$(function() {
IPLATUI.EFGrid = {
pageable: {
pageSize: 20,
pageSizes: [20, 50, 70, 100],
},
"result": {
columns: [],
loadComplete: function (grid) {
// 此grid对象
/*grid.dataSource.bind("change", function(e) {
if (e.field == "inventRecordId") {
var tr,index;
// 获取此model元素信息
var item = e.items[0];
for (let i = 0; i < inventAllGlobalData.length; i++) {
if (inventAllGlobalData[i]['valueField'] === item.inventRecordId) {
resultGrid.setCellValue(item, 'material', inventAllGlobalData[i]['param1Field'])
resultGrid.setCellValue(item, 'unit', inventAllGlobalData[i]['param2Field'])
}
}
}
});*/
}
}
}
// 查询
$("#QUERY").on("click", query);
});
let query = function () {
resultGrid.dataSource.page(1); // 点击查询按钮,从第1页开始查询
}
\ No newline at end of file
<%--
Created by IntelliJ IDEA.
User: 1
Date: 2024/5/16
Time: 18:15
To change this template use File | Settings | File Templates.
--%>
<!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">
<div class="row">
<EF:EFSelect cname="存货类型" blockId="inqu_status" ename="inventType" row="0" colWidth="3"
filter="contains">
<EF:EFOption label="全部" value=""/>
<EF:EFOptions blockId="invent_type_block_id" textField="textField" valueField="valueField"/>
</EF:EFSelect>
<EF:EFSelect cname="仓库名称" blockId="inqu_status" ename="whCode" row="0" colWidth="3" filter="contains"
defultValue="">
<EF:EFOption label="全部" value=""/>
<EF:EFOptions blockId="wh_record_block_id" textField="textField" valueField="valueField"/>
</EF:EFSelect>
<EF:EFSelect cname="存货名称" blockId="inqu_status" ename="inventCode" row="0" colWidth="3"
filter="contains"
defultValue="">
<EF:EFOption label="全部" value=""/>
<EF:EFOptions blockId="invent_record_block_id" textField="textField" valueField="valueField"/>
</EF:EFSelect>
<EF:EFSelect cname="规格" blockId="inqu_status" ename="spec" row="0" colWidth="3" filter="contains"
defultValue="">
<EF:EFOption label="全部" value=""/>
<EF:EFOptions blockId="spec_name_block_id" textField="textField" valueField="valueField"/>
</EF:EFSelect>
</div>
</div>
</EF:EFRegion>
<EF:EFRegion id="result" title="明细信息">
<EF:EFGrid blockId="result" autoDraw="override" isFloat="true" checkMode="row">
<EF:EFColumn ename="id" cname="内码" hidden="true"/>
<EF:EFColumn ename="inventRecordId" cname="存货档案ID" hidden="true"/>
<EF:EFComboColumn ename="inventType" cname="存货类型" enable="false" width="100" align="center">
<EF:EFOptions blockId="invent_type_block_id" textField="textField" valueField="valueField"/>
</EF:EFComboColumn>
<EF:EFComboColumn ename="whCode" cname="仓库名称" enable="false" width="120" align="center"
columnTemplate="#=textField#" itemTemplate="#=textField#"
blockName="wh_record_block_id" textField="textField" valueField="valueField"
filter="contains">
</EF:EFComboColumn>
<EF:EFComboColumn ename="inventCode" cname="存货名称" enable="false" width="120" align="center"
columnTemplate="#=textField#" itemTemplate="#=textField#"
blockName="invent_record_block_id" textField="textField" valueField="valueField"
filter="contains">
</EF:EFComboColumn>
<EF:EFColumn ename="spec" cname="规格" enable="false" width="120" align="center"/>
<EF:EFColumn ename="material" cname="材质" enable="false" width="120" align="center"/>
<EF:EFColumn ename="unit" cname="单位" enable="false" width="120" align="center"/>
<EF:EFColumn ename="warnNum" cname="预警值" enable="false" width="90" align="right" format="{0:N0}"/>
<EF:EFColumn ename="invQty" cname="库存数量" enable="false" width="90" align="right" format="{0:N0}"/>
<EF:EFColumn ename="invWeight" cname="库存重量(T)" enable="false" width="90" align="right" format="{0:N3}"/>
<EF:EFComboColumn ename="princ" cname="仓库负责人" width="120" align="center" enable="false"
blockName="user_block_id" textField="textField" valueField="valueField"
columnTemplate="#=textField#" itemTemplate="#=textField#"
filter="contains">
</EF:EFComboColumn>
<%--<EF:EFColumn ename="princ" cname="仓库负责人" width="120" align="center"/>--%>
<%-- <EF:EFColumn ename="createdName" cname="创建人" enable="false" width="100" align="center"/>
<EF:EFColumn ename="createdTime" cname="创建时刻" enable="false" width="140" align="center"
editType="datetime" parseFormats="['yyyyMMddHHmmss']"/>--%>
</EF:EFGrid>
</EF:EFRegion>
</EF:EFPage>
...@@ -9,6 +9,22 @@ $(function() { ...@@ -9,6 +9,22 @@ $(function() {
pageSizes: [10, 20, 30, 50, 100, 200] pageSizes: [10, 20, 30, 50, 100, 200]
}, },
columns: [{ columns: [{
field: "operator",
title: "操作",
template: function (item) {
let status = item.status;
let template = '';
if (item.id){
template += '<a style="cursor: pointer;display: inline-flex;justify-content: center;margin:auto 5px" '
+ 'onclick="showFlowDetail(' + item.id + ',\''+item.inventCode+'\')" >工艺流程</a>';
if (item.flowId>0){
template += '<a style="cursor: pointer;display: inline-flex;justify-content: center;margin:auto 5px" '
+ 'onclick="showDetail(' + item.id + ')" >工艺流程详情</a>';
}
}
return template;
}
}, {
field: "spec", field: "spec",
template: function (options) { template: function (options) {
return $.trim(options.spec) == "" ? "无规格" : options.spec; return $.trim(options.spec) == "" ? "无规格" : options.spec;
...@@ -56,6 +72,56 @@ $(function() { ...@@ -56,6 +72,56 @@ $(function() {
deleteFunc(); deleteFunc();
} }
} }
/*$("#DOWNLOAD").on("click", function (e) {
var href = ${ctx} + "\\common\\template\\PZ\\HGPZ005_存货档案.xls";
window.location.href = href;
});*/
grush.openImportBox();
IPLATUI.EFUpload = {
fileUpload: {
showFileList: false,
upload: function (e) {
openFileWindow.close();
IPLAT.progress($("body"), true);
},
success: function (e) {
var src = e.response.docUrl;
var eiInfo = new EiInfo();
let notIsExcelFile = isExcelFile(src);
eiInfo.set("fileName", src);
EiCommunicator.send("HGPZ005", "importDate", eiInfo, {
onSuccess(ei) {
if (notIsExcelFile) {
NotificationUtil("请导入xls或xlsx文件", "error");
return;
}
if (ei.status == "-1") {
NotificationUtil(
{msg: ei.msg, detailMsg: ei.detailMsg}, "error");
} else {
NotificationUtil(ei.msg);
query();
}
},
onFail(ei) {
NotificationUtil("调用失败,原因[" + ei + "]", "error");
}
},
{
async: false
});
IPLAT.progress($("body"), false);
},
fail(e) {
IPLAT.NotificationUtil('导入失败!', "error");
}
}
}
grush.downloadFile(`${ctx}\\common\\template\\PZ\\HGPZ005_存货档案.xls`);
downKeyUp(); downKeyUp();
}); });
...@@ -147,3 +213,47 @@ let deleteFunc = function () { ...@@ -147,3 +213,47 @@ let deleteFunc = function () {
} }
}); });
} }
function showDetail(id) {
JSColorbox.open({
href: "HGPZ005A?methodName=initLoad&inqu_status-0-parentId=" + id,
title: "<div style='text-align: center;'>工艺流程详情</div>",
width: "75%",
height: "80%",
});
}
function showFlowDetail(id,inventCode) {
JSColorbox.open({
href: "HGPZ005B?methodName=initLoad&inqu_status-0-parentId=" + id+"&inqu_status-0-inventCode="+inventCode,
title: "<div style='text-align: center;'>工艺流程</div>",
width: "75%",
height: "80%",
callbackName: cllback
});
}
/**
* 回调
*/
function cllback(result) {
let inEiInfo = new EiInfo();
inEiInfo.set("result-0-id", result.id);
inEiInfo.set("result-0-inventCode", result.inventCode);
inEiInfo.set("result-0-flow", result.rows);
EiCommunicator.send('HGPZ005', 'updateFlowId', inEiInfo, {
onSuccess(ei) {
if (ei.status == "-1") {
NotificationUtil({msg: ei.msg, detailMsg: ei.detailMsg}, "error");
} else {
NotificationUtil(ei.msg);
query();
}
},
onFail(errorMessage, status, e) {
NotificationUtil("执行失败!", "error");
}
}, {
async: false
});
}
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