1.同步境内账户明细所属部门一对多、客户属性、币种不是人民币(值为10)部门同步成国际部(1412)
2.同步票据收款明细时部门一对多、客户属性
This commit is contained in:
parent
a5e30b3f37
commit
468c61442f
|
|
@ -1,5 +1,6 @@
|
||||||
package com.engine.salary.mapper.cbs;
|
package com.engine.salary.mapper.cbs;
|
||||||
|
|
||||||
|
import com.engine.salary.remote.cbs8.po.DepartmentPO;
|
||||||
import com.engine.salary.remote.cbs8.po.UfHkrdzbPO;
|
import com.engine.salary.remote.cbs8.po.UfHkrdzbPO;
|
||||||
|
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
@ -13,45 +14,10 @@ public interface UfHkrdzbMapper {
|
||||||
*/
|
*/
|
||||||
List<UfHkrdzbPO> listAll();
|
List<UfHkrdzbPO> listAll();
|
||||||
|
|
||||||
/**
|
|
||||||
* 条件查询
|
|
||||||
*
|
|
||||||
* @return 返回集合,没有返回空List
|
|
||||||
*/
|
|
||||||
List<UfHkrdzbPO> listSome(UfHkrdzbPO ufHkrdzb);
|
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 根据主键查询
|
* 查询所有部门
|
||||||
*
|
* @return
|
||||||
* @param id 主键
|
*/
|
||||||
* @return 返回记录,没有返回null
|
List<DepartmentPO> listDepartment();
|
||||||
*/
|
|
||||||
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);
|
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
@ -17,9 +17,9 @@
|
||||||
<result column="bmbm" property="bmbm"/>
|
<result column="bmbm" property="bmbm"/>
|
||||||
<result column="bmd" property="bmd"/>
|
<result column="bmd" property="bmd"/>
|
||||||
<result column="bm" property="bm"/>
|
<result column="bm" property="bm"/>
|
||||||
|
<result column="khsx" property="khsx"/>
|
||||||
<result column="modedatamodifier" property="modedatamodifier"/>
|
<result column="modedatamodifier" property="modedatamodifier"/>
|
||||||
<result column="modedatamodifydatetime" property="modedatamodifydatetime"/>
|
<result column="modedatamodifydatetime" property="modedatamodifydatetime"/>
|
||||||
<result column="departmentId" property="departmentId"/>
|
|
||||||
</resultMap>
|
</resultMap>
|
||||||
|
|
||||||
<!-- 表字段 -->
|
<!-- 表字段 -->
|
||||||
|
|
@ -41,6 +41,7 @@
|
||||||
, t.bmbm
|
, t.bmbm
|
||||||
, t.bmd
|
, t.bmd
|
||||||
, t.bm
|
, t.bm
|
||||||
|
, t.khsx
|
||||||
, t.modedatamodifier
|
, t.modedatamodifier
|
||||||
, t.modedatamodifydatetime
|
, t.modedatamodifydatetime
|
||||||
</sql>
|
</sql>
|
||||||
|
|
@ -49,274 +50,21 @@
|
||||||
<select id="listAll" resultMap="BaseResultMap">
|
<select id="listAll" resultMap="BaseResultMap">
|
||||||
SELECT
|
SELECT
|
||||||
<include refid="baseColumns"/>
|
<include refid="baseColumns"/>
|
||||||
,d.id as departmentId
|
|
||||||
FROM uf_hkrdzb t
|
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>
|
</select>
|
||||||
|
|
||||||
|
|
||||||
<!-- 插入不为NULL的字段 -->
|
<resultMap id="DepartmentResultMap" type="com.engine.salary.remote.cbs8.po.DepartmentPO">
|
||||||
<insert id="insertIgnoreNull" parameterType="com.engine.salary.remote.cbs8.po.UfHkrdzbPO">
|
<result column="id" property="id"/>
|
||||||
INSERT INTO uf_hkrdzb
|
<result column="name" property="name"/>
|
||||||
<trim prefix="(" suffix=")" suffixOverrides=",">
|
<result column="code" property="code"/>
|
||||||
|
</resultMap>
|
||||||
<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>
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
<select id="listDepartment" resultMap="DepartmentResultMap">
|
||||||
|
SELECT t.id,
|
||||||
|
t.departmentcode as code,
|
||||||
|
t.departmentname as name
|
||||||
|
FROM hrmdepartment t
|
||||||
|
</select>
|
||||||
|
|
||||||
</mapper>
|
</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 bm;
|
||||||
|
|
||||||
|
private Integer khsx;
|
||||||
|
|
||||||
private Integer modedatamodifier;
|
private Integer modedatamodifier;
|
||||||
|
|
||||||
private String modedatamodifydatetime;
|
private String modedatamodifydatetime;
|
||||||
|
|
@ -50,6 +52,4 @@ public class UfHkrdzbPO {
|
||||||
|
|
||||||
private Collection<Long> ids;
|
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.mapper.cbs.UfHkrdzbMapper;
|
||||||
import com.engine.salary.remote.cbs8.client.AccountManagementClient;
|
import com.engine.salary.remote.cbs8.client.AccountManagementClient;
|
||||||
import com.engine.salary.remote.cbs8.config.EBS2ECConfig;
|
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.po.UfHkrdzbPO;
|
||||||
import com.engine.salary.remote.cbs8.request.GetTransactionDetailRequest;
|
import com.engine.salary.remote.cbs8.request.GetTransactionDetailRequest;
|
||||||
import com.engine.salary.remote.cbs8.response.GetTransactionDetailResponse;
|
import com.engine.salary.remote.cbs8.response.GetTransactionDetailResponse;
|
||||||
|
|
@ -184,7 +185,9 @@ public class SyncCBSAccountDetailsJob extends BaseCronJob {
|
||||||
|
|
||||||
//获取汇款人与办事处的对照数据
|
//获取汇款人与办事处的对照数据
|
||||||
List<UfHkrdzbPO> ufHkrdzbPOS = getUfHkrdzbMapper().listAll();
|
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) {
|
for (GetTransactionDetailResponse.Detail detail : list) {
|
||||||
Map<String, String> detailMap = JsonUtil.parseMap(detail, String.class);
|
Map<String, String> detailMap = JsonUtil.parseMap(detail, String.class);
|
||||||
|
|
@ -239,12 +242,15 @@ public class SyncCBSAccountDetailsJob extends BaseCronJob {
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* 认领逻辑,
|
* 认领逻辑,
|
||||||
|
* 如果币种不是人名币,认领部门是国际部
|
||||||
* 根据汇款人去表里匹配【汇款人与办事处的对照表】
|
* 根据汇款人去表里匹配【汇款人与办事处的对照表】
|
||||||
* 如果能匹配到数据,则状态改为已自动认领,同时把办事处(部门)的值同步到办事处字段中,是否系统自动认领同步为是;
|
* 如果能匹配到数据,则状态改为已自动认领,同时把办事处(部门)的值同步到办事处字段中,是否系统自动认领同步为是;
|
||||||
* 如对照标准无数据,则状态为:未认领;
|
* 如对照标准无数据,则状态为:未认领;
|
||||||
*/
|
*/
|
||||||
Integer departmentId = customerDepartmentMap.get(hkr);
|
UfHkrdzbPO ufHkrdzbPO = customerDepartmentMap.get(hkr);
|
||||||
if (departmentId != null) {
|
//币种不是人名币,国际部认领
|
||||||
|
String currency = detailMap.get("currency");
|
||||||
|
if (!"10".equals(currency)) {
|
||||||
//认领
|
//认领
|
||||||
fields.add("zt");
|
fields.add("zt");
|
||||||
values.add(1);
|
values.add(1);
|
||||||
|
|
@ -255,7 +261,43 @@ public class SyncCBSAccountDetailsJob extends BaseCronJob {
|
||||||
|
|
||||||
//办事处
|
//办事处
|
||||||
fields.add("szbm");
|
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 {
|
} else {
|
||||||
//未认领
|
//未认领
|
||||||
fields.add("zt");
|
fields.add("zt");
|
||||||
|
|
|
||||||
|
|
@ -6,6 +6,7 @@ import com.engine.salary.mapper.SQLMapper;
|
||||||
import com.engine.salary.mapper.cbs.UfHkrdzbMapper;
|
import com.engine.salary.mapper.cbs.UfHkrdzbMapper;
|
||||||
import com.engine.salary.remote.cbs8.client.BillManagementClient;
|
import com.engine.salary.remote.cbs8.client.BillManagementClient;
|
||||||
import com.engine.salary.remote.cbs8.config.EBS2ECConfig;
|
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.po.UfHkrdzbPO;
|
||||||
import com.engine.salary.remote.cbs8.request.GetDtaRequest;
|
import com.engine.salary.remote.cbs8.request.GetDtaRequest;
|
||||||
import com.engine.salary.remote.cbs8.response.GetDtaResponse;
|
import com.engine.salary.remote.cbs8.response.GetDtaResponse;
|
||||||
|
|
@ -188,8 +189,8 @@ public class SyncCBSPayDetailsJob extends BaseCronJob {
|
||||||
requestParam.setDueDateStart(dueDateStart);
|
requestParam.setDueDateStart(dueDateStart);
|
||||||
requestParam.setDueDateEnd(dueDateEnd);
|
requestParam.setDueDateEnd(dueDateEnd);
|
||||||
requestParam.setBillType(billType);
|
requestParam.setBillType(billType);
|
||||||
requestParam.setDraftSourceList(draftSourceList==null ? null :Arrays.stream(draftSourceList.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.setHoldBankTypeList(holdBankTypeList == null ? null : Arrays.stream(holdBankTypeList.split(",")).collect(Collectors.toList()));
|
||||||
requestParam.setIssueDateStart(issueDateStart);
|
requestParam.setIssueDateStart(issueDateStart);
|
||||||
requestParam.setIssueDateEnd(issueDateEnd);
|
requestParam.setIssueDateEnd(issueDateEnd);
|
||||||
requestParam.setDraftNbr(draftNbr);
|
requestParam.setDraftNbr(draftNbr);
|
||||||
|
|
@ -198,8 +199,8 @@ public class SyncCBSPayDetailsJob extends BaseCronJob {
|
||||||
requestParam.setBillAmountEnd(billAmountEnd);
|
requestParam.setBillAmountEnd(billAmountEnd);
|
||||||
requestParam.setSubBillIntervalStart(subBillIntervalStart);
|
requestParam.setSubBillIntervalStart(subBillIntervalStart);
|
||||||
requestParam.setSubBillIntervalEnd(subBillIntervalEnd);
|
requestParam.setSubBillIntervalEnd(subBillIntervalEnd);
|
||||||
requestParam.setBillStsList(billStsList==null ? null :Arrays.stream(billStsList.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.setBillTrsStsList(billTrsStsList == null ? null : Arrays.stream(billTrsStsList.split(",")).collect(Collectors.toList()));
|
||||||
requestParam.setStockFlag(stockFlag);
|
requestParam.setStockFlag(stockFlag);
|
||||||
requestParam.setOutInvType(outInvType);
|
requestParam.setOutInvType(outInvType);
|
||||||
requestParam.setLockFlag(lockFlag);
|
requestParam.setLockFlag(lockFlag);
|
||||||
|
|
@ -243,7 +244,9 @@ public class SyncCBSPayDetailsJob extends BaseCronJob {
|
||||||
|
|
||||||
//获取汇款人与办事处的对照数据
|
//获取汇款人与办事处的对照数据
|
||||||
List<UfHkrdzbPO> ufHkrdzbPOS = getUfHkrdzbMapper().listAll();
|
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) {
|
for (GetDtaResponse.Detail detail : list) {
|
||||||
|
|
@ -294,7 +297,7 @@ public class SyncCBSPayDetailsJob extends BaseCronJob {
|
||||||
//业务逻辑字段,收款类型
|
//业务逻辑字段,收款类型
|
||||||
fields.add("sklx");
|
fields.add("sklx");
|
||||||
//应收票据 0:银承 1:商承
|
//应收票据 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);
|
UfHkrdzbPO ufHkrdzbPO = customerDepartmentMap.get(hkr);
|
||||||
if(departmentId!=null){
|
if (ufHkrdzbPO != null) {
|
||||||
//认领
|
|
||||||
fields.add("zt");
|
|
||||||
values.add(1);
|
|
||||||
|
|
||||||
//是否系统认领
|
//客户属性
|
||||||
fields.add("sfxtzdrl");
|
Integer khsx = ufHkrdzbPO.getKhsx();
|
||||||
values.add(1);
|
if (khsx != null) {
|
||||||
|
fields.add("khsx");
|
||||||
|
values.add(khsx);
|
||||||
|
}
|
||||||
|
|
||||||
//办事处
|
String bmbms = ufHkrdzbPO.getBmbm();
|
||||||
fields.add("szbm");
|
if (StrUtil.isNotEmpty(bmbms)) {
|
||||||
values.add(String.format("'%s'", departmentId));
|
//认领
|
||||||
}else {
|
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");
|
fields.add("zt");
|
||||||
values.add(0);
|
values.add(0);
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue