Commit 18c08e74 by 宋祥
parents 21ad4a95 9b5b24db
...@@ -53,4 +53,9 @@ public class DcUser { ...@@ -53,4 +53,9 @@ public class DcUser {
@AliasNameAnon(name = "手机") @AliasNameAnon(name = "手机")
private String Mobile; private String Mobile;
/**
* 员工编号
*/
@AliasNameAnon(name = "员工编号")
private String Ygid;
} }
...@@ -216,8 +216,6 @@ public class ServiceHGCG002 extends ServiceBase { ...@@ -216,8 +216,6 @@ public class ServiceHGCG002 extends ServiceBase {
HGCGTools.HgCg001A.updateStatus(hgcg002B.getPlanDetailId(), HGConstant.CgPlanStatus.S_2); HGCGTools.HgCg001A.updateStatus(hgcg002B.getPlanDetailId(), HGConstant.CgPlanStatus.S_2);
} }
} }
} }
/** /**
...@@ -256,16 +254,17 @@ public class ServiceHGCG002 extends ServiceBase { ...@@ -256,16 +254,17 @@ public class ServiceHGCG002 extends ServiceBase {
String contractNo = fCg002.getContractNo(); String contractNo = fCg002.getContractNo();
HGCG002 dbCg002 = dbCg002AMap.get(contractNo); HGCG002 dbCg002 = dbCg002AMap.get(contractNo);
AssertUtils.isNull(dbCg002, String.format("合同[%s]不存在", contractNo)); AssertUtils.isNull(dbCg002, String.format("合同[%s]不存在", contractNo));
AssertUtils.isTrue(StringUtils.isBlank(fCg002.getSupName()), String.format("合同[%s]供应商为空", contractNo)); AssertUtils.isEmpty(dbCg002.getSupName(), String.format("合同[%s]供应商为空", contractNo));
AssertUtils.isTrue(StringUtils.isBlank(fCg002.getPurUserName()), String.format("合同[%s]采购员为空", contractNo)); AssertUtils.isEmpty(dbCg002.getPurUserName(), String.format("合同[%s]采购员为空", contractNo));
AssertUtils.isNotEquals(HGConstant.CgContractStatus.S_0, dbCg002.getStatus(), AssertUtils.isNotEquals(HGConstant.CgContractStatus.S_0, dbCg002.getStatus(),
String.format("合同[%s]状态不是\"待审核\",不允许操作", contractNo)); String.format("合同[%s]状态不是\"待审核\",不允许操作", contractNo));
AssertUtils.isTrue(fCg002.getAmount().compareTo(BigDecimal.ZERO) <= 0, String.format("合同[%s]不含税金额小于等于0,不允许操作", contractNo)); AssertUtils.isTrue(dbCg002.getAmount().compareTo(BigDecimal.ZERO) <= 0,
AssertUtils.isTrue(fCg002.getTaxIncludeAmount().compareTo(BigDecimal.ZERO) <= 0, String.format("合同[%s]含税金额小于等于0,不允许操作", contractNo)); String.format("合同[%s]不含税金额小于等于0,不允许操作", contractNo));
AssertUtils.isTrue(dbCg002.getTaxIncludeAmount().compareTo(BigDecimal.ZERO) <= 0,
String.format("合同[%s]含税金额小于等于0,不允许操作", contractNo));
} }
} }
/** /**
* 提交数据 * 提交数据
* *
......
...@@ -143,22 +143,26 @@ public class ServiceHGCG003A extends ServiceBase { ...@@ -143,22 +143,26 @@ public class ServiceHGCG003A extends ServiceBase {
Long id = fCg002B.getId(); Long id = fCg002B.getId();
HGCG002B dbCg002b = dbCg002BMap.get(id); HGCG002B dbCg002b = dbCg002BMap.get(id);
// 总重 // 总重
BigDecimal bcReceiveQty = fCg002B.getBcReceiveQty();
BigDecimal bcReceiveWeight = fCg002B.getBcReceiveWeight(); BigDecimal bcReceiveWeight = fCg002B.getBcReceiveWeight();
if (bcReceiveWeight == null || bcReceiveWeight.compareTo(BigDecimal.ZERO) == 0) { if (bcReceiveWeight == null || bcReceiveWeight.compareTo(BigDecimal.ZERO) == 0) {
fCg002B.setReceiveWeight(fCg002B.getBcReceiveQty().multiply(dbCg002b.getPurUnitWeight())); fCg002B.setReceiveWeight(bcReceiveQty.multiply(dbCg002b.getPurUnitWeight()));
fCg002B.setPurUnitWeight(dbCg002b.getPurUnitWeight());
} else { } else {
fCg002B.setReceiveWeight(bcReceiveWeight); fCg002B.setReceiveWeight(bcReceiveWeight);
fCg002B.setPurUnitWeight(bcReceiveWeight.divide(bcReceiveQty, 3, RoundingMode.HALF_UP));
} }
// 含税总金额 // 含税总金额
BigDecimal amount; BigDecimal amount;
if (HgCgConst.CalculationMethod.S1.equals(fCg002B.getCalculationMethod())) { if (HgCgConst.CalculationMethod.S1.equals(fCg002B.getCalculationMethod())) {
amount = fCg002B.getReceiveWeight().multiply(dbCg002b.getPrice()); amount = bcReceiveWeight.multiply(dbCg002b.getPrice());
} else { } else {
amount = fCg002B.getBcReceiveQty().multiply(dbCg002b.getPrice()); amount = bcReceiveQty.multiply(dbCg002b.getPrice());
} }
// 如果税率不为空,总金额减去税额 // 如果税率不为空,总金额减去税额
if (dbCg002b.getTaxRate() != null) { if (dbCg002b.getTaxRate() != null) {
amount = amount.subtract(amount.multiply(dbCg002b.getTaxRate()).divide(new BigDecimal("100"))); BigDecimal taxRate = dbCg002b.getTaxRate().multiply(new BigDecimal("0.01")).add(BigDecimal.ONE);
amount = amount.divide(taxRate, 2, RoundingMode.HALF_UP);
} }
fCg002B.setAmount(amount); fCg002B.setAmount(amount);
} }
......
...@@ -2,11 +2,50 @@ ...@@ -2,11 +2,50 @@
<!DOCTYPE sqlMap PUBLIC "-//iBATIS.com//DTD SQL Map 2.0//EN" "http://www.ibatis.com/dtd/sql-map-2.dtd"> <!DOCTYPE sqlMap PUBLIC "-//iBATIS.com//DTD SQL Map 2.0//EN" "http://www.ibatis.com/dtd/sql-map-2.dtd">
<sqlMap namespace="HGCG002A"> <sqlMap namespace="HGCG002A">
<sql id="column">
ID as "id",
ACCOUNT_CODE as "accountCode", <!-- 企业编码 -->
DEP_CODE as "depCode", <!-- 部门编码 -->
CREATED_BY as "createdBy", <!-- 记录创建者 -->
CREATED_NAME as "createdName", <!-- 记录创建名称 -->
CREATED_TIME as "createdTime", <!-- 记录创建时间 -->
UPDATED_BY as "updatedBy", <!-- 记录修改者 -->
UPDATED_NAME as "updatedName", <!-- 记录修改名称 -->
UPDATED_TIME as "updatedTime", <!-- 记录修改时间 -->
DELETE_FLAG as "deleteFlag", <!-- 0-未删除,1-已删除 -->
COMPANY_CODE as "companyCode", <!-- 公司编码 -->
COMPANY_NAME as "companyName", <!-- 公司名称 -->
INVENT_TYPE as "inventType", <!-- 存货类型 -->
INVENT_CODE as "inventCode", <!-- 存货编码 -->
INVENT_NAME as "inventName", <!-- 存货名称 -->
SPEC as "spec", <!-- 规格 -->
MATERIAL as "material", <!-- 材质 -->
UNIT as "unit", <!-- 单位 -->
LENGTH as "length", <!-- 长度 -->
WIDTH as "width", <!-- 宽度 -->
THICK as "thick", <!-- 厚度 -->
PUR_QTY as "purQty", <!-- 采购数量 -->
PUR_UNIT_WEIGHT as "purUnitWeight", <!-- 采购单重 -->
PUR_WEIGHT as "purWeight", <!-- 采购重量 -->
RECEIVE_QTY as "receiveQty", <!-- 收货数量 -->
RECEIVE_WEIGHT as "receiveWeight", <!-- 收货重量 -->
PRICE as "price", <!-- 单价 -->
AMOUNT as "amount", <!-- 金额(不含税金额) -->
TAX_INCLUDE_AMOUNT as "taxIncludeAmount", <!-- 含税金额 -->
TAX_AMOUNT as "taxAmount", <!-- 税额 -->
TAX_RATE as "taxRate", <!-- 税率 -->
INVENT_TYPE_DETAIL as "inventTypeDetail", <!-- 存货类型大类 -->
PRIMARY_ID as "primaryId", <!-- 主表id -->
PROJ_CODE as "projCode", <!-- 项目编码 -->
PROJ_NAME as "projName", <!-- 项目名称 -->
CALCULATION_METHOD as "calculationMethod", <!-- 计算方式 0-数量乘单价 1-重量乘单价 -->
PLAN_DETAIL_ID as "planDetailId", <!-- 计划明细id -->
STATUS as "status"
</sql>
<sql id="condition"> <sql id="condition">
AND DELETE_FLAG = 0 AND DELETE_FLAG = 0
<isNotEmpty prepend=" AND " property="id"> <include refid="idCondition"/>
ID = #id#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="accountCode"> <isNotEmpty prepend=" AND " property="accountCode">
ACCOUNT_CODE = #accountCode# ACCOUNT_CODE = #accountCode#
</isNotEmpty> </isNotEmpty>
...@@ -117,13 +156,6 @@ ...@@ -117,13 +156,6 @@
</isNotEmpty> </isNotEmpty>
</sql> </sql>
<!-- 公共修改字段 -->
<sql id="updateRevise">
UPDATED_BY = #updatedBy#,
UPDATED_NAME = #updatedName#,
UPDATED_TIME = #updatedTime#
</sql>
<sql id="idCondition"> <sql id="idCondition">
<isNotEmpty prepend=" AND " property="id"> <isNotEmpty prepend=" AND " property="id">
ID = #id# ID = #id#
...@@ -136,49 +168,14 @@ ...@@ -136,49 +168,14 @@
</isNotEmpty> </isNotEmpty>
</sql> </sql>
<select id="query" resultClass="com.baosight.hggp.hg.cg.domain.HGCG002B"> <!-- 公共修改字段 -->
SELECT <sql id="updateRevise">
ID as "id", UPDATED_BY = #updatedBy#,
ACCOUNT_CODE as "accountCode", <!-- 企业编码 --> UPDATED_NAME = #updatedName#,
DEP_CODE as "depCode", <!-- 部门编码 --> UPDATED_TIME = #updatedTime#
CREATED_BY as "createdBy", <!-- 记录创建者 --> </sql>
CREATED_NAME as "createdName", <!-- 记录创建名称 -->
CREATED_TIME as "createdTime", <!-- 记录创建时间 --> <sql id="orderBy">
UPDATED_BY as "updatedBy", <!-- 记录修改者 -->
UPDATED_NAME as "updatedName", <!-- 记录修改名称 -->
UPDATED_TIME as "updatedTime", <!-- 记录修改时间 -->
DELETE_FLAG as "deleteFlag", <!-- 0-未删除,1-已删除 -->
COMPANY_CODE as "companyCode", <!-- 公司编码 -->
COMPANY_NAME as "companyName", <!-- 公司名称 -->
INVENT_TYPE as "inventType", <!-- 存货类型 -->
INVENT_CODE as "inventCode", <!-- 存货编码 -->
INVENT_NAME as "inventName", <!-- 存货名称 -->
SPEC as "spec", <!-- 规格 -->
MATERIAL as "material", <!-- 材质 -->
UNIT as "unit", <!-- 单位 -->
LENGTH as "length", <!-- 长度 -->
WIDTH as "width", <!-- 宽度 -->
THICK as "thick", <!-- 厚度 -->
PUR_QTY as "purQty", <!-- 采购数量 -->
PUR_UNIT_WEIGHT as "purUnitWeight", <!-- 采购单重 -->
PUR_WEIGHT as "purWeight", <!-- 采购重量 -->
RECEIVE_QTY as "receiveQty", <!-- 收货数量 -->
RECEIVE_WEIGHT as "receiveWeight", <!-- 收货重量 -->
PRICE as "price", <!-- 单价 -->
AMOUNT as "amount", <!-- 金额(不含税金额) -->
TAX_INCLUDE_AMOUNT as "taxIncludeAmount", <!-- 含税金额 -->
TAX_AMOUNT as "taxAmount", <!-- 税额 -->
TAX_RATE as "taxRate", <!-- 税率 -->
INVENT_TYPE_DETAIL as "inventTypeDetail", <!-- 存货类型大类 -->
PRIMARY_ID as "primaryId", <!-- 主表id -->
PROJ_CODE as "projCode", <!-- 项目编码 -->
PROJ_NAME as "projName", <!-- 项目名称 -->
CALCULATION_METHOD as "calculationMethod", <!-- 计算方式 0-数量乘单价 1-重量乘单价 -->
PLAN_DETAIL_ID as "planDetailId", <!-- 计划明细id -->
STATUS as "status"
FROM ${hggpSchema}.HGCG002A WHERE 1=1
<include refid="condition" />
<include refid="idCondition"/>
<dynamic prepend="ORDER BY"> <dynamic prepend="ORDER BY">
<isNotEmpty property="orderBy"> <isNotEmpty property="orderBy">
$orderBy$ $orderBy$
...@@ -187,11 +184,19 @@ ...@@ -187,11 +184,19 @@
ID asc ID asc
</isEmpty> </isEmpty>
</dynamic> </dynamic>
</sql>
<select id="query" resultClass="com.baosight.hggp.hg.cg.domain.HGCG002B">
SELECT
<include refid="column"/>
FROM ${hggpSchema}.HGCG002A WHERE 1=1
<include refid="condition"/>
<include refid="orderBy"/>
</select> </select>
<select id="count" resultClass="int"> <select id="count" resultClass="int">
SELECT COUNT(*) FROM ${hggpSchema}.HGCG002A WHERE 1=1 SELECT COUNT(*) FROM ${hggpSchema}.HGCG002A WHERE 1=1
<include refid="condition" /> <include refid="condition"/>
</select> </select>
<insert id="insert"> <insert id="insert">
...@@ -292,7 +297,6 @@ ...@@ -292,7 +297,6 @@
<include refid="idCondition"/> <include refid="idCondition"/>
</update> </update>
<select id="queryByReceive" resultClass="com.baosight.hggp.hg.cg.domain.HGCG002B"> <select id="queryByReceive" resultClass="com.baosight.hggp.hg.cg.domain.HGCG002B">
SELECT SELECT
a.ID as "id", a.ID as "id",
......
...@@ -268,7 +268,7 @@ public class ServiceHGCW010 extends ServiceBase { ...@@ -268,7 +268,7 @@ public class ServiceHGCW010 extends ServiceBase {
} }
catch (Exception e) { catch (Exception e) {
LogUtils.setMsg(inInfo, e, "生成收款单失败"); LogUtils.setMsg(inInfo, e, "生成销售开票失败");
} }
return inInfo; return inInfo;
} }
......
...@@ -786,7 +786,7 @@ public class HGCWTools { ...@@ -786,7 +786,7 @@ public class HGCWTools {
List<HGCW011> results = DaoBase.getInstance().query(HGCW011.QUERY,new HashMap<String,Object>(){ List<HGCW011> results = DaoBase.getInstance().query(HGCW011.QUERY,new HashMap<String,Object>(){
{put("settlementNumbers",settlementNumber);} {put("settlementNumbers",settlementNumber);}
}); });
AssertUtils.isEmpty(results, "找不到对应的销售开票记录!"); //AssertUtils.isEmpty(results, "找不到对应的销售开票记录!");
BigDecimal totalAmount = new BigDecimal("0"); BigDecimal totalAmount = new BigDecimal("0");
for (HGCW011 hgcw011: results) { for (HGCW011 hgcw011: results) {
totalAmount = totalAmount.add(hgcw011.getTotalContractPriceIncluding()); totalAmount = totalAmount.add(hgcw011.getTotalContractPriceIncluding());
......
...@@ -12,6 +12,8 @@ import com.baosight.hggp.hg.kc.domain.HGKC001; ...@@ -12,6 +12,8 @@ import com.baosight.hggp.hg.kc.domain.HGKC001;
import com.baosight.hggp.hg.kc.domain.HGKC003; import com.baosight.hggp.hg.kc.domain.HGKC003;
import com.baosight.hggp.hg.kc.tools.HGKCTools; import com.baosight.hggp.hg.kc.tools.HGKCTools;
import com.baosight.hggp.hg.kc.utils.HGKCUtils; import com.baosight.hggp.hg.kc.utils.HGKCUtils;
import com.baosight.hggp.hg.pz.domain.HGPZ007;
import com.baosight.hggp.hg.pz.tools.HGPZTools;
import com.baosight.hggp.hg.xs.domain.Company; import com.baosight.hggp.hg.xs.domain.Company;
import com.baosight.hggp.util.*; import com.baosight.hggp.util.*;
import com.baosight.iplat4j.core.ei.EiBlock; import com.baosight.iplat4j.core.ei.EiBlock;
...@@ -24,6 +26,8 @@ import com.baosight.iplat4j.core.service.impl.ServiceBase; ...@@ -24,6 +26,8 @@ import com.baosight.iplat4j.core.service.impl.ServiceBase;
import java.util.Arrays; import java.util.Arrays;
import java.util.List; import java.util.List;
import java.util.Map; import java.util.Map;
import java.util.Objects;
import java.util.stream.Collectors;
/** /**
* @author:songx * @author:songx
...@@ -123,7 +127,13 @@ public class ServiceHGKC001 extends ServiceBase { ...@@ -123,7 +127,13 @@ public class ServiceHGKC001 extends ServiceBase {
* @param dbCg004Map * @param dbCg004Map
*/ */
private void saveData(List<HGKC001> fCg004s, Map<String, HGKC001> dbCg004Map) { private void saveData(List<HGKC001> fCg004s, Map<String, HGKC001> dbCg004Map) {
List<String> whCodeList = fCg004s.stream().map(HGKC001::getWhCode).collect(Collectors.toList());
Map<String, HGPZ007> whMap = HGPZTools.HgPz007.map(whCodeList);
for (HGKC001 fCg004 : fCg004s) { for (HGKC001 fCg004 : fCg004s) {
HGPZ007 wh = whMap.get(fCg004.getWhCode());
if(Objects.nonNull(wh)){
fCg004.setWhName(wh.getWhName());
}
DaoUtils.update(HGKC001.UPDATE_WH_CODE, fCg004); DaoUtils.update(HGKC001.UPDATE_WH_CODE, fCg004);
} }
} }
......
...@@ -139,7 +139,7 @@ public class ServiceHGPZ009 extends ServiceBase { ...@@ -139,7 +139,7 @@ public class ServiceHGPZ009 extends ServiceBase {
// 默认新增企业管理员账号 // 默认新增企业管理员账号
String userId = fPz009.getLoginPrefix() + "0000"; String userId = fPz009.getLoginPrefix() + "0000";
HGXSTools.XsUser.addUser(fPz009.getAccountCode(), userId, fPz009.getAccountName(), HGXSTools.XsUser.addUser(fPz009.getAccountCode(), userId, fPz009.getAccountName(),
null, null, null); null, null, null, "1");
// 关联企业管理员角色 // 关联企业管理员角色
this.insertGroupMember(fPz009, userId); this.insertGroupMember(fPz009, userId);
// 新增组织机构顶级 // 新增组织机构顶级
......
...@@ -21,11 +21,11 @@ import com.baosight.hggp.util.EiInfoUtils; ...@@ -21,11 +21,11 @@ import com.baosight.hggp.util.EiInfoUtils;
import com.baosight.hggp.util.LogUtils; import com.baosight.hggp.util.LogUtils;
import com.baosight.hggp.util.MapUtils; import com.baosight.hggp.util.MapUtils;
import com.baosight.hggp.util.ObjectUtils; import com.baosight.hggp.util.ObjectUtils;
import com.baosight.hggp.util.StringUtils;
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 org.apache.commons.collections.CollectionUtils; import org.apache.commons.collections.CollectionUtils;
import org.apache.commons.lang.StringUtils;
import java.io.IOException; import java.io.IOException;
import java.util.ArrayList; import java.util.ArrayList;
...@@ -190,7 +190,9 @@ public class ServiceHGXSUser extends ServiceBase { ...@@ -190,7 +190,9 @@ public class ServiceHGXSUser extends ServiceBase {
Map queryMap = EiInfoUtils.getFirstRow(inInfo); Map queryMap = EiInfoUtils.getFirstRow(inInfo);
HGPZ009 dbPz009 = HGPZTools.HgPz009.getByCode(MapUtils.getString(queryMap, HGPZ009.FIELD_ACCOUNT_CODE)); HGPZ009 dbPz009 = HGPZTools.HgPz009.getByCode(MapUtils.getString(queryMap, HGPZ009.FIELD_ACCOUNT_CODE));
Integer ord = MapUtils.getInteger(queryMap, "ord"); Integer ord = MapUtils.getInteger(queryMap, "ord");
syncDcUserSingle(dbPz009, ord); DcUserList dcUserList = new DcUserList();
dcUserList.setOrd(ord);
syncDcUserSingle(dbPz009, dcUserList);
inInfo.setStatus(EiConstant.STATUS_SUCCESS); inInfo.setStatus(EiConstant.STATUS_SUCCESS);
inInfo.setMsg("同步德诚用户信息成功"); inInfo.setMsg("同步德诚用户信息成功");
} catch (Exception e) { } catch (Exception e) {
...@@ -259,7 +261,7 @@ public class ServiceHGXSUser extends ServiceBase { ...@@ -259,7 +261,7 @@ public class ServiceHGXSUser extends ServiceBase {
HGPZ009 dbPz009 = HGPZTools.HgPz009.getByCode(accountCode); HGPZ009 dbPz009 = HGPZTools.HgPz009.getByCode(accountCode);
for (DcUserList dcUserList : dcUserLists) { for (DcUserList dcUserList : dcUserLists) {
try { try {
syncDcUserSingle(dbPz009, dcUserList.getOrd()); syncDcUserSingle(dbPz009, dcUserList);
} catch (Exception e) { } catch (Exception e) {
log.error("同步德诚用户失败:{}", e.getMessage(), e); log.error("同步德诚用户失败:{}", e.getMessage(), e);
} }
...@@ -270,40 +272,42 @@ public class ServiceHGXSUser extends ServiceBase { ...@@ -270,40 +272,42 @@ public class ServiceHGXSUser extends ServiceBase {
* 同步单个用户 * 同步单个用户
* *
* @param dbPz009 * @param dbPz009
* @param ord * @param dcUserList
* @throws IOException * @throws IOException
*/ */
private void syncDcUserSingle(HGPZ009 dbPz009, Integer ord) throws Exception { private void syncDcUserSingle(HGPZ009 dbPz009, DcUserList dcUserList) throws Exception {
// 获取用户详情 // 获取用户详情
DcUser zbUser = DcOpenApi.userDetail(ord); DcUser dcUser = DcOpenApi.userDetail(dcUserList.getOrd());
if (zbUser == null) { if (dcUser == null || StringUtils.isBlank(dcUser.getYgid())) {
return; return;
} }
String userId = dbPz009.getLoginPrefix() + ord;
// 判断用户是否存在 // 判断用户是否存在
User dbUser = HGXSTools.XsUser.getByLogin(userId); User dbUser = HGXSTools.XsUser.getByLogin(dcUser.getYgid());
if (dbUser == null) { if (dbUser == null) {
this.syncDcSingleUserAdd(zbUser, dbPz009, userId); this.syncDcSingleUserAdd(dcUserList, dcUser, dbPz009);
} else { } else {
this.syncDcSingleUserModify(zbUser, userId); this.syncDcSingleUserModify(dcUserList, dcUser);
} }
} }
/** /**
* 新增用户 * 新增用户
* *
* @param zbUser * @param dcUserList
* @param dcUser
* @param dbPz009 * @param dbPz009
* @param userId
* @throws Exception * @throws Exception
*/ */
private void syncDcSingleUserAdd(DcUser zbUser, HGPZ009 dbPz009, String userId) throws Exception { private void syncDcSingleUserAdd(DcUserList dcUserList, DcUser dcUser, HGPZ009 dbPz009) throws Exception {
String userId = dcUser.getYgid();
// -1:冻结用户,1:正常
String isLock = HGXSUtils.XsUser.convertIsLock(dcUserList.getStatus());
// 新增用户 // 新增用户
HGXSTools.XsUser.addUser(dbPz009.getAccountCode(), userId, zbUser.getName(), zbUser.getSex(), zbUser.getEmail(), HGXSTools.XsUser.addUser(dbPz009.getAccountCode(), userId, dcUser.getName(), dcUser.getSex(), dcUser.getEmail(),
zbUser.getCardid()); dcUser.getCardid(), isLock);
// 新增用户和组织机构关系 // 新增用户和组织机构关系
Map addMap = new HashMap(); Map addMap = new HashMap();
addMap.put("orgId", dbPz009.getLoginPrefix() + zbUser.getOrgsid()); addMap.put("orgId", dbPz009.getLoginPrefix() + dcUser.getOrgsid());
addMap.put("userId", userId); addMap.put("userId", userId);
addMap.put("recCreator", "System"); addMap.put("recCreator", "System");
addMap.put("recCreateTime", DateUtils.shortDateTime()); addMap.put("recCreateTime", DateUtils.shortDateTime());
...@@ -311,17 +315,20 @@ public class ServiceHGXSUser extends ServiceBase { ...@@ -311,17 +315,20 @@ public class ServiceHGXSUser extends ServiceBase {
} }
/** /**
* @param zbUser * @param dcUserList
* @param userId * @param dcUser
*/ */
private void syncDcSingleUserModify(DcUser zbUser, String userId) { private void syncDcSingleUserModify(DcUserList dcUserList, DcUser dcUser) {
Map updateMap = new HashMap(); Map updateMap = new HashMap();
updateMap.put(User.FIELD_LOGIN_NAME, userId); updateMap.put(User.FIELD_LOGIN_NAME, dcUser.getYgid());
updateMap.put(User.FIELD_USER_NAME, zbUser.getName()); updateMap.put(User.FIELD_USER_NAME, dcUser.getName());
updateMap.put(User.FIELD_GENDER, HGXSUtils.XsUser.convertGender(zbUser.getSex())); updateMap.put(User.FIELD_GENDER, HGXSUtils.XsUser.convertGender(dcUser.getSex()));
updateMap.put(User.FIELD_EMAIL, zbUser.getEmail()); updateMap.put(User.FIELD_EMAIL, dcUser.getEmail());
updateMap.put(User.FIELD_MOBILE, zbUser.getMobile()); updateMap.put(User.FIELD_MOBILE, dcUser.getMobile());
updateMap.put(User.FIELD_ID_CARD, zbUser.getCardid() == null ? " " : zbUser.getCardid()); updateMap.put(User.FIELD_ID_CARD, dcUser.getCardid() == null ? " " : dcUser.getCardid());
// -1:冻结用户,1:正常
String isLock = HGXSUtils.XsUser.convertIsLock(dcUserList.getStatus());
updateMap.put(User.FIELD_IS_LOCKED, isLock);
updateMap.put(User.FIELD_REC_REVISOR, "System"); updateMap.put(User.FIELD_REC_REVISOR, "System");
updateMap.put(User.FIELD_REC_REVISE_TIME, DateUtils.shortDateTime()); updateMap.put(User.FIELD_REC_REVISE_TIME, DateUtils.shortDateTime());
dao.update(HgXsSqlConstant.HgXsUser.UPDATE_DC_USER, updateMap); dao.update(HgXsSqlConstant.HgXsUser.UPDATE_DC_USER, updateMap);
......
...@@ -123,6 +123,7 @@ ...@@ -123,6 +123,7 @@
MOBILE = #mobile#, MOBILE = #mobile#,
EMAIL = #email#, EMAIL = #email#,
ID_CARD = #idCard#, ID_CARD = #idCard#,
IS_LOCKED = #isLocked#,
REC_REVISOR = #recRevisor#, REC_REVISOR = #recRevisor#,
REC_REVISE_TIME = #recReviseTime# REC_REVISE_TIME = #recReviseTime#
WHERE LOGIN_NAME = #loginName# WHERE LOGIN_NAME = #loginName#
......
...@@ -206,9 +206,11 @@ public class HGXSTools { ...@@ -206,9 +206,11 @@ public class HGXSTools {
* @param userName * @param userName
* @param gender * @param gender
* @param mobile * @param mobile
* @param idCard
* @param isLock
*/ */
public static void addUser(String accountCode, String userId, String userName, String gender, String mobile, public static void addUser(String accountCode, String userId, String userName, String gender, String mobile,
String idCard) throws Exception { String idCard, String isLock) throws Exception {
Map inInfoRowMap = new HashMap(); Map inInfoRowMap = new HashMap();
inInfoRowMap.put("userId", userId); inInfoRowMap.put("userId", userId);
inInfoRowMap.put("loginName", userId); inInfoRowMap.put("loginName", userId);
......
...@@ -48,6 +48,16 @@ public class HGXSUtils { ...@@ -48,6 +48,16 @@ public class HGXSUtils {
} }
} }
/**
* 转换锁定状态
*
* @param status
* @return
*/
public static String convertIsLock(String status) {
// -1:冻结用户,1:正常
return "冻结".equals(status) ? "-1" : "1";
}
} }
/** /**
......
package com.baosight.xservices.xs.service; package com.baosight.xservices.xs.service;
import com.baosight.hggp.core.security.UserSessionUtils; import com.baosight.hggp.core.security.UserSessionUtils;
import com.baosight.hggp.hg.sc.util.HGSCUtil;
import com.baosight.hggp.util.AssertUtils; import com.baosight.hggp.util.AssertUtils;
import com.baosight.hggp.util.ObjectUtils; import com.baosight.hggp.util.ObjectUtils;
import com.baosight.iplat4j.core.ei.EiBlock; import com.baosight.iplat4j.core.ei.EiBlock;
...@@ -105,11 +104,12 @@ public class ServiceXS0102 extends ServiceEPBase implements LoginConstants { ...@@ -105,11 +104,12 @@ public class ServiceXS0102 extends ServiceEPBase implements LoginConstants {
} }
} }
String userGroupEname = (String) inInfoRowMap.get("groupName"); String userGroupEname = (String) inInfoRowMap.get("groupName");
String isLocked = (String) inInfoRowMap.get("isLocked");
inInfoRowMap.put("userGroupEname", userGroupEname); inInfoRowMap.put("userGroupEname", userGroupEname);
inInfoRowMap.put("password", password); inInfoRowMap.put("password", password);
inInfoRowMap.put("rePass", rePass); inInfoRowMap.put("rePass", rePass);
inInfoRowMap.put("status", "1"); inInfoRowMap.put("status", "1");
inInfoRowMap.put("isLocked", "1"); inInfoRowMap.put("isLocked", StringUtils.isBlank(isLocked) ? "1" : isLocked);
inInfoRowMap.put("recCreator", UserSession.getUser().getUsername()); inInfoRowMap.put("recCreator", UserSession.getUser().getUsername());
inInfoRowMap.put("recCreateTime", DateUtils.curDateTimeStr14()); inInfoRowMap.put("recCreateTime", DateUtils.curDateTimeStr14());
String accountExpireDays = StringUtils.defaultIfEmpty( String accountExpireDays = StringUtils.defaultIfEmpty(
......
...@@ -9,22 +9,23 @@ $(function () { ...@@ -9,22 +9,23 @@ $(function () {
pageSize: 20, pageSize: 20,
pageSizes: [20, 50, 70, 100], pageSizes: [20, 50, 70, 100],
}, },
columns: [ columns: [{
{
field: "operator", field: "operator",
title: "操作", title: "操作",
width: 120,
template: function (item) { template: function (item) {
let template = ''; let template = '';
if (!isBlank(item.id)){ if (!isBlank(item.id)) {
template += '<a style="cursor: pointer;display: inline-flex;justify-content: center;margin:auto 5px" ' template += '<a style="cursor: pointer;display: inline-flex;justify-content: center;margin:auto 5px" '
+ 'onclick="showDetail(' + item.id + ', ' + item.status + ',0, ' + item.source + ')" >详情</a>'; + 'onclick="showDetail(' + item.id + ', ' + item.status + ',0, ' + item.source
+ ')" >详情</a>';
} }
if (!isBlank(item.id)){ if (!isBlank(item.id)) {
//审核通过的,可以进行合同变更 //审核通过的,可以进行合同变更
if(item.status == 2) if (item.status == 2) {
template += '<a style="cursor: pointer;display: inline-flex;justify-content: center;margin:auto 5px" ' template += '<a style="cursor: pointer;display: inline-flex;justify-content: center;margin:auto 5px" '
+ 'onclick="showDetail(' + item.id + ', ' + item.status + ', 1, ' + item.source + ')" >合同变更</a>'; + 'onclick="showDetail(' + item.id + ', ' + item.status + ', 1, '
+ item.source + ')" >合同变更</a>';
}
} }
return template; return template;
} }
...@@ -49,7 +50,7 @@ $(function () { ...@@ -49,7 +50,7 @@ $(function () {
return projCodeBox[i]['valueField']; return projCodeBox[i]['valueField'];
} }
} }
return dataItem["projCode"]; return dataItem["projCode"] == null ? "" : dataItem["projCode"];
}, },
editor: function (container, options) { editor: function (container, options) {
let inInfo = new EiInfo(); let inInfo = new EiInfo();
......
...@@ -39,7 +39,7 @@ ...@@ -39,7 +39,7 @@
<EF:EFRegion id="result" title="明细信息"> <EF:EFRegion id="result" title="明细信息">
<EF:EFGrid blockId="result" autoDraw="override" isFloat="true" checkMode="row" height="65vh"> <EF:EFGrid blockId="result" autoDraw="override" isFloat="true" checkMode="row" height="65vh">
<EF:EFColumn ename="id" cname="内码" hidden="true"/> <EF:EFColumn ename="id" cname="内码" hidden="true"/>
<EF:EFColumn ename="operator" cname="操作" locked="true" enable="false" width="80" align="center"/> <EF:EFColumn ename="operator" cname="操作" locked="true" enable="false" width="110" align="center"/>
<EF:EFComboColumn ename="source" cname="数据来源" enable="false" width="80" align="center" defaultValue="1"> <EF:EFComboColumn ename="source" cname="数据来源" enable="false" width="80" align="center" defaultValue="1">
<EF:EFCodeOption codeName="hggp.hpcg.receiveSource"/> <EF:EFCodeOption codeName="hggp.hpcg.receiveSource"/>
</EF:EFComboColumn> </EF:EFComboColumn>
...@@ -50,8 +50,8 @@ ...@@ -50,8 +50,8 @@
align="center" filter="contains" sort="true"> align="center" filter="contains" sort="true">
<EF:EFOptions blockId="roleCompany" textField="companyName" valueField="companyCode"/> <EF:EFOptions blockId="roleCompany" textField="companyName" valueField="companyCode"/>
</EF:EFComboColumn> </EF:EFComboColumn>
<EF:EFColumn ename="companyName" cname="公司名称" width="120" enable="false" readonly="true" align="center"/> <EF:EFColumn ename="companyName" cname="公司名称" width="200" enable="false" readonly="true" align="center"/>
<EF:EFColumn ename="projCode" cname="项目编码" width="100" align="center" required="true"/> <EF:EFColumn ename="projCode" cname="项目编码" width="140" align="center" required="true"/>
<EF:EFColumn ename="projName" cname="项目名称" enable="false" width="130" align="center"/> <EF:EFColumn ename="projName" cname="项目名称" enable="false" width="130" align="center"/>
<EF:EFColumn ename="contractDate" cname="合同日期" width="100" align="center" editType="date" <EF:EFColumn ename="contractDate" cname="合同日期" width="100" align="center" editType="date"
dateFormat="yyyy-MM-dd" parseFormats="['yyyyMMdd']" required="true"/> dateFormat="yyyy-MM-dd" parseFormats="['yyyyMMdd']" required="true"/>
......
...@@ -38,6 +38,7 @@ $(function () { ...@@ -38,6 +38,7 @@ $(function () {
loadComplete: function (grid) { loadComplete: function (grid) {
// 确认 // 确认
$("#CONFIRM").on("click", confirm); $("#CONFIRM").on("click", confirm);
// change事件 // change事件
grid.dataSource.bind("change", function (e) { grid.dataSource.bind("change", function (e) {
supCodeChange(e); supCodeChange(e);
...@@ -59,8 +60,7 @@ $(function () { ...@@ -59,8 +60,7 @@ $(function () {
// 查询 // 查询
$("#QUERY").on("click", query); $("#QUERY").on("click", query);
// 选择收货 $("#BTN_SUBMIT").on("click",batchUpdateSubmitStatus);
$("#SELECT_RECEIVE").on("click", selectReceive);
downKeyUp(); downKeyUp();
}); });
...@@ -229,3 +229,25 @@ function updateSubmitStatus(id) { ...@@ -229,3 +229,25 @@ function updateSubmitStatus(id) {
}); });
} }
/**
* 保存
*/
let batchUpdateSubmitStatus = function () {
let rows = resultGrid.getCheckedRows();
if (rows.length < 1) {
message("请选择数据");
return;
}
for (let i = 0; i < rows.length; i++) {
if (rows[i]['submitStatus'] != 0) {
message("勾选的第" + (i + 1) + "行提交状态不是未提交");
return;
}
}
JSUtils.confirm("确定对勾选中的[" + rows.length + "]条数据做\"提交\"操作? ", {
ok: function () {
JSUtils.submitGridsData("result", "HGKC001", "updateSubmitStatus", true);
}
});
}
...@@ -254,7 +254,7 @@ $(function () { ...@@ -254,7 +254,7 @@ $(function () {
IPLAT.NotificationUtil(ei.getMsg(), "success") IPLAT.NotificationUtil(ei.getMsg(), "success")
$("#deleteOrgWindow").data("kendoWindow").close(); $("#deleteOrgWindow").data("kendoWindow").close();
const tree = $('#categoryTree').data('kendoTreeView'); const tree = $('#categoryTree').data('kendoTreeView');
const parentId = $("#inqu_status3-0-orgParentId").val(); const parentId = $("#inqu_status-0-orgParentId").val();
// 刷新树节点 // 刷新树节点
tree.reload(parentId); tree.reload(parentId);
// 展开树 // 展开树
...@@ -322,7 +322,6 @@ $(function () { ...@@ -322,7 +322,6 @@ $(function () {
callbackName: addCallback callbackName: addCallback
}); });
}*/ }*/
}) })
$("#categoryTree").mousedown(function (e) { $("#categoryTree").mousedown(function (e) {
...@@ -511,9 +510,9 @@ let query = function () { ...@@ -511,9 +510,9 @@ let query = function () {
/** /**
* 新增组织机构回调 * 新增组织机构回调
*/ */
let addCallback = function (parentOrgId) { let addCallback = function (parentId) {
// 回填父级ID // 回填父级ID
$("#inqu_status2-0-parentId").val(parentOrgId); $("#inqu_status-0-orgParentId").val(parentId);
refreshTree(); refreshTree();
} }
...@@ -522,7 +521,7 @@ let addCallback = function (parentOrgId) { ...@@ -522,7 +521,7 @@ let addCallback = function (parentOrgId) {
*/ */
let editCallback = function (parentOrgId) { let editCallback = function (parentOrgId) {
// 回填父级ID // 回填父级ID
$("#inqu_status2-0-parentId").val(parentOrgId); //$("#inqu_status-0-orgParentId").val(parentOrgId);
refreshTree(); refreshTree();
} }
...@@ -549,7 +548,7 @@ let refreshTree = function () { ...@@ -549,7 +548,7 @@ let refreshTree = function () {
} }
// 刷新树节点 // 刷新树节点
const tree = $("#categoryTree").data("kendoTreeView"); const tree = $("#categoryTree").data("kendoTreeView");
const treeOrgId = $("#inqu_status2-0-parentId").val() const treeOrgId = $("#inqu_status-0-orgParentId").val()
tree.reload(treeOrgId) tree.reload(treeOrgId)
expandTreeNode(tree, treeOrgId) expandTreeNode(tree, treeOrgId)
// tree.expandPath(treeOrgId) // tree.expandPath(treeOrgId)
...@@ -834,6 +833,11 @@ function uploadFile() { ...@@ -834,6 +833,11 @@ function uploadFile() {
}); });
} }
/**
* 文件变更
* @param docId 文件标识
* @param bizId 业务标识
*/
function changeFile(docId,bizId) { function changeFile(docId,bizId) {
JSColorbox.open({ JSColorbox.open({
href: "HGWD099A?methodName=initLoad&inqu_status-0-bizType=WD" + href: "HGWD099A?methodName=initLoad&inqu_status-0-bizType=WD" +
...@@ -944,7 +948,7 @@ let showAuthButton = function () { ...@@ -944,7 +948,7 @@ let showAuthButton = function () {
} }
/** /**
* 文件上传 * 变更记录
*/ */
function changeResord() { function changeResord() {
let leafType = IPLATUI.EFTree.categoryTree.selectTreeNode.leafLevel; let leafType = IPLATUI.EFTree.categoryTree.selectTreeNode.leafLevel;
......
...@@ -66,14 +66,14 @@ ...@@ -66,14 +66,14 @@
<EF:EFRegion id="result" title="附件详情" fitHeight="true"> <EF:EFRegion id="result" title="附件详情" fitHeight="true">
<EF:EFGrid blockId="result" autoDraw="no" personal="true" serviceName="HGWD099" queryMethod="query" deleteMethod="delete"> <EF:EFGrid blockId="result" autoDraw="no" personal="true" serviceName="HGWD099" queryMethod="query" deleteMethod="delete">
<EF:EFColumn ename="id" cname="ID" hidden="true"/> <EF:EFColumn ename="id" cname="ID" hidden="true"/>
<EF:EFColumn ename="docId" cname="文件ID" enable="false" width="150"/> <EF:EFColumn ename="docId" cname="文件ID" enable="false" width="180"/>
<EF:EFColumn ename="docName" cname="文件名称" enable="false" width="150"/> <EF:EFColumn ename="docName" cname="文件名称" enable="false" width="180"/>
<EF:EFComboColumn ename="status" cname="状态" enable="false" width="120" align="center" defaultValue="0" hidden="false"> <EF:EFComboColumn ename="status" cname="状态" enable="false" width="100" align="center" defaultValue="0" hidden="false">
<EF:EFCodeOption codeName="hggp.hgwd.status"/> <EF:EFCodeOption codeName="hggp.hgwd.status"/>
</EF:EFComboColumn> </EF:EFComboColumn>
<EF:EFColumn ename="createdTime" cname="创建时间" enable="false" width="140" align="center" <EF:EFColumn ename="createdTime" cname="创建时间" enable="false" width="140" align="center"
parseFormats="['yyyyMMddHHmmss']" editType="datetime" dateFormat="yyyy-MM-dd HH:mm:ss"/> parseFormats="['yyyyMMddHHmmss']" editType="datetime" dateFormat="yyyy-MM-dd HH:mm:ss"/>
<EF:EFColumn ename="operator" cname="操作" enable="false" width="200" align="center"/> <EF:EFColumn ename="operator" cname="操作" enable="false" width="140" align="center"/>
</EF:EFGrid> </EF:EFGrid>
</EF:EFRegion> </EF:EFRegion>
</div> </div>
......
...@@ -181,8 +181,8 @@ let save = function (btnNode) { ...@@ -181,8 +181,8 @@ let save = function (btnNode) {
function (e) { function (e) {
var status = e.status; var status = e.status;
if (status !== -1) { if (status !== -1) {
let parentOrgId = $("#inqu_status-0-parentOrgId").val(); let parentId = $("#inqu_status-0-parentId").val();
parent.JSColorbox.setValueCallback(parentOrgId); parent.JSColorbox.setValueCallback(parentId);
} }
}); });
btnNode.attr("disabled", false); btnNode.attr("disabled", false);
......
...@@ -149,8 +149,8 @@ let save = function (btnNode) { ...@@ -149,8 +149,8 @@ let save = function (btnNode) {
function (e) { function (e) {
var status = e.status; var status = e.status;
if (status !== -1) { if (status !== -1) {
let parentOrgId = $("#inqu_status-0-parentOrgId").val(); let fileId = $("#inqu_status-0-fileId").val();
parent.JSColorbox.setValueCallback(parentOrgId); parent.JSColorbox.setValueCallback(fileId);
} }
} }
); );
......
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