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

release
yishiqihuasheng 2 years ago
commit 78a30b6903
  1. 12
      dxhy-core/src/main/java/com/dxhy/core/task/PullSapDataTask.java
  2. 1
      dxhy-erp/src/main/resources/mapper/SysDeptDao.xml
  3. 14
      dxhy-extend/src/main/java/com/dxhy/extend/controller/VouncherSyncController.java
  4. 31
      dxhy-extend/src/main/java/com/dxhy/extend/dao/GsClientMapper.java
  5. 19
      dxhy-extend/src/main/java/com/dxhy/extend/entity/GsClient.java
  6. 111
      dxhy-extend/src/main/resources/mapper/GsClientMapper.xml

@ -4,6 +4,8 @@ import com.alibaba.fastjson.JSONObject;
import com.dxhy.common.constant.DbConstant;
import com.dxhy.common.datasource.config.DynamicContextHolder;
import com.dxhy.core.dao.ConfirmDao;
import com.dxhy.core.dao.GsClientMapper;
import com.dxhy.core.entity.GsClient;
import com.dxhy.core.job.entity.SNSAPObject;
import com.dxhy.core.job.entity.ScheduleJobEntity;
import com.dxhy.core.job.entity.TAcOrg;
@ -47,6 +49,8 @@ public class PullSapDataTask {
@Value("${po.password}")
private String password;
@Resource
GsClientMapper gsClientMapper;
public void applyStat() {
log.info("拉取sap数据获取");
@ -64,7 +68,13 @@ public class PullSapDataTask {
object.setSYSID("FPXT");
object.setIFYWID("FI842");
object.setBSKEY(UUID.randomUUID().toString().replace("-", ""));
object.setZFILED5(environment);
DynamicContextHolder.push(DbConstant.BASICS_READ);
List<GsClient> gsClients = gsClientMapper.selectByGsdm(tAcOrg.getOrgcode());
if(gsClients!=null && gsClients.size()>0){
object.setZFILED5(gsClients.get(0).getClient());
}else {
object.setZFILED5(environment);
}
Map<String,String> requestMap = new HashMap<>();
//公司代码
requestMap.put("ZGSDM",tAcOrg.getOrgcode());

@ -32,7 +32,6 @@
select *
from sys_dept
where org_code = #{compCode}
and org_type = '5'
and del_flag = '0' limit 1
</select>

@ -6,7 +6,11 @@ import com.alibaba.druid.support.json.JSONUtils;
import com.alibaba.fastjson.JSONObject;
import com.alibaba.nacos.common.http.HttpUtils;
import com.dxhy.common.constant.CommonConstants;
import com.dxhy.common.constant.DbConstant;
import com.dxhy.common.datasource.config.DynamicContextHolder;
import com.dxhy.common.utils.R;
import com.dxhy.extend.dao.GsClientMapper;
import com.dxhy.extend.entity.GsClient;
import com.dxhy.extend.model.SNSAPObject;
import com.dxhy.extend.service.bb.VouncherSyncService;
import lombok.extern.slf4j.Slf4j;
@ -32,6 +36,8 @@ public class VouncherSyncController {
private VouncherSyncService vouncherSyncService;
@Value("${sdny.record.environment}")
private String environment;
@Resource
private GsClientMapper gsClientMapper;
@PostMapping("getSapData")
public Object getSapData(@RequestBody Map<String,String> map){
//是否全量 X为全量推送,空为增量推送。
@ -73,7 +79,13 @@ public class VouncherSyncController {
// object.setZFILED2("");
// object.setZFILED3("");
// object.setZFILED4("");
object.setZFILED5(environment);
DynamicContextHolder.push(DbConstant.BASICS_READ);
List<GsClient> gsClients = gsClientMapper.selectByGsdm(str);
if(gsClients!=null && gsClients.size()>0){
object.setZFILED5(gsClients.get(0).getClient());
}else {
object.setZFILED5(environment);
}
Map<String,String> requestMap = new HashMap<>();
List<Object> list = new ArrayList<>();
requestMap.put("ZGSDM",str);

@ -0,0 +1,31 @@
package com.dxhy.extend.dao;
import com.dxhy.extend.entity.GsClient;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import java.util.List;
@Mapper
public interface GsClientMapper {
int deleteByPrimaryKey(Integer id);
int deleteAll();
int insert(GsClient record);
int insertSelective(GsClient record);
int insertList(@Param("list") List<GsClient> recordList);
GsClient selectByPrimaryKey(Integer id);
List<GsClient> selectByGsdm(String gsdm);
int updateByPrimaryKeySelective(GsClient record);
int updateByPrimaryKey(GsClient record);
}

@ -0,0 +1,19 @@
package com.dxhy.extend.entity;
import lombok.Data;
import java.util.Date;
@Data
public class GsClient {
private Integer id;
private String gsdm;
private String gsmc;
private String client;
private Date createTime;
}

@ -0,0 +1,111 @@
<?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.dxhy.extend.dao.GsClientMapper" >
<resultMap id="BaseResultMap" type="com.dxhy.extend.entity.GsClient" >
<id column="id" property="id" jdbcType="INTEGER" />
<result column="gsdm" property="gsdm" jdbcType="VARCHAR" />
<result column="gsmc" property="gsmc" jdbcType="VARCHAR" />
<result column="client" property="client" jdbcType="VARCHAR" />
<result column="create_time" property="createTime" jdbcType="TIMESTAMP" />
</resultMap>
<sql id="Base_Column_List" >
id, gsdm, gsmc, client, create_time
</sql>
<select id="selectByPrimaryKey" resultMap="BaseResultMap" parameterType="java.lang.Integer" >
select
<include refid="Base_Column_List" />
from gs_client
where id = #{id,jdbcType=INTEGER}
</select>
<select id="selectByGsdm" resultMap="BaseResultMap" parameterType="java.lang.String" >
select
<include refid="Base_Column_List" />
from gs_client
where gsdm = #{gsdm,jdbcType=VARCHAR}
</select>
<delete id="deleteByPrimaryKey" parameterType="java.lang.Integer" >
delete from gs_client
where id = #{id,jdbcType=INTEGER}
</delete>
<delete id="deleteAll" >
delete from gs_client
</delete>
<insert id="insert" parameterType="com.dxhy.extend.entity.GsClient" >
insert into gs_client (id, gsdm, gsmc,
client, create_time)
values (#{id,jdbcType=INTEGER}, #{gsdm,jdbcType=VARCHAR}, #{gsmc,jdbcType=VARCHAR},
#{client,jdbcType=VARCHAR}, #{createTime,jdbcType=TIMESTAMP})
</insert>
<insert id="insertSelective" parameterType="com.dxhy.extend.entity.GsClient" >
insert into gs_client
<trim prefix="(" suffix=")" suffixOverrides="," >
<if test="id != null" >
id,
</if>
<if test="gsdm != null" >
gsdm,
</if>
<if test="gsmc != null" >
gsmc,
</if>
<if test="client != null" >
client,
</if>
<if test="createTime != null" >
create_time,
</if>
</trim>
<trim prefix="values (" suffix=")" suffixOverrides="," >
<if test="id != null" >
#{id,jdbcType=INTEGER},
</if>
<if test="gsdm != null" >
#{gsdm,jdbcType=VARCHAR},
</if>
<if test="gsmc != null" >
#{gsmc,jdbcType=VARCHAR},
</if>
<if test="client != null" >
#{client,jdbcType=VARCHAR},
</if>
<if test="createTime != null" >
#{createTime,jdbcType=TIMESTAMP},
</if>
</trim>
</insert>
<update id="updateByPrimaryKeySelective" parameterType="com.dxhy.extend.entity.GsClient" >
update gs_client
<set >
<if test="gsdm != null" >
gsdm = #{gsdm,jdbcType=VARCHAR},
</if>
<if test="gsmc != null" >
gsmc = #{gsmc,jdbcType=VARCHAR},
</if>
<if test="client != null" >
client = #{client,jdbcType=VARCHAR},
</if>
<if test="createTime != null" >
create_time = #{createTime,jdbcType=TIMESTAMP},
</if>
</set>
where id = #{id,jdbcType=INTEGER}
</update>
<update id="updateByPrimaryKey" parameterType="com.dxhy.extend.entity.GsClient" >
update gs_client
set gsdm = #{gsdm,jdbcType=VARCHAR},
gsmc = #{gsmc,jdbcType=VARCHAR},
client = #{client,jdbcType=VARCHAR},
create_time = #{createTime,jdbcType=TIMESTAMP}
where id = #{id,jdbcType=INTEGER}
</update>
<insert id="insertList" parameterType="java.util.List" useGeneratedKeys="false">
insert into gs_client (gsdm,gsmc,client,create_time)
values
<foreach collection="list" item="item" index="index"
separator=",">
(#{item.gsdm,jdbcType=VARCHAR}, #{item.gsmc,jdbcType=VARCHAR},
#{item.client,jdbcType=VARCHAR},#{item.createTime,jdbcType=TIMESTAMP})
</foreach>
</insert>
</mapper>
Loading…
Cancel
Save