Commit f674c2bd by wasx8023

1.入库质检单

parent 671678be
......@@ -227,7 +227,7 @@
SET
STATUS = #status#,
DELIVER_QTY = #deliverQty#, <!-- 退货数量 -->
DEPOSIT_QTY = #depositQty#, <!-- 退货数量 -->
DEPOSIT_QTY = #depositQty#, <!-- 入库数量 -->
<include refid="updateRevise"/>
WHERE RECEIVE_NO = #receiveNo#
</update>
......
......@@ -6,9 +6,9 @@ import com.baosight.hggp.hg.cg.domain.HGCG001;
import com.baosight.hggp.hg.cg.domain.HGCG002;
import com.baosight.hggp.hg.cg.domain.HGCG002A;
import com.baosight.hggp.hg.cg.domain.HGCG003;
import com.baosight.hggp.hg.kc.domain.HGKC001;
import com.baosight.hggp.hg.constant.HGConstant;
import com.baosight.hggp.hg.constant.HGSqlConstant;
import com.baosight.hggp.hg.zl.domain.HGZL001;
import com.baosight.hggp.util.AssertUtils;
import org.apache.commons.collections.CollectionUtils;
......@@ -234,6 +234,22 @@ public class HGCGTools {
paramMap.put("status", status);
DaoUtils.update(HGSqlConstant.HgCg003.UPDATE_STATUS, paramMap);
}
/**
* 修改状态
*
* @param zl001
*/
public static void updateCheck(HGZL001 zl001) {
Map<String, Object> paramMap = new HashMap<>();
paramMap.put(HGCG003.FIELD_RECEIVE_NO, zl001.getReceiveNo());
paramMap.put(HGCG003.FIELD_STATUS, HGConstant.CgReceiveStatus.S_4);
paramMap.put(HGCG003.FIELD_DELIVER_QTY, zl001.getUnqualifyQty());
paramMap.put(HGCG003.FIELD_DEPOSIT_QTY, zl001.getQualifyQty());
DaoUtils.update(HGSqlConstant.HgCg003.UPDATE_CONFIRM, paramMap);
}
}
}
......@@ -64,7 +64,7 @@ public class HGSqlConstant {
public static final String UPDATE_STATUS = MODULE_NAME + "updateStatus";
// 修改数量
public static final String UPDATE_QTY = MODULE_NAME + "updateQty";
// 修改数量
// 收货完成
public static final String UPDATE_CONFIRM = MODULE_NAME + "updateConfirm";
}
......@@ -147,6 +147,22 @@ public class HGSqlConstant {
}
/**
* HGZL001 SQL 定义
*
* @author:songx
* @date:2024/5/18,15:13
*/
public class HgZl001 {
// 模块名称
private static final String MODULE_NAME = "HGZL001.";
// 锁
public static final String LOCK = MODULE_NAME + "lock";
// 已处理
public static final String PROCESS = MODULE_NAME + "process";
}
/**
* HPKC001 SQL 定义
*
* @author:songx
......@@ -519,21 +535,6 @@ public class HGSqlConstant {
}
/**
* 质量巡检单
*
* @author:songx
* @date:2024/2/2,14:23
*/
public class HPZL001 {
// 已处理
public static final String DO_PROCESS = "HPZL001.doProcess";
// 已处理
public static final String DO_PROCESS2 = "HPZL001.doProcess2";
}
/**
* 用户
*
* @author:songx
......
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 java.util.HashMap;
import java.util.Map;
import com.baosight.iplat4j.core.util.StringUtils;
/**
* Project: <br>
* Title:Hgzl001a.java <br>
* Description: <br>
*
* Copyrigth:Baosight Software LTD.co Copyright (c) 2019. <br>
*
* @version 1.0
* @history 2024-05-18 15:53:05 create
*/
public class HGZL001A extends DaoEPBase {
private static final long serialVersionUID = 1L;
public static final String FIELD_ID = "id";
public static final String FIELD_ACCOUNT_CODE = "accountCode"; /* 企业编码*/
public static final String FIELD_DEP_CODE = "depCode"; /* 部门编码*/
public static final String FIELD_CREATED_BY = "createdBy"; /* 记录创建者*/
public static final String FIELD_CREATED_NAME = "createdName"; /* 记录创建名称*/
public static final String FIELD_CREATED_TIME = "createdTime"; /* 记录创建时间*/
public static final String FIELD_UPDATED_BY = "updatedBy"; /* 记录修改者*/
public static final String FIELD_UPDATED_NAME = "updatedName"; /* 记录修改名称*/
public static final String FIELD_UPDATED_TIME = "updatedTime"; /* 记录修改时间*/
public static final String FIELD_DELETE_FLAG = "deleteFlag"; /* 0-未删除,1-已删除*/
public static final String FIELD_DOC_TYPE = "docType"; /* 附件类型*/
public static final String FIELD_CHECK_ID = "checkId"; /* 质量单ID*/
public static final String FIELD_DOC_ID = "docId"; /* 文件ID*/
public static final String FIELD_DOC_NAME = "docName"; /* 文件名称*/
public static final String COL_ID = "ID";
public static final String COL_ACCOUNT_CODE = "ACCOUNT_CODE"; /* 企业编码*/
public static final String COL_DEP_CODE = "DEP_CODE"; /* 部门编码*/
public static final String COL_CREATED_BY = "CREATED_BY"; /* 记录创建者*/
public static final String COL_CREATED_NAME = "CREATED_NAME"; /* 记录创建名称*/
public static final String COL_CREATED_TIME = "CREATED_TIME"; /* 记录创建时间*/
public static final String COL_UPDATED_BY = "UPDATED_BY"; /* 记录修改者*/
public static final String COL_UPDATED_NAME = "UPDATED_NAME"; /* 记录修改名称*/
public static final String COL_UPDATED_TIME = "UPDATED_TIME"; /* 记录修改时间*/
public static final String COL_DELETE_FLAG = "DELETE_FLAG"; /* 0-未删除,1-已删除*/
public static final String COL_DOC_TYPE = "DOC_TYPE"; /* 附件类型*/
public static final String COL_CHECK_ID = "CHECK_ID"; /* 质量单ID*/
public static final String COL_DOC_ID = "DOC_ID"; /* 文件ID*/
public static final String COL_DOC_NAME = "DOC_NAME"; /* 文件文件*/
public static final String QUERY = "HGZL001A.query";
public static final String COUNT = "HGZL001A.count";
public static final String INSERT = "HGZL001A.insert";
public static final String UPDATE = "hgzl001a.update";
public static final String DELETE = "HGZL001A.delete";
private Long id = new Long(0);
private String accountCode = " "; /* 企业编码*/
private String depCode = " "; /* 部门编码*/
private String createdBy = " "; /* 记录创建者*/
private String createdName = " "; /* 记录创建名称*/
private String createdTime = " "; /* 记录创建时间*/
private String updatedBy = " "; /* 记录修改者*/
private String updatedName = " "; /* 记录修改名称*/
private String updatedTime = " "; /* 记录修改时间*/
private Integer deleteFlag; /* 0-未删除,1-已删除*/
private Integer docType; /* 附件类型*/
private Long checkId = new Long(0); /* 质量单ID*/
private String docId = " "; /* 文件ID*/
private String docName = " "; /* 文件名称*/
/**
* initialize the metadata.
*/
public void initMetaData() {
EiColumn eiColumn;
eiColumn = new EiColumn(FIELD_ID);
eiColumn.setPrimaryKey(true);
eiColumn.setDescName(" ");
eiMetadata.addMeta(eiColumn);
eiColumn = new EiColumn(FIELD_ACCOUNT_CODE);
eiColumn.setDescName("企业编码");
eiMetadata.addMeta(eiColumn);
eiColumn = new EiColumn(FIELD_DEP_CODE);
eiColumn.setDescName("部门编码");
eiMetadata.addMeta(eiColumn);
eiColumn = new EiColumn(FIELD_CREATED_BY);
eiColumn.setDescName("记录创建者");
eiMetadata.addMeta(eiColumn);
eiColumn = new EiColumn(FIELD_CREATED_NAME);
eiColumn.setDescName("记录创建名称");
eiMetadata.addMeta(eiColumn);
eiColumn = new EiColumn(FIELD_CREATED_TIME);
eiColumn.setDescName("记录创建时间");
eiMetadata.addMeta(eiColumn);
eiColumn = new EiColumn(FIELD_UPDATED_BY);
eiColumn.setDescName("记录修改者");
eiMetadata.addMeta(eiColumn);
eiColumn = new EiColumn(FIELD_UPDATED_NAME);
eiColumn.setDescName("记录修改名称");
eiMetadata.addMeta(eiColumn);
eiColumn = new EiColumn(FIELD_UPDATED_TIME);
eiColumn.setDescName("记录修改时间");
eiMetadata.addMeta(eiColumn);
eiColumn = new EiColumn(FIELD_DELETE_FLAG);
eiColumn.setDescName("0-未删除,1-已删除");
eiMetadata.addMeta(eiColumn);
eiColumn = new EiColumn(FIELD_DOC_TYPE);
eiColumn.setDescName("附件类型");
eiMetadata.addMeta(eiColumn);
eiColumn = new EiColumn(FIELD_CHECK_ID);
eiColumn.setDescName("质量单ID");
eiMetadata.addMeta(eiColumn);
eiColumn = new EiColumn(FIELD_DOC_ID);
eiColumn.setDescName("文件ID");
eiMetadata.addMeta(eiColumn);
eiColumn = new EiColumn(FIELD_DOC_NAME);
eiColumn.setDescName("文件名称");
eiMetadata.addMeta(eiColumn);
}
/**
* the constructor.
*/
public HGZL001A() {
initMetaData();
}
/**
* get the id .
* @return the id
*/
public Long getId() {
return this.id;
}
/**
* set the id .
*
* @param id
*/
public void setId(Long id) {
this.id = id;
}
/**
* get the accountCode - 企业编码.
* @return the accountCode
*/
public String getAccountCode() {
return this.accountCode;
}
/**
* set the accountCode - 企业编码.
*
* @param accountCode - 企业编码
*/
public void setAccountCode(String accountCode) {
this.accountCode = accountCode;
}
/**
* get the depCode - 部门编码.
* @return the depCode
*/
public String getDepCode() {
return this.depCode;
}
/**
* set the depCode - 部门编码.
*
* @param depCode - 部门编码
*/
public void setDepCode(String depCode) {
this.depCode = depCode;
}
/**
* get the createdBy - 记录创建者.
* @return the createdBy
*/
public String getCreatedBy() {
return this.createdBy;
}
/**
* set the createdBy - 记录创建者.
*
* @param createdBy - 记录创建者
*/
public void setCreatedBy(String createdBy) {
this.createdBy = createdBy;
}
/**
* get the createdName - 记录创建名称.
* @return the createdName
*/
public String getCreatedName() {
return this.createdName;
}
/**
* set the createdName - 记录创建名称.
*
* @param createdName - 记录创建名称
*/
public void setCreatedName(String createdName) {
this.createdName = createdName;
}
/**
* get the createdTime - 记录创建时间.
* @return the createdTime
*/
public String getCreatedTime() {
return this.createdTime;
}
/**
* set the createdTime - 记录创建时间.
*
* @param createdTime - 记录创建时间
*/
public void setCreatedTime(String createdTime) {
this.createdTime = createdTime;
}
/**
* get the updatedBy - 记录修改者.
* @return the updatedBy
*/
public String getUpdatedBy() {
return this.updatedBy;
}
/**
* set the updatedBy - 记录修改者.
*
* @param updatedBy - 记录修改者
*/
public void setUpdatedBy(String updatedBy) {
this.updatedBy = updatedBy;
}
/**
* get the updatedName - 记录修改名称.
* @return the updatedName
*/
public String getUpdatedName() {
return this.updatedName;
}
/**
* set the updatedName - 记录修改名称.
*
* @param updatedName - 记录修改名称
*/
public void setUpdatedName(String updatedName) {
this.updatedName = updatedName;
}
/**
* get the updatedTime - 记录修改时间.
* @return the updatedTime
*/
public String getUpdatedTime() {
return this.updatedTime;
}
/**
* set the updatedTime - 记录修改时间.
*
* @param updatedTime - 记录修改时间
*/
public void setUpdatedTime(String updatedTime) {
this.updatedTime = updatedTime;
}
/**
* get the deleteFlag - 0-未删除,1-已删除.
* @return the deleteFlag
*/
public Integer getDeleteFlag() {
return this.deleteFlag;
}
/**
* set the deleteFlag - 0-未删除,1-已删除.
*
* @param deleteFlag - 0-未删除,1-已删除
*/
public void setDeleteFlag(Integer deleteFlag) {
this.deleteFlag = deleteFlag;
}
/**
* get the docType - 附件类型.
* @return the docType
*/
public Integer getDocType() {
return this.docType;
}
/**
* set the docType - 附件类型.
*
* @param docType - 附件类型
*/
public void setDocType(Integer docType) {
this.docType = docType;
}
/**
* get the checkId - 质量单ID.
* @return the checkId
*/
public Long getCheckId() {
return this.checkId;
}
/**
* set the checkId - 质量单ID.
*
* @param checkId - 质量单ID
*/
public void setCheckId(Long checkId) {
this.checkId = checkId;
}
/**
* get the docId - 文件ID.
* @return the docId
*/
public String getDocId() {
return this.docId;
}
/**
* set the docId - 文件ID.
*
* @param docId - 文件ID
*/
public void setDocId(String docId) {
this.docId = docId;
}
/**
* get the docName - 文件名称.
* @return the docName
*/
public String getDocName() {
return this.getDocName();
}
/**
* set the docName - 文件名称.
*
* @param docName - 文件名称
*/
public void setDocName(String docName) {
this.docName = docName;
}
/**
* get the value from Map.
*
* @param map - source data map
*/
@Override
public void fromMap(Map map) {
setId(NumberUtils.toLong(StringUtils.toString(map.get(FIELD_ID)), id));
setAccountCode(StringUtils.defaultIfEmpty(StringUtils.toString(map.get(FIELD_ACCOUNT_CODE)), accountCode));
setDepCode(StringUtils.defaultIfEmpty(StringUtils.toString(map.get(FIELD_DEP_CODE)), depCode));
setCreatedBy(StringUtils.defaultIfEmpty(StringUtils.toString(map.get(FIELD_CREATED_BY)), createdBy));
setCreatedName(StringUtils.defaultIfEmpty(StringUtils.toString(map.get(FIELD_CREATED_NAME)), createdName));
setCreatedTime(StringUtils.defaultIfEmpty(StringUtils.toString(map.get(FIELD_CREATED_TIME)), createdTime));
setUpdatedBy(StringUtils.defaultIfEmpty(StringUtils.toString(map.get(FIELD_UPDATED_BY)), updatedBy));
setUpdatedName(StringUtils.defaultIfEmpty(StringUtils.toString(map.get(FIELD_UPDATED_NAME)), updatedName));
setUpdatedTime(StringUtils.defaultIfEmpty(StringUtils.toString(map.get(FIELD_UPDATED_TIME)), updatedTime));
setDeleteFlag(NumberUtils.toInteger(StringUtils.toString(map.get(FIELD_DELETE_FLAG)), deleteFlag));
setDocType(NumberUtils.toInteger(StringUtils.toString(map.get(FIELD_DOC_TYPE)), docType));
setCheckId(NumberUtils.toLong(StringUtils.toString(map.get(FIELD_CHECK_ID)), checkId));
setDocId(StringUtils.defaultIfEmpty(StringUtils.toString(map.get(FIELD_DOC_ID)), docId));
setDocName(StringUtils.defaultIfEmpty(StringUtils.toString(map.get(FIELD_DOC_NAME)), docName));
}
/**
* set the value to Map.
*/
@Override
public Map toMap() {
Map map = new HashMap();
map.put(FIELD_ID, StringUtils.toString(id, eiMetadata.getMeta(FIELD_ID)));
map.put(FIELD_ACCOUNT_CODE, StringUtils.toString(accountCode, eiMetadata.getMeta(FIELD_ACCOUNT_CODE)));
map.put(FIELD_DEP_CODE, StringUtils.toString(depCode, eiMetadata.getMeta(FIELD_DEP_CODE)));
map.put(FIELD_CREATED_BY, StringUtils.toString(createdBy, eiMetadata.getMeta(FIELD_CREATED_BY)));
map.put(FIELD_CREATED_NAME, StringUtils.toString(createdName, eiMetadata.getMeta(FIELD_CREATED_NAME)));
map.put(FIELD_CREATED_TIME, StringUtils.toString(createdTime, eiMetadata.getMeta(FIELD_CREATED_TIME)));
map.put(FIELD_UPDATED_BY, StringUtils.toString(updatedBy, eiMetadata.getMeta(FIELD_UPDATED_BY)));
map.put(FIELD_UPDATED_NAME, StringUtils.toString(updatedName, eiMetadata.getMeta(FIELD_UPDATED_NAME)));
map.put(FIELD_UPDATED_TIME, StringUtils.toString(updatedTime, eiMetadata.getMeta(FIELD_UPDATED_TIME)));
map.put(FIELD_DELETE_FLAG, StringUtils.toString(deleteFlag, eiMetadata.getMeta(FIELD_DELETE_FLAG)));
map.put(FIELD_DOC_TYPE, StringUtils.toString(docType, eiMetadata.getMeta(FIELD_DOC_TYPE)));
map.put(FIELD_CHECK_ID, StringUtils.toString(checkId, eiMetadata.getMeta(FIELD_CHECK_ID)));
map.put(FIELD_DOC_ID, StringUtils.toString(docId, eiMetadata.getMeta(FIELD_DOC_ID)));
map.put(FIELD_DOC_NAME, StringUtils.toString(docName, eiMetadata.getMeta(FIELD_DOC_NAME)));
return map;
}
}
......@@ -2,11 +2,18 @@ package com.baosight.hggp.hg.zl.service;
import com.baosight.hggp.aspect.annotation.OperationLogAnnotation;
import com.baosight.hggp.common.DdynamicEnum;
import com.baosight.hggp.core.constant.CommonConstant;
import com.baosight.hggp.core.dao.DaoUtils;
import com.baosight.hggp.core.enums.DeleteFlagEnum;
import com.baosight.hggp.hg.cg.tools.HGCGTools;
import com.baosight.hggp.hg.constant.HGSqlConstant;
import com.baosight.hggp.hg.zl.domain.HGZL001;
import com.baosight.hggp.hg.zl.utils.HGZLUtils;
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.iplat4j.core.ei.EiConstant;
import com.baosight.iplat4j.core.ei.EiInfo;
import com.baosight.iplat4j.core.service.impl.ServiceBase;
......@@ -31,9 +38,9 @@ public class ServiceHGZL001 extends ServiceBase {
@OperationLogAnnotation(operModul = "入库质检单", operType = "查询", operDesc = "初始化")
public EiInfo initLoad(EiInfo inInfo) {
try {
CommonMethod.initBlock(inInfo, Arrays.asList(DdynamicEnum.PROJ_RECORD_BLOCK_ID), null);
CommonMethod.initBlock(inInfo, Arrays.asList(DdynamicEnum.INVENT_RECORD_BLOCK_ID), null);
CommonMethod.initBlock(inInfo, Arrays.asList(DdynamicEnum.USER_BLOCK_ID), null);
CommonMethod.initBlock(inInfo, Arrays.asList(DdynamicEnum.COMPANY_CODE_BLOCK_ID));
CommonMethod.initBlock(inInfo, Arrays.asList(DdynamicEnum.INVENT_RECORD_BLOCK_ID));
CommonMethod.initBlock(inInfo, Arrays.asList(DdynamicEnum.SPEC_NAME_BLOCK_ID));
inInfo.addBlock(EiConstant.resultBlock).addBlockMeta(new HGZL001().eiMetadata);
} catch (Exception e) {
LogUtils.setDetailMsg(inInfo, e, "初始化失败");
......@@ -150,17 +157,19 @@ public class ServiceHGZL001 extends ServiceBase {
@OperationLogAnnotation(operModul = "质量巡检单",operType = "删除",operDesc = "删除")
public EiInfo delete(EiInfo inInfo) {
try {
List<Map> resultRows = inInfo.getBlock(EiConstant.resultBlock).getRows();
for (int i = 0; i < resultRows.size(); i++) {
// HPZL001 fZl001 = new HPZL001();
// fZl001.fromMap(resultRows.get(i));
// AssertUtils.isTrue(CommonConstant.YesNo.YES_1.equals(fZl001.getStatus()),
// String.format("单号[%s]的状态为\"已处理\"不允许删除", fZl001.getCheckNo()));
// DaoUtils.update(HPZL001.DELETE, resultRows.get(i));
List<HGZL001> fZl001s = MapUtils.toDaoEPBase(inInfo, HGZL001.class);
Map<String, HGZL001> dbZl001Map = HGZLUtils.HgZl001.lockGetDataEp(fZl001s);
for (HGZL001 fZl001 : fZl001s) {
String checkNo = fZl001.getCheckNo();
HGZL001 dbZl010 = dbZl001Map.get(checkNo);
AssertUtils.isEquals(CommonConstant.YesNo.YES_1, dbZl010.getStatus(),
String.format("单号[%s]的状态为\"已处理\",不允许删除", checkNo));
dbZl010.setDeleteFlag(DeleteFlagEnum.REMOVE.getCode());
DaoUtils.update(HGZL001.DELETE, dbZl010);
}
inInfo = this.query(inInfo);
inInfo.setStatus(EiConstant.STATUS_DEFAULT);
inInfo.setMsg("操作成功!本次对[" + resultRows.size() + "]条数据删除成功!");
inInfo.setMsg("操作成功!本次对[" + fZl001s.size() + "]条数据删除成功!");
} catch (Exception e) {
LogUtils.setDetailMsg(inInfo, e, "删除失败");
}
......@@ -176,22 +185,55 @@ public class ServiceHGZL001 extends ServiceBase {
@OperationLogAnnotation(operModul = "质量巡检单",operType = "修改",operDesc = "已处理")
public EiInfo doProcess(EiInfo inInfo) {
try {
List<Map> resultRows = inInfo.getBlock(EiConstant.resultBlock).getRows();
for (int i = 0; i < resultRows.size(); i++) {
// HPZL001 fZl001 = new HPZL001();
// fZl001.fromMap(resultRows.get(i));
///* fZl001.setCheckUser(UserSession.getLoginName());
// fZl001.setCheckUserName(UserSession.getLoginCName());*/
// fZl001.setStatus(CommonConstant.YesNo.YES_1);
// DaoUtils.update(HGSqlConstant.HPZL001.DO_PROCESS, fZl001);
}
List<HGZL001> fZl001s = MapUtils.toDaoEPBase(inInfo, HGZL001.class);
Map<String, HGZL001> dbZl001Map = HGZLUtils.HgZl001.lockGetDataEp(fZl001s);
// 数据校验
this.checkProcessData(fZl001s, dbZl001Map);
// 保存数据
this.saveProcessData(fZl001s, dbZl001Map);
inInfo = this.query(inInfo);
inInfo.setStatus(EiConstant.STATUS_DEFAULT);
inInfo.setMsg("操作成功!本次对[" + resultRows.size() + "]条数据处理成功!");
inInfo.setMsg("操作成功!本次对[" + fZl001s.size() + "]条数据处理成功!");
} catch (Exception e) {
LogUtils.setDetailMsg(inInfo, e, "提交失败");
LogUtils.setDetailMsg(inInfo, e, "处理失败");
}
return inInfo;
}
/**
* 校验数据
*
* @param fZl001s
* @param dbZl001Map
*/
private void checkProcessData(List<HGZL001> fZl001s, Map<String, HGZL001> dbZl001Map) {
for (HGZL001 fZl001 : fZl001s) {
String checkNo = fZl001.getCheckNo();
HGZL001 dbZl003 = dbZl001Map.get(checkNo);
AssertUtils.isNotEquals(CommonConstant.YesNo.NO_0, dbZl003.getStatus(),
String.format("质检单[%s]状态不是\"未处理\",不允许操作", checkNo));
AssertUtils.isNotEquals(fZl001.getQualifyQty().add(fZl001.getUnqualifyQty()), dbZl003.getReceiveQty(),
String.format("质检单[%s]的合格数量加不合格数量必须等于收货数量", checkNo));
}
}
/**
* 保存数据
*
* @param fZl001s
* @param dbZl001Map
*/
private void saveProcessData(List<HGZL001> fZl001s, Map<String, HGZL001> dbZl001Map) {
for (HGZL001 fZl001 : fZl001s) {
String checkNo = fZl001.getCheckNo();
HGZL001 dbZl001 = dbZl001Map.get(checkNo);
dbZl001.setQualifyQty(fZl001.getQualifyQty());
dbZl001.setUnqualifyQty(fZl001.getUnqualifyQty());
dbZl001.setStatus(CommonConstant.YesNo.YES_1);
DaoUtils.update(HGSqlConstant.HgZl001.PROCESS, dbZl001);
// 更新收货单状态
HGCGTools.HgCg003.updateCheck(dbZl001);
}
}
}
package com.baosight.hggp.hg.zl.service;
import com.baosight.hggp.aspect.annotation.OperationLogAnnotation;
import com.baosight.hggp.core.constant.CommonConstant;
import com.baosight.hggp.core.dao.DaoUtils;
import com.baosight.hggp.hg.zl.domain.HGZL001;
import com.baosight.hggp.hg.zl.domain.HGZL001A;
import com.baosight.hggp.hg.zl.tools.HGZLTools;
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.iplat4j.core.ProjectInfo;
import com.baosight.iplat4j.core.ei.EiConstant;
import com.baosight.iplat4j.core.ei.EiInfo;
import com.baosight.iplat4j.core.exception.PlatException;
import com.baosight.iplat4j.core.service.impl.ServiceEPBase;
import java.util.List;
import java.util.Map;
/**
* @author:songx
* @date:2024/1/25,15:25
*/
public class ServiceHGZL001A extends ServiceEPBase {
/**
* 画面初始化
*
* @param inInfo
* @return
*/
@OperationLogAnnotation(operModul = "附件清单", operType = "查询", operDesc = "质量巡检单-附件清单-初始化")
public EiInfo initLoad(EiInfo inInfo) {
try {
// 查询物料ID所对应的项目名称和部件名称
Map queryMap = EiInfoUtils.getFirstRow(inInfo);
HGZL001 dbZl001 = HGZLTools.HgZl001.get(MapUtils.getLong(queryMap, "checkId"));
inInfo.addBlock(CommonConstant.Field.DETAIL).addRow(dbZl001);
inInfo.addBlock(EiConstant.resultBlock).addBlockMeta(new HGZL001A().eiMetadata);
} catch (PlatException e) {
LogUtils.setDetailMsg(inInfo, e, "初始化失败");
}
return inInfo;
}
/**
* 查询操作
*
* @param inInfo
* @return
*/
@OperationLogAnnotation(operModul = "附件清单", operType = "查询", operDesc = "质量巡检单-附件清单-查询")
@Override
public EiInfo query(EiInfo inInfo) {
try {
// 项目环境
String projectEnv = ProjectInfo.getProjectEnv();
if (CommonConstant.projectEnv.RUN.equalsIgnoreCase(projectEnv)) {
inInfo = super.query(inInfo, "HGZL001A.queryRun", new HGZL001A());
} else {
inInfo = super.query(inInfo, "HGZL001A.queryDev", new HGZL001A());
}
} catch (Throwable e) {
LogUtils.setDetailMsg(inInfo, e, "查询失败");
}
return inInfo;
}
/**
* 新增操作
*
* @param inInfo
* @return
*/
@Override
@OperationLogAnnotation(operModul = "附件清单", operType = "新增", operDesc = "质量巡检单-附件清单-新增操作")
public EiInfo insert(EiInfo inInfo) {
try {
List<Map> resultRows = inInfo.getBlock(EiConstant.resultBlock).getRows();
for (int i = 0; i < resultRows.size(); i++) {
HGZL001A fZl001A = new HGZL001A();
fZl001A.fromMap(resultRows.get(i));
// 校验质检单是否已处理
HGZL001 dbZl001 = HGZLTools.HgZl001.get(fZl001A.getCheckId());
AssertUtils.isTrue(CommonConstant.YesNo.YES_1.equals(dbZl001.getStatus()),
String.format("质检单[%s]状态为\"已处理\",不能上传附件", dbZl001.getCheckNo()));
DaoUtils.insert(HGZL001A.INSERT, fZl001A);
}
inInfo.setStatus(EiConstant.STATUS_DEFAULT);
inInfo.setMsg("操作成功!本次对[" + resultRows.size() + "]条数据新增成功!");
} catch (Exception e) {
LogUtils.setDetailMsg(inInfo, e, "新增失败");
}
return inInfo;
}
/**
* 删除操作
*
* @param inInfo
* @return
*/
@OperationLogAnnotation(operModul = "附件清单", operType = "删除", operDesc = "质量巡检单-附件清单-删除操作")
public EiInfo delete(EiInfo inInfo) {
try {
List<Map> resultRows = inInfo.getBlock(EiConstant.resultBlock).getRows();
for (int i = 0; i < resultRows.size(); i++) {
HGZL001A fZl001A = new HGZL001A();
fZl001A.fromMap(resultRows.get(i));
// 校验质检单是否已处理
HGZL001 dbZl001 = HGZLTools.HgZl001.get(fZl001A.getCheckId());
AssertUtils.isTrue(CommonConstant.YesNo.YES_1.equals(dbZl001.getStatus()),
String.format("质检单[%s]状态为\"已处理\",不能删除附件", dbZl001.getCheckNo()));
DaoUtils.update(HGZL001A.DELETE, fZl001A);
}
inInfo = this.query(inInfo);
inInfo.setStatus(EiConstant.STATUS_DEFAULT);
inInfo.setMsg("操作成功!本次对[" + resultRows.size() + "]条数据删除成功!");
} catch (Exception e) {
LogUtils.setDetailMsg(inInfo, e, "删除失败");
}
return inInfo;
}
}
package com.baosight.hggp.hg.zl.service;
import com.baosight.hggp.aspect.annotation.OperationLogAnnotation;
import com.baosight.hggp.common.DdynamicEnum;
import com.baosight.hggp.core.constant.CommonConstant;
import com.baosight.hggp.core.dao.DaoUtils;
import com.baosight.hggp.hg.cg.domain.HGCG003;
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.hg.zl.domain.HGZL001;
import com.baosight.hggp.util.AssertUtils;
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.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.List;
import java.util.Map;
/**
* 选择生产任务
*
* @author:songx
* @date:2022/7/11,11:08
*/
public class ServiceHGZL001B extends ServiceEPBase {
/**
* 初始化
*
* @param inInfo
* @return
*/
@Override
@OperationLogAnnotation(operModul = "生产任务查询", operType = "查询", operDesc = "质量巡检单-生产任务查询-初始化")
public EiInfo initLoad(EiInfo inInfo) {
try {
CommonMethod.initBlock(inInfo, Arrays.asList(DdynamicEnum.COMPANY_CODE_BLOCK_ID));
CommonMethod.initBlock(inInfo, Arrays.asList(DdynamicEnum.SUP_RECORD_BLOCK_ID));
CommonMethod.initBlock(inInfo, Arrays.asList(DdynamicEnum.INVENT_RECORD_BLOCK_ID));
CommonMethod.initBlock(inInfo, Arrays.asList(DdynamicEnum.SPEC_NAME_BLOCK_ID));
inInfo.addBlock(EiConstant.resultBlock).addBlockMeta(new HGCG003().eiMetadata);
} catch (Exception e) {
LogUtils.setDetailMsg(inInfo, e, "初始化失败");
}
return inInfo;
}
/**
* 查询数据列表
*
* @param inInfo
* @return
*/
@Override
@OperationLogAnnotation(operModul = "生产任务查询", operType = "查询", operDesc = "质量巡检单-生产任务查询-查询")
public EiInfo query(EiInfo inInfo) {
try {
Map queryMap = EiInfoUtils.getFirstRow(inInfo);
queryMap.put(HGCG003.FIELD_STATUS, HGConstant.CgReceiveStatus.S_2);
inInfo = super.query(inInfo, HGCG003.QUERY, new HGCG003());
} catch (Exception e) {
LogUtils.setDetailMsg(inInfo, e, "查询失败");
}
return inInfo;
}
/**
* 生成巡检单
*
* @param inInfo
* @return
*/
@OperationLogAnnotation(operModul = "生产任务查询", operType = "新增", operDesc = "质量巡检单-生产任务查询-生成巡检单")
public EiInfo confirm(EiInfo inInfo) {
try {
List<HGCG003> fCg003s = MapUtils.toDaoEPBase(inInfo, HGCG003.class);
Map<String, HGCG003> dbCg003Map = HGCGUtils.HgCg003.lockGetDataEp(fCg003s);
// 数据校验
this.checkConfirmData(fCg003s, dbCg003Map);
// 生成巡检单
this.saveConfirmData(fCg003s, dbCg003Map);
} catch (Exception e) {
LogUtils.setDetailMsg(inInfo, e, "生成质检单失败");
}
return inInfo;
}
/**
* 校验数据
*
* @param fCg003s
* @param dbCg003Map
*/
private void checkConfirmData(List<HGCG003> fCg003s, Map<String, HGCG003> dbCg003Map) {
for (HGCG003 fCg003 : fCg003s) {
String receiveNo = fCg003.getReceiveNo();
HGCG003 dbSc003 = dbCg003Map.get(fCg003.getReceiveNo());
AssertUtils.isNotEquals(HGConstant.CgReceiveStatus.S_2, dbSc003.getStatus(),
String.format("采购收货单[%s]状态不是\"已收货\",不允许操作", receiveNo));
}
}
/**
* 保存数据
*
* @param fCg003s
* @param dbCg003Map
*/
private void saveConfirmData(List<HGCG003> fCg003s, Map<String, HGCG003> dbCg003Map) {
for (HGCG003 fCg003 : fCg003s) {
String receiveNo = fCg003.getReceiveNo();
// 生成新数据
HGCG003 dbSc003b = dbCg003Map.get(receiveNo);
HGZL001 newZl001 = BeanUtils.copy(dbSc003b, HGZL001.class);
newZl001.setCheckNo(SequenceGenerator.getNextSequence(HGConstant.SequenceId.HPZL001_NUMBER));
newZl001.setReceiptDate(DateUtils.shortDate());
newZl001.setStatus(CommonConstant.YesNo.NO_0);
newZl001.setDeleteFlag(CommonConstant.YesNo.NO_0);
DaoUtils.insert(HGZL001.INSERT, newZl001);
// 更新收货单状态
HGCGTools.HgCg003.updateStatus(receiveNo, HGConstant.CgReceiveStatus.S_3);
}
}
}
......@@ -37,6 +37,7 @@
</sql>
<sql id="condition">
AND DELETE_FLAG = 0
<include refid="HGXSDataAuth.authCondition"/>
<include refid="idCondition"/>
<include refid="customCondition"/>
......@@ -58,9 +59,6 @@
<isNotEmpty prepend=" AND " property="receiptDate">
RECEIPT_DATE = #receiptDate#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="checkNo">
CHECK_NO = #checkNo#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="receiveNo">
RECEIVE_NO = #receiveNo#
</isNotEmpty>
......@@ -95,11 +93,11 @@
<isNotEmpty prepend=" AND " property="id">
ID = #id#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="reqNo">
REQ_NO = #reqNo#
<isNotEmpty prepend=" AND " property="checkNo">
CHECK_NO = #checkNo#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="reqNos">
REQ_NO IN <iterate open="(" close=")" conjunction="," property="reqNos">#reqNos[]#</iterate>
<isNotEmpty prepend=" AND " property="checkNos">
CHECK_NO IN <iterate open="(" close=")" conjunction="," property="checkNos">#checkNos[]#</iterate>
</isNotEmpty>
</sql>
......@@ -163,16 +161,14 @@
WIDTH, <!-- 宽度 -->
THICK, <!-- 厚度 -->
RECEIVE_QTY, <!-- 收货数量 -->
QUALIFY_QTY, <!-- 合格数量 -->
UNQUALIFY_QTY, <!-- 不合格数量 -->
RECEIVE_UNIT_WEIGHT, <!-- 收货单重 -->
RECEIVE_WEIGHT, <!-- 收货重量 -->
STATUS <!-- 状态:0-质检中,1-质检完成 -->
) VALUES (
#id#, #accountCode#, #depCode#, #createdBy#, #createdName#, #createdTime#,
#accountCode#, #depCode#, #createdBy#, #createdName#, #createdTime#,
#deleteFlag#, #companyCode#, #companyName#, #receiptDate#, #checkNo#, #receiveNo#, #inventType#,
#inventCode#, #inventName#, #specId#, #spec#, #material#, #unit#, #length#, #width#, #thick#, #receiveQty#,
#qualifyQty#, #unqualifyQty#, #receiveUnitWeight#, #receiveWeight#, #status#
#receiveUnitWeight#, #receiveWeight#, #status#
)
</insert>
......@@ -184,4 +180,23 @@
WHERE CHECK_NO = #checkNo#
</delete>
<!-- 行锁 -->
<update id="lock">
UPDATE ${hggpSchema}.HGZL001
SET CREATED_TIME = CREATED_TIME
WHERE 1=1
<include refid="idCondition"/>
</update>
<!-- 已处理 -->
<update id="process">
UPDATE ${hggpSchema}.HGZL001
SET
STATUS = #status#,
QUALIFY_QTY = #qualifyQty#, <!-- 合格数量 -->
UNQUALIFY_QTY = #unqualifyQty#, <!-- 不合格数量 -->
<include refid="updateRevise"/>
WHERE CHECK_NO = #checkNo#
</update>
</sqlMap>
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE sqlMap PUBLIC "-//iBATIS.com//DTD SQL Map 2.0//EN" "http://www.ibatis.com/dtd/sql-map-2.dtd">
<sqlMap namespace="HGZL001A">
<sql id="column">
A.ID as "id",
A.ACCOUNT_CODE as "accountCode", <!-- 企业编码 -->
A.DEP_CODE as "depCode", <!-- 部门编码 -->
A.CREATED_BY as "createdBy", <!-- 记录创建者 -->
A.CREATED_NAME as "createdName", <!-- 记录创建名称 -->
A.CREATED_TIME as "createdTime", <!-- 记录创建时间 -->
A.UPDATED_BY as "updatedBy", <!-- 记录修改者 -->
A.UPDATED_NAME as "updatedName", <!-- 记录修改名称 -->
A.UPDATED_TIME as "updatedTime", <!-- 记录修改时间 -->
A.DELETE_FLAG as "deleteFlag", <!-- 0-未删除,1-已删除 -->
A.DOC_TYPE as "docType", <!-- 附件类型 -->
A.CHECK_ID as "checkId", <!-- 质量单ID -->
A.DOC_ID as "docId" <!-- 文件ID -->
</sql>
<sql id="columnDev">
<include refid="column"/>,
B.DOC_NAME as "docName" <!-- 文件名称 -->
</sql>
<sql id="columnRun">
<include refid="column"/>,
B.RES_CNAME as "docName" <!-- 文件名称 -->
</sql>
<sql id="condition">
<include refid="customCondition"/>
<isNotEmpty prepend=" AND " property="id">
A.ID = #id#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="accountCode">
A.ACCOUNT_CODE = #accountCode#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="depCode">
A.DEP_CODE = #depCode#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="docType">
A.DOC_TYPE = #docType#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="checkId">
A.CHECK_ID = #checkId#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="docId">
A.DOC_ID = #docId#
</isNotEmpty>
</sql>
<!-- 开发环境 -->
<sql id="conditionDev">
AND A.DOC_ID = B.DOC_ID
<include refid="condition"/>
<isNotEmpty prepend=" AND " property="docName">
B.DOC_NAME LIKE CONCAT('%', #docName#, '%')
</isNotEmpty>
</sql>
<!-- 正式环境 -->
<sql id="conditionRun">
AND A.DOC_ID = B.RES_ID
<include refid="condition"/>
<isNotEmpty prepend=" AND " property="docName">
B.RES_CNAME LIKE CONCAT('%', #docName#, '%')
</isNotEmpty>
</sql>
<sql id="customCondition">
<isNotEmpty prepend=" AND " property="createdDateFrom">
A.CREATED_TIME &gt;= CONCAT(REPLACE(#createdDateFrom#, '-', ''), '000000')
</isNotEmpty>
<isNotEmpty prepend=" AND " property="createdDateTo">
A.CREATED_TIME &lt;= CONCAT(REPLACE(#createdDateTo#, '-', ''), '235959')
</isNotEmpty>
</sql>
<sql id="order">
<dynamic prepend="ORDER BY">
<isNotEmpty property="order">
$orderBy$
</isNotEmpty>
<isEmpty property="order">
A.ID DESC
</isEmpty>
</dynamic>
</sql>
<select id="queryDev" resultClass="com.baosight.hggp.hg.zl.domain.HGZL001A">
SELECT
<include refid="columnDev"/>
FROM ${hggpSchema}.HGZL001A A, ${platSchema}.TEUDM02 B
WHERE 1=1
<include refid="conditionDev"/>
<include refid="order"/>
</select>
<select id="countDev" resultClass="int">
SELECT COUNT(*) FROM ${hggpSchema}.HGZL001A A, ${platSchema}.TEUDM02 B
WHERE 1=1
<include refid="conditionDev"/>
</select>
<select id="queryRun" resultClass="com.baosight.hggp.hg.zl.domain.HGZL001A">
SELECT
<include refid="columnRun"/>
FROM ${hggpSchema}.HGZL001A A, ${platSchema}.TEUDM05 B
WHERE 1=1
<include refid="conditionRun"/>
<include refid="order"/>
</select>
<select id="countRun" resultClass="int">
SELECT COUNT(*) FROM ${hggpSchema}.HGZL001A A, ${platSchema}.TEUDM05 B
WHERE 1=1
<include refid="conditionRun"/>
</select>
<insert id="insert">
INSERT INTO ${hggpSchema}.HGZL001A (
ACCOUNT_CODE, <!-- 企业编码 预留 -->
DEP_CODE, <!-- 部门编码 预留 -->
CHECK_ID, <!-- 巡检单ID -->
DOC_TYPE, <!-- 文件类型 -->
DOC_ID, <!-- 文件ID -->
CREATED_BY, <!-- 创建人 -->
CREATED_NAME, <!-- 创建人名称 -->
CREATED_TIME <!-- 创建时间 -->
) VALUES (
#accountCode#, #depCode#, #checkId#, #docType#, #docId#, #createdBy#,
#createdName#, #createdTime#
)
</insert>
<delete id="delete">
DELETE FROM ${hggpSchema}.HGZL001A WHERE ID = #id#
</delete>
</sqlMap>
package com.baosight.hggp.hg.zl.tools;
import com.baosight.hggp.core.dao.DaoBase;
import com.baosight.hggp.hg.constant.HGSqlConstant;
import com.baosight.hggp.hg.zl.domain.HGZL001;
import com.baosight.hggp.util.AssertUtils;
import org.apache.commons.collections.CollectionUtils;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import java.util.stream.Collectors;
/**
* @author:songx
* @date:2024/5/18,15:12
*/
public class HGZLTools {
/**
* @author:songx
* @date:2024/5/18,15:12
*/
public static class HgZl001 {
/**
* 锁
*
* @param checkNos
* @return
*/
public static void lock(List<String> checkNos) {
if (CollectionUtils.isEmpty(checkNos)) {
return;
}
Map paramMap = new HashMap();
paramMap.put("checkNos", checkNos);
DaoBase.getInstance().update(HGSqlConstant.HgZl001.LOCK, paramMap);
}
/**
* @param id
*/
public static HGZL001 get(Long id) {
AssertUtils.isNull(id, "ID不能为空");
Map paramMap = new HashMap();
paramMap.put(HGZL001.FIELD_ID, id);
List<HGZL001> results = DaoBase.getInstance().query(HGZL001.QUERY, paramMap);
return CollectionUtils.isEmpty(results) ? null : results.get(0);
}
/**
* 查询
*
* @param checkNos
* @return
*/
public static List<HGZL001> list(List<String> checkNos) {
AssertUtils.isEmpty(checkNos, "计划号不能为空");
Map<String, Object> paramMap = new HashMap();
paramMap.put("checkNos", checkNos);
return DaoBase.getInstance().query(HGZL001.QUERY, paramMap);
}
/**
* 查询
*
* @param checkNos
* @return
*/
public static Map<String, HGZL001> map(List<String> checkNos) {
List<HGZL001> results = list(checkNos);
return results.stream().collect(Collectors.toMap(HGZL001::getCheckNo, item -> item));
}
}
}
......@@ -2,10 +2,13 @@ package com.baosight.hggp.hg.zl.utils;
import com.baosight.hggp.hg.utils.HGUtils;
import com.baosight.hggp.hg.zl.domain.HGZL001;
import com.baosight.hggp.hg.zl.tools.HGZLTools;
import com.baosight.hggp.util.DateUtils;
import com.baosight.hggp.util.MapUtils;
import com.baosight.hggp.util.ObjectUtils;
import com.baosight.hggp.util.StringUtils;
import java.util.List;
import java.util.Map;
/**
......@@ -36,5 +39,28 @@ public class HGZLUtils {
queryRow.put(HGZL001.FIELD_RECEIPT_DATE, DateUtils.formatShort(receiptDate));
}
}
/**
* 锁并且获取数据
*
* @param fZl001s
* @return
*/
public static Map<String, HGZL001> lockGetDataEp(List<? extends HGZL001> fZl001s) {
return lockGetData(ObjectUtils.listEpKey(fZl001s, HGZL001.FIELD_CHECK_NO));
}
/**
* 锁并且获取数据
*
* @param checkNos
* @return
*/
public static Map<String, HGZL001> lockGetData(List<String> checkNos) {
// 锁
HGZLTools.HgZl001.lock(checkNos);
// db数据
return HGZLTools.HgZl001.map(checkNos);
}
}
}
......@@ -14,17 +14,6 @@ $(function () {
class: "i-input-readonly"
}
}, {
field: "operator",
template: function (item) {
let status = item.status;
if (status === "0") {
return '<a style="cursor: pointer;display: flex;justify-content: center;" ' +
'onclick="doProcess(' + item.id + ', \'' + item.checkNo + '\')" >处理</a>';
} else {
return "";
}
}
}, {
field: "problemPhoto",
template: function (item) {
if (!isBlank(item.checkNo)) {
......@@ -63,8 +52,12 @@ $(function () {
// 查询
$("#QUERY").on("click", query);
// 选择生产任务
$("#SELECT_PROD").on("click", selectProd);
// 选择采购收货
$("#SELECT_RECEIVE").on("click", selectReceive);
// 质检完成
$("#PROCESS").on("click", process);
});
/**
......@@ -90,7 +83,7 @@ let query = function () {
*/
let showUploadFile = function (id, docType) {
JSColorbox.open({
href: "HPZL001A?methodName=initLoad&inqu_status-0-checkId=" + id + "&inqu_status-0-docType=" + docType,
href: "HGZL001A?methodName=initLoad&inqu_status-0-checkId=" + id + "&inqu_status-0-docType=" + docType,
title: "<div style='text-align: center;'>附件清单</div>",
width: "80%",
height: "80%",
......@@ -103,32 +96,49 @@ let showUploadFile = function (id, docType) {
* @param id
* @param checkNo
*/
let doProcess = function (id, checkNo) {
let message = "确认将单号[" + checkNo + "]的状态修改为已处理吗? ";
JSUtils.confirm(message, {
let process = function () {
let rows = resultGrid.getCheckedRows();
if (rows.length < 1) {
message("请选择数据")
return;
}
for (let i = 0; i < rows.length; i++) {
let qualifyQty = rows[i]['qualifyQty'];
let unqualifyQty = rows[i]['unqualifyQty'];
let receiveQty = rows[i]['receiveQty'];
if (!isNumber(qualifyQty) || !isNumber(unqualifyQty)) {
message("第" + (i + 1) + "行合格数量和不合格数量必须是大于等于0的数字");
return;
}
if ((parseFloat(qualifyQty) + parseFloat(unqualifyQty)) != parseFloat(receiveQty)) {
message("第" + (i + 1) + "行合格数量加不合格数量必须等于收货数量");
return;
}
}
JSUtils.confirm("确定对勾选中的[" + rows.length + "]条数据做质检完成操作吗? ", {
ok: function () {
JSUtils.submitGridsData("result", "HPZL001", "doProcess", true);
JSUtils.submitGridsData("result", "HGZL001", "doProcess", true);
}
});
}
/**
* 挑选生产任务
* 选择采购收货
*/
let selectProd = function () {
let selectReceive = function () {
JSColorbox.open({
href: "HPZL001B?methodName=initLoad",
title: "<div style='text-align: center;'>生产任务查询</div>",
width: "90%",
href: "HGZL001B?methodName=initLoad",
title: "<div style='text-align: center;'>采购收货查询</div>",
width: "80%",
height: "80%",
callbackName: selectStockCallback
callbackName: selectReceiveCallback
});
}
/**
* 挑选生产任务回调
* 选择采购收货回调
*/
let selectStockCallback = function () {
let selectReceiveCallback = function () {
// 刷新页面
query();
// 关闭弹窗
......@@ -144,20 +154,9 @@ function deleteFunc() {
message("请选择数据");
return;
}
let flag = true;
$.each(rows, function(index, item) {
let status= item.get("status");
if(status==="1"){
message("选中的第"+(index+1)+"行记录已处理,不能删除!");
flag = false;
return false;
}
});
if(flag){
JSUtils.confirm("确定对勾选中的[" + rows.length + "]条数据做\"删除\"操作? ", {
ok: function () {
JSUtils.submitGridsData("result", "HPZL001", "delete", true);
JSUtils.submitGridsData("result", "HGZL001", "delete", true);
}
});
}
}
......@@ -10,33 +10,31 @@
<div class="row">
<EF:EFDatePicker cname="单据日期" ename="receiptDate" blockId="inqu_status" row="0" colWidth="3"
format="yyyy-MM-dd" readonly="true"/>
<EF:EFInput cname="项目名称" ename="projName" blockId="inqu_status" row="0" colWidth="3"/>
<EF:EFInput cname="部件名称" ename="inventName" blockId="inqu_status" row="0" colWidth="3"/>
<EF:EFInput cname="零件名称" ename="subInventName" blockId="inqu_status" row="0" colWidth="3"/>
<EF:EFSelect cname="公司名称" blockId="inqu_status" ename="companyCode" row="0" colWidth="3"
filter="contains" optionLabel="全部" defultValue="">
<EF:EFOptions blockId="company_code_block_id" textField="textField" valueField="valueField"/>
</EF:EFSelect>
<EF:EFSelect cname="存货名称" blockId="inqu_status" ename="inventCode" row="0" colWidth="3"
filter="contains" optionLabel="全部" defultValue="">
<EF:EFOptions blockId="invent_record_block_id" textField="textField" valueField="valueField"/>
</EF:EFSelect>
<EF:EFSelect cname="规格" ename="inqu_status-0-spec" colWidth="3" filter="contains" optionLabel="全部"
defultValue="">
<EF:EFOptions blockId="spec_name_block_id" textField="textField" valueField="valueField"/>
</EF:EFSelect>
</div>
<div class="row">
<EF:EFInput cname="工作组" ename="orgName" blockId="inqu_status" row="0" colWidth="3"/>
<EF:EFInput cname="检查人" ename="checkUserName" blockId="inqu_status" row="0" colWidth="3"/>
<EF:EFSelect cname="不良类型" ename="poorType" blockId="inqu_status" row="0" colWidth="3">
<EF:EFOption label="全部" value=""/>
<EF:EFCodeOption codeName="hpjx.hpjx.poorType"/>
</EF:EFSelect>
<EF:EFSelect cname="处理状态" ename="status" blockId="inqu_status" row="0" colWidth="3">
<EF:EFOption label="全部" value=""/>
<EF:EFOption label="已处理" value="1"></EF:EFOption>
<EF:EFOption label="未处理" value="0"></EF:EFOption>
</EF:EFSelect>
</div>
<div class="row">
<EF:EFInput cname="生产订单号" ename="prodOrderNo" blockId="inqu_status" row="0" colWidth="3"/>
<EF:EFInput cname="生产任务号" ename="prodTaskNo" blockId="inqu_status" row="0" colWidth="3"/>
</div>
</EF:EFRegion>
<EF:EFRegion id="result" title="明细信息">
<EF:EFGrid blockId="result" autoDraw="override" isFloat="true" checkMode="row">
<EF:EFColumn ename="id" cname="内码" hidden="true"/>
<EF:EFColumn ename="operator" cname="操作" locked="true" enable="false" width="100" align="center"/>
<EF:EFColumn ename="problemPhoto" cname="问题照片" locked="true" enable="false" width="100" align="center"
required="true"/>
<EF:EFColumn ename="processPhoto" cname="处理照片" locked="true" enable="false" width="100" align="center"
......@@ -55,18 +53,18 @@
<EF:EFColumn ename="inventName" cname="存货名称" enable="false" width="100" align="center"/>
<EF:EFColumn ename="specId" cname="规格ID" enable="false" width="100" align="center" hidden="true"/>
<EF:EFColumn ename="spec" cname="规格" enable="false" width="120" align="center"/>
<EF:EFColumn ename="receiveQty" cname="收货数量" enable="false" width="120" align="right" format="{0:N0}"/>
<EF:EFColumn ename="receiveWeight" cname="收货重量" enable="false" width="120" align="right" format="{0:N3}"/>
<EF:EFColumn ename="qualifyQty" cname="合格数量" width="120" align="right" format="{0:N0}" required="true"/>
<EF:EFColumn ename="unqualifyQty" cname="不合格数量" width="120" align="right" format="{0:N0}" required="true"/>
<EF:EFComboColumn ename="poorType" cname="不良品类" enable="false" width="100" align="center">
<EF:EFCodeOption codeName="hpjx.hpjx.poorType"/>
</EF:EFComboColumn>
<EF:EFColumn ename="problemDesc" cname="质量问题描述" enable="false" width="140" align="center"/>
<EF:EFComboColumn ename="checkUser" cname="检查人" enable="false" width="120" align="center"
blockName="user_block_id" textField="textField" valueField="valueField"
columnTemplate="#=textField#" itemTemplate="#=textField#">
</EF:EFComboColumn>
<EF:EFColumn ename="receiveQty" cname="收货数量" enable="false" width="120" align="right" format="{0:N0}"/>
<EF:EFColumn ename="receiveWeight" cname="收货重量" enable="false" width="120" align="right" format="{0:N3}"/>
<%-- <EF:EFComboColumn ename="poorType" cname="不良品类" enable="false" width="100" align="center">--%>
<%-- <EF:EFCodeOption codeName="hpjx.hpjx.poorType"/>--%>
<%-- </EF:EFComboColumn>--%>
<%-- <EF:EFColumn ename="problemDesc" cname="质量问题描述" enable="false" width="140" align="center"/>--%>
<%-- <EF:EFComboColumn ename="checkUser" cname="检查人" enable="false" width="120" align="center"--%>
<%-- blockName="user_block_id" textField="textField" valueField="valueField"--%>
<%-- columnTemplate="#=textField#" itemTemplate="#=textField#">--%>
<%-- </EF:EFComboColumn>--%>
<EF:EFColumn ename="material" cname="材质" enable="false" width="80" align="center"/>
<EF:EFColumn ename="unit" cname="单位" enable="false" width="80" align="center"/>
<EF:EFColumn ename="length" cname="长(M)" enable="false" width="80" align="right" format="{0:N3}"/>
......
......@@ -55,7 +55,7 @@ var query = function (e) {
*/
function uploadFile(id) {
JSColorbox.open({
href: "HPSC099?methodName=initLoad",
href: "HGSC099A?methodName=initLoad",
title: "<div style='text-align: center;'>附件上传</div>",
width: "60%",
height: "50%",
......@@ -73,7 +73,7 @@ function uploadFileCallback(docId) {
inEiInfo.set("result-0-checkId", $("#inqu_status-0-checkId").val());
inEiInfo.set("result-0-docType", $("#inqu_status-0-docType").val());
inEiInfo.set("result-0-docId", docId);
EiCommunicator.send('HPZL001A', 'insert', inEiInfo, {
EiCommunicator.send('HGZL001A', 'insert', inEiInfo, {
onSuccess(response) {
resultGrid.dataSource.page(1);
},
......@@ -96,7 +96,7 @@ function deleteFunc() {
}
JSUtils.confirm("确定对勾选中的[" + rows.length + "]条数据做\"删除\"操作?", {
ok: function () {
JSUtils.submitGridsData("result", "HPZL001A", "delete", true);
JSUtils.submitGridsData("result", "HGZL001A", "delete", true);
}
})
}
......@@ -7,15 +7,12 @@
<EF:EFPage title="附件清单">
<EF:EFRegion id="inqu" title="查询区域" type="query">
<EF:EFInput cname="质量巡检单ID" ename="checkId" blockId="inqu_status" row="0" type="hidden"/>
<EF:EFInput cname="质量单ID" ename="checkId" blockId="inqu_status" row="0" type="hidden"/>
<EF:EFInput cname="附件类型" ename="docType" blockId="inqu_status" row="0" type="hidden"/>
<div class="row">
<EF:EFInput cname="项目名称" ename="projName" blockId="detail" row="0" colWidth="3" readonly="true"/>
<EF:EFInput cname="部件名称" ename="inventName" blockId="detail" row="0" colWidth="3" readonly="true"/>
<EF:EFInput cname="零件名称" ename="subInventName" blockId="detail" row="0" colWidth="3" readonly="true"/>
<EF:EFInput cname="生产组" ename="orgName" blockId="detail" row="0" colWidth="3" readonly="true"/>
<EF:EFInput cname="存货名称" ename="inventName" blockId="detail" row="0" readonly="true"/>
<EF:EFInput cname="规格" ename="spec" blockId="detail" row="0" readonly="true"/>
</div>
<EF:EFInput cname="状态" ename="status" blockId="detail" row="0" colWidth="3" type="hidden"/>
</EF:EFRegion>
<EF:EFRegion id="result" title="记录集">
......
......@@ -13,7 +13,8 @@ $(function () {
$("#QUERY").on("click", query);
// 选择
$("#BTN_SELECT").on("click", select);
$("#CONFIRM").on("click", confirm);
downKeyUp();
});
......@@ -35,27 +36,15 @@ var query = function (e) {
/**
* 选择库存
*/
let select = function () {
let confirm = function () {
let rows = resultGrid.getCheckedRows();
if (rows.length < 1) {
message("请选择数据")
return;
}
for (let i = 0; i < rows.length; i++) {
let poorType = rows[i]['poorType'];
let problemDesc = rows[i]['problemDesc'];
if (isBlank(poorType)) {
message("第" + (i + 1) + "行不良品类不能为空");
return;
}
if (isBlank(problemDesc)) {
message("第" + (i + 1) + "行质量问题描述不能为空");
return;
}
}
JSUtils.confirm("确定对勾选中的[" + rows.length + "]条数据生成巡检单吗? ", {
JSUtils.confirm("确定对勾选中的[" + rows.length + "]条数据生成质检单吗? ", {
ok: function () {
JSUtils.submitGridsData("result", "HPZL001B", "select",
JSUtils.submitGridsData("result", "HGZL001B", "confirm",
true, function (e) {
var status = e.getStatus();
if (status !== -1) {
......
......@@ -5,46 +5,70 @@
<c:set var="ctx" value="${pageContext.request.contextPath}"/>
<EF:EFPage title="生产任务查询">
<EF:EFPage title="采购收货查询">
<EF:EFRegion id="inqu" title="查询区域" type="query">
<div class="row">
<div class="row">
<EF:EFInput cname="生产订单号" ename="prodOrderNo" blockId="inqu_status" row="0" colWidth="3"/>
<EF:EFInput cname="生产任务号" ename="prodTaskNo" blockId="inqu_status" row="0" colWidth="3"/>
<EF:EFInput cname="项目名称" ename="projName" blockId="inqu_status" row="0" colWidth="3"/>
<EF:EFInput cname="部件名称" ename="prdtName" blockId="inqu_status" row="0" colWidth="3"/>
<EF:EFDatePicker cname="收货日期" blockId="inqu_status" ename="receiveDate" row="0" colWidth="3"
role="date" format="yyyy-MM-dd" readonly="true"/>
<EF:EFInput cname="收货单号" blockId="inqu_status" ename="receiveNo" row="0" colWidth="3"/>
<EF:EFSelect cname="公司名称" blockId="inqu_status" ename="companyCode" row="0" colWidth="3"
filter="contains" optionLabel="全部" defultValue="">
<EF:EFOptions blockId="company_code_block_id" textField="textField" valueField="valueField"/>
</EF:EFSelect>
<EF:EFSelect cname="供应商名称" blockId="inqu_status" ename="supCode" row="0" colWidth="3"
filter="contains" optionLabel="全部" defultValue="">
<EF:EFOptions blockId="sup_record_block_id" textField="textField" valueField="valueField"/>
</EF:EFSelect>
</div>
<div class="row">
<EF:EFInput cname="零件名称" ename="partName" blockId="inqu_status" row="0" colWidth="3"/>
</div>
<EF:EFSelect cname="存货名称" blockId="inqu_status" ename="inventCode" row="0" colWidth="3"
filter="contains" optionLabel="全部" defultValue="">
<EF:EFOptions blockId="invent_record_block_id" textField="textField" valueField="valueField"/>
</EF:EFSelect>
<EF:EFSelect cname="规格" ename="inqu_status-0-spec" colWidth="3" filter="contains" optionLabel="全部"
defultValue="">
<EF:EFOptions blockId="spec_name_block_id" textField="textField" valueField="valueField"/>
</EF:EFSelect>
<EF:EFDateSpan startCname="创建时间(从)" endCname="至" blockId="inqu_status"
startName="createdTimeFrom" endName="createdTimeTo" row="0" role="datetime"
format="yyyy-MM-dd HH:mm:ss" ratio="3:3" satrtRatio="4:8" endRatio="4:8" readonly="true">
</EF:EFDateSpan>
</div>
</EF:EFRegion>
<EF:EFRegion id="result" title="记录集">
<EF:EFGrid blockId="result" autoDraw="override" checkMode="row" isFloat="true">
<EF:EFColumn ename="id" cname="生产订单ID" enable="false" width="90" align="center" hidden="true"/>
<EF:EFColumn ename="childId" cname="生产任务ID" enable="false" width="90" align="center" hidden="true"/>
<EF:EFColumn ename="projName" cname="项目名称" enable="false" width="140" align="center"/>
<EF:EFColumn ename="prdtName" cname="部件名称" enable="false" width="120" align="center"/>
<EF:EFColumn ename="partName" cname="零件名称" enable="false" width="120" align="center"/>
<EF:EFColumn ename="partSpec" cname="零件规格" enable="false" width="150" align="center"/>
<EF:EFComboColumn ename="poorType" cname="不良品类" width="100" align="center" required="true">
<EF:EFCodeOption codeName="hpjx.hpjx.poorType"/>
<EF:EFColumn ename="id" cname="内码" hidden="true"/>
<EF:EFColumn ename="companyCode" cname="公司编码" enable="false" width="100" align="center" hidden="true"/>
<EF:EFColumn ename="companyName" cname="公司名称" enable="false" width="130" align="center"/>
<EF:EFColumn ename="receiveDate" cname="收货日期" enable="false" width="100" align="center" editType="date"
dateFormat="yyyy-MM-dd" parseFormats="['yyyyMMdd']"/>
<EF:EFColumn ename="receiveNo" cname="收货单号" enable="false" width="120" align="center"/>
<EF:EFComboColumn ename="status" cname="状态" enable="false" width="80" align="center">
<EF:EFCodeOption codeName="hggp.hgcg.receiveStatus"/>
</EF:EFComboColumn>
<EF:EFColumn ename="problemDesc" cname="质量问题描述" width="140" required="true"/>
<EF:EFColumn ename="completeNum" cname="已入库数量" enable="false" width="120" align="right" format="{0:N0}"/>
<EF:EFColumn ename="num" cname="任务数量" enable="false" width="120" align="right" format="{0:N0}"/>
<EF:EFColumn ename="totalWt" cname="任务重量" enable="false" width="120" align="right" format="{0:N3}"/>
<EF:EFColumn ename="factoryName" cname="工厂" enable="false" width="150" align="center"/>
<EF:EFColumn ename="orgName" cname="生产组名称" enable="false" width="150" align="center"/>
<EF:EFColumn ename="remark" cname="备注" enable="false" width="150"/>
<EF:EFColumn ename="projCode" cname="项目号" enable="false" width="140" align="center"/>
<EF:EFColumn ename="prdtCode" cname="部件编码" enable="false" width="120" align="center"/>
<EF:EFColumn ename="partCode" cname="零件编码" enable="false" width="120" align="center"/>
<EF:EFColumn ename="factoryCode" cname="厂区编码" enable="false" width="150"/>
<EF:EFColumn ename="orgNo" cname="生产组编码" enable="false" width="150"/>
<EF:EFColumn ename="prodTaskNo" cname="生产任务号" enable="false" width="140" align="center"/>
<EF:EFColumn ename="prodOrderNo" cname="生产订单号" enable="false" width="140" align="center"/>
<EF:EFColumn ename="supCode" cname="供应商编码" enable="false" width="100" align="center" hidden="true"/>
<EF:EFColumn ename="supName" cname="供应商名称" enable="false" width="100" align="center"/>
<EF:EFColumn ename="purUserName" cname="采购员" enable="false" width="100" align="center"/>
<EF:EFColumn ename="inventCode" cname="存货编码" enable="false" width="100" align="center" hidden="true"/>
<EF:EFColumn ename="inventName" cname="存货名称" enable="false" width="100" align="center"/>
<EF:EFColumn ename="specId" cname="规格ID" enable="false" width="100" align="center" hidden="true"/>
<EF:EFColumn ename="spec" cname="规格" enable="false" width="120" align="center"/>
<%-- <EF:EFComboColumn ename="poorType" cname="不良品类" width="100" align="center" required="true">--%>
<%-- <EF:EFCodeOption codeName="hggp.hgzl.poorType"/>--%>
<%-- </EF:EFComboColumn>--%>
<%-- <EF:EFColumn ename="problemDesc" cname="质量问题描述" width="140" required="true"/>--%>
<EF:EFColumn ename="receiveQty" cname="收货数量" enable="false" width="120" align="right" format="{0:N0}"/>
<EF:EFColumn ename="receiveWeight" cname="收货重量" enable="false" width="120" align="right" format="{0:N3}"/>
<EF:EFColumn ename="material" cname="材质" enable="false" width="80" align="center"/>
<EF:EFColumn ename="unit" cname="单位" enable="false" width="80" align="center"/>
<EF:EFColumn ename="length" cname="长(M)" enable="false" width="80" align="right" format="{0:N3}"/>
<EF:EFColumn ename="width" cname="宽(M)" enable="false" width="80" align="right" format="{0:N3}"/>
<EF:EFColumn ename="thick" cname="厚(M)" enable="false" width="80" align="right" format="{0:N3}"/>
<EF:EFColumn ename="contractNo" cname="合同号" enable="false" width="120" align="center"/>
<EF:EFColumn ename="createdName" cname="创建人" enable="false" width="100" align="center"/>
<EF:EFColumn ename="createdTime" cname="创建时间" enable="false" width="140" align="center"
editType="datetime" parseFormats="['yyyyMMddHHmmss']"/>
</EF:EFGrid>
</EF:EFRegion>
</EF:EFPage>
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