Commit 336d0c9a by wuwenlong

项目人员dev;

parent 1840d291
......@@ -38,7 +38,6 @@ public enum DdynamicEnum {
CUSTOMER_TYPE_BLOCK_ID("customer_type_block_id", "custType", "custTypeName", "HGPZ001.queryComboBox"),
/**
* TODO
* 模块:客户档案
* 用途:客户档案下拉框
* 编写:wwl
......@@ -204,6 +203,15 @@ public enum DdynamicEnum {
* 编写:ly
*/
DEVICE_CODE_BOX_BLOCK_ID("deviceCodeBox_block_id","deviceCode","deviceName","deviceType", "companyCode","HGSB001.queryDeviceCodeBox"),
//------------------------------------- 生产管理---------------------------------------------------
/**
* 模块:项目档案
* 用途:项目档案下拉框
* 编写:wwl
*/
PROJ_RECORD_BLOCK_ID("proj_record_block_id", "projCode", "projName", "HGSC001.queryComboBox"),
;
......
......@@ -184,7 +184,7 @@ public class ServiceHGSC001 extends ServiceBase {
Map queryMap = EiInfoUtils.getFirstRow(inInfo);
String companyCode = MapUtils.getString(queryMap, HGSC001.FIELD_subcontract_code);
Map map = new HashMap();
map.put("accountCode", UserSessionUtils.getAccountCode());
map.put(HGSC001.FIELD_account_code, UserSessionUtils.getAccountCode());
// map.put("companyCode", companyCode);
CommonMethod.initBlock(inInfo, Arrays.asList(DdynamicEnum.CUSTOMER_RECORD_BLOCK_ID), map,false);
CommonMethod.comboBoxDefaultValue(inInfo,DdynamicEnum.CUSTOMER_RECORD_BLOCK_ID.getBlockId());
......
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.sc.domain.HGSC001;
import com.baosight.hggp.hg.sc.domain.HGSC002;
import com.baosight.hggp.hg.sc.util.HGSCUtil;
import com.baosight.hggp.hg.xs.domain.Company;
import com.baosight.hggp.util.*;
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.ServiceBase;
import java.util.*;
import java.util.stream.Collectors;
/**
* @Author wwl
* @Date 2024/5/6 19:48
*/
public class ServiceHGSC002 extends ServiceBase {
public EiInfo initLoad(EiInfo inInfo) {
try {
List<Company> companyList = UserSessionUtils.getRoleCompany();
inInfo = super.query(inInfo, HGSC002.QUERY, new HGSC002());
EiInfoUtils.addBlock(inInfo,"roleCompany", companyList, Company.class);
Map map = new HashMap();
map.put(HGSC001.FIELD_account_code, UserSessionUtils.getAccountCode());
map.put("companyCodes", Optional.ofNullable(companyList).orElse(new ArrayList<>()).stream()
.map(Company::getCompanyCode).collect(Collectors.toList()));
CommonMethod.initBlock(inInfo, Arrays.asList(DdynamicEnum.PROJ_RECORD_BLOCK_ID), map,false);
} catch (PlatException | InstantiationException | IllegalAccessException e) {
LogUtils.setDetailMsg(inInfo, e, "初始化失败");
}
return inInfo;
}
public EiInfo query(EiInfo inInfo) {
try {
inInfo = super.query(inInfo, HGSC002.QUERY, new HGSC002());
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();
// 销售单号
List<Long> ids = ObjectUtils.listKey(resultRows, HGSC002.FIELD_id);
DaoUtils.update(HGSC002.BATCH_DELETE, 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);
HGSC002 hgsc002 = new HGSC002();
hgsc002.fromMap(resultMap);
this.checkSaveData(hgsc002);
if(Objects.nonNull(hgsc002.getId())&&hgsc002.getId()!=0){
DaoUtils.update(HGSC002.UPDATE, hgsc002);
}else {
DaoUtils.insert(HGSC002.INSERT, hgsc002);
}
inInfo.setStatus(EiConstant.STATUS_DEFAULT);
inInfo.setMsg("保存成功!");
} catch (Exception e) {
LogUtils.setDetailMsg(inInfo, e, "保存失败");
}
return inInfo;
}
/**
* 校验保存的数据
*
* @param hgsc002
*/
private void checkSaveData(HGSC002 hgsc002) {
AssertUtils.isEmpty(UserSessionUtils.getAccountCode(), "当前用户未绑定公司,无法操作数据,请联系管理员!");
AssertUtils.isEmpty(UserSessionUtils.getOrgId(), "当前用户未绑定部门,无法操作数据,请联系管理员!");
AssertUtils.isEmpty(hgsc002.getCompanyCode(), "请选择公司!");
// AssertUtils.isEmpty(hgsc002.getDepCode(), "请选择部门!");
AssertUtils.isEmpty(hgsc002.getProjCode(), "请填写项目编号!");
AssertUtils.isEmpty(hgsc002.getProjName(), "请填写项目名称!");
AssertUtils.isEmpty(hgsc002.getPersonDepName(), "请填写所属部门!");
AssertUtils.isEmpty(hgsc002.getPersonName(), "请填写姓名!");
AssertUtils.isEmpty(hgsc002.getPersonPhone(), "请填写电话!");
AssertUtils.isEmpty(hgsc002.getPersonIdCard(), "请填写身份证号!");
AssertUtils.isTrue(!HGSCUtil.isValidChineseID(hgsc002.getPersonIdCard()), "请填写正确的身份证号!");
}
/**
* 项目档案下拉框
* @param inInfo
* @return
*/
public EiInfo projComboBox(EiInfo inInfo){
Map queryMap = EiInfoUtils.getFirstRow(inInfo);
String companyCode = MapUtils.getString(queryMap, HGSC001.FIELD_company_code);
Map map = new HashMap();
map.put(HGSC001.FIELD_account_code, UserSessionUtils.getAccountCode());
map.put(HGSC001.FIELD_company_code, companyCode);
CommonMethod.initBlock(inInfo, Arrays.asList(DdynamicEnum.PROJ_RECORD_BLOCK_ID), map,false);
return inInfo;
}
}
......@@ -36,6 +36,8 @@
<sqlMap namespace="HGSC001">
<sql id="condition">
<include refid="HGXSDataAuth.authCondition"/>
<isNotEmpty prepend=" AND " property="id">
id = #id#
</isNotEmpty>
......@@ -357,4 +359,23 @@
id IN <iterate close=")" open="(" conjunction="," property="ids">#ids[]#</iterate>
</update>
<select id="queryComboBox" parameterClass="java.util.HashMap"
resultClass="java.util.HashMap">
SELECT DISTINCT
PROJ_CODE as "projCode",
PROJ_NAME as "projName"
FROM ${hggpSchema}.HGSC001
WHERE 1=1
<isNotEmpty prepend=" AND " property="accountCode">
ACCOUNT_CODE = #accountCode#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="companyCode">
COMPANY_CODE = #companyCode#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="companyCodes">
COMPANY_CODE IN <iterate close=")" open="(" conjunction="," property="companyCodes">#companyCodes[]#</iterate>
</isNotEmpty>
ORDER BY PROJ_CODE
</select>
</sqlMap>
......@@ -24,6 +24,8 @@
<sqlMap namespace="HGSC001A">
<sql id="condition">
<include refid="HGXSDataAuth.authCondition"/>
<isNotEmpty prepend=" AND " property="id">
id = #id#
</isNotEmpty>
......
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE sqlMap PUBLIC "-//ibatis.apache.org//DTD SQL Map 2.0//EN" "http://ibatis.apache.org/dtd/sql-map-2.dtd"> <!-- table information
Generate time : 2024-05-13 15:26:20
Version : 1.0
schema : hggp
tableName : HGSC002
id BIGINT NOT NULL primarykey,
company_code VARCHAR NOT NULL,
company_name VARCHAR NOT NULL,
dep_code VARCHAR,
dep_name VARCHAR,
proj_code VARCHAR,
proj_name VARCHAR,
person_dep_name VARCHAR,
person_name VARCHAR,
person_phone VARCHAR,
person_id_card VARCHAR,
account_code VARCHAR NOT NULL,
created_by VARCHAR,
created_name VARCHAR,
created_time VARCHAR,
updated_by VARCHAR,
updated_name VARCHAR,
updated_time VARCHAR
-->
<sqlMap namespace="HGSC002">
<sql id="condition">
<include refid="HGXSDataAuth.authCondition"/>
<isNotEmpty prepend=" AND " property="id">
id = #id#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="companyCode">
company_code = #companyCode#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="companyName">
company_name = #companyName#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="depCode">
dep_code = #depCode#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="depName">
dep_name = #depName#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="projCode">
proj_code = #projCode#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="projName">
proj_name = #projName#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="personDepName">
person_dep_name = #personDepName#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="personName">
person_name = #personName#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="personPhone">
person_phone = #personPhone#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="personIdCard">
person_id_card = #personIdCard#
</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.HGSC002">
SELECT
id as "id",
company_code as "companyCode", <!-- 公司编码 -->
company_name as "companyName", <!-- 公司名称 -->
dep_code as "depCode", <!-- 部门编码 -->
dep_name as "depName", <!-- 部门名称 -->
proj_code as "projCode", <!-- 项目编码 -->
proj_name as "projName", <!-- 项目名称 -->
person_dep_name as "personDepName", <!-- 项目人员部门名称 -->
person_name as "personName", <!-- 项目人员名称 -->
person_phone as "personPhone", <!-- 项目人员手机号 -->
person_id_card as "personIdCard", <!-- 项目人员身份证号 -->
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}.HGSC002 WHERE 1=1
<include refid="condition" />
<dynamic prepend="ORDER BY">
<isNotEmpty property="orderBy">
$orderBy$
</isNotEmpty>
<isEmpty property="orderBy">
id asc
</isEmpty>
</dynamic>
</select>
<select id="count" resultClass="int">
SELECT COUNT(*) FROM ${hggpSchema}.HGSC002 WHERE 1=1
<include refid="condition" />
</select>
<!--
<isNotEmpty prepend=" AND " property="id">
id = #id#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="companyCode">
company_code = #companyCode#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="companyName">
company_name = #companyName#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="depCode">
dep_code = #depCode#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="depName">
dep_name = #depName#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="projCode">
proj_code = #projCode#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="projName">
proj_name = #projName#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="personDepName">
person_dep_name = #personDepName#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="personName">
person_name = #personName#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="personPhone">
person_phone = #personPhone#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="personIdCard">
person_id_card = #personIdCard#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="accountCode">
account_code = #accountCode#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="createdBy">
created_by = #createdBy#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="createdName">
created_name = #createdName#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="createdTime">
created_time = #createdTime#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="updatedBy">
updated_by = #updatedBy#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="updatedName">
updated_name = #updatedName#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="updatedTime">
updated_time = #updatedTime#
</isNotEmpty>
-->
<insert id="insert">
INSERT INTO ${hggpSchema}.HGSC002 (id,
company_code, <!-- 公司编码 -->
company_name, <!-- 公司名称 -->
dep_code, <!-- 部门编码 -->
dep_name, <!-- 部门名称 -->
proj_code, <!-- 项目编码 -->
proj_name, <!-- 项目名称 -->
person_dep_name, <!-- 项目人员部门名称 -->
person_name, <!-- 项目人员名称 -->
person_phone, <!-- 项目人员手机号 -->
person_id_card, <!-- 项目人员身份证号 -->
account_code, <!-- 帐套 -->
created_by, <!-- 创建人 -->
created_name, <!-- 创建人名称 -->
created_time, <!-- 创建时间 -->
updated_by, <!-- 更新人 -->
updated_name, <!-- 修改人名称 -->
updated_time <!-- 更新时间 -->
)
VALUES (#id#, #companyCode#, #companyName#, #depCode#, #depName#, #projCode#, #projName#, #personDepName#, #personName#, #personPhone#, #personIdCard#, #accountCode#, #createdBy#, #createdName#, #createdTime#, #updatedBy#, #updatedName#, #updatedTime#)
</insert>
<delete id="delete">
DELETE FROM ${hggpSchema}.HGSC002 WHERE
id = #id#
</delete>
<update id="update">
UPDATE ${hggpSchema}.HGSC002
SET
company_code = #companyCode#, <!-- 公司编码 -->
company_name = #companyName#, <!-- 公司名称 -->
dep_code = #depCode#, <!-- 部门编码 -->
dep_name = #depName#, <!-- 部门名称 -->
proj_code = #projCode#, <!-- 项目编码 -->
proj_name = #projName#, <!-- 项目名称 -->
person_dep_name = #personDepName#, <!-- 项目人员部门名称 -->
person_name = #personName#, <!-- 项目人员名称 -->
person_phone = #personPhone#, <!-- 项目人员手机号 -->
person_id_card = #personIdCard#, <!-- 项目人员身份证号 -->
account_code = #accountCode#, <!-- 帐套 -->
created_by = #createdBy#, <!-- 创建人 -->
created_name = #createdName#, <!-- 创建人名称 -->
created_time = #createdTime#, <!-- 创建时间 -->
updated_by = #updatedBy#, <!-- 更新人 -->
updated_name = #updatedName#, <!-- 修改人名称 -->
updated_time = #updatedTime# <!-- 更新时间 -->
WHERE
id = #id#
</update>
<delete id="batch_delete">
DELETE FROM ${hggpSchema}.HGSC002 WHERE
id IN <iterate close=")" open="(" conjunction="," property="ids">#ids[]#</iterate>
</delete>
</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"> <!-- table information
Generate time : 2024-05-13 15:26:20
Version : 1.0
schema : hggp
tableName : HGSC099
id BIGINT NOT NULL primarykey,
account_code VARCHAR NOT NULL,
main_id BIGINT,
doc_id VARCHAR,
created_by VARCHAR,
created_name VARCHAR,
created_time VARCHAR,
updated_by VARCHAR,
updated_name VARCHAR,
updated_time VARCHAR,
biz_type VARCHAR
-->
<sqlMap namespace="HGSC099">
<sql id="condition">
<isNotEmpty prepend=" AND " property="id">
id = #id#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="accountCode">
account_code = #accountCode#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="mainId">
main_id = #mainId#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="docId">
doc_id = #docId#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="createdBy">
created_by = #createdBy#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="createdName">
created_name = #createdName#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="createdTime">
created_time = #createdTime#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="updatedBy">
updated_by = #updatedBy#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="updatedName">
updated_name = #updatedName#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="updatedTime">
updated_time = #updatedTime#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="bizType">
biz_type = #bizType#
</isNotEmpty>
</sql>
<select id="query" parameterClass="java.util.HashMap"
resultClass="com.baosight.hggp.hg.sc.domain.HGSC099">
SELECT
id as "id", <!-- 主键ID -->
account_code as "accountCode", <!-- 帐套 -->
main_id as "mainId", <!-- 主表ID -->
doc_id as "docId", <!-- 文件ID -->
created_by as "createdBy", <!-- 创建人 -->
created_name as "createdName", <!-- 创建人名称 -->
created_time as "createdTime", <!-- 创建时间 -->
updated_by as "updatedBy", <!-- 修改人 -->
updated_name as "updatedName", <!-- 修改人名称 -->
updated_time as "updatedTime", <!-- 修改时间 -->
biz_type as "bizType" <!-- 业务类型 -->
FROM ${hggpSchema}.HGSC099 WHERE 1=1
<include refid="condition" />
<dynamic prepend="ORDER BY">
<isNotEmpty property="orderBy">
$orderBy$
</isNotEmpty>
<isEmpty property="orderBy">
id asc
</isEmpty>
</dynamic>
</select>
<select id="count" resultClass="int">
SELECT COUNT(*) FROM ${hggpSchema}.HGSC099 WHERE 1=1
<include refid="condition" />
</select>
<!--
<isNotEmpty prepend=" AND " property="id">
id = #id#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="accountCode">
account_code = #accountCode#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="mainId">
main_id = #mainId#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="docId">
doc_id = #docId#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="createdBy">
created_by = #createdBy#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="createdName">
created_name = #createdName#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="createdTime">
created_time = #createdTime#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="updatedBy">
updated_by = #updatedBy#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="updatedName">
updated_name = #updatedName#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="updatedTime">
updated_time = #updatedTime#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="bizType">
biz_type = #bizType#
</isNotEmpty>
-->
<insert id="insert">
INSERT INTO ${hggpSchema}.HGSC099 (id, <!-- 主键ID -->
account_code, <!-- 帐套 -->
main_id, <!-- 主表ID -->
doc_id, <!-- 文件ID -->
created_by, <!-- 创建人 -->
created_name, <!-- 创建人名称 -->
created_time, <!-- 创建时间 -->
updated_by, <!-- 修改人 -->
updated_name, <!-- 修改人名称 -->
updated_time, <!-- 修改时间 -->
biz_type <!-- 业务类型 -->
)
VALUES (#id#, #accountCode#, #mainId#, #docId#, #createdBy#, #createdName#, #createdTime#, #updatedBy#, #updatedName#, #updatedTime#, #bizType#)
</insert>
<delete id="delete">
DELETE FROM ${hggpSchema}.HGSC099 WHERE
id = #id#
</delete>
<update id="update">
UPDATE ${hggpSchema}.HGSC099
SET
account_code = #accountCode#, <!-- 帐套 -->
main_id = #mainId#, <!-- 主表ID -->
doc_id = #docId#, <!-- 文件ID -->
created_by = #createdBy#, <!-- 创建人 -->
created_name = #createdName#, <!-- 创建人名称 -->
created_time = #createdTime#, <!-- 创建时间 -->
updated_by = #updatedBy#, <!-- 修改人 -->
updated_name = #updatedName#, <!-- 修改人名称 -->
updated_time = #updatedTime#, <!-- 修改时间 -->
biz_type = #bizType# <!-- 业务类型 -->
WHERE
id = #id#
</update>
</sqlMap>
package com.baosight.hggp.hg.sc.util;
/**
* @Author wwl
* @Date 2024/5/13 20:12
*/
public class HGSCUtil {
public static boolean isValidChineseID(String id) {
if (id == null || (id.length() != 18 && id.length() != 15)) {
return false;
}
String[] cityCode = {"11", "12", "13", "14", "15", "21", "22", "23", "31", "32", "33", "34", "35", "36", "37", "41", "42", "43", "44", "45", "46", "50", "51", "52", "53", "54", "61", "62", "63", "64", "65", "71", "81", "82", "91"};
if (!id.substring(0, 2).matches("(" + String.join("|", cityCode) + ")")) {
return false;
}
if (id.length() == 18) {
if (!id.substring(17).matches("[0-9Xx]")) {
return false;
}
int[] factor = {7, 9, 10, 5, 8, 4, 2, 1, 6, 3, 7, 9, 10, 5, 8, 4, 2};
char[] checkCode = {'1', '0', 'X', '9', '8', '7', '6', '5', '4', '3', '2'};
int sum = 0;
for (int i = 0; i < 17; i++) {
sum += Integer.parseInt(String.valueOf(id.charAt(i))) * factor[i];
}
char lastChar = checkCode[sum % 11];
return lastChar == id.charAt(17);
}
return true;
}
}
......@@ -16,5 +16,11 @@
<sqlMap resource="com/baosight/hggp/hg/cg/sql/HGCG001.xml"/>
<sqlMap resource="com/baosight/hggp/hg/cg/sql/HGCG002.xml"/>
<sqlMap resource="com/baosight/hggp/hg/cg/sql/HGCG003.xml"/>
<!-- 生产 -->
<sqlMap resource="com/baosight/hggp/hg/sc/sql/HGSC001.xml"/>
<sqlMap resource="com/baosight/hggp/hg/sc/sql/HGSC001A.xml"/>
<sqlMap resource="com/baosight/hggp/hg/sc/sql/HGSC002.xml"/>
</sqlMapConfig>
......@@ -62,10 +62,6 @@ $(function () {
if(e.eiInfo.extAttr.methodName == 'save'||e.eiInfo.extAttr.methodName == 'delete' ){
query();
}
},
onAdd: function (e) {
e.preventDefault();
create();
}
}
});
......@@ -77,7 +73,8 @@ function showInfo(id) {
width: "90%",
height: "90%",
callbackName: windowCallback
});}
});
}
function create() {
JSColorbox.open({
......
$(function () {
var globalCompanyList = __eiInfo.getBlock("roleCompany").getMappedRows();
var globalProjList = __eiInfo.getBlock("proj_record_block_id").getMappedRows();
$("#QUERY").on("click", function () {
resultGrid.dataSource.page(1);
});
IPLATUI.EFGrid.result = {
pageable: {
pageSize: 20,
pageSizes: [10, 20, 50, 70, 100],
},
columns: [
{
field: "companyCode",
template: function (item) {
let template = "";
if(item.companyCode){
for(let i=0;i<globalCompanyList.length;i++){
if(item.companyCode === globalCompanyList[i]['companyCode']){
item['companyName'] = globalCompanyList[i]['companyName'];
template = globalCompanyList[i]['companyName'];
}
}
}
return template;
},
editor: function (container, options) {
var input = $('<input />');
input.attr("name", options.field);
input.attr("id", options.field);
input.appendTo(container);
input.kendoDropDownList({
dataSource: globalCompanyList,
minLength: 0,
dataTextField: "companyName",
dataValueField: "companyCode",
optionLabelTemplate: "#:companyName#",
valueTemplate: "#:companyName#",
template: "#:companyName#",
filter: "contains"
});
}
}, {
field: "projCode",
template: function (item) {
let template = "";
if(item.projCode){
for(let i=0;i<globalProjList.length;i++){
if(item.projCode === globalProjList[i]['valueField']){
item['projName'] = globalProjList[i]['textField'];
template = globalProjList[i]['valueField'];
}
}
}
return template;
},
editor: function (container, options) {
let inInfo = new EiInfo();
inInfo.set("inqu_status-0-companyCode", options.model["companyCode"]);
inInfo.set("field", options.field);
let dataSource;
EiCommunicator.send("HGSC002", "projComboBox", inInfo, {
onSuccess: function (ei) {
dataSource = ei.getBlock("proj_record_block_id").getMappedRows();
},
onFail: function (ei) {
}
}, {async: false});
var input = $('<input />');
input.attr("name", options.field);
input.attr("id", options.field);
input.appendTo(container);
input.kendoDropDownList({
dataSource: dataSource,
minLength: 0,
dataTextField: "textField",
dataValueField: "valueField",
optionLabelTemplate: "[#:valueField#]#:textField#",
valueTemplate: "[#:valueField#]#:textField#",
template: "[#:valueField#]#:textField#",
filter: "contains"
});
}
}, {
field: "operator",
template: function (item) {
let template = '<a style="cursor: pointer;display: inline-flex;justify-content: center;margin:auto 5px" ' +
'onclick="showFile(' + item.id + ')" >附件详情</a>';
return template;
}
}
],
loadComplete: function(grid) {
// 此 grid 对象
// 处理父子级联动,通过监听 change 事件,判断父级节点是否发生变化
grid.dataSource.bind("change", function(e) {
// 判断父级节点是否发生变化
if (e.field == "projCode") {
loadChange(grid,e,"projName");
}
if (e.field == "companyCode") {
e.items[0].projCode = "";
e.items[0].projName = "";
loadChange(grid,e,"projName");
loadChange(grid,e,"projCode");
}
});
},
onSave: function(e) {
e.preventDefault();
save();
},
onSuccess: function (e) {
if(e.eiInfo.extAttr.methodName == 'save'||e.eiInfo.extAttr.methodName == 'delete' ){
query();
}
}
}
});
/**
* 保存*
*/
function save(){
JSUtils.confirm("确定对数据做\"保存\"操作? ", {
ok: function () {
JSUtils.submitGrid("result", "HGSC002", "save" );
}
});
}
function showFile(id) {
// JSColorbox.open({
// href: "HGSC001D?inqu_status-0-id=" + id + "&efParentFormEname=HGSC001",
// title: "<div style='text-align: center;'>查看项目</div>",
// width: "90%",
// height: "90%",
// callbackName: windowCallback
// });
}
<!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-projName" cname="项目名称" colWidth="3"/>
<EF:EFInput ename="inqu_status-0-personName" cname="姓名" colWidth="3"/>
<EF:EFInput ename="inqu_status-0-personIdCard" cname="身份证号" colWidth="3"/>
<EF:EFInput ename="inqu_status-0-personPhone" cname="电话" colWidth="3"/>
</div>
</EF:EFRegion>
<EF:EFRegion id="result" title="记录集">
<EF:EFGrid blockId="result" autoDraw="override" isFloat="true">
<EF:EFColumn ename="id" cname="主键" hidden="true"/>
<EF:EFColumn ename="createdBy" cname="创建人" hidden="true"/>
<EF:EFColumn ename="updatedBy" cname="修改人" hidden="true"/>
<EF:EFColumn ename="companyName" cname="公司名称" hidden="true"/>
<EF:EFColumn ename="operator" cname="操作" locked="true" enable="true" width="100" align="center"/>
<EF:EFColumn ename="companyCode" cname="公司名称" enable="true" width="120" align="center"/>
<EF:EFColumn ename="projCode" cname="项目编码" enable="true" width="120" align="center"/>
<EF:EFColumn ename="projName" cname="项目名称" enable="false" width="120" align="center" readOnly="true"/>
<EF:EFColumn ename="personDepName" cname="所属部门" enable="true" width="120" align="center"/>
<EF:EFColumn ename="personName" cname="姓名" enable="true" width="120" align="center"/>
<EF:EFColumn ename="personPhone" cname="电话" enable="true" width="120" align="center"/>
<EF:EFColumn ename="personIdCard" cname="身份证号" enable="true" width="120" align="center"/>
<EF:EFColumn ename="createdTime" cname="创建日期" enable="false" width="120" align="center"/>
<EF:EFColumn ename="createdName" cname="创建人" enable="false" width="120" align="center"/>
<EF:EFColumn ename="updatedTime" cname="修改日期" enable="false" width="120" align="center"/>
<EF:EFColumn ename="updatedName" cname="修改人" enable="false" width="120" align="center"/>
</EF:EFGrid>
</EF:EFRegion>
</EF:EFPage>
......@@ -596,3 +596,4 @@ function loadChange(grid,e,field) {
// 触发 td.click 事件,
td.trigger("click");
}
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