基础信息往来信息代码提交

master
郑明梁 2 years ago
parent 35ada6f5ef
commit 5fd7c291d0

@ -0,0 +1,159 @@
package com.glxp.api.controller.basic;
import com.github.pagehelper.PageInfo;
import com.glxp.api.common.enums.ResultEnum;
import com.glxp.api.common.res.BaseResponse;
import com.glxp.api.common.util.ResultVOUtils;
import com.glxp.api.constant.BasicProcessStatus;
import com.glxp.api.entity.basic.BasicCorpEntity;
import com.glxp.api.entity.basic.BasicCorpsExportLogEntity;
import com.glxp.api.req.basic.BasicCorpsExportRequest;
import com.glxp.api.req.basic.BasicUnitMaintainFilterRequest;
import com.glxp.api.req.basic.FilterCorpExportLogRequest;
import com.glxp.api.req.system.DeleteRequest;
import com.glxp.api.res.PageSimpleResponse;
import com.glxp.api.res.basic.BasicCorpExportLogResponse;
import com.glxp.api.service.basic.BasicCorpExportLogService;
import com.glxp.api.service.basic.BasicUnitMaintainService;
import com.glxp.api.util.CustomUtil;
import org.springframework.validation.BindingResult;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RestController;
import javax.annotation.Resource;
import javax.servlet.http.HttpServletResponse;
import java.io.File;
import java.io.FileInputStream;
import java.io.OutputStream;
import java.util.Date;
import java.util.List;
@RestController
public class BasicCorpExportLogController {
@Resource
BasicGenExcelService basicGenExcelService;
@Resource
BasicCorpExportLogService basicCorpExportLogService;
@Resource
private BasicUnitMaintainService basicUnitMaintainService;
@Resource
private BasicGenJsonService basicGenJsonService;;
@GetMapping("/udiwms/corps/exportLog/filter")
public BaseResponse filter(FilterCorpExportLogRequest filterCorpExportLogRequest,
BindingResult bindingResult) {
if (bindingResult.hasErrors()) {
return ResultVOUtils.error(ResultEnum.PARAM_VERIFY_FALL, bindingResult.getFieldError().getDefaultMessage());
}
List<BasicCorpsExportLogEntity> corpExportLogEntities
= basicCorpExportLogService.filterCorpExportLog(filterCorpExportLogRequest);
PageInfo<BasicCorpsExportLogEntity> pageInfo;
pageInfo = new PageInfo<>(corpExportLogEntities);
PageSimpleResponse<BasicCorpsExportLogEntity> pageSimpleResponse = new PageSimpleResponse<>();
pageSimpleResponse.setTotal(pageInfo.getTotal());
pageSimpleResponse.setList(corpExportLogEntities);
return ResultVOUtils.success(pageSimpleResponse);
}
@PostMapping("/udiwms/corps/exportLog/deleteLog")
public BaseResponse deleteLog(@RequestBody DeleteRequest deleteRequest, BindingResult bindingResult) {
if (bindingResult.hasErrors()) {
return ResultVOUtils.error(ResultEnum.PARAM_VERIFY_FALL, bindingResult.getFieldError().getDefaultMessage());
}
String id = deleteRequest.getId();
basicCorpExportLogService.deleteById(id + "");
return ResultVOUtils.success("删除成功");
}
//往来单位excel文件下载
@GetMapping("/udiwms/corps/exportLog/download")
public void download(FilterCorpExportLogRequest filterCorpExportLogRequest, HttpServletResponse res) {
List<BasicCorpsExportLogEntity> corpExportLogEntities = basicCorpExportLogService.filterCorpExportLog(filterCorpExportLogRequest);
BasicCorpsExportLogEntity corpExportLogEntity = corpExportLogEntities.get(0);
try {
String filePath = corpExportLogEntity.getFilePath();
String fileName = "temp";
if (filePath != null && filePath.length() > 0) {
String[] data = filePath.split("/");
fileName = data[data.length - 1];
}
res.setHeader("Content-disposition", "attachment;fileName=" + fileName);
res.setContentType("text/plain;charset=UTF-8");
FileInputStream input = new FileInputStream(new File(filePath));
OutputStream out = res.getOutputStream();
byte[] b = new byte[2048];
int len;
while ((len = input.read(b)) != -1) {
out.write(b, 0, len);
}
input.close();
if (corpExportLogEntity.getDlCount() == 0) {
corpExportLogEntity.setDlCount(1);
} else {
corpExportLogEntity.setDlCount(corpExportLogEntity.getDlCount() + 1);
}
basicCorpExportLogService.updateCorpExportLog(corpExportLogEntity);
} catch (Exception ex) {
System.out.println("下载失败!");
}
}
//往来单位导出生成Excel并创建生成记录
@PostMapping("/udiwms/corps/importLog/export")
public BaseResponse excelDownload(@RequestBody BasicCorpsExportRequest basicCorpsExportRequest) {
String fileName = "D:\\udiwms\\exportFile\\" + "往来单位信息导出" + System.currentTimeMillis() + ".udi";
BasicCorpsExportLogEntity corpExportLogEntity = new BasicCorpsExportLogEntity();
corpExportLogEntity.setStatus(BasicProcessStatus.UDIINFO_IMPORT_PROCESS);
String genKey = CustomUtil.getId();
corpExportLogEntity.setGenKey(genKey);
corpExportLogEntity.setFilePath(fileName);
corpExportLogEntity.setUpdateTime(new Date());
corpExportLogEntity.setDlCount(0);
corpExportLogEntity.setType(BasicProcessStatus.EXPORT_JSON);
basicCorpExportLogService.insertCorpExportLog(corpExportLogEntity);
//basicGenExcelService.exportCorp(genKey, corpsExportRequest);
basicGenJsonService.exportCorp(genKey, basicCorpsExportRequest);
return ResultVOUtils.success("后台正在导出生成udi文件请稍后刷新查看!");
}
//往来单位上传SMP并创建生成记录
@PostMapping("/udiwms/corps/importLog/uploadSmp")
public BaseResponse uploadSmp(@RequestBody BasicCorpsExportRequest basicCorpsExportRequest) {
BasicCorpsExportLogEntity corpExportLogEntity = new BasicCorpsExportLogEntity();
corpExportLogEntity.setStatus(BasicProcessStatus.UDIINFO_IMPORT_PROCESS);
String genKey = CustomUtil.getId();
corpExportLogEntity.setGenKey(genKey);
corpExportLogEntity.setUpdateTime(new Date());
corpExportLogEntity.setDlCount(0);
corpExportLogEntity.setType(BasicProcessStatus.EXPORT_SMP);
basicCorpExportLogService.insertCorpExportLog(corpExportLogEntity);
BasicCorpExportLogResponse basicUnitMaintainExportResponse = basicGenJsonService.exportCorpJson(basicCorpsExportRequest);
basicGenExcelService.uploadCorpSmpJson(genKey, basicUnitMaintainExportResponse);
return ResultVOUtils.success("后台正在上传,请稍后刷新查看!");
}
//往来单位接口下载(第三方使用)
@GetMapping("/udiwms/basic/corps/download")
public BaseResponse filterBasicUnitMaintain(BasicUnitMaintainFilterRequest basicUnitMaintainFilterRequest,
BindingResult bindingResult) {
if (bindingResult.hasErrors()) {
return ResultVOUtils.error(ResultEnum.PARAM_VERIFY_FALL, bindingResult.getFieldError().getDefaultMessage());
}
List<BasicCorpEntity> basicUnitMaintainEntities;
basicUnitMaintainEntities = basicUnitMaintainService.filterList(basicUnitMaintainFilterRequest);
PageInfo<BasicCorpEntity> pageInfo = new PageInfo<>(basicUnitMaintainEntities);
PageSimpleResponse<BasicCorpEntity> pageSimpleResponse = new PageSimpleResponse<>();
pageSimpleResponse.setTotal(pageInfo.getTotal());
pageSimpleResponse.setList(basicUnitMaintainEntities);
return ResultVOUtils.success(pageSimpleResponse);
}
}

@ -0,0 +1,188 @@
package com.glxp.api.controller.basic;
import cn.hutool.core.io.IoUtil;
import cn.hutool.json.JSONUtil;
import com.github.pagehelper.PageInfo;
import com.glxp.api.common.enums.ResultEnum;
import com.glxp.api.common.res.BaseResponse;
import com.glxp.api.common.util.ResultVOUtils;
import com.glxp.api.constant.BasicProcessStatus;
import com.glxp.api.entity.basic.BasicCorpsImportDetailEntity;
import com.glxp.api.entity.basic.BasicCorpsImportLogEntity;
import com.glxp.api.req.basic.FilterCorpImportLogRequest;
import com.glxp.api.req.basic.PostBasicCorpRequest;
import com.glxp.api.req.system.DeleteRequest;
import com.glxp.api.res.PageSimpleResponse;
import com.glxp.api.res.basic.BasicCorpExportLogResponse;
import com.glxp.api.service.basic.BasicCorpImportDetailService;
import com.glxp.api.service.basic.BasicCorpImportLogService;
import com.glxp.api.service.thrsys.ThrSystemService;
import com.glxp.api.util.CustomUtil;
import lombok.extern.slf4j.Slf4j;
import org.springframework.validation.BindingResult;
import org.springframework.web.bind.annotation.*;
import org.springframework.web.multipart.MultipartFile;
import javax.annotation.Resource;
import java.io.File;
import java.util.Date;
import java.util.List;
@Slf4j
@RestController
public class BasicCorpImportLogController {
@Resource
BasicCorpImportLogService basicCorpImportLogService;
@Resource
BasicCorpImportDetailService basicCorpImportDetailService;
@Resource
ThrSystemService thrSystemService;
@GetMapping("/udiwms/corps/importLog/filter")
public BaseResponse filter(FilterCorpImportLogRequest filterCorpImportLogRequest,
BindingResult bindingResult) {
if (bindingResult.hasErrors()) {
return ResultVOUtils.error(ResultEnum.PARAM_VERIFY_FALL, bindingResult.getFieldError().getDefaultMessage());
}
List<BasicCorpsImportLogEntity> udiInfoImportLogEntities
= basicCorpImportLogService.filterImportLog(filterCorpImportLogRequest);
PageInfo<BasicCorpsImportLogEntity> pageInfo;
pageInfo = new PageInfo<>(udiInfoImportLogEntities);
PageSimpleResponse<BasicCorpsImportLogEntity> pageSimpleResponse = new PageSimpleResponse<>();
pageSimpleResponse.setTotal(pageInfo.getTotal());
pageSimpleResponse.setList(udiInfoImportLogEntities);
return ResultVOUtils.success(pageSimpleResponse);
}
@GetMapping("/udiwms/corps/importLog/filterDetail")
public BaseResponse filterDetail(FilterCorpImportLogRequest filterCorpImportLogRequest,
BindingResult bindingResult) {
if (bindingResult.hasErrors()) {
return ResultVOUtils.error(ResultEnum.PARAM_VERIFY_FALL, bindingResult.getFieldError().getDefaultMessage());
}
List<BasicCorpsImportDetailEntity> corpImportDetailEntities = basicCorpImportDetailService.filterCorpImport(filterCorpImportLogRequest);
PageInfo<BasicCorpsImportDetailEntity> pageInfo;
pageInfo = new PageInfo<>(corpImportDetailEntities);
PageSimpleResponse<BasicCorpsImportDetailEntity> pageSimpleResponse = new PageSimpleResponse<>();
pageSimpleResponse.setTotal(pageInfo.getTotal());
pageSimpleResponse.setList(corpImportDetailEntities);
return ResultVOUtils.success(pageSimpleResponse);
}
@PostMapping("/udiwms/corps/importLog/deleteLog")
public BaseResponse deleteLog(@RequestBody DeleteRequest deleteRequest, BindingResult bindingResult) {
if (bindingResult.hasErrors()) {
return ResultVOUtils.error(ResultEnum.PARAM_VERIFY_FALL, bindingResult.getFieldError().getDefaultMessage());
}
String id = deleteRequest.getId();
FilterCorpImportLogRequest filterCorpImportLogRequest = new FilterCorpImportLogRequest();
filterCorpImportLogRequest.setId(Integer.parseInt(id));
List<BasicCorpsImportLogEntity> corpImportLogEntities = basicCorpImportLogService.filterImportLog(filterCorpImportLogRequest);
if (corpImportLogEntities != null && corpImportLogEntities.size() > 0) {
BasicCorpsImportLogEntity corpImportLogEntity = corpImportLogEntities.get(0);
basicCorpImportLogService.deleteById(corpImportLogEntity.getId() + "");
basicCorpImportDetailService.deleteByGenkey(corpImportLogEntity.getGenKey());
}
return ResultVOUtils.success("删除成功");
}
@PostMapping("/udiwms/corps/importLog/delete")
public BaseResponse delete(@RequestBody DeleteRequest deleteRequest, BindingResult bindingResult) {
if (bindingResult.hasErrors()) {
return ResultVOUtils.error(ResultEnum.PARAM_VERIFY_FALL, bindingResult.getFieldError().getDefaultMessage());
}
if (basicCorpImportDetailService.deleteById(deleteRequest.getId()))
return ResultVOUtils.success("删除成功");
else
return ResultVOUtils.error(500, "删除成功");
}
//往来单位信息文件导入
@PostMapping("/udiwms/corps/importLog/upload")
public BaseResponse uploadCorp(@RequestParam("file") List<MultipartFile> files, @RequestParam("thirdSys") String thirdSys) {
String filePath = "D:\\udiwms\\filePath\\";
File createFile = new File(filePath);
if (!createFile.exists()) {
createFile.mkdirs();
}
for (int i = 0; i < files.size(); i++) {
MultipartFile file = files.get(i);
if (file.isEmpty()) {
return ResultVOUtils.error(500, "上传第" + (i++) + "个文件失败");
}
String fileName = file.getOriginalFilename();
//解析数据
try {
String fileType = fileName.substring(fileName.lastIndexOf("."));
if (".udi".equalsIgnoreCase(fileType)) {
String jsonData = IoUtil.read(file.getInputStream()).toString();
BasicCorpExportLogResponse data = JSONUtil.toBean(jsonData, BasicCorpExportLogResponse.class);
//导入日志
BasicCorpsImportLogEntity corpImportLogEntity = new BasicCorpsImportLogEntity();
String genKey = CustomUtil.getId();
corpImportLogEntity.setGenKey(genKey);
corpImportLogEntity.setFromType("文件导入");
corpImportLogEntity.setStatus(BasicProcessStatus.UDIINFO_IMPORT_UNPROCESS);
corpImportLogEntity.setUpdateTime(new Date(System.currentTimeMillis()));
basicCorpImportLogService.insertImportLog(corpImportLogEntity);
basicCorpImportLogService.importJsonData(data);
corpImportLogEntity.setStatus(BasicProcessStatus.UDIINFO_IMPORT_SUCCESS);
basicCorpImportLogService.updateImportLog(corpImportLogEntity);
} else {
return ResultVOUtils.error(500, "请上传udi文件");
}
} catch (Exception e) {
log.error("导入往来单位信息错误,文件名为:{}", fileName);
}
}
return ResultVOUtils.success("上传成功");
}
//往来单位信息接口上传
@PostMapping("/udiwms/basic/corps/upload")
public BaseResponse postUdiInfo(@RequestBody PostBasicCorpRequest postBasicCorpRequest, BindingResult bindingResult) {
if (bindingResult.hasErrors()) {
return ResultVOUtils.error(ResultEnum.PARAM_VERIFY_FALL, bindingResult.getFieldError().getDefaultMessage());
}
String genKey = postBasicCorpRequest.getGenKey();
if (genKey == null) {
genKey = CustomUtil.getId();
}
BasicCorpsImportLogEntity corpImportLogEntity = basicCorpImportLogService.selectByGenKey(genKey);
List<BasicCorpsImportDetailEntity> corpImportDetailEntities = postBasicCorpRequest.getDatas();
if (corpImportDetailEntities != null) {
for (BasicCorpsImportDetailEntity corpImportDetailEntity : corpImportDetailEntities) {
corpImportDetailEntity.setGenKeyFk(genKey);
corpImportDetailEntity.setImportStatus(BasicProcessStatus.UDIINFO_IMPORT_CODE_UNPROCESS);
corpImportDetailEntity.setUpdateTime(new Date());
basicCorpImportDetailService.insertCorpImport(corpImportDetailEntity);
}
}
if (corpImportLogEntity == null) {
corpImportLogEntity = new BasicCorpsImportLogEntity();
corpImportLogEntity.setGenKey(genKey);
corpImportLogEntity.setFromType("接口上传");
corpImportLogEntity.setStatus(BasicProcessStatus.UDIINFO_IMPORT_UNPROCESS);
corpImportLogEntity.setUpdateTime(new Date(System.currentTimeMillis()));
basicCorpImportLogService.insertImportLog(corpImportLogEntity);
} else {
corpImportLogEntity.setStatus(BasicProcessStatus.UDIINFO_IMPORT_UNPROCESS);
basicCorpImportLogService.updateImportLog(corpImportLogEntity);
}
basicCorpImportLogService.importCorps(genKey);
return ResultVOUtils.success("上传成功");
}
}

@ -0,0 +1,389 @@
package com.glxp.api.controller.basic;
import com.alibaba.fastjson.JSONObject;
import com.alibaba.fastjson.TypeReference;
import com.glxp.api.common.res.BaseResponse;
import com.glxp.api.constant.BasicProcessStatus;
import com.glxp.api.constant.ConstantStatus;
import com.glxp.api.entity.basic.BasicCorpEntity;
import com.glxp.api.entity.basic.BasicCorpsExportLogEntity;
import com.glxp.api.entity.system.SyncDataSetEntity;
import com.glxp.api.http.HttpOkClient;
import com.glxp.api.req.basic.BasicCorpsExportRequest;
import com.glxp.api.req.basic.BasicUnitMaintainFilterRequest;
import com.glxp.api.res.basic.BasicCorpExportLogResponse;
import com.glxp.api.res.basic.UdiRelevanceResponse;
import com.glxp.api.service.basic.BasicCorpExportLogService;
import com.glxp.api.service.basic.BasicUnitMaintainService;
import com.glxp.api.service.basic.UdiRelevanceService;
import com.glxp.api.service.system.SyncDataSetService;
import com.glxp.api.service.system.SystemParamConfigService;
import com.glxp.api.util.ExcelUtil;
import org.springframework.beans.BeanUtils;
import org.springframework.scheduling.annotation.Async;
import org.springframework.stereotype.Service;
import javax.annotation.Resource;
import java.io.File;
import java.io.IOException;
import java.util.ArrayList;
import java.util.List;
@Service
public class BasicGenExcelService {
@Resource
SyncDataSetService syncDataSetService;
@Resource
HttpOkClient httpOkClient;
//
public String getIpUrl() {
SyncDataSetEntity syncDataSetEntity = syncDataSetService.findSet();
return syncDataSetEntity.getSyncIp();
}
//
@Resource
BasicCorpExportLogService basicCorpExportLogService;
@Resource
BasicUnitMaintainService basicUnitMaintainService;
// @Resource
// UdiInfoExportLogService udiInfoExportLogService;
// @Resource
// UdiRelevanceService udiRelevanceService;
// @Resource
// SystemParamConfigService systemParamConfigService;
//
//往来单位导出excel文件
@Async
public void exportCorp(String genKey, BasicCorpsExportRequest basicCorpsExportRequest) {
BasicCorpsExportLogEntity corpExportLogEntity = basicCorpExportLogService.selectByGenKey(genKey);
List<List<String>> excelData = new ArrayList<>();
List<String> head = new ArrayList<>();
head.add("往来单位ID");
head.add("往来单位名称");
head.add("往来单位拼音简写");
head.add("地址");
head.add("联系人");
head.add("联系电话");
head.add("社会信用号");
head.add("往来单位状态");
head.add("往来单位类型");
head.add("thirdId");
head.add("thirdName");
head.add("thirdI1d");
head.add("thirdName1");
head.add("thirdId2");
head.add("thirdName2");
head.add("thirdId3");
head.add("thirdName3");
head.add("thirdId4");
head.add("thirdName4");
excelData.add(head);
//选中导出
if (basicCorpsExportRequest.getIds() != null && basicCorpsExportRequest.getIds().size() > 0) {
List<Integer> ids = basicCorpsExportRequest.getIds();
for (Integer id : ids) {
BasicUnitMaintainFilterRequest filterRequest = new BasicUnitMaintainFilterRequest();
filterRequest.setId(id);
List<List<String>> genDatas = genExcelData(filterRequest);
if (genDatas != null && genDatas.size() > 0) {
excelData.addAll(genDatas);
}
}
} else {//一键导出
BasicUnitMaintainFilterRequest filterRequest = new BasicUnitMaintainFilterRequest();
BeanUtils.copyProperties(basicCorpsExportRequest, filterRequest);
filterRequest.setPage(null);
List<List<String>> genDatas = genExcelData(filterRequest);
if (genDatas != null && genDatas.size() > 0) {
excelData.addAll(genDatas);
}
}
String sheetName = "往来单位信息";
File file = new File(corpExportLogEntity.getFilePath());
if (!file.exists()) {
try {
file.createNewFile();
} catch (IOException e) {
e.printStackTrace();
}
}
new ExcelUtil().exportExcel(excelData, sheetName, corpExportLogEntity.getFilePath(), 20);
corpExportLogEntity.setStatus(BasicProcessStatus.UDIINFO_IMPORT_SUCCESS);
basicCorpExportLogService.updateCorpExportLog(corpExportLogEntity);
}
//
// //上传往来单位SMP
// @Async
// public void uploadCorpSmp(String genKey, CorpsExportRequest corpsExportRequest) {
// PostCorpsRequest postCorpsRequest = new PostCorpsRequest();
// postCorpsRequest.setGenKey(genKey);
// List<CorpImportDetailEntity> corpImportDetailEntities = new ArrayList<>();
// CorpExportLogEntity corpExportLogEntity = corpExportLogService.selectByGenKey(genKey);
// //选中导出
// if (corpsExportRequest.getIds() != null && corpsExportRequest.getIds().size() > 0) {
// List<Integer> ids = corpsExportRequest.getIds();
// for (Integer id : ids) {
// BasicUnitMaintainFilterRequest filterRequest = new BasicUnitMaintainFilterRequest();
// filterRequest.setId(id);
// List<BasicUnitMaintainEntity> unitMaintainEntities = basicUnitMaintainService.filterList(filterRequest);
// if (unitMaintainEntities != null && unitMaintainEntities.size() > 0) {
// for (BasicUnitMaintainEntity basicUnitMaintainEntity : unitMaintainEntities) {
// CorpImportDetailEntity corpImportDetailEntity = new CorpImportDetailEntity();
// BeanUtils.copyProperties(basicUnitMaintainEntity, corpImportDetailEntity);
// corpImportDetailEntities.add(corpImportDetailEntity);
// }
// postCorpsRequest.setDatas(corpImportDetailEntities);
//
// }
// }
//
//
// } else {//一键导出
// BasicUnitMaintainFilterRequest filterRequest = new BasicUnitMaintainFilterRequest();
// BeanUtils.copyProperties(corpsExportRequest, filterRequest);
//
// List<BasicUnitMaintainEntity> unitMaintainEntities = basicUnitMaintainService.filterList(filterRequest);
// if (unitMaintainEntities != null && unitMaintainEntities.size() > 0) {
// for (BasicUnitMaintainEntity basicUnitMaintainEntity : unitMaintainEntities) {
// CorpImportDetailEntity corpImportDetailEntity = new CorpImportDetailEntity();
// BeanUtils.copyProperties(basicUnitMaintainEntity, corpImportDetailEntity);
// corpImportDetailEntities.add(corpImportDetailEntity);
// }
// postCorpsRequest.setDatas(corpImportDetailEntities);
//
// }
// }
//
// //todo 上传SMP
//// SystemParamConfigEntity systemParamConfigEntity = systemParamConfigService.selectByParamKey("smp_service_ip");
//// if (systemParamConfigEntity != null) {
// String response = httpOkClient.uCloudPost(getIpUrl() + "/udiwms/basic/corps/upload", postCorpsRequest);
// BaseResponse baseResponse = JSONObject.parseObject(response, new TypeReference<BaseResponse>() {
// });
// if (baseResponse.getCode() == 20000) {
// corpExportLogEntity.setStatus(BasicProcessStatus.UDIINFO_IMPORT_SUCCESS);
// } else {
// corpExportLogEntity.setStatus(BasicProcessStatus.UDIINFO_IMPORT_FAIL);
// }
//// } else {
//// corpExportLogEntity.setRemark("SMP服务IP地址未定义");
//// corpExportLogEntity.setStatus(BasicProcessStatus.UDIINFO_IMPORT_FAIL);
//// }
//
//
// corpExportLogService.updateCorpExportLog(corpExportLogEntity);
// }
//
//
@Async
public void uploadCorpSmpJson(String genKey, BasicCorpExportLogResponse exportData) {
BasicCorpsExportLogEntity corpExportLogEntity = basicCorpExportLogService.selectByGenKey(genKey);
String response = httpOkClient.uCloudPost(getIpUrl() + "/spssync/basic/corp/upload", exportData);
BaseResponse baseResponse = JSONObject.parseObject(response, new TypeReference<BaseResponse>() {
});
if (baseResponse.getCode() == 20000) {
corpExportLogEntity.setStatus(BasicProcessStatus.UDIINFO_IMPORT_SUCCESS);
} else {
corpExportLogEntity.setRemark(baseResponse.getMessage());
corpExportLogEntity.setStatus(BasicProcessStatus.UDIINFO_IMPORT_FAIL);
}
basicCorpExportLogService.updateCorpExportLog(corpExportLogEntity);
}
//
//
// @Async
// public void exportUdiInfo(String genKey, UdiInfoExportRequest udiInfoExportRequest) {
// UdiInfoExportLogEntity udiInfoExportLogEntity = udiInfoExportLogService.selectByGenKey(genKey);
// List<List<String>> excelData = new ArrayList<>();
// List<String> head = new ArrayList<>();
// head.add("udiCode");
// head.add("医保编码");
// head.add("商品条码");
// head.add("thirdId");
// head.add("thirdId1");
// head.add("thirdId2");
// head.add("thirdId3");
// head.add("thirdId4");
// head.add("是否以使用单元入库");
// excelData.add(head);
// //选中导出
// if (udiInfoExportRequest.getUuids() != null && udiInfoExportRequest.getUuids().size() > 0) {
// List<String> uuids = udiInfoExportRequest.getUuids();
// for (String uuid : uuids) {
// FilterUdiInfoRequest filterUdiInfoRequest = new FilterUdiInfoRequest();
// filterUdiInfoRequest.setUuid(uuid);
// List<List<String>> genDatas = genExcelData(filterUdiInfoRequest);
// if (genDatas != null && genDatas.size() > 0) {
// excelData.addAll(genDatas);
// }
// }
//
// } else {//一键导出
// FilterUdiInfoRequest filterUdiInfoRequest = new FilterUdiInfoRequest();
// BeanUtils.copyProperties(udiInfoExportRequest, filterUdiInfoRequest);
// filterUdiInfoRequest.setPage(null);
// List<List<String>> genDatas = genExcelData(filterUdiInfoRequest);
// if (genDatas != null && genDatas.size() > 0) {
// excelData.addAll(genDatas);
// }
// }
//
// String sheetName = "UDI产品信息对照";
//
// File file = new File(udiInfoExportLogEntity.getFilePath());
// if (!file.exists()) {
// try {
// file.createNewFile();
// } catch (IOException e) {
// e.printStackTrace();
// }
// }
// new ExcelUtil().exportExcel(excelData, sheetName, udiInfoExportLogEntity.getFilePath(), 20);
// udiInfoExportLogEntity.setStatus(BasicProcessStatus.UDIINFO_IMPORT_SUCCESS);
// udiInfoExportLogService.updateUdiInfoExportLog(udiInfoExportLogEntity);
// }
//
// @Async
// public void uploadProductsSmpJson(String genKey, UdiRelevanceExportJsonResponse exportData) {
// UdiInfoExportLogEntity udiInfoExportLogEntity = udiInfoExportLogService.selectByGenKey(genKey);
//// String response = HttpClient.uCloudPost(spsSyncUrl + "/udiwms/basic/products/upload", exportData);
// String response = httpOkClient.uCloudPost(getIpUrl() + "/spssync/basic/udiinfo/upload", exportData);
// BaseResponse baseResponse = JSONObject.parseObject(response, new TypeReference<BaseResponse>() {
// });
// if (baseResponse.getCode() == 20000) {
// udiInfoExportLogEntity.setStatus(BasicProcessStatus.UDIINFO_IMPORT_SUCCESS);
// } else {
// udiInfoExportLogEntity.setRemark(baseResponse.getMessage());
// udiInfoExportLogEntity.setStatus(BasicProcessStatus.UDIINFO_IMPORT_FAIL);
// }
// udiInfoExportLogService.updateUdiInfoExportLog(udiInfoExportLogEntity);
// }
//
//
// @Async
// public void uploadProductsSmp(String genKey, UdiInfoExportRequest udiInfoExportRequest) {
// UdiInfoExportLogEntity udiInfoExportLogEntity = udiInfoExportLogService.selectByGenKey(genKey);
// PostUdiInfoRequest postUdiInfoRequest = new PostUdiInfoRequest();
// postUdiInfoRequest.setGenKey(genKey);
// //选中导出
// if (udiInfoExportRequest.getUuids() != null && udiInfoExportRequest.getUuids().size() > 0) {
// List<UdiInfoImportDetailEntity> udiInfoImportDetailEntities = new ArrayList<>();
// List<String> uuids = udiInfoExportRequest.getUuids();
// for (String uuid : uuids) {
// FilterUdiInfoRequest filterUdiInfoRequest = new FilterUdiInfoRequest();
// filterUdiInfoRequest.setUuid(uuid);
// List<UdiInfoImportDetailEntity> genDatas = genSmpData(filterUdiInfoRequest);
// udiInfoImportDetailEntities.addAll(genDatas);
// }
// postUdiInfoRequest.setDatas(udiInfoImportDetailEntities);
//
// } else {//一键导出
// FilterUdiInfoRequest filterUdiInfoRequest = new FilterUdiInfoRequest();
// BeanUtils.copyProperties(udiInfoExportRequest, filterUdiInfoRequest);
// List<UdiInfoImportDetailEntity> genDatas = genSmpData(filterUdiInfoRequest);
// postUdiInfoRequest.setDatas(genDatas);
// }
// //todo 上传SMP
//// SystemParamConfigEntity systemParamConfigEntity = systemParamConfigService.selectByParamKey("smp_service_ip");
//// if (systemParamConfigEntity != null) {
// String response = httpOkClient.uCloudPost(getIpUrl() + "/udiwms/basic/products/upload", postUdiInfoRequest);
// BaseResponse baseResponse = JSONObject.parseObject(response, new TypeReference<BaseResponse>() {
// });
// if (baseResponse.getCode() == 20000) {
// udiInfoExportLogEntity.setStatus(BasicProcessStatus.UDIINFO_IMPORT_SUCCESS);
// } else {
// udiInfoExportLogEntity.setRemark(baseResponse.getMessage());
// udiInfoExportLogEntity.setStatus(BasicProcessStatus.UDIINFO_IMPORT_FAIL);
// }
//// } else {
//// udiInfoExportLogEntity.setRemark("SMP服务IP地址未定义");
//// udiInfoExportLogEntity.setStatus(BasicProcessStatus.UDIINFO_IMPORT_FAIL);
//// }
// udiInfoExportLogService.updateUdiInfoExportLog(udiInfoExportLogEntity);
// }
//
public List<List<String>> genExcelData(BasicUnitMaintainFilterRequest filterUdiInfoRequest) {
List<List<String>> excelData = new ArrayList<>();
List<BasicCorpEntity> unitMaintainEntities = basicUnitMaintainService.filterList(filterUdiInfoRequest);
for (BasicCorpEntity basicUnitMaintainEntity : unitMaintainEntities) {
List<String> rows = new ArrayList<>();
rows.add(basicUnitMaintainEntity.getErpId());
rows.add(basicUnitMaintainEntity.getName());
rows.add(basicUnitMaintainEntity.getSpell());
rows.add(basicUnitMaintainEntity.getAddr());
rows.add(basicUnitMaintainEntity.getContact());
rows.add(basicUnitMaintainEntity.getMobile());
rows.add(basicUnitMaintainEntity.getCreditNo());
rows.add(String.valueOf(basicUnitMaintainEntity.getStatus()));
rows.add(basicUnitMaintainEntity.getType());
rows.add(basicUnitMaintainEntity.getThirdId());
rows.add(basicUnitMaintainEntity.getThirdName());
rows.add(basicUnitMaintainEntity.getThirdId1());
rows.add(basicUnitMaintainEntity.getThirdName1());
rows.add(basicUnitMaintainEntity.getThirdId2());
rows.add(basicUnitMaintainEntity.getThirdName2());
rows.add(basicUnitMaintainEntity.getThirdId3());
rows.add(basicUnitMaintainEntity.getThirdName3());
rows.add(basicUnitMaintainEntity.getThirdId4());
rows.add(basicUnitMaintainEntity.getThirdName4());
excelData.add(rows);
}
return excelData;
}
//
// public List<List<String>> genExcelData(FilterUdiInfoRequest filterUdiInfoRequest) {
//
// List<List<String>> excelData = new ArrayList<>();
// List<UdiRelevanceResponse> udiRelevanceResponses = udiRelevanceService.filterUdiRelevance(filterUdiInfoRequest);
// for (UdiRelevanceResponse udiRelevanceResponse : udiRelevanceResponses) {
// List<String> rows = new ArrayList<>();
// if (udiRelevanceResponse.getProductType() == ConstantStatus.PRODUCT_TYPE_THIRD)
// rows.add(null);
// else
// rows.add(udiRelevanceResponse.getNameCode());
// rows.add(udiRelevanceResponse.getYbbm());
// rows.add(udiRelevanceResponse.getSptm());
// rows.add(udiRelevanceResponse.getThirdId());
// rows.add(udiRelevanceResponse.getThirdId1());
// rows.add(udiRelevanceResponse.getThirdId2());
// rows.add(udiRelevanceResponse.getThirdId3());
// rows.add(udiRelevanceResponse.getThirdId4());
// if (udiRelevanceResponse.getIsUseDy() == 1) {
// rows.add("是");
// } else {
// rows.add("否");
// }
// excelData.add(rows);
// }
// return excelData;
// }
//
// public List<UdiInfoImportDetailEntity> genSmpData(FilterUdiInfoRequest filterUdiInfoRequest) {
// List<UdiInfoImportDetailEntity> udiInfoImportDetailEntities = new ArrayList<>();
// List<UdiRelevanceResponse> udiRelevanceResponses = udiRelevanceService.filterUdiRelevance(filterUdiInfoRequest);
// for (UdiRelevanceResponse udiRelevanceResponse : udiRelevanceResponses) {
// UdiInfoImportDetailEntity udiInfoImportDetailEntity = new UdiInfoImportDetailEntity();
// udiInfoImportDetailEntity.setUdiCode(udiRelevanceResponse.getNameCode());
// udiInfoImportDetailEntity.setYbbm(udiRelevanceResponse.getYbbm());
// udiInfoImportDetailEntity.setSptm(udiRelevanceResponse.getSptm());
// udiInfoImportDetailEntity.setThirdId(udiRelevanceResponse.getThirdId());
// udiInfoImportDetailEntity.setThirdId1(udiRelevanceResponse.getThirdId1());
// udiInfoImportDetailEntity.setThirdId2(udiRelevanceResponse.getThirdId2());
// udiInfoImportDetailEntity.setThirdId3(udiRelevanceResponse.getThirdId3());
// udiInfoImportDetailEntity.setThirdId4(udiRelevanceResponse.getThirdId4());
// if (udiRelevanceResponse.getIsUseDy() == 1) {
// udiInfoImportDetailEntity.setIsUseDy("是");
// } else {
// udiInfoImportDetailEntity.setIsUseDy("否");
// }
// udiInfoImportDetailEntities.add(udiInfoImportDetailEntity);
// }
// return udiInfoImportDetailEntities;
// }
}

@ -0,0 +1,237 @@
package com.glxp.api.controller.basic;
import cn.hutool.core.bean.BeanUtil;
import cn.hutool.core.collection.CollUtil;
import cn.hutool.core.io.file.FileWriter;
import cn.hutool.core.util.ReflectUtil;
import cn.hutool.core.util.StrUtil;
import cn.hutool.json.JSONUtil;
import com.glxp.api.constant.BasicProcessStatus;
import com.glxp.api.dao.thrsys.ThrCorpDao;
import com.glxp.api.entity.basic.BasicCorpEntity;
import com.glxp.api.entity.basic.BasicCorpsExportLogEntity;
import com.glxp.api.entity.thrsys.ThrCorpEntity;
import com.glxp.api.req.basic.BasicCorpsExportRequest;
import com.glxp.api.req.basic.BasicUnitMaintainFilterRequest;
import com.glxp.api.req.thrsys.FilterThrCorpRequest;
import com.glxp.api.res.basic.BasicCorpExportLogResponse;
import com.glxp.api.res.thrsys.ThrCorpsResponse;
import com.glxp.api.service.basic.BasicCorpExportLogService;
import com.glxp.api.service.basic.BasicUnitMaintainService;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.BeanUtils;
import org.springframework.scheduling.annotation.Async;
import org.springframework.stereotype.Service;
import javax.annotation.Resource;
import java.io.File;
import java.lang.reflect.Field;
import java.util.ArrayList;
import java.util.List;
@Slf4j
@Service
public class BasicGenJsonService {
@Resource
BasicCorpExportLogService corpExportLogService;
@Resource
BasicUnitMaintainService basicUnitMaintainService;
// @Resource
// UdiInfoExportLogService udiInfoExportLogService;
// @Resource
// UdiRelevanceService udiRelevanceService;
// @Resource
// UdiRelevanceDao udiRelevanceDao;
// @Resource
// UdiInfoDao udiInfoDao;
// @Resource
// ThrProductsDao thrProductsDao;
@Resource
ThrCorpDao thrCorpDao;
public void exportCorp(String genKey, BasicCorpsExportRequest basicCorpsExportRequest) {
BasicCorpsExportLogEntity corpExportLogEntity = corpExportLogService.selectByGenKey(genKey);
BasicCorpExportLogResponse exportData = new BasicCorpExportLogResponse();
List<BasicCorpEntity> unitMaintainEntities = new ArrayList<>();
if (basicCorpsExportRequest.getIds() != null && basicCorpsExportRequest.getIds().size() > 0) {
List<Integer> ids = basicCorpsExportRequest.getIds();
ids.forEach(id -> {
BasicUnitMaintainFilterRequest request = new BasicUnitMaintainFilterRequest();
request.setId(id);
List<BasicCorpEntity> basicUnitMaintainEntities = basicUnitMaintainService.filterList(request);
unitMaintainEntities.addAll(basicUnitMaintainEntities);
getThrCorpList(exportData, basicUnitMaintainEntities);
});
} else { //一键导出
BasicUnitMaintainFilterRequest filterRequest = new BasicUnitMaintainFilterRequest();
BeanUtils.copyProperties(basicCorpsExportRequest, filterRequest);
filterRequest.setPage(null);
List<BasicCorpEntity> basicUnitMaintainEntities = basicUnitMaintainService.filterList(filterRequest);
unitMaintainEntities.addAll(basicUnitMaintainEntities);
getThrCorpList(exportData, basicUnitMaintainEntities);
}
exportData.setCorpList(unitMaintainEntities);
FileWriter writer = new FileWriter(corpExportLogEntity.getFilePath());
writer.write(JSONUtil.toJsonStr(exportData));
corpExportLogEntity.setStatus(BasicProcessStatus.UDIINFO_IMPORT_SUCCESS);
corpExportLogService.updateCorpExportLog(corpExportLogEntity);
}
public BasicCorpExportLogResponse exportCorpJson(BasicCorpsExportRequest corpsExportRequest) {
BasicCorpExportLogResponse exportData = new BasicCorpExportLogResponse();
List<BasicCorpEntity> unitMaintainEntities = new ArrayList<>();
if (corpsExportRequest.getIds() != null && corpsExportRequest.getIds().size() > 0) {
List<Integer> ids = corpsExportRequest.getIds();
ids.forEach(id -> {
BasicUnitMaintainFilterRequest request = new BasicUnitMaintainFilterRequest();
request.setId(id);
List<BasicCorpEntity> basicUnitMaintainEntities = basicUnitMaintainService.filterList(request);
unitMaintainEntities.addAll(basicUnitMaintainEntities);
getThrCorpList(exportData, basicUnitMaintainEntities);
});
} else { //一键导出
BasicUnitMaintainFilterRequest filterRequest = new BasicUnitMaintainFilterRequest();
BeanUtils.copyProperties(corpsExportRequest, filterRequest);
filterRequest.setPage(null);
List<BasicCorpEntity> basicUnitMaintainEntities = basicUnitMaintainService.filterList(filterRequest);
unitMaintainEntities.addAll(basicUnitMaintainEntities);
getThrCorpList(exportData, basicUnitMaintainEntities);
}
exportData.setCorpList(unitMaintainEntities);
return exportData;
}
//
/**
*
*
* @param exportData
* @param basicUnitMaintainEntities
*/
private void getThrCorpList(BasicCorpExportLogResponse exportData, List<BasicCorpEntity> basicUnitMaintainEntities) {
if (CollUtil.isNotEmpty(basicUnitMaintainEntities)) {
List<ThrCorpsResponse> thrCorpEntities = new ArrayList<>();
Field[] fields = ReflectUtil.getFields(BasicCorpEntity.class);
basicUnitMaintainEntities.forEach(basicUnitMaintainEntity -> {
for (Field field : fields) {
if (field.getName().contains("thirdId")) {
String value = String.valueOf(ReflectUtil.getFieldValue(basicUnitMaintainEntity, field));
if (StrUtil.isNotBlank(value)) {
FilterThrCorpRequest thrCorpRequest = new FilterThrCorpRequest();
thrCorpRequest.setThirdSysFk("thirdId");
thrCorpRequest.setUnitId(value);
List<ThrCorpsResponse> result = thrCorpDao.filterThrCorps(thrCorpRequest);
if (CollUtil.isNotEmpty(result)) {
thrCorpEntities.addAll(result);
}
}
}
}
});
if (CollUtil.isNotEmpty(thrCorpEntities)) {
exportData.setThrCorpEntities(thrCorpEntities);
}
}
}
//
// /**
// * 导出json格式医疗器械信息
// *
// * @param genKey
// * @param udiInfoExportRequest
// */
// @Async
// public void exportUdiInfoJson(String genKey, UdiInfoExportRequest udiInfoExportRequest) {
// UdiInfoExportLogEntity udiInfoExportLogEntity = udiInfoExportLogService.selectByGenKey(genKey);
// UdiRelevanceExportJsonResponse exportData = paresDataJson(udiInfoExportRequest);
// File file = new File(udiInfoExportLogEntity.getFilePath());
// if (!file.exists()) {
// try {
// file.createNewFile();
// } catch (Exception e) {
// log.error("导出医疗器械信息异常", e);
// }
// }
// FileWriter writer = new FileWriter(file);
// writer.write(JSONUtil.toJsonStr(exportData));
// udiInfoExportLogEntity.setStatus(BasicProcessStatus.UDIINFO_IMPORT_SUCCESS);
// udiInfoExportLogService.updateUdiInfoExportLog(udiInfoExportLogEntity);
// }
//
//
// public UdiRelevanceExportJsonResponse paresDataJson(UdiInfoExportRequest udiInfoExportRequest) {
// UdiRelevanceExportJsonResponse exportData = new UdiRelevanceExportJsonResponse();
// //选中导出
// if (CollUtil.isNotEmpty(udiInfoExportRequest.getUuids())) {
// List<String> uuids = udiInfoExportRequest.getUuids();
// uuids.forEach(uuid -> {
// FilterUdiInfoRequest filterUdiInfoRequest = new FilterUdiInfoRequest();
// filterUdiInfoRequest.setUuid(uuid);
// List<UdiRelevanceResponse> udiRelevanceResponses = udiRelevanceService.filterUdiRelevance(filterUdiInfoRequest);
// if (CollUtil.isNotEmpty(udiRelevanceResponses)) {
// parseUdiRelevanceResponses(exportData, udiRelevanceResponses);
// }
// });
// } else {
// //一键导出
// FilterUdiInfoRequest filterUdiInfoRequest = new FilterUdiInfoRequest();
// BeanUtil.copyProperties(udiInfoExportRequest, filterUdiInfoRequest);
// filterUdiInfoRequest.setPage(null);
// List<UdiRelevanceResponse> data = udiRelevanceService.filterUdiRelevance(filterUdiInfoRequest);
// if (CollUtil.isNotEmpty(data)) {
// parseUdiRelevanceResponses(exportData, data);
// }
// }
// return exportData;
// }
//
// /**
// * 解析医疗器械信息查询结果,封装完整数据
// *
// * @param exportData
// * @param udiRelevanceResponses
// */
// private void parseUdiRelevanceResponses(UdiRelevanceExportJsonResponse exportData, List<UdiRelevanceResponse> udiRelevanceResponses) {
// List<String> uuids = new ArrayList<>(udiRelevanceResponses.size());
// udiRelevanceResponses.forEach(udi -> {
// uuids.add(udi.getUuid());
// });
// List<UdiInfoEntity> udiInfoEntities = udiInfoDao.batchSelectByUuid(uuids);
// List<UdiRelevanceEntity> udiRelevanceEntities = udiRelevanceDao.batchSelectByUuid(uuids);
// if (CollUtil.isNotEmpty(udiRelevanceEntities)) {
// List<ThrProductsEntity> thrProductsEntities = new ArrayList<>(udiRelevanceEntities.size());
// Field[] fields = ReflectUtil.getFields(UdiRelevanceEntity.class);
// udiRelevanceEntities.forEach(udiRelevanceEntity -> {
// for (Field field : fields) {
// if (field.getName().contains("thirdId")) {
// Object fieldValue = ReflectUtil.getFieldValue(udiRelevanceEntity, field);
// if (null != fieldValue) {
// FilterThrProductsRequest filter = new FilterThrProductsRequest();
// filter.setCode(String.valueOf(fieldValue));
// filter.setThirdSysFk("thirdId");
// List<ThrProductsEntity> result = thrProductsDao.filterThrProductsRequest(filter);
// if (CollUtil.isNotEmpty(result)) {
// thrProductsEntities.addAll(result);
// }
// }
// }
// }
// });
// if (CollUtil.isNotEmpty(thrProductsEntities)) {
// exportData.setThrProductsEntities(thrProductsEntities);
// }
// }
// List<UdiInfoEntity> udiInfo = exportData.getUdiInfoEntities();
// List<UdiRelevanceEntity> udiRelevance = exportData.getUdiRelevanceEntities();
// udiInfo.addAll(udiInfoEntities);
// udiRelevance.addAll(udiRelevanceEntities);
// exportData.setUdiInfoEntities(udiInfo);
// exportData.setUdiRelevanceEntities(udiRelevance);
// }
}

@ -9,19 +9,23 @@ import com.glxp.api.constant.ConstantStatus;
import com.glxp.api.entity.basic.BasicCorpEntity;
import com.glxp.api.entity.system.SystemParamConfigEntity;
import com.glxp.api.entity.thrsys.ThrCorpEntity;
import com.glxp.api.entity.thrsys.ThrSystemDetailEntity;
import com.glxp.api.entity.thrsys.ThrSystemEntity;
import com.glxp.api.http.ErpBasicClient;
import com.glxp.api.req.basic.BasicUnitMaintainFilterRequest;
import com.glxp.api.req.basic.CombineUnitRequest;
import com.glxp.api.req.system.DeleteRequest;
import com.glxp.api.req.thrsys.FilterBasicThirdSysRequest;
import com.glxp.api.req.thrsys.FilterThrCorpRequest;
import com.glxp.api.res.PageSimpleResponse;
import com.glxp.api.res.basic.BasicErpUnitsResponse;
import com.glxp.api.res.basic.BasicProductThirdSysResponse;
import com.glxp.api.res.basic.BasicUnitMaintainResponse;
import com.glxp.api.service.basic.BasicUnitMaintainService;
import com.glxp.api.service.system.CompanyService;
import com.glxp.api.service.system.SystemParamConfigService;
import com.glxp.api.service.thrsys.ThrCorpService;
import com.glxp.api.service.thrsys.ThrSystemDetailService;
import com.glxp.api.service.thrsys.ThrSystemService;
import com.glxp.api.util.CustomUtil;
import org.apache.commons.lang3.StringUtils;
@ -45,8 +49,8 @@ public class BasicUnitMaintainController {
@Resource
private BasicUnitMaintainService basicUnitMaintainService;
// @Resource
// BasicThirdSysDetailService basicThirdSysDetailService;
@Resource
ThrSystemDetailService thrSystemDetailService;
@Resource
private SystemParamConfigService systemParamConfigService;
@Resource
@ -77,17 +81,7 @@ public class BasicUnitMaintainController {
pageSimpleResponse.setTotal(pageInfo.getTotal());
pageSimpleResponse.setList(basicUnitMaintainEntities);
SystemParamConfigEntity systemParamConfigEntityBUMErpId = systemParamConfigService.selectByParamKey("basic_unit_maintain_erp_id");
SystemParamConfigEntity systemParamConfigEntityBUMThirdId = systemParamConfigService.selectByParamKey("basic_cops_thirdSys");
Map<String, Object> rMap = new HashMap<>();
rMap.put("BUMErpIdValue",
systemParamConfigEntityBUMErpId != null && StringUtils.isNotBlank(systemParamConfigEntityBUMErpId.getParamValue()) ?
systemParamConfigEntityBUMErpId.getParamValue() : "0");
rMap.put("BUMThirdIdValue",
systemParamConfigEntityBUMThirdId != null && StringUtils.isNotBlank(systemParamConfigEntityBUMThirdId.getParamValue()) ?
systemParamConfigEntityBUMThirdId.getParamValue() : "0");
rMap.put("page", pageSimpleResponse);
return ResultVOUtils.success(rMap);
return ResultVOUtils.success(pageSimpleResponse);
}
@GetMapping("/udiwms/basic/unit/maintain/filter2")
@ -193,71 +187,71 @@ public class BasicUnitMaintainController {
return ResultVOUtils.success(pageSimpleResponse);
}
// @AuthRuleAnnotation("")
// @PostMapping("/udiwms/basic/unit/maintain/combine")
// public BaseResponse combine(@RequestBody CombineUnitRequest combineRequest, BindingResult bindingResult) {
//
// if (bindingResult.hasErrors()) {
// return ResultVOUtils.error(ResultEnum.PARAM_VERIFY_FALL, bindingResult.getFieldError().getDefaultMessage());
// }
// List<ErpUnitsResponse> erpUnitsResponses = combineRequest.getCustmandocResponses();
// if (erpUnitsResponses != null && erpUnitsResponses.size() > 0) {
// for (ErpUnitsResponse erpUnitsResponse : erpUnitsResponses) {
// BasicUnitMaintainEntity basicUnitMaintainEntity = new BasicUnitMaintainEntity();
// if (combineRequest.getThirdSys() != null) {
// if ("thirdId".equals(combineRequest.getThirdSys())) {
// basicUnitMaintainEntity.setThirdId(erpUnitsResponse.getId());
// basicUnitMaintainEntity.setThirdName(erpUnitsResponse.getName());
// } else if ("thirdId1".equals(combineRequest.getThirdSys())) {
// basicUnitMaintainEntity.setThirdId1(erpUnitsResponse.getId());
// basicUnitMaintainEntity.setThirdName1(erpUnitsResponse.getName());
// } else if ("thirdId2".equals(combineRequest.getThirdSys())) {
// basicUnitMaintainEntity.setThirdId2(erpUnitsResponse.getId());
// basicUnitMaintainEntity.setThirdName2(erpUnitsResponse.getName());
// } else if ("thirdId3".equals(combineRequest.getThirdSys())) {
// basicUnitMaintainEntity.setThirdId3(erpUnitsResponse.getId());
// basicUnitMaintainEntity.setThirdName3(erpUnitsResponse.getName());
// } else if ("thirdId4".equals(combineRequest.getThirdSys())) {
// basicUnitMaintainEntity.setThirdId4(erpUnitsResponse.getId());
// basicUnitMaintainEntity.setThirdName4(erpUnitsResponse.getName());
// }
// }
// basicUnitMaintainEntity.setErpId(CustomUtil.getId());
// basicUnitMaintainEntity.setName(erpUnitsResponse.getName());
// basicUnitMaintainEntity.setSpell(erpUnitsResponse.getSpell());
// basicUnitMaintainEntity.setAddr(erpUnitsResponse.getAddr());
// basicUnitMaintainEntity.setCreditNo(erpUnitsResponse.getCreditNo());
// basicUnitMaintainEntity.setContact(erpUnitsResponse.getContact());
// basicUnitMaintainEntity.setMobile(erpUnitsResponse.getMobile());
// basicUnitMaintainEntity.setCorpType(ConstantStatus.CORP_SP);
// basicUnitMaintainEntity.setUpdateTime(new Date());
// basicUnitMaintainService.insertBasicUnitMaintain(basicUnitMaintainEntity);
// }
// }
// return ResultVOUtils.success("选入成功");
// }
//
// @AuthRuleAnnotation("")
// @GetMapping("/udiwms/basic/unit/maintain/combineAll")
// public BaseResponse combineAll(BasicUnitMaintainFilterRequest unitMaintainFilterRequest, BindingResult bindingResult) {
//
// if (bindingResult.hasErrors()) {
// return ResultVOUtils.error(ResultEnum.PARAM_VERIFY_FALL, bindingResult.getFieldError().getDefaultMessage());
// }
// BasicThirdSysDetailEntity basicThirdSysDetailEntity = basicThirdSysDetailService.selectByKey("corpUrl", unitMaintainFilterRequest.getThirdSys());
// if (basicThirdSysDetailEntity == null || basicThirdSysDetailEntity.getValue() == null)
// return ResultVOUtils.error(500, "往来单位接口地址未定义");
// if (basicThirdSysDetailEntity.getEnabled()) {
@AuthRuleAnnotation("")
@PostMapping("/udiwms/basic/unit/maintain/combine")
public BaseResponse combine(@RequestBody CombineUnitRequest combineRequest, BindingResult bindingResult) {
if (bindingResult.hasErrors()) {
return ResultVOUtils.error(ResultEnum.PARAM_VERIFY_FALL, bindingResult.getFieldError().getDefaultMessage());
}
List<BasicErpUnitsResponse> erpUnitsResponses = combineRequest.getCustmandocResponses();
if (erpUnitsResponses != null && erpUnitsResponses.size() > 0) {
for (BasicErpUnitsResponse erpUnitsResponse : erpUnitsResponses) {
BasicCorpEntity basicUnitMaintainEntity = new BasicCorpEntity();
if (combineRequest.getThirdSys() != null) {
if ("thirdId".equals(combineRequest.getThirdSys())) {
basicUnitMaintainEntity.setThirdId(erpUnitsResponse.getId());
basicUnitMaintainEntity.setThirdName(erpUnitsResponse.getName());
} else if ("thirdId1".equals(combineRequest.getThirdSys())) {
basicUnitMaintainEntity.setThirdId1(erpUnitsResponse.getId());
basicUnitMaintainEntity.setThirdName1(erpUnitsResponse.getName());
} else if ("thirdId2".equals(combineRequest.getThirdSys())) {
basicUnitMaintainEntity.setThirdId2(erpUnitsResponse.getId());
basicUnitMaintainEntity.setThirdName2(erpUnitsResponse.getName());
} else if ("thirdId3".equals(combineRequest.getThirdSys())) {
basicUnitMaintainEntity.setThirdId3(erpUnitsResponse.getId());
basicUnitMaintainEntity.setThirdName3(erpUnitsResponse.getName());
} else if ("thirdId4".equals(combineRequest.getThirdSys())) {
basicUnitMaintainEntity.setThirdId4(erpUnitsResponse.getId());
basicUnitMaintainEntity.setThirdName4(erpUnitsResponse.getName());
}
}
basicUnitMaintainEntity.setErpId(CustomUtil.getId());
basicUnitMaintainEntity.setName(erpUnitsResponse.getName());
basicUnitMaintainEntity.setSpell(erpUnitsResponse.getSpell());
basicUnitMaintainEntity.setAddr(erpUnitsResponse.getAddr());
basicUnitMaintainEntity.setCreditNo(erpUnitsResponse.getCreditNo());
basicUnitMaintainEntity.setContact(erpUnitsResponse.getContact());
basicUnitMaintainEntity.setMobile(erpUnitsResponse.getMobile());
basicUnitMaintainEntity.setCorpType(ConstantStatus.CORP_SP);
basicUnitMaintainEntity.setUpdateTime(new Date());
basicUnitMaintainService.insertBasicUnitMaintain(basicUnitMaintainEntity);
}
}
return ResultVOUtils.success("选入成功");
}
@AuthRuleAnnotation("")
@GetMapping("/udiwms/basic/unit/maintain/combineAll")
public BaseResponse combineAll(BasicUnitMaintainFilterRequest unitMaintainFilterRequest, BindingResult bindingResult) {
if (bindingResult.hasErrors()) {
return ResultVOUtils.error(ResultEnum.PARAM_VERIFY_FALL, bindingResult.getFieldError().getDefaultMessage());
}
ThrSystemDetailEntity basicThirdSysDetailEntity = thrSystemDetailService.selectByKey("corpUrl", unitMaintainFilterRequest.getThirdSys());
if (basicThirdSysDetailEntity == null || basicThirdSysDetailEntity.getValue() == null)
return ResultVOUtils.error(500, "往来单位接口地址未定义");
if (basicThirdSysDetailEntity.getEnabled()) {
// basicUnitImportService.selectAllUnit(basicThirdSysDetailEntity, unitMaintainFilterRequest);
//
// } else {
// return ResultVOUtils.error(500, "第三方系统往来单位接口服务未启用");
// }
//
//
// return ResultVOUtils.success("后台正在添加,请稍后刷新查看!");
// }
//
} else {
return ResultVOUtils.error(500, "第三方系统往来单位接口服务未启用");
}
return ResultVOUtils.success("后台正在添加,请稍后刷新查看!");
}
// @AuthRuleAnnotation("")
// @PostMapping("/udiwms/basic/unit/maintain/combineSingle")
// public BaseResponse combineSingle(@RequestBody CombineSingleUnitRequest combineRequest, BindingResult bindingResult) {
@ -491,4 +485,21 @@ public class BasicUnitMaintainController {
// return null;
// }
@AuthRuleAnnotation("")
@PostMapping("/udiwms/basic/unit/maintain/getSystemParamConfig")
public BaseResponse getSystemParamConfig() {
SystemParamConfigEntity systemParamConfigEntityBUMErpId = systemParamConfigService.selectByParamKey("basic_unit_maintain_erp_id");
SystemParamConfigEntity systemParamConfigEntityBUMThirdId = systemParamConfigService.selectByParamKey("basic_cops_thirdSys");
Map<String, Object> rMap = new HashMap<>();
rMap.put("BUMErpIdValue",
systemParamConfigEntityBUMErpId != null && StringUtils.isNotBlank(systemParamConfigEntityBUMErpId.getParamValue()) ?
systemParamConfigEntityBUMErpId.getParamValue() : "0");
rMap.put("BUMThirdIdValue",
systemParamConfigEntityBUMThirdId != null && StringUtils.isNotBlank(systemParamConfigEntityBUMThirdId.getParamValue()) ?
systemParamConfigEntityBUMThirdId.getParamValue() : "0");
return ResultVOUtils.success(rMap);
}
}

@ -1,7 +0,0 @@
package com.glxp.api.dao.basic;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.glxp.api.entity.basic.BasicCorpEntity;
public interface BasicCorpDao extends BaseMapper<BasicCorpEntity> {
}

@ -0,0 +1,29 @@
package com.glxp.api.dao.basic;
import com.glxp.api.entity.basic.BasicCorpEntity;
import com.glxp.api.entity.basic.BasicCorpsExportLogEntity;
import com.glxp.api.req.basic.FilterCorpExportLogRequest;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import java.util.List;
@Mapper
public interface BasicCorpExportLogDao {
List<BasicCorpsExportLogEntity> filterCorpExportLog(FilterCorpExportLogRequest filterCorpExportLogRequest);
boolean insertCorpExportLog(BasicCorpsExportLogEntity corpExportLogEntity);
boolean updateCorpExportLog(BasicCorpsExportLogEntity corpExportLogEntity);
boolean deleteById(@Param("id") String id);
/**
* ID
*
* @param id
* @return
*/
String selectFilePathById(@Param("id") String id);
}

@ -0,0 +1,26 @@
package com.glxp.api.dao.basic;
import com.glxp.api.entity.basic.BasicCorpsImportDetailEntity;
import com.glxp.api.req.basic.FilterCorpImportLogRequest;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import java.util.List;
@Mapper
public interface BasicCorpImportDetailDao {
List<BasicCorpsImportDetailEntity> filterCorpImport(FilterCorpImportLogRequest filterCorpImportLogRequest);
boolean insertCorpImport(BasicCorpsImportDetailEntity corpImportDetailEntity);
boolean updateCorpImport(BasicCorpsImportDetailEntity corpImportDetailEntity);
boolean insertCorpImports(@Param("corps") List<BasicCorpsImportDetailEntity> corpImportDetailEntities);
boolean deleteById(@Param("id") String id);
boolean deleteByGenkey(@Param("genKey") String genKey);
}

@ -0,0 +1,20 @@
package com.glxp.api.dao.basic;
import com.glxp.api.entity.basic.BasicCorpsImportLogEntity;
import com.glxp.api.req.basic.FilterCorpImportLogRequest;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import java.util.List;
@Mapper
public interface BasicCorpImportLogDao {
List<BasicCorpsImportLogEntity> filterImportLog(FilterCorpImportLogRequest filterCorpImportLogRequest);
boolean insertImportLog(BasicCorpsImportLogEntity corpImportLogEntity);
boolean updateImportLog(BasicCorpsImportLogEntity corpImportLogEntity);
boolean deleteById(@Param("id") String id);
}

@ -1,7 +0,0 @@
package com.glxp.api.dao.basic;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.glxp.api.entity.basic.BasicCorpsExportLogEntity;
public interface BasicCorpsExportLogDao extends BaseMapper<BasicCorpsExportLogEntity> {
}

@ -1,7 +0,0 @@
package com.glxp.api.dao.basic;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.glxp.api.entity.basic.BasicCorpsImportDetailEntity;
public interface BasicCorpsImportDetailDao extends BaseMapper<BasicCorpsImportDetailEntity> {
}

@ -1,7 +0,0 @@
package com.glxp.api.dao.basic;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.glxp.api.entity.basic.BasicCorpsImportLogEntity;
public interface BasicCorpsImportLogDao extends BaseMapper<BasicCorpsImportLogEntity> {
}

@ -42,7 +42,7 @@ public class BasicCorpEntity {
*
*/
@TableField(value = "`status`")
private String status;
private Integer status;
/**
*
@ -140,57 +140,5 @@ public class BasicCorpEntity {
@TableField(value = "remark")
private String remark;
public static final String COL_ID = "id";
public static final String COL_ERPID = "erpId";
public static final String COL_NAME = "name";
public static final String COL_SPELL = "spell";
public static final String COL_ADDR = "addr";
public static final String COL_STATUS = "status";
public static final String COL_TYPE = "type";
public static final String COL_CONTACT = "contact";
public static final String COL_MOBILE = "mobile";
public static final String COL_CREDITNO = "creditNo";
public static final String COL_THIRDID = "thirdId";
public static final String COL_THIRDID1 = "thirdId1";
public static final String COL_THIRDID2 = "thirdId2";
public static final String COL_THIRDID3 = "thirdId3";
public static final String COL_THIRDID4 = "thirdId4";
public static final String COL_THIRDNAME = "thirdName";
public static final String COL_THIRDNAME1 = "thirdName1";
public static final String COL_THIRDNAME2 = "thirdName2";
public static final String COL_THIRDNAME3 = "thirdName3";
public static final String COL_THIRDNAME4 = "thirdName4";
public static final String COL_CORPTYPE = "corpType";
public static final String COL_OUTTYPE = "outType";
public static final String COL_CREATEUSER = "createUser";
public static final String COL_CREATETIME = "createTime";
public static final String COL_UPDATEUSER = "updateUser";
public static final String COL_UPDATETIME = "updateTime";
public static final String COL_REMARK = "remark";
}

@ -47,7 +47,7 @@ public class BasicCorpsImportDetailEntity {
*
*/
@TableField(value = "`status`")
private String status;
private Integer status;
/**
*
@ -133,57 +133,4 @@ public class BasicCorpsImportDetailEntity {
@TableField(value = "remark")
private String remark;
public static final String COL_ID = "id";
public static final String COL_THIRDID = "thirdId";
public static final String COL_ERPID = "erpId";
public static final String COL_NAME = "name";
public static final String COL_SPELL = "spell";
public static final String COL_ADDR = "addr";
public static final String COL_STATUS = "status";
public static final String COL_TYPE = "type";
public static final String COL_CONTACT = "contact";
public static final String COL_MOBILE = "mobile";
public static final String COL_CREDITNO = "creditNo";
public static final String COL_THIRDID1 = "thirdId1";
public static final String COL_THIRDID2 = "thirdId2";
public static final String COL_THIRDID3 = "thirdId3";
public static final String COL_THIRDID4 = "thirdId4";
public static final String COL_THIRDNAME1 = "thirdName1";
public static final String COL_THIRDNAME2 = "thirdName2";
public static final String COL_THIRDNAME3 = "thirdName3";
public static final String COL_THIRDNAME4 = "thirdName4";
public static final String COL_THIRDNAME = "thirdName";
public static final String COL_GENKEYFK = "genKeyFk";
public static final String COL_IMPORTSTATUS = "importStatus";
public static final String COL_CREATEUSER = "createUser";
public static final String COL_CREATETIME = "createTime";
public static final String COL_UPDATEUSER = "updateUser";
public static final String COL_UPDATETIME = "updateTime";
public static final String COL_REMARK = "remark";
}

@ -17,7 +17,7 @@ public class BasicCorpsImportLogEntity {
private String genKey;
@TableField(value = "`status`")
private String status;
private Integer status;
@TableField(value = "fromType")
private String fromType;
@ -52,21 +52,5 @@ public class BasicCorpsImportLogEntity {
@TableField(value = "remark")
private String remark;
public static final String COL_ID = "id";
public static final String COL_GENKEY = "genKey";
public static final String COL_STATUS = "status";
public static final String COL_FROMTYPE = "fromType";
public static final String COL_CREATEUSER = "createUser";
public static final String COL_CREATETIME = "createTime";
public static final String COL_UPDATEUSER = "updateUser";
public static final String COL_UPDATETIME = "updateTime";
public static final String COL_REMARK = "remark";
}

@ -0,0 +1,16 @@
package com.glxp.api.req.basic;
import lombok.Data;
import java.util.List;
@Data
public class BasicCorpsExportRequest {
List<Integer> ids;
private Integer id;
private String key;
private String unitId;
private String name;
private String thirdSys;
}

@ -2,6 +2,7 @@ package com.glxp.api.req.basic;
import com.glxp.api.entity.thrsys.ThrCorpEntity;
import com.glxp.api.req.ListPageRequest;
import com.glxp.api.res.basic.BasicErpUnitsResponse;
import com.glxp.api.res.thrsys.ThrCorpsResponse;
import lombok.Data;
@ -27,5 +28,5 @@ public class BasicUnitMaintainFilterRequest extends ListPageRequest {
private Integer outType;
private Boolean isDownThrSys;
private String lastUpdateTime;
List<ThrCorpsResponse>thrCorpEntities;
List<BasicErpUnitsResponse>thrCorpEntities;
}

@ -0,0 +1,15 @@
package com.glxp.api.req.basic;
import com.glxp.api.res.basic.BasicErpUnitsResponse;
import lombok.Data;
import java.util.List;
@Data
public class CombineUnitRequest {
List<String> keys;
private String thirdSys;
List<BasicErpUnitsResponse> custmandocResponses;
}

@ -0,0 +1,15 @@
package com.glxp.api.req.basic;
import com.glxp.api.req.ListPageRequest;
import lombok.Data;
@Data
public class FilterCorpExportLogRequest extends ListPageRequest {
private String genKey;
private Integer status;
private Integer type;
}

@ -0,0 +1,17 @@
package com.glxp.api.req.basic;
import com.glxp.api.req.ListPageRequest;
import lombok.Data;
@Data
public class FilterCorpImportLogRequest extends ListPageRequest {
private Integer id;
private String genKey;
private Integer status;
private String thirdSysFk;
private String fromType;
private String lastUpdateTime;
}

@ -0,0 +1,13 @@
package com.glxp.api.req.basic;
import com.glxp.api.entity.basic.BasicCorpsImportDetailEntity;
import lombok.Data;
import java.util.List;
@Data
public class PostBasicCorpRequest {
private String genKey;
private List<BasicCorpsImportDetailEntity> datas;
}

@ -0,0 +1,32 @@
package com.glxp.api.res.basic;
import com.glxp.api.entity.basic.BasicCorpEntity;
import com.glxp.api.entity.thrsys.ThrCorpEntity;
import com.glxp.api.res.thrsys.ThrCorpsResponse;
import lombok.Data;
import java.util.ArrayList;
import java.util.List;
/**
*
*/
@Data
public class BasicCorpExportLogResponse {
/**
*
*/
private List<BasicCorpEntity> corpList;
/**
*
*/
private List<ThrCorpsResponse> thrCorpEntities;
public BasicCorpExportLogResponse() {
this.corpList = new ArrayList<>();
this.thrCorpEntities = new ArrayList<>();
}
}

@ -0,0 +1,23 @@
package com.glxp.api.res.basic;
import lombok.Data;
@Data
public class BasicErpUnitsResponse {
private String id;
private String name;
private String spell;
private String addr;
private String creditNo;
private String contact;
private String mobile;
private Boolean checked;
private String unitId; //必填 往来单位ID
}

@ -0,0 +1,23 @@
package com.glxp.api.service.basic;
import com.glxp.api.entity.basic.BasicCorpsExportLogEntity;
import com.glxp.api.req.basic.FilterCorpExportLogRequest;
import java.util.List;
public interface BasicCorpExportLogService {
BasicCorpsExportLogEntity selectByGenKey(String genKey);
List<BasicCorpsExportLogEntity> filterCorpExportLog(FilterCorpExportLogRequest filterCorpExportLogRequest);
boolean insertCorpExportLog(BasicCorpsExportLogEntity corpExportLogEntity);
boolean updateCorpExportLog(BasicCorpsExportLogEntity corpExportLogEntity);
boolean deleteById(String id);
}

@ -0,0 +1,23 @@
package com.glxp.api.service.basic;
import com.glxp.api.entity.basic.BasicCorpsImportDetailEntity;
import com.glxp.api.req.basic.FilterCorpImportLogRequest;
import java.util.List;
public interface BasicCorpImportDetailService {
List<BasicCorpsImportDetailEntity> filterCorpImport(FilterCorpImportLogRequest filterCorpImportLogRequest);
boolean insertCorpImport(BasicCorpsImportDetailEntity corpImportDetailEntity);
boolean updateCorpImport(BasicCorpsImportDetailEntity corpImportDetailEntity);
boolean insertCorpImports(List<BasicCorpsImportDetailEntity> corpImportDetailEntities);
boolean deleteById(String id);
boolean deleteByGenkey(String genKey);
}

@ -0,0 +1,31 @@
package com.glxp.api.service.basic;
import com.glxp.api.entity.basic.BasicCorpsImportLogEntity;
import com.glxp.api.req.basic.FilterCorpImportLogRequest;
import com.glxp.api.res.basic.BasicCorpExportLogResponse;
import org.apache.ibatis.annotations.Param;
import java.util.List;
public interface BasicCorpImportLogService {
BasicCorpsImportLogEntity selectByGenKey(String genKey);
List<BasicCorpsImportLogEntity> filterImportLog(FilterCorpImportLogRequest filterCorpImportLogRequest);
boolean insertImportLog(BasicCorpsImportLogEntity corpImportLogEntity);
boolean updateImportLog(BasicCorpsImportLogEntity corpImportLogEntity);
boolean deleteById(@Param("id") String id);
void importCorps(String genKey);
void importJsonData(BasicCorpExportLogResponse importData);
}

@ -12,7 +12,7 @@ public interface BasicUnitMaintainService {
List<BasicCorpEntity> filterList(BasicUnitMaintainFilterRequest basicUnitMaintainFilterRequest);
boolean insertBasicUnitMaintain(BasicCorpEntity basicUnitMaintainEntity);
boolean insertBasicUnitMaintain(BasicCorpEntity basicCorpEntity);
boolean updateById(BasicCorpEntity basicUnitMaintainEntity);

@ -0,0 +1,65 @@
package com.glxp.api.service.basic.impl;
import cn.hutool.core.io.FileUtil;
import cn.hutool.core.util.StrUtil;
import com.github.pagehelper.PageHelper;
import com.glxp.api.dao.basic.BasicCorpExportLogDao;
import com.glxp.api.entity.basic.BasicCorpsExportLogEntity;
import com.glxp.api.req.basic.FilterCorpExportLogRequest;
import com.glxp.api.service.basic.BasicCorpExportLogService;
import org.springframework.stereotype.Service;
import javax.annotation.Resource;
import java.util.Collections;
import java.util.List;
@Service
public class BasicCorpExportLogServiceImpl implements BasicCorpExportLogService {
@Resource
BasicCorpExportLogDao basicCorpExportLogDao;
@Override
public BasicCorpsExportLogEntity selectByGenKey(String genKey) {
FilterCorpExportLogRequest filterUdiEpLogRequest = new FilterCorpExportLogRequest();
filterUdiEpLogRequest.setGenKey(genKey);
List<BasicCorpsExportLogEntity> corpExportLogEntities = basicCorpExportLogDao.filterCorpExportLog(filterUdiEpLogRequest);
if (corpExportLogEntities != null && corpExportLogEntities.size() > 0) {
return corpExportLogEntities.get(0);
}
return null;
}
@Override
public List<BasicCorpsExportLogEntity> filterCorpExportLog(FilterCorpExportLogRequest filterCorpExportLogRequest) {
if (filterCorpExportLogRequest == null) {
return Collections.emptyList();
}
if (filterCorpExportLogRequest.getPage() != null) {
int offset = (filterCorpExportLogRequest.getPage() - 1) * filterCorpExportLogRequest.getLimit();
PageHelper.offsetPage(offset, filterCorpExportLogRequest.getLimit());
}
List<BasicCorpsExportLogEntity> data = basicCorpExportLogDao.filterCorpExportLog(filterCorpExportLogRequest);
return data;
}
@Override
public boolean insertCorpExportLog(BasicCorpsExportLogEntity basicCorpsExportLogEntity) {
return basicCorpExportLogDao.insertCorpExportLog(basicCorpsExportLogEntity);
}
@Override
public boolean updateCorpExportLog(BasicCorpsExportLogEntity basicCorpsExportLogEntity) {
return basicCorpExportLogDao.updateCorpExportLog(basicCorpsExportLogEntity);
}
@Override
public boolean deleteById(String id) {
//删除日志同步删除磁盘文件
String filePath = basicCorpExportLogDao.selectFilePathById(id);
if (StrUtil.isNotBlank(filePath)) {
FileUtil.del(filePath);
}
return basicCorpExportLogDao.deleteById(id);
}
}

@ -0,0 +1,56 @@
package com.glxp.api.service.basic.impl;
import com.github.pagehelper.PageHelper;
import com.glxp.api.dao.basic.BasicCorpImportDetailDao;
import com.glxp.api.entity.basic.BasicCorpsImportDetailEntity;
import com.glxp.api.req.basic.FilterCorpImportLogRequest;
import com.glxp.api.service.basic.BasicCorpImportDetailService;
import org.springframework.stereotype.Service;
import javax.annotation.Resource;
import java.util.Collections;
import java.util.List;
@Service
public class BasicCorpImportDetailServiceImpl implements BasicCorpImportDetailService {
@Resource
BasicCorpImportDetailDao basicCorpImportDetailDao;
@Override
public List<BasicCorpsImportDetailEntity> filterCorpImport(FilterCorpImportLogRequest filterCorpImportLogRequest) {
if (filterCorpImportLogRequest == null) {
return Collections.emptyList();
}
if (filterCorpImportLogRequest.getPage() != null) {
int offset = (filterCorpImportLogRequest.getPage() - 1) * filterCorpImportLogRequest.getLimit();
PageHelper.offsetPage(offset, filterCorpImportLogRequest.getLimit());
}
List<BasicCorpsImportDetailEntity> data = basicCorpImportDetailDao.filterCorpImport(filterCorpImportLogRequest);
return data;
}
@Override
public boolean insertCorpImport(BasicCorpsImportDetailEntity basicCorpsImportDetailEntity) {
return basicCorpImportDetailDao.insertCorpImport(basicCorpsImportDetailEntity);
}
@Override
public boolean updateCorpImport(BasicCorpsImportDetailEntity basicCorpsImportDetailEntity) {
return basicCorpImportDetailDao.updateCorpImport(basicCorpsImportDetailEntity);
}
@Override
public boolean insertCorpImports(List<BasicCorpsImportDetailEntity> basicCorpsImportDetailEntity) {
return basicCorpImportDetailDao.insertCorpImports(basicCorpsImportDetailEntity);
}
@Override
public boolean deleteById(String id) {
return basicCorpImportDetailDao.deleteById(id);
}
@Override
public boolean deleteByGenkey(String genKey) {
return basicCorpImportDetailDao.deleteByGenkey(genKey);
}
}

@ -0,0 +1,164 @@
package com.glxp.api.service.basic.impl;
import cn.hutool.core.collection.CollUtil;
import com.github.pagehelper.PageHelper;
import com.glxp.api.constant.BasicProcessStatus;
import com.glxp.api.dao.basic.BasicCorpImportLogDao;
import com.glxp.api.dao.basic.BasicUnitMaintainDao;
import com.glxp.api.dao.thrsys.ThrCorpDao;
import com.glxp.api.entity.basic.BasicCorpEntity;
import com.glxp.api.entity.basic.BasicCorpsImportDetailEntity;
import com.glxp.api.entity.basic.BasicCorpsImportLogEntity;
import com.glxp.api.entity.thrsys.ThrCorpEntity;
import com.glxp.api.req.basic.BasicUnitMaintainFilterRequest;
import com.glxp.api.req.basic.FilterCorpImportLogRequest;
import com.glxp.api.res.basic.BasicCorpExportLogResponse;
import com.glxp.api.res.thrsys.ThrCorpsResponse;
import com.glxp.api.service.basic.BasicCorpImportDetailService;
import com.glxp.api.service.basic.BasicCorpImportLogService;
import com.glxp.api.service.basic.BasicUnitMaintainService;
import lombok.extern.slf4j.Slf4j;
import org.apache.ibatis.session.ExecutorType;
import org.apache.ibatis.session.SqlSession;
import org.apache.ibatis.session.SqlSessionFactory;
import org.apache.ibatis.session.TransactionIsolationLevel;
import org.springframework.beans.BeanUtils;
import org.springframework.scheduling.annotation.Async;
import org.springframework.stereotype.Service;
import javax.annotation.Resource;
import java.util.Collections;
import java.util.List;
@Slf4j
@Service
public class BasicCorpImportLogServiceImpl implements BasicCorpImportLogService {
@Resource
BasicCorpImportLogDao basicCorpImportLogDao;
@Resource
BasicCorpImportDetailService basicCorpImportDetailService;
@Resource
BasicUnitMaintainService basicUnitMaintainService;
@Resource
SqlSessionFactory sqlSessionFactory;
@Override
public BasicCorpsImportLogEntity selectByGenKey(String genKey) {
FilterCorpImportLogRequest filterCorpImportLogRequest = new FilterCorpImportLogRequest();
filterCorpImportLogRequest.setGenKey(genKey);
List<BasicCorpsImportLogEntity> data = basicCorpImportLogDao.filterImportLog(filterCorpImportLogRequest);
if (data != null && data.size() > 0) {
return data.get(0);
}
return null;
}
@Override
public List<BasicCorpsImportLogEntity> filterImportLog(FilterCorpImportLogRequest filterCorpImportLogRequest) {
if (filterCorpImportLogRequest == null) {
return Collections.emptyList();
}
if (filterCorpImportLogRequest.getPage() != null) {
int offset = (filterCorpImportLogRequest.getPage() - 1) * filterCorpImportLogRequest.getLimit();
PageHelper.offsetPage(offset, filterCorpImportLogRequest.getLimit());
}
List<BasicCorpsImportLogEntity> data = basicCorpImportLogDao.filterImportLog(filterCorpImportLogRequest);
return data;
}
@Override
public boolean insertImportLog(BasicCorpsImportLogEntity basicCorpsImportLogEntity) {
return basicCorpImportLogDao.insertImportLog(basicCorpsImportLogEntity);
}
@Override
public boolean updateImportLog(BasicCorpsImportLogEntity corpImportLogEntity) {
return basicCorpImportLogDao.updateImportLog(corpImportLogEntity);
}
@Override
public boolean deleteById(String id) {
return basicCorpImportLogDao.deleteById(id);
}
@Async
@Override
public void importCorps(String genKey) {
BasicCorpsImportLogEntity corpImportLogEntity =selectByGenKey(genKey);
if (corpImportLogEntity != null && corpImportLogEntity.getStatus() == BasicProcessStatus.UDIINFO_IMPORT_UNPROCESS) {
FilterCorpImportLogRequest filterUdiIpLogRequest = new FilterCorpImportLogRequest();
filterUdiIpLogRequest.setGenKey(genKey);
List<BasicCorpsImportDetailEntity> corpImportDetailEntities
= basicCorpImportDetailService.filterCorpImport(filterUdiIpLogRequest);
if (corpImportDetailEntities != null) {
for (BasicCorpsImportDetailEntity corpImportDetailEntity : corpImportDetailEntities) {
BasicCorpEntity basicCorpEntity = new BasicCorpEntity();
BeanUtils.copyProperties(corpImportDetailEntity, basicCorpEntity);
BasicUnitMaintainFilterRequest basicUnitMaintainFilterRequest = new BasicUnitMaintainFilterRequest();
BeanUtils.copyProperties(corpImportDetailEntity, basicUnitMaintainFilterRequest);
List<BasicCorpEntity> basicUnitMaintainEntities = basicUnitMaintainService.filterList(basicUnitMaintainFilterRequest);
if (basicUnitMaintainEntities != null && basicUnitMaintainEntities.size() > 0) {
basicUnitMaintainService.insertBasicUnitMaintain(basicCorpEntity);
corpImportDetailEntity.setImportStatus(BasicProcessStatus.UDIINFO_IMPORT_CODE_SUCESS);
} else {
corpImportDetailEntity.setImportStatus(BasicProcessStatus.UDIINFO_IMPORT_CODE_FAIL);
corpImportDetailEntity.setRemark("重复导入!");
}
basicCorpImportDetailService.updateCorpImport(corpImportDetailEntity);
}
}
corpImportLogEntity.setStatus(BasicProcessStatus.UDIINFO_IMPORT_SUCCESS);
updateImportLog(corpImportLogEntity);
}
}
/**
*
*
* @param
*/
@Async
public void importJsonData(BasicCorpExportLogResponse importData) {
if (null != importData) {
SqlSession batchSession = sqlSessionFactory.openSession(ExecutorType.BATCH, TransactionIsolationLevel.READ_COMMITTED);
if (CollUtil.isNotEmpty(importData.getCorpList())) {
try {
List<BasicCorpEntity> corpList = importData.getCorpList();
BasicUnitMaintainDao mapper = batchSession.getMapper(BasicUnitMaintainDao.class);
for (BasicCorpEntity basicUnitMaintainEntity : corpList) {
mapper.importBasicUnitMaintain(basicUnitMaintainEntity);
}
batchSession.commit();
log.info("导入往来单位数据成功,导入数量为:{} 条", corpList.size());
} catch (Exception e) {
log.error("导入往来单位信息异常", e);
}
}
if (CollUtil.isNotEmpty(importData.getThrCorpEntities())) {
try {
List<ThrCorpsResponse> thrCorpEntities = importData.getThrCorpEntities();
ThrCorpDao mapper = batchSession.getMapper(ThrCorpDao.class);
thrCorpEntities.forEach(thrCorpEntity -> {
ThrCorpEntity thrCorpEntity1=new ThrCorpEntity();
BeanUtils.copyProperties(thrCorpEntity1, thrCorpEntity);
mapper.importThrCorp(thrCorpEntity1);
});
batchSession.commit();
log.info("导入第三方往来单位数据成功,导入数量为:{}", thrCorpEntities.size());
} catch (Exception e) {
log.error("导入第三方往来单位数据失败", e);
}
}
batchSession.close();
}
}
}

@ -51,7 +51,7 @@ public class ThrProductsImportLogServiceImpl implements ThrProductsImportLogServ
//
// @Override
// public ThrProductsImportLogEntity selectByGenKey(String genKey) {
// FilterUdiIpLogRequest filterUdiIpLogRequest = new FilterUdiIpLogRequest();
//
// filterUdiIpLogRequest.setGenKey(genKey);
// List<ThrProductsImportLogEntity> data = thrProductsImportLogDao.filterImportLog(filterUdiIpLogRequest);
// if (data != null && data.size() > 0) {

@ -1,42 +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.glxp.api.dao.basic.BasicCorpDao">
<resultMap id="BaseResultMap" type="com.glxp.api.entity.basic.BasicCorpEntity">
<!--@mbg.generated-->
<!--@Table basic_corp-->
<id column="id" jdbcType="INTEGER" property="id" />
<result column="erpId" jdbcType="VARCHAR" property="erpId" />
<result column="name" jdbcType="VARCHAR" property="name" />
<result column="spell" jdbcType="VARCHAR" property="spell" />
<result column="addr" jdbcType="VARCHAR" property="addr" />
<result column="status" jdbcType="VARCHAR" property="status" />
<result column="type" jdbcType="VARCHAR" property="type" />
<result column="contact" jdbcType="VARCHAR" property="contact" />
<result column="mobile" jdbcType="VARCHAR" property="mobile" />
<result column="creditNo" jdbcType="VARCHAR" property="creditNo" />
<result column="thirdId" jdbcType="VARCHAR" property="thirdId" />
<result column="thirdId1" jdbcType="VARCHAR" property="thirdId1" />
<result column="thirdId2" jdbcType="VARCHAR" property="thirdId2" />
<result column="thirdId3" jdbcType="VARCHAR" property="thirdId3" />
<result column="thirdId4" jdbcType="VARCHAR" property="thirdId4" />
<result column="thirdName" jdbcType="VARCHAR" property="thirdName" />
<result column="thirdName1" jdbcType="VARCHAR" property="thirdName1" />
<result column="thirdName2" jdbcType="VARCHAR" property="thirdName2" />
<result column="thirdName3" jdbcType="VARCHAR" property="thirdName3" />
<result column="thirdName4" jdbcType="VARCHAR" property="thirdName4" />
<result column="corpType" jdbcType="TINYINT" property="corpType" />
<result column="outType" jdbcType="TINYINT" property="outType" />
<result column="createUser" jdbcType="VARCHAR" property="createUser" />
<result column="createTime" jdbcType="TIMESTAMP" property="createTime" />
<result column="updateUser" jdbcType="VARCHAR" property="updateUser" />
<result column="updateTime" jdbcType="TIMESTAMP" property="updateTime" />
<result column="remark" jdbcType="VARCHAR" property="remark" />
</resultMap>
<sql id="Base_Column_List">
<!--@mbg.generated-->
id, erpId, `name`, spell, addr, `status`, `type`, contact, mobile, creditNo, thirdId,
thirdId1, thirdId2, thirdId3, thirdId4, thirdName, thirdName1, thirdName2, thirdName3,
thirdName4, corpType, outType, `createUser`, createTime, updateUser, updateTime,
remark
</sql>
</mapper>

@ -0,0 +1,56 @@
<?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.glxp.api.dao.basic.BasicCorpExportLogDao">
<select id="filterCorpExportLog" parameterType="com.glxp.api.req.basic.FilterCorpExportLogRequest"
resultType="com.glxp.api.entity.basic.BasicCorpsExportLogEntity">
SELECT * FROM basic_corps_export_log
<where>
<if test="genKey != '' and genKey != null">
AND genKey = #{genKey}
</if>
<if test="status != '' and status != null">
AND status = #{status}
</if>
<if test="type != '' and type != null">
AND `type` = #{type}
</if>
</where>
ORDER BY updateTime DESC
</select>
<select id="selectFilePathById" resultType="java.lang.String">
select filePath from basic_corps_export_log where id = #{id}
</select>
<insert id="insertCorpExportLog" keyProperty="id"
parameterType="com.glxp.api.entity.basic.BasicCorpsExportLogEntity">
insert INTO basic_corps_export_log
(genKey,updateTime,dlCount,status,filePath,remark,`type`)
values
(
#{genKey},
#{updateTime},
#{dlCount},#{status},#{filePath},#{remark},#{type}
)
</insert>
<delete id="deleteById" parameterType="Map">
DELETE FROM basic_corps_export_log WHERE id = #{id}
</delete>
<update id="updateCorpExportLog" parameterType="com.glxp.api.entity.basic.BasicCorpsExportLogEntity">
UPDATE basic_corps_export_log
<set>
<if test="updateTime != null">updateTime=#{updateTime},</if>
<if test="dlCount != null">dlCount=#{dlCount},</if>
<if test="status != null">status=#{status},</if>
<if test="filePath != null">filePath=#{filePath},</if>
<if test="remark != null">remark=#{remark},</if>
</set>
WHERE genKey = #{genKey}
</update>
</mapper>

@ -0,0 +1,113 @@
<?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.glxp.api.dao.basic.BasicCorpImportDetailDao">
<select id="filterCorpImport" parameterType="com.glxp.api.req.basic.FilterCorpImportLogRequest"
resultType="com.glxp.api.entity.basic.BasicCorpsImportDetailEntity">
SELECT * FROM basic_corps_import_detail
<where>
<if test="genKey != '' and genKey != null">
AND genKeyFk = #{genKey}
</if>
<if test="id != '' and id != null">
AND id = #{id}
</if>
<if test="status != '' and status != null">
AND status = #{status}
</if>
</where>
</select>
<insert id="insertCorpImport" keyProperty="id"
parameterType="com.glxp.api.entity.basic.BasicCorpsImportDetailEntity">
insert INTO basic_corps_import_detail
(
thirdId,erpId,name,spell,
addr,status,type,creditNo,contact,mobile,thirdId1,thirdId2,thirdId3,thirdId4,
thirdName,thirdName1,thirdName2,thirdName3,thirdName4,
importStatus,updateTime,remark,genKeyFk)
values
(
#{thirdId},
#{erpId},
#{name},
#{spell},
#{addr},
#{status},
#{type},
#{creditNo},
#{contact},
#{mobile},#{thirdId1},#{thirdId2},#{thirdId3},#{thirdId4},
#{thirdName},#{thirdName1},#{thirdName2},#{thirdName3},#{thirdName4},
#{importStatus},
#{updateTime},#{remark}, #{genKeyFk}
)
</insert>
<insert id="insertCorpImports" keyProperty="id" parameterType="java.util.List">
insert INTO basic_corps_import_detail
(
thirdId,erpId,name,spell,
addr,status,type,creditNo,contact,mobile,thirdId1,thirdId2,thirdId3,thirdId4,
thirdName,thirdName1,thirdName2,thirdName3,thirdName4,
importStatus,updateTime,remark,genKeyFk)
values
<foreach collection="corps" item="item" index="index"
separator=",">
(
#{item.thirdId},
#{item.erpId},
#{item.name},
#{item.spell},
#{item.addr},
#{item.status},
#{item.type},
#{item.creditNo},
#{item.contact},
#{item.mobile},#{item.thirdId1},#{item.thirdId2},#{item.thirdId3},#{item.thirdId4},
#{item.thirdName},#{item.thirdName1},#{item.thirdName2},#{item.thirdName3},#{item.thirdName4},
#{item.importStatus},
#{item.updateTime},#{item.remark}, #{item.genKeyFk}
)
</foreach>
</insert>
<delete id="deleteById" parameterType="Map">
DELETE FROM basic_corps_import_detail WHERE id = #{id}
</delete>
<delete id="deleteByGenkey" parameterType="Map">
DELETE FROM basic_corps_import_detail WHERE genKeyFk = #{genKey}
</delete>
<update id="updateCorpImport" parameterType="com.glxp.api.entity.basic.BasicCorpsImportDetailEntity">
UPDATE basic_corps_import_detail
<trim prefix="set" suffixOverrides=",">
<if test="thirdId != null">thirdId=#{thirdId},</if>
<if test="erpId != null">erpId=#{erpId},</if>
<if test="name != null">name=#{name},</if>
<if test="spell != null">spell=#{spell},</if>
<if test="addr != null">addr=#{addr},</if>
<if test="status != null">status=#{status},</if>
<if test="type != null">type=#{type},</if>
<if test="creditNo != null">creditNo=#{creditNo},</if>
<if test="contact != null">contact=#{contact},</if>
<if test="mobile != null">mobile=#{mobile},</if>
<if test="thirdId1 != null">thirdId1=#{thirdId1},</if>
<if test="thirdId2 != null">thirdId2=#{thirdId2},</if>
<if test="thirdId3 != null">thirdId3=#{thirdId3},</if>
<if test="thirdId4 != null">thirdId4=#{thirdId4},</if>
<if test="thirdName != null">thirdName=#{thirdName},</if>
<if test="thirdName1 != null">thirdName1=#{thirdName1},</if>
<if test="thirdName2 != null">thirdName2=#{thirdName2},</if>
<if test="thirdName3 != null">thirdName3=#{thirdName3},</if>
<if test="thirdName4 != null">thirdName4=#{thirdName4},</if>
<if test="importStatus != null">importStatus=#{importStatus},</if>
<if test="updateTime != null">updateTime=#{updateTime},</if>
<if test="remark != null">remark=#{remark},</if>
</trim>
WHERE id = #{id}
</update>
</mapper>

@ -0,0 +1,53 @@
<?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.glxp.api.dao.basic.BasicCorpImportLogDao">
<select id="filterImportLog" parameterType="com.glxp.api.req.basic.FilterCorpImportLogRequest"
resultType="com.glxp.api.entity.basic.BasicCorpsImportLogEntity">
SELECT * FROM basic_corps_import_log
<where>
<if test="genKey != '' and genKey != null">
AND genKey = #{genKey}
</if>
<if test="id != '' and id != null">
AND id = #{id}
</if>
<if test="status != '' and status != null">
AND status = #{status}
</if>
</where>
ORDER BY updateTime DESC
</select>
<insert id="insertImportLog" keyProperty="id" parameterType="com.glxp.api.entity.basic.BasicCorpsImportLogEntity">
insert INTO basic_corps_import_log
(genKey,fromType,updateTime,remark,status)
values
(
#{genKey},
#{fromType},
#{updateTime},
#{remark},#{status}
)
</insert>
<delete id="deleteById" parameterType="Map">
DELETE FROM basic_corps_import_log WHERE id = #{id}
</delete>
<update id="updateImportLog" parameterType="com.glxp.api.entity.basic.BasicCorpsImportLogEntity">
UPDATE basic_corps_import_log
<set>
<if test="genKey != null">genKey=#{genKey},</if>
<if test="fromType != null">fromType=#{fromType},</if>
<if test="updateTime != null">updateTime=#{updateTime},</if>
<if test="status != null">status=#{status},</if>
<if test="remark != null">remark=#{remark},</if>
</set>
WHERE genKey = #{genKey}
</update>
</mapper>

@ -1,24 +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.glxp.api.dao.basic.BasicCorpsExportLogDao">
<resultMap id="BaseResultMap" type="com.glxp.api.entity.basic.BasicCorpsExportLogEntity">
<!--@mbg.generated-->
<!--@Table basic_corps_export_log-->
<id column="id" jdbcType="INTEGER" property="id" />
<result column="genKey" jdbcType="VARCHAR" property="genKey" />
<result column="status" jdbcType="INTEGER" property="status" />
<result column="dlCount" jdbcType="INTEGER" property="dlCount" />
<result column="filePath" jdbcType="VARCHAR" property="filePath" />
<result column="type" jdbcType="INTEGER" property="type" />
<result column="createUser" jdbcType="VARCHAR" property="createUser" />
<result column="createTime" jdbcType="TIMESTAMP" property="createTime" />
<result column="updateUser" jdbcType="VARCHAR" property="updateUser" />
<result column="updateTime" jdbcType="TIMESTAMP" property="updateTime" />
<result column="remark" jdbcType="VARCHAR" property="remark" />
</resultMap>
<sql id="Base_Column_List">
<!--@mbg.generated-->
id, genKey, `status`, dlCount, filePath, `type`, `createUser`, createTime, updateUser,
updateTime, remark
</sql>
</mapper>

@ -1,42 +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.glxp.api.dao.basic.BasicCorpsImportDetailDao">
<resultMap id="BaseResultMap" type="com.glxp.api.entity.basic.BasicCorpsImportDetailEntity">
<!--@mbg.generated-->
<!--@Table basic_corps_import_detail-->
<id column="id" jdbcType="INTEGER" property="id" />
<result column="thirdId" jdbcType="VARCHAR" property="thirdId" />
<result column="erpId" jdbcType="VARCHAR" property="erpId" />
<result column="name" jdbcType="VARCHAR" property="name" />
<result column="spell" jdbcType="VARCHAR" property="spell" />
<result column="addr" jdbcType="VARCHAR" property="addr" />
<result column="status" jdbcType="VARCHAR" property="status" />
<result column="type" jdbcType="VARCHAR" property="type" />
<result column="contact" jdbcType="VARCHAR" property="contact" />
<result column="mobile" jdbcType="VARCHAR" property="mobile" />
<result column="creditNo" jdbcType="VARCHAR" property="creditNo" />
<result column="thirdId1" jdbcType="VARCHAR" property="thirdId1" />
<result column="thirdId2" jdbcType="VARCHAR" property="thirdId2" />
<result column="thirdId3" jdbcType="VARCHAR" property="thirdId3" />
<result column="thirdId4" jdbcType="VARCHAR" property="thirdId4" />
<result column="thirdName1" jdbcType="VARCHAR" property="thirdName1" />
<result column="thirdName2" jdbcType="VARCHAR" property="thirdName2" />
<result column="thirdName3" jdbcType="VARCHAR" property="thirdName3" />
<result column="thirdName4" jdbcType="VARCHAR" property="thirdName4" />
<result column="thirdName" jdbcType="VARCHAR" property="thirdName" />
<result column="genKeyFk" jdbcType="VARCHAR" property="genKeyFk" />
<result column="importStatus" jdbcType="INTEGER" property="importStatus" />
<result column="createUser" jdbcType="VARCHAR" property="createUser" />
<result column="createTime" jdbcType="TIMESTAMP" property="createTime" />
<result column="updateUser" jdbcType="VARCHAR" property="updateUser" />
<result column="updateTime" jdbcType="TIMESTAMP" property="updateTime" />
<result column="remark" jdbcType="VARCHAR" property="remark" />
</resultMap>
<sql id="Base_Column_List">
<!--@mbg.generated-->
id, thirdId, erpId, `name`, spell, addr, `status`, `type`, contact, mobile, creditNo,
thirdId1, thirdId2, thirdId3, thirdId4, thirdName1, thirdName2, thirdName3, thirdName4,
thirdName, genKeyFk, importStatus, `createUser`, createTime, updateUser, updateTime,
remark
</sql>
</mapper>

@ -1,22 +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.glxp.api.dao.basic.BasicCorpsImportLogDao">
<resultMap id="BaseResultMap" type="com.glxp.api.entity.basic.BasicCorpsImportLogEntity">
<!--@mbg.generated-->
<!--@Table basic_corps_import_log-->
<id column="id" jdbcType="INTEGER" property="id" />
<result column="genKey" jdbcType="VARCHAR" property="genKey" />
<result column="status" jdbcType="VARCHAR" property="status" />
<result column="fromType" jdbcType="VARCHAR" property="fromType" />
<result column="createUser" jdbcType="VARCHAR" property="createUser" />
<result column="createTime" jdbcType="TIMESTAMP" property="createTime" />
<result column="updateUser" jdbcType="VARCHAR" property="updateUser" />
<result column="updateTime" jdbcType="TIMESTAMP" property="updateTime" />
<result column="remark" jdbcType="VARCHAR" property="remark" />
</resultMap>
<sql id="Base_Column_List">
<!--@mbg.generated-->
id, genKey, `status`, fromType, `createUser`, createTime, updateUser, updateTime,
remark
</sql>
</mapper>
Loading…
Cancel
Save