feat:同步客商接口,物料分类编码增删改查批量上传

release
gongquanlin 2 years ago
parent 86db51149e
commit d5aa0110d0
  1. 3
      order-management-base-service/src/main/java/com/dxhy/order/baseservice/module/base/controller/DownloadExcelController.java
  2. 1
      order-management-base-service/src/main/java/com/dxhy/order/baseservice/module/buyer/controller/BuyerController.java
  3. 14
      order-management-base-service/src/main/java/com/dxhy/order/baseservice/module/thirdservice/user/dto/AddUserRequestDto.java
  4. 3
      order-management-common/src/main/java/com/dxhy/order/constant/DownloadExcelEnum.java
  5. 28
      order-management-consumer/src/main/java/com/dxhy/order/consumer/modules/buyer/controller/MdmBuyerController.java
  6. 20
      order-management-consumer/src/main/java/com/dxhy/order/consumer/modules/buyer/domain/SyncBuyerDTO.java
  7. 131
      order-management-consumer/src/main/java/com/dxhy/order/consumer/modules/taxcodematch/controller/SdenergyTaxCodeMatchController.java
  8. 74
      order-management-consumer/src/main/java/com/dxhy/order/consumer/modules/taxcodematch/dao/SdenergyTaxCodeMatchDao.java
  9. 41
      order-management-consumer/src/main/java/com/dxhy/order/consumer/modules/taxcodematch/emum/SdenergyTaxCodeMatchEnum.java
  10. 75
      order-management-consumer/src/main/java/com/dxhy/order/consumer/modules/taxcodematch/entity/SdenergyTaxCodeMatch.java
  11. 27
      order-management-consumer/src/main/java/com/dxhy/order/consumer/modules/taxcodematch/model/dto/SdenergyTaxCodeMatchDTO.java
  12. 64
      order-management-consumer/src/main/java/com/dxhy/order/consumer/modules/taxcodematch/service/SdenergyTaxCodeMatchService.java
  13. 123
      order-management-consumer/src/main/java/com/dxhy/order/consumer/modules/taxcodematch/service/impl/SdenergyTaxCodeMatchServiceImpl.java
  14. 9
      order-management-consumer/src/main/java/com/dxhy/order/consumer/openapi/service/ISDEnregyService.java
  15. 1
      order-management-consumer/src/main/java/com/dxhy/order/consumer/openapi/service/impl/CommonInterfaceServiceImpl.java
  16. 78
      order-management-consumer/src/main/java/com/dxhy/order/consumer/openapi/service/impl/SDEnregyServiceImpl.java
  17. BIN
      order-management-consumer/src/main/resources/download/SdenergyTaxCodeMatch.xlsx
  18. 101
      order-management-consumer/src/main/resources/mybatis/mapper/SdenergyTaxCodeMatchDao.xml
  19. 283
      src/main/resources/com/dxhy/order/MdmBuyerManageInfoDao.xml

@ -96,6 +96,9 @@ public class DownloadExcelController {
case "12":
downloadExcelEnum = DownloadExcelEnum.EXCEL_QDFP;
break;
case "13":
downloadExcelEnum = DownloadExcelEnum.EXCEL_TAX_CODE_MATCH;
break;
default:
throw new IllegalStateException("Unexpected value: " + excelType);
}

@ -3,6 +3,7 @@ package com.dxhy.order.baseservice.module.buyer.controller;
import cn.hutool.core.util.ObjectUtil;
import com.alibaba.fastjson.JSON;
import com.alibaba.fastjson.JSONException;
import com.dxhy.order.baseservice.module.buyer.protocol.SyncBuyerDTO;
import com.dxhy.order.constant.ConfigureConstant;
import com.dxhy.order.constant.OrderInfoContentEnum;
import com.dxhy.order.constant.OrderInfoEnum;

@ -61,4 +61,18 @@ public class AddUserRequestDto implements Serializable {
* 数据权限id
*/
private List<Long> deptList;
// 用户编码
private String code;
// 电子邮箱
private String email;
// 公司编码
private String companyCode;
// 员工状态 0离职、1离岗、2退休、3在岗、4死亡
private String userStatus;
}

@ -31,7 +31,8 @@ public enum DownloadExcelEnum {
EXCEL_INVOICE_COUNT("InvoiceCountExcel.xlsx", "批量下架模板"),
EXCEL_VEHICLE_CODE("VehiclesCodeExcel.xlsx", "车辆税编模板"),
EXCEL_HZXXB("SpecialInvoiceReversalsExcel.xlsx", "红字信息表模板"),
EXCEL_QDFP("QdfpImportExcel.xlsx", "全电发票订单导入模板");
EXCEL_QDFP("QdfpImportExcel.xlsx", "全电发票订单导入模板"),
EXCEL_TAX_CODE_MATCH("SdenergyTaxCodeMatch.xlsx", "物料分类编码表");
/**
* key

@ -0,0 +1,28 @@
package com.dxhy.order.consumer.modules.buyer.controller;
import com.dxhy.order.consumer.modules.buyer.domain.SyncBuyerDTO;
import com.dxhy.order.consumer.modules.commodity.domain.dto.SyncGroupCommodityDTO;
import com.dxhy.order.consumer.openapi.service.impl.SDEnregyServiceAbstract;
import com.dxhy.order.consumer.openapi.service.impl.SDEnregyServiceImpl;
import com.dxhy.order.model.R;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.*;
/**
* @Description
* @Author 巩权林
* @Date 2023/3/14 17:28
**/
@RestController
@RequestMapping("/mdm_buyer")
public class MdmBuyerController {
@Autowired
private SDEnregyServiceAbstract serviceAbstract;
@PostMapping("/sync")
public R sync(@RequestBody @Validated SyncBuyerDTO dto) {
return serviceAbstract.proactiveSyncMdmBuyer(dto.getZxbm());
}
}

@ -0,0 +1,20 @@
package com.dxhy.order.consumer.modules.buyer.domain;
import lombok.Data;
import javax.validation.constraints.NotBlank;
/**
* @Description
* @Author 巩权林
* @Date 2023/3/14 17:23
**/
@Data
public class SyncBuyerDTO {
/**
* 自行编码
*/
@NotBlank(message = "购方编码不能为空!")
private String zxbm;
}

@ -0,0 +1,131 @@
package com.dxhy.order.consumer.modules.taxcodematch.controller;
import com.dxhy.base.file.common.ExcelReadContext;
import com.dxhy.base.file.exception.ExcelReadException;
import com.dxhy.base.file.handle.ExcelReadHandle;
import com.dxhy.order.baseservice.module.commodity.constant.CommodityEnum;
import com.dxhy.order.baseservice.module.commodity.model.CommodityExcel;
import com.dxhy.order.consumer.modules.commodity.domain.dto.QueryGroupCommodityDTO;
import com.dxhy.order.consumer.modules.taxcodematch.emum.SdenergyTaxCodeMatchEnum;
import com.dxhy.order.consumer.modules.taxcodematch.entity.SdenergyTaxCodeMatch;
import com.dxhy.order.consumer.modules.taxcodematch.model.dto.SdenergyTaxCodeMatchDTO;
import com.dxhy.order.consumer.modules.taxcodematch.service.SdenergyTaxCodeMatchService;
import com.dxhy.order.model.PageUtils;
import com.dxhy.order.model.R;
import lombok.extern.slf4j.Slf4j;
import org.apache.commons.beanutils.BeanUtils;
import org.apache.commons.lang3.StringUtils;
import org.springframework.web.bind.annotation.*;
import org.springframework.web.multipart.MultipartFile;
import javax.annotation.Resource;
import java.io.IOException;
import java.lang.reflect.InvocationTargetException;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
/**
* 物料分类编码表控制层
*
* @author 巩权林
* @since 2023-03-14 15:22:24
*/
@RestController
@RequestMapping("/sdenergyTaxCodeMatch")
@Slf4j
public class SdenergyTaxCodeMatchController {
private final static String LOGGER_MSG = "(物料分类编码)";
/**
* 服务对象
*/
@Resource
private SdenergyTaxCodeMatchService sdenergyTaxCodeMatchService;
/**
* 通过主键查询单条数据
*
* @param dto 主键
* @return 单条数据
*/
@GetMapping("/list")
public R list(SdenergyTaxCodeMatchDTO dto) {
try {
PageUtils pageUtil = sdenergyTaxCodeMatchService.queryList(dto);
return R.ok().put("page", pageUtil);
} catch (NumberFormatException e) {
log.error("{},分页参数类型转换异常:{}", LOGGER_MSG, e.getMessage());
return R.error("商品信息列表查询异常");
}
}
@PostMapping("/create")
public R create(@RequestBody SdenergyTaxCodeMatchDTO dto) {
return sdenergyTaxCodeMatchService.insert(dto) > 0 ? R.ok() : R.error("插入失败");
}
@PutMapping("/edit")
public R edit(@RequestBody SdenergyTaxCodeMatchDTO dto, @RequestParam("id") Long id) {
SdenergyTaxCodeMatch updateEntity = new SdenergyTaxCodeMatch();
try {
BeanUtils.copyProperties(updateEntity, dto);
updateEntity.setId(id);
if (sdenergyTaxCodeMatchService.update(updateEntity) > 0) {
return R.ok();
} else {
return R.error("更新失败,未进行更新");
}
} catch (IllegalAccessException e) {
log.error("{},更新物料分类编码异常", LOGGER_MSG, e);
return R.error("更新出错,错误原因:" + e.getMessage());
} catch (InvocationTargetException e) {
log.error("{},更新物料分类编码异常", LOGGER_MSG, e);
return R.error("更新出错,错误原因:" + e.getMessage());
}
}
@DeleteMapping("/delete")
public R delete(@RequestParam("id") Long id) {
return sdenergyTaxCodeMatchService.deleteById(id) ? R.ok() : R.error();
}
/**
* 批量导入
*
* @param file
* @return
*/
@PostMapping("/upload")
public R upload(MultipartFile file) {
Map<String, String> headToProperty = new HashMap<>();
for (SdenergyTaxCodeMatchEnum flowStatus : SdenergyTaxCodeMatchEnum.values()) {
headToProperty.put(flowStatus.getKey(), flowStatus.getValue());
}
ExcelReadContext context = new ExcelReadContext(SdenergyTaxCodeMatch.class, headToProperty, false);
if (StringUtils.isBlank(file.getOriginalFilename())) {
context.setFilePrefix(".xlsx");
} else {
context.setFilePrefix(file.getOriginalFilename().substring(file.getOriginalFilename().lastIndexOf(".")));
}
ExcelReadHandle handle = new ExcelReadHandle(context);
List<SdenergyTaxCodeMatch> uploadList = new ArrayList<>();
try {
uploadList = handle.readFromExcel(file.getInputStream(), SdenergyTaxCodeMatch.class);
} catch (ExcelReadException e) {
log.error("{},导入物料分类编码异常", LOGGER_MSG, e);
return R.error("导入物料分类编码异常,请重新上传");
} catch (IOException e) {
log.error("{},导入物料分类编码异常", LOGGER_MSG, e);
return R.error("导入物料分类编码异常,请重新上传");
}
return sdenergyTaxCodeMatchService.upload(uploadList) > 0 ? R.ok() : R.error();
}
}

@ -0,0 +1,74 @@
package com.dxhy.order.consumer.modules.taxcodematch.dao;
import com.dxhy.order.consumer.modules.taxcodematch.entity.SdenergyTaxCodeMatch;
import org.apache.ibatis.annotations.Param;
import java.util.List;
/**
* (SdenergyTaxCodeMatch)表数据库访问层
*
* @author 巩权林
* @since 2023-03-14 15:22:21
*/
public interface SdenergyTaxCodeMatchDao {
/**
* 通过ID查询单条数据
*
* @param id 主键
* @return 实例对象
*/
SdenergyTaxCodeMatch queryById(Long id);
/**
* 查询指定行数据
*
* @param offset 查询起始位置
* @param limit 查询条数
* @return 对象列表
*/
List<SdenergyTaxCodeMatch> queryAllByLimit(@Param("offset") int offset, @Param("limit") int limit);
/**
* 通过实体作为筛选条件查询
*
* @param sdenergyTaxCodeMatch 实例对象
* @return 对象列表
*/
List<SdenergyTaxCodeMatch> queryAll(SdenergyTaxCodeMatch sdenergyTaxCodeMatch);
/**
* 新增数据
*
* @param sdenergyTaxCodeMatch 实例对象
* @return 影响行数
*/
int insert(SdenergyTaxCodeMatch sdenergyTaxCodeMatch);
/**
* 修改数据
*
* @param sdenergyTaxCodeMatch 实例对象
* @return 影响行数
*/
int update(SdenergyTaxCodeMatch sdenergyTaxCodeMatch);
/**
* 通过主键删除数据
*
* @param id 主键
* @return 影响行数
*/
int deleteById(Long id);
/**
* 批量插入
*
* @param id
* @return
*/
int batchInsert(List<SdenergyTaxCodeMatch> id);
}

@ -0,0 +1,41 @@
package com.dxhy.order.consumer.modules.taxcodematch.emum;
import lombok.Getter;
/**
* 表格导入枚举类
*
* @author ZSC-DXHY
* @date 创建时间: 2020-08-14 15:23
*/
@Getter
public enum SdenergyTaxCodeMatchEnum {
WIFIBM_NAME("物料分类编码*", "wlflbm"),
FIMC_NAME("物料名称*", "flmc"),
SSFIBM_NAME("税收分类编码*", "ssflbm"),
SSFIMC_NAME("税收分类名称*", "ssflmc"),
;
private final String key;
private final String value;
SdenergyTaxCodeMatchEnum(String key, String value) {
this.key = key;
this.value = value;
}
public static SdenergyTaxCodeMatchEnum getCodeValue(String key) {
for (SdenergyTaxCodeMatchEnum item : values()) {
if (item.getKey().equals(key)) {
return item;
}
}
return null;
}
}

@ -0,0 +1,75 @@
package com.dxhy.order.consumer.modules.taxcodematch.entity;
import java.io.Serializable;
/**
* (SdenergyTaxCodeMatch)实体类
*
* @author 巩权林
* @since 2023-03-14 15:22:20
*/
public class SdenergyTaxCodeMatch implements Serializable {
private static final long serialVersionUID = 990512909469419032L;
/**
* Id
*/
private Long id;
/**
* 物料分类编码
*/
private String wlflbm;
/**
* 物料名称
*/
private String flmc;
/**
* 税收分类编码
*/
private String ssflbm;
/**
* 税收分类名称
*/
private String ssflmc;
public Long getId() {
return id;
}
public void setId(Long id) {
this.id = id;
}
public String getWlflbm() {
return wlflbm;
}
public void setWlflbm(String wlflbm) {
this.wlflbm = wlflbm;
}
public String getFlmc() {
return flmc;
}
public void setFlmc(String flmc) {
this.flmc = flmc;
}
public String getSsflbm() {
return ssflbm;
}
public void setSsflbm(String ssflbm) {
this.ssflbm = ssflbm;
}
public String getSsflmc() {
return ssflmc;
}
public void setSsflmc(String ssflmc) {
this.ssflmc = ssflmc;
}
}

@ -0,0 +1,27 @@
package com.dxhy.order.consumer.modules.taxcodematch.model.dto;
import com.dxhy.order.consumer.modules.taxcodematch.entity.SdenergyTaxCodeMatch;
import java.io.Serializable;
public class SdenergyTaxCodeMatchDTO extends SdenergyTaxCodeMatch {
private Integer currPage;
private Integer pageSize;
public Integer getCurrPage() {
return currPage;
}
public void setCurrPage(Integer currPage) {
this.currPage = currPage;
}
public Integer getPageSize() {
return pageSize;
}
public void setPageSize(Integer pageSize) {
this.pageSize = pageSize;
}
}

@ -0,0 +1,64 @@
package com.dxhy.order.consumer.modules.taxcodematch.service;
import com.dxhy.order.consumer.modules.taxcodematch.entity.SdenergyTaxCodeMatch;
import com.dxhy.order.consumer.modules.taxcodematch.model.dto.SdenergyTaxCodeMatchDTO;
import com.dxhy.order.model.PageUtils;
import java.util.List;
/**
* (SdenergyTaxCodeMatch)表服务接口
*
* @author 巩权林
* @since 2023-03-14 15:22:22
*/
public interface SdenergyTaxCodeMatchService {
/**
* 通过ID查询单条数据
*
* @param id 主键
* @return 实例对象
*/
SdenergyTaxCodeMatch queryById(Long id);
PageUtils queryList(SdenergyTaxCodeMatchDTO sdenergyTaxCodeMatch);
/**
* 查询多条数据
*
* @param offset 查询起始位置
* @param limit 查询条数
* @return 对象列表
*/
List<SdenergyTaxCodeMatch> queryAllByLimit(int offset, int limit);
/**
* 新增数据
*
* @param sdenergyTaxCodeMatch 实例对象
* @return 实例对象
*/
int insert(SdenergyTaxCodeMatch sdenergyTaxCodeMatch);
/**
* 修改数据
*
* @param sdenergyTaxCodeMatch 实例对象
* @return 实例对象
*/
int update(SdenergyTaxCodeMatch sdenergyTaxCodeMatch);
/**
* 通过主键删除数据
*
* @param id 主键
* @return 是否成功
*/
boolean deleteById(Long id);
int upload(List<SdenergyTaxCodeMatch> list);
}

@ -0,0 +1,123 @@
package com.dxhy.order.consumer.modules.taxcodematch.service.impl;
import com.dxhy.order.baseservice.module.commodity.model.CommodityCodeEntity;
import com.dxhy.order.consumer.modules.taxcodematch.entity.SdenergyTaxCodeMatch;
import com.dxhy.order.consumer.modules.taxcodematch.dao.SdenergyTaxCodeMatchDao;
import com.dxhy.order.consumer.modules.taxcodematch.model.dto.SdenergyTaxCodeMatchDTO;
import com.dxhy.order.consumer.modules.taxcodematch.service.SdenergyTaxCodeMatchService;
import com.dxhy.order.model.PageUtils;
import com.github.pagehelper.PageHelper;
import com.github.pagehelper.PageInfo;
import lombok.extern.slf4j.Slf4j;
import org.apache.commons.beanutils.BeanUtils;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import javax.annotation.Resource;
import java.lang.reflect.InvocationTargetException;
import java.util.List;
/**
* (SdenergyTaxCodeMatch)表服务实现类
*
* @author 巩权林
* @since 2023-03-14 15:22:23
*/
@Service("sdenergyTaxCodeMatchService")
@Slf4j
public class SdenergyTaxCodeMatchServiceImpl implements SdenergyTaxCodeMatchService {
private final static String LOGGER_MSG = "(物料分类编码服务类)";
@Resource
private SdenergyTaxCodeMatchDao sdenergyTaxCodeMatchDao;
/**
* 通过ID查询单条数据
*
* @param id 主键
* @return 实例对象
*/
@Override
public SdenergyTaxCodeMatch queryById(Long id) {
return this.sdenergyTaxCodeMatchDao.queryById(id);
}
@Override
public PageUtils queryList(SdenergyTaxCodeMatchDTO sdenergyTaxCodeMatch) {
int pageSize = sdenergyTaxCodeMatch.getPageSize();
int currPage = sdenergyTaxCodeMatch.getCurrPage();
PageHelper.startPage(currPage, pageSize);
SdenergyTaxCodeMatch query = new SdenergyTaxCodeMatch();
try {
BeanUtils.copyProperties(query, sdenergyTaxCodeMatch);
} catch (IllegalAccessException e) {
log.error(LOGGER_MSG + "查询物料分类编码异常", e);
throw new RuntimeException(e);
} catch (InvocationTargetException e) {
log.error(LOGGER_MSG + "查询物料分类编码异常", e);
throw new RuntimeException(e);
}
List<SdenergyTaxCodeMatch> result = sdenergyTaxCodeMatchDao.queryAll(query);
PageInfo<SdenergyTaxCodeMatch> pageInfo = new PageInfo<>(result);
return new PageUtils(pageInfo.getList(), (int) pageInfo.getTotal(), pageInfo.getPageSize(), pageInfo.getPageNum());
}
/**
* 查询多条数据
*
* @param offset 查询起始位置
* @param limit 查询条数
* @return 对象列表
*/
@Override
public List<SdenergyTaxCodeMatch> queryAllByLimit(int offset, int limit) {
return this.sdenergyTaxCodeMatchDao.queryAllByLimit(offset, limit);
}
/**
* 新增数据
*
* @param sdenergyTaxCodeMatch 实例对象
* @return 实例对象
*/
@Override
public int insert(SdenergyTaxCodeMatch sdenergyTaxCodeMatch) {
return this.sdenergyTaxCodeMatchDao.insert(sdenergyTaxCodeMatch);
}
/**
* 修改数据
*
* @param sdenergyTaxCodeMatch 实例对象
* @return 实例对象
*/
@Override
public int update(SdenergyTaxCodeMatch sdenergyTaxCodeMatch) {
return this.sdenergyTaxCodeMatchDao.update(sdenergyTaxCodeMatch);
}
/**
* 通过主键删除数据
*
* @param id 主键
* @return 是否成功
*/
@Override
public boolean deleteById(Long id) {
return this.sdenergyTaxCodeMatchDao.deleteById(id) > 0;
}
/**
* 上传
*
* @param list
* @return
*/
@Override
@Transactional
public int upload(List<SdenergyTaxCodeMatch> list) {
return this.sdenergyTaxCodeMatchDao.batchInsert(list);
}
}

@ -48,5 +48,14 @@ public interface ISDEnregyService {
*/
public R proactiveSyncMdmGroupTax(String code);
/**
* 主动同步用户信息
*
* @param code
* @return
*/
public R proactiveSyncMdmBuyer(String code);
public SDEnergyMdmBaseBO buildResult(SDEnergyMdmBaseBO baseBO, List respList, Function<Object, SDEnergyMdmBaseRespBO> handleFunction);
}

@ -466,6 +466,7 @@ public class CommonInterfaceServiceImpl implements CommonInterfaceService {
*/
@Override
public void dealOrderInfoKpr(OrderInfo orderInfo, String userId) throws OrderReceiveException {
// TODO MDM接口走通后补全这里
if (StringUtils.isBlank(orderInfo.getKpr())) {
DrawerInfoEntity drawerInfoEntity = drawerInfoService.queryDrawerInfo(orderInfo.getNsrsbh(), userId);

@ -51,6 +51,7 @@ public class SDEnregyServiceImpl extends SDEnregyServiceAbstract {
@Resource
private BaseService baseService;
// ===========物料相关开始===========
// 物料主动查询接口
@Value("${mdm.groupTaxCode.url}")
private String groupTaxCodeUrl;
@ -62,7 +63,20 @@ public class SDEnregyServiceImpl extends SDEnregyServiceAbstract {
// 物料主动查询密码
@Value("${mdm.groupTaxCode.password}")
private String groupTaxCodePassword;
// ===========物料相关结束===========
// ===========客商相关开始===========
@Value("${mdm.buyer.url}")
private String buyerUrl;
// 物料主动查询用户名
@Value("${mdm.buyer.usercode}")
private String buyerUsercode;
// 物料主动查询密码
@Value("${mdm.buyer.password}")
private String buyerPassword;
// ===========客商相关结束===========
// // 客商主动查询接口
// @Value("${mdm.buyerUrl}")
@ -240,6 +254,10 @@ public class SDEnregyServiceImpl extends SDEnregyServiceAbstract {
.boradAuth(null) // 看板权限
.roleIdList(null) // 角色id
.deptList(null) // 数据权限id
.code(mdmSyncUserReqBO.getCODE()) // 用户编码
.email(mdmSyncUserReqBO.getDESC11()) // 电子邮箱
.companyCode(mdmSyncUserReqBO.getDESC37()) // 公司编码
.userStatus(mdmSyncUserReqBO.getDESC59()) // 员工状态 0离职、1离岗、2退休、3在岗、4死亡
.build();
// 添加用户到大B
@ -330,4 +348,64 @@ public class SDEnregyServiceImpl extends SDEnregyServiceAbstract {
return R.error(syncResult.getMsg());
}
}
/**
* 主动同步购方信息
*
* @param code
* @return
*/
@Override
public R proactiveSyncMdmBuyer(String code) {
// 向mdm主动发送请求
if (StringUtils.isEmpty(buyerUrl)) {
return R.error("请配置客商主动查询地址");
}
String requestBody = " \n" +
"{\n" +
" \"ESB\":{\n" +
" \"DATA\":{\n" +
" \"DATAINFOS\":{\n" +
" \"DATAINFO\":[\n" +
" {\n" +
" \"CODE\":\"" + code + "\"\n" +
" }\n" +
" ],\n" +
" \"PUUID\":\"" + UUID.randomUUID().toString() + "\"\n" +
" }\n" +
" }\n" +
" }\n" +
"}";
// 发送POST请求
HttpResponse response = HttpRequest.post(buyerUrl)
.timeout(20000) // 设置请求超时时间
.header("Content-Type", "application/json")
.header("usercode", groupTaxCodeUsercode)
.header("password", groupTaxCodePassword)
.body(requestBody) // 设置请求体内容
.execute();
String resp = response.body();
SDEnergyMdmBaseBO baseBO = JSONObject.parseObject(resp, SDEnergyMdmBaseBO.class);
List<MdmGmfxxtbReqBO> mdmGmfxxtbReqBOS = (List<MdmGmfxxtbReqBO>) Optional.of(baseBO)
.map(SDEnergyMdmBaseBO::getESB)
.map(ESBBO::getDATA)
.map(DATABO::getDATAINFOS)
.map(DATAINFOSBO::getDATAINFO)
.map(i -> {
// 转成List<MdmSyncGroupTaxCodeReqBO>
return i.stream().map(j -> {
return JSONObject.parseObject(JSONObject.toJSONString(j), MdmSyncGroupTaxCodeReqBO.class);
}).collect(Collectors.toList());
})
.orElse(new ArrayList<MdmSyncGroupTaxCodeReqBO>());
AjaxResult syncResult = this.syncBuyerMessage(mdmGmfxxtbReqBOS, resp);
if (syncResult.isSuccess()) {
return R.ok();
} else {
return R.error(syncResult.getMsg());
}
}
}

@ -0,0 +1,101 @@
<?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.order.consumer.modules.taxcodematch.dao.SdenergyTaxCodeMatchDao">
<resultMap type="com.dxhy.order.consumer.modules.taxcodematch.entity.SdenergyTaxCodeMatch"
id="SdenergyTaxCodeMatchMap">
<result property="id" column="id" jdbcType="INTEGER"/>
<result property="wlflbm" column="wlflbm" jdbcType="VARCHAR"/>
<result property="flmc" column="flmc" jdbcType="VARCHAR"/>
<result property="ssflbm" column="ssflbm" jdbcType="VARCHAR"/>
<result property="ssflmc" column="ssflmc" jdbcType="VARCHAR"/>
</resultMap>
<!--查询单个-->
<select id="queryById" resultMap="SdenergyTaxCodeMatchMap">
select id,
wlflbm,
flmc,
ssflbm,
ssflmc
from sales_order_sdenergy.sdenergy_tax_code_match
where id = #{id}
</select>
<!--查询指定行数据-->
<select id="queryAllByLimit" resultMap="SdenergyTaxCodeMatchMap">
select id,
wlflbm,
flmc,
ssflbm,
ssflmc
from sales_order_sdenergy.sdenergy_tax_code_match limit #{offset}, #{limit}
</select>
<!--通过实体作为筛选条件查询-->
<select id="queryAll" resultMap="SdenergyTaxCodeMatchMap">
select
id, wlflbm, flmc, ssflbm, ssflmc
from sales_order_sdenergy.sdenergy_tax_code_match
<where>
<if test="id != null">
and id = #{id}
</if>
<if test="wlflbm != null and wlflbm != ''">
and wlflbm like concat("%",#{wlflbm},"%")
</if>
<if test="flmc != null and flmc != ''">
and flmc = like concat("%",#{flmc},"%")
</if>
<if test="ssflbm != null and ssflbm != ''">
and ssflbm = #{ssflbm}
</if>
<if test="ssflmc != null and ssflmc != ''">
and ssflmc = #{ssflmc}
</if>
</where>
</select>
<!--新增所有列-->
<insert id="insert" keyProperty="id" useGeneratedKeys="true">
insert into sales_order_sdenergy.sdenergy_tax_code_match(wlflbm, flmc, ssflbm, ssflmc)
values (#{wlflbm}, #{flmc}, #{ssflbm}, #{ssflmc})
</insert>
<!--通过主键修改数据-->
<update id="update">
update sales_order_sdenergy.sdenergy_tax_code_match
<set>
<if test="wlflbm != null and wlflbm != ''">
wlflbm = #{wlflbm},
</if>
<if test="flmc != null and flmc != ''">
flmc = #{flmc},
</if>
<if test="ssflbm != null and ssflbm != ''">
ssflbm = #{ssflbm},
</if>
<if test="ssflmc != null and ssflmc != ''">
ssflmc = #{ssflmc},
</if>
</set>
where id = #{id}
</update>
<!--通过主键删除-->
<delete id="deleteById">
delete
from sales_order_sdenergy.sdenergy_tax_code_match
where id = #{id}
</delete>
<!--批量插入-->
<insert id="batchInsert" keyProperty="id" useGeneratedKeys="true">
insert into sales_order_sdenergy.sdenergy_tax_code_match(wlflbm, flmc, ssflbm, ssflmc)
values
<foreach collection="collection" item="item" separator=",">
(#{item.wlflbm}, #{item.flmc}, #{item.ssflbm}, #{item.ssflmc})
</foreach>
</insert>
</mapper>

@ -1,283 +0,0 @@
<?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.order.MdmBuyerManageInfoDao">
<resultMap id="BaseResultMap" type="com.dxhy.order.MdmBuyerManageInfo">
<id column="mdm_buyer_manage_info_id" jdbcType="VARCHAR" property="id" />
<result column="mdm_buyer_manage_info_taxpayer_code" jdbcType="VARCHAR" property="taxpayerCode" />
<result column="mdm_buyer_manage_info_purchase_name" jdbcType="VARCHAR" property="purchaseName" />
<result column="mdm_buyer_manage_info_address" jdbcType="VARCHAR" property="address" />
<result column="mdm_buyer_manage_info_phone" jdbcType="VARCHAR" property="phone" />
<result column="mdm_buyer_manage_info_bank_of_deposit" jdbcType="VARCHAR" property="bankOfDeposit" />
<result column="mdm_buyer_manage_info_bank_number" jdbcType="VARCHAR" property="bankNumber" />
<result column="mdm_buyer_manage_info_sjh" jdbcType="VARCHAR" property="sjh" />
<result column="mdm_buyer_manage_info_email" jdbcType="VARCHAR" property="email" />
<result column="mdm_buyer_manage_info_remarks" jdbcType="VARCHAR" property="remarks" />
<result column="mdm_buyer_manage_info_create_time" jdbcType="TIMESTAMP" property="createTime" />
<result column="mdm_buyer_manage_info_create_user_id" jdbcType="VARCHAR" property="createUserId" />
<result column="mdm_buyer_manage_info_modify_time" jdbcType="TIMESTAMP" property="modifyTime" />
<result column="mdm_buyer_manage_info_modify_user_id" jdbcType="VARCHAR" property="modifyUserId" />
<result column="mdm_buyer_manage_info_ghf_qylx" jdbcType="VARCHAR" property="ghfQylx" />
<result column="mdm_buyer_manage_info_xhf_nsrsbh" jdbcType="VARCHAR" property="xhfNsrsbh" />
<result column="mdm_buyer_manage_info_xhf_mc" jdbcType="VARCHAR" property="xhfMc" />
<result column="mdm_buyer_manage_info_buyer_code" jdbcType="VARCHAR" property="buyerCode" />
<result column="mdm_buyer_manage_info_invoice_name" jdbcType="VARCHAR" property="invoiceName" />
<result column="mdm_buyer_manage_info_invoice_taxno" jdbcType="VARCHAR" property="invoiceTaxno" />
<result column="mdm_buyer_manage_info_mdm_multicode_json" jdbcType="VARCHAR" property="mdmMulticodeJson" />
</resultMap>
<sql id="Base_Column_List">
mdm_buyer_manage_info.id as mdm_buyer_manage_info_id, mdm_buyer_manage_info.taxpayer_code as mdm_buyer_manage_info_taxpayer_code,
mdm_buyer_manage_info.purchase_name as mdm_buyer_manage_info_purchase_name, mdm_buyer_manage_info.address as mdm_buyer_manage_info_address,
mdm_buyer_manage_info.phone as mdm_buyer_manage_info_phone, mdm_buyer_manage_info.bank_of_deposit as mdm_buyer_manage_info_bank_of_deposit,
mdm_buyer_manage_info.bank_number as mdm_buyer_manage_info_bank_number, mdm_buyer_manage_info.sjh as mdm_buyer_manage_info_sjh,
mdm_buyer_manage_info.email as mdm_buyer_manage_info_email, mdm_buyer_manage_info.remarks as mdm_buyer_manage_info_remarks,
mdm_buyer_manage_info.create_time as mdm_buyer_manage_info_create_time, mdm_buyer_manage_info.create_user_id as mdm_buyer_manage_info_create_user_id,
mdm_buyer_manage_info.modify_time as mdm_buyer_manage_info_modify_time, mdm_buyer_manage_info.modify_user_id as mdm_buyer_manage_info_modify_user_id,
mdm_buyer_manage_info.ghf_qylx as mdm_buyer_manage_info_ghf_qylx, mdm_buyer_manage_info.xhf_nsrsbh as mdm_buyer_manage_info_xhf_nsrsbh,
mdm_buyer_manage_info.xhf_mc as mdm_buyer_manage_info_xhf_mc, mdm_buyer_manage_info.buyer_code as mdm_buyer_manage_info_buyer_code,
mdm_buyer_manage_info.invoice_name as mdm_buyer_manage_info_invoice_name, mdm_buyer_manage_info.invoice_taxno as mdm_buyer_manage_info_invoice_taxno,
mdm_buyer_manage_info.mdm_multicode_json as mdm_buyer_manage_info_mdm_multicode_json
</sql>
<select id="selectByPrimaryKey" parameterType="java.lang.String" resultMap="BaseResultMap">
select
<include refid="Base_Column_List" />
from mdm_buyer_manage_info mdm_buyer_manage_info
where mdm_buyer_manage_info.id = #{id,jdbcType=VARCHAR}
</select>
<delete id="deleteByPrimaryKey" parameterType="java.lang.String">
delete from mdm_buyer_manage_info
where id = #{id,jdbcType=VARCHAR}
</delete>
<insert id="insert" keyColumn="id" keyProperty="id" parameterType="com.dxhy.order.MdmBuyerManageInfo" useGeneratedKeys="true">
insert into mdm_buyer_manage_info (taxpayer_code, purchase_name, address,
phone, bank_of_deposit, bank_number,
sjh, email, remarks,
create_time, create_user_id, modify_time,
modify_user_id, ghf_qylx, xhf_nsrsbh,
xhf_mc, buyer_code, invoice_name,
invoice_taxno, mdm_multicode_json)
values (#{taxpayerCode,jdbcType=VARCHAR}, #{purchaseName,jdbcType=VARCHAR}, #{address,jdbcType=VARCHAR},
#{phone,jdbcType=VARCHAR}, #{bankOfDeposit,jdbcType=VARCHAR}, #{bankNumber,jdbcType=VARCHAR},
#{sjh,jdbcType=VARCHAR}, #{email,jdbcType=VARCHAR}, #{remarks,jdbcType=VARCHAR},
#{createTime,jdbcType=TIMESTAMP}, #{createUserId,jdbcType=VARCHAR}, #{modifyTime,jdbcType=TIMESTAMP},
#{modifyUserId,jdbcType=VARCHAR}, #{ghfQylx,jdbcType=VARCHAR}, #{xhfNsrsbh,jdbcType=VARCHAR},
#{xhfMc,jdbcType=VARCHAR}, #{buyerCode,jdbcType=VARCHAR}, #{invoiceName,jdbcType=VARCHAR},
#{invoiceTaxno,jdbcType=VARCHAR}, #{mdmMulticodeJson,jdbcType=VARCHAR})
</insert>
<insert id="insertSelective" keyColumn="id" keyProperty="id" parameterType="com.dxhy.order.MdmBuyerManageInfo" useGeneratedKeys="true">
insert into mdm_buyer_manage_info
<trim prefix="(" suffix=")" suffixOverrides=",">
<if test="taxpayerCode != null">
taxpayer_code,
</if>
<if test="purchaseName != null">
purchase_name,
</if>
<if test="address != null">
address,
</if>
<if test="phone != null">
phone,
</if>
<if test="bankOfDeposit != null">
bank_of_deposit,
</if>
<if test="bankNumber != null">
bank_number,
</if>
<if test="sjh != null">
sjh,
</if>
<if test="email != null">
email,
</if>
<if test="remarks != null">
remarks,
</if>
<if test="createTime != null">
create_time,
</if>
<if test="createUserId != null">
create_user_id,
</if>
<if test="modifyTime != null">
modify_time,
</if>
<if test="modifyUserId != null">
modify_user_id,
</if>
<if test="ghfQylx != null">
ghf_qylx,
</if>
<if test="xhfNsrsbh != null">
xhf_nsrsbh,
</if>
<if test="xhfMc != null">
xhf_mc,
</if>
<if test="buyerCode != null">
buyer_code,
</if>
<if test="invoiceName != null">
invoice_name,
</if>
<if test="invoiceTaxno != null">
invoice_taxno,
</if>
<if test="mdmMulticodeJson != null">
mdm_multicode_json,
</if>
</trim>
<trim prefix="values (" suffix=")" suffixOverrides=",">
<if test="taxpayerCode != null">
#{taxpayerCode,jdbcType=VARCHAR},
</if>
<if test="purchaseName != null">
#{purchaseName,jdbcType=VARCHAR},
</if>
<if test="address != null">
#{address,jdbcType=VARCHAR},
</if>
<if test="phone != null">
#{phone,jdbcType=VARCHAR},
</if>
<if test="bankOfDeposit != null">
#{bankOfDeposit,jdbcType=VARCHAR},
</if>
<if test="bankNumber != null">
#{bankNumber,jdbcType=VARCHAR},
</if>
<if test="sjh != null">
#{sjh,jdbcType=VARCHAR},
</if>
<if test="email != null">
#{email,jdbcType=VARCHAR},
</if>
<if test="remarks != null">
#{remarks,jdbcType=VARCHAR},
</if>
<if test="createTime != null">
#{createTime,jdbcType=TIMESTAMP},
</if>
<if test="createUserId != null">
#{createUserId,jdbcType=VARCHAR},
</if>
<if test="modifyTime != null">
#{modifyTime,jdbcType=TIMESTAMP},
</if>
<if test="modifyUserId != null">
#{modifyUserId,jdbcType=VARCHAR},
</if>
<if test="ghfQylx != null">
#{ghfQylx,jdbcType=VARCHAR},
</if>
<if test="xhfNsrsbh != null">
#{xhfNsrsbh,jdbcType=VARCHAR},
</if>
<if test="xhfMc != null">
#{xhfMc,jdbcType=VARCHAR},
</if>
<if test="buyerCode != null">
#{buyerCode,jdbcType=VARCHAR},
</if>
<if test="invoiceName != null">
#{invoiceName,jdbcType=VARCHAR},
</if>
<if test="invoiceTaxno != null">
#{invoiceTaxno,jdbcType=VARCHAR},
</if>
<if test="mdmMulticodeJson != null">
#{mdmMulticodeJson,jdbcType=VARCHAR},
</if>
</trim>
</insert>
<update id="updateByPrimaryKeySelective" parameterType="com.dxhy.order.MdmBuyerManageInfo">
update mdm_buyer_manage_info
<set>
<if test="taxpayerCode != null">
taxpayer_code = #{taxpayerCode,jdbcType=VARCHAR},
</if>
<if test="purchaseName != null">
purchase_name = #{purchaseName,jdbcType=VARCHAR},
</if>
<if test="address != null">
address = #{address,jdbcType=VARCHAR},
</if>
<if test="phone != null">
phone = #{phone,jdbcType=VARCHAR},
</if>
<if test="bankOfDeposit != null">
bank_of_deposit = #{bankOfDeposit,jdbcType=VARCHAR},
</if>
<if test="bankNumber != null">
bank_number = #{bankNumber,jdbcType=VARCHAR},
</if>
<if test="sjh != null">
sjh = #{sjh,jdbcType=VARCHAR},
</if>
<if test="email != null">
email = #{email,jdbcType=VARCHAR},
</if>
<if test="remarks != null">
remarks = #{remarks,jdbcType=VARCHAR},
</if>
<if test="createTime != null">
create_time = #{createTime,jdbcType=TIMESTAMP},
</if>
<if test="createUserId != null">
create_user_id = #{createUserId,jdbcType=VARCHAR},
</if>
<if test="modifyTime != null">
modify_time = #{modifyTime,jdbcType=TIMESTAMP},
</if>
<if test="modifyUserId != null">
modify_user_id = #{modifyUserId,jdbcType=VARCHAR},
</if>
<if test="ghfQylx != null">
ghf_qylx = #{ghfQylx,jdbcType=VARCHAR},
</if>
<if test="xhfNsrsbh != null">
xhf_nsrsbh = #{xhfNsrsbh,jdbcType=VARCHAR},
</if>
<if test="xhfMc != null">
xhf_mc = #{xhfMc,jdbcType=VARCHAR},
</if>
<if test="buyerCode != null">
buyer_code = #{buyerCode,jdbcType=VARCHAR},
</if>
<if test="invoiceName != null">
invoice_name = #{invoiceName,jdbcType=VARCHAR},
</if>
<if test="invoiceTaxno != null">
invoice_taxno = #{invoiceTaxno,jdbcType=VARCHAR},
</if>
<if test="mdmMulticodeJson != null">
mdm_multicode_json = #{mdmMulticodeJson,jdbcType=VARCHAR},
</if>
</set>
where id = #{id,jdbcType=VARCHAR}
</update>
<update id="updateByPrimaryKey" parameterType="com.dxhy.order.MdmBuyerManageInfo">
update mdm_buyer_manage_info
set taxpayer_code = #{taxpayerCode,jdbcType=VARCHAR},
purchase_name = #{purchaseName,jdbcType=VARCHAR},
address = #{address,jdbcType=VARCHAR},
phone = #{phone,jdbcType=VARCHAR},
bank_of_deposit = #{bankOfDeposit,jdbcType=VARCHAR},
bank_number = #{bankNumber,jdbcType=VARCHAR},
sjh = #{sjh,jdbcType=VARCHAR},
email = #{email,jdbcType=VARCHAR},
remarks = #{remarks,jdbcType=VARCHAR},
create_time = #{createTime,jdbcType=TIMESTAMP},
create_user_id = #{createUserId,jdbcType=VARCHAR},
modify_time = #{modifyTime,jdbcType=TIMESTAMP},
modify_user_id = #{modifyUserId,jdbcType=VARCHAR},
ghf_qylx = #{ghfQylx,jdbcType=VARCHAR},
xhf_nsrsbh = #{xhfNsrsbh,jdbcType=VARCHAR},
xhf_mc = #{xhfMc,jdbcType=VARCHAR},
buyer_code = #{buyerCode,jdbcType=VARCHAR},
invoice_name = #{invoiceName,jdbcType=VARCHAR},
invoice_taxno = #{invoiceTaxno,jdbcType=VARCHAR},
mdm_multicode_json = #{mdmMulticodeJson,jdbcType=VARCHAR}
where id = #{id,jdbcType=VARCHAR}
</update>
</mapper>
Loading…
Cancel
Save