Commit 07e31b43 by yukang

Merge remote-tracking branch 'origin/dev' into dev

parents 504febc9 de3253e5
package com.baosight.hggp.common;
/**
* @author wwl
* @version 1.0 2024/5/21
*/
public enum CheckStatusEnum {
CHECKING(0,"质检中"),
CHECKED(1,"质检完成");
private Integer code;
private String value;
CheckStatusEnum(Integer code, String value) {
this.code = code;
this.value = value;
}
public static CheckStatusEnum getEnumByCode(Integer code){
for (CheckStatusEnum en : CheckStatusEnum.values()){
if(code.compareTo(en.code)==0){
return en;
}
}
return null;
}
public Integer getCode() {
return code;
}
public void setCode(Integer code) {
this.code = code;
}
public String getValue() {
return value;
}
public void setValue(String value) {
this.value = value;
}
}
......@@ -71,6 +71,10 @@ public class HGConstant {
public static final String HGSC006_ORDER_CODE = "HGSC006_ORDER_CODE";
//生产任务
public static final String HGSC007_TASK_CODE = "HGSC007_TASK_CODE";
//生产报工
public static final String HGSC008_WORK_CODE = "HGSC008_WORK_CODE";
//工序质检
public static final String HGZL002_CHECK_CODE = "HGZL002_CHECK_CODE";
//生产任务订单
public static final String PROD_TASK_NO = "PROD_TASK_NO";
//售后维修单号
......
......@@ -21,7 +21,7 @@ import com.baosight.iplat4j.core.util.StringUtils;
*/
public class HGSC008 extends DaoEPBase {
private static final long serialVersionUID = 1L;
private static final long serialVersionUID = 1L;
public static final String FIELD_id = "id";
public static final String FIELD_mat_id = "matId"; /* 物料清单ID*/
......@@ -38,7 +38,7 @@ public class HGSC008 extends DaoEPBase {
public static final String FIELD_dep_name = "depName"; /* 部门名称*/
public static final String FIELD_proj_code = "projCode"; /* 项目编码*/
public static final String FIELD_proj_name = "projName"; /* 项目名称*/
public static final String FIELD_task_code = "taskCode"; /* 任务编码*/
public static final String FIELD_work_code = "workCode"; /* 报工编码*/
public static final String FIELD_product_type = "productType"; /* 产品类型*/
public static final String FIELD_product_code = "productCode"; /* 产品编号*/
public static final String FIELD_product_name = "productName"; /* 产品名称*/
......@@ -82,7 +82,7 @@ public class HGSC008 extends DaoEPBase {
public static final String COL_dep_name = "dep_name"; /* 部门名称*/
public static final String COL_proj_code = "proj_code"; /* 项目编码*/
public static final String COL_proj_name = "proj_name"; /* 项目名称*/
public static final String COL_task_code = "task_code"; /* 任务编码*/
public static final String COL_work_code = "work_code"; /* 报工编码*/
public static final String COL_product_type = "product_type"; /* 产品类型*/
public static final String COL_product_code = "product_code"; /* 产品编号*/
public static final String COL_product_name = "product_name"; /* 产品名称*/
......@@ -109,6 +109,8 @@ public class HGSC008 extends DaoEPBase {
public static final String INSERT = "HGSC008.insert";
public static final String UPDATE = "HGSC008.update";
public static final String DELETE = "HGSC008.delete";
public static final String BATCH_DELETE = "HGSC008.batch_delete";
private Long id = new Long(0);
private Long matId = new Long(0); /* 物料清单ID*/
......@@ -125,7 +127,7 @@ public class HGSC008 extends DaoEPBase {
private String depName = " "; /* 部门名称*/
private String projCode = " "; /* 项目编码*/
private String projName = " "; /* 项目名称*/
private String taskCode = " "; /* 任务编码*/
private String workCode = " "; /* 报工编码*/
private Integer productType = new Integer(0); /* 产品类型*/
private String productCode = " "; /* 产品编号*/
private String productName = " "; /* 产品名称*/
......@@ -271,8 +273,8 @@ public class HGSC008 extends DaoEPBase {
eiColumn.setDescName("项目名称");
eiMetadata.addMeta(eiColumn);
eiColumn = new EiColumn(FIELD_task_code);
eiColumn.setDescName("任务编码");
eiColumn = new EiColumn(FIELD_work_code);
eiColumn.setDescName("报工编码");
eiMetadata.addMeta(eiColumn);
eiColumn = new EiColumn(FIELD_product_type);
......@@ -649,20 +651,20 @@ public class HGSC008 extends DaoEPBase {
this.projName = projName;
}
/**
* get the taskCode - 任务编码.
* @return the taskCode
* get the workCode - 报工编码.
* @return the workCode
*/
public String getTaskCode() {
return this.taskCode;
public String getWorkCode() {
return this.workCode;
}
/**
* set the taskCode - 任务编码.
* set the workCode - 报工编码.
*
* @param taskCode - 任务编码
* @param workCode - 报工编码
*/
public void setTaskCode(String taskCode) {
this.taskCode = taskCode;
public void setWorkCode(String workCode) {
this.workCode = workCode;
}
/**
* get the productType - 产品类型.
......@@ -1007,7 +1009,7 @@ public class HGSC008 extends DaoEPBase {
setDepName(StringUtils.defaultIfEmpty(StringUtils.toString(map.get(FIELD_dep_name)), depName));
setProjCode(StringUtils.defaultIfEmpty(StringUtils.toString(map.get(FIELD_proj_code)), projCode));
setProjName(StringUtils.defaultIfEmpty(StringUtils.toString(map.get(FIELD_proj_name)), projName));
setTaskCode(StringUtils.defaultIfEmpty(StringUtils.toString(map.get(FIELD_task_code)), taskCode));
setWorkCode(StringUtils.defaultIfEmpty(StringUtils.toString(map.get(FIELD_work_code)), workCode));
setProductType(NumberUtils.toInteger(StringUtils.toString(map.get(FIELD_product_type)), productType));
setProductCode(StringUtils.defaultIfEmpty(StringUtils.toString(map.get(FIELD_product_code)), productCode));
setProductName(StringUtils.defaultIfEmpty(StringUtils.toString(map.get(FIELD_product_name)), productName));
......@@ -1059,7 +1061,7 @@ public class HGSC008 extends DaoEPBase {
map.put(FIELD_dep_name, StringUtils.toString(depName, eiMetadata.getMeta(FIELD_dep_name)));
map.put(FIELD_proj_code, StringUtils.toString(projCode, eiMetadata.getMeta(FIELD_proj_code)));
map.put(FIELD_proj_name, StringUtils.toString(projName, eiMetadata.getMeta(FIELD_proj_name)));
map.put(FIELD_task_code, StringUtils.toString(taskCode, eiMetadata.getMeta(FIELD_task_code)));
map.put(FIELD_work_code, StringUtils.toString(workCode, eiMetadata.getMeta(FIELD_work_code)));
map.put(FIELD_product_type, StringUtils.toString(productType, eiMetadata.getMeta(FIELD_product_type)));
map.put(FIELD_product_code, StringUtils.toString(productCode, eiMetadata.getMeta(FIELD_product_code)));
map.put(FIELD_product_name, StringUtils.toString(productName, eiMetadata.getMeta(FIELD_product_name)));
......
......@@ -115,7 +115,6 @@ public class ServiceHGSC006A extends ServiceBase {
hgsc007.setDepCode(null);
hgsc007.setDepName(null);
hgsc007.setId(null);
HGSC006A a = new HGSC006A();
}
}
......@@ -2,9 +2,13 @@ package com.baosight.hggp.hg.sc.service;
import com.baosight.hggp.aspect.annotation.OperationLogAnnotation;
import com.baosight.hggp.core.constant.CommonConstant;
import com.baosight.hggp.core.dao.DaoUtils;
import com.baosight.hggp.hg.constant.HGConstant;
import com.baosight.hggp.hg.sc.domain.HGSC006A;
import com.baosight.hggp.hg.sc.domain.HGSC007;
import com.baosight.hggp.hg.sc.domain.HGSC008;
import com.baosight.hggp.hg.sc.tools.HGSCTools;
import com.baosight.hggp.hg.zl.tools.HGZLTools;
import com.baosight.hggp.util.*;
import com.baosight.hggp.util.contants.ACConstants;
import com.baosight.iplat4j.core.ei.EiBlock;
......@@ -12,6 +16,8 @@ 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 com.baosight.iplat4j.core.util.NumberUtils;
import com.baosight.iplat4j.ed.util.SequenceGenerator;
import org.springframework.beans.BeanUtils;
import java.math.BigDecimal;
......@@ -24,7 +30,7 @@ import java.util.*;
*/
public class ServiceHGSC007A extends ServiceEPBase {
@OperationLogAnnotation(operModul = "生产任务", operType = "查询", operDesc = "初始化页面")
@OperationLogAnnotation(operModul = "生产报工", operType = "报工", operDesc = "初始化页面")
public EiInfo initLoad(EiInfo inInfo) {
try {
Map queryMap = EiInfoUtils.getFirstRow(inInfo);
......@@ -52,6 +58,17 @@ public class ServiceHGSC007A extends ServiceEPBase {
return inInfo;
}
@OperationLogAnnotation(operModul = "生产报工", operType = "报工", operDesc = "保存")
public EiInfo save(EiInfo inInfo) {
try{
HGSCTools.THGSC008.add(inInfo);
inInfo.setStatus(EiConstant.STATUS_DEFAULT);
inInfo.setMsg("保存成功!");
} catch (Exception e) {
LogUtils.setDetailMsg(inInfo, e, "保存失败");
}
return inInfo;
}
}
......
package com.baosight.hggp.hg.sc.service;
import com.baosight.hggp.aspect.annotation.OperationLogAnnotation;
import com.baosight.hggp.core.dao.DaoUtils;
import com.baosight.hggp.hg.sc.domain.HGSC002;
import com.baosight.hggp.hg.sc.domain.HGSC008;
import com.baosight.hggp.hg.sc.tools.HGSCTools;
import com.baosight.hggp.util.LogUtils;
import com.baosight.hggp.util.ObjectUtils;
import com.baosight.iplat4j.core.ei.EiConstant;
import com.baosight.iplat4j.core.ei.EiInfo;
import com.baosight.iplat4j.core.exception.PlatException;
import com.baosight.iplat4j.core.service.impl.ServiceEPBase;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
/**
* @author wwl
* @version 1.0 2024/5/24
*/
public class ServiceHGSC008 extends ServiceEPBase {
@OperationLogAnnotation(operModul = "生产报工单", operType = "查询", operDesc = "初始化页面")
public EiInfo initLoad(EiInfo inInfo) {
try {
inInfo = super.query(inInfo, HGSC008.QUERY, new HGSC008());
} catch (PlatException e) {
LogUtils.setDetailMsg(inInfo, e, "初始化失败");
}
return inInfo;
}
/*
* 查询*/
@OperationLogAnnotation(operModul = "生产报工单", operType = "查询", operDesc = "查询")
public EiInfo query(EiInfo inInfo) {
try {
inInfo = super.query(inInfo,HGSC008.QUERY,new HGSC008() );
} catch (PlatException e) {
LogUtils.setDetailMsg(inInfo, e, "查询失败");
}
return inInfo;
}
@Override
@OperationLogAnnotation(operModul = "生产报工单", operType = "删除", operDesc = "删除")
public EiInfo delete(EiInfo inInfo) {
try {
List<Map> resultRows = inInfo.getBlock(EiConstant.resultBlock).getRows();
// 销售单号
List<Long> ids = ObjectUtils.listKey(resultRows, HGSC002.FIELD_id);
HGSCTools.THGSC008.delete(ids);
inInfo = this.query(inInfo);
inInfo.setStatus(EiConstant.STATUS_DEFAULT);
inInfo.setMsg("操作成功!本次对[" + resultRows.size() + "]条数据删除成功!");
} catch (Exception e) {
LogUtils.setDetailMsg(inInfo, e, "删除失败");
}
return inInfo;
}
}
......@@ -171,7 +171,9 @@
<isNotEmpty prepend=" AND " property="updatedTime">
updated_time = #updatedTime#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="ids">
id IN <iterate close=")" open="(" conjunction="," property="ids">#ids[]#</iterate>
</isNotEmpty>
</sql>
<select id="query" parameterClass="java.util.HashMap"
......
......@@ -19,7 +19,7 @@
dep_name VARCHAR,
proj_code VARCHAR,
proj_name VARCHAR,
task_code VARCHAR,
work_code VARCHAR,
product_type TINYINT,
product_code VARCHAR,
product_name VARCHAR,
......@@ -75,7 +75,7 @@
company_code = #companyCode#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="companyName">
company_name = #companyName#
company_name like ('%$companyName$%')
</isNotEmpty>
<isNotEmpty prepend=" AND " property="depCode">
dep_code = #depCode#
......@@ -89,8 +89,8 @@
<isNotEmpty prepend=" AND " property="projName">
proj_name = #projName#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="taskCode">
task_code = #taskCode#
<isNotEmpty prepend=" AND " property="workCode">
work_code like ('%$workCode$%')
</isNotEmpty>
<isNotEmpty prepend=" AND " property="productType">
product_type = #productType#
......@@ -117,7 +117,7 @@
group_code = #groupCode#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="groupName">
group_name = #groupName#
group_name like ('%$groupName$%')
</isNotEmpty>
<isNotEmpty prepend=" AND " property="registerDate">
register_date = #registerDate#
......@@ -172,7 +172,7 @@
dep_name as "depName", <!-- 部门名称 -->
proj_code as "projCode", <!-- 项目编码 -->
proj_name as "projName", <!-- 项目名称 -->
task_code as "taskCode", <!-- 任务编码 -->
work_code as "workCode", <!-- 报工编码 -->
product_type as "productType", <!-- 产品类型 -->
product_code as "productCode", <!-- 产品编号 -->
product_name as "productName", <!-- 产品名称 -->
......@@ -200,7 +200,7 @@
$orderBy$
</isNotEmpty>
<isEmpty property="orderBy">
id asc
register_date desc ,id desc
</isEmpty>
</dynamic>
......@@ -257,8 +257,8 @@
<isNotEmpty prepend=" AND " property="projName">
proj_name = #projName#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="taskCode">
task_code = #taskCode#
<isNotEmpty prepend=" AND " property="workCode">
work_code = #workCode#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="productType">
product_type = #productType#
......@@ -338,7 +338,7 @@
dep_name, <!-- 部门名称 -->
proj_code, <!-- 项目编码 -->
proj_name, <!-- 项目名称 -->
task_code, <!-- 任务编码 -->
work_code, <!-- 报工编码 -->
product_type, <!-- 产品类型 -->
product_code, <!-- 产品编号 -->
product_name, <!-- 产品名称 -->
......@@ -360,7 +360,10 @@
updated_name, <!-- 修改人名称 -->
updated_time <!-- 更新时间 -->
)
VALUES (#id#, #matId#, #taskId#, #techFlowId#, #techFlowName#, #inventProcessId#, #processCode#, #processName#, #processOrder#, #companyCode#, #companyName#, #depCode#, #depName#, #projCode#, #projName#, #taskCode#, #productType#, #productCode#, #productName#, #planStartDate#, #planEndDate#, #factoryCode#, #factoryName#, #groupCode#, #groupName#, #registerDate#, #quantity#, #singleWeight#, #totalWeight#, #accountCode#, #createdBy#, #createdName#, #createdTime#, #updatedBy#, #updatedName#, #updatedTime#)
VALUES (#id#, #matId#, #taskId#, #techFlowId#, #techFlowName#, #inventProcessId#, #processCode#, #processName#, #processOrder#, #companyCode#, #companyName#, #depCode#, #depName#, #projCode#, #projName#, #workCode#, #productType#, #productCode#, #productName#, #planStartDate#, #planEndDate#, #factoryCode#, #factoryName#, #groupCode#, #groupName#, #registerDate#, #quantity#, #singleWeight#, #totalWeight#, #accountCode#, #createdBy#, #createdName#, #createdTime#, #updatedBy#, #updatedName#, #updatedTime#)
<selectKey resultClass="long" keyProperty="id">
SELECT MAX(ID) AS "id" FROM ${hggpSchema}.HGSC008
</selectKey>
</insert>
<delete id="delete">
......@@ -385,7 +388,7 @@
dep_name = #depName#, <!-- 部门名称 -->
proj_code = #projCode#, <!-- 项目编码 -->
proj_name = #projName#, <!-- 项目名称 -->
task_code = #taskCode#, <!-- 任务编码 -->
work_code = #workCode#, <!-- 报工编码 -->
product_type = #productType#, <!-- 产品类型 -->
product_code = #productCode#, <!-- 产品编号 -->
product_name = #productName#, <!-- 产品名称 -->
......@@ -410,4 +413,8 @@
id = #id#
</update>
<delete id="batch_delete">
DELETE FROM ${hggpSchema}.HGSC008 WHERE
id IN <iterate close=")" open="(" conjunction="," property="ids">#ids[]#</iterate>
</delete>
</sqlMap>
......@@ -2,6 +2,7 @@ package com.baosight.hggp.hg.sc.tools;
import cn.hutool.core.bean.BeanUtil;
import com.baosight.hggp.common.AssignStatusEnum;
import com.baosight.hggp.common.CheckStatusEnum;
import com.baosight.hggp.common.ComputeTypeEnum;
import com.baosight.hggp.common.ProductTypeEnum;
import com.baosight.hggp.core.constant.CommonConstant;
......@@ -16,10 +17,17 @@ import com.baosight.hggp.hg.pz.tools.HGPZTools;
import com.baosight.hggp.hg.sc.domain.*;
import com.baosight.hggp.hg.sj.domain.HGSJ001;
import com.baosight.hggp.hg.sj.tools.HGSJTools;
import com.baosight.hggp.hg.xs.domain.Org;
import com.baosight.hggp.hg.zl.domain.HGZL002;
import com.baosight.hggp.hg.zl.tools.HGZLTools;
import com.baosight.hggp.util.AssertUtils;
import com.baosight.hggp.util.BeanUtils;
import com.baosight.hggp.util.DateUtil;
import com.baosight.hggp.util.EiInfoUtils;
import com.baosight.iplat4j.core.ei.EiConstant;
import com.baosight.iplat4j.core.ei.EiInfo;
import com.baosight.iplat4j.core.exception.PlatException;
import com.baosight.iplat4j.core.util.NumberUtils;
import com.baosight.iplat4j.ed.util.SequenceGenerator;
import org.apache.commons.collections.CollectionUtils;
import org.apache.commons.collections.MapUtils;
......@@ -757,6 +765,56 @@ public class HGSCTools {
List<HGSC008> results = DaoBase.getInstance().query(HGSC008.QUERY, new HashMap<String,Object>(){{put(HGSC008.FIELD_task_id, taskId);}});
return CollectionUtils.isEmpty(results) ? null : results;
}
public static HGSC008 add(EiInfo info){
Map resultMap = EiInfoUtils.getFirstRow(info, EiConstant.resultBlock);
String taskId = com.baosight.hggp.util.MapUtils.getString(resultMap, HGSC008.FIELD_task_id);
HGSC007 hgsc007 = HGSCTools.THGSC007.getById(Long.valueOf(taskId));
HGSC008 hgsc008 = new HGSC008();
BeanUtils.copyProperties(hgsc007,hgsc008);
cleanBaseInfo(hgsc008);
hgsc008.setQuantity(NumberUtils.toInteger(resultMap.get(HGSC008.FIELD_quantity)));
hgsc008.setTotalWeight(hgsc007.getSingleWeight().multiply(new BigDecimal(hgsc008.getQuantity())));
checkAddDate(hgsc008);
hgsc008.setWorkCode(SequenceGenerator.getNextSequence(HGConstant.SequenceId.HGSC008_WORK_CODE));
DaoUtils.insert(HGSC008.INSERT,hgsc008);
HGZLTools.THGZL002.add(hgsc008);
return hgsc008;
}
private static void checkAddDate(HGSC008 hgsc008){
List<String> orgIdList = UserSessionUtils.getOrgId();
AssertUtils.isEmpty(hgsc008.getGroupCode(),"生产任务班组信息异常,请联系管理员!");
AssertUtils.isTrue(!orgIdList.contains(hgsc008.getGroupCode()),"非当前任务生产组用户,无法报工此任务!");
AssertUtils.isNull(hgsc008.getQuantity(),"报工数量不能为空!");
}
private static void cleanBaseInfo(HGSC008 hgsc008){
hgsc008.setCreatedBy(null);
hgsc008.setCreatedName(null);
hgsc008.setCreatedTime(null);
hgsc008.setUpdatedBy(null);
hgsc008.setUpdatedName(null);
hgsc008.setUpdatedTime(null);
hgsc008.setDepCode(null);
hgsc008.setDepName(null);
hgsc008.setId(null);
}
public static void delete(List<Long> ids) {
checkDeleteDate(ids);
DaoUtils.update(HGSC008.BATCH_DELETE, new HashMap<String,Object>(){{put("ids",ids);}});
}
private static void checkDeleteDate(List<Long> ids){
List<HGZL002> hgzl002s = HGZLTools.THGZL002.list(ids);
List<String> workCodes = hgzl002s.stream().filter(o -> o.getCheckStatus().compareTo(CheckStatusEnum.CHECKED.getCode())==0).map(HGZL002::getWorkCode).collect(Collectors.toList());
if(CollectionUtils.isNotEmpty(workCodes)){
AssertUtils.isNotEmpty(workCodes,String.format("生产报工单[%s]已经质检完成,无法删除!",String.join(",",workCodes)));
}
}
}
......
package com.baosight.hggp.hg.zl.tools;
import com.baosight.hggp.common.CheckStatusEnum;
import com.baosight.hggp.core.dao.DaoBase;
import com.baosight.hggp.core.dao.DaoUtils;
import com.baosight.hggp.hg.constant.HGConstant;
import com.baosight.hggp.hg.constant.HGSqlConstant;
import com.baosight.hggp.hg.sc.domain.HGSC008;
import com.baosight.hggp.hg.zl.domain.HGZL001;
import com.baosight.hggp.hg.zl.domain.HGZL002;
import com.baosight.hggp.util.AssertUtils;
import com.baosight.iplat4j.ed.util.SequenceGenerator;
import org.apache.commons.collections.CollectionUtils;
import org.springframework.beans.BeanUtils;
import java.math.BigDecimal;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
......@@ -16,13 +24,13 @@ import java.util.stream.Collectors;
* @date:2024/5/18,15:12
*/
public class HGZLTools {
/**
* @author:songx
* @date:2024/5/18,15:12
*/
public static class HgZl001 {
/**
* 锁
*
......@@ -37,7 +45,7 @@ public class HGZLTools {
paramMap.put("checkNos", checkNos);
DaoBase.getInstance().update(HGSqlConstant.HgZl001.LOCK, paramMap);
}
/**
* @param id
*/
......@@ -48,7 +56,7 @@ public class HGZLTools {
List<HGZL001> results = DaoBase.getInstance().query(HGZL001.QUERY, paramMap);
return CollectionUtils.isEmpty(results) ? null : results.get(0);
}
/**
* 查询
*
......@@ -61,7 +69,7 @@ public class HGZLTools {
paramMap.put("checkNos", checkNos);
return DaoBase.getInstance().query(HGZL001.QUERY, paramMap);
}
/**
* 查询
*
......@@ -73,4 +81,41 @@ public class HGZLTools {
return results.stream().collect(Collectors.toMap(HGZL001::getCheckNo, item -> item));
}
}
}
public static class THGZL002 {
public static HGZL002 add(HGSC008 hgsc008){
HGZL002 hgzl002 = new HGZL002();
BeanUtils.copyProperties(hgsc008,hgzl002);
cleanBaseInfo(hgzl002);
hgzl002.setCheckStatus(CheckStatusEnum.CHECKING.getCode());
hgzl002.setWorkId(hgsc008.getId());
hgzl002.setWorkCode(hgsc008.getWorkCode());
hgzl002.setWorkBy(hgsc008.getCreatedBy());
hgzl002.setWorkName(hgsc008.getCreatedName());
hgzl002.setCheckCode(SequenceGenerator.getNextSequence(HGConstant.SequenceId.HGZL002_CHECK_CODE));
DaoUtils.insert(HGZL002.INSERT,hgzl002);
return hgzl002;
}
private static void cleanBaseInfo(HGZL002 hgzl002){
hgzl002.setCreatedBy(null);
hgzl002.setCreatedName(null);
hgzl002.setCreatedTime(null);
hgzl002.setUpdatedBy(null);
hgzl002.setUpdatedName(null);
hgzl002.setUpdatedTime(null);
hgzl002.setDepCode(null);
hgzl002.setDepName(null);
hgzl002.setId(null);
}
public static List<HGZL002> list(List<Long> workIds) {
if (CollectionUtils.isEmpty(workIds)) {
return null;
}
Map queryMap = new HashMap();
queryMap.put("workIds", workIds);
return DaoBase.getInstance().query(HGZL002.QUERY, queryMap);
}
}
}
\ No newline at end of file
......@@ -137,7 +137,7 @@ let initInvent = function () {
*/
let initSpec = function () {
let inInfo = new EiInfo();
inInfo.set("inqu_status-0-inventTypes", [1, 2]);
//inInfo.set("inqu_status-0-inventTypes", [1, 2]);
inInfo.set("inqu_status-0-isSplicingSymbol", false);
EiCommunicator.send("HGPZ005", "queryInventBoxAll", inInfo, {
onSuccess: function (ei) {
......@@ -182,12 +182,24 @@ let save = function () {
}
let flag = true;
$.each(rows, function(index, item) {
let whCode= item.get("whCode");
/* if(isBlank(whCode)){
message("选中的第"+(index+1)+"行\"仓库名称\",不能为空!");
let inventType= item.get("inventType");
let inventCode= item.get("inventCode");
let inventRecordId= item.get("inventRecordId");
if(isBlank(inventType)){
message("选中的第"+(index+1)+"行\"存货类型\",不能为空!");
flag = false;
return false;
}*/
}
if(isBlank(inventCode)){
message("选中的第"+(index+1)+"行\"存货名称\",不能为空!");
flag = false;
return false;
}
if(isBlank(inventRecordId)){
message("选中的第"+(index+1)+"行\"规格\",不能为空!");
flag = false;
return false;
}
});
if(flag) {
JSUtils.confirm("确定对勾选中的[" + rows.length + "]条数据做\"保存\"操作? ", {
......
......@@ -137,7 +137,7 @@ let initInvent = function () {
*/
let initSpec = function () {
let inInfo = new EiInfo();
inInfo.set("inqu_status-0-inventTypes", [1, 2]);
//inInfo.set("inqu_status-0-inventTypes", [1, 2]);
inInfo.set("inqu_status-0-isSplicingSymbol", false);
EiCommunicator.send("HGPZ005", "queryInventBoxAll", inInfo, {
onSuccess: function (ei) {
......@@ -184,12 +184,24 @@ let save = function () {
}
let flag = true;
$.each(rows, function(index, item) {
/* let whCode= item.get("whCode");
if(isBlank(whCode)){
message("选中的第"+(index+1)+"行\"仓库名称\",不能为空!");
flag = false;
return false;
}*/
let inventType= item.get("inventType");
let inventCode= item.get("inventCode");
let inventRecordId= item.get("inventRecordId");
if(isBlank(inventType)){
message("选中的第"+(index+1)+"行\"存货类型\",不能为空!");
flag = false;
return false;
}
if(isBlank(inventCode)){
message("选中的第"+(index+1)+"行\"存货名称\",不能为空!");
flag = false;
return false;
}
if(isBlank(inventRecordId)){
message("选中的第"+(index+1)+"行\"规格\",不能为空!");
flag = false;
return false;
}
});
if(flag) {
JSUtils.confirm("确定对勾选中的[" + rows.length + "]条数据做\"保存\"操作? ", {
......
......@@ -15,10 +15,8 @@ $(function () {
field: "operator",
template: function (item) {
let template = '';
if(item.unfinishQuantity>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="registerWork(' + item.id + ')" >报工</a>';
}
template+='<a style="cursor: pointer;display: inline-flex;justify-content: center;margin:auto 5px" '
+ 'onclick="showUploadFile(' + item.matId + ')" >附件清单</a>';
return template;
......
......@@ -37,7 +37,7 @@ $(function () {
}
JSUtils.confirm("确定对数据做\"保存\"操作? ", {
ok: function () {
JSUtils.submitGrid("detail", "HGSC001", "save", {isAlldata:true,onSuccessCallback:parent.windowCallback});
JSUtils.submitGrid("result", "HGSC007A", "save", {isAlldata:true,onSuccessCallback:parent.registerWorkCallback});
}
});
});
......
$(function () {
$("#QUERY").on("click", function () {
resultGrid.dataSource.page(1);
});
IPLATUI.EFGrid.result = {
pageable: {
pageSize: 20,
pageSizes: [10, 20, 50, 70, 100],
},
columns: [
],
loadComplete: function(grid) {
},
onSuccess: function (e) {
if(e.eiInfo.extAttr.methodName == 'save'||e.eiInfo.extAttr.methodName == 'delete' ){
query();
}
}
}
});
<%--
Created by IntelliJ IDEA.
User: 1
Date: 2024/5/10
Time: 15:29
To change this template use File | Settings | File Templates.
--%>
<!DOCTYPE html>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %>
<%@ taglib prefix="EF" tagdir="/WEB-INF/tags/EF" %>
<%@ page import="com.baosight.iplat4j.core.web.threadlocal.UserSession" %>
<%
String loginName = UserSession.getLoginName();
%>
<c:set var="ctx" value="${pageContext.request.contextPath}"/>
<c:set var="loginName" value="<%=loginName%>" />
<EF:EFPage title="生产报工单">
<EF:EFRegion id="inqu" title="查询条件">
<div class="row">
<EF:EFInput blockId="inqu_status" row="0" ename="companyName" cname="公司名称" placeholder="模糊查询" colWidth="3"/>
<EF:EFInput blockId="inqu_status" row="0" ename="workCode" cname="报工单号" placeholder="模糊查询" colWidth="3"/>
<EF:EFInput blockId="inqu_status" row="0" ename="groupName" cname="生产组" placeholder="模糊查询" colWidth="3"/>
</div>
</EF:EFRegion>
<EF:EFRegion id="result" title="明细信息">
<EF:EFGrid blockId="result" autoDraw="override" isFloat="true">
<EF:EFColumn ename="id" primaryKey="true" cname="内码" hidden="true"/>
<EF:EFColumn ename="accountCode" cname="账套" hidden="true"/>
<EF:EFColumn ename="companyName" cname="公司名称" enable="true" width="120" align="center" readOnly="true"/>
<EF:EFColumn ename="projName" cname="项目名称" enable="true" width="120" align="center" readOnly="true"/>
<EF:EFColumn ename="workCode" cname="报工单号" width="100" enable="false" readonly="true" align="center"/>
<EF:EFColumn ename="productCode" cname="产品编码" width="100" enable="false" readonly="true" align="center"/>
<EF:EFColumn ename="productName" 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="groupName" cname="生产组" width="100" enable="false" readonly="true" align="center"/>
<EF:EFColumn ename="quantity" cname="数量" width="100" enable="false" readonly="true" align="center"/>
<EF:EFColumn ename="singleWeight" cname="单重" width="100" enable="false" readonly="true" align="center"/>
<EF:EFColumn ename="totalWeight" cname="任务总重" width="100" enable="false" readonly="true" align="center"/>
</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