1.同步境内账户明细所属部门一对多、客户属性、币种不是人民币(值为10)部门同步成国际部(1412)

2.同步票据收款明细时部门一对多、客户属性
master
钱涛 4 days ago
parent a5e30b3f37
commit 468c61442f

@ -1,5 +1,6 @@
package com.engine.salary.mapper.cbs;
import com.engine.salary.remote.cbs8.po.DepartmentPO;
import com.engine.salary.remote.cbs8.po.UfHkrdzbPO;
import java.util.List;
@ -12,46 +13,11 @@ public interface UfHkrdzbMapper {
* @return List
*/
List<UfHkrdzbPO> listAll();
/**
*
*
* @return List
*/
List<UfHkrdzbPO> listSome(UfHkrdzbPO ufHkrdzb);
/**
*
*
* @param id
* @return null
*/
UfHkrdzbPO getById(Integer id);
/**
* null
*
* @param ufHkrdzb
* @return
*/
int insertIgnoreNull(UfHkrdzbPO ufHkrdzb);
/**
*
*
* @param ufHkrdzb
* @return
*/
int update(UfHkrdzbPO ufHkrdzb);
/**
* null
*
* @param ufHkrdzb
* @return
*/
int updateIgnoreNull(UfHkrdzbPO ufHkrdzb);
*
* @return
*/
List<DepartmentPO> listDepartment();
}

@ -17,9 +17,9 @@
<result column="bmbm" property="bmbm"/>
<result column="bmd" property="bmd"/>
<result column="bm" property="bm"/>
<result column="khsx" property="khsx"/>
<result column="modedatamodifier" property="modedatamodifier"/>
<result column="modedatamodifydatetime" property="modedatamodifydatetime"/>
<result column="departmentId" property="departmentId"/>
</resultMap>
<!-- 表字段 -->
@ -41,6 +41,7 @@
, t.bmbm
, t.bmd
, t.bm
, t.khsx
, t.modedatamodifier
, t.modedatamodifydatetime
</sql>
@ -49,274 +50,21 @@
<select id="listAll" resultMap="BaseResultMap">
SELECT
<include refid="baseColumns"/>
,d.id as departmentId
FROM uf_hkrdzb t
left join hrmdepartment d on t.bmbm = d.departmentcode
</select>
<!-- 根据主键获取单条记录 -->
<select id="getById" resultMap="BaseResultMap" parameterType="Integer">
SELECT
<include refid="baseColumns"/>
FROM uf_hkrdzb t
WHERE id = #{id}
</select>
<!-- 条件查询 -->
<select id="listSome" resultMap="BaseResultMap" parameterType="com.engine.salary.remote.cbs8.po.UfHkrdzbPO">
SELECT
<include refid="baseColumns"/>
FROM uf_hkrdzb t
WHERE 1=1
<if test="requestId != null">
AND requestId = #{requestId}
</if>
<if test="formmodeid != null">
AND formmodeid = #{formmodeid}
</if>
<if test="modedatacreater != null">
AND modedatacreater = #{modedatacreater}
</if>
<if test="modedatacreatertype != null">
AND modedatacreatertype = #{modedatacreatertype}
</if>
<if test="modedatacreatedate != null">
AND modedatacreatedate = #{modedatacreatedate}
</if>
<if test="modedatacreatetime != null">
AND modedatacreatetime = #{modedatacreatetime}
</if>
<if test="modeuuid != null">
AND MODEUUID = #{modeuuid}
</if>
<if test="formBizId != null">
AND form_biz_id = #{formBizId}
</if>
<if test="gsbm != null">
AND gsbm = #{gsbm}
</if>
<if test="khbm != null">
AND khbm = #{khbm}
</if>
<if test="khmc != null">
AND khmc = #{khmc}
</if>
<if test="bmbm != null">
AND bmbm = #{bmbm}
</if>
<if test="bmd != null">
AND bmd = #{bmd}
</if>
<if test="bm != null">
AND bm = #{bm}
</if>
<if test="modedatamodifier != null">
AND modedatamodifier = #{modedatamodifier}
</if>
<if test="modedatamodifydatetime != null">
AND modedatamodifydatetime = #{modedatamodifydatetime}
</if>
<if test="ids != null and ids.size()>0">
AND id IN
<foreach collection="ids" open="(" item="id" separator="," close=")">
#{id}
</foreach>
</if>
ORDER BY id DESC
</select>
<!-- 插入不为NULL的字段 -->
<insert id="insertIgnoreNull" parameterType="com.engine.salary.remote.cbs8.po.UfHkrdzbPO">
INSERT INTO uf_hkrdzb
<trim prefix="(" suffix=")" suffixOverrides=",">
<if test="requestId != null">
requestId,
</if>
<if test="formmodeid != null">
formmodeid,
</if>
<if test="modedatacreater != null">
modedatacreater,
</if>
<if test="modedatacreatertype != null">
modedatacreatertype,
</if>
<if test="modedatacreatedate != null">
modedatacreatedate,
</if>
<if test="modedatacreatetime != null">
modedatacreatetime,
</if>
<if test="modeuuid != null">
MODEUUID,
</if>
<if test="formBizId != null">
form_biz_id,
</if>
<if test="gsbm != null">
gsbm,
</if>
<if test="khbm != null">
khbm,
</if>
<if test="khmc != null">
khmc,
</if>
<if test="bmbm != null">
bmbm,
</if>
<if test="bmd != null">
bmd,
</if>
<if test="bm != null">
bm,
</if>
<if test="modedatamodifier != null">
modedatamodifier,
</if>
<if test="modedatamodifydatetime != null">
modedatamodifydatetime,
</if>
</trim>
<trim prefix="VALUES (" suffix=")" suffixOverrides=",">
<if test="requestId != null">
#{requestId},
</if>
<if test="formmodeid != null">
#{formmodeid},
</if>
<if test="modedatacreater != null">
#{modedatacreater},
</if>
<if test="modedatacreatertype != null">
#{modedatacreatertype},
</if>
<if test="modedatacreatedate != null">
#{modedatacreatedate},
</if>
<if test="modedatacreatetime != null">
#{modedatacreatetime},
</if>
<if test="modeuuid != null">
#{modeuuid},
</if>
<if test="formBizId != null">
#{formBizId},
</if>
<if test="gsbm != null">
#{gsbm},
</if>
<if test="khbm != null">
#{khbm},
</if>
<if test="khmc != null">
#{khmc},
</if>
<if test="bmbm != null">
#{bmbm},
</if>
<if test="bmd != null">
#{bmd},
</if>
<if test="bm != null">
#{bm},
</if>
<if test="modedatamodifier != null">
#{modedatamodifier},
</if>
<if test="modedatamodifydatetime != null">
#{modedatamodifydatetime},
</if>
</trim>
</insert>
<!-- 更新,更新全部字段 -->
<update id="update" parameterType="com.engine.salary.remote.cbs8.po.UfHkrdzbPO">
UPDATE uf_hkrdzb
<set>
requestId=#{requestId},
formmodeid=#{formmodeid},
modedatacreater=#{modedatacreater},
modedatacreatertype=#{modedatacreatertype},
modedatacreatedate=#{modedatacreatedate},
modedatacreatetime=#{modedatacreatetime},
MODEUUID=#{modeuuid},
form_biz_id=#{formBizId},
gsbm=#{gsbm},
khbm=#{khbm},
khmc=#{khmc},
bmbm=#{bmbm},
bmd=#{bmd},
bm=#{bm},
modedatamodifier=#{modedatamodifier},
modedatamodifydatetime=#{modedatamodifydatetime},
</set>
WHERE id = #{id}
</update>
<!-- 更新不为NULL的字段 -->
<update id="updateIgnoreNull" parameterType="com.engine.salary.remote.cbs8.po.UfHkrdzbPO">
UPDATE uf_hkrdzb
<set>
<if test="requestId != null">
requestId=#{requestId},
</if>
<if test="formmodeid != null">
formmodeid=#{formmodeid},
</if>
<if test="modedatacreater != null">
modedatacreater=#{modedatacreater},
</if>
<if test="modedatacreatertype != null">
modedatacreatertype=#{modedatacreatertype},
</if>
<if test="modedatacreatedate != null">
modedatacreatedate=#{modedatacreatedate},
</if>
<if test="modedatacreatetime != null">
modedatacreatetime=#{modedatacreatetime},
</if>
<if test="modeuuid != null">
MODEUUID=#{modeuuid},
</if>
<if test="formBizId != null">
form_biz_id=#{formBizId},
</if>
<if test="gsbm != null">
gsbm=#{gsbm},
</if>
<if test="khbm != null">
khbm=#{khbm},
</if>
<if test="khmc != null">
khmc=#{khmc},
</if>
<if test="bmbm != null">
bmbm=#{bmbm},
</if>
<if test="bmd != null">
bmd=#{bmd},
</if>
<if test="bm != null">
bm=#{bm},
</if>
<if test="modedatamodifier != null">
modedatamodifier=#{modedatamodifier},
</if>
<if test="modedatamodifydatetime != null">
modedatamodifydatetime=#{modedatamodifydatetime},
</if>
</set>
WHERE id = #{id}
</update>
<resultMap id="DepartmentResultMap" type="com.engine.salary.remote.cbs8.po.DepartmentPO">
<result column="id" property="id"/>
<result column="name" property="name"/>
<result column="code" property="code"/>
</resultMap>
<select id="listDepartment" resultMap="DepartmentResultMap">
SELECT t.id,
t.departmentcode as code,
t.departmentname as name
FROM hrmdepartment t
</select>
</mapper>

@ -0,0 +1,22 @@
package com.engine.salary.remote.cbs8.po;
import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Data;
import lombok.NoArgsConstructor;
import java.util.Collection;
@Data
@Builder
@NoArgsConstructor
@AllArgsConstructor
public class DepartmentPO {
private String id;
private String name;
private String code;
}

@ -43,6 +43,8 @@ public class UfHkrdzbPO {
private Integer bm;
private Integer khsx;
private Integer modedatamodifier;
private String modedatamodifydatetime;
@ -50,6 +52,4 @@ public class UfHkrdzbPO {
private Collection<Long> ids;
private Integer departmentId;
}

@ -6,6 +6,7 @@ import com.engine.salary.mapper.SQLMapper;
import com.engine.salary.mapper.cbs.UfHkrdzbMapper;
import com.engine.salary.remote.cbs8.client.AccountManagementClient;
import com.engine.salary.remote.cbs8.config.EBS2ECConfig;
import com.engine.salary.remote.cbs8.po.DepartmentPO;
import com.engine.salary.remote.cbs8.po.UfHkrdzbPO;
import com.engine.salary.remote.cbs8.request.GetTransactionDetailRequest;
import com.engine.salary.remote.cbs8.response.GetTransactionDetailResponse;
@ -184,7 +185,9 @@ public class SyncCBSAccountDetailsJob extends BaseCronJob {
//获取汇款人与办事处的对照数据
List<UfHkrdzbPO> ufHkrdzbPOS = getUfHkrdzbMapper().listAll();
Map<String, Integer> customerDepartmentMap = SalaryEntityUtil.convert2Map(ufHkrdzbPOS, UfHkrdzbPO::getKhmc, UfHkrdzbPO::getDepartmentId);
Map<String, UfHkrdzbPO> customerDepartmentMap = SalaryEntityUtil.convert2Map(ufHkrdzbPOS, UfHkrdzbPO::getKhmc);
List<DepartmentPO> departmentPOS = getUfHkrdzbMapper().listDepartment();
Map<String, String> departmentMap = SalaryEntityUtil.convert2Map(departmentPOS, DepartmentPO::getCode, DepartmentPO::getId);
for (GetTransactionDetailResponse.Detail detail : list) {
Map<String, String> detailMap = JsonUtil.parseMap(detail, String.class);
@ -239,12 +242,15 @@ public class SyncCBSAccountDetailsJob extends BaseCronJob {
/*
*
*
*
*
*
*/
Integer departmentId = customerDepartmentMap.get(hkr);
if (departmentId != null) {
UfHkrdzbPO ufHkrdzbPO = customerDepartmentMap.get(hkr);
//币种不是人名币,国际部认领
String currency = detailMap.get("currency");
if (!"10".equals(currency)) {
//认领
fields.add("zt");
values.add(1);
@ -255,7 +261,43 @@ public class SyncCBSAccountDetailsJob extends BaseCronJob {
//办事处
fields.add("szbm");
values.add(String.format("'%s'", departmentId));
values.add(String.format("'%s'", "1412"));
if (ufHkrdzbPO != null && ufHkrdzbPO.getKhsx() != null) {
//客户属性
fields.add("khsx");
values.add(ufHkrdzbPO.getKhsx());
}
} else if (ufHkrdzbPO != null) {
//客户属性
Integer khsx = ufHkrdzbPO.getKhsx();
if (khsx != null) {
fields.add("khsx");
values.add(khsx);
}
String bmbms = ufHkrdzbPO.getBmbm();
if (StrUtil.isNotEmpty(bmbms)) {
//认领
fields.add("zt");
values.add(1);
//是否系统认领
fields.add("sfxtzdrl");
values.add(1);
//办事处
fields.add("szbm");
List<String> bmbmList = Arrays.stream(bmbms.split(",")).map(departmentMap::get).filter(StrUtil::isNotBlank).collect(Collectors.toList());
values.add(String.format("'%s'", String.join(",", bmbmList)));
} else {
//未认领
fields.add("zt");
values.add(0);
}
} else {
//未认领
fields.add("zt");

@ -6,6 +6,7 @@ import com.engine.salary.mapper.SQLMapper;
import com.engine.salary.mapper.cbs.UfHkrdzbMapper;
import com.engine.salary.remote.cbs8.client.BillManagementClient;
import com.engine.salary.remote.cbs8.config.EBS2ECConfig;
import com.engine.salary.remote.cbs8.po.DepartmentPO;
import com.engine.salary.remote.cbs8.po.UfHkrdzbPO;
import com.engine.salary.remote.cbs8.request.GetDtaRequest;
import com.engine.salary.remote.cbs8.response.GetDtaResponse;
@ -188,8 +189,8 @@ public class SyncCBSPayDetailsJob extends BaseCronJob {
requestParam.setDueDateStart(dueDateStart);
requestParam.setDueDateEnd(dueDateEnd);
requestParam.setBillType(billType);
requestParam.setDraftSourceList(draftSourceList==null ? null :Arrays.stream(draftSourceList.split(",")).collect(Collectors.toList()));
requestParam.setHoldBankTypeList(holdBankTypeList==null ? null :Arrays.stream(holdBankTypeList.split(",")).collect(Collectors.toList()));
requestParam.setDraftSourceList(draftSourceList == null ? null : Arrays.stream(draftSourceList.split(",")).collect(Collectors.toList()));
requestParam.setHoldBankTypeList(holdBankTypeList == null ? null : Arrays.stream(holdBankTypeList.split(",")).collect(Collectors.toList()));
requestParam.setIssueDateStart(issueDateStart);
requestParam.setIssueDateEnd(issueDateEnd);
requestParam.setDraftNbr(draftNbr);
@ -198,8 +199,8 @@ public class SyncCBSPayDetailsJob extends BaseCronJob {
requestParam.setBillAmountEnd(billAmountEnd);
requestParam.setSubBillIntervalStart(subBillIntervalStart);
requestParam.setSubBillIntervalEnd(subBillIntervalEnd);
requestParam.setBillStsList(billStsList==null ? null :Arrays.stream(billStsList.split(",")).collect(Collectors.toList()));
requestParam.setBillTrsStsList(billTrsStsList==null ? null :Arrays.stream(billTrsStsList.split(",")).collect(Collectors.toList()));
requestParam.setBillStsList(billStsList == null ? null : Arrays.stream(billStsList.split(",")).collect(Collectors.toList()));
requestParam.setBillTrsStsList(billTrsStsList == null ? null : Arrays.stream(billTrsStsList.split(",")).collect(Collectors.toList()));
requestParam.setStockFlag(stockFlag);
requestParam.setOutInvType(outInvType);
requestParam.setLockFlag(lockFlag);
@ -243,7 +244,9 @@ public class SyncCBSPayDetailsJob extends BaseCronJob {
//获取汇款人与办事处的对照数据
List<UfHkrdzbPO> ufHkrdzbPOS = getUfHkrdzbMapper().listAll();
Map<String, Integer> customerDepartmentMap = SalaryEntityUtil.convert2Map(ufHkrdzbPOS, UfHkrdzbPO::getKhmc, UfHkrdzbPO::getDepartmentId);
Map<String, UfHkrdzbPO> customerDepartmentMap = SalaryEntityUtil.convert2Map(ufHkrdzbPOS, UfHkrdzbPO::getKhmc);
List<DepartmentPO> departmentPOS = getUfHkrdzbMapper().listDepartment();
Map<String, String> departmentMap = SalaryEntityUtil.convert2Map(departmentPOS, DepartmentPO::getCode, DepartmentPO::getId);
for (GetDtaResponse.Detail detail : list) {
@ -294,7 +297,7 @@ public class SyncCBSPayDetailsJob extends BaseCronJob {
//业务逻辑字段,收款类型
fields.add("sklx");
//应收票据 0银承 1商承
values. add("AC01".equals(detail.getBillType()) ? 0 : 1);
values.add("AC01".equals(detail.getBillType()) ? 0 : 1);
/*
*
@ -302,20 +305,36 @@ public class SyncCBSPayDetailsJob extends BaseCronJob {
*
*
*/
Integer departmentId = customerDepartmentMap.get(hkr);
if(departmentId!=null){
//认领
fields.add("zt");
values.add(1);
//是否系统认领
fields.add("sfxtzdrl");
values.add(1);
UfHkrdzbPO ufHkrdzbPO = customerDepartmentMap.get(hkr);
if (ufHkrdzbPO != null) {
//客户属性
Integer khsx = ufHkrdzbPO.getKhsx();
if (khsx != null) {
fields.add("khsx");
values.add(khsx);
}
//办事处
fields.add("szbm");
values.add(String.format("'%s'", departmentId));
}else {
String bmbms = ufHkrdzbPO.getBmbm();
if (StrUtil.isNotEmpty(bmbms)) {
//认领
fields.add("zt");
values.add(1);
//是否系统认领
fields.add("sfxtzdrl");
values.add(1);
//办事处
fields.add("szbm");
List<String> bmbmList = Arrays.stream(bmbms.split(",")).map(departmentMap::get).filter(StrUtil::isNotBlank).collect(Collectors.toList());
values.add(String.format("'%s'", String.join(",", bmbmList)));
} else {
//未认领
fields.add("zt");
values.add(0);
}
} else {
//未认领
fields.add("zt");
values.add(0);

Loading…
Cancel
Save