汇款人与办事处逻辑
This commit is contained in:
parent
fb005a8139
commit
28b5ee71f6
|
|
@ -5,8 +5,8 @@
|
|||
<table name="境内账户明细" key="uf_jnzhmx" modeId="10">
|
||||
<field name="交易流水号" key="jylsh" ebsKey="transactionSerialNumber" unique="true"/>
|
||||
<field name="收款日期" key="skrq" ebsKey="bankTransactionDate"/>
|
||||
<field name="汇款人" key="hkr" ebsKey="oppositeName"/>
|
||||
<field name="对应客户" key="dykh" ebsKey="oppositeName"/>
|
||||
<field name="汇款人" key="hkr" ebsKey="unitName"/>
|
||||
<field name="对应客户" key="dykh" ebsKey="unitName"/>
|
||||
<field name="金额" key="je" ebsKey="incurredAmount"/>
|
||||
</table>
|
||||
|
||||
|
|
|
|||
|
|
@ -0,0 +1,57 @@
|
|||
package com.engine.salary.mapper.cbs;
|
||||
|
||||
import com.engine.salary.remote.cbs8.po.UfHkrdzbPO;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
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);
|
||||
|
||||
|
||||
}
|
||||
|
|
@ -0,0 +1,322 @@
|
|||
<?xml version="1.0" encoding="UTF-8" ?>
|
||||
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd" >
|
||||
<mapper namespace="com.engine.salary.mapper.cbs.UfHkrdzbMapper">
|
||||
<resultMap id="BaseResultMap" type="com.engine.salary.remote.cbs8.po.UfHkrdzbPO">
|
||||
<result column="id" property="id"/>
|
||||
<result column="requestId" property="requestId"/>
|
||||
<result column="formmodeid" property="formmodeid"/>
|
||||
<result column="modedatacreater" property="modedatacreater"/>
|
||||
<result column="modedatacreatertype" property="modedatacreatertype"/>
|
||||
<result column="modedatacreatedate" property="modedatacreatedate"/>
|
||||
<result column="modedatacreatetime" property="modedatacreatetime"/>
|
||||
<result column="MODEUUID" property="modeuuid"/>
|
||||
<result column="form_biz_id" property="formBizId"/>
|
||||
<result column="gsbm" property="gsbm"/>
|
||||
<result column="khbm" property="khbm"/>
|
||||
<result column="khmc" property="khmc"/>
|
||||
<result column="bmbm" property="bmbm"/>
|
||||
<result column="bmd" property="bmd"/>
|
||||
<result column="bm" property="bm"/>
|
||||
<result column="modedatamodifier" property="modedatamodifier"/>
|
||||
<result column="modedatamodifydatetime" property="modedatamodifydatetime"/>
|
||||
<result column="departmentId" property="departmentId"/>
|
||||
</resultMap>
|
||||
|
||||
<!-- 表字段 -->
|
||||
<sql id="baseColumns">
|
||||
t
|
||||
.
|
||||
id
|
||||
, t.requestId
|
||||
, t.formmodeid
|
||||
, t.modedatacreater
|
||||
, t.modedatacreatertype
|
||||
, t.modedatacreatedate
|
||||
, t.modedatacreatetime
|
||||
, t.MODEUUID
|
||||
, t.form_biz_id
|
||||
, t.gsbm
|
||||
, t.khbm
|
||||
, t.khmc
|
||||
, t.bmbm
|
||||
, t.bmd
|
||||
, t.bm
|
||||
, t.modedatamodifier
|
||||
, t.modedatamodifydatetime
|
||||
</sql>
|
||||
|
||||
<!-- 查询全部 -->
|
||||
<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>
|
||||
|
||||
|
||||
|
||||
|
||||
</mapper>
|
||||
|
|
@ -50,6 +50,7 @@ public class AccountManagementClient extends CBS8BaseClient {
|
|||
return getTransactionDetailResponse;
|
||||
|
||||
} catch (IOException ignored) {
|
||||
log.error("网络连接失败或超时!",ignored);
|
||||
throw new SalaryRunTimeException("网络连接失败或超时!");
|
||||
} finally {
|
||||
client.close();
|
||||
|
|
|
|||
|
|
@ -0,0 +1,55 @@
|
|||
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 UfHkrdzbPO {
|
||||
private Integer id;
|
||||
|
||||
private Integer requestId;
|
||||
|
||||
private Integer formmodeid;
|
||||
|
||||
private Integer modedatacreater;
|
||||
|
||||
private Integer modedatacreatertype;
|
||||
|
||||
private String modedatacreatedate;
|
||||
|
||||
private String modedatacreatetime;
|
||||
|
||||
private String modeuuid;
|
||||
|
||||
private String formBizId;
|
||||
|
||||
private String gsbm;
|
||||
|
||||
private String khbm;
|
||||
|
||||
private String khmc;
|
||||
|
||||
private String bmbm;
|
||||
|
||||
private Integer bmd;
|
||||
|
||||
private Integer bm;
|
||||
|
||||
private Integer modedatamodifier;
|
||||
|
||||
private String modedatamodifydatetime;
|
||||
|
||||
|
||||
private Collection<Long> ids;
|
||||
|
||||
private Integer departmentId;
|
||||
|
||||
}
|
||||
|
|
@ -0,0 +1,77 @@
|
|||
package com.engine.salary.remote.cbs8.response;
|
||||
|
||||
import lombok.Data;
|
||||
|
||||
|
||||
@Data
|
||||
public class CBS8PageInfo {
|
||||
/**
|
||||
* 当前页
|
||||
*/
|
||||
private int pageNum;
|
||||
/**
|
||||
* 每页的数量
|
||||
*/
|
||||
private int pageSize;
|
||||
/**
|
||||
* 当前页的数量
|
||||
*/
|
||||
private int size;
|
||||
/**
|
||||
* 总页数
|
||||
*/
|
||||
private int pages;
|
||||
/**
|
||||
* 上一页
|
||||
*/
|
||||
private int prePage;
|
||||
/**
|
||||
* 下一页
|
||||
*/
|
||||
private int nextPage;
|
||||
/**
|
||||
* 总记录数
|
||||
*/
|
||||
private long total;
|
||||
/**
|
||||
* 当前页面第一个元素在数据库中的行号
|
||||
*/
|
||||
private int startRow;
|
||||
/**
|
||||
* 当前页面最后一个元素在数据库中的行号
|
||||
*/
|
||||
private int endRow;
|
||||
/**
|
||||
* 是否为第一页
|
||||
*/
|
||||
private boolean isFirstPage;
|
||||
/**
|
||||
* 是否为最后一页
|
||||
*/
|
||||
private boolean isLastPage;
|
||||
/**
|
||||
* 是否有前一页
|
||||
*/
|
||||
private boolean hasPreviousPage;
|
||||
/**
|
||||
* 是否有下一页
|
||||
*/
|
||||
private boolean hasNextPage;
|
||||
/**
|
||||
* 导航页码数
|
||||
*/
|
||||
private int navigatePages;
|
||||
/**
|
||||
* 所有导航页号
|
||||
*/
|
||||
private int[] navigatepageNums;
|
||||
/**
|
||||
* 导航条上的第一页
|
||||
*/
|
||||
private int navigateFirstPage;
|
||||
/**
|
||||
* 导航条上的最后一页
|
||||
*/
|
||||
private int navigateLastPage;
|
||||
|
||||
}
|
||||
|
|
@ -17,7 +17,8 @@ public class GetTransactionDetailResponse extends CBS8BaseResponse {
|
|||
private Body data;
|
||||
|
||||
@Data
|
||||
public static class Body {
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
public static class Body extends CBS8PageInfo{
|
||||
/**
|
||||
* 明细列表
|
||||
*/
|
||||
|
|
|
|||
|
|
@ -3,11 +3,14 @@ package com.engine.salary.timer;
|
|||
import cn.hutool.core.util.StrUtil;
|
||||
import com.engine.salary.exception.SalaryRunTimeException;
|
||||
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.UfHkrdzbPO;
|
||||
import com.engine.salary.remote.cbs8.request.GetTransactionDetailRequest;
|
||||
import com.engine.salary.remote.cbs8.response.GetTransactionDetailResponse;
|
||||
import com.engine.salary.util.JsonUtil;
|
||||
import com.engine.salary.util.SalaryEntityUtil;
|
||||
import com.engine.salary.util.db.MapperProxyFactory;
|
||||
import com.thoughtworks.xstream.XStream;
|
||||
import com.thoughtworks.xstream.security.AnyTypePermission;
|
||||
|
|
@ -57,6 +60,10 @@ public class SyncCBSAccountDetailsJob extends BaseCronJob {
|
|||
return MapperProxyFactory.getProxy(SQLMapper.class);
|
||||
}
|
||||
|
||||
private UfHkrdzbMapper getUfHkrdzbMapper() {
|
||||
return MapperProxyFactory.getProxy(UfHkrdzbMapper.class);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void execute() {
|
||||
User user = new User();
|
||||
|
|
@ -88,6 +95,18 @@ public class SyncCBSAccountDetailsJob extends BaseCronJob {
|
|||
GetTransactionDetailResponse getTransactionDetailResponse = accountManagementClient.transactionDetailQuery(requestParam);
|
||||
List<GetTransactionDetailResponse.Detail> list = getTransactionDetailResponse.getData().getList();
|
||||
|
||||
//判断是否还存在数据,递归查询
|
||||
boolean hasNextPage = getTransactionDetailResponse.getData().isHasNextPage();
|
||||
int nextPage = getTransactionDetailResponse.getData().getNextPage();
|
||||
while (hasNextPage) {
|
||||
requestParam.setCurrentPage(nextPage);
|
||||
GetTransactionDetailResponse nextPageResponse = accountManagementClient.transactionDetailQuery(requestParam);
|
||||
List<GetTransactionDetailResponse.Detail> pageData = nextPageResponse.getData().getList();
|
||||
list.addAll(pageData);
|
||||
hasNextPage = nextPageResponse.getData().isHasNextPage();
|
||||
nextPage = nextPageResponse.getData().getNextPage();
|
||||
}
|
||||
|
||||
//加载cbs配置
|
||||
XStream xStream = new XStream();
|
||||
String resource = GCONST.getRootPath() + "WEB-INF" + File.separatorChar + "CBS2ECConfig.xml";
|
||||
|
|
@ -108,6 +127,10 @@ public class SyncCBSAccountDetailsJob extends BaseCronJob {
|
|||
String uniqueEbsKey = uniqueField.getEbsKey();
|
||||
List<String> uniqueDataKeys = getSQLMapper().listString(String.format("select %s from %s", uniqueKey, tableName));
|
||||
|
||||
//获取汇款人与办事处的对照数据
|
||||
List<UfHkrdzbPO> ufHkrdzbPOS = getUfHkrdzbMapper().listAll();
|
||||
Map<String, Integer> customerDepartmentMap = SalaryEntityUtil.convert2Map(ufHkrdzbPOS, UfHkrdzbPO::getKhmc, UfHkrdzbPO::getDepartmentId);
|
||||
|
||||
for (GetTransactionDetailResponse.Detail detail : list) {
|
||||
Map<String, String> detailMap = JsonUtil.parseMap(detail, String.class);
|
||||
String uniqueData = detailMap.get(uniqueEbsKey);
|
||||
|
|
@ -127,8 +150,6 @@ public class SyncCBSAccountDetailsJob extends BaseCronJob {
|
|||
add("modedatacreatertype");
|
||||
add("modedatacreatedate");
|
||||
add("modedatacreatetime");
|
||||
//业务逻辑字段,收款类型,默认是银行存款
|
||||
add("sklx");
|
||||
}};
|
||||
|
||||
String currDate = TimeUtil.getCurrentDateString();
|
||||
|
|
@ -140,25 +161,51 @@ public class SyncCBSAccountDetailsJob extends BaseCronJob {
|
|||
add(0);
|
||||
add(String.format("'%s'", currDate));
|
||||
add(String.format("'%s'", currTime));
|
||||
//业务逻辑字段,收款类型,默认是银行存款
|
||||
add(0);
|
||||
}};
|
||||
|
||||
String hkr = "";
|
||||
for (EBS2ECConfig.Table.Field field : table.getFields()) {
|
||||
//数据库字段
|
||||
String fieldName = field.getKey();
|
||||
fields.add(fieldName);
|
||||
// 接口值
|
||||
String value = detailMap.getOrDefault(field.getEbsKey(), "");
|
||||
values.add(String.format("'%s'", detailMap.getOrDefault(field.getEbsKey(), "")));
|
||||
|
||||
//汇款人
|
||||
if ("hkr".equals(fieldName)) {
|
||||
hkr = value;
|
||||
}
|
||||
}
|
||||
|
||||
//业务逻辑字段,收款类型,默认是银行存款
|
||||
fields.add("sklx");
|
||||
values.add(0);
|
||||
|
||||
/*
|
||||
* 认领逻辑,
|
||||
* 根据回款人去表里匹配【回款人与办事处的对照表】
|
||||
* 根据汇款人去表里匹配【汇款人与办事处的对照表】
|
||||
* 如果能匹配到数据,则状态改为已自动认领,同时把办事处(部门)的值同步到办事处字段中,是否系统自动认领同步为是;
|
||||
* 如对照标准无数据,则状态为:未认领;
|
||||
*/
|
||||
Integer departmentId = customerDepartmentMap.get(hkr);
|
||||
if(departmentId!=null){
|
||||
//认领
|
||||
fields.add("zt");
|
||||
values.add(1);
|
||||
|
||||
//是否系统认领
|
||||
fields.add("sfxtzdrl");
|
||||
values.add(1);
|
||||
|
||||
//办事处
|
||||
fields.add("szbm");
|
||||
values.add(departmentId);
|
||||
}else {
|
||||
//未认领
|
||||
fields.add("zt");
|
||||
values.add(0);
|
||||
}
|
||||
|
||||
String sql = String.format("insert into %s (%s) values (%s)", tableName, String.join(",", fields), values.stream().map(Object::toString).collect(Collectors.joining(",")));
|
||||
RecordSet rs = new RecordSet();
|
||||
|
|
|
|||
Loading…
Reference in New Issue