Commit a568a105 by liuyang

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

parents 09e9280c 5f6cc8b7
...@@ -5,7 +5,7 @@ package com.baosight.hggp.hg.constant; ...@@ -5,7 +5,7 @@ package com.baosight.hggp.hg.constant;
* @date:2024/1/18,17:16 * @date:2024/1/18,17:16
*/ */
public class HGConstant { public class HGConstant {
/** /**
* 序列号 * 序列号
* *
...@@ -13,7 +13,7 @@ public class HGConstant { ...@@ -13,7 +13,7 @@ public class HGConstant {
* @date:2021/8/17,15:22 * @date:2021/8/17,15:22
*/ */
public static class SequenceId { public static class SequenceId {
// 用户ID // 用户ID
public static final String USER_ID = "USER_ID"; public static final String USER_ID = "USER_ID";
// 组织机构编码 // 组织机构编码
...@@ -40,7 +40,7 @@ public class HGConstant { ...@@ -40,7 +40,7 @@ public class HGConstant {
public static final String WH_CODE = "HGPZ007_WH_CODE"; public static final String WH_CODE = "HGPZ007_WH_CODE";
// 项目性质编码 // 项目性质编码
public static final String NAT_CODE = "HGPZ008_NAT_CODE"; public static final String NAT_CODE = "HGPZ008_NAT_CODE";
//项目档案编号 //项目档案编号
public static final String PROJ_NUMBER = "PROJ_NUMBER"; public static final String PROJ_NUMBER = "PROJ_NUMBER";
// 盘点单号 // 盘点单号
...@@ -101,8 +101,10 @@ public class HGConstant { ...@@ -101,8 +101,10 @@ public class HGConstant {
public static final String INSPEC_CODE = "INSPEC_CODE"; public static final String INSPEC_CODE = "INSPEC_CODE";
// 保养单号 // 保养单号
public static final String UPKEEP_CODE = "UPKEEP_CODE"; public static final String UPKEEP_CODE = "UPKEEP_CODE";
// 蓝图编号
public static final String BLUEPRINT_CODE = "BLUEPRINT_CODE";
} }
/** /**
* 采购计划状态 * 采购计划状态
* *
...@@ -110,7 +112,7 @@ public class HGConstant { ...@@ -110,7 +112,7 @@ public class HGConstant {
* @date:2024/2/22,13:57 * @date:2024/2/22,13:57
*/ */
public static class CgPlanStatus { public static class CgPlanStatus {
// 待审核 // 待审核
public static final Integer S_0 = 0; public static final Integer S_0 = 0;
// 审核中 // 审核中
...@@ -122,7 +124,7 @@ public class HGConstant { ...@@ -122,7 +124,7 @@ public class HGConstant {
// 生成合同 // 生成合同
public static final Integer S_4 = 4; public static final Integer S_4 = 4;
} }
/** /**
* 采购合同状态 * 采购合同状态
* *
...@@ -130,7 +132,7 @@ public class HGConstant { ...@@ -130,7 +132,7 @@ public class HGConstant {
* @date:2024/2/22,13:57 * @date:2024/2/22,13:57
*/ */
public static class CgContractStatus { public static class CgContractStatus {
// 待审核 // 待审核
public static final Integer S_0 = 0; public static final Integer S_0 = 0;
// 审核中 // 审核中
...@@ -164,7 +166,7 @@ public class HGConstant { ...@@ -164,7 +166,7 @@ public class HGConstant {
// 已入库 // 已入库
public static final Integer S_5 = 5; public static final Integer S_5 = 5;
} }
/** /**
* 库存类型 * 库存类型
* *
...@@ -172,7 +174,7 @@ public class HGConstant { ...@@ -172,7 +174,7 @@ public class HGConstant {
* @date:2024/1/20,15:18 * @date:2024/1/20,15:18
*/ */
public static class KcType { public static class KcType {
// 采购 // 采购
public static final String CG = "CG"; public static final String CG = "CG";
// 生产 // 生产
...@@ -180,5 +182,33 @@ public class HGConstant { ...@@ -180,5 +182,33 @@ public class HGConstant {
// 其他 // 其他
public static final String QT = "QT"; public static final String QT = "QT";
} }
/**
* 停用状态
*
* @author:songx
* @date:2024/1/20,15:18
*/
public static class EnablingStatus {
// 停用
public static final Integer TY = 0;
// 启用
public static final Integer QY = 1;
}
/**
* 审批状态
*
* @author:songx
* @date:2024/5/15,15:18
*/
public static class ApprovalStatus {
// 待审
public static final Integer DS = 0;
// 审批中
public static final Integer SPZ = 1;
// 已审
public static final Integer YS = 2;
}
} }
package com.baosight.hggp.hg.sc.service;
import com.baosight.hggp.common.DdynamicEnum;
import com.baosight.hggp.core.dao.DaoUtils;
import com.baosight.hggp.core.security.UserSessionUtils;
import com.baosight.hggp.hg.constant.HGConstant;
import com.baosight.hggp.hg.sc.domain.HGSC001;
import com.baosight.hggp.hg.sc.domain.HGSC003;
import com.baosight.hggp.util.*;
import com.baosight.iplat4j.core.ei.EiBlock;
import com.baosight.iplat4j.core.ei.EiConstant;
import com.baosight.iplat4j.core.ei.EiInfo;
import com.baosight.iplat4j.core.exception.PlatException;
import com.baosight.iplat4j.core.resource.I18nMessages;
import com.baosight.iplat4j.core.service.impl.ServiceBase;
import com.baosight.iplat4j.ed.util.SequenceGenerator;
import java.util.*;
/**
* @Author jhs
* @Date 2024/5/14 14:46
*/
public class ServiceHGSC003 extends ServiceBase {
public EiInfo initLoad(EiInfo inInfo) {
try {
inInfo = super.query(inInfo, HGSC003.QUERY, new HGSC003());
Map map = new HashMap();
map.put(HGSC003.FIELD_account_code, UserSessionUtils.getAccountCode());
CommonMethod.initBlock(inInfo,
Arrays.asList(DdynamicEnum.COMPANY_BOX_BLOCK_ID,DdynamicEnum.PROJ_RECORD_BLOCK_ID),map,false
);
} catch (PlatException e) {
LogUtils.setDetailMsg(inInfo, e, "初始化失败");
}
return inInfo;
}
public EiInfo query(EiInfo inInfo) {
try {
inInfo = super.query(inInfo, HGSC003.QUERY, new HGSC003());
Map map = new HashMap();
map.put(HGSC003.FIELD_account_code, UserSessionUtils.getAccountCode());
CommonMethod.initBlock(inInfo,
Arrays.asList(DdynamicEnum.COMPANY_BOX_BLOCK_ID,DdynamicEnum.PROJ_RECORD_BLOCK_ID),map,false
);
inInfo.setStatus(EiConstant.STATUS_DEFAULT);
} catch (PlatException e) {
LogUtils.setDetailMsg(inInfo, e, "查询失败");
}
return inInfo;
}
@Override
public EiInfo delete(EiInfo inInfo) {
try {
List<Map> resultRows = inInfo.getBlock(EiConstant.resultBlock).getRows();
// 蓝图ids
List<Long> ids = ObjectUtils.listKey(resultRows, HGSC003.FIELD_id);
DaoUtils.update(HGSC003.BATCH_DELETE, new HashMap<String,Object>(){{put("ids",ids);}});
// HGSCTools.THGSC003A.deleteByProIds(ids);
inInfo = this.query(inInfo);
inInfo.setStatus(EiConstant.STATUS_DEFAULT);
inInfo.setMsg("操作成功!本次对[" + resultRows.size() + "]条数据删除成功!");
} catch (Exception e) {
LogUtils.setDetailMsg(inInfo, e, "删除失败");
}
return inInfo;
}
public EiInfo deactivate(EiInfo inInfo) {
try {
List<Map> resultRows = inInfo.getBlock(EiConstant.resultBlock).getRows();
// 蓝图ids
List<Long> ids = ObjectUtils.listKey(resultRows, "id");
DaoUtils.update(HGSC003.BATCH_DEACTIVATE, new HashMap<String,Object>(){{put("ids",ids);}});
inInfo = this.query(inInfo);
inInfo.setStatus(EiConstant.STATUS_DEFAULT);
inInfo.setMsg("操作成功!本次对[" + resultRows.size() + "]条数据停用成功!");
} catch (Exception e) {
LogUtils.setDetailMsg(inInfo, e, "操作失败");
}
return inInfo;
}
public EiInfo save(EiInfo inInfo){
try {
Map resultMap = EiInfoUtils.getFirstRow(inInfo,EiConstant.resultBlock);
HGSC003 hgsc003 = new HGSC003();
hgsc003.fromMap(resultMap);
this.checkSaveData(hgsc003);
if(Objects.nonNull(hgsc003.getId())&&hgsc003.getId()!=0){
DaoUtils.update(HGSC003.UPDATE, hgsc003);
}else {
//生成蓝图编号
hgsc003.setBlueprintCode(SequenceGenerator.getNextSequence(HGConstant.SequenceId.BLUEPRINT_CODE));
hgsc003.setBlueprintStatus(HGConstant.EnablingStatus.QY);
DaoUtils.insert(HGSC003.INSERT, hgsc003);
}
inInfo.setStatus(EiConstant.STATUS_DEFAULT);
inInfo.setMsg("保存成功!");
} catch (Exception e) {
LogUtils.setDetailMsg(inInfo, e, "保存失败");
}
return inInfo;
}
/**
* 校验保存的数据
*
* @param hgsc003
*/
private void checkSaveData(HGSC003 hgsc003) {
if(Objects.nonNull(hgsc003.getId())&&hgsc003.getId()>0){
HGSC003 oldHgsc003 = (HGSC003) super.dao.get(HGSC003.QUERY,HGSC003.FIELD_id,hgsc003.getId());
AssertUtils.isTrue(oldHgsc003.getBlueprintStatus().compareTo(HGConstant.EnablingStatus.QY) == 0,"蓝图启用中不可修改!");
}
Map<String,Object> map = new HashMap<>();
map.put("projCode",hgsc003.getProjCode());
List<HGSC003> oldHgsc003List = this.dao.query(HGSC003.QUERY,map);
for(HGSC003 o : oldHgsc003List){
AssertUtils.isTrue(!(o.getId().intValue() == hgsc003.getId().intValue()),"已存在此项目号的蓝图!");
}
AssertUtils.isEmpty(UserSessionUtils.getAccountCode(), "当前用户未绑定公司,无法操作数据,请联系管理员!");
AssertUtils.isEmpty(UserSessionUtils.getOrgId(), "当前用户未绑定部门,无法操作数据,请联系管理员!");
AssertUtils.isEmpty(hgsc003.getCompanyCode(), "请选择公司!");
AssertUtils.isEmpty(hgsc003.getProjCode(), "请填写项目编号!");
AssertUtils.isEmpty(hgsc003.getProjName(), "请填写项目名称!");
AssertUtils.isEmpty(hgsc003.getBlueprintName(), "请填写蓝图名称!");
}
/**
* 修改启用状态
* @param inInfo
* @return
*/
public EiInfo updateBlueprintStatus(EiInfo inInfo){
int i = 0;
try {
HGSC003 hgsc003 = new HGSC003();
EiBlock eiBlock = inInfo.getBlock(EiConstant.resultBlock);
for (i = 0; i < eiBlock.getRowCount(); i++) {
Map<?, ?> map = eiBlock.getRow(i);
hgsc003.fromMap(map);
DaoUtils.update(HGSC003.UPDATE_BLUEPRINT_STATUS, hgsc003);
}
inInfo.setStatus(EiConstant.STATUS_SUCCESS);
inInfo.setMsgByKey("ep.1000", new String[]{String.valueOf(i), I18nMessages.getText("label.update", "修改")});
} catch (PlatException e) {
e.printStackTrace();
inInfo.setStatus(EiConstant.STATUS_FAILURE);
ErrorCodeUtils.handleUpdateException(inInfo,i,e);
logError("修改失败", e.getMessage());
return inInfo;
}
return inInfo;
}
/**
* 项目档案下拉框
* @param inInfo
* @return
*/
public EiInfo projComboBox(EiInfo inInfo){
Map queryMap = EiInfoUtils.getFirstRow(inInfo);
String companyCode = MapUtils.getString(queryMap, HGSC001.FIELD_company_code);
String approvalStatus = MapUtils.getString(queryMap, HGSC001.FIELD_approval_status);
Map map = new HashMap();
map.put(HGSC001.FIELD_account_code, UserSessionUtils.getAccountCode());
map.put(HGSC001.FIELD_company_code, companyCode);
map.put(HGSC001.FIELD_approval_status, approvalStatus);
CommonMethod.initBlock(inInfo, Arrays.asList(DdynamicEnum.PROJ_RECORD_BLOCK_ID), map,false);
return inInfo;
}
}
...@@ -4,33 +4,33 @@ ...@@ -4,33 +4,33 @@
Version : 1.0 Version : 1.0
schema : hggp schema : hggp
tableName : HGSC001 tableName : HGSC001
id BIGINT NOT NULL primarykey, id BIGINT NOT NULL primarykey,
company_code VARCHAR NOT NULL, company_code VARCHAR NOT NULL,
company_name VARCHAR NOT NULL, company_name VARCHAR NOT NULL,
dep_code VARCHAR, dep_code VARCHAR,
dep_name VARCHAR, dep_name VARCHAR,
subcontract_code VARCHAR NOT NULL, subcontract_code VARCHAR NOT NULL,
subcontract_name VARCHAR NOT NULL, subcontract_name VARCHAR NOT NULL,
genral_contract_code VARCHAR NOT NULL, genral_contract_code VARCHAR NOT NULL,
genral_contract_name VARCHAR NOT NULL, genral_contract_name VARCHAR NOT NULL,
party_pm_name VARCHAR, party_pm_name VARCHAR,
party_pm_hpone VARCHAR, party_pm_hpone VARCHAR,
contract_name VARCHAR, contract_name VARCHAR,
contract_work_txt VARCHAR, contract_work_txt VARCHAR,
proj_code VARCHAR, proj_code VARCHAR,
proj_name VARCHAR, proj_name VARCHAR,
proj_type VARCHAR, proj_type VARCHAR,
proj_status TINYINT, proj_status TINYINT,
approval_status TINYINT, approval_status TINYINT,
permiss_start_date VARCHAR, permiss_start_date VARCHAR,
start_date VARCHAR, start_date VARCHAR,
end_date VARCHAR, end_date VARCHAR,
account_code VARCHAR NOT NULL, account_code VARCHAR NOT NULL,
created_by VARCHAR, created_by VARCHAR,
created_name VARCHAR, created_name VARCHAR,
created_time VARCHAR, created_time VARCHAR,
updated_by VARCHAR, updated_by VARCHAR,
updated_name VARCHAR, updated_name VARCHAR,
updated_time VARCHAR updated_time VARCHAR
--> -->
<sqlMap namespace="HGSC001"> <sqlMap namespace="HGSC001">
...@@ -127,7 +127,7 @@ ...@@ -127,7 +127,7 @@
<select id="query" parameterClass="java.util.HashMap" <select id="query" parameterClass="java.util.HashMap"
resultClass="com.baosight.hggp.hg.sc.domain.HGSC001"> resultClass="com.baosight.hggp.hg.sc.domain.HGSC001">
SELECT SELECT
id as "id", id as "id",
company_code as "companyCode", <!-- 公司编码 --> company_code as "companyCode", <!-- 公司编码 -->
company_name as "companyName", <!-- 公司名称 --> company_name as "companyName", <!-- 公司名称 -->
dep_code as "depCode", <!-- 部门编码 --> dep_code as "depCode", <!-- 部门编码 -->
...@@ -376,6 +376,9 @@ ...@@ -376,6 +376,9 @@
<isNotEmpty prepend=" AND " property="companyCodes"> <isNotEmpty prepend=" AND " property="companyCodes">
COMPANY_CODE IN <iterate close=")" open="(" conjunction="," property="companyCodes">#companyCodes[]#</iterate> COMPANY_CODE IN <iterate close=")" open="(" conjunction="," property="companyCodes">#companyCodes[]#</iterate>
</isNotEmpty> </isNotEmpty>
<isNotEmpty prepend=" AND " property="approvalStatus">
approval_status = #approvalStatus#
</isNotEmpty>
ORDER BY PROJ_CODE ORDER BY PROJ_CODE
</select> </select>
</sqlMap> </sqlMap>
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE sqlMap PUBLIC "-//ibatis.apache.org//DTD SQL Map 2.0//EN" "http://ibatis.apache.org/dtd/sql-map-2.dtd">
<sqlMap namespace="HGSC003">
<sql id="condition">
<isNotEmpty prepend=" AND " property="id">
id = #id#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="companyCode">
company_code = #companyCode#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="companyName">
company_name like ('%$companyName$%')
</isNotEmpty>
<isNotEmpty prepend=" AND " property="blueprintCode">
blueprint_code = #blueprintCode#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="blueprintName">
blueprint_name like ('%$blueprintName$%')
</isNotEmpty>
<isNotEmpty prepend=" AND " property="projCode">
proj_code = #projCode#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="projName">
proj_name like ('%$projName$%')
</isNotEmpty>
<isNotEmpty prepend=" AND " property="blueprintStatus">
blueprint_status = #blueprintStatus#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="approvalStatus">
approval_status = #approvalStatus#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="accountCode">
account_code = #accountCode#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="createdBy">
created_by = #createdBy#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="createdName">
created_name = #createdName#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="createdTime">
created_time = #createdTime#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="updatedBy">
updated_by = #updatedBy#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="updatedName">
updated_name = #updatedName#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="updatedTime">
updated_time = #updatedTime#
</isNotEmpty>
</sql>
<select id="query" parameterClass="java.util.HashMap"
resultClass="com.baosight.hggp.hg.sc.domain.HGSC003">
SELECT
id as "id", <!-- 主键 -->
company_code as "companyCode", <!-- 公司编码 -->
company_name as "companyName", <!-- 公司名称 -->
dep_code as "depCode", <!-- 部门编码 -->
dep_name as "depName", <!-- 部门名称 -->
blueprint_code as "blueprintCode", <!-- 蓝图编号 -->
blueprint_name as "blueprintName", <!-- 蓝图名称 -->
proj_code as "projCode", <!-- 项目编码 -->
proj_name as "projName", <!-- 项目名称 -->
blueprint_status as "blueprintStatus", <!-- 蓝图状态 0:停用,1:启用 -->
approval_status as "approvalStatus", <!-- 审批状态 0:待审;1:审核中;2:已审 -->
account_code as "accountCode", <!-- 帐套 -->
created_by as "createdBy", <!-- 创建人 -->
created_name as "createdName", <!-- 创建人名称 -->
created_time as "createdTime", <!-- 创建时间 -->
updated_by as "updatedBy", <!-- 更新人 -->
updated_name as "updatedName", <!-- 修改人名称 -->
updated_time as "updatedTime" <!-- 更新时间 -->
FROM ${hggpSchema}.HGSC003 WHERE 1=1
<include refid="condition" />
<dynamic prepend="ORDER BY">
<isNotEmpty property="orderBy">
$orderBy$
</isNotEmpty>
</dynamic>
</select>
<select id="count" resultClass="int">
SELECT COUNT(*) FROM ${hggpSchema}.HGSC003 WHERE 1=1
<include refid="condition" />
</select>
<insert id="insert">
INSERT INTO ${hggpSchema}.HGSC003 (id, <!-- 主键 -->
company_code, <!-- 公司编码 -->
company_name, <!-- 公司名称 -->
dep_code, <!-- 部门编码 -->
dep_name, <!-- 部门名称 -->
blueprint_code, <!-- 蓝图编号 -->
blueprint_name, <!-- 蓝图名称 -->
proj_code, <!-- 项目编码 -->
proj_name, <!-- 项目名称 -->
blueprint_status, <!-- 蓝图状态 0:停用,1:启用 -->
approval_status, <!-- 审批状态 0:待审;1:审核中;2:已审 -->
account_code, <!-- 帐套 -->
created_by, <!-- 创建人 -->
created_name, <!-- 创建人名称 -->
created_time, <!-- 创建时间 -->
updated_by, <!-- 更新人 -->
updated_name, <!-- 修改人名称 -->
updated_time <!-- 更新时间 -->
)
VALUES (#id#, #companyCode#, #companyName#, #depCode#, #depName#, #blueprintCode#, #blueprintName#, #projCode#, #projName#, #blueprintStatus#, #approvalStatus#, #accountCode#, #createdBy#, #createdName#, #createdTime#, #updatedBy#, #updatedName#, #updatedTime#)
</insert>
<delete id="delete">
DELETE FROM ${hggpSchema}.HGSC003 WHERE
</delete>
<update id="update">
UPDATE ${hggpSchema}.HGSC003
SET
id = #id#, <!-- 主键 -->
company_code = #companyCode#, <!-- 公司编码 -->
company_name = #companyName#, <!-- 公司名称 -->
dep_code = #depCode#, <!-- 部门编码 -->
dep_name = #depName#, <!-- 部门名称 -->
blueprint_code = #blueprintCode#, <!-- 蓝图编号 -->
blueprint_name = #blueprintName#, <!-- 蓝图名称 -->
proj_code = #projCode#, <!-- 项目编码 -->
proj_name = #projName#, <!-- 项目名称 -->
blueprint_status = #blueprintStatus#, <!-- 蓝图状态 0:停用,1:启用 -->
approval_status = #approvalStatus#, <!-- 审批状态 0:待审;1:审核中;2:已审 -->
account_code = #accountCode#, <!-- 帐套 -->
created_by = #createdBy#, <!-- 创建人 -->
created_name = #createdName#, <!-- 创建人名称 -->
created_time = #createdTime#, <!-- 创建时间 -->
updated_by = #updatedBy#, <!-- 更新人 -->
updated_name = #updatedName#, <!-- 修改人名称 -->
updated_time = #updatedTime# <!-- 更新时间 -->
WHERE
</update>
<delete id="batchDelete">
DELETE FROM ${hggpSchema}.HGSC003 WHERE
id IN <iterate close=")" open="(" conjunction="," property="ids">#ids[]#</iterate>
</delete>
<update id="batchDeactivate">
UPDATE ${hggpSchema}.HGSC003
SET
blueprint_status = 0, <!-- 蓝图状态 0:停用,1:启用 -->
updated_by = #updatedBy#, <!-- 更新人 -->
updated_name = #updatedName#, <!-- 修改人名称 -->
updated_time = #updatedTime# <!-- 更新时间 -->
WHERE
id IN <iterate close=")" open="(" conjunction="," property="ids">#ids[]#</iterate>
</update>
<update id="updateBlueprintStatus">
UPDATE ${hggpSchema}.HGSC003
SET
UPDATED_BY = #updatedBy#, <!-- 更新人 -->
UPDATED_NAME = #updatedName#, <!-- 更新人名称 -->
UPDATED_TIME = #updatedTime#, <!-- 更新时间 -->
BLUEPRINT_STATUS = #blueprintStatus# <!-- 状态0.启用1.停止 -->
WHERE
ID = #id#
</update>
</sqlMap>
package com.baosight.hggp.hg.zl.domain; package com.baosight.hggp.hg.zl.domain;
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.NumberUtils;
import com.baosight.iplat4j.core.util.StringUtils;
import java.math.BigDecimal; import java.math.BigDecimal;
import com.baosight.iplat4j.core.ei.EiColumn;
import com.baosight.iplat4j.core.data.DaoEPBase;
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>
...@@ -17,7 +16,7 @@ import java.util.Map; ...@@ -17,7 +16,7 @@ import java.util.Map;
* Copyrigth:Baosight Software LTD.co Copyright (c) 2019. <br> * Copyrigth:Baosight Software LTD.co Copyright (c) 2019. <br>
* *
* @version 1.0 * @version 1.0
* @history 2024-05-15 16:04:54 create * @history 2024-05-16 11:17:34 create
*/ */
public class HGZL001 extends DaoEPBase { public class HGZL001 extends DaoEPBase {
...@@ -49,8 +48,8 @@ public class HGZL001 extends DaoEPBase { ...@@ -49,8 +48,8 @@ public class HGZL001 extends DaoEPBase {
public static final String FIELD_WIDTH = "width"; /* 宽度*/ public static final String FIELD_WIDTH = "width"; /* 宽度*/
public static final String FIELD_THICK = "thick"; /* 厚度*/ public static final String FIELD_THICK = "thick"; /* 厚度*/
public static final String FIELD_RECEIVE_QTY = "receiveQty"; /* 收货数量*/ public static final String FIELD_RECEIVE_QTY = "receiveQty"; /* 收货数量*/
public static final String FIELD_DELIVER_QTY = "deliverQty"; /* 退货数量*/ public static final String FIELD_QUALIFY_QTY = "qualifyQty"; /* 合格数量*/
public static final String FIELD_DEPOSIT_QTY = "depositQty"; /* 入库数量*/ public static final String FIELD_UNQUALIFY_QTY = "unqualifyQty"; /* 不合格数量*/
public static final String FIELD_RECEIVE_UNIT_WEIGHT = "receiveUnitWeight"; /* 收货单重*/ public static final String FIELD_RECEIVE_UNIT_WEIGHT = "receiveUnitWeight"; /* 收货单重*/
public static final String FIELD_RECEIVE_WEIGHT = "receiveWeight"; /* 收货重量*/ public static final String FIELD_RECEIVE_WEIGHT = "receiveWeight"; /* 收货重量*/
public static final String FIELD_STATUS = "status"; /* 状态:0-质检中,1-质检完成*/ public static final String FIELD_STATUS = "status"; /* 状态:0-质检中,1-质检完成*/
...@@ -81,8 +80,8 @@ public class HGZL001 extends DaoEPBase { ...@@ -81,8 +80,8 @@ public class HGZL001 extends DaoEPBase {
public static final String COL_WIDTH = "WIDTH"; /* 宽度*/ public static final String COL_WIDTH = "WIDTH"; /* 宽度*/
public static final String COL_THICK = "THICK"; /* 厚度*/ public static final String COL_THICK = "THICK"; /* 厚度*/
public static final String COL_RECEIVE_QTY = "RECEIVE_QTY"; /* 收货数量*/ public static final String COL_RECEIVE_QTY = "RECEIVE_QTY"; /* 收货数量*/
public static final String COL_DELIVER_QTY = "DELIVER_QTY"; /* 退货数量*/ public static final String COL_QUALIFY_QTY = "QUALIFY_QTY"; /* 合格数量*/
public static final String COL_DEPOSIT_QTY = "DEPOSIT_QTY"; /* 入库数量*/ public static final String COL_UNQUALIFY_QTY = "UNQUALIFY_QTY"; /* 不合格数量*/
public static final String COL_RECEIVE_UNIT_WEIGHT = "RECEIVE_UNIT_WEIGHT"; /* 收货单重*/ public static final String COL_RECEIVE_UNIT_WEIGHT = "RECEIVE_UNIT_WEIGHT"; /* 收货单重*/
public static final String COL_RECEIVE_WEIGHT = "RECEIVE_WEIGHT"; /* 收货重量*/ public static final String COL_RECEIVE_WEIGHT = "RECEIVE_WEIGHT"; /* 收货重量*/
public static final String COL_STATUS = "STATUS"; /* 状态:0-质检中,1-质检完成*/ public static final String COL_STATUS = "STATUS"; /* 状态:0-质检中,1-质检完成*/
...@@ -119,8 +118,8 @@ public class HGZL001 extends DaoEPBase { ...@@ -119,8 +118,8 @@ public class HGZL001 extends DaoEPBase {
private BigDecimal width = new BigDecimal(0.000); /* 宽度*/ private BigDecimal width = new BigDecimal(0.000); /* 宽度*/
private BigDecimal thick = new BigDecimal(0.000); /* 厚度*/ private BigDecimal thick = new BigDecimal(0.000); /* 厚度*/
private BigDecimal receiveQty = new BigDecimal(0.000); /* 收货数量*/ private BigDecimal receiveQty = new BigDecimal(0.000); /* 收货数量*/
private BigDecimal deliverQty = new BigDecimal(0.000); /* 退货数量*/ private BigDecimal qualifyQty = new BigDecimal(0.000); /* 合格数量*/
private BigDecimal depositQty = new BigDecimal(0.000); /* 入库数量*/ private BigDecimal unqualifyQty = new BigDecimal(0.000); /* 不合格数量*/
private BigDecimal receiveUnitWeight = new BigDecimal(0.000); /* 收货单重*/ private BigDecimal receiveUnitWeight = new BigDecimal(0.000); /* 收货单重*/
private BigDecimal receiveWeight = new BigDecimal(0.000); /* 收货重量*/ private BigDecimal receiveWeight = new BigDecimal(0.000); /* 收货重量*/
private Integer status; /* 状态:0-质检中,1-质检完成*/ private Integer status; /* 状态:0-质检中,1-质检完成*/
...@@ -248,18 +247,18 @@ public class HGZL001 extends DaoEPBase { ...@@ -248,18 +247,18 @@ public class HGZL001 extends DaoEPBase {
eiColumn.setDescName("收货数量"); eiColumn.setDescName("收货数量");
eiMetadata.addMeta(eiColumn); eiMetadata.addMeta(eiColumn);
eiColumn = new EiColumn(FIELD_DELIVER_QTY); eiColumn = new EiColumn(FIELD_QUALIFY_QTY);
eiColumn.setType("N"); eiColumn.setType("N");
eiColumn.setScaleLength(3); eiColumn.setScaleLength(3);
eiColumn.setFieldLength(20); eiColumn.setFieldLength(20);
eiColumn.setDescName("退货数量"); eiColumn.setDescName("合格数量");
eiMetadata.addMeta(eiColumn); eiMetadata.addMeta(eiColumn);
eiColumn = new EiColumn(FIELD_DEPOSIT_QTY); eiColumn = new EiColumn(FIELD_UNQUALIFY_QTY);
eiColumn.setType("N"); eiColumn.setType("N");
eiColumn.setScaleLength(3); eiColumn.setScaleLength(3);
eiColumn.setFieldLength(20); eiColumn.setFieldLength(20);
eiColumn.setDescName("入库数量"); eiColumn.setDescName("不合格数量");
eiMetadata.addMeta(eiColumn); eiMetadata.addMeta(eiColumn);
eiColumn = new EiColumn(FIELD_RECEIVE_UNIT_WEIGHT); eiColumn = new EiColumn(FIELD_RECEIVE_UNIT_WEIGHT);
...@@ -707,36 +706,36 @@ public class HGZL001 extends DaoEPBase { ...@@ -707,36 +706,36 @@ public class HGZL001 extends DaoEPBase {
this.receiveQty = receiveQty; this.receiveQty = receiveQty;
} }
/** /**
* get the deliverQty - 退货数量. * get the qualifyQty - 合格数量.
* @return the deliverQty * @return the qualifyQty
*/ */
public BigDecimal getDeliverQty() { public BigDecimal getQualifyQty() {
return this.deliverQty; return this.qualifyQty;
} }
/** /**
* set the deliverQty - 退货数量. * set the qualifyQty - 合格数量.
* *
* @param deliverQty - 退货数量 * @param qualifyQty - 合格数量
*/ */
public void setDeliverQty(BigDecimal deliverQty) { public void setQualifyQty(BigDecimal qualifyQty) {
this.deliverQty = deliverQty; this.qualifyQty = qualifyQty;
} }
/** /**
* get the depositQty - 入库数量. * get the unqualifyQty - 不合格数量.
* @return the depositQty * @return the unqualifyQty
*/ */
public BigDecimal getDepositQty() { public BigDecimal getUnqualifyQty() {
return this.depositQty; return this.unqualifyQty;
} }
/** /**
* set the depositQty - 入库数量. * set the unqualifyQty - 不合格数量.
* *
* @param depositQty - 入库数量 * @param unqualifyQty - 不合格数量
*/ */
public void setDepositQty(BigDecimal depositQty) { public void setUnqualifyQty(BigDecimal unqualifyQty) {
this.depositQty = depositQty; this.unqualifyQty = unqualifyQty;
} }
/** /**
* get the receiveUnitWeight - 收货单重. * get the receiveUnitWeight - 收货单重.
...@@ -820,8 +819,8 @@ public class HGZL001 extends DaoEPBase { ...@@ -820,8 +819,8 @@ public class HGZL001 extends DaoEPBase {
setWidth(NumberUtils.toBigDecimal(StringUtils.toString(map.get(FIELD_WIDTH)), width)); setWidth(NumberUtils.toBigDecimal(StringUtils.toString(map.get(FIELD_WIDTH)), width));
setThick(NumberUtils.toBigDecimal(StringUtils.toString(map.get(FIELD_THICK)), thick)); setThick(NumberUtils.toBigDecimal(StringUtils.toString(map.get(FIELD_THICK)), thick));
setReceiveQty(NumberUtils.toBigDecimal(StringUtils.toString(map.get(FIELD_RECEIVE_QTY)), receiveQty)); setReceiveQty(NumberUtils.toBigDecimal(StringUtils.toString(map.get(FIELD_RECEIVE_QTY)), receiveQty));
setDeliverQty(NumberUtils.toBigDecimal(StringUtils.toString(map.get(FIELD_DELIVER_QTY)), deliverQty)); setQualifyQty(NumberUtils.toBigDecimal(StringUtils.toString(map.get(FIELD_QUALIFY_QTY)), qualifyQty));
setDepositQty(NumberUtils.toBigDecimal(StringUtils.toString(map.get(FIELD_DEPOSIT_QTY)), depositQty)); setUnqualifyQty(NumberUtils.toBigDecimal(StringUtils.toString(map.get(FIELD_UNQUALIFY_QTY)), unqualifyQty));
setReceiveUnitWeight(NumberUtils.toBigDecimal(StringUtils.toString(map.get(FIELD_RECEIVE_UNIT_WEIGHT)), receiveUnitWeight)); setReceiveUnitWeight(NumberUtils.toBigDecimal(StringUtils.toString(map.get(FIELD_RECEIVE_UNIT_WEIGHT)), receiveUnitWeight));
setReceiveWeight(NumberUtils.toBigDecimal(StringUtils.toString(map.get(FIELD_RECEIVE_WEIGHT)), receiveWeight)); setReceiveWeight(NumberUtils.toBigDecimal(StringUtils.toString(map.get(FIELD_RECEIVE_WEIGHT)), receiveWeight));
setStatus(NumberUtils.toInteger(StringUtils.toString(map.get(FIELD_STATUS)), status)); setStatus(NumberUtils.toInteger(StringUtils.toString(map.get(FIELD_STATUS)), status));
...@@ -860,8 +859,8 @@ public class HGZL001 extends DaoEPBase { ...@@ -860,8 +859,8 @@ public class HGZL001 extends DaoEPBase {
map.put(FIELD_WIDTH, StringUtils.toString(width, eiMetadata.getMeta(FIELD_WIDTH))); map.put(FIELD_WIDTH, StringUtils.toString(width, eiMetadata.getMeta(FIELD_WIDTH)));
map.put(FIELD_THICK, StringUtils.toString(thick, eiMetadata.getMeta(FIELD_THICK))); map.put(FIELD_THICK, StringUtils.toString(thick, eiMetadata.getMeta(FIELD_THICK)));
map.put(FIELD_RECEIVE_QTY, StringUtils.toString(receiveQty, eiMetadata.getMeta(FIELD_RECEIVE_QTY))); map.put(FIELD_RECEIVE_QTY, StringUtils.toString(receiveQty, eiMetadata.getMeta(FIELD_RECEIVE_QTY)));
map.put(FIELD_DELIVER_QTY, StringUtils.toString(deliverQty, eiMetadata.getMeta(FIELD_DELIVER_QTY))); map.put(FIELD_QUALIFY_QTY, StringUtils.toString(qualifyQty, eiMetadata.getMeta(FIELD_QUALIFY_QTY)));
map.put(FIELD_DEPOSIT_QTY, StringUtils.toString(depositQty, eiMetadata.getMeta(FIELD_DEPOSIT_QTY))); map.put(FIELD_UNQUALIFY_QTY, StringUtils.toString(unqualifyQty, eiMetadata.getMeta(FIELD_UNQUALIFY_QTY)));
map.put(FIELD_RECEIVE_UNIT_WEIGHT, StringUtils.toString(receiveUnitWeight, eiMetadata.getMeta(FIELD_RECEIVE_UNIT_WEIGHT))); map.put(FIELD_RECEIVE_UNIT_WEIGHT, StringUtils.toString(receiveUnitWeight, eiMetadata.getMeta(FIELD_RECEIVE_UNIT_WEIGHT)));
map.put(FIELD_RECEIVE_WEIGHT, StringUtils.toString(receiveWeight, eiMetadata.getMeta(FIELD_RECEIVE_WEIGHT))); map.put(FIELD_RECEIVE_WEIGHT, StringUtils.toString(receiveWeight, eiMetadata.getMeta(FIELD_RECEIVE_WEIGHT)));
map.put(FIELD_STATUS, StringUtils.toString(status, eiMetadata.getMeta(FIELD_STATUS))); map.put(FIELD_STATUS, StringUtils.toString(status, eiMetadata.getMeta(FIELD_STATUS)));
......
...@@ -2,21 +2,14 @@ package com.baosight.hggp.hg.zl.service; ...@@ -2,21 +2,14 @@ package com.baosight.hggp.hg.zl.service;
import com.baosight.hggp.aspect.annotation.OperationLogAnnotation; import com.baosight.hggp.aspect.annotation.OperationLogAnnotation;
import com.baosight.hggp.common.DdynamicEnum; import com.baosight.hggp.common.DdynamicEnum;
import com.baosight.hggp.core.constant.CommonConstant;
import com.baosight.hggp.core.dao.DaoUtils;
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.hg.zl.domain.HGZL001;
import com.baosight.hggp.util.AssertUtils; import com.baosight.hggp.hg.zl.utils.HGZLUtils;
import com.baosight.hggp.util.CommonMethod; import com.baosight.hggp.util.CommonMethod;
import com.baosight.hggp.util.EiInfoUtils; import com.baosight.hggp.util.EiInfoUtils;
import com.baosight.hggp.util.LogUtils; import com.baosight.hggp.util.LogUtils;
import com.baosight.hggp.util.StringUtil;
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 org.apache.commons.collections.MapUtils;
import java.util.Arrays; import java.util.Arrays;
import java.util.List; import java.util.List;
...@@ -34,7 +27,8 @@ public class ServiceHGZL001 extends ServiceBase { ...@@ -34,7 +27,8 @@ public class ServiceHGZL001 extends ServiceBase {
* @param inInfo * @param inInfo
* @return * @return
*/ */
@OperationLogAnnotation(operModul = "质量巡检单",operType = "查询",operDesc = "初始化") @Override
@OperationLogAnnotation(operModul = "入库质检单", operType = "查询", operDesc = "初始化")
public EiInfo initLoad(EiInfo inInfo) { public EiInfo initLoad(EiInfo inInfo) {
try { try {
CommonMethod.initBlock(inInfo, Arrays.asList(DdynamicEnum.PROJ_RECORD_BLOCK_ID), null); CommonMethod.initBlock(inInfo, Arrays.asList(DdynamicEnum.PROJ_RECORD_BLOCK_ID), null);
...@@ -53,14 +47,12 @@ public class ServiceHGZL001 extends ServiceBase { ...@@ -53,14 +47,12 @@ public class ServiceHGZL001 extends ServiceBase {
* @param inInfo * @param inInfo
* @return * @return
*/ */
@OperationLogAnnotation(operModul = "质量巡检单",operType = "查询",operDesc = "查询")
@Override @Override
@OperationLogAnnotation(operModul = "质量巡检单", operType = "查询", operDesc = "查询")
public EiInfo query(EiInfo inInfo) { public EiInfo query(EiInfo inInfo) {
try { try {
Map queryMap = EiInfoUtils.getFirstRow(inInfo); Map queryMap = EiInfoUtils.getFirstRow(inInfo);
String receiptDate = MapUtils.getString(queryMap, "receiptDate"); HGZLUtils.HgZl001.setCondition(queryMap);
queryMap.put("receiptDate", StringUtil.removeSpecifiedCharacter(receiptDate,
StringUtil.DEFAULT_CHARACTER_TO_BE_REMOVED));
inInfo = super.query(inInfo, HGZL001.QUERY, new HGZL001()); inInfo = super.query(inInfo, HGZL001.QUERY, new HGZL001());
} catch (Exception e) { } catch (Exception e) {
LogUtils.setDetailMsg(inInfo, e, "查询失败"); LogUtils.setDetailMsg(inInfo, e, "查询失败");
...@@ -75,7 +67,6 @@ public class ServiceHGZL001 extends ServiceBase { ...@@ -75,7 +67,6 @@ public class ServiceHGZL001 extends ServiceBase {
* @return * @return
*/ */
@OperationLogAnnotation(operModul = "质量巡检单",operType = "新增",operDesc = "新增") @OperationLogAnnotation(operModul = "质量巡检单",operType = "新增",operDesc = "新增")
@Override
public EiInfo insert(EiInfo inInfo) { public EiInfo insert(EiInfo inInfo) {
try { try {
List<Map> resultRows = inInfo.getBlock(EiConstant.resultBlock).getRows(); List<Map> resultRows = inInfo.getBlock(EiConstant.resultBlock).getRows();
......
package com.baosight.hggp.hg.zl.utils;
import com.baosight.hggp.hg.utils.HGUtils;
import com.baosight.hggp.hg.zl.domain.HGZL001;
import com.baosight.hggp.util.DateUtils;
import com.baosight.hggp.util.MapUtils;
import com.baosight.hggp.util.StringUtils;
import java.util.Map;
/**
* @author:songx
* @date:2024/5/16,11:26
*/
public class HGZLUtils {
/**
* HGZL001 工具类
*
* @author:songx
* @date:2024/5/9,16:58
*/
public static class HgZl001 {
/**
* 设置查询条件
*
* @param queryRow 集合
* @return
*/
public static void setCondition(Map queryRow) {
HGUtils.setCondition(queryRow);
// 单据日期
String receiptDate = MapUtils.getString(queryRow, HGZL001.FIELD_RECEIPT_DATE);
if (StringUtils.isNotBlank(receiptDate)) {
queryRow.put(HGZL001.FIELD_RECEIPT_DATE, DateUtils.formatShort(receiptDate));
}
}
}
}
<!DOCTYPE html>
<%@ page contentType="text/html; charset=UTF-8" %>
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %>
<%@ taglib prefix="EF" tagdir="/WEB-INF/tags/EF" %>
<c:set var="ctx" value="${pageContext.request.contextPath}"/>
<script>
var ctx = "${ctx}";
</script>
<head>
</head>
<EF:EFPage title="蓝图清单">
<EF:EFRegion id="inqu" title="查询条件">
<div class="row">
<EF:EFInput ename="inqu_status-0-companyName" cname="公司名称" colWidth="3"/>
<EF:EFInput ename="inqu_status-0-blueprintName" cname="蓝图名称" colWidth="3"/>
<EF:EFInput ename="inqu_status-0-projName" cname="项目名称" colWidth="3"/>
<EF:EFSelect cname="状态" ename="inqu_status-0-blueprintStatus" colWidth="3" filter="contains">
<EF:EFOption label="全部" value=""/>
<EF:EFCodeOption codeName="hggp.hgsc.enablingStatus" />
</EF:EFSelect>
</div>
</EF:EFRegion>
<EF:EFRegion id="result" title="记录集">
<EF:EFGrid blockId="result" autoDraw="no" isFloat="true" copyToAdd="false">
<EF:EFColumn ename="id" cname="主键" hidden="true"/>
<EF:EFColumn ename="operator" cname="操作" locked="true" enable="false" width="100" align="center"/>
<EF:EFComboColumn ename="companyCode" cname="公司名称"
columnTemplate="#=textField#" itemTemplate="#=textField#"
textField="textField" valueField="valueField"
maxLength="16" width="120" required="true"
align="center" filter="contains" sort="true">
<EF:EFOptions blockId="companyBox_block_id" textField="textField" valueField="valueField"/>
</EF:EFComboColumn>
<EF:EFColumn ename="companyName" cname="公司名称" hidden="true"/>
<EF:EFColumn ename="blueprintCode" cname="蓝图编码" enable="false" width="120" align="center"/>
<EF:EFColumn ename="blueprintName" cname="蓝图名称" enable="true" width="120" align="center" required="true"/>
<EF:EFColumn ename="projCode" cname="项目编码" enable="true" width="120" align="center"/>
<EF:EFColumn ename="projName" cname="项目名称" width="120" align="center" enable="false"/>
<EF:EFComboColumn ename="blueprintStatus" cname="状态" width="80" align="center" enable="false" required="false" readonly="true">
<EF:EFCodeOption codeName="hggp.hgsc.enablingStatus" />
</EF:EFComboColumn>
</EF:EFGrid>
</EF:EFRegion>
</EF:EFPage>
$(function () {
IPLATUI.EFGrid = {
"result": {
pageable: {
input: true,
numeric: false,
pageSize: 20,
pageSizes: [10, 20, 30, 50, 100, 200]
},
columns: [{
field: "receiptDate",
attributes: {
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)) {
return '<a style="cursor: pointer;display: inline-flex;justify-content: center;margin:auto 5px" '
+ 'onclick="showUploadFile(' + item.id + ', 1)" >附件清单</a>';
} else {
return "";
}
}
}, {
field: "processPhoto",
template: function (item) {
if (!isBlank(item.checkNo)) {
return '<a style="cursor: pointer;display: inline-flex;justify-content: center;margin:auto 5px" '
+ 'onclick="showUploadFile(' + item.id + ', 2)" >附件清单</a>';
} else {
return "";
}
}
}, {
field: "createdName",
template: function (options) {
return showUserName(options.createdBy, options.createdName);
}
}],
onDelete: function (e) {
// 阻止默认请求,使用自定义删除
e.preventDefault();
deleteFunc();
},
onSuccess: function (e) {
}
}
}
// 查询
$("#QUERY").on("click", query);
// 选择生产任务
$("#SELECT_PROD").on("click", selectProd);
});
/**
* 页面加载时执行
*/
$(window).load(function () {
// 查询
query();
});
/**
* 查询
*/
let query = function () {
resultGrid.dataSource.page(1);
}
/**
* 显示附件清单
*
* @param id
* @param docType
*/
let showUploadFile = function (id, docType) {
JSColorbox.open({
href: "HPZL001A?methodName=initLoad&inqu_status-0-checkId=" + id + "&inqu_status-0-docType=" + docType,
title: "<div style='text-align: center;'>附件清单</div>",
width: "80%",
height: "80%",
});
}
/**
* 提交操作
*
* @param id
* @param checkNo
*/
let doProcess = function (id, checkNo) {
let message = "确认将单号[" + checkNo + "]的状态修改为已处理吗? ";
JSUtils.confirm(message, {
ok: function () {
JSUtils.submitGridsData("result", "HPZL001", "doProcess", true);
}
});
}
/**
* 挑选生产任务
*/
let selectProd = function () {
JSColorbox.open({
href: "HPZL001B?methodName=initLoad",
title: "<div style='text-align: center;'>生产任务查询</div>",
width: "90%",
height: "80%",
callbackName: selectStockCallback
});
}
/**
* 挑选生产任务回调
*/
let selectStockCallback = function () {
// 刷新页面
query();
// 关闭弹窗
JSColorbox.close();
}
/**
* 删除
*/
function deleteFunc() {
let rows = resultGrid.getCheckedRows();
if (rows.length < 1) {
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);
}
});
}
}
...@@ -41,17 +41,24 @@ ...@@ -41,17 +41,24 @@
required="true"/> required="true"/>
<EF:EFColumn ename="processPhoto" cname="处理照片" locked="true" enable="false" width="100" align="center" <EF:EFColumn ename="processPhoto" cname="处理照片" locked="true" enable="false" width="100" align="center"
required="true"/> required="true"/>
<EF:EFColumn ename="receiptDate" cname="单据日期" enable="false" width="120" align="center" editType="date"
dateFormat="yyyy-MM-dd" parseFormats="['yyyyMMdd']"/>
<EF:EFColumn ename="checkNo" cname="检查单号" enable="false" width="130" align="center"/> <EF:EFColumn ename="checkNo" cname="检查单号" enable="false" width="130" align="center"/>
<EF:EFComboColumn ename="status" cname="状态" enable="false" width="100" align="center"> <EF:EFComboColumn ename="status" cname="状态" enable="false" width="100" align="center">
<EF:EFOption label="已处理" value="1"></EF:EFOption> <EF:EFOption label="已处理" value="1"></EF:EFOption>
<EF:EFOption label="未处理" value="0"></EF:EFOption> <EF:EFOption label="未处理" value="0"></EF:EFOption>
</EF:EFComboColumn> </EF:EFComboColumn>
<EF:EFColumn ename="receiptDate" cname="单据日期" enable="false" width="120" align="center" editType="date" <EF:EFColumn ename="companyCode" cname="公司编码" enable="false" width="100" align="center" hidden="true"/>
dateFormat="yyyy-MM-dd" parseFormats="['yyyyMMdd']"/> <EF:EFColumn ename="companyName" cname="公司名称" enable="false" width="130" align="center"/>
<EF:EFColumn ename="projName" cname="项目名称" enable="false" width="130" align="center"/> <EF:EFColumn ename="receiveNo" cname="收货单号" enable="false" width="120" align="center"/>
<EF:EFColumn ename="inventName" cname="部件名称" enable="false" width="130" align="center"/> <EF:EFColumn ename="inventCode" cname="存货编码" enable="false" width="100" align="center" hidden="true"/>
<EF:EFColumn ename="subInventName" cname="零件名称" enable="false" width="130" align="center"/> <EF:EFColumn ename="inventName" cname="存货名称" enable="false" width="100" align="center"/>
<EF:EFColumn ename="orgName" cname="生产组名称" enable="false" width="130" 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:EFComboColumn ename="poorType" cname="不良品类" enable="false" width="100" align="center">
<EF:EFCodeOption codeName="hpjx.hpjx.poorType"/> <EF:EFCodeOption codeName="hpjx.hpjx.poorType"/>
</EF:EFComboColumn> </EF:EFComboColumn>
...@@ -60,12 +67,11 @@ ...@@ -60,12 +67,11 @@
blockName="user_block_id" textField="textField" valueField="valueField" blockName="user_block_id" textField="textField" valueField="valueField"
columnTemplate="#=textField#" itemTemplate="#=textField#"> columnTemplate="#=textField#" itemTemplate="#=textField#">
</EF:EFComboColumn> </EF:EFComboColumn>
<EF:EFColumn ename="prodOrderNo" cname="生产订单号" enable="false" width="140" align="center"/> <EF:EFColumn ename="material" cname="材质" enable="false" width="80" align="center"/>
<EF:EFColumn ename="prodTaskNo" cname="生产任务号" enable="false" width="150" align="center"/> <EF:EFColumn ename="unit" cname="单位" enable="false" width="80" align="center"/>
<EF:EFColumn ename="projCode" cname="项目编码" enable="false" width="130" align="center"/> <EF:EFColumn ename="length" cname="长(M)" enable="false" width="80" align="right" format="{0:N3}"/>
<EF:EFColumn ename="inventCode" cname="部件编码" enable="false" width="130" align="center"/> <EF:EFColumn ename="width" cname="宽(M)" enable="false" width="80" align="right" format="{0:N3}"/>
<EF:EFColumn ename="subInventCode" cname="零件编码" enable="false" width="130" align="center"/> <EF:EFColumn ename="thick" cname="厚(M)" enable="false" width="80" align="right" format="{0:N3}"/>
<EF:EFColumn ename="orgNo" cname="生产组编码" enable="false" width="130" align="center"/>
<EF:EFColumn ename="createdName" cname="创建人" enable="false" width="150" align="center"/> <EF:EFColumn ename="createdName" cname="创建人" enable="false" width="150" align="center"/>
<EF:EFColumn ename="createdTime" cname="创建时间" enable="false" width="150" align="center" <EF:EFColumn ename="createdTime" cname="创建时间" enable="false" width="150" align="center"
editType="datetime" parseFormats="['yyyyMMddHHmmss']" dateFormat="yyyy-MM-dd HH:mm:ss"/> editType="datetime" parseFormats="['yyyyMMddHHmmss']" dateFormat="yyyy-MM-dd HH:mm:ss"/>
......
let projNameGlobalData = [];
let inventNameGlobalData = [];
let subInventNameGlobalData = [];
let orgNameGlobalData = [];
$(function () {
IPLATUI.EFGrid = {
"result": {
pageable: {
input: true,
numeric: false,
pageSize: 20,
pageSizes: [10, 20, 30, 50, 100, 200]
},
columns: [{
field: "receiptDate",
attributes: {
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)) {
return '<a style="cursor: pointer;display: inline-flex;justify-content: center;margin:auto 5px" '
+ 'onclick="showUploadFile(' + item.id + ', 1)" >附件清单</a>';
} else {
return "";
}
}
}, {
field: "processPhoto",
template: function (item) {
if (!isBlank(item.checkNo)) {
return '<a style="cursor: pointer;display: inline-flex;justify-content: center;margin:auto 5px" '
+ 'onclick="showUploadFile(' + item.id + ', 2)" >附件清单</a>';
} else {
return "";
}
}
},
// {
// field: "projCode",
// template: function (dataItem) {
// for (let i = 0; i < projNameGlobalData.length; i++) {
// if (projNameGlobalData[i]['valueField'] === dataItem['projCode']) {
// return projNameGlobalData[i]['textField'];
// }
// }
// return "";
// },
// editor: function (container, options) {
// let inInfo = new EiInfo();
// // 1.部分分派,2.全部分派
// inInfo.set("inqu_status-0-statuses", [1, 2]);
// inInfo.set("serviceName", "HPSC005");
// inInfo.set("methodName", "queryProjComboBox");
// inInfo.set("blockId", "proj_prod_block_id");
// inInfo.set("field", options.field);
// refreshSelect(container, inInfo);
// }
// }, {
// field: "inventCode",
// template: function (dataItem) {
// for (let i = 0; i < inventNameGlobalData.length; i++) {
// if (inventNameGlobalData[i]['valueField'] === dataItem['inventCode']) {
// return inventNameGlobalData[i]['textField'];
// }
// }
// return "";
// },
// editor: function (container, options) {
// let projCode = options.model["projCode"];
// let inInfo = new EiInfo();
// inInfo.set("inqu_status-0-projCode", isBlank(projCode) ? " " : projCode);
// inInfo.set("serviceName", "HPSC003");
// inInfo.set("methodName", "queryInventComboBox");
// inInfo.set("blockId", "invent_record_block_id");
// inInfo.set("field", options.field);
// refreshSelect(container, inInfo);
// }
// }, {
// field: "subInventCode",
// template: function (dataItem) {
// for (let i = 0; i < subInventNameGlobalData.length; i++) {
// if (subInventNameGlobalData[i]['valueField'] === dataItem['subInventCode']) {
// return subInventNameGlobalData[i]['textField'];
// }
// }
// return "";
// },
// editor: function (container, options) {
// let inventCode = options.model["inventCode"];
// let inInfo = new EiInfo();
// inInfo.set("inqu_status-0-parentPrdtCode", isBlank(inventCode) ? " " : inventCode);
// inInfo.set("serviceName", "HPSC004");
// inInfo.set("methodName", "queryInventComboBox");
// inInfo.set("blockId", "sub_invent_record_block_id");
// inInfo.set("field", options.field);
// refreshSelect(container, inInfo);
// }
// }, {
// field: "orgNo",
// template: function (dataItem) {
// for (let i = 0; i < orgNameGlobalData.length; i++) {
// if (orgNameGlobalData[i]['valueField'] === dataItem['orgNo']) {
// return orgNameGlobalData[i]['textField'];
// }
// }
// return "";
// },
// editor: function (container, options) {
// let subInventCode = options.model["subInventCode"];
// let inInfo = new EiInfo();
// inInfo.set("inqu_status-0-prdtCode", isBlank(subInventCode) ? " " : subInventCode);
// inInfo.set("serviceName", "HPSC005");
// inInfo.set("methodName", "queryOrgComboBox");
// inInfo.set("blockId", "org_prod_block_id");
// inInfo.set("field", options.field);
// refreshSelect(container, inInfo);
// }
// },
{
field: "createdName",
template: function (options) {
return showUserName(options.createdBy, options.createdName);
}
}],
onDelete: function (e) {
// 阻止默认请求,使用自定义删除
e.preventDefault();
deleteFunc();
},
onSuccess: function (e) {
if(e.eiInfo.extAttr.methodName == 'delete' ){
query();
}
}
}
}
// 查询
$("#QUERY").on("click", query);
// 选择生产任务
$("#SELECT_PROD").on("click", selectProd);
});
/**
* 页面加载时执行
*/
$(window).load(function () {
// 项目名称
// let inInfo = new EiInfo();
// EiCommunicator.send("HPSC001", "queryComboBox", inInfo, {
// onSuccess: function (ei) {
// projNameGlobalData = ei.getBlock("proj_record_block_id").getMappedRows();
// },
// onFail: function (ei) {
// }
// }, {async: false});
// // 部件名称
// EiCommunicator.send("HPSC003", "queryInventComboBox", inInfo, {
// onSuccess: function (ei) {
// inventNameGlobalData = ei.getBlock("invent_record_block_id").getMappedRows();
// },
// onFail: function (ei) {
// }
// }, {async: false});
// // 零件名称
// EiCommunicator.send("HPSC004", "queryInventComboBox", inInfo, {
// onSuccess: function (ei) {
// subInventNameGlobalData = ei.getBlock("sub_invent_record_block_id").getMappedRows();
// },
// onFail: function (ei) {
// }
// }, {async: false});
// // 生产组名称
// EiCommunicator.send("HPSC005", "queryOrgComboBox", inInfo, {
// onSuccess: function (ei) {
// orgNameGlobalData = ei.getBlock("org_prod_block_id").getMappedRows();
// },
// onFail: function (ei) {
// }
// }, {async: false});
// 查询
query();
});
/**
* 查询
*/
let query = function () {
resultGrid.dataSource.page(1);
}
/**
* 显示附件清单
*
* @param id
* @param docType
*/
let showUploadFile = function (id, docType) {
JSColorbox.open({
href: "HPZL001A?methodName=initLoad&inqu_status-0-checkId=" + id + "&inqu_status-0-docType=" + docType,
title: "<div style='text-align: center;'>附件清单</div>",
width: "80%",
height: "80%",
});
}
/**
* 提交操作
*
* @param id
* @param checkNo
*/
let doProcess = function (id, checkNo) {
let message = "确认将单号[" + checkNo + "]的状态修改为已处理吗? ";
JSUtils.confirm(message, {
ok: function () {
JSUtils.submitGridsData("result", "HPZL001", "doProcess", true);
}
});
}
/**
* 挑选生产任务
*/
let selectProd = function () {
JSColorbox.open({
href: "HPZL001B?methodName=initLoad",
title: "<div style='text-align: center;'>生产任务查询</div>",
width: "90%",
height: "80%",
callbackName: selectStockCallback
});
}
/**
* 挑选生产任务回调
*/
let selectStockCallback = function () {
// 刷新页面
query();
// 关闭弹窗
JSColorbox.close();
}
/**
* 删除
*/
function deleteFunc() {
let rows = resultGrid.getCheckedRows();
if (rows.length < 1) {
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);
}
});
}
}
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