Commit 5d118308 by 江和松

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

parents e7c2004a ef8e87bc
......@@ -16,7 +16,6 @@ import com.baosight.hggp.util.StringUtils;
import com.baosight.iplat4j.core.exception.PlatException;
import java.io.IOException;
import java.util.List;
import lombok.extern.slf4j.Slf4j;
......@@ -50,8 +49,8 @@ public class DcOpenApi {
*
* @param pageIndex 当前页
*/
public static Pager<DcUserList> userList(int pageIndex)
throws IOException, InstantiationException, IllegalAccessException {
public static Pager<DcUserList> userList(int pageIndex) throws IOException, InstantiationException,
IllegalAccessException {
JSONObject paramJson = DcApiUtils.buildParamJson(pageIndex);
String result = HttpUtils.post(DeChengConst.USER_LIST, DcApiUtils.buildHeader(), JSON.toJSONString(paramJson),
HttpUtils.JSON_MEDIA_TYPE);
......@@ -84,7 +83,7 @@ public class DcOpenApi {
* @param endTime 结束日期 20240820
* @param pageIndex 当前页
*/
public static List<DcChance> chanceList(String startTime, String endTime, int pageIndex) throws IOException {
public static Pager<DcChance> chanceList(String startTime, String endTime, int pageIndex) throws IOException {
JSONArray dataJsons = new JSONArray();
dataJsons.add(DcApiUtils.buildValueJson("a_date_0", startTime));
dataJsons.add(DcApiUtils.buildValueJson("a_date_1", endTime));
......@@ -103,7 +102,7 @@ public class DcOpenApi {
*
* @param pageIndex 当前页
*/
public static List<DcContractList> contactList(int pageIndex) throws IOException {
public static Pager<DcContractList> contactList(int pageIndex) throws IOException {
JSONArray dataJsons = new JSONArray();
dataJsons.add(DcApiUtils.buildValueJson("pageindex", pageIndex));
dataJsons.add(DcApiUtils.buildValueJson("pagesize", 100));
......
......@@ -191,12 +191,24 @@ public class DcApiUtils {
* @param result
* @return
*/
public static <T> List<T> handleResult(String result, Class<T> clazz) {
public static <T> Pager<T> handleResult(String result, Class<T> clazz) {
JSONObject resultJson = JSONObject.parseObject(result);
// 异常处理
handleMessage(resultJson);
// 获取结果数据集
JSONObject bodyJson = resultJson.getJSONObject("body");
JSONObject sourceJson = bodyJson.getJSONObject("source");
JSONObject tableJson = sourceJson.getJSONObject("table");
// 构建结果数据集
return buildTableData(resultJson, clazz);
Pager pager = new Pager<T>();
pager.setData(buildTableData(tableJson, clazz));
// 分页数据
JSONObject pageJson = tableJson.getJSONObject("page");
pager.setPageIndex(pageJson.getInteger("pageindex"));
pager.setPageSize(pageJson.getInteger("pagesize"));
pager.setTotalRows(pageJson.getInteger("recordcount"));
pager.setTotalPages(pageJson.getInteger("pagecount"));
return pager;
}
/**
......@@ -221,15 +233,12 @@ public class DcApiUtils {
/**
* 构建数据集
*
* @param resultJson
* @param tableJson
* @param clazz
* @param <T>
* @return
*/
public static <T> List<T> buildTableData(JSONObject resultJson, Class<T> clazz) {
JSONObject bodyJson = resultJson.getJSONObject("body");
JSONObject sourceJson = bodyJson.getJSONObject("source");
JSONObject tableJson = sourceJson.getJSONObject("table");
public static <T> List<T> buildTableData(JSONObject tableJson, Class<T> clazz) {
JSONArray colJsons = tableJson.getJSONArray("cols");
JSONArray rowJsons = tableJson.getJSONArray("rows");
return rowJsons.stream().map(item -> {
......
......@@ -109,13 +109,11 @@ public class ServiceHGCG003B extends ServiceBase {
this.editData(fCg003Bs, dbCg003BMap, dbCg002AMap, cg003, dbCg002BMap);
} else {
// 写入数据
for (int i = 0; i < fCg003Bs.size(); i++) {
HGCG003B hgcg003B = fCg003Bs.get(i);
if (hgcg003B.getId() == null || hgcg003B.getId() == 0) {
// 修改数据
this.addData(hgcg003B, cg003);
for (HGCG003B fCg003B : fCg003Bs) {
if (fCg003B.getId() == null || fCg003B.getId() == 0) {
this.addData(fCg003B, cg003);
} else {
this.updateData(hgcg003B);
this.updateData(fCg003B);
}
}
//修改主表信息
......
......@@ -631,7 +631,9 @@ public class HGSqlConstant {
* @date:2024/5/8,10:55
*/
public class HgXsUser {
// 查询
public static final String GET_BY_LOGIN = "HGXSUser.getByLogin";
// 查询
public static final String QUERY = "HGXSUser.query";
// 查询
......
......@@ -14,6 +14,8 @@ public class HgScSqlConstant {
*/
public static class HgSc001 {
// 获取
public static final String GET_BY_CODE = "HGSC001.get";
// 德诚修改
public static final String UPDATE_FOR_DC = "HGSC001.updateForDc";
// 修改项目名称
......
......@@ -3,6 +3,7 @@ package com.baosight.hggp.hg.sc.service;
import com.baosight.hggp.core.dao.DaoUtils;
import com.baosight.hggp.core.extapp.decheng.api.DcOpenApi;
import com.baosight.hggp.core.extapp.decheng.model.DcContractList;
import com.baosight.hggp.core.model.Pager;
import com.baosight.hggp.core.utils.ThreadUtils;
import com.baosight.hggp.hg.pz.domain.HGPZ009;
import com.baosight.hggp.hg.pz.tools.HGPZTools;
......@@ -125,12 +126,13 @@ public class ServiceHGSC101 extends ServiceEPBase {
if (pageIndex > 1000) {
break;
}
List<DcContractList> zbContracts = DcOpenApi.contactList(pageIndex);
if (CollectionUtils.isEmpty(zbContracts)) {
Pager<DcContractList> pager = DcOpenApi.contactList(pageIndex);
List<DcContractList> dcContractLists = pager.getData();
if (CollectionUtils.isEmpty(dcContractLists) || pageIndex > pager.getTotalPages()) {
break;
}
// 写入合同数据
saveContractData(accountCode, zbContracts);
saveContractData(accountCode, dcContractLists);
pageIndex++;
}
}
......@@ -139,27 +141,27 @@ public class ServiceHGSC101 extends ServiceEPBase {
* 写入合同信息
*
* @param accountCode
* @param zbContracts
* @param dcContractLists
*/
private void saveContractData(String accountCode, List<DcContractList> zbContracts) {
private void saveContractData(String accountCode, List<DcContractList> dcContractLists) {
// 查询帐套信息
HGPZ009 dbPz009 = HGPZTools.HgPz009.getByCode(accountCode);
String prefix = dbPz009.getLoginPrefix();
for (DcContractList zbContract : zbContracts) {
String projCode = prefix + zbContract.getOrd();
HGSC001 dbSc001 = HGSCTools.Hgsc001.queryByCode(projCode);
for (DcContractList dcContractList : dcContractLists) {
String projCode = prefix + dcContractList.getOrd();
HGSC001 dbSc001 = HGSCTools.Hgsc001.getByCode(projCode);
if (dbSc001 == null) {
dbSc001 = new HGSC001();
dbSc001.setAccountCode(accountCode);
dbSc001.setDepCode(accountCode);
dbSc001.setDepName(dbPz009.getAccountName());
dbSc001.setProjCode(projCode);
dbSc001.setProjName(zbContract.getTitle());
dbSc001.setProjName(dcContractList.getTitle());
DaoUtils.insert(HGSC001.INSERT, dbSc001);
} else {
Map updateMap = new HashMap();
updateMap.put(HGSC001.FIELD_proj_code, projCode);
updateMap.put(HGSC001.FIELD_proj_name, zbContract.getTitle());
updateMap.put(HGSC001.FIELD_proj_name, dcContractList.getTitle());
DaoUtils.insert(HgScSqlConstant.HgSc001.UPDATE_PROJ_NAME, dbSc001);
}
}
......
......@@ -2,6 +2,37 @@
<!DOCTYPE sqlMap PUBLIC "-//iBATIS.com//DTD SQL Map 2.0//EN" "http://www.ibatis.com/dtd/sql-map-2.dtd">
<sqlMap namespace="HGSC001">
<sql id="column">
id as "id",
company_code as "companyCode", <!-- 公司编码 -->
company_name as "companyName", <!-- 公司名称 -->
dep_code as "depCode", <!-- 部门编码 -->
dep_name as "depName", <!-- 部门名称 -->
subcontract_code as "subcontractCode", <!-- 分包商编码 -->
subcontract_name as "subcontractName", <!-- 分包商名称 -->
genral_contract_code as "genralContractCode", <!-- 总包商编码 -->
genral_contract_name as "genralContractName", <!-- 总包商名称 -->
party_pm_name as "partyPmName", <!-- 甲方项目经理名称 -->
party_pm_hpone as "partyPmHpone", <!-- 甲方项目经理联系电话 -->
contract_name as "contractName", <!-- 合同名称 -->
contract_work_txt as "contractWorkTxt", <!-- 合同工作量 -->
proj_code as "projCode", <!-- 项目编码 -->
proj_name as "projName", <!-- 项目名称 -->
proj_type as "projType", <!-- 项目性质 -->
proj_status as "projStatus", <!-- 项目状态 0:在建;1:完工 -->
approval_status as "approvalStatus", <!-- 审批状态 0:待审;1:审核中;2:已审 -->
permiss_start_date as "permissStartDate", <!-- 准许开工日期 -->
start_date as "startDate", <!-- 开工日期 -->
end_date as "endDate", <!-- 完工日期 -->
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" <!-- 更新时间 -->
</sql>
<sql id="condition">
<include refid="HGXSDataAuth.authCondition"/>
<isNotEmpty prepend=" AND " property="id">
......@@ -98,47 +129,27 @@
</isNotEmpty>
</sql>
<select id="get" resultClass="com.baosight.hggp.hg.sc.domain.HGSC001">
SELECT
<include refid="column"/>
FROM ${hggpSchema}.HGSC001
WHERE PROJ_CODE = #projCode
</select>
<select id="query" resultClass="com.baosight.hggp.hg.sc.domain.HGSC001">
SELECT
id as "id",
company_code as "companyCode", <!-- 公司编码 -->
company_name as "companyName", <!-- 公司名称 -->
dep_code as "depCode", <!-- 部门编码 -->
dep_name as "depName", <!-- 部门名称 -->
subcontract_code as "subcontractCode", <!-- 分包商编码 -->
subcontract_name as "subcontractName", <!-- 分包商名称 -->
genral_contract_code as "genralContractCode", <!-- 总包商编码 -->
genral_contract_name as "genralContractName", <!-- 总包商名称 -->
party_pm_name as "partyPmName", <!-- 甲方项目经理名称 -->
party_pm_hpone as "partyPmHpone", <!-- 甲方项目经理联系电话 -->
contract_name as "contractName", <!-- 合同名称 -->
contract_work_txt as "contractWorkTxt", <!-- 合同工作量 -->
proj_code as "projCode", <!-- 项目编码 -->
proj_name as "projName", <!-- 项目名称 -->
proj_type as "projType", <!-- 项目性质 -->
proj_status as "projStatus", <!-- 项目状态 0:在建;1:完工 -->
approval_status as "approvalStatus", <!-- 审批状态 0:待审;1:审核中;2:已审 -->
permiss_start_date as "permissStartDate", <!-- 准许开工日期 -->
start_date as "startDate", <!-- 开工日期 -->
end_date as "endDate", <!-- 完工日期 -->
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}.HGSC001 WHERE 1=1
<include refid="customCondition" />
<dynamic prepend="ORDER BY">
<isNotEmpty property="orderBy">
$orderBy$
</isNotEmpty>
<isEmpty property="orderBy">
id desc
</isEmpty>
</dynamic>
</select>
<include refid="column"/>
FROM ${hggpSchema}.HGSC001 WHERE 1=1
<include refid="customCondition"/>
<dynamic prepend="ORDER BY">
<isNotEmpty property="orderBy">
$orderBy$
</isNotEmpty>
<isEmpty property="orderBy">
id desc
</isEmpty>
</dynamic>
</select>
<select id="count" resultClass="int">
SELECT COUNT(*) FROM ${hggpSchema}.HGSC001 WHERE 1=1
......
package com.baosight.hggp.hg.sc.tools;
import cn.hutool.core.bean.BeanUtil;
import com.baosight.hggp.common.*;
import com.baosight.hggp.common.AssignStatusEnum;
import com.baosight.hggp.common.CheckStatusEnum;
import com.baosight.hggp.common.ComputeTypeEnum;
import com.baosight.hggp.common.HandleStatusEnum;
import com.baosight.hggp.common.ProductTypeEnum;
import com.baosight.hggp.core.constant.CommonConstant;
import com.baosight.hggp.core.dao.DaoBase;
import com.baosight.hggp.core.dao.DaoUtils;
......@@ -13,18 +16,37 @@ import com.baosight.hggp.hg.pz.domain.HGPZ004;
import com.baosight.hggp.hg.pz.domain.HGPZ005;
import com.baosight.hggp.hg.pz.domain.HGPZ005A;
import com.baosight.hggp.hg.pz.tools.HGPZTools;
import com.baosight.hggp.hg.sc.domain.*;
import com.baosight.hggp.hg.sc.constant.HgScSqlConstant;
import com.baosight.hggp.hg.sc.domain.HGSC001;
import com.baosight.hggp.hg.sc.domain.HGSC001A;
import com.baosight.hggp.hg.sc.domain.HGSC003;
import com.baosight.hggp.hg.sc.domain.HGSC004;
import com.baosight.hggp.hg.sc.domain.HGSC004A;
import com.baosight.hggp.hg.sc.domain.HGSC004B;
import com.baosight.hggp.hg.sc.domain.HGSC005;
import com.baosight.hggp.hg.sc.domain.HGSC005A;
import com.baosight.hggp.hg.sc.domain.HGSC006;
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.domain.HGSC009;
import com.baosight.hggp.hg.sc.domain.HGSC009A;
import com.baosight.hggp.hg.sc.domain.HGSC099;
import com.baosight.hggp.hg.sj.domain.HGSJ001;
import com.baosight.hggp.hg.sj.tools.HGSJTools;
import com.baosight.hggp.hg.zl.domain.HGZL002;
import com.baosight.hggp.hg.zl.domain.HGZL004;
import com.baosight.hggp.hg.zl.tools.HGZLTools;
import com.baosight.hggp.util.*;
import com.baosight.hggp.util.AssertUtils;
import com.baosight.hggp.util.BeanUtils;
import com.baosight.hggp.util.DateUtil;
import com.baosight.hggp.util.DateUtils;
import com.baosight.hggp.util.EiInfoUtils;
import com.baosight.hggp.util.FileUtils;
import com.baosight.iplat4j.core.ProjectInfo;
import com.baosight.iplat4j.core.ei.EiConstant;
import com.baosight.iplat4j.core.ei.EiInfo;
import com.baosight.iplat4j.core.exception.PlatException;
import com.baosight.iplat4j.core.service.soa.XServiceManager;
import com.baosight.iplat4j.core.util.NumberUtils;
import com.baosight.iplat4j.ed.util.SequenceGenerator;
import org.apache.commons.collections.CollectionUtils;
......@@ -33,12 +55,24 @@ import org.apache.commons.lang3.StringUtils;
import java.math.BigDecimal;
import java.math.RoundingMode;
import java.util.*;
import java.util.ArrayList;
import java.util.Collections;
import java.util.Comparator;
import java.util.Date;
import java.util.HashMap;
import java.util.LinkedHashMap;
import java.util.List;
import java.util.Map;
import java.util.Objects;
import java.util.Optional;
import java.util.concurrent.atomic.AtomicReference;
import java.util.function.Function;
import java.util.stream.Collectors;
import static com.baosight.hggp.common.AssignStatusEnum.*;
import cn.hutool.core.bean.BeanUtil;
import static com.baosight.hggp.common.AssignStatusEnum.ASSIGNED;
import static com.baosight.hggp.common.AssignStatusEnum.PARTIAL_ASSIGN;
import static com.baosight.hggp.common.AssignStatusEnum.UNASSIGN;
import static java.math.BigDecimal.ROUND_DOWN;
/**
......@@ -196,18 +230,34 @@ public class HGSCTools {
*/
public static class Hgsc001 {
/**
*
* @param code
* @return
*/
public static HGSC001 queryByCode(String code) {
AssertUtils.isNull(code, "项目Code不能为空!");
List<HGSC001> results = DaoBase.getInstance().query(HGSC001.QUERY, new HashMap<String,Object>(){
{put("projCode",code);}
});
return CollectionUtils.isEmpty(results) ? null : results.get(0);
}
public static HGSC001 getByCode(String code) {
AssertUtils.isNull(code, "项目Code不能为空!");
Map queryMap = new HashMap();
queryMap.put(HGSC001.FIELD_proj_code, code);
List<HGSC001> results = DaoBase.getInstance().query(HgScSqlConstant.HgSc001.GET_BY_CODE, queryMap);
return CollectionUtils.isEmpty(results) ? null : results.get(0);
}
/**
*
* @param code
* @return
*/
public static HGSC001 queryByCode(String code) {
AssertUtils.isNull(code, "项目Code不能为空!");
List<HGSC001> results = DaoBase.getInstance().query(HGSC001.QUERY, new HashMap<String, Object>() {
{
put("projCode", code);
}
});
return CollectionUtils.isEmpty(results) ? null : results.get(0);
}
/**
* @param projCodes
......
......@@ -2,12 +2,15 @@ package com.baosight.hggp.hg.wd.service;
import com.baosight.hggp.aspect.annotation.OperationLogAnnotation;
import com.baosight.hggp.common.DdynamicEnum;
import com.baosight.hggp.core.security.UserSessionUtils;
import com.baosight.hggp.hg.wd.constant.HgWdConstant;
import com.baosight.hggp.hg.wd.domain.HGWD001;
import com.baosight.hggp.hg.wd.domain.HGWD002;
import com.baosight.hggp.hg.xs.domain.User;
import com.baosight.hggp.util.CommonMethod;
import com.baosight.hggp.util.EiInfoUtils;
import com.baosight.hggp.util.LogUtils;
import com.baosight.hggp.util.contants.ACConstants;
import com.baosight.iplat4j.core.ei.EiConstant;
import com.baosight.iplat4j.core.ei.EiInfo;
import com.baosight.iplat4j.core.service.impl.ServiceBase;
......@@ -52,6 +55,7 @@ public class ServiceHGWD002 extends ServiceBase {
Map queryRow = EiInfoUtils.getFirstRow(inInfo);
// 仅查询已发布的文件
queryRow.put(HGWD001.FIELD_STATUS, HgWdConstant.FileStatus.S_1);
inInfo.setCell(EiConstant.queryBlock, ACConstants.ROW_CODE_0, User.FIELD_USER_ID, UserSessionUtils.getUserId());
inInfo = super.query(inInfo, HGWD002.QUERY, new HGWD002());
} catch (Exception e) {
LogUtils.setDetailMsg(inInfo, e, "查询失败");
......
......@@ -60,7 +60,6 @@ public class ServiceHGWD099 extends ServiceEPBase {
try {
Map queryRow =EiInfoUtils.getFirstRow(inInfo);
if (StringUtils.isNotEmpty(queryRow.get(HGWD001.FIELD_FILE_ID).toString())){
inInfo.setCell(EiConstant.queryBlock, ACConstants.ROW_CODE_0, User.FIELD_USER_ID, UserSessionUtils.getUserId());
inInfo = super.query(inInfo, HGWD099.QUERY, new HGWD099());
}
} catch (Throwable e) {
......
......@@ -30,6 +30,7 @@
<sql id="condition">
AND DELETE_FLAG = 0
<include refid="HGXSDataAuth.authCondition"/>
<isNotEmpty prepend=" AND " property="id">
ID = #id#
</isNotEmpty>
......
......@@ -23,6 +23,7 @@
<sql id="condition">
AND A.DELETE_FLAG = 0
AND B.DELETE_FLAG = 0
AND B.BIZ_TYPE = 'WD'
<include refid="HGXSDataAuth.authConditionA"/>
<isNotEmpty prepend=" AND " property="id">
......@@ -52,6 +53,9 @@
<isNotEmpty prepend=" AND " property="docName">
B.DOC_NAME LIKE CONCAT('%', #docName#, '%')
</isNotEmpty>
<isNotEmpty prepend=" AND " property="parentId">
B.BIZ_ID IN (select FILE_ID from ${hggpSchema}.hgwd003 where USER_ID = #userId# and FILE_ID = #parentId# )
</isNotEmpty>
</sql>
<sql id="orderBy">
......
......@@ -35,9 +35,9 @@
<isNotEmpty prepend=" AND " property="bizId">
BIZ_ID = #bizId#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="fileId">
<!--<isNotEmpty prepend=" AND " property="fileId">
BIZ_ID IN (select FILE_ID from ${hggpSchema}.hgwd003 where USER_ID = #userId# and FILE_ID = #fileId# )
</isNotEmpty>
</isNotEmpty>-->
<isNotEmpty prepend=" AND " property="docId">
DOC_ID = #docId#
</isNotEmpty>
......@@ -50,6 +50,9 @@
<isNotEmpty prepend=" AND " property="releaseDate">
RELEASE_DATE = #releaseDate#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="parentId">
BIZ_ID = #parentId#
</isNotEmpty>
</sql>
<sql id="customCondition">
......
......@@ -150,34 +150,34 @@ public class ServiceHGXSOrg extends ServiceBase {
private void syncDcDeptData(String accountCode) throws IOException, InstantiationException, IllegalAccessException {
int pageIndex = 1;
Pager<DcDeptList> pager = DcOpenApi.deptList(pageIndex);
List<DcDeptList> zbDepts = pager.getData();
if (CollectionUtils.isEmpty(zbDepts)) {
List<DcDeptList> dcDeptLists = pager.getData();
if (CollectionUtils.isEmpty(dcDeptLists)) {
return;
}
// 写入合同数据
syncDcDeptData(accountCode, zbDepts);
syncDcDeptData(accountCode, dcDeptLists);
}
/**
* 写入部门信息
*
* @param accountCode
* @param zbDepts
* @param dcDeptLists
*/
private void syncDcDeptData(String accountCode, List<DcDeptList> zbDepts) {
private void syncDcDeptData(String accountCode, List<DcDeptList> dcDeptLists) {
// 查询帐套信息
HGPZ009 dbPz009 = HGPZTools.HgPz009.getByCode(accountCode);
for (DcDeptList zbDept : zbDepts) {
String orgId = dbPz009.getLoginPrefix() + zbDept.getNodeId();
for (DcDeptList dcDeptList : dcDeptLists) {
String orgId = dbPz009.getLoginPrefix() + dcDeptList.getNodeId();
Org dbOrg = HGXSTools.XsOrg.get(orgId);
if (dbOrg == null) {
dbOrg = new Org();
dbOrg.setOrgId(orgId);
this.syncDcDeptAdd(accountCode, zbDept, dbOrg, dbPz009);
this.syncDcDeptAdd(accountCode, dcDeptList, dbOrg, dbPz009);
} else {
Map updateMap = new HashMap();
updateMap.put(Org.FIELD_ORG_ID, orgId);
updateMap.put(Org.FIELD_ORG_CNAME, zbDept.getNodeText());
updateMap.put(Org.FIELD_ORG_CNAME, dcDeptList.getNodeText());
updateMap.put(Org.FIELD_REC_REVISOR, "System");
updateMap.put(Org.FIELD_REC_REVISE_TIME, DateUtils.shortDateTime());
updateMap.put(Org.FIELD_IS_DELETED, DeleteFlagEnum.UN_REMOVE.getCode().toString());
......@@ -194,16 +194,16 @@ public class ServiceHGXSOrg extends ServiceBase {
* @param dbOrg
* @param dbPz009
*/
private void syncDcDeptAdd(String accountCode, DcDeptList zbDept, Org dbOrg, HGPZ009 dbPz009) {
private void syncDcDeptAdd(String accountCode, DcDeptList dcDeptList, Org dbOrg, HGPZ009 dbPz009) {
String orgId = dbOrg.getOrgId();
dbOrg.setAccountCode(accountCode);
dbOrg.setOrgEname(orgId);
dbOrg.setOrgCname(zbDept.getNodeText());
dbOrg.setOrgCname(dcDeptList.getNodeText());
dbOrg.setOrgType(OrgTypeEnum.DEPT.getCode());
dbOrg.setParentOrgId("-1".equals(zbDept.getParentId())
? accountCode : dbPz009.getLoginPrefix() + zbDept.getParentId());
dbOrg.setParentOrgId("-1".equals(dcDeptList.getParentId())
? accountCode : dbPz009.getLoginPrefix() + dcDeptList.getParentId());
dbOrg.setEstablishDate("20240101");
dbOrg.setSortIndex(zbDept.getFullSort());
dbOrg.setSortIndex(dcDeptList.getFullSort());
dbOrg.setCompanyCode(accountCode);
dbOrg.setCompanyName(dbPz009.getAccountName());
dbOrg.setRecCreator("System");
......
......@@ -238,12 +238,12 @@ public class ServiceHGXSUser extends ServiceBase {
break;
}
Pager<DcUserList> pager = DcOpenApi.userList(pageIndex);
List<DcUserList> zbUsers = pager.getData();
if (CollectionUtils.isEmpty(zbUsers) || pageIndex > pager.getTotalPages()) {
List<DcUserList> dcUserLists = pager.getData();
if (CollectionUtils.isEmpty(dcUserLists) || pageIndex > pager.getTotalPages()) {
break;
}
// 写入合同数据
syncDcUserData(accountCode, zbUsers);
syncDcUserData(accountCode, dcUserLists);
pageIndex++;
}
}
......@@ -252,14 +252,14 @@ public class ServiceHGXSUser extends ServiceBase {
* 写入用户信息
*
* @param accountCode
* @param ZbUserLists
* @param dcUserLists
*/
private void syncDcUserData(String accountCode, List<DcUserList> ZbUserLists) {
private void syncDcUserData(String accountCode, List<DcUserList> dcUserLists) {
// 查询帐套信息
HGPZ009 dbPz009 = HGPZTools.HgPz009.getByCode(accountCode);
for (DcUserList zbUserList : ZbUserLists) {
for (DcUserList dcUserList : dcUserLists) {
try {
syncDcUserSingle(dbPz009, zbUserList.getOrd());
syncDcUserSingle(dbPz009, dcUserList.getOrd());
} catch (Exception e) {
log.error("同步德诚用户失败:{}", e.getMessage(), e);
}
......@@ -281,7 +281,7 @@ public class ServiceHGXSUser extends ServiceBase {
}
String userId = dbPz009.getLoginPrefix() + ord;
// 判断用户是否存在
User dbUser = HGXSTools.XsUser.get(userId);
User dbUser = HGXSTools.XsUser.getByLogin(userId);
if (dbUser == null) {
this.syncDcSingleUserAdd(zbUser, dbPz009, userId);
} else {
......@@ -297,8 +297,7 @@ public class ServiceHGXSUser extends ServiceBase {
* @param userId
* @throws Exception
*/
private void syncDcSingleUserAdd(DcUser zbUser, HGPZ009 dbPz009, String userId)
throws Exception {
private void syncDcSingleUserAdd(DcUser zbUser, HGPZ009 dbPz009, String userId) throws Exception {
// 新增用户
HGXSTools.XsUser.addUser(dbPz009.getAccountCode(), userId, zbUser.getName(), zbUser.getSex(), zbUser.getEmail(),
zbUser.getCardid());
......
......@@ -57,8 +57,7 @@
SELECT
<include refid="column"/>
FROM ${platSchema}.TXSOG01
WHERE 1=1
AND ORG_ID = #orgId#
WHERE ORG_ID = #orgId#
</select>
<!-- 查询组织信息 -->
......
......@@ -2,6 +2,16 @@
<!DOCTYPE sqlMap PUBLIC "-//iBATIS.com//DTD SQL Map 2.0//EN" "http://www.ibatis.com/dtd/sql-map-2.dtd">
<sqlMap namespace="HGXSUser">
<sql id="column">
USER_ID as "userId", <!-- 用户id -->
USER_NAME as "userName", <!-- 用户名 -->
LOGIN_NAME as "loginName", <!-- 登录id -->
GENDER as "gender", <!-- 性别 -->
MOBILE as "mobile", <!-- 手机号 -->
EMAIL as "email", <!-- 邮箱 -->
ACCOUNT_CODE as "accountCode" <!-- 企业编码 -->
</sql>
<sql id="condition">
<isNotEmpty prepend=" AND " property="loginName">
LOGIN_NAME = #loginName#
......@@ -21,15 +31,17 @@
</sql>
<!-- 查询用户信息 -->
<select id="getByLogin" resultClass="com.baosight.hggp.hg.xs.domain.User">
SELECT
<include refid="column"/>
FROM ${platSchema}.XS_USER
WHERE LOGIN_NAME = #loginName#
</select>
<!-- 查询用户信息 -->
<select id="query" resultClass="com.baosight.hggp.hg.xs.domain.User">
SELECT
USER_ID as "userId", <!-- 用户id -->
USER_NAME as "userName", <!-- 用户名 -->
LOGIN_NAME as "loginName", <!-- 登录id -->
GENDER as "gender", <!-- 性别 -->
MOBILE as "mobile", <!-- 手机号 -->
EMAIL as "email", <!-- 邮箱 -->
ACCOUNT_CODE as "accountCode" <!-- 企业编码 -->
<include refid="column"/>
FROM ${platSchema}.XS_USER
WHERE 1=1
<include refid="condition"/>
......
......@@ -121,11 +121,11 @@ public class HGXSTools {
*
* @return
*/
public static User get(String loginName) {
public static User getByLogin(String loginName) {
AssertUtils.isEmpty(loginName, "用户登录名不能为空");
Map paramMap = new HashMap();
paramMap.put("loginName", loginName);
List<User> results = DaoBase.getInstance().query(HGSqlConstant.HgXsUser.QUERY, paramMap);
List<User> results = DaoBase.getInstance().query(HGSqlConstant.HgXsUser.GET_BY_LOGIN, paramMap);
return CollectionUtils.isEmpty(results) ? null : results.get(0);
}
......
......@@ -43,7 +43,7 @@
<EF:EFColumn ename="purWeight" cname="采购重量" width="120" align="right" format="{0:N3}" sumType="page"
required="true"/>
<EF:EFComboColumn ename="calculationMethod" cname="计算方式" enable="true" width="100" align="center"
required="true">
copy="true" required="true">
<EF:EFCodeOption codeName="hggp.cg.calculationMethod"/>
</EF:EFComboColumn>
<EF:EFColumn ename="price" cname="单价" width="80" align="right" format="{0:N3}" required="true"/>
......
......@@ -108,7 +108,6 @@ $(function () {
//系数
let coefficient = inventRecordBoxBlockId[i]['param10Field']
calUnitWeight(e.items[0],e.items[0].length,e.items[0].width,e.items[0].thick,coefficient);
break
}
}
......
......@@ -49,12 +49,13 @@
sumType="page"/>
<EF:EFColumn ename="receiveWeight" cname="收货重量" width="120" align="right" format="{0:N3}" sumType="page"
required="true"/>
<EF:EFColumn ename="receiveUnitWeight" cname="收货单重" enable="false" width="120" align="right"
format="{0:N3}"/>
<EF:EFComboColumn ename="calculationMethod" cname="计算方式" enable="false" width="120" align="center">
<EF:EFColumn ename="receiveUnitWeight" cname="收货单重" width="120" align="right" format="{0:N3}"
required="true"/>
<EF:EFComboColumn ename="calculationMethod" cname="计算方式" width="120" align="center" required="true"
copy="true">
<EF:EFCodeOption codeName="hggp.cg.calculationMethod"/>
</EF:EFComboColumn>
<EF:EFColumn ename="price" cname="单价" enable="false" width="120" align="right" format="{0:C3}"/>
<EF:EFColumn ename="price" cname="单价" width="120" align="right" format="{0:C3}" required="true"/>
<EF:EFColumn ename="amount" cname="金额" enable="false" width="120" align="right" format="{0:C3}"
sumType="page"/>
<EF:EFComboColumn ename="status" cname="状态" enable="false" width="80" align="center">
......
......@@ -471,9 +471,10 @@ $(function () {
// 附件上传
$("#UPLOAD_FILE").on("click", uploadFile);
$("#RELEASE").click("click",updateRelease)
//发布
$("#RELEASE").click("click",updateRelease);
//变更记录
$("#CHANGE_RECORD").on("click", changeResord);
},
onDelete: function (e) {
// 阻止默认请求,使用自定义删除
......@@ -833,7 +834,7 @@ function uploadFile() {
});
}
function changeFile(docId,bizId) {
function changeResor(docId,bizId) {
JSColorbox.open({
href: "HGWD099A?methodName=initLoad&inqu_status-0-bizType=WD" +
"&inqu_status-0-bizId="+bizId+"" +
......@@ -925,7 +926,6 @@ function updateRelease() {
);
}
/**
* 显示授权按钮
*/
......@@ -935,8 +935,31 @@ let showAuthButton = function () {
if (leafType && leafType >0) {
$("#RELEASE").attr("disabled", false);
$("#UPLOAD_FILE").attr("disabled", false);
$("#CHANGE_RECORD").attr("disabled", true);
} else {
$("#RELEASE").attr("disabled", true);
$("#UPLOAD_FILE").attr("disabled", true);
$("#CHANGE_RECORD").attr("disabled", false);
}
}
/**
* 文件上传
*/
function changeResord() {
let leafType = IPLATUI.EFTree.categoryTree.selectTreeNode.leafLevel;
if (isBlank(leafType)){
message("请选择文档目录树节点!");
return;
}
JSColorbox.open({
href: "HGWD001A?methodName=initLoad&inqu_status-0-bizType=WD" +
"&inqu_status-0-projCode=" + $("#inqu_status-0-parentId").val()+"" +
"&inqu_status-0-projName=" + $("#inqu_status-0-fileName").val() +
"&efParentFormEname=HGWD001",
title: "<div style='text-align: center;'>变更记录</div>",
width: "80%",
height: "80%",
callbackName: uploadFileCallback
});
}
\ No newline at end of file
......@@ -4,7 +4,7 @@ $(function () {
"result": {
exportGrid: false, // 隐藏右侧自定义导出按钮
pageable: {
pageSize: 20,
pageSize: 10,
pageSizes: [20, 50, 70, 100],
},
columns: [/*{
......@@ -22,19 +22,19 @@ $(function () {
field: "changeStart",
template: function (item) {
let template = item["changeStart"]
if (item.changeType == "uploadAdd" || item.changeType == "uploadDelete") {
/* if (item.changeType == "uploadAdd" || item.changeType == "uploadDelete") {
template = "";
}
}*/
return template;
}
},{
field: "changeEnd",
template: function (item) {
let template = item["changeEnd"]
if (item.changeType == "uploadAdd" || item.changeType == "uploadDelete") {
/*if (item.changeType == "uploadAdd" || item.changeType == "uploadDelete") {
template = '<a style="cursor: pointer;display: inline-flex;justify-content: center;margin:auto 5px" '
+ 'href="' + downloadHref(item.changeStart) + '" target="_blank">'+item.changeEnd+'</a>';
}
}*/
return template;
}
}],
......
......@@ -20,11 +20,12 @@
<EF:EFPage title="变更记录">
<EF:EFRegion id="inqu" title="查询条件">
<div class="row">
<EF:EFSelect blockId="inqu_status" row="0" ename="companyCode" cname="公司名称" colWidth="3" filter="contains" readonly="true">
<EF:EFSelect blockId="inqu_status" row="0" ename="companyCode" cname="公司名称" colWidth="3" filter="contains">
<EF:EFOption label="全部" value=""/>
<EF:EFOptions blockId="companyBox_block_id" textField="textField" valueField="valueField"/>
</EF:EFSelect>
<EF:EFInput blockId="inqu_status" row="0" ename="projName" cname="项目名称" placeholder="模糊查询" colWidth="3"/>
<EF:EFInput blockId="inqu_status" row="0" ename="projCode" cname="项目编码" type="hidden" colWidth="3"/>
<EF:EFInput blockId="inqu_status" row="0" ename="projName" cname="项目名称" placeholder="模糊查询" colWidth="3" readonly="true"/>
<EF:EFSelect blockId="inqu_status" row="0" ename="changeType" cname="变更类型" colWidth="3" filter="contains">
<EF:EFOption label="全部" value=""/>
<EF:EFCodeOption codeName="hggp.hgwd.changeType"/>
......
......@@ -177,7 +177,14 @@ let save = function (btnNode) {
if(flag) {
JSUtils.confirm("确定对勾选中的[" + rows.length + "]条数据做\"保存\"操作? ", {
ok: function () {
JSUtils.submitGridsData("result", "HGWD001E", "save", true);
JSUtils.submitGridsData("result", "HGWD001E", "save", true,
function (e) {
var status = e.status;
if (status !== -1) {
let parentOrgId = $("#inqu_status-0-parentOrgId").val();
parent.JSColorbox.setValueCallback(parentOrgId);
}
});
btnNode.attr("disabled", false);
}
});
......
......@@ -145,7 +145,15 @@ let save = function (btnNode) {
if(flag) {
JSUtils.confirm("确定对勾选中的[" + rows.length + "]条数据做\"保存\"操作? ", {
ok: function () {
JSUtils.submitGridsData("result", "HGWD001F", "save", true);
JSUtils.submitGridsData("result", "HGWD001F", "save", true,
function (e) {
var status = e.status;
if (status !== -1) {
let parentOrgId = $("#inqu_status-0-parentOrgId").val();
parent.JSColorbox.setValueCallback(parentOrgId);
}
}
);
btnNode.attr("disabled", false);
}
});
......
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