Commit c011c9f6 by 宋祥

1.整改通知单增加处理按钮

2.日常巡检单可以修改处理人
3.采购收货详情可选择合同
parent f5b51324
...@@ -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";
} }
......
...@@ -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, "查询规格失败");
} }
......
...@@ -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为空的入库单才是工序质检单生成的入库单。
//更新工序质检单状态 //更新工序质检单状态
......
...@@ -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());
} }
......
<?xml version="1.0" encoding="UTF-8"?> <?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 <!DOCTYPE sqlMap PUBLIC "-//iBATIS.com//DTD SQL Map 2.0//EN" "http://www.ibatis.com/dtd/sql-map-2.dtd">
Generate time : 2024-06-05 10:34:21
Version : 1.0
schema : hggp
tableName : HGZL003
id BIGINT NOT NULL primarykey,
mat_id BIGINT NOT NULL,
task_id BIGINT NOT NULL,
tech_flow_id BIGINT,
tech_flow_name BIGINT,
invent_process_id BIGINT,
process_code VARCHAR,
process_name VARCHAR,
process_order BIGINT,
company_code VARCHAR NOT NULL,
company_name VARCHAR NOT NULL,
dep_code VARCHAR,
dep_name VARCHAR,
proj_code VARCHAR,
proj_name VARCHAR,
task_code VARCHAR,
check_code VARCHAR,
product_type TINYINT,
product_code VARCHAR,
product_name VARCHAR,
plan_start_date VARCHAR,
plan_end_date VARCHAR,
factory_code VARCHAR,
factory_name VARCHAR,
group_code VARCHAR,
group_name VARCHAR,
work_by VARCHAR,
work_name VARCHAR,
quantity TINYINT,
pass_quantity TINYINT,
unpass_quantity TINYINT,
single_weight DECIMAL,
total_weight DECIMAL,
check_by VARCHAR,
check_name VARCHAR,
check_date VARCHAR,
check_status TINYINT,
account_code VARCHAR NOT NULL,
created_by VARCHAR,
created_name VARCHAR,
created_time VARCHAR,
updated_by VARCHAR,
updated_name VARCHAR,
updated_time VARCHAR
-->
<sqlMap namespace="HGZL003"> <sqlMap namespace="HGZL003">
<sql id="condition"> <sql id="condition">
<include refid="HGXSDataAuth.authCondition"/> <include refid="HGXSDataAuth.authCondition"/>
<isNotEmpty prepend=" AND " property="id"> <isNotEmpty prepend=" AND " property="id">
id = #id# id = #id#
</isNotEmpty> </isNotEmpty>
...@@ -253,250 +203,131 @@ ...@@ -253,250 +203,131 @@
<include refid="condition" /> <include refid="condition" />
</select> </select>
<!-- <insert id="insert">
<isNotEmpty prepend=" AND " property="id"> INSERT INTO ${hggpSchema}.HGZL003 (
id = #id# mat_id, <!-- 物料清单ID -->
</isNotEmpty> task_id, <!-- 生产任务ID -->
<isNotEmpty prepend=" AND " property="matId"> tech_flow_id, <!-- 工艺流程ID -->
mat_id = #matId# tech_flow_name, <!-- 工艺流程名称 -->
</isNotEmpty> invent_process_id, <!-- 存货工序ID,对应HGPZ005A.id -->
<isNotEmpty prepend=" AND " property="taskId"> process_code, <!-- 工序编码 -->
task_id = #taskId# process_name, <!-- 工序名称 -->
</isNotEmpty> process_order, <!-- 加工顺序 -->
<isNotEmpty prepend=" AND " property="techFlowId"> company_code, <!-- 公司编码 -->
tech_flow_id = #techFlowId# company_name, <!-- 公司名称 -->
</isNotEmpty> dep_code, <!-- 部门编码 -->
<isNotEmpty prepend=" AND " property="techFlowName"> dep_name, <!-- 部门名称 -->
tech_flow_name = #techFlowName# proj_code, <!-- 项目编码 -->
</isNotEmpty> proj_name, <!-- 项目名称 -->
<isNotEmpty prepend=" AND " property="inventProcessId"> task_code, <!-- 生产任务单编码 -->
invent_process_id = #inventProcessId# check_code, <!-- 质检单编码 -->
</isNotEmpty> product_type, <!-- 产品类型 -->
<isNotEmpty prepend=" AND " property="processCode"> product_code, <!-- 产品编号 -->
process_code = #processCode# product_name, <!-- 产品名称 -->
</isNotEmpty> plan_start_date, <!-- 计划开始日期 -->
<isNotEmpty prepend=" AND " property="processName"> plan_end_date, <!-- 计划结束日期 -->
process_name = #processName# factory_code, <!-- 工厂编号 -->
</isNotEmpty> factory_name, <!-- 工厂名称 -->
<isNotEmpty prepend=" AND " property="processOrder"> group_code, <!-- 工作组编号 -->
process_order = #processOrder# group_name, <!-- 工作组名称 -->
</isNotEmpty> work_by, <!-- 生产人 -->
<isNotEmpty prepend=" AND " property="companyCode"> work_name, <!-- 生产人名称 -->
company_code = #companyCode# quantity, <!-- 数量 -->
</isNotEmpty> pass_quantity, <!-- 合格数量 -->
<isNotEmpty prepend=" AND " property="companyName"> unpass_quantity, <!-- 不合格数量 -->
company_name = #companyName# single_weight, <!-- 单重 -->
</isNotEmpty> total_weight, <!-- 总重 -->
<isNotEmpty prepend=" AND " property="depCode"> check_by, <!-- 质检人 -->
dep_code = #depCode# check_name, <!-- 质检人名称 -->
</isNotEmpty> check_date, <!-- 质检日期 -->
<isNotEmpty prepend=" AND " property="depName"> check_status, <!-- 提交状态 0:质检中;1:质检完成 -->
dep_name = #depName# account_code, <!-- 帐套 -->
</isNotEmpty> created_by, <!-- 创建人 -->
<isNotEmpty prepend=" AND " property="projCode"> created_name, <!-- 创建人名称 -->
proj_code = #projCode# created_time, <!-- 创建时间 -->
</isNotEmpty> updated_by, <!-- 更新人 -->
<isNotEmpty prepend=" AND " property="projName"> updated_name, <!-- 修改人名称 -->
proj_name = #projName# updated_time <!-- 更新时间 -->
</isNotEmpty> ) VALUES (#matId#, #taskId#, #techFlowId#, #techFlowName#, #inventProcessId#, #processCode#, #processName#,
<isNotEmpty prepend=" AND " property="taskCode"> #processOrder#, #companyCode#, #companyName#, #depCode#, #depName#, #projCode#, #projName#, #taskCode#,
task_code = #taskCode# #checkCode#, #productType#, #productCode#, #productName#, #planStartDate#, #planEndDate#, #factoryCode#,
</isNotEmpty> #factoryName#, #groupCode#, #groupName#, #workBy#, #workName#, #quantity#, #passQuantity#, #unpassQuantity#,
<isNotEmpty prepend=" AND " property="checkCode"> #singleWeight#, #totalWeight#, #checkBy#, #checkName#, #checkDate#, #checkStatus#, #accountCode#, #createdBy#,
check_code = #checkCode# #createdName#, #createdTime#, #updatedBy#, #updatedName#, #updatedTime#)
</isNotEmpty> <selectKey resultClass="long" keyProperty="id">
<isNotEmpty prepend=" AND " property="productType"> SELECT MAX(ID) AS "id" FROM ${hggpSchema}.HGSC003
product_type = #productType# </selectKey>
</isNotEmpty> </insert>
<isNotEmpty prepend=" AND " property="productCode">
product_code = #productCode#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="productName">
product_name = #productName#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="planStartDate">
plan_start_date = #planStartDate#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="planEndDate">
plan_end_date = #planEndDate#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="factoryCode">
factory_code = #factoryCode#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="factoryName">
factory_name = #factoryName#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="groupCode">
group_code = #groupCode#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="groupName">
group_name = #groupName#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="workBy">
work_by = #workBy#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="workName">
work_name = #workName#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="quantity">
quantity = #quantity#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="passQuantity">
pass_quantity = #passQuantity#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="unpassQuantity">
unpass_quantity = #unpassQuantity#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="singleWeight">
single_weight = #singleWeight#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="totalWeight">
total_weight = #totalWeight#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="checkBy">
check_by = #checkBy#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="checkName">
check_name = #checkName#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="checkDate">
check_date = #checkDate#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="checkStatus">
check_status = #checkStatus#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="accountCode">
account_code = #accountCode#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="createdBy">
created_by = #createdBy#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="createdName">
created_name = #createdName#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="createdTime">
created_time = #createdTime#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="updatedBy">
updated_by = #updatedBy#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="updatedName">
updated_name = #updatedName#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="updatedTime">
updated_time = #updatedTime#
</isNotEmpty>
-->
<insert id="insert">
INSERT INTO ${hggpSchema}.HGZL003 (id,
mat_id, <!-- 物料清单ID -->
task_id, <!-- 生产任务ID -->
tech_flow_id, <!-- 工艺流程ID -->
tech_flow_name, <!-- 工艺流程名称 -->
invent_process_id, <!-- 存货工序ID,对应HGPZ005A.id -->
process_code, <!-- 工序编码 -->
process_name, <!-- 工序名称 -->
process_order, <!-- 加工顺序 -->
company_code, <!-- 公司编码 -->
company_name, <!-- 公司名称 -->
dep_code, <!-- 部门编码 -->
dep_name, <!-- 部门名称 -->
proj_code, <!-- 项目编码 -->
proj_name, <!-- 项目名称 -->
task_code, <!-- 生产任务单编码 -->
check_code, <!-- 质检单编码 -->
product_type, <!-- 产品类型 -->
product_code, <!-- 产品编号 -->
product_name, <!-- 产品名称 -->
plan_start_date, <!-- 计划开始日期 -->
plan_end_date, <!-- 计划结束日期 -->
factory_code, <!-- 工厂编号 -->
factory_name, <!-- 工厂名称 -->
group_code, <!-- 工作组编号 -->
group_name, <!-- 工作组名称 -->
work_by, <!-- 生产人 -->
work_name, <!-- 生产人名称 -->
quantity, <!-- 数量 -->
pass_quantity, <!-- 合格数量 -->
unpass_quantity, <!-- 不合格数量 -->
single_weight, <!-- 单重 -->
total_weight, <!-- 总重 -->
check_by, <!-- 质检人 -->
check_name, <!-- 质检人名称 -->
check_date, <!-- 质检日期 -->
check_status, <!-- 提交状态 0:质检中;1:质检完成 -->
account_code, <!-- 帐套 -->
created_by, <!-- 创建人 -->
created_name, <!-- 创建人名称 -->
created_time, <!-- 创建时间 -->
updated_by, <!-- 更新人 -->
updated_name, <!-- 修改人名称 -->
updated_time <!-- 更新时间 -->
)
VALUES (#id#, #matId#, #taskId#, #techFlowId#, #techFlowName#, #inventProcessId#, #processCode#, #processName#, #processOrder#, #companyCode#, #companyName#, #depCode#, #depName#, #projCode#, #projName#, #taskCode#, #checkCode#, #productType#, #productCode#, #productName#, #planStartDate#, #planEndDate#, #factoryCode#, #factoryName#, #groupCode#, #groupName#, #workBy#, #workName#, #quantity#, #passQuantity#, #unpassQuantity#, #singleWeight#, #totalWeight#, #checkBy#, #checkName#, #checkDate#, #checkStatus#, #accountCode#, #createdBy#, #createdName#, #createdTime#, #updatedBy#, #updatedName#, #updatedTime#)
<selectKey resultClass="long" keyProperty="id">
SELECT MAX(ID) AS "id" FROM ${hggpSchema}.HGSC003
</selectKey>
</insert>
<delete id="delete"> <delete id="delete">
DELETE FROM ${hggpSchema}.HGZL003 WHERE DELETE FROM ${hggpSchema}.HGZL003 WHERE
id = #id# id = #id#
</delete> </delete>
<update id="update"> <update id="update">
UPDATE ${hggpSchema}.HGZL003 UPDATE ${hggpSchema}.HGZL003
SET SET
mat_id = #matId#, <!-- 物料清单ID --> mat_id = #matId#, <!-- 物料清单ID -->
task_id = #taskId#, <!-- 生产任务ID --> task_id = #taskId#, <!-- 生产任务ID -->
tech_flow_id = #techFlowId#, <!-- 工艺流程ID --> tech_flow_id = #techFlowId#, <!-- 工艺流程ID -->
tech_flow_name = #techFlowName#, <!-- 工艺流程名称 --> tech_flow_name = #techFlowName#, <!-- 工艺流程名称 -->
invent_process_id = #inventProcessId#, <!-- 存货工序ID,对应HGPZ005A.id --> invent_process_id = #inventProcessId#, <!-- 存货工序ID,对应HGPZ005A.id -->
process_code = #processCode#, <!-- 工序编码 --> process_code = #processCode#, <!-- 工序编码 -->
process_name = #processName#, <!-- 工序名称 --> process_name = #processName#, <!-- 工序名称 -->
process_order = #processOrder#, <!-- 加工顺序 --> process_order = #processOrder#, <!-- 加工顺序 -->
company_code = #companyCode#, <!-- 公司编码 --> company_code = #companyCode#, <!-- 公司编码 -->
company_name = #companyName#, <!-- 公司名称 --> company_name = #companyName#, <!-- 公司名称 -->
dep_code = #depCode#, <!-- 部门编码 --> dep_code = #depCode#, <!-- 部门编码 -->
dep_name = #depName#, <!-- 部门名称 --> dep_name = #depName#, <!-- 部门名称 -->
proj_code = #projCode#, <!-- 项目编码 --> proj_code = #projCode#, <!-- 项目编码 -->
proj_name = #projName#, <!-- 项目名称 --> proj_name = #projName#, <!-- 项目名称 -->
task_code = #taskCode#, <!-- 生产任务单编码 --> task_code = #taskCode#, <!-- 生产任务单编码 -->
check_code = #checkCode#, <!-- 质检单编码 --> check_code = #checkCode#, <!-- 质检单编码 -->
product_type = #productType#, <!-- 产品类型 --> product_type = #productType#, <!-- 产品类型 -->
product_code = #productCode#, <!-- 产品编号 --> product_code = #productCode#, <!-- 产品编号 -->
product_name = #productName#, <!-- 产品名称 --> product_name = #productName#, <!-- 产品名称 -->
plan_start_date = #planStartDate#, <!-- 计划开始日期 --> plan_start_date = #planStartDate#, <!-- 计划开始日期 -->
plan_end_date = #planEndDate#, <!-- 计划结束日期 --> plan_end_date = #planEndDate#, <!-- 计划结束日期 -->
factory_code = #factoryCode#, <!-- 工厂编号 --> factory_code = #factoryCode#, <!-- 工厂编号 -->
factory_name = #factoryName#, <!-- 工厂名称 --> factory_name = #factoryName#, <!-- 工厂名称 -->
group_code = #groupCode#, <!-- 工作组编号 --> group_code = #groupCode#, <!-- 工作组编号 -->
group_name = #groupName#, <!-- 工作组名称 --> group_name = #groupName#, <!-- 工作组名称 -->
work_by = #workBy#, <!-- 生产人 --> work_by = #workBy#, <!-- 生产人 -->
work_name = #workName#, <!-- 生产人名称 --> work_name = #workName#, <!-- 生产人名称 -->
quantity = #quantity#, <!-- 数量 --> quantity = #quantity#, <!-- 数量 -->
pass_quantity = #passQuantity#, <!-- 合格数量 --> pass_quantity = #passQuantity#, <!-- 合格数量 -->
unpass_quantity = #unpassQuantity#, <!-- 不合格数量 --> unpass_quantity = #unpassQuantity#, <!-- 不合格数量 -->
single_weight = #singleWeight#, <!-- 单重 --> single_weight = #singleWeight#, <!-- 单重 -->
total_weight = #totalWeight#, <!-- 总重 --> total_weight = #totalWeight#, <!-- 总重 -->
check_by = #checkBy#, <!-- 质检人 --> check_by = #checkBy#, <!-- 质检人 -->
check_name = #checkName#, <!-- 质检人名称 --> check_name = #checkName#, <!-- 质检人名称 -->
check_date = #checkDate#, <!-- 质检日期 --> check_date = #checkDate#, <!-- 质检日期 -->
check_status = #checkStatus#, <!-- 提交状态 0:质检中;1:质检完成 --> check_status = #checkStatus#, <!-- 提交状态 0:质检中;1:质检完成 -->
account_code = #accountCode#, <!-- 帐套 --> account_code = #accountCode#, <!-- 帐套 -->
created_by = #createdBy#, <!-- 创建人 --> created_by = #createdBy#, <!-- 创建人 -->
created_name = #createdName#, <!-- 创建人名称 --> created_name = #createdName#, <!-- 创建人名称 -->
created_time = #createdTime#, <!-- 创建时间 --> created_time = #createdTime#, <!-- 创建时间 -->
updated_by = #updatedBy#, <!-- 更新人 --> updated_by = #updatedBy#, <!-- 更新人 -->
updated_name = #updatedName#, <!-- 修改人名称 --> updated_name = #updatedName#, <!-- 修改人名称 -->
updated_time = #updatedTime# <!-- 更新时间 --> updated_time = #updatedTime# <!-- 更新时间 -->
WHERE WHERE
id = #id# id = #id#
</update> </update>
<delete id="batch_delete"> <delete id="batch_delete">
DELETE FROM ${hggpSchema}.HGZL003 WHERE DELETE FROM ${hggpSchema}.HGZL003 WHERE
id IN <iterate close=")" open="(" conjunction="," property="ids">#ids[]#</iterate> id IN <iterate close=")" open="(" conjunction="," property="ids">#ids[]#</iterate>
</delete> </delete>
<!-- 修改 -->
<update id="updateInfo">
UPDATE ${hggpSchema}.HGZL003
SET
check_by = #checkBy#, <!-- 质检人 -->
check_name = #checkName#, <!-- 质检人名称 -->
check_date = #checkDate#, <!-- 质检日期 -->
<include refid="SqlBase.updateRevise"/>
WHERE id = #id#
</update>
</sqlMap> </sqlMap>
...@@ -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
......
...@@ -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"
......
...@@ -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>
......
$(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
}); });
} }
......
...@@ -6,6 +6,7 @@ ...@@ -6,6 +6,7 @@
<c:set var="ctx" value="${pageContext.request.contextPath}"/> <c:set var="ctx" value="${pageContext.request.contextPath}"/>
<EF:EFPage title="合同查询"> <EF:EFPage title="合同查询">
<EF:EFInput ename="receiveNo" cname="收货单号" blockId="main" row="0" hidden="true"/>
<EF:EFRegion id="inqu" title="查询区域" type="query"> <EF:EFRegion id="inqu" title="查询区域" type="query">
<div class="row"> <div class="row">
<EF:EFDatePicker cname="合同日期" blockId="inqu_status" ename="contractDate" row="0" colWidth="3" <EF:EFDatePicker cname="合同日期" blockId="inqu_status" ename="contractDate" row="0" colWidth="3"
...@@ -89,6 +90,7 @@ ...@@ -89,6 +90,7 @@
sumType="page"/> sumType="page"/>
<EF:EFColumn ename="taxIncludeAmount" cname="含税金额" enable="false" width="120" align="right" <EF:EFColumn ename="taxIncludeAmount" cname="含税金额" enable="false" width="120" align="right"
format="{0:C2}" sumType="page"/> format="{0:C2}" sumType="page"/>
<EF:EFColumn ename="contractLineNo" cname="合同行号" enable="false" width="120" align="center"/>
<EF:EFColumn ename="planNo" cname="计划单号" enable="false" width="120" align="center"/> <EF:EFColumn ename="planNo" cname="计划单号" enable="false" width="120" align="center"/>
<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"
......
$(function () { $(function () {
var inventRecordBoxBlockId = __eiInfo.getBlock("invent_record_box_block_id").getMappedRows(); let inventRecordBoxBlockId = __eiInfo.getBlock("invent_record_box_block_id").getMappedRows();
IPLATUI.EFGrid = { IPLATUI.EFGrid = {
"result": { "result": {
...@@ -57,11 +57,11 @@ $(function () { ...@@ -57,11 +57,11 @@ $(function () {
} }
}], }],
beforeEdit: function (e) { beforeEdit: function (e) {
var status = $("#status").val(); var status = $("#main-0-status").val();
if (status != '0' && status != '2') { if (status != '0' && status != '2') {
e.preventDefault(); e.preventDefault();
} }
var source = $("#source").val(); var source = $("#main-0-source").val();
if (source === '0') { if (source === '0') {
//选择合同的明细不能修改存货信息 //选择合同的明细不能修改存货信息
for (let i = 0; i < e.sender.columns.length; i++) { for (let i = 0; i < e.sender.columns.length; i++) {
...@@ -153,6 +153,9 @@ $(function () { ...@@ -153,6 +153,9 @@ $(function () {
// 查询 // 查询
$("#QUERY").on("click", query); $("#QUERY").on("click", query);
// 选择合同
$("#SELECT_HT").on("click", selectContract);
downKeyUp(); downKeyUp();
}); });
...@@ -164,20 +167,24 @@ $(window).load(function () { ...@@ -164,20 +167,24 @@ $(window).load(function () {
query(); query();
initInventCode(); initInventCode();
// 主合同状态,0.待确认,2.已收货
var status = $("#status").val(); var status = $("#main-0-status").val();
if (status != '0' && status != '2') { if (status != '0' && status != '2') {
$(".k-grid-add").hide(); $(".k-grid-add").hide();
$(".k-grid-save-changes").hide(); $(".k-grid-save-changes").hide();
$(".k-grid-cancel-changes").hide(); $(".k-grid-cancel-changes").hide();
$(".k-grid-delete").hide(); $(".k-grid-delete").hide();
$("#SELECT_HT").hide();
} else { } else {
//合同选择的存货不让新增、删除 // 合同选择的存货不让新增、删除
var source = $("#source").val(); var source = $("#main-0-source").val();
if (source === '0') { if (source === '0') {
$(".k-grid-add").hide(); $(".k-grid-add").hide();
$(".k-grid-cancel-changes").hide(); $(".k-grid-cancel-changes").hide();
$(".k-grid-delete").hide(); $(".k-grid-delete").hide();
$("#SELECT_HT").show();
} else {
$("#SELECT_HT").hide();
} }
} }
}); });
...@@ -315,3 +322,30 @@ let calUnitWeight = function (item, length, width, thick, coefficient) { ...@@ -315,3 +322,30 @@ let calUnitWeight = function (item, length, width, thick, coefficient) {
resultGrid.setCellValue(item, 'receiveUnitWeight', unitWeight); resultGrid.setCellValue(item, 'receiveUnitWeight', unitWeight);
resultGrid.setCellValue(item, 'receiveWeight', item.receiveQty * unitWeight); resultGrid.setCellValue(item, 'receiveWeight', item.receiveQty * unitWeight);
} }
/**
* 选择
*/
let selectContract = function () {
let params = {
"main-0-receiveNo": $("#inqu_status-0-receiveNo").val()
}
JSColorbox.open({
href: "HGCG003A",
title: "<div style='text-align: center;'>合同查询</div>",
width: "95%",
height: "95%",
params: params,
callbackName: selectContractCallback
});
}
/**
* 选择回调
*/
let selectContractCallback = function () {
// 刷新页面
query();
// 关闭弹窗
JSColorbox.close();
}
\ No newline at end of file
...@@ -7,15 +7,16 @@ ...@@ -7,15 +7,16 @@
<EF:EFPage title="采购收货"> <EF:EFPage title="采购收货">
<EF:EFRegion id="inqu" title="查询条件"> <EF:EFRegion id="inqu" title="查询条件">
<EF:EFInput ename="inqu_status-0-primaryId" cname="主表id" colWidth="3" type="hidden"/> <EF:EFInput ename="source" cname="来源" blockId="main" row="0" type="hidden"/>
<EF:EFInput ename="status" cname="状态" colWidth="3" type="hidden"/> <EF:EFInput ename="status" cname="状态" blockId="main" row="0" type="hidden"/>
<EF:EFInput ename="source" cname="数据来源" colWidth="3" type="hidden"/>
<div class="row"> <div class="row">
<EF:EFInput ename="receiveNo" cname="收货单号" blockId="inqu_status" row="0" readonly="true"/>
<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_block_id" textField="textField" valueField="valueField"/> <EF:EFOptions blockId="invent_record_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>
......
...@@ -31,17 +31,19 @@ ...@@ -31,17 +31,19 @@
</EF:EFRegion> </EF:EFRegion>
<EF:EFRegion id="result" title="记录集"> <EF:EFRegion id="result" title="记录集">
<EF:EFGrid blockId="result" autoDraw="override" isFloat="true"> <EF:EFGrid blockId="result" autoDraw="override" isFloat="true" sort="single">
<EF:EFColumn ename="id" cname="主键" hidden="true"/> <EF:EFColumn ename="id" cname="主键" hidden="true"/>
<EF:EFColumn ename="operator" cname="操作" locked="true" enable="false" width="160" align="center"/> <EF:EFColumn ename="operator" cname="操作" locked="true" enable="false" width="160" align="center"
<EF:EFColumn cname="存货编码" ename="inventCode" width="140" align="center" enable="true" required="true" readonly="true"/> sort="false"/>
<EF:EFColumn cname="存货编码" ename="inventCode" width="140" align="center" enable="true" required="true"
readonly="true" sort="true"/>
<EF:EFComboColumn ename="inventType" cname="存货类型" width="120" align="center" required="true" <EF:EFComboColumn ename="inventType" cname="存货类型" width="120" align="center" required="true"
blockName="invent_type_box_block_id" textField="textField" valueField="valueField" blockName="invent_type_box_block_id" textField="textField" valueField="valueField"
columnTemplate="#=textField#" itemTemplate="#=textField#" readonly="false" columnTemplate="#=textField#" itemTemplate="#=textField#" readonly="false"
filter="contains"> filter="contains">
</EF:EFComboColumn> </EF:EFComboColumn>
<EF:EFColumn ename="inventTypeDetail" cname="存货类型大类" hidden="true"/> <EF:EFColumn ename="inventTypeDetail" cname="存货类型大类" hidden="true"/>
<EF:EFColumn ename="inventName" cname="存货名称" width="120" align="center" required="true"/> <EF:EFColumn ename="inventName" cname="存货名称" width="120" align="center" required="true" sort="true"/>
<EF:EFColumn ename="spec" cname="规格" width="140" align="center" maxLength="50"/> <EF:EFColumn ename="spec" cname="规格" width="140" align="center" maxLength="50"/>
<EF:EFColumn ename="length" cname="长(MM)" width="100" align="right" format="{0:N2}" maxLength="10"/> <EF:EFColumn ename="length" cname="长(MM)" width="100" align="right" format="{0:N2}" maxLength="10"/>
<EF:EFColumn ename="width" cname="宽(MM)" width="100" align="right" format="{0:N2}" maxLength="10"/> <EF:EFColumn ename="width" cname="宽(MM)" width="100" align="right" format="{0:N2}" maxLength="10"/>
...@@ -52,7 +54,7 @@ ...@@ -52,7 +54,7 @@
<EF:EFComboColumn ename="status" cname="状态" align="center" width="80" required="true" defaultValue="1"> <EF:EFComboColumn ename="status" cname="状态" align="center" width="80" required="true" defaultValue="1">
<EF:EFCodeOption codeName="hpjx.hpjx.status"/> <EF:EFCodeOption codeName="hpjx.hpjx.status"/>
</EF:EFComboColumn> </EF:EFComboColumn>
<EF:EFColumn ename="isFlowId" cname="是否分配" width="80" align="center"/> <EF:EFColumn ename="isFlowId" cname="是否分配" width="100" align="center"/>
<EF:EFColumn cname="创建人" ename="createdName" enable="false" align="center"/> <EF:EFColumn cname="创建人" ename="createdName" enable="false" align="center"/>
<EF:EFColumn cname="创建时间" ename="createdTime" enable="false" width="140" align="center" <EF:EFColumn cname="创建时间" ename="createdTime" enable="false" width="140" align="center"
editType="datetime" parseFormats="['yyyyMMddHHmmss','yyyy-MM-dd HH:mm:ss']"/> editType="datetime" parseFormats="['yyyyMMddHHmmss','yyyy-MM-dd HH:mm:ss']"/>
......
...@@ -31,14 +31,16 @@ ...@@ -31,14 +31,16 @@
</EF:EFRegion> </EF:EFRegion>
<EF:EFRegion id="result" title="记录集"> <EF:EFRegion id="result" title="记录集">
<EF:EFGrid blockId="result" autoDraw="override" isFloat="true"> <EF:EFGrid blockId="result" autoDraw="override" isFloat="true" sort="single">
<EF:EFColumn ename="id" cname="主键" hidden="true"/> <EF:EFColumn ename="id" cname="主键" hidden="true"/>
<EF:EFColumn ename="operator" cname="操作" locked="true" enable="false" width="160" align="center"/> <EF:EFColumn ename="operator" cname="操作" locked="true" enable="false" width="160" align="center"
<EF:EFColumn cname="存货编码" ename="inventCode" width="140" align="center" enable="true" required="true" readonly="true"/> sort="false"/>
<EF:EFColumn cname="存货编码" ename="inventCode" width="140" align="center" enable="true" required="true"
readonly="true"/>
<EF:EFComboColumn ename="inventType" cname="存货类型" width="120" align="center" required="true" <EF:EFComboColumn ename="inventType" cname="存货类型" width="120" align="center" required="true"
blockName="invent_type_box_block_id" textField="textField" valueField="valueField" blockName="invent_type_box_block_id" textField="textField" valueField="valueField"
columnTemplate="#=textField#" itemTemplate="#=textField#" readonly="false" columnTemplate="#=textField#" itemTemplate="#=textField#" readonly="false"
filter="contains"> filter="contains">
</EF:EFComboColumn> </EF:EFComboColumn>
<EF:EFColumn ename="inventTypeDetail" cname="存货类型大类" hidden="true"/> <EF:EFColumn ename="inventTypeDetail" cname="存货类型大类" hidden="true"/>
<EF:EFColumn ename="inventName" cname="存货名称" width="120" align="center" required="true"/> <EF:EFColumn ename="inventName" cname="存货名称" width="120" align="center" required="true"/>
......
$(function() { $(function() {
var whTypeBox = __eiInfo.getBlock("invent_type_box_block_id").getMappedRows(); // var whTypeBox = __eiInfo.getBlock("invent_type_box_block_id").getMappedRows();
// 查询 // 查询
$("#QUERY").on("click", query); $("#QUERY").on("click", query);
......
...@@ -77,7 +77,7 @@ ...@@ -77,7 +77,7 @@
</div> </div>
</EF:EFRegion> </EF:EFRegion>
<EF:EFRegion id="result" title="明细信息" fitHeight="true"> <EF:EFRegion id="result" title="明细信息" fitHeight="true">
<EF:EFGrid blockId="result" autoDraw="no" autoBind="false" showCount="true" height="74vh" sort="all" <EF:EFGrid blockId="result" autoDraw="no" autoBind="false" showCount="true" sort="all"
serviceName="HGWD099" queryMethod="query" deleteMethod="delete"> serviceName="HGWD099" queryMethod="query" deleteMethod="delete">
<EF:EFColumn ename="id" cname="ID" hidden="true"/> <EF:EFColumn ename="id" cname="ID" hidden="true"/>
<EF:EFColumn ename="docId" cname="文件ID" enable="false" width="180" hidden="true"/> <EF:EFColumn ename="docId" cname="文件ID" enable="false" width="180" hidden="true"/>
......
...@@ -107,8 +107,8 @@ $(function () { ...@@ -107,8 +107,8 @@ $(function () {
}, },
/*ROOT:{label: 'root',text: '组织机构'},*/ /*ROOT:{label: 'root',text: '组织机构'},*/
template: function (node) { template: function (node) {
var item = node.item; let item = node.item;
var title = item.text; let title = item.text;
let icon = 'fa fa-globe' let icon = 'fa fa-globe'
if (item.label !== 'root') { if (item.label !== 'root') {
switch (item.leafType) { switch (item.leafType) {
......
...@@ -85,18 +85,7 @@ $(function () { ...@@ -85,18 +85,7 @@ $(function () {
//选择生产任务 //选择生产任务
$("#BNT_SELECT").on("click", selectTask); $("#BNT_SELECT").on("click", selectTask);
// 此 grid 对象 // 此 grid 对象
grid.dataSource.bind("change", function(e) { gridChange(grid);
// 判断父级节点是否发生变化
if (e.field == "unpassQuantity") {
// loadChange(grid,e,"passQuantity");
var passQuantity = e.items[0]['quantity'] - e.items[0]['unpassQuantity'];
resultGrid.setCellValue(e.items[0],"passQuantity",passQuantity.toFixed(3));
}
if (e.field == "workBy") {
loadChange(grid,e,"workName");
}
});
}, },
onCheckRow: function (e){ onCheckRow: function (e){
if(e.checked){ if(e.checked){
...@@ -104,8 +93,11 @@ $(function () { ...@@ -104,8 +93,11 @@ $(function () {
// var now = new Date() // var now = new Date()
// resultGrid.setCellValue(e.row, "checkDate", now.getFullYear() + "-" + now.getMonth() + "-" + now.getDay()); // resultGrid.setCellValue(e.row, "checkDate", now.getFullYear() + "-" + now.getMonth() + "-" + now.getDay());
// } // }
resultGrid.setCellValue(e.row, "checkBy", loginUser[0].userId); // 如果为空,默认为当前登录人
resultGrid.setCellValue(e.row, "checkName", loginUser[0].userName); if (isBlank(e.model.checkName)) {
resultGrid.setCellValue(e.row, "checkBy", loginUser[0].userId);
resultGrid.setCellValue(e.row, "checkName", loginUser[0].userName);
}
} }
// else{ // else{
// if(e.model.checkStatus === '0'){ // if(e.model.checkStatus === '0'){
...@@ -154,22 +146,20 @@ let save = function () { ...@@ -154,22 +146,20 @@ let save = function () {
return; return;
} }
for (let i = 0; i < rows.length; i++) { for (let i = 0; i < rows.length; i++) {
// let passQuantity = rows[i]['passQuantity'];
let unpassQuantity = rows[i]['unpassQuantity']; let unpassQuantity = rows[i]['unpassQuantity'];
let quantity = rows[i]['quantity']; let quantity = rows[i]['quantity'];
let checkDate = rows[i]['checkDate']; let checkDate = rows[i]['checkDate'];
let workBy = rows[i]['workBy']; let workBy = rows[i]['workBy'];
let checkStatus = rows[i]['checkStatus']; let checkStatus = rows[i]['checkStatus'];
if (isBlank(workBy)) {
if(!workBy){
message("第" + (i + 1) + "行请选择生产人员!"); message("第" + (i + 1) + "行请选择生产人员!");
return; return;
} }
if(!unpassQuantity) { if (isBlank(unpassQuantity)) {
message("第" + (i + 1) + "行请输入不合格数量!"); message("第" + (i + 1) + "行请输入不合格数量!");
return; return;
} }
if (!isNumber(unpassQuantity)) { if (!isNumber(unpassQuantity)) {
message("第" + (i + 1) + "行不合格数量必须是大于等于0的数字!"); message("第" + (i + 1) + "行不合格数量必须是大于等于0的数字!");
return; return;
} }
...@@ -181,7 +171,7 @@ let save = function () { ...@@ -181,7 +171,7 @@ let save = function () {
message("第" + (i + 1) + "行不合格数量不能大于报工数量!"); message("第" + (i + 1) + "行不合格数量不能大于报工数量!");
return; return;
} }
if(!checkDate){ if (isBlank(checkDate)) {
message("第" + (i + 1) + "行请选择质检日期!"); message("第" + (i + 1) + "行请选择质检日期!");
return; return;
} }
...@@ -197,29 +187,62 @@ let save = function () { ...@@ -197,29 +187,62 @@ let save = function () {
}); });
} }
function selectTask(){ function selectTask(){
JSColorbox.open({ JSColorbox.open({
href: "HGZL003A?methodName=initLoad", href: "HGZL003A",
title: "<div style='text-align: center;'>选择生产任务</div>", title: "<div style='text-align: center;'>选择生产任务</div>",
width: "90%", width: "90%",
height: "90%", height: "90%",
callbackName: function (row) { callbackName: selectTaskCallBack
var now = new Date();
var nowStr = now.getFullYear() + "-" + String(now.getMonth() + 1).padStart(2, '0') + "-" + String(now.getDate()).padStart(2, '0');
row.checkDate = nowStr;
row.taskId = row.id;
row.id = "";
row.checkBy = loginUser[0].userId;
row.checkName = loginUser[0].userName;
row.workName = "";
row.workCode = "";
row.checkStatus = 1;
row.unpassQuantity = "";
row.passQuantity = "";
resultGrid.addRows(row);
JSColorbox.close();
}
}); });
} }
/**
* 选择任务回调
*
* @param res
*/
let selectTaskCallBack = function (row) {
row.taskId = row.id;
row.id = "";
row.checkBy = loginUser[0].userId;
row.checkName = loginUser[0].userName;
row.workName = "";
row.workCode = "";
row.checkCode = "";
row.checkStatus = 1;
row.unpassQuantity = "";
row.passQuantity = "";
resultGrid.addRows(row);
// 关闭弹窗
JSColorbox.close();
}
/**
* 表格变更
*
* @param grid
*/
let gridChange = function (grid) {
grid.dataSource.bind("change", function (e) {
// 判断父级节点是否发生变化
if (e.field == "unpassQuantity") {
// loadChange(grid,e,"passQuantity");
var passQuantity = e.items[0]['quantity'] - e.items[0]['unpassQuantity'];
resultGrid.setCellValue(e.items[0], "passQuantity", passQuantity.toFixed(3));
}
if (e.field == "workBy") {
loadChange(grid, e, "workName");
}
if (e.field == "checkName") {
let checkName = e.items[0]['checkName'];
if (checkName === loginUser[0].userName) {
resultGrid.setCellValue(e.items[0], "checkBy", loginUser[0].userId);
} else {
resultGrid.setCellValue(e.items[0], "checkBy", "");
}
}
});
}
\ No newline at end of file
...@@ -25,30 +25,31 @@ ...@@ -25,30 +25,31 @@
</EF:EFRegion> </EF:EFRegion>
<EF:EFRegion id="result" title="明细信息"> <EF:EFRegion id="result" title="明细信息">
<EF:EFGrid blockId="result" autoDraw="override" isFloat="true"> <EF:EFGrid blockId="result" autoDraw="override" isFloat="true" checkMode="row">
<EF:EFColumn ename="id" cname="内码" hidden="true"/> <EF:EFColumn ename="id" cname="内码" hidden="true"/>
<EF:EFColumn ename="taskId" cname="生产任务" hidden="true"/> <EF:EFColumn ename="taskId" cname="生产任务" hidden="true"/>
<EF:EFColumn ename="checkBy" cname="质检员" hidden="true"/>
<EF:EFColumn ename="groupCode" cname="生产班组" hidden="true"/> <EF:EFColumn ename="groupCode" cname="生产班组" hidden="true"/>
<EF:EFColumn ename="checkBy" cname="质检员" hidden="true"/>
<EF:EFColumn ename="workName" cname="生产人员" hidden="true"/> <EF:EFColumn ename="workName" cname="生产人员" hidden="true"/>
<EF:EFColumn ename="companyName" cname="公司名称" width="130" enable="false" readonly="true" align="center"/> <EF:EFColumn ename="companyName" cname="公司名称" width="130" enable="false" readonly="true" align="center"/>
<EF:EFColumn ename="projName" cname="项目名称" width="130" enable="false" readonly="true" align="center"/> <EF:EFColumn ename="projName" cname="项目名称" width="130" enable="false" readonly="true" align="center"/>
<EF:EFColumn ename="taskCode" cname="生产任务单号" width="130" enable="false" readonly="true" align="center"/> <EF:EFColumn ename="taskCode" cname="生产任务单号" width="130" enable="false" readonly="true" align="center"/>
<EF:EFColumn ename="checkCode" cname="质检单号" width="130" enable="false" readonly="true" align="center"/> <EF:EFColumn ename="checkCode" cname="质检单号" width="130" enable="false" readonly="true" align="center"/>
<EF:EFColumn ename="checkDate" cname="质检日期" width="120" align="center" editType="date"
dateFormat="yyyy-MM-dd" parseFormats="['yyyyMMdd']" required="true"/>
<EF:EFColumn ename="processName" cname="工序" width="100" enable="false" readonly="true" align="center"/> <EF:EFColumn ename="processName" cname="工序" width="100" enable="false" readonly="true" align="center"/>
<EF:EFColumn ename="productCode" cname="存货编码" width="90" enable="false" readonly="true" align="center"/> <EF:EFColumn ename="productCode" cname="存货编码" width="90" enable="false" readonly="true" align="center"/>
<EF:EFColumn ename="productName" cname="存货名称" width="90" enable="false" readonly="true" align="center"/> <EF:EFColumn ename="productName" cname="存货名称" width="90" enable="false" readonly="true" align="center"/>
<EF:EFColumn ename="quantity" cname="任务数量" width="90" enable="false" readonly="true" align="center"/> <EF:EFColumn ename="quantity" cname="任务数量" width="90" enable="false" readonly="true" align="center"/>
<EF:EFColumn ename="checkName" cname="质检员" width="100" enable="false" readonly="true" align="center"/> <EF:EFColumn ename="checkName" cname="质检员" width="100" align="center" required="true"/>
<EF:EFColumn ename="groupName" cname="生产班组" width="100" enable="false" readonly="true" align="center"/> <EF:EFColumn ename="groupName" cname="生产班组" width="100" enable="false" readonly="true" align="center"/>
<EF:EFColumn ename="workBy" cname="生产人员" width="90" readonly="true" align="center" required="true"/> <EF:EFColumn ename="workBy" cname="生产人员" width="90" readonly="true" align="center" required="true"/>
<EF:EFColumn ename="passQuantity" cname="合格数量" width="90" align="center" hidden="true"/> <EF:EFColumn ename="passQuantity" cname="合格数量" width="90" align="center" hidden="true"/>
<EF:EFColumn ename="unpassQuantity" cname="不合格数量" width="100" align="center" readonly="true" required="true"/> <EF:EFColumn ename="unpassQuantity" cname="不合格数量" width="100" align="center" readonly="true"
<EF:EFColumn ename="checkDate" cname="质检日期" width="120" enable="true" readonly="true" align="center" editType="date" required="true"/>
dateFormat="yyyy-MM-dd" parseFormats="['yyyy-MM-dd']" required="true"/>
<EF:EFComboColumn ename="checkStatus" cname="质检状态" width="80" align="center" enable="false" <EF:EFComboColumn ename="checkStatus" cname="质检状态" width="80" align="center" enable="false"
readonly="true" hidden="true"> readonly="true" hidden="true">
<EF:EFCodeOption codeName="hggp.checkStatus"/> <EF:EFCodeOption codeName="hggp.checkStatus"/>
</EF:EFComboColumn> </EF:EFComboColumn>
</EF:EFGrid> </EF:EFGrid>
......
...@@ -34,10 +34,6 @@ $(function () { ...@@ -34,10 +34,6 @@ $(function () {
query(); query();
} }
}, },
loadComplete: function(grid) {
//复检完工
$("#BNT_COMPLETE").on("click", complete);
},
onSave: function(e){ onSave: function(e){
// 阻止默认请求,使用自定义保存 // 阻止默认请求,使用自定义保存
e.preventDefault(); e.preventDefault();
...@@ -50,6 +46,12 @@ $(function () { ...@@ -50,6 +46,12 @@ $(function () {
} }
// 查询 // 查询
$("#QUERY").on("click", query); $("#QUERY").on("click", query);
// 处理
$("#DEAL").on("click", deal);
// 复检完工
$("#COMPLETE").on("click", complete);
}); });
...@@ -77,6 +79,21 @@ let save = function () { ...@@ -77,6 +79,21 @@ let save = function () {
message("请选择数据") message("请选择数据")
return; return;
} }
for (let i = 0; i < rows.length; i++) {
let row = rows[i];
if (isBlank(row['qualityProblem'])) {
message("勾选的第" + (i + 1) + "行\"质量问题描述\"不能为空");
return;
}
if (isBlank(row['processSugges'])) {
message("勾选的第" + (i + 1) + "行\"处理意见\"不能为空");
return;
}
if (isBlank(row['rectificatSugges'])) {
message("勾选的第" + (i + 1) + "行\"整改措施\"不能为空");
return;
}
}
JSUtils.confirm("确定对勾选中的[" + rows.length + "]条数据做保存操作吗? ", { JSUtils.confirm("确定对勾选中的[" + rows.length + "]条数据做保存操作吗? ", {
ok: function () { ok: function () {
JSUtils.submitGridsData("result", "HGZL004", "save", true); JSUtils.submitGridsData("result", "HGZL004", "save", true);
...@@ -84,7 +101,6 @@ let save = function () { ...@@ -84,7 +101,6 @@ let save = function () {
}); });
} }
/** /**
* 显示附件清单 * 显示附件清单
* *
...@@ -108,7 +124,43 @@ function communication(id) { ...@@ -108,7 +124,43 @@ function communication(id) {
}); });
} }
/**
* 处理操作
*
* @param id
* @param checkNo
*/
let deal = function () {
let rows = resultGrid.getCheckedRows();
if (rows.length < 1) {
message("请选择数据")
return;
}
for (let i = 0; i < rows.length; i++) {
let row = rows[i];
if (isBlank(row['qualityProblem'])) {
message("勾选的第" + (i + 1) + "行\"质量问题描述\"不能为空");
return;
}
if (isBlank(row['processSugges'])) {
message("勾选的第" + (i + 1) + "行\"处理意见\"不能为空");
return;
}
if (isBlank(row['rectificatSugges'])) {
message("勾选的第" + (i + 1) + "行\"整改措施\"不能为空");
return;
}
}
JSUtils.confirm("确定对勾选中的[" + rows.length + "]条数据做\"处理\"操作吗? ", {
ok: function () {
JSUtils.submitGridsData("result", "HGZL004", "deal", true);
}
});
}
/**
* 附件合格
*/
function complete() { function complete() {
let rows = resultGrid.getCheckedRows() let rows = resultGrid.getCheckedRows()
if (rows.length < 1) { if (rows.length < 1) {
......
...@@ -29,6 +29,10 @@ ...@@ -29,6 +29,10 @@
<EF:EFColumn ename="problemPic" cname="问题照片" width="90" enable="false" align="center"/> <EF:EFColumn ename="problemPic" cname="问题照片" width="90" enable="false" align="center"/>
<EF:EFColumn ename="processPic" cname="处理照片" width="90" enable="false" align="center"/> <EF:EFColumn ename="processPic" cname="处理照片" width="90" enable="false" align="center"/>
<EF:EFColumn ename="checkCode" cname="整改单号" width="130" enable="false" readonly="true" align="center"/> <EF:EFColumn ename="checkCode" cname="整改单号" width="130" enable="false" readonly="true" align="center"/>
<EF:EFComboColumn ename="handleStatus" cname="处理状态" width="80" align="center" enable="false"
readonly="true">
<EF:EFCodeOption codeName="hggp.handleStatus"/>
</EF:EFComboColumn>
<EF:EFColumn ename="companyName" cname="公司名称" width="180" enable="false" readonly="true" align="center"/> <EF:EFColumn ename="companyName" cname="公司名称" width="180" enable="false" readonly="true" align="center"/>
<EF:EFColumn ename="projCode" cname="项目编号" width="130" enable="false" readonly="true" align="center"/> <EF:EFColumn ename="projCode" cname="项目编号" width="130" enable="false" readonly="true" align="center"/>
<EF:EFColumn ename="projName" cname="项目名称" width="130" enable="false" readonly="true" align="center"/> <EF:EFColumn ename="projName" cname="项目名称" width="130" enable="false" readonly="true" align="center"/>
...@@ -39,13 +43,9 @@ ...@@ -39,13 +43,9 @@
<EF:EFColumn ename="workName" cname="姓名" width="90" enable="false" readonly="true" align="center"/> <EF:EFColumn ename="workName" cname="姓名" width="90" enable="false" readonly="true" align="center"/>
<EF:EFColumn ename="productName" cname="产品名称" width="90" enable="false" readonly="true" align="center"/> <EF:EFColumn ename="productName" cname="产品名称" width="90" enable="false" readonly="true" align="center"/>
<EF:EFColumn ename="processName" cname="工序" width="100" enable="false" readonly="true" align="center"/> <EF:EFColumn ename="processName" cname="工序" width="100" enable="false" readonly="true" align="center"/>
<EF:EFColumn ename="qualityProblem" cname="质量问题描述" width="130" align="center"/> <EF:EFColumn ename="qualityProblem" cname="质量问题描述" width="130" align="center" required="true"/>
<EF:EFColumn ename="processSugges" cname="处理意见" width="130" align="center"/> <EF:EFColumn ename="processSugges" cname="处理意见" width="130" align="center" required="true"/>
<EF:EFColumn ename="rectificatSugges" cname="整改措施" width="130" align="center"/> <EF:EFColumn ename="rectificatSugges" cname="整改措施" width="130" align="center" required="true"/>
<EF:EFComboColumn ename="handleStatus" cname="处理状态" width="80" align="center" enable="false"
readonly="true">
<EF:EFCodeOption codeName="hggp.handleStatus"/>
</EF:EFComboColumn>
</EF:EFGrid> </EF:EFGrid>
</EF:EFRegion> </EF:EFRegion>
</EF:EFPage> </EF:EFPage>
...@@ -29,8 +29,6 @@ ...@@ -29,8 +29,6 @@
<div id="left-pane" class="i-fit-height"> <div id="left-pane" class="i-fit-height">
<div class="col-md-12" style="padding-left: 0;padding-right: 8px"> <div class="col-md-12" style="padding-left: 0;padding-right: 8px">
<EF:EFRegion id="inqu" title="角色信息" style="padding-left:0;padding-right:0" fitHeight="true"> <EF:EFRegion id="inqu" title="角色信息" style="padding-left:0;padding-right:0" fitHeight="true">
<%-- <EF:EFRegion id="inqu" title="用户组查询" type="query" efRegionShowClear="true" efRegionSave="true"--%>
<%-- style="padding-left:0;padding-right:0">--%>
<div class="row" id="inquRegion"> <div class="row" id="inquRegion">
<EF:EFInput ename="inqu_status-0-groupEname" cname="角色英文名" placeholder="请输入角色英文名" <EF:EFInput ename="inqu_status-0-groupEname" cname="角色英文名" placeholder="请输入角色英文名"
colWidth="6"/> colWidth="6"/>
...@@ -38,8 +36,6 @@ ...@@ -38,8 +36,6 @@
colWidth="6"/> colWidth="6"/>
</div> </div>
<hr> <hr>
<%-- </EF:EFRegion>--%>
<%-- <EF:EFRegion id="userGroupTable" title="用户组信息" style="overflow-y:auto">--%>
<div style="margin-bottom: 0px"> <div style="margin-bottom: 0px">
<EF:EFGrid blockId="result" autoDraw="no" serviceName="XS02" personal="true" checkMode="row,single"> <EF:EFGrid blockId="result" autoDraw="no" serviceName="XS02" personal="true" checkMode="row,single">
<EF:EFColumn ename="groupId" cname="用户群组ID" readonly="false" hidden="true" <EF:EFColumn ename="groupId" cname="用户群组ID" readonly="false" hidden="true"
...@@ -94,7 +90,6 @@ ...@@ -94,7 +90,6 @@
<div class="i-region-header" style="padding-left: 8px; display: flex;"> <div class="i-region-header" style="padding-left: 8px; display: flex;">
<span>角色成员</span> <span>角色成员</span>
</div> </div>
<%-- <EF:EFRegion id="userTable" title="用户组成员" style="overflow-y:auto">--%>
<EF:EFGrid blockId="resultB" autoDraw="false" autoBind="false" serviceName="XS3002" <EF:EFGrid blockId="resultB" autoDraw="false" autoBind="false" serviceName="XS3002"
queryMethod="queryUserByGroup"> queryMethod="queryUserByGroup">
<EF:EFColumn ename="loginName" cname="登录账号" readonly="true" style="text-align:left;"/> <EF:EFColumn ename="loginName" cname="登录账号" readonly="true" style="text-align:left;"/>
......
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