Commit 93debeaf by 宋祥

Merge branch 'dev' of http://129.211.46.84:8800/platform/hg-smart into master-dc

parents 8658868f c02e2c60
...@@ -310,6 +310,8 @@ public enum DdynamicEnum { ...@@ -310,6 +310,8 @@ public enum DdynamicEnum {
* 编写:ly * 编写:ly
*/ */
PROCESS_CODE_BLOCK_ID("processCode_block_id","processCode","processName","factoryCode","factoryName","unit", "status","deleteFlag","costWeight","HGSJ001.queryProcessCode"), PROCESS_CODE_BLOCK_ID("processCode_block_id","processCode","processName","factoryCode","factoryName","unit", "status","deleteFlag","costWeight","HGSJ001.queryProcessCode"),
FLOW_CODE_BLOCK_ID("flowCodeBox_block_id","flowCode","flowName","HGSJ002.queryFlowCodeBox"),
/** /**
* 模块:设备台账编码 * 模块:设备台账编码
* 用途:设备区域下拉框 * 用途:设备区域下拉框
......
...@@ -112,7 +112,8 @@ public class CommonConstant { ...@@ -112,7 +112,8 @@ public class CommonConstant {
public static final String COMPANY_MANAGE = "companyManage"; public static final String COMPANY_MANAGE = "companyManage";
// ADMIN // ADMIN
public static final String ADMIN = "ADMIN"; public static final String ADMIN = "ADMIN";
// Main
public static final String MAIN = "main";
public static final String ENAME = "ename"; public static final String ENAME = "ename";
} }
......
...@@ -22,7 +22,7 @@ public class FileTools { ...@@ -22,7 +22,7 @@ public class FileTools {
public static void clearZip() { public static void clearZip() {
File zipFolder = new File(OSConstant.ZIP_DIR); File zipFolder = new File(OSConstant.ZIP_DIR);
File[] zipFolderFiles = zipFolder.listFiles(); File[] zipFolderFiles = zipFolder.listFiles();
if (zipFolderFiles.length == 0) { if (zipFolderFiles == null || zipFolderFiles.length == 0) {
log.warn("清理ZIP文件:无有效的文件"); log.warn("清理ZIP文件:无有效的文件");
} }
for (File zipFolderFile : zipFolderFiles) { for (File zipFolderFile : zipFolderFiles) {
......
...@@ -3,23 +3,25 @@ package com.baosight.hggp.hg.cg.service; ...@@ -3,23 +3,25 @@ package com.baosight.hggp.hg.cg.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.common.InventTypeDetailEnum; import com.baosight.hggp.common.InventTypeDetailEnum;
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.DeleteFlagEnum; import com.baosight.hggp.core.enums.DeleteFlagEnum;
import com.baosight.hggp.core.security.UserSessionUtils; import com.baosight.hggp.core.security.UserSessionUtils;
import com.baosight.hggp.hg.cg.domain.*; import com.baosight.hggp.hg.cg.domain.HGCG002;
import com.baosight.hggp.hg.cg.domain.HGCG002B;
import com.baosight.hggp.hg.cg.tools.HGCGTools; import com.baosight.hggp.hg.cg.tools.HGCGTools;
import com.baosight.hggp.hg.cg.utils.HGCGUtils; import com.baosight.hggp.hg.cg.utils.HGCGUtils;
import com.baosight.hggp.hg.constant.HGConstant; import com.baosight.hggp.hg.constant.HGConstant;
import com.baosight.hggp.hg.constant.HGSqlConstant;
import com.baosight.hggp.hg.pz.domain.HGPZ004; import com.baosight.hggp.hg.pz.domain.HGPZ004;
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.domain.Company;
import com.baosight.hggp.hg.xs.domain.User; import com.baosight.hggp.hg.xs.domain.User;
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.AssertUtils;
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.hggp.util.ObjectUtils;
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.core.service.impl.ServiceBase; import com.baosight.iplat4j.core.service.impl.ServiceBase;
...@@ -27,7 +29,11 @@ import com.baosight.iplat4j.ed.util.SequenceGenerator; ...@@ -27,7 +29,11 @@ import com.baosight.iplat4j.ed.util.SequenceGenerator;
import java.math.BigDecimal; import java.math.BigDecimal;
import java.math.RoundingMode; import java.math.RoundingMode;
import java.util.*; import java.util.Arrays;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import java.util.Objects;
/** /**
* @author:songx * @author:songx
...@@ -50,7 +56,7 @@ public class ServiceHGCG002B extends ServiceBase { ...@@ -50,7 +56,7 @@ public class ServiceHGCG002B extends ServiceBase {
DdynamicEnum.SUP_RECORD_BLOCK_ID, DdynamicEnum.SUP_RECORD_BLOCK_ID,
DdynamicEnum.INVENT_RECORD_BLOCK_ID, DdynamicEnum.INVENT_RECORD_BLOCK_ID,
DdynamicEnum.SPEC_NAME_BLOCK_ID, DdynamicEnum.SPEC_NAME_BLOCK_ID,
DdynamicEnum.INVENT_TYPE_BOX_BLOCK_ID)); DdynamicEnum.INVENT_ALL_BLOCK_ID));
EiInfoUtils.addBlock(inInfo,"userByCompany", HGXSTools.XsUser.listAll(UserSessionUtils.getAccountCode()), User.class); EiInfoUtils.addBlock(inInfo,"userByCompany", HGXSTools.XsUser.listAll(UserSessionUtils.getAccountCode()), User.class);
CommonMethod.initBlock(inInfo, Arrays.asList(DdynamicEnum.INVENT_RECORD_BOX_BLOCK_ID), CommonMethod.initBlock(inInfo, Arrays.asList(DdynamicEnum.INVENT_RECORD_BOX_BLOCK_ID),
new HashMap<String, Object>(){{ new HashMap<String, Object>(){{
......
package com.baosight.hggp.hg.cg.service;
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.cg.domain.HGCG002;
import com.baosight.hggp.hg.cg.tools.HGCGTools;
import com.baosight.hggp.hg.cg.utils.HGCGUtils;
import com.baosight.hggp.hg.constant.HGConstant;
import com.baosight.hggp.util.AssertUtils;
import com.baosight.hggp.util.CommonMethod;
import com.baosight.hggp.util.DateUtils;
import com.baosight.hggp.util.EiInfoUtils;
import com.baosight.hggp.util.LogUtils;
import com.baosight.hggp.util.MapUtils;
import com.baosight.hggp.util.StringUtils;
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.service.impl.ServiceEPBase;
import com.baosight.iplat4j.ed.util.SequenceGenerator;
import java.util.Arrays;
import java.util.Map;
/**
* @author:songx
* @date:2024/10/22,9:48
*/
public class ServiceHGCG002C extends ServiceEPBase {
/**
* 初始化
*
* @param inInfo
* @return
*/
@Override
public EiInfo initLoad(EiInfo inInfo) {
try {
CommonMethod.initBlock(inInfo, Arrays.asList(DdynamicEnum.COMPANY_CODE_BLOCK_ID), null);
CommonMethod.initBlock(inInfo, Arrays.asList(DdynamicEnum.SUP_RECORD_BLOCK_ID), null);
CommonMethod.initBlock(inInfo, Arrays.asList(DdynamicEnum.USER_BLOCK_ID), null);
this.setBaseInfo(inInfo);
} catch (Exception e) {
LogUtils.setDetailMsg(inInfo, e, "初始化失败");
}
return inInfo;
}
/**
* 保存操作.
*
* @param inInfo
* @return
*/
public EiInfo save(EiInfo inInfo) {
try {
HGCG002 fCg002 = MapUtils.toDaoEPBase(inInfo, EiConstant.queryBlock, HGCG002.class);
fCg002.setContractDate(DateUtils.formatShort(fCg002.getContractDate()));
if (StringUtils.isBlank(fCg002.getContractNo())) {
this.add(fCg002);
} else {
this.modify(fCg002);
}
// 回填实体信息,移动端更新数据使用
inInfo.set("detail", fCg002);
inInfo.setMsg("保存成功!");
} catch (Exception e) {
LogUtils.setDetailMsg(inInfo, e, "保存失败");
}
return inInfo;
}
/**
* 新增
*
* @param fCg002
*/
private void add(HGCG002 fCg002) {
fCg002.setContractNo(SequenceGenerator.getNextSequence(HGConstant.SequenceId.CG_CONTRACT_NO));
fCg002.setSource(HGConstant.CgSource.SDLR);
fCg002.setStatus(HGConstant.CgContractStatus.S_0);
fCg002.setDeleteFlag(CommonConstant.YesNo.NO_0);
DaoUtils.insert(HGCG002.INSERT, fCg002);
}
/**
* 修改数据
*
* @param fCg002
*/
private void modify(HGCG002 fCg002) {
HGCG002 dbCg002 = HGCGUtils.HgCg002.lockGetData(fCg002.getContractNo());
this.checkData(fCg002, dbCg002);
DaoUtils.update(HGCG002.UPDATE, fCg002);
}
/**
* 设置信息
*
* @param inInfo
*/
public void setBaseInfo(EiInfo inInfo) {
Map queryRow = EiInfoUtils.getFirstRow(inInfo);
String contractNo = MapUtils.getString(queryRow, HGCG002.FIELD_CONTRACT_NO);
if (StringUtils.isBlank(contractNo)) {
return;
}
EiBlock resultBlock = new EiBlock(EiConstant.queryBlock);
resultBlock.addRow(HGCGTools.HgCg002.get(contractNo));
resultBlock.addBlockMeta(new HGCG002().eiMetadata);
inInfo.setBlock(resultBlock);
}
/**
* 数据校验
*
* @param fCg002
* @param dbCg002
*/
private void checkData(HGCG002 fCg002, HGCG002 dbCg002) {
String contractNo = fCg002.getContractNo();
AssertUtils.isNull(dbCg002, String.format("合同单【%s】不存在", contractNo));
AssertUtils.isNotEquals(dbCg002.getDeleteFlag(), CommonConstant.YesNo.NO_0,
String.format("建议单【%s】不是\"未删除\"状态,不允许操作", contractNo));
AssertUtils.isNotEquals(dbCg002.getStatus(), HGConstant.DealStatus.S0,
String.format("建议单【%s】不是\"未审核\"状态,不允许操作", contractNo));
}
}
package com.baosight.hggp.hg.cg.service; package com.baosight.hggp.hg.cg.service;
import com.alibaba.fastjson.JSON;
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.core.constant.CommonConstant;
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.constant.HgCgConst; import com.baosight.hggp.hg.cg.constant.HgCgConst;
...@@ -20,6 +20,7 @@ import com.baosight.hggp.util.DateUtils; ...@@ -20,6 +20,7 @@ import com.baosight.hggp.util.DateUtils;
import com.baosight.hggp.util.EiInfoUtils; import com.baosight.hggp.util.EiInfoUtils;
import com.baosight.hggp.util.LogUtils; import com.baosight.hggp.util.LogUtils;
import com.baosight.hggp.util.MapUtils; import com.baosight.hggp.util.MapUtils;
import com.baosight.hggp.util.StringUtils;
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.core.exception.PlatException; import com.baosight.iplat4j.core.exception.PlatException;
...@@ -91,6 +92,9 @@ public class ServiceHGCG003A extends ServiceBase { ...@@ -91,6 +92,9 @@ public class ServiceHGCG003A extends ServiceBase {
@OperationLogAnnotation(operModul = "采购合同", operType = "修改", operDesc = "确认") @OperationLogAnnotation(operModul = "采购合同", operType = "修改", operDesc = "确认")
public EiInfo confirm(EiInfo inInfo) { public EiInfo confirm(EiInfo inInfo) {
try { try {
// 收货单号用于判断是新增还是续增
Map mainMap = EiInfoUtils.getFirstRow(inInfo, CommonConstant.Field.MAIN);
String receiveNo = MapUtils.getString(mainMap, HGCG003.FIELD_RECEIVE_NO);
List<HGCG002B> fCg002Bs = MapUtils.toDaoEPBases(inInfo, HGCG002B.class); List<HGCG002B> fCg002Bs = MapUtils.toDaoEPBases(inInfo, HGCG002B.class);
// db数据 // db数据
Map<Long, HGCG002B> dbCg002bMap = HGCGUtils.HgCg002B.lockGetDataEp(fCg002Bs); Map<Long, HGCG002B> dbCg002bMap = HGCGUtils.HgCg002B.lockGetDataEp(fCg002Bs);
...@@ -100,7 +104,7 @@ public class ServiceHGCG003A extends ServiceBase { ...@@ -100,7 +104,7 @@ public class ServiceHGCG003A extends ServiceBase {
// 计算总金额和总重 // 计算总金额和总重
this.calcAmountAndWeight(fCg002Bs, dbCg002bMap, dbCg002); this.calcAmountAndWeight(fCg002Bs, dbCg002bMap, dbCg002);
// 保存数据 // 保存数据
this.confirmData(fCg002Bs, dbCg002bMap, dbCg002); this.confirmData(fCg002Bs, dbCg002bMap, dbCg002, receiveNo);
inInfo = this.query(inInfo); inInfo = this.query(inInfo);
inInfo.setStatus(EiConstant.STATUS_DEFAULT); inInfo.setStatus(EiConstant.STATUS_DEFAULT);
inInfo.setMsg("操作成功!本次对[" + fCg002Bs.size() + "]条数据保存成功!"); inInfo.setMsg("操作成功!本次对[" + fCg002Bs.size() + "]条数据保存成功!");
...@@ -190,14 +194,23 @@ public class ServiceHGCG003A extends ServiceBase { ...@@ -190,14 +194,23 @@ public class ServiceHGCG003A extends ServiceBase {
* @param fCg002Bs * @param fCg002Bs
* @param dbCg002BMap * @param dbCg002BMap
* @param dbCg002 * @param dbCg002
* @param receiveNo
*/ */
private void confirmData(List<HGCG002B> fCg002Bs, Map<Long, HGCG002B> dbCg002BMap, HGCG002 dbCg002) { private void confirmData(List<HGCG002B> fCg002Bs, Map<Long, HGCG002B> dbCg002BMap, HGCG002 dbCg002,
// 写入主信息 String receiveNo) {
HGCG003 newCg003 = insertMain(fCg002Bs, dbCg002); // 主信息
HGCG003 newCg003;
if (StringUtils.isEmpty(receiveNo)) {
newCg003 = insertMain(fCg002Bs, dbCg002);
} else {
newCg003 = HGCGTools.HgCg003.get(receiveNo);
}
// 写入明细数据 // 写入明细数据
for (HGCG002B fCg002B : fCg002Bs) { for (HGCG002B fCg002B : fCg002Bs) {
insertDetails(fCg002B, dbCg002BMap, newCg003); insertDetails(fCg002B, dbCg002BMap, newCg003);
} }
// 汇总金额和数量
HGCGUtils.HgCg003.updatePur(newCg003);
// 修改合同信息 // 修改合同信息
List<HGCG002> cg002s = new LinkedList<>(); List<HGCG002> cg002s = new LinkedList<>();
cg002s.add(dbCg002); cg002s.add(dbCg002);
...@@ -251,8 +264,6 @@ public class ServiceHGCG003A extends ServiceBase { ...@@ -251,8 +264,6 @@ public class ServiceHGCG003A extends ServiceBase {
cg003B.setReceiveNo(newCg003.getReceiveNo()); // 收货号 cg003B.setReceiveNo(newCg003.getReceiveNo()); // 收货号
cg003B.setReceiveLineNo(SequenceGenerator.getNextSequence(HGConstant.SequenceId.CG_RECEIVE_LINE_NO, cg003B.setReceiveLineNo(SequenceGenerator.getNextSequence(HGConstant.SequenceId.CG_RECEIVE_LINE_NO,
new String[]{newCg003.getReceiveNo()})); new String[]{newCg003.getReceiveNo()}));
cg003B.setPlanNo(newCg003.getPlanNo()); // 计划号
cg003B.setContractNo(newCg003.getContractNo()); // 合同号
cg003B.setPrimaryId(newCg003.getId()); cg003B.setPrimaryId(newCg003.getId());
cg003B.setReceiveUnitWeight(fCg002B.getPurUnitWeight()); cg003B.setReceiveUnitWeight(fCg002B.getPurUnitWeight());
cg003B.setReceiveQty(fCg002B.getBcReceiveQty()); cg003B.setReceiveQty(fCg002B.getBcReceiveQty());
......
...@@ -3,6 +3,7 @@ package com.baosight.hggp.hg.cg.service; ...@@ -3,6 +3,7 @@ package com.baosight.hggp.hg.cg.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.common.InventTypeDetailEnum; import com.baosight.hggp.common.InventTypeDetailEnum;
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.DeleteFlagEnum; import com.baosight.hggp.core.enums.DeleteFlagEnum;
import com.baosight.hggp.core.security.UserSessionUtils; import com.baosight.hggp.core.security.UserSessionUtils;
...@@ -10,7 +11,6 @@ import com.baosight.hggp.hg.cg.domain.HGCG002; ...@@ -10,7 +11,6 @@ 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.HGCG002B; import com.baosight.hggp.hg.cg.domain.HGCG002B;
import com.baosight.hggp.hg.cg.domain.HGCG003; import com.baosight.hggp.hg.cg.domain.HGCG003;
import com.baosight.hggp.hg.cg.domain.HGCG003A;
import com.baosight.hggp.hg.cg.domain.HGCG003B; import com.baosight.hggp.hg.cg.domain.HGCG003B;
import com.baosight.hggp.hg.cg.tools.HGCGTools; import com.baosight.hggp.hg.cg.tools.HGCGTools;
import com.baosight.hggp.hg.cg.utils.HGCGUtils; import com.baosight.hggp.hg.cg.utils.HGCGUtils;
...@@ -55,6 +55,7 @@ public class ServiceHGCG003B extends ServiceBase { ...@@ -55,6 +55,7 @@ public class ServiceHGCG003B extends ServiceBase {
@OperationLogAnnotation(operModul = "采购收货", operType = "查询", operDesc = "初始化") @OperationLogAnnotation(operModul = "采购收货", operType = "查询", operDesc = "初始化")
public EiInfo initLoad(EiInfo inInfo) { public EiInfo initLoad(EiInfo inInfo) {
try { try {
Map queryMap = EiInfoUtils.getFirstRow(inInfo);
CommonMethod.initBlock(inInfo, Arrays.asList(DdynamicEnum.INVENT_TYPE_BOX_BLOCK_ID), null, false); CommonMethod.initBlock(inInfo, Arrays.asList(DdynamicEnum.INVENT_TYPE_BOX_BLOCK_ID), null, false);
CommonMethod.initBlock(inInfo, Arrays.asList(DdynamicEnum.INVENT_RECORD_BOX_BLOCK_ID), CommonMethod.initBlock(inInfo, Arrays.asList(DdynamicEnum.INVENT_RECORD_BOX_BLOCK_ID),
new HashMap<String, Object>() {{ new HashMap<String, Object>() {{
...@@ -63,6 +64,9 @@ public class ServiceHGCG003B extends ServiceBase { ...@@ -63,6 +64,9 @@ public class ServiceHGCG003B extends ServiceBase {
}}, false); }}, false);
EiInfoUtils.addBlock(inInfo, "roleCompany", UserSessionUtils.getRoleCompany(), Company.class); EiInfoUtils.addBlock(inInfo, "roleCompany", UserSessionUtils.getRoleCompany(), Company.class);
inInfo.addBlock(EiConstant.resultBlock).addBlockMeta(new HGCG003B().eiMetadata); inInfo.addBlock(EiConstant.resultBlock).addBlockMeta(new HGCG003B().eiMetadata);
// 填充主信息
HGCG003 dbCg003 = HGCGTools.HgCg003.get(MapUtils.getString(queryMap, HGCG003.FIELD_RECEIVE_NO));
inInfo.addBlock(CommonConstant.Field.MAIN).addRow(dbCg003);
} catch (Exception e) { } catch (Exception e) {
LogUtils.setDetailMsg(inInfo, e, "初始化失败"); LogUtils.setDetailMsg(inInfo, e, "初始化失败");
} }
...@@ -134,8 +138,8 @@ public class ServiceHGCG003B extends ServiceBase { ...@@ -134,8 +138,8 @@ public class ServiceHGCG003B extends ServiceBase {
this.updateData(fCg003B); this.updateData(fCg003B);
} }
} }
//修改主表信息 // 修改主表信息
updateCg003Pur(dbCg003); HGCGUtils.HgCg003.updatePur(dbCg003);
} }
inInfo = this.query(inInfo); inInfo = this.query(inInfo);
inInfo.setStatus(EiConstant.STATUS_DEFAULT); inInfo.setStatus(EiConstant.STATUS_DEFAULT);
...@@ -204,7 +208,7 @@ public class ServiceHGCG003B extends ServiceBase { ...@@ -204,7 +208,7 @@ public class ServiceHGCG003B extends ServiceBase {
//根据子表明细刷新合同主表信息 //根据子表明细刷新合同主表信息
HGCGTools.HgCg002.updateContractPrimary(hgcg002List); HGCGTools.HgCg002.updateContractPrimary(hgcg002List);
//修改主表信息 //修改主表信息
updateCg003Pur(cg003); HGCGUtils.HgCg003.updatePur(cg003);
} }
/** /**
...@@ -242,36 +246,6 @@ public class ServiceHGCG003B extends ServiceBase { ...@@ -242,36 +246,6 @@ public class ServiceHGCG003B extends ServiceBase {
} }
/** /**
* 修改主收货信息
*
* @param cg003
*/
private void updateCg003Pur(HGCG003 cg003) {
List<HGCG003B> queryCG003Bs = HGCGTools.HgCg003B.listByPrimaryId(cg003.getId());
// 收货数量
BigDecimal receiveQtySum = queryCG003Bs.stream().map(HGCG003B::getReceiveQty)
.reduce(BigDecimal.ZERO, BigDecimal::add);
cg003.setReceiveQty(receiveQtySum);
// 收货重量
BigDecimal receiveWeightSum = queryCG003Bs.stream().map(HGCG003B::getReceiveWeight)
.reduce(BigDecimal.ZERO, BigDecimal::add);
cg003.setReceiveWeight(receiveWeightSum);
// 金额
BigDecimal amountSum = queryCG003Bs.stream().map(HGCG003B::getAmount)
.reduce(BigDecimal.ZERO, BigDecimal::add);
cg003.setAmount(amountSum);
// 税额
BigDecimal taxAmountSum = queryCG003Bs.stream().map(HGCG003B::getTaxAmount)
.reduce(BigDecimal.ZERO, BigDecimal::add);
cg003.setTaxAmount(taxAmountSum);
// 不含税税额
BigDecimal taxIncludeAmountSum = queryCG003Bs.stream().map(HGCG003B::getTaxIncludeAmount)
.reduce(BigDecimal.ZERO, BigDecimal::add);
cg003.setTaxIncludeAmount(taxIncludeAmountSum);
DaoUtils.update(HGSqlConstant.HgCg003.UPDATE_QTY, cg003);
}
/**
* 删除操作. * 删除操作.
* *
* @param inInfo * @param inInfo
...@@ -359,7 +333,7 @@ public class ServiceHGCG003B extends ServiceBase { ...@@ -359,7 +333,7 @@ public class ServiceHGCG003B extends ServiceBase {
} }
} }
//修改主表信息 //修改主表信息
updateCg003Pur(dbCg003); HGCGUtils.HgCg003.updatePur(dbCg003);
} }
} }
...@@ -253,6 +253,23 @@ ...@@ -253,6 +253,23 @@
<include refid="idCondition"/> <include refid="idCondition"/>
</update> </update>
<!-- 修改信息 -->
<update id="update">
UPDATE ${hggpSchema}.HGCG002
SET
CONTRACT_DATE = #contractDate#, <!-- 合同日期-->
COMPANY_CODE = #companyCode#, <!-- 公司编码 -->
COMPANY_NAME = #companyName#, <!-- 公司名称 -->
PROJ_CODE = #projCode#, <!-- 项目编码 -->
PROJ_NAME = #projName#, <!-- 项目名称 -->
SUP_CODE = #supCode#, <!-- 供应商编码 -->
SUP_NAME = #supName#, <!-- 供应商名称 -->
PUR_USER_ID = #purUserId#, <!-- 采购员 -->
PUR_USER_NAME = #purUserName#, <!-- 采购员名称 -->
<include refid="updateRevise"/>
WHERE CONTRACT_NO = #contractNo#
</update>
<!-- 修改采购信息 --> <!-- 修改采购信息 -->
<update id="updatePur"> <update id="updatePur">
UPDATE ${hggpSchema}.HGCG002 UPDATE ${hggpSchema}.HGCG002
......
...@@ -88,56 +88,20 @@ ...@@ -88,56 +88,20 @@
INVENT_CODE = #inventCode# INVENT_CODE = #inventCode#
</isNotEmpty> </isNotEmpty>
<isNotEmpty prepend=" AND " property="inventName"> <isNotEmpty prepend=" AND " property="inventName">
INVENT_NAME = #inventName# INVENT_NAME LIKE CONCAT('%', #inventName#, '%')
</isNotEmpty> </isNotEmpty>
<isNotEmpty prepend=" AND " property="spec"> <isNotEmpty prepend=" AND " property="spec">
SPEC = #spec# SPEC = #spec#
</isNotEmpty> </isNotEmpty>
<isNotEmpty prepend=" AND " property="material"> <isNotEmpty prepend=" AND " property="material">
MATERIAL = #material# MATERIAL LIKE CONCAT('%', #material#, '%')
</isNotEmpty> </isNotEmpty>
<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="purQty">
PUR_QTY = #purQty#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="purUnitWeight">
PUR_UNIT_WEIGHT = #purUnitWeight#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="purWeight">
PUR_WEIGHT = #purWeight#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="receiveQty">
RECEIVE_QTY = #receiveQty#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="receiveWeight"> <isNotEmpty prepend=" AND " property="receiveWeight">
RECEIVE_WEIGHT = #receiveWeight# RECEIVE_WEIGHT = #receiveWeight#
</isNotEmpty> </isNotEmpty>
<isNotEmpty prepend=" AND " property="price">
PRICE = #price#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="amount">
AMOUNT = #amount#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="taxIncludeAmount">
TAX_INCLUDE_AMOUNT = #taxIncludeAmount#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="taxAmount">
TAX_AMOUNT = #taxAmount#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="taxRate">
TAX_RATE = #taxRate#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="inventTypeDetail"> <isNotEmpty prepend=" AND " property="inventTypeDetail">
INVENT_TYPE_DETAIL = #inventTypeDetail# INVENT_TYPE_DETAIL = #inventTypeDetail#
</isNotEmpty> </isNotEmpty>
...@@ -346,6 +310,7 @@ ...@@ -346,6 +310,7 @@
a.PROJ_NAME as "projName", <!-- 项目名称 --> a.PROJ_NAME as "projName", <!-- 项目名称 -->
a.CALCULATION_METHOD as "calculationMethod", <!-- 计算方式 0-数量乘单价 1-重量乘单价 --> a.CALCULATION_METHOD as "calculationMethod", <!-- 计算方式 0-数量乘单价 1-重量乘单价 -->
a.STATUS as "status", <!-- 状态 --> a.STATUS as "status", <!-- 状态 -->
A.CONTRACT_LINE_NO as "contractLineNo", <!-- 合同行号 -->
b.CONTRACT_DATE as "contractDate", <!-- 合同日期 --> b.CONTRACT_DATE as "contractDate", <!-- 合同日期 -->
b.CONTRACT_NO as "contractNo", <!-- 合同号 --> b.CONTRACT_NO as "contractNo", <!-- 合同号 -->
b.PLAN_NO as "planNo", <!-- 计划单号 --> b.PLAN_NO as "planNo", <!-- 计划单号 -->
......
...@@ -2,24 +2,27 @@ package com.baosight.hggp.hg.cg.tools; ...@@ -2,24 +2,27 @@ package com.baosight.hggp.hg.cg.tools;
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.DeleteFlagEnum; import com.baosight.hggp.hg.cg.domain.HGCG001;
import com.baosight.hggp.hg.cg.constant.HgCgConst; import com.baosight.hggp.hg.cg.domain.HGCG001A;
import com.baosight.hggp.hg.cg.domain.*; import com.baosight.hggp.hg.cg.domain.HGCG002;
import com.baosight.hggp.hg.cg.domain.HGCG002A;
import com.baosight.hggp.hg.cg.domain.HGCG002B;
import com.baosight.hggp.hg.cg.domain.HGCG003;
import com.baosight.hggp.hg.cg.domain.HGCG003B;
import com.baosight.hggp.hg.cg.utils.HGCGUtils; import com.baosight.hggp.hg.cg.utils.HGCGUtils;
import com.baosight.hggp.hg.constant.HGConstant; import com.baosight.hggp.hg.constant.HGConstant;
import com.baosight.hggp.hg.constant.HGSqlConstant; import com.baosight.hggp.hg.constant.HGSqlConstant;
import com.baosight.hggp.hg.cw.domain.HGCW013; import com.baosight.hggp.hg.cw.domain.HGCW013;
import com.baosight.hggp.hg.kc.tools.HGKCTools;
import com.baosight.hggp.hg.zl.domain.HGZL001; import com.baosight.hggp.hg.zl.domain.HGZL001;
import com.baosight.hggp.util.AssertUtils; import com.baosight.hggp.util.AssertUtils;
import com.baosight.hggp.util.ObjectUtils; import com.baosight.hggp.util.ObjectUtils;
import com.baosight.hggp.util.StringUtils;
import org.apache.commons.collections.CollectionUtils; import org.apache.commons.collections.CollectionUtils;
import java.math.BigDecimal; import java.math.BigDecimal;
import java.util.HashMap; import java.util.HashMap;
import java.util.List; import java.util.List;
import java.util.Map; import java.util.Map;
import java.util.Objects;
import java.util.stream.Collectors; import java.util.stream.Collectors;
/** /**
...@@ -265,6 +268,21 @@ public class HGCGTools { ...@@ -265,6 +268,21 @@ public class HGCGTools {
} }
/** /**
* 查询
*
* @param contractNo
* @return
*/
public static HGCG002 get(String contractNo) {
AssertUtils.isNull(contractNo, "采购合同号不能为空");
Map queryMap = new HashMap();
queryMap.put("contractNo", contractNo);
List<HGCG002> results = DaoBase.getInstance().query(HGCG002.QUERY, queryMap);
AssertUtils.isEmpty(results, String.format("采购合同[%s]不存在", contractNo));
return results.get(0);
}
/**
* 锁 * 锁
* *
* @param ids * @param ids
...@@ -282,6 +300,21 @@ public class HGCGTools { ...@@ -282,6 +300,21 @@ public class HGCGTools {
/** /**
* 锁 * 锁
* *
* @param contractNo
* @return
*/
public static void lock(String contractNo) {
if (StringUtils.isEmpty(contractNo)) {
return;
}
Map paramMap = new HashMap();
paramMap.put("contractNo", contractNo);
DaoBase.getInstance().update(HGSqlConstant.HgCg002.LOCK, paramMap);
}
/**
* 锁
*
* @param contractNos * @param contractNos
* @return * @return
*/ */
...@@ -698,6 +731,21 @@ public class HGCGTools { ...@@ -698,6 +731,21 @@ public class HGCGTools {
} }
/** /**
* 查询
*
* @param receiveNo
* @return
*/
public static HGCG003 get(String receiveNo) {
AssertUtils.isNull(receiveNo, "采购收货单号不能为空");
Map queryMap = new HashMap();
queryMap.put(HGCG003.FIELD_RECEIVE_NO, receiveNo);
List<HGCG003> results = DaoBase.getInstance().query(HGCG003.QUERY, queryMap);
AssertUtils.isEmpty(results, String.format("采购收货单[%s]不存在", receiveNo));
return results.get(0);
}
/**
* 锁 * 锁
* *
* @param receiveNos * @param receiveNos
......
package com.baosight.hggp.hg.cg.utils; package com.baosight.hggp.hg.cg.utils;
import com.baosight.hggp.core.dao.DaoUtils;
import com.baosight.hggp.hg.cg.domain.*; import com.baosight.hggp.hg.cg.domain.*;
import com.baosight.hggp.hg.cg.tools.HGCGTools; import com.baosight.hggp.hg.cg.tools.HGCGTools;
import com.baosight.hggp.hg.constant.HGConstant; import com.baosight.hggp.hg.constant.HGConstant;
import com.baosight.hggp.hg.constant.HGSqlConstant;
import com.baosight.hggp.hg.utils.HGUtils; 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;
...@@ -11,6 +13,7 @@ import com.baosight.hggp.util.StringUtils; ...@@ -11,6 +13,7 @@ import com.baosight.hggp.util.StringUtils;
import org.apache.commons.collections.CollectionUtils; import org.apache.commons.collections.CollectionUtils;
import java.math.BigDecimal;
import java.util.List; import java.util.List;
import java.util.Map; import java.util.Map;
...@@ -97,6 +100,22 @@ public class HGCGUtils { ...@@ -97,6 +100,22 @@ public class HGCGUtils {
/** /**
* 锁并且获取数据 * 锁并且获取数据
* *
* @param contractNo
* @return
*/
public static HGCG002 lockGetData(String contractNo) {
if (StringUtils.isEmpty(contractNo)) {
return null;
}
// 锁
HGCGTools.HgCg002.lock(contractNo);
// db数据
return HGCGTools.HgCg002.get(contractNo);
}
/**
* 锁并且获取数据
*
* @param ids * @param ids
* @return * @return
*/ */
...@@ -229,6 +248,36 @@ public class HGCGUtils { ...@@ -229,6 +248,36 @@ public class HGCGUtils {
return status; return status;
} }
/**
* 修改主收货信息
*
* @param cg003
*/
public static void updatePur(HGCG003 cg003) {
List<HGCG003B> queryCG003Bs = HGCGTools.HgCg003B.listByPrimaryId(cg003.getId());
// 收货数量
BigDecimal receiveQtySum = queryCG003Bs.stream().map(HGCG003B::getReceiveQty)
.reduce(BigDecimal.ZERO, BigDecimal::add);
cg003.setReceiveQty(receiveQtySum);
// 收货重量
BigDecimal receiveWeightSum = queryCG003Bs.stream().map(HGCG003B::getReceiveWeight)
.reduce(BigDecimal.ZERO, BigDecimal::add);
cg003.setReceiveWeight(receiveWeightSum);
// 金额
BigDecimal amountSum = queryCG003Bs.stream().map(HGCG003B::getAmount)
.reduce(BigDecimal.ZERO, BigDecimal::add);
cg003.setAmount(amountSum);
// 税额
BigDecimal taxAmountSum = queryCG003Bs.stream().map(HGCG003B::getTaxAmount)
.reduce(BigDecimal.ZERO, BigDecimal::add);
cg003.setTaxAmount(taxAmountSum);
// 不含税税额
BigDecimal taxIncludeAmountSum = queryCG003Bs.stream().map(HGCG003B::getTaxIncludeAmount)
.reduce(BigDecimal.ZERO, BigDecimal::add);
cg003.setTaxIncludeAmount(taxIncludeAmountSum);
DaoUtils.update(HGSqlConstant.HgCg003.UPDATE_QTY, cg003.toMap());
}
} }
/** /**
......
...@@ -608,7 +608,14 @@ public class HGSqlConstant { ...@@ -608,7 +608,14 @@ public class HGSqlConstant {
public static final String PROCESS = MODULE_NAME + "process"; public static final String PROCESS = MODULE_NAME + "process";
} }
/**
*
* @author:songx
* @date:2024/10/22,16:05
*/
public class HGZL004 { public class HGZL004 {
// 锁
public static final String LOCK = "HGZL004.lock"; public static final String LOCK = "HGZL004.lock";
} }
......
...@@ -45,6 +45,9 @@ public class HGCW003 extends DaoEPBase { ...@@ -45,6 +45,9 @@ public class HGCW003 extends DaoEPBase {
public static final String FIELD_UPDATED_TIME = "updatedTime"; /* 记录修改时间*/ public static final String FIELD_UPDATED_TIME = "updatedTime"; /* 记录修改时间*/
public static final String FIELD_DEP_CODE = "depCode"; /* 部门编码*/ public static final String FIELD_DEP_CODE = "depCode"; /* 部门编码*/
public static final String FIELD_COMPANY_CODES = "companyCodes"; public static final String FIELD_COMPANY_CODES = "companyCodes";
public static final String FIELD_MODEL = "model"; /*型号*/
public static final String FIELD_SPEC = "spec"; /*规格*/
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"; /* 企业编码*/
...@@ -104,6 +107,8 @@ public class HGCW003 extends DaoEPBase { ...@@ -104,6 +107,8 @@ public class HGCW003 extends DaoEPBase {
private String updatedName = " "; /* 记录修改名称*/ private String updatedName = " "; /* 记录修改名称*/
private String updatedTime = " "; /* 记录修改时间*/ private String updatedTime = " "; /* 记录修改时间*/
private String depCode = " "; /* 部门编码*/ private String depCode = " "; /* 部门编码*/
private String model = " "; /*型号*/
private String spec = " "; /*规格*/
/** /**
* initialize the metadata. * initialize the metadata.
...@@ -208,6 +213,13 @@ public class HGCW003 extends DaoEPBase { ...@@ -208,6 +213,13 @@ public class HGCW003 extends DaoEPBase {
eiColumn.setDescName("部门编码"); eiColumn.setDescName("部门编码");
eiMetadata.addMeta(eiColumn); eiMetadata.addMeta(eiColumn);
eiColumn = new EiColumn(FIELD_MODEL);
eiColumn.setDescName("型号");
eiMetadata.addMeta(eiColumn);
eiColumn = new EiColumn(FIELD_SPEC);
eiColumn.setDescName("规格");
eiMetadata.addMeta(eiColumn);
} }
...@@ -554,6 +566,23 @@ public class HGCW003 extends DaoEPBase { ...@@ -554,6 +566,23 @@ public class HGCW003 extends DaoEPBase {
public void setDepCode(String depCode) { public void setDepCode(String depCode) {
this.depCode = depCode; this.depCode = depCode;
} }
public String getModel() {
return model;
}
public void setModel(String model) {
this.model = model;
}
public String getSpec() {
return spec;
}
public void setSpec(String spec) {
this.spec = spec;
}
/** /**
* get the value from Map. * get the value from Map.
* *
...@@ -583,6 +612,8 @@ public class HGCW003 extends DaoEPBase { ...@@ -583,6 +612,8 @@ public class HGCW003 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));
setDepCode(StringUtils.defaultIfEmpty(StringUtils.toString(map.get(FIELD_DEP_CODE)), depCode)); setDepCode(StringUtils.defaultIfEmpty(StringUtils.toString(map.get(FIELD_DEP_CODE)), depCode));
setModel(StringUtils.defaultIfEmpty(StringUtils.toString(map.get(FIELD_MODEL)), model));
setSpec(StringUtils.defaultIfEmpty(StringUtils.toString(map.get(FIELD_SPEC)), spec));
} }
/** /**
...@@ -613,6 +644,8 @@ public class HGCW003 extends DaoEPBase { ...@@ -613,6 +644,8 @@ public class HGCW003 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_DEP_CODE, StringUtils.toString(depCode, eiMetadata.getMeta(FIELD_DEP_CODE))); map.put(FIELD_DEP_CODE, StringUtils.toString(depCode, eiMetadata.getMeta(FIELD_DEP_CODE)));
map.put(FIELD_MODEL, StringUtils.toString(model, eiMetadata.getMeta(FIELD_MODEL)));
map.put(FIELD_SPEC, StringUtils.toString(spec, eiMetadata.getMeta(FIELD_SPEC)));
return map; return map;
} }
......
...@@ -2,6 +2,7 @@ package com.baosight.hggp.hg.cw.service; ...@@ -2,6 +2,7 @@ package com.baosight.hggp.hg.cw.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.common.ReviewStatusEnum;
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.security.UserSessionUtils; import com.baosight.hggp.core.security.UserSessionUtils;
...@@ -196,7 +197,12 @@ public class ServiceHGCW002 extends ServiceBase { ...@@ -196,7 +197,12 @@ public class ServiceHGCW002 extends ServiceBase {
try { try {
List<Map> resultRows = inInfo.getBlock(EiConstant.resultBlock).getRows(); List<Map> resultRows = inInfo.getBlock(EiConstant.resultBlock).getRows();
for (int i = 0; i < resultRows.size(); i++) { for (int i = 0; i < resultRows.size(); i++) {
DaoUtils.update("HGCW002.delete", resultRows.get(i)); HGCW002 hgcw002 = new HGCW002();
hgcw002.fromMap(resultRows.get(i));
if (hgcw002.getReviewStatus() == ReviewStatusEnum.SUBMITTED.getCode().intValue()){
throw new PlatException("该数据已提交,不能删除!");
}
DaoUtils.update("HGCW002.delete", hgcw002);
} }
inInfo = this.query(inInfo); inInfo = this.query(inInfo);
inInfo.setStatus(EiConstant.STATUS_DEFAULT); inInfo.setStatus(EiConstant.STATUS_DEFAULT);
......
...@@ -100,6 +100,12 @@ ...@@ -100,6 +100,12 @@
<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="model">
MODEL = #model#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="spec">
SPEC = #spec#
</isNotEmpty>
</sql> </sql>
<select id="query" parameterClass="java.util.HashMap" <select id="query" parameterClass="java.util.HashMap"
...@@ -125,7 +131,9 @@ ...@@ -125,7 +131,9 @@
UPDATED_BY as "updatedBy", <!-- 记录修改者 --> UPDATED_BY as "updatedBy", <!-- 记录修改者 -->
UPDATED_NAME as "updatedName", <!-- 记录修改名称 --> UPDATED_NAME as "updatedName", <!-- 记录修改名称 -->
UPDATED_TIME as "updatedTime", <!-- 记录修改时间 --> UPDATED_TIME as "updatedTime", <!-- 记录修改时间 -->
DEP_CODE as "depCode" <!-- 部门编码 --> DEP_CODE as "depCode", <!-- 部门编码 -->
MODEL AS "model",
SPEC as "spec"
FROM ${hggpSchema}.HGCW003 WHERE 1=1 FROM ${hggpSchema}.HGCW003 WHERE 1=1
<include refid="condition" /> <include refid="condition" />
<dynamic prepend="ORDER BY"> <dynamic prepend="ORDER BY">
...@@ -212,28 +220,33 @@ ...@@ -212,28 +220,33 @@
<insert id="insert"> <insert id="insert">
INSERT INTO ${hggpSchema}.HGCW003 (ID, INSERT INTO ${hggpSchema}.HGCW003 (ID,
ACCOUNT_CODE, <!-- 企业编码 --> ACCOUNT_CODE, <!-- 企业编码 -->
COMPANY_CODE, <!-- 公司编码 --> COMPANY_CODE, <!-- 公司编码 -->
COMPANY_NAME, <!-- 公司名称 --> COMPANY_NAME, <!-- 公司名称 -->
CONTRACT_NUMBER, <!-- 合同号 --> CONTRACT_NUMBER, <!-- 合同号 -->
INVENTORY, <!-- 清单 --> INVENTORY, <!-- 清单 -->
UNIT, <!-- 单位 --> UNIT, <!-- 单位 -->
PROVISIONAL_QUANTITY, <!-- 暂定工程量 --> PROVISIONAL_QUANTITY, <!-- 暂定工程量 -->
MEASUREMENT_METHOD, <!-- 计量方式 --> MEASUREMENT_METHOD, <!-- 计量方式 -->
SUPPLY_METHOD, <!-- 材料供应方式 --> SUPPLY_METHOD, <!-- 材料供应方式 -->
UNIT_PRICE_EXCLUDING_TAX, <!-- 除税单价/元 --> UNIT_PRICE_EXCLUDING_TAX, <!-- 除税单价/元 -->
TOTAL_PRICE_EXCLUDING, <!-- 不含税总价 --> TOTAL_PRICE_EXCLUDING, <!-- 不含税总价 -->
TOTAL_PRICE_INCLUDING, <!-- 含税总价 --> TOTAL_PRICE_INCLUDING, <!-- 含税总价 -->
LABOR_COSTS, <!-- 其中人工费/元 --> LABOR_COSTS, <!-- 其中人工费/元 -->
CREATED_BY, <!-- 记录创建者 --> CREATED_BY, <!-- 记录创建者 -->
CREATED_NAME, <!-- 记录创建名称 --> CREATED_NAME, <!-- 记录创建名称 -->
CREATED_TIME, <!-- 记录创建时间 --> CREATED_TIME, <!-- 记录创建时间 -->
UPDATED_BY, <!-- 记录修改者 --> UPDATED_BY, <!-- 记录修改者 -->
UPDATED_NAME, <!-- 记录修改名称 --> UPDATED_NAME, <!-- 记录修改名称 -->
UPDATED_TIME, <!-- 记录修改时间 --> UPDATED_TIME, <!-- 记录修改时间 -->
DEP_CODE <!-- 部门编码 --> DEP_CODE, <!-- 部门编码 -->
) MODEL,
VALUES (#id#, #accountCode#, #companyCode#, #companyName#, #contractNumber#, #inventory#, #unit#, #provisionalQuantity#, #measurementMethod#, #supplyMethod#, #unitPriceExcludingTax#, #totalPriceExcluding#, #totalPriceIncluding#, #laborCosts#, #createdBy#, #createdName#, #createdTime#, #updatedBy#, #updatedName#, #updatedTime#, #depCode#) SPEC
)
VALUES (#id#, #accountCode#, #companyCode#, #companyName#, #contractNumber#, #inventory#, #unit#,
#provisionalQuantity#, #measurementMethod#, #supplyMethod#, #unitPriceExcludingTax#, #totalPriceExcluding#,
#totalPriceIncluding#, #laborCosts#, #createdBy#, #createdName#, #createdTime#, #updatedBy#, #updatedName#,
#updatedTime#, #depCode#,#model#, #spec#)
</insert> </insert>
<delete id="delete"> <delete id="delete">
...@@ -263,7 +276,9 @@ ...@@ -263,7 +276,9 @@
UPDATED_BY = #updatedBy#, <!-- 记录修改者 --> UPDATED_BY = #updatedBy#, <!-- 记录修改者 -->
UPDATED_NAME = #updatedName#, <!-- 记录修改名称 --> UPDATED_NAME = #updatedName#, <!-- 记录修改名称 -->
UPDATED_TIME = #updatedTime#, <!-- 记录修改时间 --> UPDATED_TIME = #updatedTime#, <!-- 记录修改时间 -->
DEP_CODE = #depCode# <!-- 部门编码 --> DEP_CODE = #depCode#, <!-- 部门编码 -->
MODEL = #model#,
SPEC = #spec#
WHERE WHERE
ID = #id# ID = #id#
</update> </update>
......
...@@ -380,12 +380,12 @@ public class HGCWTools { ...@@ -380,12 +380,12 @@ public class HGCWTools {
public static void save(List<Map> rows, String contractNumber, HGCW002 HGCW002) { public static void save(List<Map> rows, String contractNumber, HGCW002 HGCW002) {
AssertUtils.isNull(contractNumber, "合同号不能为空!"); AssertUtils.isNull(contractNumber, "合同号不能为空!");
rows.forEach(row -> { rows.forEach(row -> {
HGCW003 HGCW003 = new HGCW003(); HGCW003 hgcw003 = new HGCW003();
HGCW003.fromMap(row); hgcw003.fromMap(row);
HGCW003.setCompanyCode(HGCW002.getCompanyCode()); hgcw003.setCompanyCode(HGCW002.getCompanyCode());
HGCW003.setCompanyName(HGCW002.getCompanyName()); hgcw003.setCompanyName(HGCW002.getCompanyName());
HGCW003.setContractNumber(contractNumber); hgcw003.setContractNumber(contractNumber);
DaoUtils.insert(HGCW003.INSERT, HGCW003); DaoUtils.insert(HGCW003.INSERT, hgcw003);
}); });
} }
......
...@@ -3,8 +3,10 @@ package com.baosight.hggp.hg.pz.service; ...@@ -3,8 +3,10 @@ package com.baosight.hggp.hg.pz.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.core.constant.CommonConstant; import com.baosight.hggp.core.constant.CommonConstant;
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.hg.constant.HGConstant; import com.baosight.hggp.hg.constant.HGConstant;
import com.baosight.hggp.hg.cw.domain.HGCW002;
import com.baosight.hggp.hg.pz.domain.HGPZ002; import com.baosight.hggp.hg.pz.domain.HGPZ002;
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;
...@@ -25,6 +27,7 @@ import java.util.Arrays; ...@@ -25,6 +27,7 @@ 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;
import java.util.stream.Collectors;
/** /**
* 客户档案 * 客户档案
...@@ -82,9 +85,9 @@ public class ServiceHGPZ002 extends ServiceBase { ...@@ -82,9 +85,9 @@ public class ServiceHGPZ002 extends ServiceBase {
// 数据校验 // 数据校验
this.checkSaveData(resultRows); this.checkSaveData(resultRows);
// 写入数据 // 写入数据
for (int i = 0; i < resultRows.size(); i++) { for (Map resultRow : resultRows) {
HGPZ002 hgpz002 = new HGPZ002(); HGPZ002 hgpz002 = new HGPZ002();
hgpz002.fromMap(resultRows.get(i)); hgpz002.fromMap(resultRow);
if (hgpz002.getId() == null || hgpz002.getId() == 0) { if (hgpz002.getId() == null || hgpz002.getId() == 0) {
this.add(hgpz002); this.add(hgpz002);
} else { } else {
...@@ -107,9 +110,9 @@ public class ServiceHGPZ002 extends ServiceBase { ...@@ -107,9 +110,9 @@ public class ServiceHGPZ002 extends ServiceBase {
*/ */
private void checkSaveData(List<Map> resultRows) { private void checkSaveData(List<Map> resultRows) {
// 数据校验 // 数据校验
for (int i = 0; i < resultRows.size(); i++) { for (Map resultRow : resultRows) {
HGPZ002 hgpz002 = new HGPZ002(); HGPZ002 hgpz002 = new HGPZ002();
hgpz002.fromMap(resultRows.get(i)); hgpz002.fromMap(resultRow);
AssertUtils.isNull(hgpz002.getStatus(), "是否启用不能为空"); AssertUtils.isNull(hgpz002.getStatus(), "是否启用不能为空");
} }
} }
...@@ -197,17 +200,22 @@ public class ServiceHGPZ002 extends ServiceBase { ...@@ -197,17 +200,22 @@ public class ServiceHGPZ002 extends ServiceBase {
* @return * @return
*/ */
@OperationLogAnnotation(operModul = "客户档案", operType = "删除", operDesc = "删除操作") @OperationLogAnnotation(operModul = "客户档案", operType = "删除", operDesc = "删除操作")
@Override
public EiInfo delete(EiInfo inInfo) { public EiInfo delete(EiInfo inInfo) {
try { try {
List<Map> resultRows = inInfo.getBlock(EiConstant.resultBlock).getRows(); List<Map> resultRows = inInfo.getBlock(EiConstant.resultBlock).getRows();
for (int i = 0; i < resultRows.size(); i++) { List<String> custCodes = resultRows.stream().map(row -> row.get(HGPZ002.FIELD_CUST_CODE).toString()).collect(Collectors.toList());
List<HGCW002> hgcw002List = queryCustCode(custCodes);
for (Map resultRow : resultRows) {
HGPZ002 hgpz002 = new HGPZ002(); HGPZ002 hgpz002 = new HGPZ002();
hgpz002.fromMap(resultRows.get(i)); hgpz002.fromMap(resultRow);
// 校验企业下是否存在用户 // 校验企业下是否存在用户
int count = HGXSTools.XsUser.countByAccount(hgpz002.getAccountCode()); int count = HGXSTools.XsUser.countByAccount(hgpz002.getAccountCode());
if (count > 0) { if (count > 0) {
// throw new PlatException(String.format("企业[%s]已关联用户,请先解除用户", hgpz002.getAccountName())); //throw new PlatException(String.format("企业[%s]已关联用户,请先解除用户", hgpz002.getAccountName()));
} }
List<HGCW002> hgcw002s =hgcw002List.stream().filter(hgcw002 -> hgcw002.getPartyA().equals(hgpz002.getCustCode())).collect(Collectors.toList());
AssertUtils.isNotEmpty(hgcw002s, String.format("客户[%s]已关联业务,请先解除业务", hgpz002.getCustName()));
DaoUtils.update(HGPZ002.DELETE, hgpz002); DaoUtils.update(HGPZ002.DELETE, hgpz002);
} }
inInfo = this.query(inInfo); inInfo = this.query(inInfo);
...@@ -218,5 +226,14 @@ public class ServiceHGPZ002 extends ServiceBase { ...@@ -218,5 +226,14 @@ public class ServiceHGPZ002 extends ServiceBase {
} }
return inInfo; return inInfo;
} }
public List<HGCW002> queryCustCode(List<String> custCodes){
List<HGCW002> hgcw002List = DaoBase.getInstance().query(HGCW002.QUERY,
new HashMap<String,Object>(){{
put("partyA", custCodes);
put("partyB", custCodes);
}});
return hgcw002List;
}
} }
...@@ -6,33 +6,32 @@ import com.baosight.hggp.common.InventTypeDetailEnum; ...@@ -6,33 +6,32 @@ import com.baosight.hggp.common.InventTypeDetailEnum;
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.OrgTypeEnum;
import com.baosight.hggp.core.security.UserSessionUtils;
import com.baosight.hggp.hg.constant.HGConstant;
import com.baosight.hggp.hg.constant.HGSqlConstant; import com.baosight.hggp.hg.constant.HGSqlConstant;
import com.baosight.hggp.hg.pz.domain.HGPZ004; import com.baosight.hggp.hg.pz.domain.HGPZ004;
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.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.HGSJ002;
import com.baosight.hggp.hg.sj.domain.HGSJ002A; 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.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.AssertUtils;
import com.baosight.hggp.util.CommonMethod;
import com.baosight.hggp.util.EiInfoUtils;
import com.baosight.hggp.util.LogUtils;
import com.baosight.hggp.util.StringUtils;
import com.baosight.hggp.util.contants.ACConstants; import com.baosight.hggp.util.contants.ACConstants;
import com.baosight.iplat4j.core.ProjectInfo;
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.core.exception.PlatException; import com.baosight.iplat4j.core.exception.PlatException;
import com.baosight.iplat4j.core.service.impl.ServiceBase; import com.baosight.iplat4j.core.service.impl.ServiceBase;
import com.baosight.iplat4j.core.service.soa.XLocalManager;
import com.baosight.iplat4j.core.web.threadlocal.UserSession;
import com.baosight.iplat4j.ed.util.SequenceGenerator;
import java.math.BigDecimal; import java.math.BigDecimal;
import java.util.*; import java.util.ArrayList;
import java.util.Arrays;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
/** /**
* 存货档案 * 存货档案
...@@ -295,10 +294,13 @@ public class ServiceHGPZ005 extends ServiceBase { ...@@ -295,10 +294,13 @@ public class ServiceHGPZ005 extends ServiceBase {
@OperationLogAnnotation(operModul = "存货档案",operType = "查询",operDesc = "下拉框(原料、零件、耗材)") @OperationLogAnnotation(operModul = "存货档案",operType = "查询",operDesc = "下拉框(原料、零件、耗材)")
public EiInfo queryInventCodeProdTypeFourBox(EiInfo inInfo) { public EiInfo queryInventCodeProdTypeFourBox(EiInfo inInfo) {
try { try {
Map queryMap = new HashMap();
queryMap.put(HGPZ005.FIELD_STATUS, CommonConstant.YesNo.YES_1);
List<DdynamicEnum> list = new ArrayList<>(); List<DdynamicEnum> list = new ArrayList<>();
list.add(DdynamicEnum.INVENT_RECORD_BOX_BLOCK_ID); list.add(DdynamicEnum.INVENT_RECORD_BOX_BLOCK_ID);
inInfo.setCell(EiConstant.queryBlock, ACConstants.ROW_CODE_0, HGPZ004.FIELD_INVENT_TYPE_DETAILS, InventTypeDetailEnum.getInentTypeThree()); // modify by songx at 2024-20-22 需求不限制类型
inInfo.setCell(EiConstant.queryBlock, ACConstants.ROW_CODE_0, HGPZ005.FIELD_STATUS,1); // inInfo.setCell(EiConstant.queryBlock, ACConstants.ROW_CODE_0, HGPZ004.FIELD_INVENT_TYPE_DETAILS,
// InventTypeDetailEnum.getInentTypeThree());
CommonMethod.initBlock(inInfo, list, EiInfoUtils.getFirstRow(inInfo), false); CommonMethod.initBlock(inInfo, list, EiInfoUtils.getFirstRow(inInfo), false);
} catch (Exception e) { } catch (Exception e) {
LogUtils.setDetailMsg(inInfo, e, "查询规格失败"); LogUtils.setDetailMsg(inInfo, e, "查询规格失败");
...@@ -332,12 +334,14 @@ public class ServiceHGPZ005 extends ServiceBase { ...@@ -332,12 +334,14 @@ public class ServiceHGPZ005 extends ServiceBase {
* @param inInfo * @param inInfo
* @return * @return
*/ */
@OperationLogAnnotation(operModul = "存货档案",operType = "查询",operDesc = "规格下拉框") @OperationLogAnnotation(operModul = "存货档案", operType = "查询", operDesc = "规格下拉框")
public EiInfo queryComboBoxAll(EiInfo inInfo) { public EiInfo queryComboBoxAll(EiInfo inInfo) {
try { try {
Map queryMap = EiInfoUtils.getFirstRow(inInfo);
queryMap.put(HGPZ005.FIELD_STATUS, CommonConstant.YesNo.YES_1);
List<DdynamicEnum> list = new ArrayList<>(); List<DdynamicEnum> list = new ArrayList<>();
list.add(DdynamicEnum.INVENT_ALL_BLOCK_ID); list.add(DdynamicEnum.INVENT_ALL_BLOCK_ID);
CommonMethod.initBlock(inInfo, list, EiInfoUtils.getFirstRow(inInfo), false); CommonMethod.initBlock(inInfo, list, queryMap, false);
} catch (Exception e) { } catch (Exception e) {
LogUtils.setDetailMsg(inInfo, e, "查询规格失败"); LogUtils.setDetailMsg(inInfo, e, "查询规格失败");
} }
......
...@@ -323,6 +323,9 @@ ...@@ -323,6 +323,9 @@
<isNotEmpty prepend=" AND " property="custType"> <isNotEmpty prepend=" AND " property="custType">
CUST_TYPE = #custType# CUST_TYPE = #custType#
</isNotEmpty> </isNotEmpty>
<isNotEmpty prepend=" AND " property="custTypes">
CUST_TYPE IN <iterate close=")" open="(" conjunction="," property="custTypes">#custTypes[]#</iterate>
</isNotEmpty>
ORDER BY CUST_CODE ORDER BY CUST_CODE
</select> </select>
......
package com.baosight.hggp.hg.sb.service;
import com.baosight.hggp.aspect.annotation.OperationLogAnnotation;
import com.baosight.hggp.core.dao.DaoBase;
import com.baosight.hggp.util.DateUtils;
import com.baosight.hggp.util.EiInfoUtils;
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.*;
import java.util.stream.Collectors;
/**
* @author LiuYang
* @version 1.0 2024/10/21
* @description
*/
public class ServiceHGSB010 extends ServiceEPBase {
@OperationLogAnnotation(operModul = "设备监控",operType = "app查询",operDesc = "app查询设备状态")
public EiInfo queryAppBySbStatus(EiInfo inInfo) {
Map params = EiInfoUtils.getFirstRow(inInfo);
if (params.containsKey("date")){
params.put("date", DateUtils.formatShort(params.get("date")));
}
List<Map> result = DaoBase.getInstance().query("HGSB010.queryBySbStatus", params);
inInfo.set("result",result);
this.sbYes(inInfo, params);
this.sbNo(inInfo, params);
inInfo.setStatus(EiConstant.STATUS_DEFAULT);
return inInfo;
}
@OperationLogAnnotation(operModul = "设备监控",operType = "查询",operDesc = "查询设备状态")
public EiInfo queryBySbStatus(EiInfo inInfo) {
Map params = EiInfoUtils.getFirstRow(inInfo);
if (params.containsKey("date")){
params.put("date", DateUtils.formatShort(params.get("date")));
}
List<Map> result = DaoBase.getInstance().query("HGSB010.queryBySbStatus", params);
inInfo.set("result",result);
inInfo.setStatus(EiConstant.STATUS_DEFAULT);
return inInfo;
}
/**
* 近7日设备运行时长
* @param inInfo
* @return
*/
public EiInfo querySbYes(EiInfo inInfo){
Map params = EiInfoUtils.getFirstRow(inInfo);
if (params.containsKey("date")){
params.put("date", DateUtils.formatShort(params.get("date")));
}
params.put("logValues", Arrays.asList("1", "2", "4"));
List<Map> result = new ArrayList<>();
List<Map> listMap = DaoBase.getInstance().query("HGSB010.queryBySbYes", params, 0,100);
List listMap2 = listMap.stream().map(map -> map.get("date")).sorted().distinct().collect(Collectors.toList());
Map<Object, List<Map>> listMap1 = listMap.stream().collect(Collectors.groupingBy(m -> m.get("deviceCode")));
for (Object key: listMap1.keySet()) {
Map<Object, Object> map = new HashMap<>();
map.put("name", key);
map.put("type", "line");
map.put("stack", "Total");
List list1 = new ArrayList<>();
for (Map map1: listMap1.get(key)) {
list1.add(map1.get("num"));
}
map.put("data", list1);
result.add(map);
}
inInfo.set("date", listMap2);
inInfo.set("name", listMap1.keySet());
inInfo.set(EiConstant.resultBlock, result);
return inInfo;
}
/**
* 近7日设备运行时长
* @param inInfo
* @return
*/
public EiInfo querySbNo(EiInfo inInfo){
Map params = EiInfoUtils.getFirstRow(inInfo);
if (params.containsKey("date")){
params.put("date", DateUtils.formatShort(params.get("date")));
}
params.put("logValues", Arrays.asList("3", "5", "6"));
List<Map> result = new ArrayList<>();
List<Map> listMap = DaoBase.getInstance().query("HGSB010.queryBySbYes", params, 0,100);
List listMap2 = listMap.stream().map(map -> map.get("date")).sorted().distinct().collect(Collectors.toList());
Map<Object, List<Map>> listMap1 = listMap.stream().collect(Collectors.groupingBy(m -> m.get("deviceCode")));
for (Object key: listMap1.keySet()) {
Map<Object, Object> map = new HashMap<>();
map.put("name", key);
map.put("type", "line");
map.put("stack", "Total");
List list1 = new ArrayList<>();
for (Map map1: listMap1.get(key)) {
list1.add(map1.get("num"));
}
map.put("data", list1);
result.add(map);
}
inInfo.set("date", listMap2);
inInfo.set("name", listMap1.keySet());
inInfo.set(EiConstant.resultBlock, result);
return inInfo;
}
public void sbYes(EiInfo inInfo, Map params){
params.put("logValues", Arrays.asList("1", "2", "4"));
List<Map> result = (List<Map>) inInfo.get(EiConstant.resultBlock);
List<Map> list = new ArrayList<>();
List<Map> listMap = DaoBase.getInstance().query("HGSB010.queryBySbYes", params, 0,100);
List listMap2 = listMap.stream().map(map -> map.get("date")).sorted().distinct().collect(Collectors.toList());
Map<Object, List<Map>> listMap1 = listMap.stream().collect(Collectors.groupingBy(m -> m.get("deviceCode")));
for (Object key: listMap1.keySet()) {
Map<Object, Object> map = new HashMap<>();
map.put("name", key);
List list1 = new ArrayList<>();
for (Map map1: listMap1.get(key)) {
Map map2 = new HashMap();
map2.put(map1.get("date"), map1.get("num"));
list1.add(map2);
}
map.put("data", list1);
list.add(map);
}
for (Map map: result) {
Map resultMap = list.stream().filter(m -> m.get("name").equals(map.get("deviceCode"))).findAny().get();
map.put("runTime", resultMap.get("data"));
}
}
public void sbNo(EiInfo inInfo, Map params){
params.put("logValues", Arrays.asList("3", "5", "6"));
List<Map> result = (List<Map>) inInfo.get(EiConstant.resultBlock);
List<Map> list = new ArrayList<>();
List<Map> listMap = DaoBase.getInstance().query("HGSB010.queryBySbYes", params, 0,100);
List listMap2 = listMap.stream().map(map -> map.get("date")).sorted().distinct().collect(Collectors.toList());
Map<Object, List<Map>> listMap1 = listMap.stream().collect(Collectors.groupingBy(m -> m.get("deviceCode")));
for (Object key: listMap1.keySet()) {
Map<Object, Object> map = new HashMap<>();
map.put("name", key);
List list1 = new ArrayList<>();
for (Map map1: listMap1.get(key)) {
Map map2 = new HashMap();
map2.put(map1.get("date"), map1.get("num"));
list1.add(map2);
}
map.put("data", list1);
list.add(map);
}
for (Map map: result) {
Map resultMap = list.stream().filter(m -> m.get("name").equals(map.get("deviceCode"))).findAny().get();
map.put("errerTime", resultMap.get("data"));
}
//inInfo.set("errerDate", listMap2);
//inInfo.set("errerTime", result);
}
}
...@@ -51,6 +51,7 @@ public class HGSC001 extends DaoEPBase { ...@@ -51,6 +51,7 @@ public class HGSC001 extends DaoEPBase {
public static final String FIELD_start_date = "startDate"; /* 开工日期*/ public static final String FIELD_start_date = "startDate"; /* 开工日期*/
public static final String FIELD_end_date = "endDate"; /* 完工日期*/ public static final String FIELD_end_date = "endDate"; /* 完工日期*/
public static final String FIELD_project_source = "projectSource"; /* 项目来源*/ public static final String FIELD_project_source = "projectSource"; /* 项目来源*/
public static final String FIELD_branch_unit = "branchUnit"; /*分子单位*/
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"; /* 帐套*/
...@@ -119,6 +120,7 @@ public class HGSC001 extends DaoEPBase { ...@@ -119,6 +120,7 @@ public class HGSC001 extends DaoEPBase {
private String startDate = " "; /* 开工日期*/ private String startDate = " "; /* 开工日期*/
private String endDate = " "; /* 完工日期*/ private String endDate = " "; /* 完工日期*/
private String projectSource = " "; /* 项目来源*/ private String projectSource = " "; /* 项目来源*/
private String branchUnit = " "; /*分支单位*/
/** /**
* initialize the metadata. * initialize the metadata.
...@@ -246,6 +248,10 @@ public class HGSC001 extends DaoEPBase { ...@@ -246,6 +248,10 @@ public class HGSC001 extends DaoEPBase {
eiColumn = new EiColumn(FIELD_project_source); eiColumn = new EiColumn(FIELD_project_source);
eiColumn.setDescName("项目来源"); eiColumn.setDescName("项目来源");
eiMetadata.addMeta(eiColumn); eiMetadata.addMeta(eiColumn);
eiColumn = new EiColumn(FIELD_branch_unit);
eiColumn.setDescName("分支单位");
eiMetadata.addMeta(eiColumn);
} }
...@@ -737,6 +743,15 @@ public class HGSC001 extends DaoEPBase { ...@@ -737,6 +743,15 @@ public class HGSC001 extends DaoEPBase {
public void setProjectSource(String projectSource) { public void setProjectSource(String projectSource) {
this.projectSource = projectSource; this.projectSource = projectSource;
} }
public String getBranchUnit() {
return branchUnit;
}
public void setBranchUnit(String branchUnit) {
this.branchUnit = branchUnit;
}
/** /**
* get the value from Map. * get the value from Map.
* *
...@@ -775,6 +790,7 @@ public class HGSC001 extends DaoEPBase { ...@@ -775,6 +790,7 @@ public class HGSC001 extends DaoEPBase {
setStartDate(StringUtils.defaultIfEmpty(StringUtils.toString(map.get(FIELD_start_date)), startDate)); setStartDate(StringUtils.defaultIfEmpty(StringUtils.toString(map.get(FIELD_start_date)), startDate));
setEndDate(StringUtils.defaultIfEmpty(StringUtils.toString(map.get(FIELD_end_date)), endDate)); setEndDate(StringUtils.defaultIfEmpty(StringUtils.toString(map.get(FIELD_end_date)), endDate));
setProjectSource(StringUtils.defaultIfEmpty(StringUtils.toString(map.get(FIELD_project_source)), projectSource)); setProjectSource(StringUtils.defaultIfEmpty(StringUtils.toString(map.get(FIELD_project_source)), projectSource));
setBranchUnit(StringUtils.defaultIfEmpty(StringUtils.toString(map.get(FIELD_branch_unit)), branchUnit));
} }
/** /**
...@@ -814,6 +830,7 @@ public class HGSC001 extends DaoEPBase { ...@@ -814,6 +830,7 @@ public class HGSC001 extends DaoEPBase {
map.put(FIELD_start_date, StringUtils.toString(startDate, eiMetadata.getMeta(FIELD_start_date))); map.put(FIELD_start_date, StringUtils.toString(startDate, eiMetadata.getMeta(FIELD_start_date)));
map.put(FIELD_end_date, StringUtils.toString(endDate, eiMetadata.getMeta(FIELD_end_date))); map.put(FIELD_end_date, StringUtils.toString(endDate, eiMetadata.getMeta(FIELD_end_date)));
map.put(FIELD_project_source, StringUtils.toString(projectSource, eiMetadata.getMeta(FIELD_project_source))); map.put(FIELD_project_source, StringUtils.toString(projectSource, eiMetadata.getMeta(FIELD_project_source)));
map.put(FIELD_branch_unit, StringUtils.toString(branchUnit, eiMetadata.getMeta(FIELD_branch_unit)));
return map; return map;
} }
......
...@@ -52,6 +52,8 @@ public class HGSC010A extends DaoEPBase { ...@@ -52,6 +52,8 @@ public class HGSC010A extends DaoEPBase {
public static final String FIELD_REMAINING_UNIT_WEIGHT = "remainingUnitWeight"; /* 剩余单量*/ public static final String FIELD_REMAINING_UNIT_WEIGHT = "remainingUnitWeight"; /* 剩余单量*/
public static final String FIELD_REMAINING_WEIGHT = "remainingWeight"; /* 剩余重量*/ public static final String FIELD_REMAINING_WEIGHT = "remainingWeight"; /* 剩余重量*/
public static final String FIELD_DELIVER_QTY = "deliverQty"; /* 退货数量*/ public static final String FIELD_DELIVER_QTY = "deliverQty"; /* 退货数量*/
public static final String FIELD_INVENT_CODE = "inventCode"; /* 原料编码*/
public static final String FIELD_INVENT_NAME = "inventName"; /* 原料名称*/
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"; /* 账套*/
...@@ -79,6 +81,8 @@ public class HGSC010A extends DaoEPBase { ...@@ -79,6 +81,8 @@ public class HGSC010A extends DaoEPBase {
public static final String COL_REMAINING_QTY = "REMAINING_QTY"; /* 剩余数量*/ public static final String COL_REMAINING_QTY = "REMAINING_QTY"; /* 剩余数量*/
public static final String COL_REMAINING_WEIGHT = "REMAINING_WEIGHT"; /* 剩余重量*/ public static final String COL_REMAINING_WEIGHT = "REMAINING_WEIGHT"; /* 剩余重量*/
public static final String COL_DELIVER_WEIGHT = "DELIVER_WEIGHT"; /* 退货数量*/ public static final String COL_DELIVER_WEIGHT = "DELIVER_WEIGHT"; /* 退货数量*/
public static final String COL_INVENT_CODE = "INVENT_CODE"; /* 原料编码*/
public static final String COL_INVENT_NAME = "INVENT_NAME"; /* 原料名称*/
public static final String QUERY = "HGSC010A.query"; public static final String QUERY = "HGSC010A.query";
public static final String COUNT = "HGSC010A.count"; public static final String COUNT = "HGSC010A.count";
...@@ -116,6 +120,8 @@ public class HGSC010A extends DaoEPBase { ...@@ -116,6 +120,8 @@ public class HGSC010A extends DaoEPBase {
private BigDecimal remainingUnitWeight = new BigDecimal("0"); /* 剩余单量*/ private BigDecimal remainingUnitWeight = new BigDecimal("0"); /* 剩余单量*/
private BigDecimal remainingWeight = new BigDecimal("0"); /* 剩余重量*/ private BigDecimal remainingWeight = new BigDecimal("0"); /* 剩余重量*/
private BigDecimal deliverQty = new BigDecimal("0"); /* 退货数量*/ private BigDecimal deliverQty = new BigDecimal("0"); /* 退货数量*/
private String inventCode = " "; /* 原料编码*/
private String inventName = " "; /* 原料名称*/
/** /**
* initialize the metadata. * initialize the metadata.
...@@ -273,6 +279,14 @@ public class HGSC010A extends DaoEPBase { ...@@ -273,6 +279,14 @@ public class HGSC010A extends DaoEPBase {
eiColumn.setFieldLength(17); eiColumn.setFieldLength(17);
eiColumn.setDescName("退货数量"); eiColumn.setDescName("退货数量");
eiMetadata.addMeta(eiColumn); eiMetadata.addMeta(eiColumn);
eiColumn = new EiColumn(FIELD_INVENT_CODE);
eiColumn.setDescName("原料编码");
eiMetadata.addMeta(eiColumn);
eiColumn = new EiColumn(FIELD_INVENT_NAME);
eiColumn.setDescName("原料名称");
eiMetadata.addMeta(eiColumn);
} }
/** /**
...@@ -722,7 +736,23 @@ public class HGSC010A extends DaoEPBase { ...@@ -722,7 +736,23 @@ public class HGSC010A extends DaoEPBase {
public void setDeliverQty(BigDecimal deliverQty) { public void setDeliverQty(BigDecimal deliverQty) {
this.deliverQty = deliverQty; this.deliverQty = deliverQty;
} }
public String getInventCode() {
return inventCode;
}
public void setInventCode(String inventCode) {
this.inventCode = inventCode;
}
public String getInventName() {
return inventName;
}
public void setInventName(String inventName) {
this.inventName = inventName;
}
/** /**
* get the value from Map. * get the value from Map.
* *
...@@ -761,6 +791,8 @@ public class HGSC010A extends DaoEPBase { ...@@ -761,6 +791,8 @@ public class HGSC010A extends DaoEPBase {
setRemainingUnitWeight(NumberUtils.toBigDecimal(StringUtils.toString(map.get(FIELD_REMAINING_UNIT_WEIGHT)), remainingUnitWeight)); setRemainingUnitWeight(NumberUtils.toBigDecimal(StringUtils.toString(map.get(FIELD_REMAINING_UNIT_WEIGHT)), remainingUnitWeight));
setRemainingWeight(NumberUtils.toBigDecimal(StringUtils.toString(map.get(FIELD_REMAINING_WEIGHT)), remainingWeight)); setRemainingWeight(NumberUtils.toBigDecimal(StringUtils.toString(map.get(FIELD_REMAINING_WEIGHT)), remainingWeight));
setDeliverQty(NumberUtils.toBigDecimal(StringUtils.toString(map.get(FIELD_DELIVER_QTY)), deliverQty)); setDeliverQty(NumberUtils.toBigDecimal(StringUtils.toString(map.get(FIELD_DELIVER_QTY)), deliverQty));
setInventCode(StringUtils.defaultIfEmpty(StringUtils.toString(map.get(FIELD_INVENT_CODE)), inventCode));
setInventName(StringUtils.defaultIfEmpty(StringUtils.toString(map.get(FIELD_INVENT_NAME)), inventName));
} }
/** /**
...@@ -800,6 +832,8 @@ public class HGSC010A extends DaoEPBase { ...@@ -800,6 +832,8 @@ public class HGSC010A extends DaoEPBase {
map.put(FIELD_REMAINING_UNIT_WEIGHT, StringUtils.toString(remainingUnitWeight, eiMetadata.getMeta(FIELD_REMAINING_UNIT_WEIGHT))); map.put(FIELD_REMAINING_UNIT_WEIGHT, StringUtils.toString(remainingUnitWeight, eiMetadata.getMeta(FIELD_REMAINING_UNIT_WEIGHT)));
map.put(FIELD_REMAINING_WEIGHT, StringUtils.toString(remainingWeight, eiMetadata.getMeta(FIELD_REMAINING_WEIGHT))); map.put(FIELD_REMAINING_WEIGHT, StringUtils.toString(remainingWeight, eiMetadata.getMeta(FIELD_REMAINING_WEIGHT)));
map.put(FIELD_DELIVER_QTY, StringUtils.toString(deliverQty, eiMetadata.getMeta(FIELD_DELIVER_QTY))); map.put(FIELD_DELIVER_QTY, StringUtils.toString(deliverQty, eiMetadata.getMeta(FIELD_DELIVER_QTY)));
map.put(FIELD_INVENT_CODE, StringUtils.toString(inventCode, eiMetadata.getMeta(FIELD_INVENT_CODE)));
map.put(FIELD_INVENT_NAME, StringUtils.toString(inventName, eiMetadata.getMeta(FIELD_INVENT_NAME)));
return map; return map;
} }
......
package com.baosight.hggp.hg.sc.domain;
public class queryByWtDto {
private String processName;
private String totalWeight ;
public String getProcessName() {
return processName;
}
public void setProcessName(String processName) {
this.processName = processName;
}
public String getTotalWeight() {
return totalWeight;
}
public void setTotalWeight(String totalWeight) {
this.totalWeight = totalWeight;
}
@Override
public String toString() {
return "queryByWtDto{" +
"processName='" + processName + '\'' +
", totalWeight='" + totalWeight + '\'' +
'}';
}
}
...@@ -3,8 +3,11 @@ package com.baosight.hggp.hg.sc.service; ...@@ -3,8 +3,11 @@ package com.baosight.hggp.hg.sc.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.core.constant.CommonConstant; import com.baosight.hggp.core.constant.CommonConstant;
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.security.UserSessionUtils; import com.baosight.hggp.core.security.UserSessionUtils;
import com.baosight.hggp.hg.pz.domain.HGPZ001;
import com.baosight.hggp.hg.pz.domain.HGPZ002;
import com.baosight.hggp.hg.sc.constant.HgScSqlConstant; import com.baosight.hggp.hg.sc.constant.HgScSqlConstant;
import com.baosight.hggp.hg.sc.domain.HGSC001; import com.baosight.hggp.hg.sc.domain.HGSC001;
import com.baosight.hggp.hg.sc.domain.HGSC001A; import com.baosight.hggp.hg.sc.domain.HGSC001A;
...@@ -14,12 +17,14 @@ import com.baosight.hggp.hg.xs.domain.Dept; ...@@ -14,12 +17,14 @@ import com.baosight.hggp.hg.xs.domain.Dept;
import com.baosight.hggp.hg.xs.domain.User; import com.baosight.hggp.hg.xs.domain.User;
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.iplat4j.core.ei.EiBlock;
import com.baosight.iplat4j.core.ei.EiConstant; import com.baosight.iplat4j.core.ei.EiConstant;
import com.baosight.iplat4j.core.ei.EiInfo; import com.baosight.iplat4j.core.ei.EiInfo;
import com.baosight.iplat4j.core.exception.PlatException; import com.baosight.iplat4j.core.exception.PlatException;
import com.baosight.iplat4j.core.service.impl.ServiceBase; import com.baosight.iplat4j.core.service.impl.ServiceBase;
import java.util.*; import java.util.*;
import java.util.stream.Collectors;
/** /**
...@@ -32,7 +37,6 @@ public class ServiceHGSC001 extends ServiceBase { ...@@ -32,7 +37,6 @@ public class ServiceHGSC001 extends ServiceBase {
public EiInfo initLoad(EiInfo inInfo) { public EiInfo initLoad(EiInfo inInfo) {
try { try {
inInfo.addBlock(EiConstant.resultBlock).addBlockMeta(new HGSC001().eiMetadata); inInfo.addBlock(EiConstant.resultBlock).addBlockMeta(new HGSC001().eiMetadata);
// inInfo = super.query(inInfo, HGSC001.QUERY, new HGSC001());
Map map = new HashMap(); Map map = new HashMap();
map.put(HGSC001.FIELD_account_code, UserSessionUtils.getAccountCode()); map.put(HGSC001.FIELD_account_code, UserSessionUtils.getAccountCode());
CommonMethod.initBlock(inInfo, Arrays.asList(DdynamicEnum.PROJ_TYPE_BLOCK_ID), map,false); CommonMethod.initBlock(inInfo, Arrays.asList(DdynamicEnum.PROJ_TYPE_BLOCK_ID), map,false);
...@@ -201,11 +205,23 @@ public class ServiceHGSC001 extends ServiceBase { ...@@ -201,11 +205,23 @@ public class ServiceHGSC001 extends ServiceBase {
String companyCode = MapUtils.getString(queryMap, HGSC001.FIELD_subcontract_code); String companyCode = MapUtils.getString(queryMap, HGSC001.FIELD_subcontract_code);
Map map = new HashMap(); Map map = new HashMap();
map.put(HGSC001.FIELD_account_code, UserSessionUtils.getAccountCode()); map.put(HGSC001.FIELD_account_code, UserSessionUtils.getAccountCode());
// map.put("companyCode", companyCode);
Map map1 = new HashMap<>();
map1.put("status", CommonConstant.YesNo.YES_1);
map1.put(HGSC001.FIELD_account_code, map.get(HGSC001.FIELD_account_code));
List<HGPZ001> list = DaoBase.getInstance().query(HGPZ001.QUERY,map);
if (!queryMap.containsKey(HGSC001.FIELD_branch_unit) || queryMap.get(HGSC001.FIELD_branch_unit).equals(CommonConstant.YesNo.NO_0)){
list = list.stream().filter(hgpz001 -> !"分支单位".equals(hgpz001.getCustTypeName())).collect(Collectors.toList());
}else {
list = list.stream().filter(hgpz001 -> "分支单位".equals(hgpz001.getCustTypeName())).collect(Collectors.toList());
}
if (list.size() > 0){
List<String> custTypeList = list.stream().map(HGPZ001::getCustType).collect(Collectors.toList());
map.put("custTypes", custTypeList);
}
CommonMethod.initBlock(inInfo, Arrays.asList(DdynamicEnum.CUSTOMER_RECORD_BLOCK_ID), map,false); CommonMethod.initBlock(inInfo, Arrays.asList(DdynamicEnum.CUSTOMER_RECORD_BLOCK_ID), map,false);
CommonMethod.comboBoxDefaultValue(inInfo,DdynamicEnum.CUSTOMER_RECORD_BLOCK_ID.getBlockId()); CommonMethod.comboBoxDefaultValue(inInfo,DdynamicEnum.CUSTOMER_RECORD_BLOCK_ID.getBlockId());
return inInfo; return inInfo;
} }
/** /**
......
...@@ -2,8 +2,10 @@ package com.baosight.hggp.hg.sc.service; ...@@ -2,8 +2,10 @@ package com.baosight.hggp.hg.sc.service;
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.DaoBase;
import com.baosight.hggp.core.security.UserSessionUtils; 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.HGPZ001;
import com.baosight.hggp.hg.sc.domain.HGSC001; import com.baosight.hggp.hg.sc.domain.HGSC001;
import com.baosight.hggp.hg.sc.domain.HGSC001A; import com.baosight.hggp.hg.sc.domain.HGSC001A;
import com.baosight.hggp.hg.xs.domain.Company; import com.baosight.hggp.hg.xs.domain.Company;
...@@ -12,6 +14,8 @@ import com.baosight.hggp.hg.xs.tools.HGXSTools; ...@@ -12,6 +14,8 @@ import com.baosight.hggp.hg.xs.tools.HGXSTools;
import com.baosight.hggp.util.CommonMethod; import com.baosight.hggp.util.CommonMethod;
import com.baosight.hggp.util.EiInfoUtils; import com.baosight.hggp.util.EiInfoUtils;
import com.baosight.hggp.util.LogUtils; 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.EiConstant;
import com.baosight.iplat4j.core.ei.EiInfo; import com.baosight.iplat4j.core.ei.EiInfo;
import com.baosight.iplat4j.core.exception.PlatException; import com.baosight.iplat4j.core.exception.PlatException;
...@@ -19,6 +23,7 @@ import com.baosight.iplat4j.core.service.impl.ServiceBase; ...@@ -19,6 +23,7 @@ import com.baosight.iplat4j.core.service.impl.ServiceBase;
import com.baosight.iplat4j.ed.util.SequenceGenerator; import com.baosight.iplat4j.ed.util.SequenceGenerator;
import java.util.*; import java.util.*;
import java.util.stream.Collectors;
/** /**
...@@ -36,9 +41,32 @@ public class ServiceHGSC001C extends ServiceBase { ...@@ -36,9 +41,32 @@ public class ServiceHGSC001C extends ServiceBase {
Map map = new HashMap(); Map map = new HashMap();
map.put(HGSC001.FIELD_account_code, UserSessionUtils.getAccountCode()); map.put(HGSC001.FIELD_account_code, UserSessionUtils.getAccountCode());
CommonMethod.initBlock(inInfo, Arrays.asList(DdynamicEnum.PROJ_TYPE_BLOCK_ID), map,false); CommonMethod.initBlock(inInfo, Arrays.asList(DdynamicEnum.PROJ_TYPE_BLOCK_ID), map,false);
CommonMethod.initBlock(inInfo, Arrays.asList(DdynamicEnum.CUSTOMER_RECORD_BLOCK_ID), map,false);
EiInfoUtils.addBlock(inInfo,"roleCompany", UserSessionUtils.getRoleCompany(), Company.class); EiInfoUtils.addBlock(inInfo,"roleCompany", UserSessionUtils.getRoleCompany(), Company.class);
EiInfoUtils.addBlock(inInfo,"userAll", HGXSTools.XsUser.listAll(UserSessionUtils.getAccountCode()), User.class); EiInfoUtils.addBlock(inInfo,"userAll", HGXSTools.XsUser.listAll(UserSessionUtils.getAccountCode()), User.class);
Map map1 = new HashMap<>();
map1.put("status", CommonConstant.YesNo.YES_1);
map1.put(HGSC001.FIELD_account_code, map.get(HGSC001.FIELD_account_code));
List<HGPZ001> list = DaoBase.getInstance().query(HGPZ001.QUERY,map);
List<HGPZ001> list1 = Optional.ofNullable(list).orElse(new ArrayList<>()).stream().filter(hgpz001 -> "分支单位".equals(hgpz001.getCustTypeName())).collect(Collectors.toList());
if (list1.size() > 0){
list1 = list1.stream().filter(hgpz001 -> "分支单位".equals(hgpz001.getCustTypeName())).collect(Collectors.toList());
List<String> custTypeList = list1.stream().map(HGPZ001::getCustType).collect(Collectors.toList());
CommonMethod.initBlock(inInfo, Arrays.asList(DdynamicEnum.CUSTOMER_RECORD_BLOCK_ID),
new HashMap<String, Object>(){{put("custTypes", custTypeList);}},false);
List<Map> info = inInfo.getBlock("customer_record_block_id").getRows();
EiBlock block = new EiBlock("customer1_record_block_id");
block.setRows(info);
inInfo.setBlock(block);
CommonMethod.comboBoxDefaultValue(inInfo,"customer1_record_block_id");
}
List<HGPZ001> list2 = Optional.ofNullable(list).orElse(new ArrayList<>()).stream().filter(hgpz001 -> !"分支单位".equals(hgpz001.getCustTypeName())).collect(Collectors.toList());
if (list2.size() > 0){
list2 = list2.stream().filter(hgpz001 -> !"分支单位".equals(hgpz001.getCustTypeName())).collect(Collectors.toList());
List<String> custTypeList = list2.stream().map(HGPZ001::getCustType).collect(Collectors.toList());
CommonMethod.initBlock(inInfo, Arrays.asList(DdynamicEnum.CUSTOMER_RECORD_BLOCK_ID),
new HashMap<String, Object>(){{put("custTypes", custTypeList);}},false);
CommonMethod.comboBoxDefaultValue(inInfo,DdynamicEnum.CUSTOMER_RECORD_BLOCK_ID.getBlockId());
}
} catch (PlatException e) { } catch (PlatException e) {
LogUtils.setDetailMsg(inInfo, e, "初始化失败"); LogUtils.setDetailMsg(inInfo, e, "初始化失败");
} catch (InstantiationException e) { } catch (InstantiationException e) {
......
...@@ -2,8 +2,10 @@ package com.baosight.hggp.hg.sc.service; ...@@ -2,8 +2,10 @@ package com.baosight.hggp.hg.sc.service;
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.DaoBase;
import com.baosight.hggp.core.security.UserSessionUtils; 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.HGPZ001;
import com.baosight.hggp.hg.sc.domain.HGSC001; import com.baosight.hggp.hg.sc.domain.HGSC001;
import com.baosight.hggp.hg.sc.domain.HGSC001A; import com.baosight.hggp.hg.sc.domain.HGSC001A;
import com.baosight.hggp.hg.sc.tools.HGSCTools; import com.baosight.hggp.hg.sc.tools.HGSCTools;
...@@ -14,6 +16,7 @@ import com.baosight.hggp.hg.xs.tools.HGXSTools; ...@@ -14,6 +16,7 @@ import com.baosight.hggp.hg.xs.tools.HGXSTools;
import com.baosight.hggp.util.CommonMethod; import com.baosight.hggp.util.CommonMethod;
import com.baosight.hggp.util.EiInfoUtils; import com.baosight.hggp.util.EiInfoUtils;
import com.baosight.hggp.util.LogUtils; import com.baosight.hggp.util.LogUtils;
import com.baosight.iplat4j.core.ei.EiBlock;
import com.baosight.iplat4j.core.ei.EiConstant; import com.baosight.iplat4j.core.ei.EiConstant;
import com.baosight.iplat4j.core.ei.EiInfo; import com.baosight.iplat4j.core.ei.EiInfo;
import com.baosight.iplat4j.core.exception.PlatException; import com.baosight.iplat4j.core.exception.PlatException;
...@@ -21,6 +24,7 @@ import com.baosight.iplat4j.core.service.impl.ServiceBase; ...@@ -21,6 +24,7 @@ import com.baosight.iplat4j.core.service.impl.ServiceBase;
import com.baosight.iplat4j.ed.util.SequenceGenerator; import com.baosight.iplat4j.ed.util.SequenceGenerator;
import java.util.*; import java.util.*;
import java.util.stream.Collectors;
/** /**
...@@ -43,6 +47,30 @@ public class ServiceHGSC001D extends ServiceBase { ...@@ -43,6 +47,30 @@ public class ServiceHGSC001D extends ServiceBase {
EiInfoUtils.addBlock(inInfo,"roleCompany", UserSessionUtils.getRoleCompany(), Company.class); EiInfoUtils.addBlock(inInfo,"roleCompany", UserSessionUtils.getRoleCompany(), Company.class);
EiInfoUtils.addBlock(inInfo,"depByCompany", UserSessionUtils.getDepByCompany((String) resultMap.get(HGSC001.FIELD_company_code)), Dept.class); EiInfoUtils.addBlock(inInfo,"depByCompany", UserSessionUtils.getDepByCompany((String) resultMap.get(HGSC001.FIELD_company_code)), Dept.class);
EiInfoUtils.addBlock(inInfo,"userAll", HGXSTools.XsUser.listAll(UserSessionUtils.getAccountCode()), User.class); EiInfoUtils.addBlock(inInfo,"userAll", HGXSTools.XsUser.listAll(UserSessionUtils.getAccountCode()), User.class);
Map map1 = new HashMap<>();
map1.put("status", CommonConstant.YesNo.YES_1);
map1.put(HGSC001.FIELD_account_code, map.get(HGSC001.FIELD_account_code));
List<HGPZ001> list = DaoBase.getInstance().query(HGPZ001.QUERY,map);
List<HGPZ001> list1 = Optional.ofNullable(list).orElse(new ArrayList<>()).stream().filter(hgpz001 -> "分支单位".equals(hgpz001.getCustTypeName())).collect(Collectors.toList());
if (list1.size() > 0){
list1 = list1.stream().filter(hgpz001 -> "分支单位".equals(hgpz001.getCustTypeName())).collect(Collectors.toList());
List<String> custTypeList = list1.stream().map(HGPZ001::getCustType).collect(Collectors.toList());
CommonMethod.initBlock(inInfo, Arrays.asList(DdynamicEnum.CUSTOMER_RECORD_BLOCK_ID),
new HashMap<String, Object>(){{put("custTypes", custTypeList);}},false);
List<Map> info = inInfo.getBlock("customer_record_block_id").getRows();
EiBlock block = new EiBlock("customer1_record_block_id");
block.setRows(info);
inInfo.setBlock(block);
CommonMethod.comboBoxDefaultValue(inInfo,"customer1_record_block_id");
}
List<HGPZ001> list2 = Optional.ofNullable(list).orElse(new ArrayList<>()).stream().filter(hgpz001 -> !"分支单位".equals(hgpz001.getCustTypeName())).collect(Collectors.toList());
if (list2.size() > 0){
list2 = list2.stream().filter(hgpz001 -> !"分支单位".equals(hgpz001.getCustTypeName())).collect(Collectors.toList());
List<String> custTypeList = list2.stream().map(HGPZ001::getCustType).collect(Collectors.toList());
CommonMethod.initBlock(inInfo, Arrays.asList(DdynamicEnum.CUSTOMER_RECORD_BLOCK_ID),
new HashMap<String, Object>(){{put("custTypes", custTypeList);}},false);
CommonMethod.comboBoxDefaultValue(inInfo,DdynamicEnum.CUSTOMER_RECORD_BLOCK_ID.getBlockId());
}
} catch (PlatException e) { } catch (PlatException e) {
LogUtils.setDetailMsg(inInfo, e, "初始化失败"); LogUtils.setDetailMsg(inInfo, e, "初始化失败");
} catch (InstantiationException e) { } catch (InstantiationException e) {
......
...@@ -2,7 +2,9 @@ package com.baosight.hggp.hg.sc.service; ...@@ -2,7 +2,9 @@ package com.baosight.hggp.hg.sc.service;
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.DaoBase;
import com.baosight.hggp.core.security.UserSessionUtils; import com.baosight.hggp.core.security.UserSessionUtils;
import com.baosight.hggp.hg.pz.domain.HGPZ001;
import com.baosight.hggp.hg.sc.domain.HGSC001; import com.baosight.hggp.hg.sc.domain.HGSC001;
import com.baosight.hggp.hg.sc.domain.HGSC001A; import com.baosight.hggp.hg.sc.domain.HGSC001A;
import com.baosight.hggp.hg.sc.tools.HGSCTools; import com.baosight.hggp.hg.sc.tools.HGSCTools;
...@@ -14,15 +16,14 @@ import com.baosight.hggp.util.CommonMethod; ...@@ -14,15 +16,14 @@ import com.baosight.hggp.util.CommonMethod;
import com.baosight.hggp.util.EiInfoUtils; import com.baosight.hggp.util.EiInfoUtils;
import com.baosight.hggp.util.LogUtils; import com.baosight.hggp.util.LogUtils;
import com.baosight.hggp.util.MapUtils; import com.baosight.hggp.util.MapUtils;
import com.baosight.iplat4j.core.ei.EiBlock;
import com.baosight.iplat4j.core.ei.EiConstant; import com.baosight.iplat4j.core.ei.EiConstant;
import com.baosight.iplat4j.core.ei.EiInfo; import com.baosight.iplat4j.core.ei.EiInfo;
import com.baosight.iplat4j.core.exception.PlatException; import com.baosight.iplat4j.core.exception.PlatException;
import com.baosight.iplat4j.core.service.impl.ServiceBase; import com.baosight.iplat4j.core.service.impl.ServiceBase;
import java.util.Arrays; import java.util.*;
import java.util.HashMap; import java.util.stream.Collectors;
import java.util.List;
import java.util.Map;
/** /**
...@@ -45,6 +46,30 @@ public class ServiceHGSC001U extends ServiceBase { ...@@ -45,6 +46,30 @@ public class ServiceHGSC001U extends ServiceBase {
EiInfoUtils.addBlock(inInfo,"roleCompany", UserSessionUtils.getRoleCompany(), Company.class); EiInfoUtils.addBlock(inInfo,"roleCompany", UserSessionUtils.getRoleCompany(), Company.class);
EiInfoUtils.addBlock(inInfo,"depByCompany", UserSessionUtils.getDepByCompany((String) resultMap.get(HGSC001.FIELD_company_code)), Dept.class); EiInfoUtils.addBlock(inInfo,"depByCompany", UserSessionUtils.getDepByCompany((String) resultMap.get(HGSC001.FIELD_company_code)), Dept.class);
EiInfoUtils.addBlock(inInfo,"userAll", HGXSTools.XsUser.listAll(UserSessionUtils.getAccountCode()), User.class); EiInfoUtils.addBlock(inInfo,"userAll", HGXSTools.XsUser.listAll(UserSessionUtils.getAccountCode()), User.class);
Map map1 = new HashMap<>();
map1.put("status", CommonConstant.YesNo.YES_1);
map1.put(HGSC001.FIELD_account_code, map.get(HGSC001.FIELD_account_code));
List<HGPZ001> list = DaoBase.getInstance().query(HGPZ001.QUERY,map);
List<HGPZ001> list1 = Optional.ofNullable(list).orElse(new ArrayList<>()).stream().filter(hgpz001 -> "分支单位".equals(hgpz001.getCustTypeName())).collect(Collectors.toList());
if (list1.size() > 0){
list1 = list1.stream().filter(hgpz001 -> "分支单位".equals(hgpz001.getCustTypeName())).collect(Collectors.toList());
List<String> custTypeList = list1.stream().map(HGPZ001::getCustType).collect(Collectors.toList());
CommonMethod.initBlock(inInfo, Arrays.asList(DdynamicEnum.CUSTOMER_RECORD_BLOCK_ID),
new HashMap<String, Object>(){{put("custTypes", custTypeList);}},false);
List<Map> info = inInfo.getBlock("customer_record_block_id").getRows();
EiBlock block = new EiBlock("customer1_record_block_id");
block.setRows(info);
inInfo.setBlock(block);
CommonMethod.comboBoxDefaultValue(inInfo,"customer1_record_block_id");
}
List<HGPZ001> list2 = Optional.ofNullable(list).orElse(new ArrayList<>()).stream().filter(hgpz001 -> !"分支单位".equals(hgpz001.getCustTypeName())).collect(Collectors.toList());
if (list2.size() > 0){
list2 = list2.stream().filter(hgpz001 -> !"分支单位".equals(hgpz001.getCustTypeName())).collect(Collectors.toList());
List<String> custTypeList = list2.stream().map(HGPZ001::getCustType).collect(Collectors.toList());
CommonMethod.initBlock(inInfo, Arrays.asList(DdynamicEnum.CUSTOMER_RECORD_BLOCK_ID),
new HashMap<String, Object>(){{put("custTypes", custTypeList);}},false);
CommonMethod.comboBoxDefaultValue(inInfo,DdynamicEnum.CUSTOMER_RECORD_BLOCK_ID.getBlockId());
}
} catch (PlatException e) { } catch (PlatException e) {
LogUtils.setDetailMsg(inInfo, e, "初始化失败"); LogUtils.setDetailMsg(inInfo, e, "初始化失败");
} catch (InstantiationException e) { } catch (InstantiationException e) {
......
...@@ -4,8 +4,11 @@ import com.baosight.hggp.aspect.annotation.OperationLogAnnotation; ...@@ -4,8 +4,11 @@ import com.baosight.hggp.aspect.annotation.OperationLogAnnotation;
import com.baosight.hggp.common.DdynamicEnum; import com.baosight.hggp.common.DdynamicEnum;
import com.baosight.hggp.common.InventTypeDetailEnum; import com.baosight.hggp.common.InventTypeDetailEnum;
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.DaoUtils; import com.baosight.hggp.core.dao.DaoUtils;
import com.baosight.hggp.core.security.UserSessionUtils; import com.baosight.hggp.core.security.UserSessionUtils;
import com.baosight.hggp.hg.kc.domain.HGKC010;
import com.baosight.hggp.hg.kc.tools.HGKCTools;
import com.baosight.hggp.hg.pz.domain.HGPZ004; import com.baosight.hggp.hg.pz.domain.HGPZ004;
import com.baosight.hggp.hg.pz.domain.HGPZ005; import com.baosight.hggp.hg.pz.domain.HGPZ005;
import com.baosight.hggp.hg.sc.domain.HGSC010; import com.baosight.hggp.hg.sc.domain.HGSC010;
...@@ -20,11 +23,13 @@ import com.baosight.iplat4j.core.ei.EiInfo; ...@@ -20,11 +23,13 @@ import com.baosight.iplat4j.core.ei.EiInfo;
import com.baosight.iplat4j.core.exception.PlatException; import com.baosight.iplat4j.core.exception.PlatException;
import com.baosight.iplat4j.core.resource.I18nMessages; import com.baosight.iplat4j.core.resource.I18nMessages;
import com.baosight.iplat4j.core.service.impl.ServiceEPBase; import com.baosight.iplat4j.core.service.impl.ServiceEPBase;
import org.apache.commons.collections.CollectionUtils;
import java.util.Arrays; 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;
import java.util.stream.Collectors;
/** /**
* @author LiuYang * @author LiuYang
...@@ -99,10 +104,20 @@ public class ServiceHGSC010B extends ServiceEPBase { ...@@ -99,10 +104,20 @@ public class ServiceHGSC010B extends ServiceEPBase {
HGSC010 hgsc010 = HGSCTools.Hgsc010.getById(Long.parseLong(queryMap.get("parentId").toString())); HGSC010 hgsc010 = HGSCTools.Hgsc010.getById(Long.parseLong(queryMap.get("parentId").toString()));
AssertUtils.isTrue(hgsc010.getSubStatus().equals(CommonConstant.YesNo.YES_1), "当前委外任务已提交,不允许修改保存!"); AssertUtils.isTrue(hgsc010.getSubStatus().equals(CommonConstant.YesNo.YES_1), "当前委外任务已提交,不允许修改保存!");
List<Map> resultRows = inInfo.getBlock(CommonConstant.Field.DETAIL).getRows(); List<Map> resultRows = inInfo.getBlock(CommonConstant.Field.DETAIL).getRows();
List<String> inventCodes =resultRows.stream().map(map -> map.get(HGSC010B.FIELD_INVENT_CODE).toString()).distinct().collect(Collectors.toList());
Map paramMap = new HashMap();
paramMap.put("companyCode", hgsc010.getCompanyCode());
paramMap.put("inventCodes", inventCodes);
List<HGKC010> results = DaoBase.getInstance().query(HGKC010.QUERY, paramMap);
// 写入数据 // 写入数据
for (Map resultRow : resultRows) { for (Map resultRow : resultRows) {
HGSC010B hgsc010B = new HGSC010B(); HGSC010B hgsc010B = new HGSC010B();
hgsc010B.fromMap(resultRow); hgsc010B.fromMap(resultRow);
List<HGKC010> kc010 = results.stream().filter(hgkc010 -> hgkc010.getInventCode().equals(hgsc010B.getInventCode())).collect(Collectors.toList());
AssertUtils.isEmpty(kc010, "库存不足!");
if (kc010.get(0).getInvQty().compareTo(hgsc010B.getPcsQty()) < 0) {
throw new PlatException("库存不足,无法保存!");
}
if (hgsc010B.getId() == null || hgsc010B.getId() == 0) { if (hgsc010B.getId() == null || hgsc010B.getId() == 0) {
hgsc010B.setCompanyCode(queryMap.get("companyCode").toString()); hgsc010B.setCompanyCode(queryMap.get("companyCode").toString());
hgsc010B.setCompanyName(queryMap.get("companyName").toString()); hgsc010B.setCompanyName(queryMap.get("companyName").toString());
......
package com.baosight.hggp.hg.sc.service;
import com.baosight.hggp.aspect.annotation.OperationLogAnnotation;
import com.baosight.hggp.common.DdynamicEnum;
import com.baosight.hggp.common.InventTypeDetailEnum;
import com.baosight.hggp.core.constant.CommonConstant;
import com.baosight.hggp.core.security.UserSessionUtils;
import com.baosight.hggp.hg.pz.domain.HGPZ004;
import com.baosight.hggp.hg.sc.domain.HGSC010;
import com.baosight.hggp.hg.xs.domain.Company;
import com.baosight.hggp.hg.yx.domain.HGYX001;
import com.baosight.hggp.hg.yx.domain.HGYX001C;
import com.baosight.hggp.util.*;
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.exception.PlatException;
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/10/19
* @description
*/
public class ServiceHGSC010C extends ServiceEPBase {
@Override
public EiInfo initLoad(EiInfo inInfo) {
try {
inInfo.setCell(EiConstant.queryBlock, ACConstants.ROW_CODE_0, HGYX001C.FIELD_DELETE_FLAG, CommonConstant.YesNo.NO_0);
String inventCodes = inInfo.getCellStr(EiConstant.queryBlock, ACConstants.ROW_CODE_0, "inventCodes");
if (StringUtils.isNotEmpty(inventCodes)) {
String[] specIdArray = inventCodes.split(",");
inInfo.setCell(EiConstant.queryBlock, ACConstants.ROW_CODE_0, "inventCodes", specIdArray);
}
inInfo.setCell(EiConstant.queryBlock, ACConstants.ROW_CODE_0, HGPZ004.FIELD_INVENT_TYPE_DETAILS, InventTypeDetailEnum.getProdTypeFour());
inInfo = super.query(inInfo, HGYX001C.QUERY, new HGYX001C());
Map<String, Object> queryMap = new HashMap<>();
queryMap.put(HGPZ004.FIELD_INVENT_TYPE_DETAILS, InventTypeDetailEnum.getProdTypeFour());
CommonMethod.initBlock(inInfo,
Arrays.asList(
DdynamicEnum.INVENT_TYPE_BLOCK_ID,
DdynamicEnum.INVENT_RECORD_BLOCK_ID,
DdynamicEnum.SPEC_NAME_BLOCK_ID,
DdynamicEnum.WH_RECORD_BLOCK_ID), queryMap);
EiInfoUtils.addBlock(inInfo,"roleCompany", UserSessionUtils.getRoleCompany(), Company.class);
} catch (Exception e) {
LogUtils.setDetailMsg(inInfo, e, "初始化失败");
}
return inInfo;
}
/**
* 查询
*
* @param inInfo
* @return
*/
@OperationLogAnnotation(operModul = "委外加工", operType = "查询", operDesc = "查询")
@Override
public EiInfo query(EiInfo inInfo) {
try {
Map queryMap = EiInfoUtils.getFirstRow(inInfo);
queryMap.put(HGYX001.FIELD_DELETE_FLAG, CommonConstant.YesNo.NO_0);
queryMap.put(HGPZ004.FIELD_INVENT_TYPE_DETAILS, InventTypeDetailEnum.getProdTypeFour());
return super.query(inInfo, HGYX001C.QUERY,new HGYX001C());
} catch (PlatException e) {
LogUtils.setDetailMsg(inInfo, e, "查询失败");
}
return inInfo;
}
}
package com.baosight.hggp.hg.sc.service;
import com.baosight.hggp.aspect.annotation.OperationLogAnnotation;
import com.baosight.hggp.core.dao.DaoUtils;
import com.baosight.hggp.hg.sc.domain.HGSC010D;
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.exception.PlatException;
import com.baosight.iplat4j.core.service.impl.ServiceEPBase;
import java.util.List;
import java.util.Map;
/**
* @author:songx
* @date:2024/10/21,11:07
*/
public class ServiceHGSC010D extends ServiceEPBase {
/**
* 初始化
*
* @param inInfo
* @return
*/
@Override
public EiInfo initLoad(EiInfo inInfo) {
try {
inInfo.addBlock(EiConstant.resultBlock).addBlockMeta(new HGSC010D().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);
return super.query(inInfo, HGSC010D.QUERY, new HGSC010D());
} catch (PlatException e) {
LogUtils.setDetailMsg(inInfo, e, "查询失败");
}
return inInfo;
}
/**
* 删除
*
* @param inInfo
* @return
*/
public EiInfo remove(EiInfo inInfo) {
try {
List<HGSC010D> fSc010Ds = MapUtils.toDaoEPBases(inInfo, HGSC010D.class);
for (HGSC010D fSc010D : fSc010Ds) {
DaoUtils.insert(HGSC010D.DELETE, fSc010D.toMap());
}
inInfo = this.query(inInfo);
inInfo.setMsg("操作成功!本次对[" + fSc010Ds.size() + "]条数据删除成功!");
} catch (PlatException e) {
LogUtils.setDetailMsg(inInfo, e, "删除失败");
}
return inInfo;
}
}
package com.baosight.hggp.hg.sc.service;
import com.baosight.hggp.aspect.annotation.OperationLogAnnotation;
import com.baosight.hggp.core.constant.CommonConstant;
import com.baosight.hggp.core.dao.DaoUtils;
import com.baosight.hggp.core.security.UserSessionUtils;
import com.baosight.hggp.hg.sc.domain.HGSC010D;
import com.baosight.hggp.hg.wd.constant.HgWdConstant;
import com.baosight.hggp.hg.wd.domain.HGWD001;
import com.baosight.hggp.hg.wd.domain.HGWD002;
import com.baosight.hggp.hg.wd.utils.HgWdUtils;
import com.baosight.hggp.hg.xs.domain.User;
import com.baosight.hggp.util.AssertUtils;
import com.baosight.hggp.util.EiInfoUtils;
import com.baosight.hggp.util.LogUtils;
import com.baosight.hggp.util.MapUtils;
import com.baosight.hggp.util.StringUtils;
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.ServiceEPBase;
import java.util.List;
import java.util.Map;
/**
* @author:songx
* @date:2024/10/21,11:07
*/
public class ServiceHGSC010D1 extends ServiceEPBase {
/**
* 初始化
*
* @param inInfo
* @return
*/
@Override
public EiInfo initLoad(EiInfo inInfo) {
try {
inInfo.addBlock(EiConstant.resultBlock).addBlockMeta(new HGSC010D().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);
// 未选择文件目录时,返回空
String fileId = MapUtils.getString(queryRow, HGWD001.FIELD_FILE_ID);
if (StringUtils.isBlank(fileId)) {
return inInfo;
}
String parentId = MapUtils.getString(queryRow, HGWD001.FIELD_PARENT_ID);
String projCode = MapUtils.getString(queryRow, HGWD001.FIELD_PROJ_CODE);
// 判断是否备件制造图
boolean isSpare = HgWdUtils.HgWd001.isSpare(parentId, projCode);
// 仅查询已发布的文件
queryRow.put(HGWD001.FIELD_STATUS, HgWdConstant.FileStatus.S_1);
// 管理员、开放目录不做权限验证
if (!(isSpare || HgWdUtils.HgWd009.isManager())) {
queryRow.put(User.FIELD_USER_ID, UserSessionUtils.getUserId());
}
inInfo = super.query(inInfo, HGWD002.QUERY, new HGWD002());
} catch (PlatException e) {
LogUtils.setDetailMsg(inInfo, e, "查询失败");
}
return inInfo;
}
/**
* 确认
*
* @param inInfo
* @return
*/
public EiInfo confirm(EiInfo inInfo) {
try {
Map queryMap = EiInfoUtils.getFirstRow(inInfo);
String contractCode = MapUtils.getString(queryMap, HGSC010D.FIELD_CONTRACT_CODE);
AssertUtils.isEmpty(contractCode, "请先选择委托单");
List<HGSC010D> fSc010Ds = MapUtils.toDaoEPBases(inInfo, HGSC010D.class);
for (HGSC010D fSc010D : fSc010Ds) {
fSc010D.setContractCode(contractCode);
fSc010D.setDeleteFlag(CommonConstant.YesNo.NO_0);
DaoUtils.insert(HGSC010D.INSERT, fSc010D);
}
inInfo.setMsg("操作成功!本次对[" + fSc010Ds.size() + "]条数据新增成功!");
} catch (Exception e) {
LogUtils.setMsg(inInfo, e, "新增失败");
}
return inInfo;
}
}
...@@ -32,7 +32,8 @@ ...@@ -32,7 +32,8 @@
permiss_start_date as "permissStartDate", <!-- 准许开工日期 --> permiss_start_date as "permissStartDate", <!-- 准许开工日期 -->
start_date as "startDate", <!-- 开工日期 --> start_date as "startDate", <!-- 开工日期 -->
end_date as "endDate", <!-- 完工日期 --> end_date as "endDate", <!-- 完工日期 -->
project_source as "projectSource" <!-- 项目来源 --> project_source as "projectSource", <!-- 项目来源 -->
branch_unit as "branchUnit" <!-- 分公司 -->
</sql> </sql>
<sql id="condition"> <sql id="condition">
...@@ -118,6 +119,9 @@ ...@@ -118,6 +119,9 @@
<isNotEmpty prepend=" AND " property="projectSource"> <isNotEmpty prepend=" AND " property="projectSource">
project_source = #projectSource# project_source = #projectSource#
</isNotEmpty> </isNotEmpty>
<isNotEmpty prepend=" AND " property="branchUnit">
branch_unit = #branchUnit#
</isNotEmpty>
</sql> </sql>
<sql id="customCondition"> <sql id="customCondition">
...@@ -185,13 +189,14 @@ ...@@ -185,13 +189,14 @@
updated_name, <!-- 修改人名称 --> updated_name, <!-- 修改人名称 -->
updated_time, <!-- 更新时间 --> updated_time, <!-- 更新时间 -->
contract_no, <!-- 合同号 --> contract_no, <!-- 合同号 -->
project_source project_source,
branch_unit
) )
VALUES (#id#, #companyCode#, #companyName#, #depCode#, #depName#, #subcontractCode#, #subcontractName#, VALUES (#id#, #companyCode#, #companyName#, #depCode#, #depName#, #subcontractCode#, #subcontractName#,
#genralContractCode#, #genralContractName#, #partyPmName#, #partyPmHpone#, #contractName#, #contractWorkTxt#, #genralContractCode#, #genralContractName#, #partyPmName#, #partyPmHpone#, #contractName#, #contractWorkTxt#,
#projCode#, #projName#, #projType#, #projStatus#, #approvalStatus#, #permissStartDate#, #startDate#, #endDate#, #projCode#, #projName#, #projType#, #projStatus#, #approvalStatus#, #permissStartDate#, #startDate#, #endDate#,
#accountCode#, #createdBy#, #createdName#, #createdTime#, #updatedBy#, #updatedName#, #updatedTime#, #accountCode#, #createdBy#, #createdName#, #createdTime#, #updatedBy#, #updatedName#, #updatedTime#,
#contractNo#, #projectSource#) #contractNo#, #projectSource#, #branchUnit#)
<selectKey resultClass="long" keyProperty="id"> <selectKey resultClass="long" keyProperty="id">
SELECT MAX(ID) AS "id" FROM ${hggpSchema}.HGSC001 SELECT MAX(ID) AS "id" FROM ${hggpSchema}.HGSC001
</selectKey> </selectKey>
...@@ -233,7 +238,8 @@ ...@@ -233,7 +238,8 @@
end_date = #endDate#, <!-- 完工日期 --> end_date = #endDate#, <!-- 完工日期 -->
updated_by = #updatedBy#, <!-- 更新人 --> updated_by = #updatedBy#, <!-- 更新人 -->
updated_name = #updatedName#, <!-- 修改人名称 --> updated_name = #updatedName#, <!-- 修改人名称 -->
updated_time = #updatedTime# <!-- 更新时间 --> updated_time = #updatedTime#, <!-- 更新时间 -->
branch_unit = #branchUnit#
WHERE id = #id# WHERE id = #id#
</update> </update>
......
...@@ -950,6 +950,7 @@ ...@@ -950,6 +950,7 @@
a.finish_date as completeDate, a.finish_date as completeDate,
ROUND(ifnull(sum(a.total_weight),0)/1000, 4) as totalWeight, ROUND(ifnull(sum(a.total_weight),0)/1000, 4) as totalWeight,
ROUND(ifnull(sum(a.finish_weight),0)/1000, 4) as finishWeight, ROUND(ifnull(sum(a.finish_weight),0)/1000, 4) as finishWeight,
ROUND(ifnull(sum(a.finish_weight),0) / ifnull(sum(a.total_weight),0) / 1000, 4)*100 as schedule,
a.updated_time as updatedTime a.updated_time as updatedTime
from ( from (
select select
...@@ -1066,7 +1067,7 @@ ...@@ -1066,7 +1067,7 @@
</isNotEmpty> </isNotEmpty>
group by h2.process_code group by h2.process_code
) B on A.process_code = B.process_code ) B on A.process_code = B.process_code
where 1=1 where 1=1
<isNotEmpty prepend=" AND " property="accountCode"> <isNotEmpty prepend=" AND " property="accountCode">
A.account_code = #accountCode# A.account_code = #accountCode#
</isNotEmpty> </isNotEmpty>
...@@ -1098,10 +1099,13 @@ ...@@ -1098,10 +1099,13 @@
</isNotEmpty> </isNotEmpty>
group by h2.process_code group by h2.process_code
) B on A.process_code = B.process_code ) B on A.process_code = B.process_code
where 1=1 where 1=1
<isNotEmpty prepend=" AND " property="accountCode"> <isNotEmpty prepend=" AND " property="accountCode">
A.account_code = #accountCode# A.account_code = #accountCode#
</isNotEmpty> </isNotEmpty>
<isNotEmpty prepend=" AND " property="processNames">
A.process_name IN <iterate close=")" open="(" conjunction="," property="processNames">#processNames[]#</iterate>
</isNotEmpty>
<isNotEmpty prepend=" AND " property="factoryName"> <isNotEmpty prepend=" AND " property="factoryName">
C.factory_name = #factoryName# C.factory_name = #factoryName#
</isNotEmpty> </isNotEmpty>
......
...@@ -32,7 +32,9 @@ ...@@ -32,7 +32,9 @@
REMAINING_QTY as "remainingQty", <!-- 剩余数量 --> REMAINING_QTY as "remainingQty", <!-- 剩余数量 -->
REMAINING_UNIT_WEIGHT as "remainingUnitWeight", <!-- 剩余单量 --> REMAINING_UNIT_WEIGHT as "remainingUnitWeight", <!-- 剩余单量 -->
REMAINING_WEIGHT as "remainingWeight", <!-- 剩余重量 --> REMAINING_WEIGHT as "remainingWeight", <!-- 剩余重量 -->
DELIVER_QTY as "deliverQty" <!-- 退货数量 --> DELIVER_QTY as "deliverQty", <!-- 退货数量 -->
INVENT_CODE as "inventCode", <!-- 原料编码 -->
INVENT_NAME as "inventName" <!-- 原料名称 -->
</sql> </sql>
<sql id="condition"> <sql id="condition">
...@@ -129,6 +131,12 @@ ...@@ -129,6 +131,12 @@
COMPANY_CODE = #companyCode# COMPANY_CODE = #companyCode#
</isNotEmpty>) </isNotEmpty>)
</isNotEmpty> </isNotEmpty>
<isNotEmpty prepend=" AND " property="inventCode">
INVENT_CODE = #inventCode#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="inventName">
INVENT_NAME like #inventName#
</isNotEmpty>
</sql> </sql>
<sql id="idCondition"> <sql id="idCondition">
...@@ -186,12 +194,14 @@ ...@@ -186,12 +194,14 @@
DEPOSIT_WEIGHT, <!-- 入库重量 --> DEPOSIT_WEIGHT, <!-- 入库重量 -->
REMAINING_QTY, <!-- 剩余数量 --> REMAINING_QTY, <!-- 剩余数量 -->
REMAINING_UNIT_WEIGHT, REMAINING_UNIT_WEIGHT,
REMAINING_WEIGHT <!-- 剩余重量 --> REMAINING_WEIGHT, <!-- 剩余重量 -->
INVENT_CODE, <!-- 原料编码 -->
INVENT_NAME <!-- 原料名称 -->
) )
VALUES (#id#, #accountCode#, #depCode#, #createdBy#, #createdName#, #createdTime#, #deleteFlag#, VALUES (#id#, #accountCode#, #depCode#, #createdBy#, #createdName#, #createdTime#, #deleteFlag#,
#companyCode#, #companyName#, #parentId#, #contractCode#, #inventType#, #companyCode#, #companyName#, #parentId#, #contractCode#, #inventType#,
#productCode#, #productName#, #specId#, #spec#, #unit#, #pcsQty#, #pcsUnitWeight#, #pcsWeight#, #depositQty#, #depositUnitWeight#, #depositWeight#, #productCode#, #productName#, #specId#, #spec#, #unit#, #pcsQty#, #pcsUnitWeight#, #pcsWeight#, #depositQty#, #depositUnitWeight#, #depositWeight#,
#remainingQty#, #remainingUnitWeight#, #remainingWeight#) #remainingQty#, #remainingUnitWeight#, #remainingWeight#, #inventCode#, #inventName#)
</insert> </insert>
<delete id="delete"> <delete id="delete">
...@@ -227,7 +237,9 @@ ...@@ -227,7 +237,9 @@
DEPOSIT_WEIGHT = #depositWeight#, <!-- 入库重量 --> DEPOSIT_WEIGHT = #depositWeight#, <!-- 入库重量 -->
REMAINING_QTY = #remainingQty#, <!-- 剩余数量 --> REMAINING_QTY = #remainingQty#, <!-- 剩余数量 -->
REMAINING_UNIT_WEIGHT = #remainingUnitWeight#, REMAINING_UNIT_WEIGHT = #remainingUnitWeight#,
REMAINING_WEIGHT = #remainingWeight# <!-- 剩余重量 --> REMAINING_WEIGHT = #remainingWeight#, <!-- 剩余重量 -->
INVENT_CODE = #inventCode#, <!-- 原料编码 -->
INVENT_NAME = #inventName# <!-- 原料名称 -->
WHERE WHERE
ID = #id# ID = #id#
</update> </update>
......
<?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="HGSC010D">
<sql id="column">
T.ID as "id", <!-- ID -->
T.ACCOUNT_CODE as "accountCode", <!-- 账套 -->
T.DEP_CODE as "depCode", <!-- 部门编码 -->
T.CREATED_BY as "createdBy", <!-- 创建人 -->
T.CREATED_NAME as "createdName", <!-- 创建人名称 -->
T.CREATED_TIME as "createdTime", <!-- 创建时间 -->
T.UPDATED_BY as "updatedBy", <!-- 修改人 -->
T.UPDATED_NAME as "updatedName", <!-- 修改人名称 -->
T.UPDATED_TIME as "updatedTime", <!-- 修改时间 -->
T.DELETE_FLAG as "deleteFlag", <!-- 是否删除 0-否1-是 -->
T.CONTRACT_CODE as "contractCode", <!-- 委托单号 -->
T.FILE_ID as "fileId", <!-- 目录ID -->
T.DOC_ID as "docId", <!-- 附件ID -->
T.DOC_NAME as "docName", <!-- 附件名称 -->
T.DOC_TYPE as "docType" <!-- 附件类型 -->
</sql>
<sql id="columnC">
C.PROJ_CODE as "projCode", <!-- 项目编码 -->
C.PROJ_NAME as "projName", <!-- 项目名称 -->
C.FILE_NAME as "fileName" <!-- 目录名称 -->
</sql>
<sql id="condition">
AND T.DELETE_FLAG = 0
<isNotEmpty prepend=" AND " property="id">
T.ID = #id#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="accountCode">
T.ACCOUNT_CODE = #accountCode#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="depCode">
T.DEP_CODE = #depCode#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="contractCode">
T.CONTRACT_CODE = #contractCode#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="fileId">
T.FILE_ID = #fileId#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="docId">
T.DOC_ID = #docId#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="docName">
T.DOC_NAME LIKE CONCAT('%', #docName#, '%')
</isNotEmpty>
</sql>
<sql id="orderBy">
<dynamic prepend="ORDER BY">
<isNotEmpty property="orderBy">
$orderBy$
</isNotEmpty>
<isEmpty property="orderBy">
T.ID DESC
</isEmpty>
</dynamic>
</sql>
<select id="query" resultClass="com.baosight.hggp.hg.sc.domain.HGSC010D">
SELECT
<include refid="column"/>,
<include refid="columnC"/>
FROM ${hggpSchema}.HGSC010D T, ${hggpSchema}.HGWD099 B, ${hggpSchema}.HGWD001 C
WHERE 1=1
AND T.DOC_ID = B.DOC_ID
AND B.BIZ_ID = C.FILE_ID
<include refid="condition"/>
<include refid="orderBy"/>
</select>
<select id="count" resultClass="int">
SELECT COUNT(*)
FROM ${hggpSchema}.HGSC010D T, ${hggpSchema}.HGWD099 B, ${hggpSchema}.HGWD001 C
WHERE 1=1
AND T.DOC_ID = B.DOC_ID
AND B.FILE_ID = C.FILE_ID
<include refid="condition"/>
</select>
<insert id="insert">
INSERT INTO ${hggpSchema}.HGSC010D (
ACCOUNT_CODE, <!-- 账套 -->
DEP_CODE, <!-- 部门编码 -->
CREATED_BY, <!-- 创建人 -->
CREATED_NAME, <!-- 创建人名称 -->
CREATED_TIME, <!-- 创建时间 -->
UPDATED_BY, <!-- 修改人 -->
UPDATED_NAME, <!-- 修改人名称 -->
UPDATED_TIME, <!-- 修改时间 -->
DELETE_FLAG, <!-- 是否删除 0-否1-是 -->
CONTRACT_CODE, <!-- 委托单号 -->
FILE_ID, <!-- 目录ID -->
DOC_ID, <!-- 附件ID -->
DOC_NAME, <!-- 附件名称 -->
DOC_TYPE
) VALUES (
#accountCode#, #depCode#, #createdBy#, #createdName#, #createdTime#,
#updatedBy#, #updatedName#, #updatedTime#, #deleteFlag#,
#contractCode#, #fileId#, #docId#, #docName#, #docType#
)
</insert>
<delete id="delete">
UPDATE ${hggpSchema}.HGSC010D SET DELETE_FLAG = 1 WHERE ID = #id#
</delete>
</sqlMap>
...@@ -181,9 +181,9 @@ public class HGSCTools { ...@@ -181,9 +181,9 @@ public class HGSCTools {
if(storageType.intValue() == HGConstant.StorageType.TH){ if(storageType.intValue() == HGConstant.StorageType.TH){
if(Objects.nonNull(rectificationId) && rectificationId.intValue() != 0){ if(Objects.nonNull(rectificationId) && rectificationId.intValue() != 0){
//更新整改通知单状态,工序质检单与整改通知单是2条入库单数据 //更新整改通知单状态,工序质检单与整改通知单是2条入库单数据
HGZL004 hgzl004 = HGZLTools.THGZL004.get(rectificationId); HGZL004 hgzl004 = HGZLTools.HgZl004.get(rectificationId);
hgzl004.setHandleStatus(HandleStatusEnum.UNPROCESS.getCode()); hgzl004.setHandleStatus(HandleStatusEnum.UNPROCESS.getCode());
DaoUtils.update(HGZL004.UPDATE,hgzl004); DaoUtils.update(com.baosight.hggp.hg.zl.domain.HGZL004.UPDATE,hgzl004);
}else{ }else{
//整改通知单id为空的入库单才是工序质检单生成的入库单。 //整改通知单id为空的入库单才是工序质检单生成的入库单。
//更新工序质检单状态 //更新工序质检单状态
...@@ -220,9 +220,9 @@ public class HGSCTools { ...@@ -220,9 +220,9 @@ public class HGSCTools {
HGZL002 hgzl002 = HGZLTools.THGZL002.get(checkId); HGZL002 hgzl002 = HGZLTools.THGZL002.get(checkId);
if(Objects.nonNull(rectificationId) && rectificationId.intValue() != 0){ if(Objects.nonNull(rectificationId) && rectificationId.intValue() != 0){
//更新整改通知单状态,工序质检单与整改通知单是2条入库单数据 //更新整改通知单状态,工序质检单与整改通知单是2条入库单数据
HGZL004 hgzl004 = HGZLTools.THGZL004.get(rectificationId); HGZL004 hgzl004 = HGZLTools.HgZl004.get(rectificationId);
hgzl004.setHandleStatus(HandleStatusEnum.UNPROCESS.getCode()); hgzl004.setHandleStatus(HandleStatusEnum.UNPROCESS.getCode());
DaoUtils.update(HGZL004.UPDATE,hgzl004); DaoUtils.update(com.baosight.hggp.hg.zl.domain.HGZL004.UPDATE,hgzl004);
}else{ }else{
//整改通知单id为空的入库单才是工序质检单生成的入库单。 //整改通知单id为空的入库单才是工序质检单生成的入库单。
//更新工序质检单状态 //更新工序质检单状态
......
...@@ -36,7 +36,7 @@ public class ServiceHGSJ002A extends ServiceEPBase { ...@@ -36,7 +36,7 @@ public class ServiceHGSJ002A extends ServiceEPBase {
//inInfo.setCell(EiConstant.queryBlock,ACConstants.ROW_CODE_0,HGPZ002A.FIELD_FLOW_CODE,inInfo.get("inqu_status-0-flowCode")); //inInfo.setCell(EiConstant.queryBlock,ACConstants.ROW_CODE_0,HGPZ002A.FIELD_FLOW_CODE,inInfo.get("inqu_status-0-flowCode"));
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();
EiInfo outInfo = super.query(inInfo, HGSJ002A.QUERY, new HGSJ002A()); EiInfo outInfo = super.query(inInfo, HGSJ002A.QUERY, new HGSJ002A());
CommonMethod.initBlock(outInfo, Arrays.asList(DdynamicEnum.COMPANY_BOX_BLOCK_ID,DdynamicEnum.PROCESS_CODE_BLOCK_ID), CommonMethod.initBlock(outInfo, Arrays.asList(DdynamicEnum.COMPANY_BOX_BLOCK_ID,DdynamicEnum.PROCESS_CODE_BLOCK_ID,DdynamicEnum.FLOW_CODE_BLOCK_ID),
new HashMap<String,Object>(){{ new HashMap<String,Object>(){{
put(HGSJ002A.FIELD_FACTORY_CODE,factoryCode); put(HGSJ002A.FIELD_FACTORY_CODE,factoryCode);
}}); }});
......
...@@ -251,4 +251,21 @@ ...@@ -251,4 +251,21 @@
ID = #id# ID = #id#
</update> </update>
<select id="queryFlowCodeBox" parameterClass="java.util.HashMap" resultClass="java.util.HashMap">
SELECT
FLOW_CODE as "flowCode", <!-- 流程编码 -->
FLOW_NAME as "flowName" <!-- 流程名称 -->
FROM ${hggpSchema}.HGGY002 WHERE 1=1 and STATUS = 1 and DELETE_FLAG = 0
<include refid="condition" />
<dynamic prepend="ORDER BY">
<isNotEmpty property="orderBy">
$orderBy$
</isNotEmpty>
<isEmpty property="orderBy">
FLOW_CODE desc
</isEmpty>
</dynamic>
</select>
</sqlMap> </sqlMap>
...@@ -40,6 +40,7 @@ public class HGWD003 extends DaoEPBase { ...@@ -40,6 +40,7 @@ public class HGWD003 extends DaoEPBase {
public static final String FIELD_EXT_ID = "extId"; /* 外部系统主键ID*/ public static final String FIELD_EXT_ID = "extId"; /* 外部系统主键ID*/
public static final String FIELD_ORG_ID = "orgId"; /* 部门编码*/ public static final String FIELD_ORG_ID = "orgId"; /* 部门编码*/
public static final String FIELD_ORG_CNAME = "orgCname"; /* 部门名称*/ public static final String FIELD_ORG_CNAME = "orgCname"; /* 部门名称*/
public static final String FIELD_DOWNLOAD_FLAG = "downloadFlag"; /* 是否可以下载,0=否,1=是*/
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"; /* 企业编码*/
...@@ -59,6 +60,7 @@ public class HGWD003 extends DaoEPBase { ...@@ -59,6 +60,7 @@ public class HGWD003 extends DaoEPBase {
public static final String COL_EXT_ID = "EXT_ID"; /* 外部系统主键ID*/ public static final String COL_EXT_ID = "EXT_ID"; /* 外部系统主键ID*/
public static final String COL_ORG_ID = "ORG_ID"; /* 部门编码*/ public static final String COL_ORG_ID = "ORG_ID"; /* 部门编码*/
public static final String COL_ORG_CNAME = "ORG_CNAME"; /* 部门名称*/ public static final String COL_ORG_CNAME = "ORG_CNAME"; /* 部门名称*/
public static final String COL_DOWNLOAD_FLAG = "DOWNLOAD_FLAG"; /* 是否可以下载,0=否,1=是*/
public static final String QUERY = "HGWD003.query"; public static final String QUERY = "HGWD003.query";
public static final String COUNT = "HGWD003.count"; public static final String COUNT = "HGWD003.count";
...@@ -84,6 +86,7 @@ public class HGWD003 extends DaoEPBase { ...@@ -84,6 +86,7 @@ public class HGWD003 extends DaoEPBase {
private String extId = " "; /* 外部系统主键ID*/ private String extId = " "; /* 外部系统主键ID*/
private String orgId = " "; /* 部门编码*/ private String orgId = " "; /* 部门编码*/
private String orgCname = " "; /* 部门名称*/ private String orgCname = " "; /* 部门名称*/
private Integer downloadFlag = 0; /* 是否可以下载,0=否,1=是*/
/** /**
* initialize the metadata. * initialize the metadata.
...@@ -163,7 +166,10 @@ public class HGWD003 extends DaoEPBase { ...@@ -163,7 +166,10 @@ public class HGWD003 extends DaoEPBase {
eiColumn = new EiColumn(FIELD_ORG_CNAME); eiColumn = new EiColumn(FIELD_ORG_CNAME);
eiColumn.setDescName("部门名称"); eiColumn.setDescName("部门名称");
eiMetadata.addMeta(eiColumn); eiMetadata.addMeta(eiColumn);
eiColumn = new EiColumn(FIELD_DOWNLOAD_FLAG);
eiColumn.setDescName("是否可以下载");
eiMetadata.addMeta(eiColumn);
} }
/** /**
...@@ -423,6 +429,14 @@ public class HGWD003 extends DaoEPBase { ...@@ -423,6 +429,14 @@ public class HGWD003 extends DaoEPBase {
this.orgCname = orgCname; this.orgCname = orgCname;
} }
public Integer getDownloadFlag() {
return downloadFlag;
}
public void setDownloadFlag(Integer downloadFlag) {
this.downloadFlag = downloadFlag;
}
/** /**
* get the value from Map. * get the value from Map.
* *
...@@ -449,6 +463,7 @@ public class HGWD003 extends DaoEPBase { ...@@ -449,6 +463,7 @@ public class HGWD003 extends DaoEPBase {
setExtId(StringUtils.defaultIfEmpty(StringUtils.toString(map.get(FIELD_EXT_ID)), extId)); setExtId(StringUtils.defaultIfEmpty(StringUtils.toString(map.get(FIELD_EXT_ID)), extId));
setOrgId(StringUtils.defaultIfEmpty(StringUtils.toString(map.get(FIELD_ORG_ID)), orgId)); setOrgId(StringUtils.defaultIfEmpty(StringUtils.toString(map.get(FIELD_ORG_ID)), orgId));
setOrgCname(StringUtils.defaultIfEmpty(StringUtils.toString(map.get(FIELD_ORG_CNAME)), orgCname)); setOrgCname(StringUtils.defaultIfEmpty(StringUtils.toString(map.get(FIELD_ORG_CNAME)), orgCname));
setDownloadFlag(NumberUtils.toInteger(StringUtils.toString(map.get(FIELD_DOWNLOAD_FLAG)), downloadFlag));
} }
/** /**
...@@ -476,7 +491,8 @@ public class HGWD003 extends DaoEPBase { ...@@ -476,7 +491,8 @@ public class HGWD003 extends DaoEPBase {
map.put(FIELD_EXT_ID, StringUtils.toString(extId, eiMetadata.getMeta(FIELD_EXT_ID))); map.put(FIELD_EXT_ID, StringUtils.toString(extId, eiMetadata.getMeta(FIELD_EXT_ID)));
map.put(FIELD_ORG_ID, StringUtils.toString(orgId, eiMetadata.getMeta(FIELD_ORG_ID))); map.put(FIELD_ORG_ID, StringUtils.toString(orgId, eiMetadata.getMeta(FIELD_ORG_ID)));
map.put(FIELD_ORG_CNAME, StringUtils.toString(orgCname, eiMetadata.getMeta(FIELD_ORG_CNAME))); map.put(FIELD_ORG_CNAME, StringUtils.toString(orgCname, eiMetadata.getMeta(FIELD_ORG_CNAME)));
map.put(FIELD_DOWNLOAD_FLAG, StringUtils.toString(downloadFlag, eiMetadata.getMeta(FIELD_DOWNLOAD_FLAG)));
return map; return map;
} }
} }
...@@ -311,6 +311,10 @@ public class ServiceHGWD001 extends ServiceEPBase { ...@@ -311,6 +311,10 @@ public class ServiceHGWD001 extends ServiceEPBase {
hgwd099.setStatus(HgWdConstant.FileStatus.S_0); hgwd099.setStatus(HgWdConstant.FileStatus.S_0);
hgwd099.setOperStatus(HgWdConstant.OperStatus.S_1); hgwd099.setOperStatus(HgWdConstant.OperStatus.S_1);
DaoUtils.insert(HGWD099.UPDATE, hgwd099); DaoUtils.insert(HGWD099.UPDATE, hgwd099);
if (Objects.nonNull(resultRow.get("changeContent")) || resultRow.get("changeContent").toString().trim().length()>0){
HGWDTools.HgWd006.add(hgwd099, hgwd001, resultRow.get("changeContent").toString());
}
} }
//获取文件下的权限人员 //获取文件下的权限人员
List<HGWD003> listByFile = HGWDTools.HgWd003.listByFile(hgwd001.getFileId()); List<HGWD003> listByFile = HGWDTools.HgWd003.listByFile(hgwd001.getFileId());
......
...@@ -308,9 +308,11 @@ public class ServiceHGWD001D extends TreeService { ...@@ -308,9 +308,11 @@ public class ServiceHGWD001D extends TreeService {
* @return * @return
*/ */
public List queryChildNode(String projCode, String parentId, String ename) { public List queryChildNode(String projCode, String parentId, String ename) {
String userId = UserSessionUtils.getLoginName();
// 查询项目来源 // 查询项目来源
HGSC001 dbSc001 = HGSCTools.Hgsc001.queryByCode(projCode); HGSC001 dbSc001 = HGSCTools.Hgsc001.queryByCode(projCode);
boolean isAuth = !ProjectSourceEnum.SPARE.getCode().equals(dbSc001.getProjectSource()); // true:需要权限
boolean isSourceAuth = !ProjectSourceEnum.SPARE.getCode().equals(dbSc001.getProjectSource());
List<Map> results = new ArrayList(); List<Map> results = new ArrayList();
Map queryMap = new HashMap(); Map queryMap = new HashMap();
queryMap.put("parentId", parentId); queryMap.put("parentId", parentId);
...@@ -320,17 +322,28 @@ public class ServiceHGWD001D extends TreeService { ...@@ -320,17 +322,28 @@ public class ServiceHGWD001D extends TreeService {
return results; return results;
} }
List<String> fileIds = dbWd001s.stream().map(HGWD001::getFileId).distinct().collect(Collectors.toList()); List<String> fileIds = dbWd001s.stream().map(HGWD001::getFileId).distinct().collect(Collectors.toList());
List<HGWD003> hgwd003s = HGWDTools.HgWd003.list(fileIds); // 查询目录授权人数
Map<String, List<HGWD003>> dbWd003Map = HGWDTools.HgWd003.map(fileIds);
for (HGWD001 dbWd001 : dbWd001s) { for (HGWD001 dbWd001 : dbWd001s) {
Map leafMap = buildLeaf(parentId, dbWd001.getFileId(), dbWd001.getFileName(), HgWdConstant.LeafType.C); Map leafMap = buildLeaf(parentId, dbWd001.getFileId(), dbWd001.getFileName(), HgWdConstant.LeafType.C);
Long count = hgwd003s.stream().filter(hgwd003 -> hgwd003.getFileId().equals(dbWd001.getFileId())).count(); // 已授权人员信息
List<HGWD003> dbWd003s = dbWd003Map == null ? null : dbWd003Map.get(dbWd001.getFileId());
leafMap.put("projCode", dbWd001.getProjCode()); leafMap.put("projCode", dbWd001.getProjCode());
leafMap.put("projName", dbWd001.getProjName()); leafMap.put("projName", dbWd001.getProjName());
leafMap.put("ename", dbWd001.getProjCode()); leafMap.put("ename", dbWd001.getProjCode());
leafMap.put("type", dbWd001.getFileType()); leafMap.put("type", dbWd001.getFileType());
leafMap.put("leafLevel", dbWd001.getLeafLevel()); leafMap.put("leafLevel", dbWd001.getLeafLevel());
leafMap.put("count", count); leafMap.put("count", dbWd003s == null ? 0 : dbWd003s.size());
leafMap.put("isAuth", isAuth ? "1" : "0"); if (isSourceAuth) {
leafMap.put("isAuth", "1");
// 从已授权的信息中查找出自己
HGWD003 dbWd003 = dbWd003s == null ? null : dbWd003s.stream().filter(item
-> item.getUserId().equals(userId)).findFirst().orElse(null);
leafMap.put("downloadFlag", dbWd003 == null ? "0" : dbWd003.getDownloadFlag());
} else {
leafMap.put("isAuth", "0");
leafMap.put("downloadFlag", "1");
}
results.add(leafMap); results.add(leafMap);
} }
// 设置叶子节点 // 设置叶子节点
......
...@@ -3,11 +3,9 @@ package com.baosight.hggp.hg.wd.service; ...@@ -3,11 +3,9 @@ package com.baosight.hggp.hg.wd.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.core.security.UserSessionUtils; import com.baosight.hggp.core.security.UserSessionUtils;
import com.baosight.hggp.hg.sc.enums.ProjectSourceEnum;
import com.baosight.hggp.hg.wd.constant.HgWdConstant; import com.baosight.hggp.hg.wd.constant.HgWdConstant;
import com.baosight.hggp.hg.wd.domain.HGWD001; import com.baosight.hggp.hg.wd.domain.HGWD001;
import com.baosight.hggp.hg.wd.domain.HGWD002; import com.baosight.hggp.hg.wd.domain.HGWD002;
import com.baosight.hggp.hg.wd.tools.HGWDTools;
import com.baosight.hggp.hg.wd.utils.HgWdUtils; import com.baosight.hggp.hg.wd.utils.HgWdUtils;
import com.baosight.hggp.hg.xs.domain.User; import com.baosight.hggp.hg.xs.domain.User;
import com.baosight.hggp.util.CommonMethod; import com.baosight.hggp.util.CommonMethod;
...@@ -79,12 +77,12 @@ public class ServiceHGWD002 extends ServiceBase { ...@@ -79,12 +77,12 @@ public class ServiceHGWD002 extends ServiceBase {
} }
return inInfo; return inInfo;
} }
public void builder(EiInfo eiInfo){ public void builder(EiInfo eiInfo) {
String[] orderBy = eiInfo.getBlock(EiConstant.resultBlock).getString("orderBy").split(","); String[] orderBy = eiInfo.getBlock(EiConstant.resultBlock).getString("orderBy").split(",");
if (orderBy.length>0){ if (orderBy.length > 0) {
StringBuilder orderByStr= new StringBuilder(); StringBuilder orderByStr = new StringBuilder();
for (int i = 0; i < orderBy.length; i++) { for (int i = 0; i < orderBy.length; i++) {
if (i != 0 && i != orderByStr.length() - 1) { if (i != 0 && i != orderByStr.length() - 1) {
orderByStr.append(","); orderByStr.append(",");
...@@ -139,15 +137,15 @@ public class ServiceHGWD002 extends ServiceBase { ...@@ -139,15 +137,15 @@ public class ServiceHGWD002 extends ServiceBase {
orderByStr.append(orderBy[i].replace("updatedTime desc", "b.updatedTime desc")); orderByStr.append(orderBy[i].replace("updatedTime desc", "b.updatedTime desc"));
break; break;
default: default:
if (!orderBy[i].isEmpty()){ if (!orderBy[i].isEmpty()) {
orderByStr.append(orderBy[i]); orderByStr.append(orderBy[i]);
}else { } else {
orderByStr.append(orderBy[i]); orderByStr.append(orderBy[i]);
} }
break; break;
} }
} }
eiInfo.getBlock(EiConstant.resultBlock).set("orderBy",orderByStr); eiInfo.getBlock(EiConstant.resultBlock).set("orderBy", orderByStr);
} }
} }
} }
...@@ -12,13 +12,11 @@ import com.baosight.hggp.hg.wd.constant.HgWdConstant; ...@@ -12,13 +12,11 @@ import com.baosight.hggp.hg.wd.constant.HgWdConstant;
import com.baosight.hggp.hg.wd.constant.HgWdSqlConstant; import com.baosight.hggp.hg.wd.constant.HgWdSqlConstant;
import com.baosight.hggp.hg.wd.domain.HGWD001; import com.baosight.hggp.hg.wd.domain.HGWD001;
import com.baosight.hggp.hg.wd.domain.HGWD003; import com.baosight.hggp.hg.wd.domain.HGWD003;
import com.baosight.hggp.hg.wd.tools.HGWDTools;
import com.baosight.hggp.hg.wd.utils.HgWdUtils; import com.baosight.hggp.hg.wd.utils.HgWdUtils;
import com.baosight.hggp.util.AssertUtils; import com.baosight.hggp.util.AssertUtils;
import com.baosight.hggp.util.EiInfoUtils; import com.baosight.hggp.util.EiInfoUtils;
import com.baosight.hggp.util.LogUtils; import com.baosight.hggp.util.LogUtils;
import com.baosight.hggp.util.MapUtils; import com.baosight.hggp.util.MapUtils;
import com.baosight.hggp.util.ObjectUtils;
import com.baosight.hggp.util.StringUtils; import com.baosight.hggp.util.StringUtils;
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;
......
package com.baosight.hggp.hg.wd.service;
import com.baosight.hggp.common.DdynamicEnum;
import com.baosight.hggp.core.dao.DaoUtils;
import com.baosight.hggp.core.enums.OrgTypeEnum;
import com.baosight.hggp.hg.wd.domain.HGWD001;
import com.baosight.hggp.hg.wd.domain.HGWD001A;
import com.baosight.hggp.hg.wd.domain.HGWD006;
import com.baosight.hggp.hg.xs.domain.Org;
import com.baosight.hggp.util.*;
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.service.impl.ServiceEPBase;
import java.util.Arrays;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
/**
* @author LiuYang
* @version 1.0 2024/10/22
* @description
*/
public class ServiceHGWD006 extends ServiceEPBase{
@Override
public EiInfo initLoad(EiInfo inInfo) {
try {
inInfo.addBlock(EiConstant.resultBlock).addBlockMeta(new HGWD006().eiMetadata);
}catch (Exception e){
LogUtils.setMsg(inInfo,e,"初始化失败");
}
return inInfo;
}
@Override
public EiInfo query(EiInfo inInfo) {
Map row = EiInfoUtils.getFirstRow(inInfo);
row.remove(HGWD006.FIELD_FILE_NAME);
row.remove(HGWD006.FIELD_DOC_NAME);
return super.query(inInfo, HGWD006.QUERY, new HGWD006());
}
@Override
public EiInfo update(EiInfo inInfo) {
return super.update(inInfo, HGWD006.UPDATE);
}
@Override
public EiInfo insert(EiInfo inInfo) {
try {
List<HGWD006> resultRows = MapUtils.toDaoEPBases(inInfo, HGWD006.class);
for (HGWD006 hgwd006: resultRows) {
if (StringUtils.isNotEmpty(hgwd006.getChangeContent())){
DaoUtils.insert(HGWD006.INSERT, hgwd006);
}
}
inInfo.setStatus(EiConstant.STATUS_DEFAULT);
inInfo.setMsg("操作成功!本次对[" + resultRows.size() + "]条数据保存成功!");
}catch (Exception e){
LogUtils.setMsg(inInfo,e,"新增失败");
}
return inInfo;
}
}
package com.baosight.hggp.hg.wd.service;
import com.baosight.hggp.aspect.annotation.OperationLogAnnotation;
import com.baosight.iplat4j.core.ei.EiInfo;
import com.baosight.iplat4j.core.service.impl.ServiceEPBase;
/**
* @author LiuYang
* @version 1.0 2024/10/22
* @description
*/
public class ServiceHGWD099B extends ServiceEPBase {
@OperationLogAnnotation(operModul = "附件上传",operType = "查询",operDesc = "初始化")
@Override
public EiInfo initLoad(EiInfo inInfo) {
return inInfo;
}
/**
* 附件上传.
*/
@OperationLogAnnotation(operModul = "附件上传",operType = "上传",operDesc = "附件上传")
public EiInfo form(EiInfo inInfo) {
return inInfo;
}
}
...@@ -17,7 +17,8 @@ ...@@ -17,7 +17,8 @@
A.USER_ID as "userId", <!-- 用户ID --> A.USER_ID as "userId", <!-- 用户ID -->
A.REMARK as "remark", <!-- 备注 --> A.REMARK as "remark", <!-- 备注 -->
A.IS_PROJECT_MANAGER as "isProjectManager", <!-- 是否项目经理,0=否,1=是 --> A.IS_PROJECT_MANAGER as "isProjectManager", <!-- 是否项目经理,0=否,1=是 -->
A.EXT_ID as "extId" <!-- 外部系统ID --> A.EXT_ID as "extId", <!-- 外部系统ID -->
A.DOWNLOAD_FLAG as "downloadFlag" <!-- 是否可以下载,0=否,1=是 -->
</sql> </sql>
<sql id="columnB"> <sql id="columnB">
...@@ -148,6 +149,7 @@ ...@@ -148,6 +149,7 @@
UPDATE ${hggpSchema}.HGWD003 UPDATE ${hggpSchema}.HGWD003
SET SET
IS_PROJECT_MANAGER = #isProjectManager#, IS_PROJECT_MANAGER = #isProjectManager#,
DOWNLOAD_FLAG = #downloadFlag#,
<include refid="SqlBase.updateRevise"/> <include refid="SqlBase.updateRevise"/>
WHERE ID = #id# WHERE ID = #id#
</update> </update>
......
<?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-10-22 14:00:02
Version : 1.0
schema : hggp
tableName : HGWD006
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,
PROJ_CODE VARCHAR,
PROJ_NAME VARCHAR,
FILE_ID VARCHAR,
DOC_ID VARCHAR,
CHANGE_CONTENT VARCHAR
-->
<sqlMap namespace="HGWD006">
<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="projCode">
PROJ_CODE = #projCode#
</isNotEmpty>
<!--<isNotEmpty prepend=" AND " property="projName">
PROJ_NAME like concat('%',#projName#,'%')
</isNotEmpty>-->
<isNotEmpty prepend=" AND " property="fileId">
FILE_ID = #fileId#
</isNotEmpty>
<!--<isNotEmpty prepend=" AND " property="fileName">
FILE_ID like concat('%',#fileName#,'%')
</isNotEmpty>-->
<!--<isNotEmpty prepend=" AND " property="docId">
DOC_ID = #docId#
</isNotEmpty>-->
<!--<isNotEmpty prepend=" AND " property="docName">
DOC_NAME like concat('%',#docName#,'%')
</isNotEmpty>-->
<isNotEmpty prepend=" AND " property="changeContent">
CHANGE_CONTENT = #changeContent#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="parentId">
PARENT_ID = #parentId#
</isNotEmpty>
</sql>
<select id="query" parameterClass="java.util.HashMap"
resultClass="com.baosight.hggp.hg.wd.domain.HGWD006">
SELECT
ID as "id", <!-- 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-已删除 -->
PROJ_CODE as "projCode", <!-- 项目编码 -->
PROJ_NAME as "projName", <!-- 项目名称 -->
FILE_ID as "fileId", <!-- 文件ID -->
DOC_ID as "docId", <!-- 附件ID -->
CHANGE_CONTENT as "changeContent", <!-- 变更内容 -->
FILE_NAME as "fileName",
DOC_NAME as "docName"
FROM ${hggpSchema}.HGWD006 WHERE 1=1
<include refid="condition" />
<dynamic prepend="ORDER BY">
<isNotEmpty property="orderBy">
$orderBy$
</isNotEmpty>
<isEmpty property="orderBy">
ID DESC
</isEmpty>
</dynamic>
</select>
<select id="count" resultClass="int">
SELECT COUNT(*) FROM ${hggpSchema}.HGWD006 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="projCode">
PROJ_CODE = #projCode#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="projName">
PROJ_NAME = #projName#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="fileId">
FILE_ID = #fileId#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="docId">
DOC_ID = #docId#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="changeContent">
CHANGE_CONTENT = #changeContent#
</isNotEmpty>
-->
<insert id="insert">
INSERT INTO ${hggpSchema}.HGWD006 (ID, <!-- ID -->
ACCOUNT_CODE, <!-- 企业编码 -->
DEP_CODE, <!-- 部门编码 -->
CREATED_BY, <!-- 记录创建者 -->
CREATED_NAME, <!-- 记录创建名称 -->
CREATED_TIME, <!-- 记录创建时间 -->
DELETE_FLAG, <!-- 0-未删除,1-已删除 -->
PROJ_CODE, <!-- 项目编码 -->
PROJ_NAME, <!-- 项目名称 -->
FILE_ID, <!-- 文件ID -->
DOC_ID, <!-- 附件ID -->
CHANGE_CONTENT, <!-- 变更内容 -->
FILE_NAME,
DOC_NAME,
PARENT_ID
)
VALUES (#id#, #accountCode#, #depCode#, #createdBy#, #createdName#, #createdTime#, #deleteFlag#,
#projCode#, #projName#, #fileId#, #docId#, #changeContent#, #fileName#, #docName#, #parentId#)
</insert>
<delete id="delete">
DELETE FROM ${hggpSchema}.HGWD006 WHERE
ID = #id#
</delete>
<update id="update">
UPDATE ${hggpSchema}.HGWD006
SET
UPDATED_BY = #updatedBy#, <!-- 记录修改者 -->
UPDATED_NAME = #updatedName#, <!-- 记录修改名称 -->
UPDATED_TIME = #updatedTime#, <!-- 记录修改时间 -->
DELETE_FLAG = #deleteFlag#, <!-- 0-未删除,1-已删除 -->
PROJ_CODE = #projCode#, <!-- 项目编码 -->
PROJ_NAME = #projName#, <!-- 项目名称 -->
FILE_ID = #fileId#, <!-- 文件ID -->
DOC_ID = #docId#, <!-- 附件ID -->
CHANGE_CONTENT = #changeContent#, <!-- 变更内容 -->
FILE_NAME = #fileName#,
DOC_NAME = #docName#,
PARENT_ID = #parentId#
WHERE
ID = #id#
</update>
</sqlMap>
...@@ -6,13 +6,7 @@ import com.baosight.hggp.core.extapp.decheng.api.DcOpenApi; ...@@ -6,13 +6,7 @@ import com.baosight.hggp.core.extapp.decheng.api.DcOpenApi;
import com.baosight.hggp.core.security.UserSessionUtils; import com.baosight.hggp.core.security.UserSessionUtils;
import com.baosight.hggp.hg.cw.domain.HGCW999; import com.baosight.hggp.hg.cw.domain.HGCW999;
import com.baosight.hggp.hg.wd.constant.HgWdSqlConstant; import com.baosight.hggp.hg.wd.constant.HgWdSqlConstant;
import com.baosight.hggp.hg.wd.domain.HGWD001; import com.baosight.hggp.hg.wd.domain.*;
import com.baosight.hggp.hg.wd.domain.HGWD001A;
import com.baosight.hggp.hg.wd.domain.HGWD002;
import com.baosight.hggp.hg.wd.domain.HGWD003;
import com.baosight.hggp.hg.wd.domain.HGWD005;
import com.baosight.hggp.hg.wd.domain.HGWD009;
import com.baosight.hggp.hg.wd.domain.HGWD099;
import com.baosight.hggp.hg.wd.utils.HgWdUtils; import com.baosight.hggp.hg.wd.utils.HgWdUtils;
import com.baosight.hggp.hg.xs.domain.User; import com.baosight.hggp.hg.xs.domain.User;
import com.baosight.hggp.util.AssertUtils; import com.baosight.hggp.util.AssertUtils;
...@@ -363,6 +357,24 @@ public class HGWDTools { ...@@ -363,6 +357,24 @@ public class HGWDTools {
return CollectionUtils.isEmpty(results) ? null : results.get(0); return CollectionUtils.isEmpty(results) ? null : results.get(0);
} }
} }
public static class HgWd006 {
public static void add(HGWD099 hgwd099,HGWD001 hgwd001,String changeContent) {
HGWD006 hgwd006 = new HGWD006();
hgwd006.setProjCode(hgwd001.getProjCode());
hgwd006.setProjName(hgwd001.getProjName());
hgwd006.setFileId(hgwd001.getFileId());
hgwd006.setFileName(hgwd001.getFileName());
hgwd006.setDocId(hgwd099.getDocId());
hgwd006.setDocName(hgwd099.getDocName());
hgwd006.setChangeContent(changeContent);
hgwd006.setParentId(hgwd099.getId());
DaoUtils.insert(HGWD006.INSERT, hgwd006);
}
}
public static class HgWd099 { public static class HgWd099 {
......
...@@ -98,6 +98,9 @@ ...@@ -98,6 +98,9 @@
<isNotEmpty prepend=" AND " property="specIds"> <isNotEmpty prepend=" AND " property="specIds">
SPEC_ID NOT IN <iterate close=")" open="(" conjunction="," property="specIds">#specIds[]#</iterate> SPEC_ID NOT IN <iterate close=")" open="(" conjunction="," property="specIds">#specIds[]#</iterate>
</isNotEmpty> </isNotEmpty>
<isNotEmpty prepend=" AND " property="inventCodes">
INVENT_CODE IN <iterate close=")" open="(" conjunction="," property="inventCodes">#inventCodes[]#</iterate>
</isNotEmpty>
</sql> </sql>
<!--<sql id="customCondition"> <!--<sql id="customCondition">
......
...@@ -7,6 +7,35 @@ package com.baosight.hggp.hg.zl.constant; ...@@ -7,6 +7,35 @@ package com.baosight.hggp.hg.zl.constant;
public class HgZlSqlConst { public class HgZlSqlConst {
/** /**
* HGZL003
*
* @author:songx
* @date:2024/5/7,16:36
*/
public static class HGZL003 {
// 修改
public static final String UPDATE_INFO = "HGZL003.updateInfo";
}
/**
* HGZL004
*
* @author:songx
* @date:2024/5/7,16:36
*/
public static class HGZL004 {
// 处理
public static final String DEAL = "HGZL004.deal";
// 复检合格
public static final String BATCH_COMPLETE = "HGZL004.batch_complete";
// 批量删除
public static final String DELETE_BY_IDS = "HGZL004.delete_by_ids";
}
/**
* HGZL011 * HGZL011
* *
* @author:songx * @author:songx
......
package com.baosight.hggp.hg.zl.domain; package com.baosight.hggp.hg.zl.domain;
import com.baosight.iplat4j.core.util.NumberUtils;
import com.baosight.iplat4j.core.ei.EiColumn;
import com.baosight.iplat4j.core.data.DaoEPBase; import com.baosight.iplat4j.core.data.DaoEPBase;
import com.baosight.iplat4j.core.ei.EiColumn;
import com.baosight.iplat4j.core.util.NumberUtils;
import com.baosight.iplat4j.core.util.StringUtils;
import java.util.HashMap; import java.util.HashMap;
import java.util.Map; import java.util.Map;
import com.baosight.iplat4j.core.util.StringUtils;
/** /**
* Project: <br> * Project: <br>
...@@ -94,11 +95,6 @@ public class HGZL004 extends DaoEPBase { ...@@ -94,11 +95,6 @@ public class HGZL004 extends DaoEPBase {
public static final String INSERT = "HGZL004.insert"; public static final String INSERT = "HGZL004.insert";
public static final String UPDATE = "HGZL004.update"; public static final String UPDATE = "HGZL004.update";
public static final String DELETE = "HGZL004.delete"; public static final String DELETE = "HGZL004.delete";
public static final String BATCH_COMPLETE= "HGZL004.batch_complete";
public static final String DELETE_BY_CHECK_IDS = "HGZL004.delete_by_check_ids";
public static final String DELETE_BY_IDS = "HGZL004.delete_by_ids";
private Long id = new Long(0); private Long id = new Long(0);
private Long checkId = new Long(0); /* 质检单ID*/ private Long checkId = new Long(0); /* 质检单ID*/
......
...@@ -93,7 +93,7 @@ public class ServiceHGZL002 extends ServiceBase { ...@@ -93,7 +93,7 @@ public class ServiceHGZL002 extends ServiceBase {
hgzl002List.forEach( o -> { hgzl002List.forEach( o -> {
o.setCheckStatus(CheckStatusEnum.CHECKED.getCode()); o.setCheckStatus(CheckStatusEnum.CHECKED.getCode());
DaoUtils.update(HGZL002.UPDATE,o); DaoUtils.update(HGZL002.UPDATE,o);
HGZLTools.THGZL004.addByHGZL002(o); HGZLTools.HgZl004.addByHGZL002(o);
}); });
HGKCTools.HgKc003.putInStorageData(hgzl002List); HGKCTools.HgKc003.putInStorageData(hgzl002List);
inInfo = this.query(inInfo); inInfo = this.query(inInfo);
......
...@@ -4,14 +4,26 @@ import com.baosight.hggp.aspect.annotation.OperationLogAnnotation; ...@@ -4,14 +4,26 @@ import com.baosight.hggp.aspect.annotation.OperationLogAnnotation;
import com.baosight.hggp.common.CheckTypeEnum; import com.baosight.hggp.common.CheckTypeEnum;
import com.baosight.hggp.core.dao.DaoUtils; import com.baosight.hggp.core.dao.DaoUtils;
import com.baosight.hggp.core.security.UserSessionUtils; import com.baosight.hggp.core.security.UserSessionUtils;
import com.baosight.hggp.hg.constant.HGConstant;
import com.baosight.hggp.hg.sc.domain.HGSC007;
import com.baosight.hggp.hg.sc.tools.HGSCTools;
import com.baosight.hggp.hg.xs.domain.User; import com.baosight.hggp.hg.xs.domain.User;
import com.baosight.hggp.hg.xs.tools.HGXSTools; import com.baosight.hggp.hg.xs.tools.HGXSTools;
import com.baosight.hggp.hg.zl.constant.HgZlSqlConst;
import com.baosight.hggp.hg.zl.domain.HGZL003; import com.baosight.hggp.hg.zl.domain.HGZL003;
import com.baosight.hggp.hg.zl.tools.HGZLTools; import com.baosight.hggp.hg.zl.tools.HGZLTools;
import com.baosight.hggp.util.*; import com.baosight.hggp.util.BeanUtils;
import com.baosight.hggp.util.CommonMethod;
import com.baosight.hggp.util.DateUtils;
import com.baosight.hggp.util.EiInfoUtils;
import com.baosight.hggp.util.LogUtils;
import com.baosight.hggp.util.MapUtils;
import com.baosight.hggp.util.ObjectUtils;
import com.baosight.hggp.util.StringUtils;
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.core.service.impl.ServiceBase; import com.baosight.iplat4j.core.service.impl.ServiceBase;
import com.baosight.iplat4j.ed.util.SequenceGenerator;
import java.util.ArrayList; import java.util.ArrayList;
import java.util.HashMap; import java.util.HashMap;
...@@ -19,7 +31,6 @@ import java.util.List; ...@@ -19,7 +31,6 @@ import java.util.List;
import java.util.Map; import java.util.Map;
import java.util.stream.Collectors; import java.util.stream.Collectors;
/** /**
* @author wwl * @author wwl
* @date 2025年05月29日 17:18 * @date 2025年05月29日 17:18
...@@ -63,32 +74,68 @@ public class ServiceHGZL003 extends ServiceBase { ...@@ -63,32 +74,68 @@ public class ServiceHGZL003 extends ServiceBase {
} }
return inInfo; return inInfo;
} }
/**
* @param inInfo
* @return
*/
@OperationLogAnnotation(operModul = "日常巡检单", operType = "保存", operDesc = "保存") @OperationLogAnnotation(operModul = "日常巡检单", operType = "保存", operDesc = "保存")
public EiInfo save(EiInfo inInfo) { public EiInfo save(EiInfo inInfo) {
try { try {
List<HGZL003> hgzl003List = MapUtils.toDaoEPBases(inInfo,HGZL003.class); List<HGZL003> fZl003s = MapUtils.toDaoEPBases(inInfo, HGZL003.class);
hgzl003List.forEach( o -> { for (HGZL003 fZl003 : fZl003s) {
HGZLTools.THGZL003.add(o); fZl003.setCheckDate(DateUtils.formatShort(fZl003.getCheckDate()));
}); if (StringUtils.isEmpty(fZl003.getCheckCode())) {
this.add(fZl003);
} else {
this.modify(fZl003);
}
}
inInfo = this.query(inInfo); inInfo = this.query(inInfo);
inInfo.setStatus(EiConstant.STATUS_DEFAULT); inInfo.setMsg("操作成功!本次对[" + fZl003s.size() + "]条数据保存成功!");
inInfo.setMsg("操作成功!本次对[" + hgzl003List.size() + "]条数据保存成功!");
} catch (Exception e) { } catch (Exception e) {
LogUtils.setDetailMsg(inInfo, e, "保存失败"); LogUtils.setDetailMsg(inInfo, e, "保存失败");
} }
return inInfo; return inInfo;
} }
/**
* @param fZl003
* @return
*/
private void add(HGZL003 fZl003) {
HGSC007 dbSc007 = HGSCTools.THGSC007.getById(fZl003.getTaskId());
HGZL003 newZl003 = BeanUtils.copy(dbSc007, HGZL003.class);
newZl003.setTaskId(dbSc007.getId());
newZl003.setCheckCode(SequenceGenerator.getNextSequence(HGConstant.SequenceId.HGZL003_CHECK_CODE));
newZl003.setCheckBy(UserSessionUtils.getLoginName());
newZl003.setCheckName(UserSessionUtils.getLoginCName());
newZl003.setCheckDate(DateUtils.shortDate());
DaoUtils.insert(HGZL003.INSERT, newZl003);
// 生成整改通知单
HGZLTools.HgZl004.addByHGZL003(newZl003);
}
/**
* @param fZl003
* @return
*/
private void modify(HGZL003 fZl003) {
DaoUtils.update(HgZlSqlConst.HGZL003.UPDATE_INFO, fZl003.toMap());
}
@Override @Override
@OperationLogAnnotation(operModul = "日常巡检单", operType = "删除", operDesc = "删除") @OperationLogAnnotation(operModul = "日常巡检单", operType = "删除", operDesc = "删除")
public EiInfo delete(EiInfo inInfo) { public EiInfo delete(EiInfo inInfo) {
try { try {
List<Map> resultRows = inInfo.getBlock(EiConstant.resultBlock).getRows(); List<Map> resultRows = inInfo.getBlock(EiConstant.resultBlock).getRows();
List<Long> ids = ObjectUtils.listKey(resultRows, HGZL003.FIELD_id).stream().map(id -> Long.parseLong(String.valueOf(id))).collect(Collectors.toList()); List<Long> ids = ObjectUtils.listKey(resultRows, HGZL003.FIELD_id).stream()
DaoUtils.update(HGZL003.BATCH_DELETE, new HashMap<String,Object>(){{put("ids",ids);}}); .map(id -> Long.parseLong(String.valueOf(id))).collect(
HGZLTools.THGZL004.deleteByCheckIds(ids, CheckTypeEnum.POLLING_CHECK); Collectors.toList());
DaoUtils.update(HGZL003.BATCH_DELETE, new HashMap<String, Object>() {{
put("ids", ids);
}});
HGZLTools.HgZl004.deleteByCheckIds(ids, CheckTypeEnum.POLLING_CHECK);
inInfo = this.query(inInfo); inInfo = this.query(inInfo);
inInfo.setStatus(EiConstant.STATUS_DEFAULT); inInfo.setStatus(EiConstant.STATUS_DEFAULT);
inInfo.setMsg("操作成功!本次对[" + resultRows.size() + "]条数据删除成功!"); inInfo.setMsg("操作成功!本次对[" + resultRows.size() + "]条数据删除成功!");
......
...@@ -11,43 +11,46 @@ import com.baosight.iplat4j.core.ei.EiInfo; ...@@ -11,43 +11,46 @@ import com.baosight.iplat4j.core.ei.EiInfo;
import com.baosight.iplat4j.core.exception.PlatException; import com.baosight.iplat4j.core.exception.PlatException;
import com.baosight.iplat4j.core.service.impl.ServiceEPBase; import com.baosight.iplat4j.core.service.impl.ServiceEPBase;
/** /**
* @author wwl * @author wwl
* @version 1.0 2024/5/24 * @version 1.0 2024/5/24
*/ */
public class ServiceHGZL003A extends ServiceEPBase { public class ServiceHGZL003A extends ServiceEPBase {
@OperationLogAnnotation(operModul = "日常巡检单-生产任务", operType = "查询", operDesc = "初始化页面") /**
public EiInfo initLoad(EiInfo inInfo) { * @param inInfo
try { * @return
inInfo.addBlock(EiConstant.resultBlock).addBlockMeta(new HGSC007().eiMetadata); */
// inInfo = super.query(inInfo, HGSC007.QUERY, new HGSC007()); @OperationLogAnnotation(operModul = "日常巡检单-生产任务", operType = "查询", operDesc = "初始化页面")
} catch (PlatException e) { public EiInfo initLoad(EiInfo inInfo) {
LogUtils.setDetailMsg(inInfo, e, "初始化失败"); try {
} inInfo.addBlock(EiConstant.resultBlock).addBlockMeta(new HGSC007().eiMetadata);
return inInfo; } catch (PlatException e) {
} LogUtils.setDetailMsg(inInfo, e, "初始化失败");
}
/* return inInfo;
* 查询*/ }
@OperationLogAnnotation(operModul = "日常巡检单-生产任务", operType = "查询", operDesc = "查询")
public EiInfo query(EiInfo inInfo) { /**
try { * @param inInfo
EiBlock block = inInfo.getBlock(EiConstant.queryBlock); * @return
String creatTime = block.getCellStr(ACConstants.ROW_CODE_0, HGSC007.FIELD_created_time); */
if (!creatTime.isEmpty()) { @OperationLogAnnotation(operModul = "日常巡检单-生产任务", operType = "查询", operDesc = "查询")
inInfo.setCell(EiConstant.queryBlock, ACConstants.ROW_CODE_0,HGSC007.FIELD_created_time, StringUtil.removeHorizontalLine(creatTime)); public EiInfo query(EiInfo inInfo) {
} try {
EiBlock block = inInfo.getBlock(EiConstant.queryBlock);
inInfo = super.query(inInfo,HGSC007.QUERY,new HGSC007() ); String creatTime = block.getCellStr(ACConstants.ROW_CODE_0, HGSC007.FIELD_created_time);
if (!creatTime.isEmpty()) {
} catch (PlatException e) { inInfo.setCell(EiConstant.queryBlock, ACConstants.ROW_CODE_0, HGSC007.FIELD_created_time,
LogUtils.setDetailMsg(inInfo, e, "查询失败"); StringUtil.removeHorizontalLine(creatTime));
} }
return inInfo; inInfo = super.query(inInfo, HGSC007.QUERY, new HGSC007());
} } catch (PlatException e) {
LogUtils.setDetailMsg(inInfo, e, "查询失败");
} }
return inInfo;
}
}
...@@ -6,9 +6,15 @@ import com.baosight.hggp.core.dao.DaoUtils; ...@@ -6,9 +6,15 @@ import com.baosight.hggp.core.dao.DaoUtils;
import com.baosight.hggp.core.security.UserSessionUtils; import com.baosight.hggp.core.security.UserSessionUtils;
import com.baosight.hggp.hg.kc.tools.HGKCTools; import com.baosight.hggp.hg.kc.tools.HGKCTools;
import com.baosight.hggp.hg.xs.domain.User; import com.baosight.hggp.hg.xs.domain.User;
import com.baosight.hggp.hg.zl.constant.HgZlSqlConst;
import com.baosight.hggp.hg.zl.domain.HGZL004; import com.baosight.hggp.hg.zl.domain.HGZL004;
import com.baosight.hggp.hg.zl.tools.HGZLTools; import com.baosight.hggp.hg.zl.tools.HGZLTools;
import com.baosight.hggp.util.*; import com.baosight.hggp.hg.zl.utils.HGZLUtils;
import com.baosight.hggp.util.AssertUtils;
import com.baosight.hggp.util.EiInfoUtils;
import com.baosight.hggp.util.LogUtils;
import com.baosight.hggp.util.MapUtils;
import com.baosight.hggp.util.ObjectUtils;
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.core.service.impl.ServiceBase; import com.baosight.iplat4j.core.service.impl.ServiceBase;
...@@ -18,7 +24,6 @@ import java.util.HashMap; ...@@ -18,7 +24,6 @@ import java.util.HashMap;
import java.util.List; import java.util.List;
import java.util.Map; import java.util.Map;
/** /**
* @author wwl * @author wwl
* @date 2025年05月29日 17:18 * @date 2025年05月29日 17:18
...@@ -66,18 +71,18 @@ public class ServiceHGZL004 extends ServiceBase { ...@@ -66,18 +71,18 @@ public class ServiceHGZL004 extends ServiceBase {
try { try {
List<HGZL004> hgzl004List = MapUtils.toDaoEPBases(inInfo,HGZL004.class); List<HGZL004> hgzl004List = MapUtils.toDaoEPBases(inInfo,HGZL004.class);
hgzl004List.forEach( o -> { hgzl004List.forEach( o -> {
HGZL004 db004 = HGZLTools.THGZL004.get(o.getId()); HGZL004 db004 = HGZLTools.HgZl004.get(o.getId());
HGZLTools.THGZL004.lock(o.getId()); HGZLTools.HgZl004.lock(o.getId());
HandleStatusEnum stat = HandleStatusEnum.getEnumByCode(db004.getHandleStatus()); HandleStatusEnum stat = HandleStatusEnum.getEnumByCode(db004.getHandleStatus());
switch (stat){ switch (stat){
case UNPROCESS: case UNPROCESS:
if(StringUtils.isNotBlank(o.getProcessSugges())||StringUtils.isNotBlank(o.getRectificatSugges())){ if(StringUtils.isNotBlank(o.getProcessSugges())||StringUtils.isNotBlank(o.getRectificatSugges())){
o.setHandleStatus(HandleStatusEnum.PROCESSING.getCode()); o.setHandleStatus(HandleStatusEnum.PROCESSING.getCode());
} }
DaoUtils.update(HGZL004.UPDATE,o); DaoUtils.update(HGZL004.UPDATE, o);
break; break;
case PROCESSING: case PROCESSING:
DaoUtils.update(HGZL004.UPDATE,o); DaoUtils.update(HGZL004.UPDATE, o);
break; break;
case PROCESSED: case PROCESSED:
AssertUtils.isTrue(true,String.format("检查单号[%s]已处理完成,不能修改!")); AssertUtils.isTrue(true,String.format("检查单号[%s]已处理完成,不能修改!"));
...@@ -94,15 +99,62 @@ public class ServiceHGZL004 extends ServiceBase { ...@@ -94,15 +99,62 @@ public class ServiceHGZL004 extends ServiceBase {
} }
return inInfo; return inInfo;
} }
/**
* 处理操作
*
* @param inInfo
* @return
*/
public EiInfo deal(EiInfo inInfo) {
try {
List<HGZL004> fZl004s = MapUtils.toDaoEPBases(inInfo, HGZL004.class);
Map<String, HGZL004> dbZl004 = HGZLUtils.HgZl004.lockGetDataEp(fZl004s);
// 数据校验
this.checkDealData(fZl004s, dbZl004);
// 保存数据
this.dealData(fZl004s);
inInfo = this.query(inInfo);
inInfo.setMsg("操作成功!本次对[" + fZl004s.size() + "]条数据处理成功!");
} catch (Exception e) {
LogUtils.setDetailMsg(inInfo, e, "处理失败");
}
return inInfo;
}
/**
* 数据校验
*
* @param fZl004s
* @param dbZl004Map
*/
private void checkDealData(List<HGZL004> fZl004s, Map<String, HGZL004> dbZl004Map) {
for (HGZL004 fZl004 : fZl004s) {
String checkCode = fZl004.getCheckCode();
HGZL004 dbZl004 = dbZl004Map.get(checkCode);
this.checkData(checkCode, dbZl004);
}
}
/**
* 数据保存
*
* @param fZl004s
*/
private void dealData(List<HGZL004> fZl004s) {
for (HGZL004 fZl004 : fZl004s) {
fZl004.setHandleStatus(HandleStatusEnum.PROCESSED.getCode());
DaoUtils.update(HgZlSqlConst.HGZL004.DEAL, fZl004.toMap());
}
}
@OperationLogAnnotation(operModul = "整改通知单", operType = "处理完成", operDesc = "处理完成") @OperationLogAnnotation(operModul = "整改通知单", operType = "处理完成", operDesc = "处理完成")
public EiInfo complete(EiInfo inInfo) { public EiInfo complete(EiInfo inInfo) {
try { try {
List<Map> resultRows = inInfo.getBlock(EiConstant.resultBlock).getRows(); List<Map> resultRows = inInfo.getBlock(EiConstant.resultBlock).getRows();
// 销售单号 // 销售单号
List<Long> ids = ObjectUtils.listKey(resultRows, "id"); List<Long> ids = ObjectUtils.listKey(resultRows, "id");
DaoUtils.update(HGZL004.BATCH_COMPLETE, new HashMap<String,Object>(){{put("ids",ids);}}); DaoUtils.update(HgZlSqlConst.HGZL004.BATCH_COMPLETE, new HashMap<String,Object>(){{put("ids",ids);}});
HGKCTools.HgKc003.putInStorageByHgzl004(ids); HGKCTools.HgKc003.putInStorageByHgzl004(ids);
inInfo = this.query(inInfo); inInfo = this.query(inInfo);
inInfo.setStatus(EiConstant.STATUS_DEFAULT); inInfo.setStatus(EiConstant.STATUS_DEFAULT);
...@@ -112,4 +164,18 @@ public class ServiceHGZL004 extends ServiceBase { ...@@ -112,4 +164,18 @@ public class ServiceHGZL004 extends ServiceBase {
} }
return inInfo; return inInfo;
} }
/**
* 数据校验
*
* @param checkCode
* @param dbZl004
*/
private void checkData(String checkCode, HGZL004 dbZl004) {
AssertUtils.isNull(dbZl004, String.format("整改通知单[%s]不存在", checkCode));
boolean isStatus = dbZl004.getHandleStatus().equals(HandleStatusEnum.UNPROCESS.getCode())
|| dbZl004.getHandleStatus().equals(HandleStatusEnum.PROCESSING.getCode());
AssertUtils.isTrue(!isStatus, String.format("整改通知单[%s]不是\"待处理\"或\"处理中\"状态,不允许操作", checkCode));
}
} }
...@@ -252,7 +252,7 @@ public class ServiceHGZL012 extends ServiceBase { ...@@ -252,7 +252,7 @@ public class ServiceHGZL012 extends ServiceBase {
// 不合格量大于0,更新委外加工 // 不合格量大于0,更新委外加工
if (fZl012.getUnQualityQty().compareTo(BigDecimal.ZERO) > 0) { if (fZl012.getUnQualityQty().compareTo(BigDecimal.ZERO) > 0) {
// 生成整改通知单 // 生成整改通知单
HGZLTools.THGZL004.addByHGZL012(fZl012); HGZLTools.HgZl004.addByHGZL012(fZl012);
// 更新委外加工 // 更新委外加工
HGSCTools.Hgsc010a.updateDeliver(dbKc014A.getPcsId(), fZl012.getUnQualityQty()); HGSCTools.Hgsc010a.updateDeliver(dbKc014A.getPcsId(), fZl012.getUnQualityQty());
} }
......
...@@ -3,10 +3,8 @@ ...@@ -3,10 +3,8 @@
<sqlMap namespace="HGZL004"> <sqlMap namespace="HGZL004">
<sql id="condition"> <sql id="condition">
<include refid="idCondition"/>
<include refid="HGXSDataAuth.authCondition"/> <include refid="HGXSDataAuth.authCondition"/>
<isNotEmpty prepend=" AND " property="id">
id = #id#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="checkId"> <isNotEmpty prepend=" AND " property="checkId">
check_id = #checkId# check_id = #checkId#
</isNotEmpty> </isNotEmpty>
...@@ -43,9 +41,6 @@ ...@@ -43,9 +41,6 @@
<isNotEmpty prepend=" AND " property="checkType"> <isNotEmpty prepend=" AND " property="checkType">
check_type = #checkType# check_type = #checkType#
</isNotEmpty> </isNotEmpty>
<isNotEmpty prepend=" AND " property="checkCode">
check_code = #checkCode#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="productType"> <isNotEmpty prepend=" AND " property="productType">
product_type = #productType# product_type = #productType#
</isNotEmpty> </isNotEmpty>
...@@ -114,6 +109,21 @@ ...@@ -114,6 +109,21 @@
</isNotEmpty> </isNotEmpty>
</sql> </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>
<isNotEmpty prepend=" AND " property="checkCode">
CHECK_CODE = #checkCode#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="checkCodes">
CHECK_CODE IN <iterate close=")" open="(" conjunction="," property="checkCodes">#checkCodes[]#</iterate>
</isNotEmpty>
</sql>
<select id="query" resultClass="com.baosight.hggp.hg.zl.domain.HGZL004"> <select id="query" resultClass="com.baosight.hggp.hg.zl.domain.HGZL004">
SELECT SELECT
id as "id", id as "id",
...@@ -253,17 +263,22 @@ ...@@ -253,17 +263,22 @@
WHERE id = #id# WHERE id = #id#
</update> </update>
<!-- 行锁 --> <!-- 行锁 -->
<update id="lock"> <update id="lock">
UPDATE ${hggpSchema}.HGZL004 UPDATE ${hggpSchema}.HGZL004
SET CREATED_TIME = CREATED_TIME SET CREATED_TIME = CREATED_TIME
WHERE 1=1 WHERE 1=1
<isNotEmpty prepend=" AND " property="id"> <include refid="idCondition"/>
id = #id# </update>
</isNotEmpty>
<isNotEmpty prepend=" AND " property="ids"> <!-- 处理 -->
id IN <iterate close=")" open="(" conjunction="," property="ids">#ids[]#</iterate> <update id="deal">
</isNotEmpty> UPDATE ${hggpSchema}.HGZL004
SET
HANDLE_STATUS = #handleStatus#,
<include refid="SqlBase.updateRevise"/>
WHERE 1=1
<include refid="idCondition"/>
</update> </update>
<update id="batch_complete"> <update id="batch_complete">
......
...@@ -8,7 +8,6 @@ import com.baosight.hggp.core.dao.DaoUtils; ...@@ -8,7 +8,6 @@ import com.baosight.hggp.core.dao.DaoUtils;
import com.baosight.hggp.core.security.UserSessionUtils; 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.constant.HGSqlConstant; import com.baosight.hggp.hg.constant.HGSqlConstant;
import com.baosight.hggp.hg.sc.domain.HGSC007;
import com.baosight.hggp.hg.sc.domain.HGSC008; import com.baosight.hggp.hg.sc.domain.HGSC008;
import com.baosight.hggp.hg.sc.tools.HGSCTools; import com.baosight.hggp.hg.sc.tools.HGSCTools;
import com.baosight.hggp.hg.zl.constant.HgZlConst; import com.baosight.hggp.hg.zl.constant.HgZlConst;
...@@ -158,7 +157,8 @@ public class HGZLTools { ...@@ -158,7 +157,8 @@ public class HGZLTools {
public static void deleteByWorkIds(List<Long> workIds) { public static void deleteByWorkIds(List<Long> workIds) {
List<HGZL002> hgzl002s = listByWorkIds(workIds); List<HGZL002> hgzl002s = listByWorkIds(workIds);
THGZL004.deleteByCheckIds(hgzl002s.stream().map(HGZL002::getId).collect(Collectors.toList()), CheckTypeEnum.PROCESS_CHECK); HgZl004.deleteByCheckIds(hgzl002s.stream().map(HGZL002::getId).collect(Collectors.toList()),
CheckTypeEnum.PROCESS_CHECK);
DaoUtils.update(HGZL002.DELETE_BY_WORKS, new HashMap<String, Object>() {{ DaoUtils.update(HGZL002.DELETE_BY_WORKS, new HashMap<String, Object>() {{
put("workIds", workIds); put("workIds", workIds);
}}); }});
...@@ -177,19 +177,7 @@ public class HGZLTools { ...@@ -177,19 +177,7 @@ public class HGZLTools {
List<HGZL002> results = DaoBase.getInstance().query(HGZL002.QUERY, paramMap); List<HGZL002> results = DaoBase.getInstance().query(HGZL002.QUERY, paramMap);
return results; return results;
} }
public static HGZL003 add(HGZL003 hgzl003) {
HGSC007 hgsc007 = HGSCTools.THGSC007.getById(hgzl003.getTaskId());
BeanUtils.copyProperties(hgsc007, hgzl003);
cleanBaseInfo(hgzl003);
//hgzl003.setCheckStatus(CheckStatusEnum.CHECKED.getCode());
hgzl003.setTaskId(hgsc007.getId());
hgzl003.setCheckCode(SequenceGenerator.getNextSequence(HGConstant.SequenceId.HGZL003_CHECK_CODE));
DaoUtils.insert(HGZL003.INSERT, hgzl003);
THGZL004.addByHGZL003(hgzl003);
return hgzl003;
}
private static void cleanBaseInfo(HGZL003 hgzl003) { private static void cleanBaseInfo(HGZL003 hgzl003) {
hgzl003.setCreatedBy(null); hgzl003.setCreatedBy(null);
hgzl003.setCreatedName(null); hgzl003.setCreatedName(null);
...@@ -202,9 +190,12 @@ public class HGZLTools { ...@@ -202,9 +190,12 @@ public class HGZLTools {
hgzl003.setId(null); hgzl003.setId(null);
} }
} }
/**
public static class THGZL004 { * @author:songx
* @date:2024/10/22,16:03
*/
public static class HgZl004 {
/** /**
* 锁 * 锁
...@@ -217,21 +208,61 @@ public class HGZLTools { ...@@ -217,21 +208,61 @@ public class HGZLTools {
return; return;
} }
Map queryMap = new HashMap(); Map queryMap = new HashMap();
queryMap.put(HGZL004.FIELD_id, id); queryMap.put(com.baosight.hggp.hg.zl.domain.HGZL004.FIELD_id, id);
DaoBase.getInstance().update(HGSqlConstant.HGZL004.LOCK, queryMap); DaoBase.getInstance().update(HGSqlConstant.HGZL004.LOCK, queryMap);
} }
/**
* 锁
*
* @param checkCodes
* @return
*/
public static void lock(List<String> checkCodes) {
if (CollectionUtils.isEmpty(checkCodes)) {
return;
}
Map paramMap = new HashMap();
paramMap.put("checkCodes", checkCodes);
DaoBase.getInstance().update(HGSqlConstant.HGZL004.LOCK, paramMap);
}
/**
* 查询
*
* @param checkCodes
* @return
*/
public static List<HGZL004> list(List<String> checkCodes) {
AssertUtils.isEmpty(checkCodes, "计划号不能为空");
Map<String, Object> paramMap = new HashMap();
paramMap.put("checkCodes", checkCodes);
return DaoBase.getInstance().query(HGZL004.QUERY, paramMap);
}
/**
* 查询
*
* @param checkCodes
* @return
*/
public static Map<String, HGZL004> map(List<String> checkCodes) {
List<HGZL004> results = list(checkCodes);
return results.stream().collect(Collectors.toMap(HGZL004::getCheckCode, item -> item));
}
public static void addByHGZL002(HGZL002 hgzl002) { public static void addByHGZL002(HGZL002 hgzl002) {
List<HGZL004> hgzl004DbList = listByCheckId(hgzl002.getId(), CheckTypeEnum.PROCESS_CHECK.getCode()); List<com.baosight.hggp.hg.zl.domain.HGZL004> hgzl004DbList = listByCheckId(hgzl002.getId(),
CheckTypeEnum.PROCESS_CHECK.getCode());
if (hgzl002.getUnpassQuantity().compareTo(BigDecimal.ZERO) == 1 && CollectionUtils.isEmpty(hgzl004DbList)) { if (hgzl002.getUnpassQuantity().compareTo(BigDecimal.ZERO) == 1 && CollectionUtils.isEmpty(hgzl004DbList)) {
HGZL004 hgzl004 = new HGZL004(); com.baosight.hggp.hg.zl.domain.HGZL004 hgzl004 = new com.baosight.hggp.hg.zl.domain.HGZL004();
BeanUtils.copyProperties(hgzl002, hgzl004); BeanUtils.copyProperties(hgzl002, hgzl004);
cleanBaseInfo(hgzl004); cleanBaseInfo(hgzl004);
hgzl004.setCheckId(hgzl002.getId()); hgzl004.setCheckId(hgzl002.getId());
hgzl004.setCheckType(CheckTypeEnum.PROCESS_CHECK.getCode()); hgzl004.setCheckType(CheckTypeEnum.PROCESS_CHECK.getCode());
hgzl004.setHandleStatus(HandleStatusEnum.UNPROCESS.getCode()); hgzl004.setHandleStatus(HandleStatusEnum.UNPROCESS.getCode());
hgzl004.setCheckCode(SequenceGenerator.getNextSequence(HGConstant.SequenceId.HGZL002_CHECK_CODE)); hgzl004.setCheckCode(SequenceGenerator.getNextSequence(HGConstant.SequenceId.HGZL002_CHECK_CODE));
DaoUtils.insert(HGZL004.INSERT, hgzl004); DaoUtils.insert(com.baosight.hggp.hg.zl.domain.HGZL004.INSERT, hgzl004);
} }
//修改质检单问题数量为0的情况下,删除通知单,并删除相应附件照片 //修改质检单问题数量为0的情况下,删除通知单,并删除相应附件照片
// if(hgzl002.getUnpassQuantity()==0&&CollectionUtils.isNotEmpty(hgzl004DbList)){ // if(hgzl002.getUnpassQuantity()==0&&CollectionUtils.isNotEmpty(hgzl004DbList)){
...@@ -267,7 +298,8 @@ public class HGZLTools { ...@@ -267,7 +298,8 @@ public class HGZLTools {
if (hgZl012.getUnQualityQty().compareTo(BigDecimal.ZERO) < 1) { if (hgZl012.getUnQualityQty().compareTo(BigDecimal.ZERO) < 1) {
return; return;
} }
HGZL004 newZl004 = BeanUtils.copy(hgZl012, HGZL004.class); com.baosight.hggp.hg.zl.domain.HGZL004 newZl004 = BeanUtils.copy(hgZl012,
com.baosight.hggp.hg.zl.domain.HGZL004.class);
newZl004.setCheckId(hgZl012.getId()); newZl004.setCheckId(hgZl012.getId());
newZl004.setCheckType(CheckTypeEnum.OUTSOURCE_CHECK.getCode()); newZl004.setCheckType(CheckTypeEnum.OUTSOURCE_CHECK.getCode());
newZl004.setHandleStatus(HandleStatusEnum.UNPROCESS.getCode()); newZl004.setHandleStatus(HandleStatusEnum.UNPROCESS.getCode());
...@@ -276,21 +308,24 @@ public class HGZLTools { ...@@ -276,21 +308,24 @@ public class HGZLTools {
newZl004.setCheckName(UserSessionUtils.getLoginCName()); newZl004.setCheckName(UserSessionUtils.getLoginCName());
newZl004.setProductCode(hgZl012.getInventCode()); newZl004.setProductCode(hgZl012.getInventCode());
newZl004.setProductName(hgZl012.getInventName()); newZl004.setProductName(hgZl012.getInventName());
DaoUtils.insert(HGZL004.INSERT, newZl004); DaoUtils.insert(com.baosight.hggp.hg.zl.domain.HGZL004.INSERT, newZl004);
} }
public static void deleteByCheckIds(List<Long> checkIds,CheckTypeEnum checkType){ public static void deleteByCheckIds(List<Long> checkIds,CheckTypeEnum checkType) {
List<HGZL004> hgzl004List = listByCheckIds(checkIds,checkType.getCode()); List<com.baosight.hggp.hg.zl.domain.HGZL004> hgzl004List = listByCheckIds(checkIds, checkType.getCode());
List<Long> ids = hgzl004List.stream().map(HGZL004::getId).collect(Collectors.toList()); List<Long> ids = hgzl004List.stream().map(com.baosight.hggp.hg.zl.domain.HGZL004::getId)
DaoUtils.update(HGZL004.DELETE_BY_IDS,new HashMap<String,Object>(){{put("ids",ids);}}); .collect(Collectors.toList());
DaoUtils.update(HgZlSqlConst.HGZL004.DELETE_BY_IDS, new HashMap<String, Object>() {{
put("ids", ids);
}});
THGZL004A.deleteByInformIds(ids); THGZL004A.deleteByInformIds(ids);
ids.forEach( id -> { ids.forEach( id -> {
HGSCTools.THGSC099.deleteByMatId(id,HGConstant.FileBizType.CHECK_DEFECT); HGSCTools.THGSC099.deleteByMatId(id,HGConstant.FileBizType.CHECK_DEFECT);
HGSCTools.THGSC099.deleteByMatId(id,HGConstant.FileBizType.CHECK_HANDLE); HGSCTools.THGSC099.deleteByMatId(id,HGConstant.FileBizType.CHECK_HANDLE);
}); });
} }
private static void cleanBaseInfo(HGZL004 hgzl004) { private static void cleanBaseInfo(com.baosight.hggp.hg.zl.domain.HGZL004 hgzl004) {
hgzl004.setCreatedBy(null); hgzl004.setCreatedBy(null);
hgzl004.setCreatedName(null); hgzl004.setCreatedName(null);
hgzl004.setCreatedTime(null); hgzl004.setCreatedTime(null);
...@@ -301,29 +336,30 @@ public class HGZLTools { ...@@ -301,29 +336,30 @@ public class HGZLTools {
hgzl004.setDepName(null); hgzl004.setDepName(null);
hgzl004.setId(null); hgzl004.setId(null);
} }
public static List<HGZL004> listByCheckIds(List<Long> checkIds, Integer checkType) { public static List<com.baosight.hggp.hg.zl.domain.HGZL004> listByCheckIds(List<Long> checkIds, Integer checkType) {
Map queryMap = new HashMap(); Map queryMap = new HashMap();
queryMap.put("checkIds", checkIds); queryMap.put("checkIds", checkIds);
queryMap.put(HGZL004.FIELD_check_type, checkType); queryMap.put(com.baosight.hggp.hg.zl.domain.HGZL004.FIELD_check_type, checkType);
return DaoBase.getInstance().query(HGZL004.QUERY, queryMap); return DaoBase.getInstance().query(com.baosight.hggp.hg.zl.domain.HGZL004.QUERY, queryMap);
} }
public static List<HGZL004> listByCheckId(Long checkId, Integer checkType) { public static List<com.baosight.hggp.hg.zl.domain.HGZL004> listByCheckId(Long checkId, Integer checkType) {
Map queryMap = new HashMap(); Map queryMap = new HashMap();
queryMap.put(HGZL004.FIELD_check_id, checkId); queryMap.put(com.baosight.hggp.hg.zl.domain.HGZL004.FIELD_check_id, checkId);
queryMap.put(HGZL004.FIELD_check_type, checkType); queryMap.put(com.baosight.hggp.hg.zl.domain.HGZL004.FIELD_check_type, checkType);
return DaoBase.getInstance().query(HGZL004.QUERY, queryMap); return DaoBase.getInstance().query(com.baosight.hggp.hg.zl.domain.HGZL004.QUERY, queryMap);
} }
/** /**
* @param id * @param id
*/ */
public static HGZL004 get(Long id) { public static com.baosight.hggp.hg.zl.domain.HGZL004 get(Long id) {
AssertUtils.isNull(id, "ID不能为空"); AssertUtils.isNull(id, "ID不能为空");
Map paramMap = new HashMap(); Map paramMap = new HashMap();
paramMap.put(HGZL004.FIELD_id, id); paramMap.put(com.baosight.hggp.hg.zl.domain.HGZL004.FIELD_id, id);
List<HGZL004> results = DaoBase.getInstance().query(HGZL004.QUERY, paramMap); List<com.baosight.hggp.hg.zl.domain.HGZL004> results = DaoBase.getInstance().query(
com.baosight.hggp.hg.zl.domain.HGZL004.QUERY, paramMap);
return CollectionUtils.isEmpty(results) ? null : results.get(0); return CollectionUtils.isEmpty(results) ? null : results.get(0);
} }
......
...@@ -2,6 +2,7 @@ package com.baosight.hggp.hg.zl.utils; ...@@ -2,6 +2,7 @@ package com.baosight.hggp.hg.zl.utils;
import com.baosight.hggp.hg.utils.HGUtils; import com.baosight.hggp.hg.utils.HGUtils;
import com.baosight.hggp.hg.zl.domain.HGZL001; import com.baosight.hggp.hg.zl.domain.HGZL001;
import com.baosight.hggp.hg.zl.domain.HGZL004;
import com.baosight.hggp.hg.zl.domain.HGZL011; import com.baosight.hggp.hg.zl.domain.HGZL011;
import com.baosight.hggp.hg.zl.domain.HGZL012; import com.baosight.hggp.hg.zl.domain.HGZL012;
import com.baosight.hggp.hg.zl.tools.HGZLTools; import com.baosight.hggp.hg.zl.tools.HGZLTools;
...@@ -67,6 +68,38 @@ public class HGZLUtils { ...@@ -67,6 +68,38 @@ public class HGZLUtils {
} }
/** /**
* HGZL004 工具类
*
* @author:songx
* @date:2024/5/9,16:58
*/
public static class HgZl004 {
/**
* 锁并且获取数据
*
* @param fZl004s
* @return
*/
public static Map<String, HGZL004> lockGetDataEp(List<? extends HGZL004> fZl004s) {
return lockGetData(ObjectUtils.listEpKey(fZl004s, HGZL004.FIELD_check_code));
}
/**
* 锁并且获取数据
*
* @param checkCodes
* @return
*/
public static Map<String, HGZL004> lockGetData(List<String> checkCodes) {
// 锁
HGZLTools.HgZl004.lock(checkCodes);
// db数据
return HGZLTools.HgZl004.map(checkCodes);
}
}
/**
* HGZL001 工具类 * HGZL001 工具类
* *
* @author:songx * @author:songx
......
...@@ -11,7 +11,7 @@ ...@@ -11,7 +11,7 @@
<Appenders> <Appenders>
<!--*********************控制台日志***********************--> <!--*********************控制台日志***********************-->
<Console name="Console" target="SYSTEM_OUT" follow="true"> <Console name="Console" target="SYSTEM_OUT" follow="true">
<PatternLayout charset="GBK" pattern="${LOG_PATTERN}"/> <PatternLayout charset="UTF-8" pattern="${LOG_PATTERN}"/>
</Console> </Console>
<TextArea name="platLogAppender"> <TextArea name="platLogAppender">
<PatternLayout pattern="%m%n"/> <PatternLayout pattern="%m%n"/>
......
<template>
<div class="home-page-left">
<div class="content-main-title">车间设备分布图</div>
<div class="content-content-title">原材料库</div>
<div style="width: 100%;display: flex">
<div class="content-content-img device-img1" style="margin-left: 3.5vw;margin-right: 3vh">
<img :src="`${ctx}/common/img/device-img1-content.png`" class="device-img1-content img" alt/>
<div class="content-content-title" style="justify-content: flex-start;margin-top: 2.8vh;padding-left: 1vw">型材切割机</div>
</div>
<div class="content-content-img device-img2">
<img :src="`${ctx}/common/img/device-img2-content.png`" class="device-img2-content img" alt/>
<div class="content-content-title" style="justify-content: flex-end;margin-top: 2.8vh;padding-right: 1vw">激光切割机</div>
</div>
</div>
<div style="width: 100%;height: 48vh;display: flex;margin-top: 2vh">
<div style="width: 50%;height: 100%">
<div class="content-content-img device-img1" style="width: 79%;margin-left: 3.2vw;">
<img :src="`${ctx}/common/img/device-img3-content.png`" class="device-img1-content img" alt/>
<div class="content-content-title" style="justify-content: flex-start;margin-top: 2.8vh;padding-left: 1.5vw">组立机</div>
</div>
<div style="width: 79%;margin-left: 3.2vw;height: 28vh;margin-top: 2vh">
<div class="content-device-img img">
<div class="title-content-device img">成品库</div>
</div>
<img :src="`${ctx}/common/img/architectureDiagram.png`" style="width: 100%;height: 100%" alt/>
</div>
</div>
<div class="right-device img">
<div style="width: 100%;height: 30%;display: flex;margin-top: 3vh;">
<div class="content-content-title" style="width: 40%;">组立机</div>
<img :src="`${ctx}/common/img/device-img3-content.png`" class="device-img1-content img" style="margin: 0;" alt/>
</div>
<div style="width: 100%;height: 30%;display: flex;margin-top: 2vh;">
<div class="content-content-title" style="width: 40%;">埋弧焊机</div>
<img :src="`${ctx}/common/img/device-img4-content.png`" class="device-img1-content img" style="margin: 0;" alt/>
</div>
<div style="width: 100%;height: 30%;display: flex;margin-top: 2vh;">
<div class="content-content-title" style="width: 40%;">激光焊接机</div>
<img :src="`${ctx}/common/img/device-img5-content.png`" class="device-img1-content img" style="margin: 0;" alt/>
</div>
</div>
</div>
<!-- <select></select>-->
</div>
</template>
<script>
module.exports = {
props:{
ctx:String,
},
data(){
return {
name: '红安',
dataPicker:new Date,
};
},
}
</script>
<style scoped>
.img{
background-size: 100% 100%;
background-repeat: no-repeat;
}
.home-page-left{
width: 100%;
display: flex;
justify-content: flex-start;
flex-wrap: wrap;
align-content: flex-start;
background-image: url("../../../../../common/img/manageDeviceBg.png");
background-size: 100% 100%;
background-repeat: no-repeat;
}
.content-main-title{
height: 3vh;
width: 100%;
font-family: Microsoft YaHei;
font-weight: 400;
font-size: 1.2vw;
color: #01A9FF;
display: flex;
align-items: center;
justify-content: center;
}
.content-content-title{
width: 100%;
height: 3vh;
font-family: Microsoft YaHei;
font-weight: 400;
font-size: 1vw;
color: #FFFFFF;
display: flex;
align-items: center;
justify-content: center;
margin-top: 2vh;
}
.content-content-img{
width: 40%;
height: 17vh;
background-size: 100% 100%;
background-repeat: no-repeat;
position: relative;
}
.device-img1{
background-image: url("../../../../../common/img/deviceImgLeft.png");
}
.device-img2{
background-image: url("../../../../../common/img/deviceImgRight.png");
}
.device-img1-content{
width: 9vw;
height: 8vh;
margin-top: 3vh;
margin-left: 3.5vw;
}
.device-img2-content{
width: 9vw;
height: 8vh;
margin-top: 3vh;
margin-left: 3.5vw;
}
.content-device-img{
width: 95%;
height: 5vh;
background-image: url("../../../../../common/img/titleContentDevice.png");
}
.title-content-device{
width: 100%;
height: 100%;
font-family: Adobe Heiti Std;
font-weight: normal;
font-size: 1vw;
color: #FFFFFF;
background: linear-gradient(180deg, #ACE5FF 0%, #FFFFFF 100%);
-webkit-background-clip: text;
-webkit-text-fill-color: transparent;
display: flex;
justify-content: center;
align-items: center;
//background-image: url("../../../../../common/img/titleContentDevice.png");
}
.right-device{
width: 46%;
height: 100%;
background-image: url("../../../../../common/img/rightLongBg.png");
}
</style>
<template>
<div ref="chartContainer" :style="{ width: width+'vw', height: height + 'vh' }"></div>
</template>
<script>
module.exports = {
props: {
option: {
type: Object,
required: true,
},
height: {
type: Number,
default: 35
},
width: {
type: Number,
default: 52
}
},
data() {
return {
chart: null,
};
},
watch: {
option: {
handler(newVal) {
if (this.chart) {
this.chart.setOption(newVal);
}
},
deep: true, // 监听对象内部属性的变化
immediate: true, // 在绑定时立即执行一次监听器
},
},
mounted() {
this.initChart();
window.addEventListener('resize', this.handleResize);
},
beforeDestroy() {
if (this.chart) {
this.chart.dispose();
}
window.removeEventListener('resize', this.handleResize);
},
methods: {
initChart() {
this.chart = echarts.init(this.$refs.chartContainer);
this.chart.setOption(this.option);
},
handleResize() {
if (this.chart) {
this.chart.resize();
}
},
},
};
</script>
<template>
<div class="home-page-main">
<div class="left-device device">
<div v-for="(item,index) in 3"
:key="index" class="device-background">
<div class="device-title " style="padding-top: 0.2vh;margin-left: 2vw;display: flex">
<div class="device-span" style="width: 50%">激光切割机</div>
<div style="display: flex;width: 50%">
<div class="openOn-span" style="margin-left: 0.5vw;margin-right: 0.5vw">设备开机</div>
<img src="../../hggp/common/img/powerOn.png" style="width: 1.5vw;height: 3vh" alt/>
</div>
</div>
<div class="device-main device-span">
<div style="display: flex;width: 100%;margin-left: 1vw;height: 3vh">
<div style="margin-right: 0.5vw;color: #FFFFFF;font-size: 0.8vw;">设备型号</div>
<div style="color: #01A9FF;font-size: 1vw;">MZ-1250</div>
</div>
<div style="height: 15.5vh;width: 100%;display: flex;justify-content: center;align-items: center;">
<img src="../../hggp/common/img/avi.png" style="width: 3vw;height: 6vh;" alt/>
</div>
</div>
</div>
</div>
<div class="left-device device" style="margin-left: 2vw;">
<div v-for="(item,index) in 3"
:key="index" class="device-background">
<div class="device-title " style="padding-top: 0.2vh;margin-left: 2vw">
<div class="device-span" >激光切割机</div>
</div>
<div class="device-main device-span">
123
</div>
</div>
</div>
<div class="left-device device" style="margin-left: 2vw;">
<div v-for="(item,index) in 3"
:key="index" class="device-background">
<div class="device-title " style="padding-top: 0.2vh;margin-left: 2vw">
<div class="device-span">激光切割机</div>
</div>
<div class="device-main device-span">
123
</div>
</div>
</div>
</div>
</template>
<script>
module.exports = {
data(){
return {
name: '红安',
dataPicker:new Date,
};
},
}
</script>
<style scoped>
.home-page-main{
width: 100%;
height: 100%;
display: flex;
}
.device{
height: 100%;
}
.left-device{
width: 30%;
}
.right-device{
width: 68%;
height: 100%;
}
.device-background{
width: 100%;
height:31.1%;
background-image: url("../../../../../common/img/productionBackground.png");
background-size: 100% 100%;
background-repeat: no-repeat;
position: relative;
margin-bottom: 2vh;
}
.device-background::before{
content: ""; /* 伪元素需要内容,即使它是空的 */
position: absolute;
top: 0;
right: 0;
bottom: 0;
left: 0;
width: 100%;
height: 5vh;
background-image: url("../../../../../common/img/productionTitle.png");
background-size: 100% 100%;
background-repeat: no-repeat;
z-index: -1;
}
.device-span{
height: 3vh;
font-family: Microsoft YaHei;
font-weight: 400;
font-size: 1vw;
color: #FFFFFF;
}
.openOn-span{
height: 3vh;
font-family: Microsoft YaHei;
font-weight: 400;
font-size: 0.8vw;
color: #1AA6CB;
line-height: 3vh;
}
.device-title{
width: 100%;
height: 5vh;
}
.device-main{
width: 100%
}
</style>
<template>
<div ref="chartContainer" :style="{ width: width+'vw', height: height + 'vh' }"></div>
</template>
<script>
module.exports = {
props: {
option: {
type: Object,
required: true,
},
height: {
type: Number,
default: 35
},
width: {
type: Number,
default: 52
}
},
data() {
return {
chart: null,
};
},
watch: {
option: {
handler(newVal) {
if (this.chart) {
this.chart.setOption(newVal);
}
},
deep: true, // 监听对象内部属性的变化
immediate: true, // 在绑定时立即执行一次监听器
},
},
mounted() {
this.initChart();
window.addEventListener('resize', this.handleResize);
},
beforeDestroy() {
if (this.chart) {
this.chart.dispose();
}
window.removeEventListener('resize', this.handleResize);
},
methods: {
initChart() {
this.chart = echarts.init(this.$refs.chartContainer);
this.chart.setOption(this.option);
},
handleResize() {
if (this.chart) {
this.chart.resize();
}
},
},
};
</script>
<template>
<div class="home-page-left">
<div class="home-page-content">
<div class="page-content-title">
<div class="page-title-span">
项目生产明细
</div>
</div>
<div class="page-content-main">
<div class="page-title-project">
<div v-for="(item,index) in dataList"
:key="index" class="project-title-font"
>
{{ item }}
</div>
</div>
<div v-for="(temp,index) in getByProjCodewtWtList" :key="index" class="page-title-project"
style="margin-top: 0.8vh;height: 5vh;border: 1px solid #0097FF ;">
<div v-for="(item,index) in getByProjCodewtWtArray"
:key="index" class="project-title-font" style="opacity: 0.5;"
>
{{ temp[item] }}
</div>
</div>
</div>
</div>
<!-- <select></select>-->
</div>
</template>
<script>
module.exports = {
props:{
factory:String,
datapicker:String,
ctx:String,
},
data(){
return {
name: '红安',
projCodeWtList:[],
getByProjCodewtWtList:[],
dataList:['项目名称','计划完成时间','计划产量','实际产量','进度'],
getByProjCodewtWtArray:['projName','completeDate','totalWeight','finishWeight','schedule'],
};
},
watch:{
factory(newVal) {
this.getByProjCodewt();
},
datapicker(newVal) {
this.getByProjCodewt();
},
},
mounted(){
this.getByProjCodewt();
},
methods:{
getByProjCodewt(){
let _this = this;
var inInfo = new EiInfo();
console.log('this.factory',this.factory)
console.log('this.factory',this.datapicker)
inInfo.set('inqu_status-0-factoryCode',this.factory)
inInfo.set('inqu_status-0-depositDate',this.dataPicker)
IPLAT.EiCommunicator.send('HGSC007', 'getByProjCodeWt', inInfo, {
onSuccess: function (res) {
_this.getByProjCodewtWtList = res.extAttr.result
console.log('项目生产',res.extAttr.result)
console.log('项目生产',res)
},
onFail: function (err) {
console.error('request_tools----------------->错误信息', err);
}
},
{async: false}
);
},
}
}
</script>
<style scoped>
.home-page-left{
width: 100%;
height: 100%;
display: flex;
justify-content: flex-start;
flex-wrap: wrap;
}
.home-page-content{
width: 23vw;
height:100%;
background-image: url("../../../../../common/img/productionBackground.png");
background-size: 100% 100%;
background-repeat: no-repeat;
position: relative;
}
.home-page-content::before{
content: ""; /* 伪元素需要内容,即使它是空的 */
position: absolute;
top: 0;
right: 0;
bottom: 0;
left: 0;
width: 100%;
height: 5vh;
z-index: -1;
background-image: url("../../../../../common/img/productionTitle.png");
background-size: 100% 100%;
background-repeat: no-repeat;
}
.page-content-title{
width: 100%;
height: 5vh;
}
.page-title-span{
font-family: Microsoft YaHei;
font-weight: 400;
font-size: 0.9vw;
color: #CAECFF;
background: linear-gradient(-2deg, #FFFFFF 0%, #CAECFF 100%);
-webkit-background-clip: text;
-webkit-text-fill-color: transparent;
margin-left: 2vw;
padding-top: 0.2vh;
}
.page-content-main{
height: 90%;
margin: 1vw 1vh;
overflow: auto;
}
::-webkit-scrollbar {
width: 0.3vw;
cursor:pointer;
}
::-webkit-scrollbar-thumb {
background-color: rgba(94, 113, 135, 0.5) !important;
cursor:pointer;
}
.page-content-main::-webkit-scrollbar-thumb {
background-color: rgb(42, 36, 36);
border-radius: 10px;
}
.page-title-project{
width: 100%;
height: 4vh;
background: #071938;
border-radius: 2px;
display: flex;
}
.project-title-font{
width: 25%;
height: 100%;
display: flex;
font-size: 0.7vw;
justify-content: center;
align-items: center;
color: #fff;
overflow: hidden;
flex-wrap: wrap;
}
</style>
...@@ -54,9 +54,9 @@ ...@@ -54,9 +54,9 @@
<EF:EFComboColumn ename="status" cname="状态" enable="false" width="80" align="center"> <EF:EFComboColumn ename="status" cname="状态" enable="false" width="80" align="center">
<EF:EFCodeOption codeName="hggp.hgcg.planStatus"/> <EF:EFCodeOption codeName="hggp.hgcg.planStatus"/>
</EF:EFComboColumn> </EF:EFComboColumn>
<EF:EFColumn ename="purQty" cname="采购数量" enable="false" width="120" align="right" format="{0:N0}" defaultValue="0"/> <EF:EFColumn ename="purQty" cname="采购数量" enable="false" width="120" align="right" format="{0:N3}" defaultValue="0"/>
<EF:EFColumn ename="purWeight" cname="采购重量" enable="false" width="120" align="right" format="{0:N3}" defaultValue="0"/> <EF:EFColumn ename="purWeight" cname="采购重量" enable="false" width="120" align="right" format="{0:N3}" defaultValue="0"/>
<EF:EFColumn ename="planQty" cname="计划数量" enable="false" width="120" align="right" format="{0:N0}" defaultValue="0"/> <EF:EFColumn ename="planQty" cname="计划数量" enable="false" width="120" align="right" format="{0:N3}" defaultValue="0"/>
<EF:EFColumn ename="planWeight" cname="计划重量" enable="false" width="120" align="right" format="{0:N3}" defaultValue="0"/> <EF:EFColumn ename="planWeight" cname="计划重量" enable="false" width="120" align="right" format="{0:N3}" defaultValue="0"/>
<EF:EFColumn ename="createdName" cname="创建人" enable="false" width="100" align="center"/> <EF:EFColumn ename="createdName" cname="创建人" enable="false" width="100" align="center"/>
<EF:EFColumn ename="createdTime" cname="创建时间" enable="false" width="140" align="center" <EF:EFColumn ename="createdTime" cname="创建时间" enable="false" width="140" align="center"
......
...@@ -44,9 +44,9 @@ ...@@ -44,9 +44,9 @@
</EF:EFComboColumn> </EF:EFComboColumn>
<EF:EFColumn ename="inventTypeDetail" cname="存货类型大类" hidden="true"/> <EF:EFColumn ename="inventTypeDetail" cname="存货类型大类" hidden="true"/>
<EF:EFColumn ename="spec" cname="规格" width="120" align="center" required="true"/> <EF:EFColumn ename="spec" cname="规格" width="120" align="center" required="true"/>
<EF:EFColumn ename="purQty" cname="采购数量" width="120" align="right" format="{0:N0}" required="true"/> <EF:EFColumn ename="purQty" cname="采购数量" width="120" align="right" format="{0:N3}" required="true"/>
<EF:EFColumn ename="purWeight" cname="采购重量" width="120" align="right" format="{0:N3}" required="true"/> <EF:EFColumn ename="purWeight" cname="采购重量" width="120" align="right" format="{0:N3}" required="true"/>
<EF:EFColumn ename="planQty" cname="计划数量" enable="false" width="120" align="right" format="{0:N0}"/> <EF:EFColumn ename="planQty" cname="计划数量" enable="false" width="120" align="right" format="{0:N3}"/>
<EF:EFColumn ename="planWeight" cname="计划重量" enable="false" width="120" align="right" format="{0:N3}"/> <EF:EFColumn ename="planWeight" cname="计划重量" enable="false" width="120" align="right" format="{0:N3}"/>
<EF:EFColumn ename="material" cname="材质" width="80" align="center" required="true"/> <EF:EFColumn ename="material" cname="材质" width="80" align="center" required="true"/>
<EF:EFColumn ename="unit" cname="单位" enable="false" width="80" align="center"/> <EF:EFColumn ename="unit" cname="单位" enable="false" width="80" align="center"/>
......
...@@ -2,6 +2,7 @@ $(function () { ...@@ -2,6 +2,7 @@ $(function () {
var userByCompany = __eiInfo.getBlock("userByCompany").getMappedRows(); var userByCompany = __eiInfo.getBlock("userByCompany").getMappedRows();
var companyCodeBox = __eiInfo.getBlock("roleCompany").getMappedRows(); var companyCodeBox = __eiInfo.getBlock("roleCompany").getMappedRows();
var projCodeBox = __eiInfo.getBlock("projRecordByRole_block_id").getMappedRows(); var projCodeBox = __eiInfo.getBlock("projRecordByRole_block_id").getMappedRows();
IPLATUI.EFGrid = { IPLATUI.EFGrid = {
"result": { "result": {
exportGrid: false, // 隐藏右侧自定义导出按钮 exportGrid: false, // 隐藏右侧自定义导出按钮
...@@ -14,18 +15,21 @@ $(function () { ...@@ -14,18 +15,21 @@ $(function () {
title: "操作", title: "操作",
template: function (item) { template: function (item) {
let template = ''; let template = '';
if (!isBlank(item.id)) { if (isBlank(item.id)) {
return template;
}
template += '<a style="cursor: pointer;display: inline-flex;justify-content: center;margin:auto 5px" '
+ 'onclick="showDetail(' + item.id + ', ' + item.status + ',0, ' + item.source
+ ')" >详情</a>';
if (item.status == 0) {
template += '<a style="cursor: pointer;display: inline-flex;justify-content: center;margin:auto 5px" ' template += '<a style="cursor: pointer;display: inline-flex;justify-content: center;margin:auto 5px" '
+ 'onclick="showDetail(' + item.id + ', ' + item.status + ',0, ' + item.source + 'onclick="modify(\'' + item.contractNo + '\')" >修改</a>';
+ ')" >详情</a>';
} }
if (!isBlank(item.id)) { // 审核通过的,可以进行合同变更
//审核通过的,可以进行合同变更 if (item.status == 2) {
if (item.status == 2) { template += '<a style="cursor: pointer;display: inline-flex;justify-content: center;margin:auto 5px" '
template += '<a style="cursor: pointer;display: inline-flex;justify-content: center;margin:auto 5px" ' + 'onclick="showDetail(' + item.id + ', ' + item.status + ', 1, '
+ 'onclick="showDetail(' + item.id + ', ' + item.status + ', 1, ' + item.source + ')" >合同变更</a>';
+ item.source + ')" >合同变更</a>';
}
} }
return template; return template;
} }
...@@ -197,6 +201,12 @@ $(function () { ...@@ -197,6 +201,12 @@ $(function () {
// 查询 // 查询
$("#QUERY").on("click", query); $("#QUERY").on("click", query);
// 新增
$("#ADD").on("click", add);
// 删除
$("#REMOVE").on("click", remove);
// 选择计划 // 选择计划
$("#SELECT_PLAN").on("click", selectPlan); $("#SELECT_PLAN").on("click", selectPlan);
...@@ -328,6 +338,46 @@ let purUserIdChange = function (e) { ...@@ -328,6 +338,46 @@ let purUserIdChange = function (e) {
} }
/** /**
* 新增
*/
let add = function () {
addOrUpdate("");
}
/**
* 修改
*/
let modify = function (contractNo) {
let params = "inqu_status-0-contractNo=" + contractNo;
addOrUpdate(params);
}
/**
* 新增/修改
*/
let addOrUpdate = function (params) {
JSColorbox.open({
href: "HGCG002C?" + params,
title: "<div style='text-align: center;'>" + (isBlank(params) ? "新增合同" : "修改合同") + "</div>",
width: "70%",
height: "70%",
callbackName: addOrUpdateCallback
});
}
/**
* 新增成功后回调
*/
let addOrUpdateCallback = function (res) {
// 消息
// message(res.msg);
// 刷新列表
query();
// 关闭弹窗
JSColorbox.close();
}
/**
* 保存 * 保存
*/ */
let save = function () { let save = function () {
...@@ -392,8 +442,8 @@ let selectPlan = function () { ...@@ -392,8 +442,8 @@ let selectPlan = function () {
JSColorbox.open({ JSColorbox.open({
href: "HGCG002A?methodName=initLoad", href: "HGCG002A?methodName=initLoad",
title: "<div style='text-align: center;'>计划查询</div>", title: "<div style='text-align: center;'>计划查询</div>",
width: "80%", width: "95%",
height: "90%", height: "95%",
callbackName: selectPlanCallback callbackName: selectPlanCallback
}); });
} }
...@@ -415,8 +465,8 @@ function showDetail(id,status,updateFlag,source) { ...@@ -415,8 +465,8 @@ function showDetail(id,status,updateFlag,source) {
JSColorbox.open({ JSColorbox.open({
href: "HGCG002B?methodName=initLoad&inqu_status-0-primaryId=" + id+"&inqu_status-0-status="+status+"&updateFlag="+updateFlag+"&source="+source, href: "HGCG002B?methodName=initLoad&inqu_status-0-primaryId=" + id+"&inqu_status-0-status="+status+"&updateFlag="+updateFlag+"&source="+source,
title: "<div style='text-align: center;'>详情</div>", title: "<div style='text-align: center;'>详情</div>",
width: "80%", width: "95%",
height: "80%", height: "95%",
callbackName: windowCallback callbackName: windowCallback
}); });
} }
......
...@@ -43,14 +43,13 @@ ...@@ -43,14 +43,13 @@
<EF:EFComboColumn ename="source" cname="数据来源" enable="false" width="80" align="center" defaultValue="1"> <EF:EFComboColumn ename="source" cname="数据来源" enable="false" width="80" align="center" defaultValue="1">
<EF:EFCodeOption codeName="hggp.hpcg.receiveSource"/> <EF:EFCodeOption codeName="hggp.hpcg.receiveSource"/>
</EF:EFComboColumn> </EF:EFComboColumn>
<EF:EFComboColumn ename="companyCode" cname="公司编码" <EF:EFComboColumn ename="companyCode" cname="公司编码" width="120" align="center"
columnTemplate="#=companyName#" itemTemplate="#=companyName#" columnTemplate="#=companyCode#" itemTemplate="#=companyCode#-#=companyName#"
textField="companyName" valueField="companyCode" textField="companyName" valueField="companyCode"
maxLength="16" readonly="false" width="100" required="true" maxLength="16" required="true" filter="contains" sort="true">
align="center" filter="contains" sort="true">
<EF:EFOptions blockId="roleCompany" textField="companyName" valueField="companyCode"/> <EF:EFOptions blockId="roleCompany" textField="companyName" valueField="companyCode"/>
</EF:EFComboColumn> </EF:EFComboColumn>
<EF:EFColumn ename="companyName" cname="公司名称" width="200" enable="false" readonly="true" align="center"/> <EF:EFColumn ename="companyName" cname="公司名称" enable="false" width="200" align="center"/>
<EF:EFColumn ename="projCode" cname="项目编码" width="140" align="center" required="true"/> <EF:EFColumn ename="projCode" cname="项目编码" width="140" align="center" required="true"/>
<EF:EFColumn ename="projName" cname="项目名称" enable="false" width="130" align="center"/> <EF:EFColumn ename="projName" cname="项目名称" enable="false" width="130" align="center"/>
<EF:EFColumn ename="contractDate" cname="合同日期" width="100" align="center" editType="date" <EF:EFColumn ename="contractDate" cname="合同日期" width="100" align="center" editType="date"
...@@ -71,11 +70,11 @@ ...@@ -71,11 +70,11 @@
<EF:EFOptions blockId="user_block_id" valueField="valueField" textField="textField"/> <EF:EFOptions blockId="user_block_id" valueField="valueField" textField="textField"/>
</EF:EFComboColumn> </EF:EFComboColumn>
<EF:EFColumn ename="purUserName" cname="采购员姓名" enable="false" width="120" align="center" hidden="true"/> <EF:EFColumn ename="purUserName" cname="采购员姓名" enable="false" width="120" align="center" hidden="true"/>
<EF:EFColumn ename="purQty" cname="采购数量" width="120" align="right" format="{0:N0}" enable="false" <EF:EFColumn ename="purQty" cname="采购数量" width="120" align="right" format="{0:N3}" enable="false"
defaultValue="0" sumType="page"/> defaultValue="0" sumType="page"/>
<EF:EFColumn ename="purWeight" cname="采购重量" width="120" align="right" format="{0:N3}" enable="false" <EF:EFColumn ename="purWeight" cname="采购重量" width="120" align="right" format="{0:N3}" enable="false"
defaultValue="0" sumType="page"/> defaultValue="0" sumType="page"/>
<EF:EFColumn ename="receiveQty" cname="已收货数量" enable="false" width="120" align="right" format="{0:N0}" <EF:EFColumn ename="receiveQty" cname="已收货数量" enable="false" width="120" align="right" format="{0:N3}"
defaultValue="0" sumType="page"/> defaultValue="0" sumType="page"/>
<EF:EFColumn ename="amount" cname="不含税金额" enable="false" width="120" align="right" format="{0:C2}" <EF:EFColumn ename="amount" cname="不含税金额" enable="false" width="120" align="right" format="{0:C2}"
defaultValue="0" sumType="page"/> defaultValue="0" sumType="page"/>
......
...@@ -38,7 +38,7 @@ ...@@ -38,7 +38,7 @@
<EF:EFColumn ename="length" cname="长(MM)" enable="false" width="80" align="right" format="{0:N3}"/> <EF:EFColumn ename="length" cname="长(MM)" enable="false" width="80" align="right" format="{0:N3}"/>
<EF:EFColumn ename="width" cname="宽(MM)" enable="false" width="80" align="right" format="{0:N3}"/> <EF:EFColumn ename="width" cname="宽(MM)" enable="false" width="80" align="right" format="{0:N3}"/>
<EF:EFColumn ename="thick" cname="厚(MM)" enable="false" width="80" align="right" format="{0:N3}"/> <EF:EFColumn ename="thick" cname="厚(MM)" enable="false" width="80" align="right" format="{0:N3}"/>
<EF:EFColumn ename="purQty" cname="采购数量" width="120" align="right" format="{0:N0}" sumType="page" <EF:EFColumn ename="purQty" cname="采购数量" width="120" align="right" format="{0:N3}" sumType="page"
required="true"/> required="true"/>
<EF:EFColumn ename="purWeight" cname="采购重量" width="120" align="right" format="{0:N3}" sumType="page" <EF:EFColumn ename="purWeight" cname="采购重量" width="120" align="right" format="{0:N3}" sumType="page"
required="true"/> required="true"/>
......
...@@ -8,8 +8,7 @@ $(function () { ...@@ -8,8 +8,7 @@ $(function () {
pageSize: 20, pageSize: 20,
pageSizes: [20, 50, 70, 100], pageSizes: [20, 50, 70, 100],
}, },
columns: [ columns: [{
{
field: "inventCode", field: "inventCode",
template: function (item) { template: function (item) {
let template = item.inventCode; let template = item.inventCode;
......
...@@ -12,14 +12,17 @@ ...@@ -12,14 +12,17 @@
<EF:EFInput ename="updateFlag" cname="合同变更标记" colWidth="3" type="hidden"/> <EF:EFInput ename="updateFlag" cname="合同变更标记" colWidth="3" type="hidden"/>
<EF:EFInput ename="source" cname="数据来源" colWidth="3" type="hidden"/> <EF:EFInput ename="source" cname="数据来源" colWidth="3" type="hidden"/>
<div class="row"> <div class="row">
<EF:EFSelect cname="存货编号" blockId="inqu_status" ename="inventCode" row="0" colWidth="3" <%-- <EF:EFSelect cname="存货编号" blockId="inqu_status" ename="inventCode" row="0" colWidth="3"--%>
filter="contains" optionLabel="全部" defultValue="" template="[#=valueField#]#=textField#"> <%-- filter="contains" optionLabel="全部" defultValue="" template="[#=valueField#]#=textField#">--%>
<EF:EFOptions blockId="invent_record_box_block_id" textField="textField" valueField="valueField"/> <%-- <EF:EFOptions blockId="invent_record_box_block_id" textField="textField" valueField="valueField"/>--%>
</EF:EFSelect> <%-- </EF:EFSelect>--%>
<EF:EFSelect cname="存货类型" ename="inqu_status-0-inventType" colWidth="3" filter="contains" template="[#=valueField#]#=textField#"> <EF:EFSelect cname="存货类型" ename="inqu_status-0-inventType" colWidth="3" filter="contains"
template="[#=valueField#]#=textField#">
<EF:EFOption label="全部" value=""/> <EF:EFOption label="全部" value=""/>
<EF:EFOptions blockId="invent_type_box_block_id" textField="textField" valueField="valueField"/> <EF:EFOptions blockId="invent_type_box_block_id" textField="textField" valueField="valueField"/>
</EF:EFSelect> </EF:EFSelect>
<EF:EFInput ename="inventName" cname="存货名称" blockId="inqu_status" row="0" colWidth="3"/>
<EF:EFInput ename="material" cname="材质" blockId="inqu_status" row="0" colWidth="3"/>
</div> </div>
</EF:EFRegion> </EF:EFRegion>
...@@ -40,11 +43,11 @@ ...@@ -40,11 +43,11 @@
<EF:EFColumn ename="length" cname="长(MM)" width="80" align="right" format="{0:N3}" required="true"/> <EF:EFColumn ename="length" cname="长(MM)" width="80" align="right" format="{0:N3}" required="true"/>
<EF:EFColumn ename="width" cname="宽(MM)" width="80" align="right" format="{0:N3}" required="true"/> <EF:EFColumn ename="width" cname="宽(MM)" width="80" align="right" format="{0:N3}" required="true"/>
<EF:EFColumn ename="thick" cname="厚(MM)" width="80" align="right" format="{0:N3}" required="true"/> <EF:EFColumn ename="thick" cname="厚(MM)" width="80" align="right" format="{0:N3}" required="true"/>
<EF:EFColumn ename="purQty" cname="采购数量" width="120" align="right" format="{0:N0}" required="true" <EF:EFColumn ename="purQty" cname="采购数量" width="120" align="right" format="{0:N3}" required="true"
defaultValue="0" sumType="page"/> defaultValue="0" sumType="page"/>
<EF:EFColumn ename="purWeight" cname="采购重量" width="120" align="right" format="{0:N3}" required="true" <EF:EFColumn ename="purWeight" cname="采购重量" width="120" align="right" format="{0:N3}" required="true"
defaultValue="0" sumType="page"/> defaultValue="0" sumType="page"/>
<EF:EFColumn ename="receiveQty" cname="已收货数量" enable="false" width="120" align="right" format="{0:N0}" <EF:EFColumn ename="receiveQty" cname="已收货数量" enable="false" width="120" align="right" format="{0:N3}"
defaultValue="0" sumType="page"/> defaultValue="0" sumType="page"/>
<EF:EFComboColumn ename="calculationMethod" cname="计算方式" enable="true" width="100" align="center" <EF:EFComboColumn ename="calculationMethod" cname="计算方式" enable="true" width="100" align="center"
copy="true" required="true"> copy="true" required="true">
......
$(function () {
IPLATUI.EFSelect = {
"inqu_status-0-companyCode": {
select: function (e) {
var dataItem = e.dataItem;
var valueField = dataItem['valueField'];
var textField = dataItem['textField'];
if (valueField) {
textField = textField.indexOf("-") > -1 ? textField.split("-")[1] : textField;
$("#inqu_status-0-companyName").val(textField);
} else {
$("#inqu_status-0-companyName").val("");
}
}
},
"inqu_status-0-supCode": {
select: function (e) {
var dataItem = e.dataItem;
var valueField = dataItem['valueField'];
var textField = dataItem['textField'];
if (valueField) {
textField = textField.indexOf("-") > -1 ? textField.split("-")[1] : textField;
$("#inqu_status-0-supName").val(textField);
} else {
$("#inqu_status-0-supName").val("");
}
}
},
"inqu_status-0-purUserId": {
select: function (e) {
var dataItem = e.dataItem;
var valueField = dataItem['valueField'];
var textField = dataItem['textField'];
if (valueField) {
textField = textField.indexOf("-") > -1 ? textField.split("-")[1] : textField;
$("#inqu_status-0-purUserName").val(textField);
} else {
$("#inqu_status-0-purUserName").val("");
}
}
}
}
IPLATUI.EFCascadeSelect = {
"inqu_status-0-projCode": {
change: function (e) {
let text = $("#inqu_status-0-projCode").data("kendoDropDownList").text();
$("#inqu_status-0-projName").val(text);
},
}
}
// 确认
$('#SAVE').on('click', save);
});
/**
* 保存
*/
let save = function () {
let msg = checkParam();
if (!isBlank(msg)) {
message(msg);
return;
}
JSUtils.submitGridsData("", "HGCG002C", "save", false, function (res) {
if (res.status > -1) {
parent.JSColorbox.setValueCallback(res);
} else {
message(res.msg);
}
});
}
/**
* 参数校验
*/
let checkParam = function () {
let contractDate = $("#inqu_status-0-contractDate").val();
if (isBlank(contractDate)) {
return "合同日期不能为空";
}
let companyCode = $("#inqu_status-0-companyCode").val();
if (isBlank(companyCode)) {
return "公司不能为空";
}
let projCode = $("#inqu_status-0-projCode").val();
if (isBlank(projCode)) {
return "项目不能为空";
}
let supCode = $("#inqu_status-0-supCode").val();
if (isBlank(supCode)) {
message("供应商不能为空");
return;
}
let purUserId = $("#inqu_status-0-purUserId").val();
if (isBlank(purUserId)) {
message("采购员不能为空");
return;
}
return "";
}
\ No newline at end of file
<!DOCTYPE html>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<%@ taglib prefix="EF" tagdir="/WEB-INF/tags/EF" %>
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %>
<c:set var="ctx" value="${pageContext.request.contextPath}"/>
<EF:EFPage title="合同详情">
<EF:EFRegion id="inqu" title="数据区域">
<EF:EFInput ename="id" cname="ID" blockId="inqu_status" row="0" type="hidden"/>
<div class="row">
<EF:EFInput ename="contractNo" cname="合同号" blockId="inqu_status" row="0" colWidth="6" ratio="2:10"
required="true" readonly="true"/>
</div>
<div class="row">
<EF:EFDatePicker ename="contractDate" cname="合同日期" blockId="inqu_status" row="0" colWidth="6"
ratio="2:10" format="yyyy-MM-dd" readonly="true" required="true"/>
</div>
<div class="row">
<EF:EFSelect ename="companyCode" cname="公司名称" blockId="inqu_status" row="0" colWidth="6" ratio="2:10"
filter="contains" required="true">
<EF:EFOption label="请选择" value=""/>
<EF:EFOptions blockId="company_code_block_id" textField="textField" valueField="valueField"/>
</EF:EFSelect>
<EF:EFInput ename="companyName" cname="公司名称" blockId="inqu_status" row="0" colWidth="6" ratio="2:10"
type="hidden"/>
</div>
<div class="row">
<EF:EFCascadeSelect cascadeFrom="inqu_status-0-companyCode" ename="projCode" cname="项目名称"
blockId="inqu_status" row="0" colWidth="6" ratio="2:10" filter="contains"
defaultValue="" serviceName="HGSC003" methodName="projComboBox"
resultId="projRecordByRole_block_id" textField="textField"
valueField="valueField" template="#=valueField#-#=textField#"
valueTemplate="#=valueField#-#=textField#" required="true">
</EF:EFCascadeSelect>
<EF:EFInput ename="projName" cname="项目名称" blockId="inqu_status" row="0" colWidth="6" ratio="2:10"
type="hidden"/>
</div>
<div class="row">
<EF:EFSelect ename="supCode" cname="供应商名称" blockId="inqu_status" row="0" colWidth="6" ratio="2:10"
filter="contains" required="true">
<EF:EFOption label="请选择" value=""/>
<EF:EFOptions blockId="sup_record_block_id" textField="textField" valueField="valueField"/>
</EF:EFSelect>
<EF:EFInput ename="supName" cname="供应商名称" blockId="inqu_status" row="0" colWidth="6" ratio="2:10"
type="hidden"/>
</div>
<div class="row">
<EF:EFSelect ename="purUserId" cname="采购员" blockId="inqu_status" row="0" colWidth="6" ratio="2:10"
filter="contains" required="true">
<EF:EFOption label="请选择" value=""/>
<EF:EFOptions blockId="user_block_id" textField="textField" valueField="valueField"/>
</EF:EFSelect>
<EF:EFInput ename="purUserName" cname="采购员姓名" blockId="inqu_status" row="0" colWidth="6" ratio="2:10"
type="hidden"/>
</div>
<br/>
<span style="color: red; ">说明:合同号由系统自动生成</span><br>
</EF:EFRegion>
</EF:EFPage>
\ No newline at end of file
...@@ -16,8 +16,7 @@ $(function () { ...@@ -16,8 +16,7 @@ $(function () {
let template = ''; let template = '';
if (!isBlank(item.id)) { if (!isBlank(item.id)) {
template += '<a style="cursor: pointer;display: inline-flex;justify-content: center;margin:auto 5px" ' template += '<a style="cursor: pointer;display: inline-flex;justify-content: center;margin:auto 5px" '
+ 'onclick="showDetail(' + item.id + ', ' + item.status + ', ' + item.source + 'onclick="showDetail(\'' + item.receiveNo + '\')" >详情</a>';
+ ')" >详情</a>';
} }
if (item.status == 0 && item.source == 1) { if (item.status == 0 && item.source == 1) {
...@@ -310,8 +309,8 @@ let selectContract = function () { ...@@ -310,8 +309,8 @@ let selectContract = function () {
JSColorbox.open({ JSColorbox.open({
href: "HGCG003A?methodName=initLoad", href: "HGCG003A?methodName=initLoad",
title: "<div style='text-align: center;'>合同查询</div>", title: "<div style='text-align: center;'>合同查询</div>",
width: "80%", width: "95%",
height: "90%", height: "95%",
callbackName: selectContractCallback callbackName: selectContractCallback
}); });
} }
...@@ -368,14 +367,15 @@ let purUserIdChange = function (e) { ...@@ -368,14 +367,15 @@ let purUserIdChange = function (e) {
/** /**
* 显示详情 * 显示详情
*
* @param receiveNo
*/ */
function showDetail(id, status, source) { function showDetail(receiveNo) {
JSColorbox.open({ JSColorbox.open({
href: "HGCG003B?methodName=initLoad&inqu_status-0-primaryId=" + id + "&status=" + status + "&source=" href: "HGCG003B?inqu_status-0-receiveNo=" + receiveNo,
+ source,
title: "<div style='text-align: center;'>详情</div>", title: "<div style='text-align: center;'>详情</div>",
width: "80%", width: "95%",
height: "90%", height: "95%",
callbackName: windowCallback callbackName: windowCallback
}); });
} }
......
...@@ -70,11 +70,11 @@ ...@@ -70,11 +70,11 @@
<EF:EFOptions blockId="user_block_id" valueField="valueField" textField="textField"/> <EF:EFOptions blockId="user_block_id" valueField="valueField" textField="textField"/>
</EF:EFComboColumn> </EF:EFComboColumn>
<EF:EFColumn ename="purUserName" cname="采购员姓名" enable="false" width="120" align="center" hidden="true"/> <EF:EFColumn ename="purUserName" cname="采购员姓名" enable="false" width="120" align="center" hidden="true"/>
<EF:EFColumn ename="receiveQty" cname="收货数量" enable="false" width="120" align="right" format="{0:N0}" <EF:EFColumn ename="receiveQty" cname="收货数量" enable="false" width="120" align="right" format="{0:N3}"
sumType="page"/> sumType="page"/>
<EF:EFColumn ename="deliverQty" cname="退货数量" enable="false" width="120" align="right" format="{0:N0}" <EF:EFColumn ename="deliverQty" cname="退货数量" enable="false" width="120" align="right" format="{0:N3}"
sumType="page"/> sumType="page"/>
<EF:EFColumn ename="depositQty" cname="入库数量" enable="false" width="120" align="right" format="{0:N0}" <EF:EFColumn ename="depositQty" cname="入库数量" enable="false" width="120" align="right" format="{0:N3}"
sumType="page"/> sumType="page"/>
<EF:EFColumn ename="receiveWeight" cname="收货重量" enable="false" width="120" align="right" format="{0:N3}" <EF:EFColumn ename="receiveWeight" cname="收货重量" enable="false" width="120" align="right" format="{0:N3}"
sumType="page"/> sumType="page"/>
......
This source diff could not be displayed because it is too large. You can view the blob instead.
This source diff could not be displayed because it is too large. You can view the blob instead.
This source diff could not be displayed because it is too large. You can view the blob instead.
This source diff could not be displayed because it is too large. You can view the blob instead.
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