From 4d384129b8c717a5bc7fb9754babb314ed02c161 Mon Sep 17 00:00:00 2001 From: chenhc <2369838784@qq.com> Date: Mon, 26 Feb 2024 16:36:06 +0800 Subject: [PATCH] =?UTF-8?q?feat:=20=E5=8C=BB=E4=BF=9D=E5=8A=9F=E8=83=BD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../udchs/UdchsThirdApiController.java | 70 ++++++++ .../udchs/UdchsYbHcflController.java | 32 ++++ .../udchs/UdchsYbHcxxController.java | 37 ++++ .../udchs/UdchsYbHcxxGgController.java | 36 ++++ .../udidl/admin/dao/chs/YbHcflMapper.java | 4 +- .../udidl/admin/dao/chs/YbHcxxGgMapper.java | 8 + .../udidl/admin/dao/chs/YbHcxxMapper.java | 8 + .../glxp/udidl/admin/dto/udchs/BaseParam.java | 19 ++ .../admin/service/chs/YbHcxxGgService.java | 10 -- .../admin/service/chs/YbHcxxService.java | 10 -- .../ChsYbChsHttpClient.java} | 43 ++--- .../ChsYbHcflService.java} | 18 +- .../service/chsapi/ChsYbHcxxGgService.java | 100 +++++++++++ .../service/chsapi/ChsYbHcxxService.java | 53 ++++++ .../admin/service/udchs/YbHcflService.java | 8 + .../admin/service/udchs/YbHcxxGgService.java | 8 + .../admin/service/udchs/YbHcxxService.java | 8 + .../service/udchs/impl/YbHcflServiceImpl.java | 34 ++++ .../udchs/impl/YbHcxxGgServiceImpl.java | 33 ++++ .../service/udchs/impl/YbHcxxServiceImpl.java | 32 ++++ .../udidl/admin/thread/YbChsHcflTask.java | 12 +- .../udidl/admin/thread/YbChsHcxxGgTask.java | 48 +++++ .../udidl/admin/thread/YbChsHcxxTask.java | 48 +++++ .../mybatis/mapper/chs/YbHcxxGgMapper.xml | 57 ------ .../mybatis/mapper/chs/YbHcxxMapper.xml | 42 ----- .../mapper/{chs => udchs}/YbHcflMapper.xml | 23 ++- .../mybatis/mapper/udchs/YbHcxxGgMapper.xml | 170 ++++++++++++++++++ .../mybatis/mapper/udchs/YbHcxxMapper.xml | 125 +++++++++++++ 28 files changed, 924 insertions(+), 172 deletions(-) create mode 100644 src/main/java/com/glxp/udidl/admin/controller/udchs/UdchsThirdApiController.java create mode 100644 src/main/java/com/glxp/udidl/admin/controller/udchs/UdchsYbHcflController.java create mode 100644 src/main/java/com/glxp/udidl/admin/controller/udchs/UdchsYbHcxxController.java create mode 100644 src/main/java/com/glxp/udidl/admin/controller/udchs/UdchsYbHcxxGgController.java create mode 100644 src/main/java/com/glxp/udidl/admin/dto/udchs/BaseParam.java delete mode 100644 src/main/java/com/glxp/udidl/admin/service/chs/YbHcxxGgService.java delete mode 100644 src/main/java/com/glxp/udidl/admin/service/chs/YbHcxxService.java rename src/main/java/com/glxp/udidl/admin/service/{chs/YbChsHttpClient.java => chsapi/ChsYbChsHttpClient.java} (87%) rename src/main/java/com/glxp/udidl/admin/service/{chs/YbHcflService.java => chsapi/ChsYbHcflService.java} (71%) create mode 100644 src/main/java/com/glxp/udidl/admin/service/chsapi/ChsYbHcxxGgService.java create mode 100644 src/main/java/com/glxp/udidl/admin/service/chsapi/ChsYbHcxxService.java create mode 100644 src/main/java/com/glxp/udidl/admin/service/udchs/YbHcflService.java create mode 100644 src/main/java/com/glxp/udidl/admin/service/udchs/YbHcxxGgService.java create mode 100644 src/main/java/com/glxp/udidl/admin/service/udchs/YbHcxxService.java create mode 100644 src/main/java/com/glxp/udidl/admin/service/udchs/impl/YbHcflServiceImpl.java create mode 100644 src/main/java/com/glxp/udidl/admin/service/udchs/impl/YbHcxxGgServiceImpl.java create mode 100644 src/main/java/com/glxp/udidl/admin/service/udchs/impl/YbHcxxServiceImpl.java create mode 100644 src/main/java/com/glxp/udidl/admin/thread/YbChsHcxxGgTask.java create mode 100644 src/main/java/com/glxp/udidl/admin/thread/YbChsHcxxTask.java delete mode 100644 src/main/resources/mybatis/mapper/chs/YbHcxxGgMapper.xml delete mode 100644 src/main/resources/mybatis/mapper/chs/YbHcxxMapper.xml rename src/main/resources/mybatis/mapper/{chs => udchs}/YbHcflMapper.xml (85%) create mode 100644 src/main/resources/mybatis/mapper/udchs/YbHcxxGgMapper.xml create mode 100644 src/main/resources/mybatis/mapper/udchs/YbHcxxMapper.xml diff --git a/src/main/java/com/glxp/udidl/admin/controller/udchs/UdchsThirdApiController.java b/src/main/java/com/glxp/udidl/admin/controller/udchs/UdchsThirdApiController.java new file mode 100644 index 0000000..b896509 --- /dev/null +++ b/src/main/java/com/glxp/udidl/admin/controller/udchs/UdchsThirdApiController.java @@ -0,0 +1,70 @@ +package com.glxp.udidl.admin.controller.udchs; + +import com.glxp.udidl.admin.res.BaseResponse; +import com.glxp.udidl.admin.service.chsapi.ChsYbHcflService; +import com.glxp.udidl.admin.service.chsapi.ChsYbHcxxGgService; +import com.glxp.udidl.admin.service.chsapi.ChsYbHcxxService; +import com.glxp.udidl.admin.util.ResultVOUtils; +import io.swagger.annotations.Api; +import io.swagger.annotations.ApiOperation; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.web.bind.annotation.PostMapping; +import org.springframework.web.bind.annotation.RequestBody; +import org.springframework.web.bind.annotation.RestController; + + +@Api(tags = "医保接口触发手动更新测试") +@RestController +public class UdchsThirdApiController { + + @Autowired + ChsYbHcflService ybHcflService; + @Autowired + ChsYbHcxxService ybHcxxService; + @Autowired + ChsYbHcxxGgService ybHcxxGgService; + + @ApiOperation("手动触发ybHcfl数据全量更新") +// @AuthRuleAnnotation("udiwms/erp/manual/trig/ybHcfl") + @PostMapping("/udiwms/erp/manual/trig/ybHcfl") + public BaseResponse manualTrigYbHcfl() { + ybHcflService.updateYbHcflList(); + return ResultVOUtils.success("手动触发ybHcfl数据全量更新!"); + } + + @ApiOperation("手动触发ybHcxx数据全量更新") +// @AuthRuleAnnotation("udiwms/erp/manual/trig/ybHcxx") + @PostMapping("/udiwms/erp/manual/trig/ybHcxx") + public BaseResponse manualTrigYbHcxx() { + ybHcxxService.updateYbHcxxList(); + return ResultVOUtils.success("手动触发ybHcxx数据全量更新!"); + } + + @ApiOperation("手动触发ybHcxxGg数据全量更新") +// @AuthRuleAnnotation("udiwms/erp/manual/trig/ybHcxxGg") + @PostMapping("/udiwms/erp/manual/trig/ybHcxxGg") + public BaseResponse manualTrigYbHcxxGg() { + ybHcxxGgService.updateForEachYbHcxxList(); +// Tesseract tesseract = new Tesseract(); +// // 其他配置,如语言、OCR引擎等 +// String result; +// try { +//// File imageFromNetByUrl = getImageFromNetByUrl("http://code.nhsa.gov.cn/hc/ipActuatorVeryCode"); +//// File imageFromNetByUrl = new File("E:\\image\\ipActuatorVeryCode.png"); +// ImageIO.scanForPlugins(); +// result = tesseract.doOCR(imageFromNetByUrl); +// System.out.println(result); +// } catch (TesseractException e) { +// e.printStackTrace(); +// } + return ResultVOUtils.success("手动触发ybHcxxGg数据全量更新!"); + } + + @ApiOperation("手动触发ybHcxxGg数据更新通过父code") +// @AuthRuleAnnotation("udiwms/erp/manual/trig/ybHcxxGgByCode") + @PostMapping("/udiwms/erp/manual/trig/ybHcxxGgByCode") + public BaseResponse manualTrigYbHcxxGgByCode(@RequestBody String specificationCode) { + ybHcxxGgService.updateYbHcxxGgList(specificationCode); + return ResultVOUtils.success("手动触发ybHcxxGg数据更新通过父code!"); + } +} diff --git a/src/main/java/com/glxp/udidl/admin/controller/udchs/UdchsYbHcflController.java b/src/main/java/com/glxp/udidl/admin/controller/udchs/UdchsYbHcflController.java new file mode 100644 index 0000000..829d15f --- /dev/null +++ b/src/main/java/com/glxp/udidl/admin/controller/udchs/UdchsYbHcflController.java @@ -0,0 +1,32 @@ +package com.glxp.udidl.admin.controller.udchs; + +import com.glxp.udidl.admin.annotation.AuthRuleAnnotation; +import com.glxp.udidl.admin.dto.udchs.BaseParam; +import com.glxp.udidl.admin.entity.chs.YbHcflEntity; +import com.glxp.udidl.admin.res.BaseResponse; +import com.glxp.udidl.admin.service.udchs.YbHcflService; +import io.swagger.annotations.Api; +import io.swagger.annotations.ApiOperation; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.web.bind.annotation.*; + + +/** + * 国家医保 + */ +@Api(tags = "国家医保耗材分类目录信息接口") +@RestController +@RequestMapping("/udchs/ybHcfl") +public class UdchsYbHcflController { + + @Autowired + private YbHcflService ybHcflService; + + @ApiOperation(value = "国家医保耗材分类目录信息", response = YbHcflEntity.class) + @AuthRuleAnnotation("udchs/ybHcfl/list") + @PostMapping("/list") + public BaseResponse getList(@RequestBody BaseParam param) { + return ybHcflService.getList(param); + } + +} diff --git a/src/main/java/com/glxp/udidl/admin/controller/udchs/UdchsYbHcxxController.java b/src/main/java/com/glxp/udidl/admin/controller/udchs/UdchsYbHcxxController.java new file mode 100644 index 0000000..814792e --- /dev/null +++ b/src/main/java/com/glxp/udidl/admin/controller/udchs/UdchsYbHcxxController.java @@ -0,0 +1,37 @@ +package com.glxp.udidl.admin.controller.udchs; + +import com.glxp.udidl.admin.annotation.AuthRuleAnnotation; +import com.glxp.udidl.admin.dto.udchs.BaseParam; +import com.glxp.udidl.admin.entity.chs.YbHcflEntity; +import com.glxp.udidl.admin.entity.chs.YbHcxxEntity; +import com.glxp.udidl.admin.res.BaseResponse; +import com.glxp.udidl.admin.service.udchs.YbHcflService; +import com.glxp.udidl.admin.service.udchs.YbHcxxService; +import io.swagger.annotations.Api; +import io.swagger.annotations.ApiOperation; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.web.bind.annotation.PostMapping; +import org.springframework.web.bind.annotation.RequestBody; +import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.web.bind.annotation.RestController; + + +/** + * 国家医保 + */ +@Api(tags = "国家医保医用耗材信息接口") +@RestController +@RequestMapping("/udchs/ybHcxx") +public class UdchsYbHcxxController { + + @Autowired + private YbHcxxService ybHcxxService; + + @ApiOperation(value = "国家医保医用耗材信息", response = YbHcxxEntity.class) + @AuthRuleAnnotation("udchs/ybHcxx/list") + @PostMapping("/list") + public BaseResponse getList(@RequestBody BaseParam param) { + return ybHcxxService.getList(param); + } + +} diff --git a/src/main/java/com/glxp/udidl/admin/controller/udchs/UdchsYbHcxxGgController.java b/src/main/java/com/glxp/udidl/admin/controller/udchs/UdchsYbHcxxGgController.java new file mode 100644 index 0000000..90d5607 --- /dev/null +++ b/src/main/java/com/glxp/udidl/admin/controller/udchs/UdchsYbHcxxGgController.java @@ -0,0 +1,36 @@ +package com.glxp.udidl.admin.controller.udchs; + +import com.glxp.udidl.admin.annotation.AuthRuleAnnotation; +import com.glxp.udidl.admin.dto.udchs.BaseParam; +import com.glxp.udidl.admin.entity.chs.YbHcflEntity; +import com.glxp.udidl.admin.res.BaseResponse; +import com.glxp.udidl.admin.service.udchs.YbHcflService; +import com.glxp.udidl.admin.service.udchs.YbHcxxGgService; +import io.swagger.annotations.Api; +import io.swagger.annotations.ApiOperation; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.web.bind.annotation.PostMapping; +import org.springframework.web.bind.annotation.RequestBody; +import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.web.bind.annotation.RestController; + + +/** + * 国家医保 + */ +@Api(tags = "国家医保医用耗材规格信息接口") +@RestController +@RequestMapping("/udchs/ybHcxxGg") +public class UdchsYbHcxxGgController { + + @Autowired + private YbHcxxGgService ybHcxxGgService; + + @ApiOperation(value = "国家医保医用耗材规格信息", response = YbHcflEntity.class) + @AuthRuleAnnotation("udchs/ybHcxxGg/list") + @PostMapping("/list") + public BaseResponse getList(@RequestBody BaseParam param) { + return ybHcxxGgService.getList(param); + } + +} diff --git a/src/main/java/com/glxp/udidl/admin/dao/chs/YbHcflMapper.java b/src/main/java/com/glxp/udidl/admin/dao/chs/YbHcflMapper.java index a484338..62eee39 100644 --- a/src/main/java/com/glxp/udidl/admin/dao/chs/YbHcflMapper.java +++ b/src/main/java/com/glxp/udidl/admin/dao/chs/YbHcflMapper.java @@ -1,17 +1,17 @@ package com.glxp.udidl.admin.dao.chs; import com.baomidou.mybatisplus.core.mapper.BaseMapper; +import com.glxp.udidl.admin.dto.udchs.BaseParam; import com.glxp.udidl.admin.entity.chs.YbHcflEntity; import org.apache.ibatis.annotations.Mapper; import org.apache.ibatis.annotations.Param; import java.util.List; -import java.util.Map; @Mapper public interface YbHcflMapper extends BaseMapper { int batchSaveOrUpdateBySpecificationCode(@Param("list") List list); - + List list(BaseParam param); } diff --git a/src/main/java/com/glxp/udidl/admin/dao/chs/YbHcxxGgMapper.java b/src/main/java/com/glxp/udidl/admin/dao/chs/YbHcxxGgMapper.java index 4c5a000..cd12c53 100644 --- a/src/main/java/com/glxp/udidl/admin/dao/chs/YbHcxxGgMapper.java +++ b/src/main/java/com/glxp/udidl/admin/dao/chs/YbHcxxGgMapper.java @@ -1,9 +1,17 @@ package com.glxp.udidl.admin.dao.chs; import com.baomidou.mybatisplus.core.mapper.BaseMapper; +import com.glxp.udidl.admin.dto.udchs.BaseParam; import com.glxp.udidl.admin.entity.chs.YbHcxxGgEntity; import org.apache.ibatis.annotations.Mapper; +import org.apache.ibatis.annotations.Param; + +import java.util.List; @Mapper public interface YbHcxxGgMapper extends BaseMapper { + + int batchSaveOrUpdateBySpecificationCode(@Param("list") List list); + + List list(BaseParam param); } diff --git a/src/main/java/com/glxp/udidl/admin/dao/chs/YbHcxxMapper.java b/src/main/java/com/glxp/udidl/admin/dao/chs/YbHcxxMapper.java index 8ba6a7a..af9bf42 100644 --- a/src/main/java/com/glxp/udidl/admin/dao/chs/YbHcxxMapper.java +++ b/src/main/java/com/glxp/udidl/admin/dao/chs/YbHcxxMapper.java @@ -1,9 +1,17 @@ package com.glxp.udidl.admin.dao.chs; import com.baomidou.mybatisplus.core.mapper.BaseMapper; +import com.glxp.udidl.admin.dto.udchs.BaseParam; import com.glxp.udidl.admin.entity.chs.YbHcxxEntity; import org.apache.ibatis.annotations.Mapper; +import org.apache.ibatis.annotations.Param; + +import java.util.List; @Mapper public interface YbHcxxMapper extends BaseMapper { + + int batchSaveOrUpdateBySpecificationCode(@Param("list") List list); + + List list(BaseParam param); } diff --git a/src/main/java/com/glxp/udidl/admin/dto/udchs/BaseParam.java b/src/main/java/com/glxp/udidl/admin/dto/udchs/BaseParam.java new file mode 100644 index 0000000..e3d8553 --- /dev/null +++ b/src/main/java/com/glxp/udidl/admin/dto/udchs/BaseParam.java @@ -0,0 +1,19 @@ +package com.glxp.udidl.admin.dto.udchs; + +import com.glxp.udidl.admin.req.ListPageRequest; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import lombok.Data; + + +@Data +@ApiModel("查询参数") +public class BaseParam extends ListPageRequest { + + @ApiModelProperty(name = "specificationCode", value = "名称,支持模糊查询") + private String specificationCode;//名称,支持模糊查询 + + @ApiModelProperty(name = "codeShow", value = "名称,支持模糊查询") + private String codeShow;//名称,支持模糊查询 + +} diff --git a/src/main/java/com/glxp/udidl/admin/service/chs/YbHcxxGgService.java b/src/main/java/com/glxp/udidl/admin/service/chs/YbHcxxGgService.java deleted file mode 100644 index dd6bc96..0000000 --- a/src/main/java/com/glxp/udidl/admin/service/chs/YbHcxxGgService.java +++ /dev/null @@ -1,10 +0,0 @@ -package com.glxp.udidl.admin.service.chs; - -import org.springframework.stereotype.Service; -import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; -import com.glxp.udidl.admin.entity.chs.YbHcxxGgEntity; -import com.glxp.udidl.admin.dao.chs.YbHcxxGgMapper; -@Service -public class YbHcxxGgService extends ServiceImpl { - -} diff --git a/src/main/java/com/glxp/udidl/admin/service/chs/YbHcxxService.java b/src/main/java/com/glxp/udidl/admin/service/chs/YbHcxxService.java deleted file mode 100644 index c4a68b3..0000000 --- a/src/main/java/com/glxp/udidl/admin/service/chs/YbHcxxService.java +++ /dev/null @@ -1,10 +0,0 @@ -package com.glxp.udidl.admin.service.chs; - -import org.springframework.stereotype.Service; -import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; -import com.glxp.udidl.admin.entity.chs.YbHcxxEntity; -import com.glxp.udidl.admin.dao.chs.YbHcxxMapper; -@Service -public class YbHcxxService extends ServiceImpl { - -} diff --git a/src/main/java/com/glxp/udidl/admin/service/chs/YbChsHttpClient.java b/src/main/java/com/glxp/udidl/admin/service/chsapi/ChsYbChsHttpClient.java similarity index 87% rename from src/main/java/com/glxp/udidl/admin/service/chs/YbChsHttpClient.java rename to src/main/java/com/glxp/udidl/admin/service/chsapi/ChsYbChsHttpClient.java index faaf8da..d486b7d 100644 --- a/src/main/java/com/glxp/udidl/admin/service/chs/YbChsHttpClient.java +++ b/src/main/java/com/glxp/udidl/admin/service/chsapi/ChsYbChsHttpClient.java @@ -1,29 +1,15 @@ -package com.glxp.udidl.admin.service.chs; +package com.glxp.udidl.admin.service.chsapi; -import cn.hutool.core.util.StrUtil; import com.alibaba.fastjson.JSONObject; import com.alibaba.fastjson.TypeReference; -import com.alibaba.fastjson2.JSON; -import com.glxp.udidl.admin.req.chs.YbHcflRequest; import com.glxp.udidl.admin.res.chs.YbHcflResponse; import com.glxp.udidl.admin.res.chs.YbHcxxGgResponse; import com.glxp.udidl.admin.res.chs.YbHcxxResponse; -import com.glxp.udidl.admin.res.tyapi.CompanyBaseResponse; -import com.glxp.udidl.admin.res.tyapi.ContactResponse; -import com.glxp.udidl.admin.res.tyapi.SupplierResponse; -import com.glxp.udidl.admin.util.OkHttpCli; import lombok.extern.slf4j.Slf4j; -import okhttp3.FormBody; -import okhttp3.OkHttpClient; -import okhttp3.Request; -import okhttp3.Response; -import org.apache.commons.lang3.exception.ExceptionUtils; import org.springframework.stereotype.Service; -import javax.annotation.Resource; import java.io.*; -import java.net.HttpURLConnection; -import java.net.URL; +import java.net.*; import java.nio.charset.Charset; import java.util.HashMap; import java.util.Iterator; @@ -31,7 +17,7 @@ import java.util.Map; @Slf4j @Service -public class YbChsHttpClient { +public class ChsYbChsHttpClient { /** * 获取耗材分类目录 @@ -71,7 +57,11 @@ public class YbChsHttpClient { params.put("page", pageNum); params.put("sord", "asc"); params.put("specificationCode", "C"); - + try { + Thread.sleep(20000); + } catch (InterruptedException e) { + e.printStackTrace(); + } String response = sendPost(getHcxxUrl+getParams(params), "",Charset.forName("utf-8")); YbHcxxResponse baseResponse = JSONObject.parseObject(response, new TypeReference() { }); @@ -87,18 +77,22 @@ public class YbChsHttpClient { params.put("page", pageNum); params.put("sord", "asc"); params.put("specificationCode", specificationCode); - + try { + Thread.sleep(15000); + } catch (InterruptedException e) { + e.printStackTrace(); + } String response = sendPost(getHcxxGgUrl+getParams(params), "",Charset.forName("utf-8")); YbHcxxGgResponse baseResponse = JSONObject.parseObject(response, new TypeReference() { }); return baseResponse; } - public static void main(String[] args) { - YbChsHttpClient ybChsHttpClient = new YbChsHttpClient(); - YbHcxxGgResponse ybHcflList = ybChsHttpClient.getYbHcxxGgList("C0101010010100103941",1, 100); - System.out.println(ybHcflList); - } +// public static void main(String[] args) { +// YbChsHttpClient ybChsHttpClient = new YbChsHttpClient(); +// YbHcxxGgResponse ybHcflList = ybChsHttpClient.getYbHcxxGgList("C0101010010100103941",1, 200); +// System.out.println(ybHcflList); +// } /** @@ -180,6 +174,5 @@ public class YbChsHttpClient { } catch (IOException e) { throw new RuntimeException(String.format("url:%s,param:%s,message:%s", url, param, e.getMessage()), e); } - } } diff --git a/src/main/java/com/glxp/udidl/admin/service/chs/YbHcflService.java b/src/main/java/com/glxp/udidl/admin/service/chsapi/ChsYbHcflService.java similarity index 71% rename from src/main/java/com/glxp/udidl/admin/service/chs/YbHcflService.java rename to src/main/java/com/glxp/udidl/admin/service/chsapi/ChsYbHcflService.java index 4a812ee..98c5baa 100644 --- a/src/main/java/com/glxp/udidl/admin/service/chs/YbHcflService.java +++ b/src/main/java/com/glxp/udidl/admin/service/chsapi/ChsYbHcflService.java @@ -1,29 +1,20 @@ -package com.glxp.udidl.admin.service.chs; +package com.glxp.udidl.admin.service.chsapi; import cn.hutool.core.bean.BeanUtil; -import cn.hutool.core.collection.CollUtil; -import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; -import com.glxp.udidl.admin.entity.tyapi.TySupplierEntity; import com.glxp.udidl.admin.res.chs.YbHcflResponse; -import com.glxp.udidl.admin.res.tyapi.SupplierResponse; -import com.glxp.udidl.admin.util.DateUtil; -import com.glxp.udidl.admin.util.IntUtil; -import org.springframework.beans.BeanUtils; import org.springframework.stereotype.Service; import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; import com.glxp.udidl.admin.dao.chs.YbHcflMapper; import com.glxp.udidl.admin.entity.chs.YbHcflEntity; import javax.annotation.Resource; -import java.util.ArrayList; -import java.util.Date; import java.util.List; @Service -public class YbHcflService extends ServiceImpl { +public class ChsYbHcflService extends ServiceImpl { @Resource - YbChsHttpClient ybChsHttpClient; + ChsYbChsHttpClient ybChsHttpClient; @Resource YbHcflMapper ybHcflMapper; @@ -31,7 +22,7 @@ public class YbHcflService extends ServiceImpl { * 更新数据库的YbHcf列表数据 * 以一定大小页面 分批对比数据库 医用耗材分类代码 是否存在 不存在进行新增 */ - public void updateYbHcfList(){ + public void updateYbHcflList(){ Integer pageNum = 1; Integer pageSize = 200; @@ -43,6 +34,7 @@ public class YbHcflService extends ServiceImpl { //处理后续数据 if (total>pageNum){ for (int i = 2; i <= total ; i++) { + System.out.println("更新数据库的YbHcf列表数据"+ i); processUpdates(ybChsHttpClient.getYbHcflList(i, pageSize)); } } diff --git a/src/main/java/com/glxp/udidl/admin/service/chsapi/ChsYbHcxxGgService.java b/src/main/java/com/glxp/udidl/admin/service/chsapi/ChsYbHcxxGgService.java new file mode 100644 index 0000000..57e3c11 --- /dev/null +++ b/src/main/java/com/glxp/udidl/admin/service/chsapi/ChsYbHcxxGgService.java @@ -0,0 +1,100 @@ +package com.glxp.udidl.admin.service.chsapi; + +import cn.hutool.core.bean.BeanUtil; +import cn.hutool.core.collection.CollectionUtil; +import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; +import com.baomidou.mybatisplus.core.metadata.IPage; +import com.baomidou.mybatisplus.extension.plugins.pagination.Page; +import com.glxp.udidl.admin.dao.chs.YbHcxxMapper; +import com.glxp.udidl.admin.entity.chs.YbHcxxEntity; +import com.glxp.udidl.admin.res.chs.YbHcxxGgResponse; +import org.springframework.stereotype.Service; +import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; +import com.glxp.udidl.admin.entity.chs.YbHcxxGgEntity; +import com.glxp.udidl.admin.dao.chs.YbHcxxGgMapper; + +import javax.annotation.Resource; +import java.util.List; + +@Service +public class ChsYbHcxxGgService extends ServiceImpl { + @Resource + ChsYbChsHttpClient ybChsHttpClient; + @Resource + YbHcxxGgMapper ybHcxxGgMapper; + @Resource + YbHcxxMapper ybHcxxMapper; + + /** + * 遍历YbHcxx列表数据分别更新名字 + */ + public void updateForEachYbHcxxList(){ + Integer pageNum = 1; + Integer pageSize = 200; + + IPage page = new Page<>(); + //设置每页条数 + page.setSize(pageSize); + //设置查询第几页 + page.setCurrent(pageNum); + QueryWrapper queryWrapper = new QueryWrapper<>(); + queryWrapper.select("specificationCode"); + queryWrapper.orderByAsc("specificationCode"); + ybHcxxMapper.selectPage(page, queryWrapper); + + List records = page.getRecords(); + if (CollectionUtil.isNotEmpty(records)){ + records.forEach( x->{ + updateYbHcxxGgList(x.getSpecificationCode()); + }); + } + + long total = page.getTotal(); + if (total > pageSize){ + long pageTotal = total/pageSize + 1; + for (int i = 2; i <= pageTotal ; i++) { + page.setCurrent(i); + ybHcxxMapper.selectPage(page, queryWrapper); + List records2 = page.getRecords(); + records2.forEach( x->{ + updateYbHcxxGgList(x.getSpecificationCode()); + }); + } + } + + } + + + /** + * 更新数据库的YbHcxxGg列表数据 + */ + public void updateYbHcxxGgList(String specificationCode){ + Integer pageNum = 1; + Integer pageSize = 200; + + //1、获取数据 + YbHcxxGgResponse ybHcxxGgResponse = ybChsHttpClient.getYbHcxxGgList(specificationCode, pageNum, pageSize); + Integer total = ybHcxxGgResponse.getTotal(); + //处理第一批数据 + processUpdates(ybHcxxGgResponse); + //处理后续数据 + if (total>pageNum){ + for (int i = 2; i <= total ; i++) { + System.out.println("更新数据库的YbHcxxGg列表数据"+ i); + processUpdates(ybChsHttpClient.getYbHcxxGgList(specificationCode,i, pageSize)); + } + } + } + + + /** + * 处理比对更新 + * @param ybHcxxGgResponse + */ + private void processUpdates(YbHcxxGgResponse ybHcxxGgResponse) { + List list = ybHcxxGgResponse.getRows(); + List ybHcxxGgEntities = BeanUtil.copyToList(list, YbHcxxGgEntity.class); + ybHcxxGgMapper.batchSaveOrUpdateBySpecificationCode(ybHcxxGgEntities); + } + +} diff --git a/src/main/java/com/glxp/udidl/admin/service/chsapi/ChsYbHcxxService.java b/src/main/java/com/glxp/udidl/admin/service/chsapi/ChsYbHcxxService.java new file mode 100644 index 0000000..053783e --- /dev/null +++ b/src/main/java/com/glxp/udidl/admin/service/chsapi/ChsYbHcxxService.java @@ -0,0 +1,53 @@ +package com.glxp.udidl.admin.service.chsapi; + +import cn.hutool.core.bean.BeanUtil; +import com.glxp.udidl.admin.res.chs.YbHcxxResponse; +import org.springframework.stereotype.Service; +import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; +import com.glxp.udidl.admin.entity.chs.YbHcxxEntity; +import com.glxp.udidl.admin.dao.chs.YbHcxxMapper; + +import javax.annotation.Resource; +import java.util.List; + +@Service +public class ChsYbHcxxService extends ServiceImpl { + + @Resource + ChsYbChsHttpClient ybChsHttpClient; + @Resource + YbHcxxMapper ybHcxxMapper; + + /** + * 更新数据库的YbHcxx列表数据 + * 以一定大小页面 分批对比数据库 医用耗材分类代码 是否存在 不存在进行新增 + */ + public void updateYbHcxxList(){ + Integer pageNum = 1; + Integer pageSize = 100; + + //1、获取数据 + YbHcxxResponse ybHcxxResponse = ybChsHttpClient.getYbHcxxList(pageNum, pageSize); + Integer total = ybHcxxResponse.getTotal(); + //处理第一批数据 + processUpdates(ybHcxxResponse); + //处理后续数据 + if (total>pageNum){ + for (int i = 2; i <= total ; i++) { + System.out.println("更新数据库的YbHcxx列表数据"+ i); + processUpdates(ybChsHttpClient.getYbHcxxList(i, pageSize)); + } + } + } + + /** + * 处理比对更新 + * @param ybHcxxResponse + */ + private void processUpdates(YbHcxxResponse ybHcxxResponse) { + List list = ybHcxxResponse.getRows(); + List ybHcxxEntities = BeanUtil.copyToList(list, YbHcxxEntity.class); + ybHcxxMapper.batchSaveOrUpdateBySpecificationCode(ybHcxxEntities); + } + +} diff --git a/src/main/java/com/glxp/udidl/admin/service/udchs/YbHcflService.java b/src/main/java/com/glxp/udidl/admin/service/udchs/YbHcflService.java new file mode 100644 index 0000000..fe64e81 --- /dev/null +++ b/src/main/java/com/glxp/udidl/admin/service/udchs/YbHcflService.java @@ -0,0 +1,8 @@ +package com.glxp.udidl.admin.service.udchs; + +import com.glxp.udidl.admin.dto.udchs.BaseParam; +import com.glxp.udidl.admin.res.BaseResponse; + +public interface YbHcflService { + BaseResponse getList(BaseParam param); +} diff --git a/src/main/java/com/glxp/udidl/admin/service/udchs/YbHcxxGgService.java b/src/main/java/com/glxp/udidl/admin/service/udchs/YbHcxxGgService.java new file mode 100644 index 0000000..a511b33 --- /dev/null +++ b/src/main/java/com/glxp/udidl/admin/service/udchs/YbHcxxGgService.java @@ -0,0 +1,8 @@ +package com.glxp.udidl.admin.service.udchs; + +import com.glxp.udidl.admin.dto.udchs.BaseParam; +import com.glxp.udidl.admin.res.BaseResponse; + +public interface YbHcxxGgService { + BaseResponse getList(BaseParam param); +} diff --git a/src/main/java/com/glxp/udidl/admin/service/udchs/YbHcxxService.java b/src/main/java/com/glxp/udidl/admin/service/udchs/YbHcxxService.java new file mode 100644 index 0000000..7880db4 --- /dev/null +++ b/src/main/java/com/glxp/udidl/admin/service/udchs/YbHcxxService.java @@ -0,0 +1,8 @@ +package com.glxp.udidl.admin.service.udchs; + +import com.glxp.udidl.admin.dto.udchs.BaseParam; +import com.glxp.udidl.admin.res.BaseResponse; + +public interface YbHcxxService { + BaseResponse getList(BaseParam param); +} diff --git a/src/main/java/com/glxp/udidl/admin/service/udchs/impl/YbHcflServiceImpl.java b/src/main/java/com/glxp/udidl/admin/service/udchs/impl/YbHcflServiceImpl.java new file mode 100644 index 0000000..a4fb051 --- /dev/null +++ b/src/main/java/com/glxp/udidl/admin/service/udchs/impl/YbHcflServiceImpl.java @@ -0,0 +1,34 @@ +package com.glxp.udidl.admin.service.udchs.impl; + + +import com.github.pagehelper.PageHelper; +import com.github.pagehelper.PageInfo; +import com.glxp.udidl.admin.dao.chs.YbHcflMapper; +import com.glxp.udidl.admin.dto.udchs.BaseParam; +import com.glxp.udidl.admin.entity.chs.YbHcflEntity; +import com.glxp.udidl.admin.res.BaseResponse; +import com.glxp.udidl.admin.res.PageSimpleResponse; +import com.glxp.udidl.admin.service.udchs.YbHcflService; +import com.glxp.udidl.admin.util.ResultVOUtils; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; + +import java.util.List; + +@Service +public class YbHcflServiceImpl implements YbHcflService { + + @Autowired + private YbHcflMapper mapper; + + @Override + public BaseResponse getList(BaseParam param) { + PageHelper.startPage(param.getPage(), param.getLimit()); + List list = mapper.list(param); + PageInfo pageInfo = new PageInfo<>(list); + PageSimpleResponse pageSimpleResponse = new PageSimpleResponse<>(); + pageSimpleResponse.setTotal(pageInfo.getTotal()); + pageSimpleResponse.setList(list); + return ResultVOUtils.success(pageSimpleResponse); + } +} diff --git a/src/main/java/com/glxp/udidl/admin/service/udchs/impl/YbHcxxGgServiceImpl.java b/src/main/java/com/glxp/udidl/admin/service/udchs/impl/YbHcxxGgServiceImpl.java new file mode 100644 index 0000000..7fb3621 --- /dev/null +++ b/src/main/java/com/glxp/udidl/admin/service/udchs/impl/YbHcxxGgServiceImpl.java @@ -0,0 +1,33 @@ +package com.glxp.udidl.admin.service.udchs.impl; + + +import com.github.pagehelper.PageHelper; +import com.github.pagehelper.PageInfo; +import com.glxp.udidl.admin.dao.chs.YbHcxxGgMapper; +import com.glxp.udidl.admin.dto.udchs.BaseParam; +import com.glxp.udidl.admin.entity.chs.YbHcflEntity; +import com.glxp.udidl.admin.entity.chs.YbHcxxGgEntity; +import com.glxp.udidl.admin.res.BaseResponse; +import com.glxp.udidl.admin.res.PageSimpleResponse; +import com.glxp.udidl.admin.service.udchs.YbHcxxGgService; +import com.glxp.udidl.admin.util.ResultVOUtils; +import org.springframework.stereotype.Service; + +import javax.annotation.Resource; +import java.util.List; + +@Service +public class YbHcxxGgServiceImpl implements YbHcxxGgService { + @Resource + YbHcxxGgMapper mapper; + @Override + public BaseResponse getList(BaseParam param) { + PageHelper.startPage(param.getPage(), param.getLimit()); + List list = mapper.list(param); + PageInfo pageInfo = new PageInfo<>(list); + PageSimpleResponse pageSimpleResponse = new PageSimpleResponse<>(); + pageSimpleResponse.setTotal(pageInfo.getTotal()); + pageSimpleResponse.setList(list); + return ResultVOUtils.success(pageSimpleResponse); + } +} diff --git a/src/main/java/com/glxp/udidl/admin/service/udchs/impl/YbHcxxServiceImpl.java b/src/main/java/com/glxp/udidl/admin/service/udchs/impl/YbHcxxServiceImpl.java new file mode 100644 index 0000000..9c76cce --- /dev/null +++ b/src/main/java/com/glxp/udidl/admin/service/udchs/impl/YbHcxxServiceImpl.java @@ -0,0 +1,32 @@ +package com.glxp.udidl.admin.service.udchs.impl; + + +import com.github.pagehelper.PageHelper; +import com.github.pagehelper.PageInfo; +import com.glxp.udidl.admin.dao.chs.YbHcxxMapper; +import com.glxp.udidl.admin.dto.udchs.BaseParam; +import com.glxp.udidl.admin.entity.chs.YbHcxxEntity; +import com.glxp.udidl.admin.res.BaseResponse; +import com.glxp.udidl.admin.res.PageSimpleResponse; +import com.glxp.udidl.admin.service.udchs.YbHcxxService; +import com.glxp.udidl.admin.util.ResultVOUtils; +import org.springframework.stereotype.Service; + +import javax.annotation.Resource; +import java.util.List; + +@Service +public class YbHcxxServiceImpl implements YbHcxxService { + @Resource + YbHcxxMapper mapper; + @Override + public BaseResponse getList(BaseParam param) { + PageHelper.startPage(param.getPage(), param.getLimit()); + List list = mapper.list(param); + PageInfo pageInfo = new PageInfo<>(list); + PageSimpleResponse pageSimpleResponse = new PageSimpleResponse<>(); + pageSimpleResponse.setTotal(pageInfo.getTotal()); + pageSimpleResponse.setList(list); + return ResultVOUtils.success(pageSimpleResponse); + } +} diff --git a/src/main/java/com/glxp/udidl/admin/thread/YbChsHcflTask.java b/src/main/java/com/glxp/udidl/admin/thread/YbChsHcflTask.java index 87a0128..ac4a701 100644 --- a/src/main/java/com/glxp/udidl/admin/thread/YbChsHcflTask.java +++ b/src/main/java/com/glxp/udidl/admin/thread/YbChsHcflTask.java @@ -1,13 +1,9 @@ package com.glxp.udidl.admin.thread; -import com.glxp.udidl.admin.constant.Constant; import com.glxp.udidl.admin.dao.info.ScheduledMapper; import com.glxp.udidl.admin.entity.info.ScheduledEntity; -import com.glxp.udidl.admin.entity.udid.JobLog; import com.glxp.udidl.admin.req.info.ScheduledRequest; -import com.glxp.udidl.admin.res.BaseResponse; -import com.glxp.udidl.admin.service.chs.YbHcflService; -import com.glxp.udidl.admin.util.DateUtil; +import com.glxp.udidl.admin.service.chsapi.ChsYbHcflService; import org.slf4j.Logger; import org.slf4j.LoggerFactory; import org.springframework.scheduling.annotation.EnableScheduling; @@ -26,7 +22,7 @@ public class YbChsHcflTask implements SchedulingConfigurer { private ScheduledMapper scheduledDao; @Resource - private YbHcflService ybHcflService; + private ChsYbHcflService ybHcflService; final Logger logger = LoggerFactory.getLogger(DownloadProductInfoTask.class); @@ -46,7 +42,7 @@ public class YbChsHcflTask implements SchedulingConfigurer { } private void process() { - System.out.println("开始执行更新医保数据"); - ybHcflService.updateYbHcfList(); + System.out.println("开始执行更新医保数据YbHcfl"); + ybHcflService.updateYbHcflList(); } } diff --git a/src/main/java/com/glxp/udidl/admin/thread/YbChsHcxxGgTask.java b/src/main/java/com/glxp/udidl/admin/thread/YbChsHcxxGgTask.java new file mode 100644 index 0000000..7d32535 --- /dev/null +++ b/src/main/java/com/glxp/udidl/admin/thread/YbChsHcxxGgTask.java @@ -0,0 +1,48 @@ +package com.glxp.udidl.admin.thread; + +import com.glxp.udidl.admin.dao.info.ScheduledMapper; +import com.glxp.udidl.admin.entity.info.ScheduledEntity; +import com.glxp.udidl.admin.req.info.ScheduledRequest; +import com.glxp.udidl.admin.service.chsapi.ChsYbHcxxGgService; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; +import org.springframework.scheduling.annotation.EnableScheduling; +import org.springframework.scheduling.annotation.SchedulingConfigurer; +import org.springframework.scheduling.config.ScheduledTaskRegistrar; +import org.springframework.scheduling.support.CronTrigger; +import org.springframework.stereotype.Component; + +import javax.annotation.Resource; + +@Component +@EnableScheduling +public class YbChsHcxxGgTask implements SchedulingConfigurer { + + @Resource + private ScheduledMapper scheduledDao; + + @Resource + private ChsYbHcxxGgService ybHcxxGgService; + + final Logger logger = LoggerFactory.getLogger(DownloadProductInfoTask.class); + + @Override + public void configureTasks(ScheduledTaskRegistrar scheduledTaskRegistrar) { + scheduledTaskRegistrar.addTriggerTask(() -> process(), + triggerContext -> { + ScheduledRequest scheduledRequest = new ScheduledRequest(); + scheduledRequest.setCronName("ybChsHcxxGgTask"); + ScheduledEntity scheduledEntity = scheduledDao.findScheduled(scheduledRequest); + String cron = scheduledEntity.getCron(); + if (cron.isEmpty()) { + logger.error("cron is null"); + } + return new CronTrigger(cron).nextExecutionTime(triggerContext); + }); + } + + private void process() { + System.out.println("开始执行更新医保数据YbHcxxGg"); + ybHcxxGgService.updateForEachYbHcxxList(); + } +} diff --git a/src/main/java/com/glxp/udidl/admin/thread/YbChsHcxxTask.java b/src/main/java/com/glxp/udidl/admin/thread/YbChsHcxxTask.java new file mode 100644 index 0000000..ced902b --- /dev/null +++ b/src/main/java/com/glxp/udidl/admin/thread/YbChsHcxxTask.java @@ -0,0 +1,48 @@ +package com.glxp.udidl.admin.thread; + +import com.glxp.udidl.admin.dao.info.ScheduledMapper; +import com.glxp.udidl.admin.entity.info.ScheduledEntity; +import com.glxp.udidl.admin.req.info.ScheduledRequest; +import com.glxp.udidl.admin.service.chsapi.ChsYbHcxxService; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; +import org.springframework.scheduling.annotation.EnableScheduling; +import org.springframework.scheduling.annotation.SchedulingConfigurer; +import org.springframework.scheduling.config.ScheduledTaskRegistrar; +import org.springframework.scheduling.support.CronTrigger; +import org.springframework.stereotype.Component; + +import javax.annotation.Resource; + +@Component +@EnableScheduling +public class YbChsHcxxTask implements SchedulingConfigurer { + + @Resource + private ScheduledMapper scheduledDao; + + @Resource + private ChsYbHcxxService ybHcxxService; + + final Logger logger = LoggerFactory.getLogger(DownloadProductInfoTask.class); + + @Override + public void configureTasks(ScheduledTaskRegistrar scheduledTaskRegistrar) { + scheduledTaskRegistrar.addTriggerTask(() -> process(), + triggerContext -> { + ScheduledRequest scheduledRequest = new ScheduledRequest(); + scheduledRequest.setCronName("ybChsHcxxTask"); + ScheduledEntity scheduledEntity = scheduledDao.findScheduled(scheduledRequest); + String cron = scheduledEntity.getCron(); + if (cron.isEmpty()) { + logger.error("cron is null"); + } + return new CronTrigger(cron).nextExecutionTime(triggerContext); + }); + } + + private void process() { + System.out.println("开始执行更新医保数据YbHcxx"); + ybHcxxService.updateYbHcxxList(); + } +} diff --git a/src/main/resources/mybatis/mapper/chs/YbHcxxGgMapper.xml b/src/main/resources/mybatis/mapper/chs/YbHcxxGgMapper.xml deleted file mode 100644 index fd5510d..0000000 --- a/src/main/resources/mybatis/mapper/chs/YbHcxxGgMapper.xml +++ /dev/null @@ -1,57 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - id, addTime, addUserId, addUserName, auditRemark, auditUserId, auditUserName, catalogCode, - catalogname1, catalogname2, catalogname3, characteristic, codeOld, codeShow, commonname, - companyName, dataType, ggxhCode, goodsid, isUsing, lastUpdateTime, lastUpdateUserId, - lastUpdateUserName, mapingCode, matrial, model, oldregcardnm, productName, productid, - productionCode, regcardName, regcardid, regcardnm, registrant, relationId, relationStatus, - releaseVersion, specification, specificationCode, udiCode - - diff --git a/src/main/resources/mybatis/mapper/chs/YbHcxxMapper.xml b/src/main/resources/mybatis/mapper/chs/YbHcxxMapper.xml deleted file mode 100644 index 693d9c4..0000000 --- a/src/main/resources/mybatis/mapper/chs/YbHcxxMapper.xml +++ /dev/null @@ -1,42 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - id, specificationCode, hcflCodeFk, catalogname1, catalogname2, catalogname3, characteristic, - codeCount, codeCounts, commonname, compCounts, companyName, matrial, model, proCounts, - prodCount, productName, productionCode, regCount, regCounts, regcardName, regcardnm, - releaseVersion, specCount, specCounts, specification, totals - - diff --git a/src/main/resources/mybatis/mapper/chs/YbHcflMapper.xml b/src/main/resources/mybatis/mapper/udchs/YbHcflMapper.xml similarity index 85% rename from src/main/resources/mybatis/mapper/chs/YbHcflMapper.xml rename to src/main/resources/mybatis/mapper/udchs/YbHcflMapper.xml index 865a9e6..4a390e1 100644 --- a/src/main/resources/mybatis/mapper/chs/YbHcflMapper.xml +++ b/src/main/resources/mybatis/mapper/udchs/YbHcflMapper.xml @@ -48,7 +48,8 @@ ) VALUES - (#{item.specificationCode}, + ( + #{item.specificationCode}, #{item.specificationId}, #{item.catalogcode}, #{item.catalogname1}, @@ -69,28 +70,26 @@ #{item.productCount}, #{item.compCount}, #{item.regCount}, - #{item.goodsCount}) + #{item.goodsCount} + ) ON DUPLICATE KEY UPDATE specificationId = VALUES(specificationId), catalogcode = VALUES(catalogcode), catalogname1 = VALUES(catalogname1), catalogname2 = VALUES(catalogname2), - catalogname3 = VALUES(catalogname3), commonnamecode = VALUES(commonnamecode), commonname = VALUES(commonname), matrialcode = VALUES(matrialcode), matrial = VALUES(matrial), characteristiccode = VALUES(characteristiccode), - characteristic = VALUES(characteristic), separateCharges = VALUES(separateCharges), paymentType = VALUES(paymentType), paymentStandard = VALUES(paymentStandard), isusing = VALUES(isusing), specificationType = VALUES(specificationType), - productStatusS = VALUES(productStatusS), productCount = VALUES(productCount), compCount = VALUES(compCount), @@ -98,4 +97,18 @@ goodsCount = VALUES(goodsCount) + + diff --git a/src/main/resources/mybatis/mapper/udchs/YbHcxxGgMapper.xml b/src/main/resources/mybatis/mapper/udchs/YbHcxxGgMapper.xml new file mode 100644 index 0000000..f714d74 --- /dev/null +++ b/src/main/resources/mybatis/mapper/udchs/YbHcxxGgMapper.xml @@ -0,0 +1,170 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + id, addTime, addUserId, addUserName, auditRemark, auditUserId, auditUserName, catalogCode, + catalogname1, catalogname2, catalogname3, characteristic, codeOld, codeShow, commonname, + companyName, dataType, ggxhCode, goodsid, isUsing, lastUpdateTime, lastUpdateUserId, + lastUpdateUserName, mapingCode, matrial, model, oldregcardnm, productName, productid, + productionCode, regcardName, regcardid, regcardnm, registrant, relationId, relationStatus, + releaseVersion, specification, specificationCode, udiCode + + + + + INSERT INTO + yb_hcxx_gg + ( + addTime, addUserId, addUserName, auditRemark, auditUserId, auditUserName, catalogCode, + catalogname1, catalogname2, catalogname3, characteristic, codeOld, codeShow, commonname, + companyName, dataType, ggxhCode, goodsid, isUsing, lastUpdateTime, lastUpdateUserId, + lastUpdateUserName, mapingCode, matrial, model, oldregcardnm, productName, productid, + productionCode, regcardName, regcardid, regcardnm, registrant, relationId, relationStatus, + releaseVersion, specification, specificationCode, udiCode + ) + VALUES + + ( + #{item.addTime}, + #{item.addUserId}, + #{item.addUserName}, + #{item.auditRemark}, + #{item.auditUserId}, + #{item.auditUserName}, + #{item.catalogCode}, + #{item.catalogname1}, + #{item.catalogname2}, + #{item.catalogname3}, + #{item.characteristic}, + #{item.codeOld}, + #{item.codeShow}, + #{item.commonname}, + #{item.companyName}, + #{item.dataType}, + #{item.ggxhCode}, + #{item.goodsid}, + #{item.isUsing}, + #{item.lastUpdateTime}, + #{item.lastUpdateUserId}, + #{item.lastUpdateUserName}, + #{item.mapingCode}, + #{item.matrial}, + #{item.model}, + #{item.oldregcardnm}, + #{item.productName}, + #{item.productid}, + #{item.productionCode}, + #{item.regcardName}, + #{item.regcardid}, + #{item.regcardnm}, + #{item.registrant}, + #{item.relationId}, + #{item.relationStatus}, + #{item.releaseVersion}, + #{item.specification}, + #{item.specificationCode}, + #{item.udiCode} + ) + + ON DUPLICATE KEY UPDATE + addTime = VALUES(addTime), + addUserId = VALUES(addUserId), + addUserName = VALUES(addUserName), + auditRemark = VALUES(auditRemark), + auditUserId = VALUES(auditUserId), + auditUserName = VALUES(auditUserName), + catalogCode = VALUES(catalogCode), + catalogname1 = VALUES(catalogname1), + catalogname2 = VALUES(catalogname2), + catalogname3 = VALUES(catalogname3), + characteristic = VALUES(characteristic), + codeOld = VALUES(codeOld), + commonname = VALUES(commonname), + companyName = VALUES(companyName), + dataType = VALUES(dataType), + ggxhCode = VALUES(ggxhCode), + goodsid = VALUES(goodsid), + isUsing = VALUES(isUsing), + lastUpdateTime = VALUES(lastUpdateTime), + lastUpdateUserId = VALUES(lastUpdateUserId), + lastUpdateUserName = VALUES(lastUpdateUserName), + mapingCode = VALUES(mapingCode), + matrial = VALUES(matrial), + model = VALUES(model), + oldregcardnm = VALUES(oldregcardnm), + productName = VALUES(productName), + productid = VALUES(productid), + productionCode = VALUES(productionCode), + regcardName = VALUES(regcardName), + regcardid = VALUES(regcardid), + regcardnm = VALUES(regcardnm), + registrant = VALUES(registrant), + relationId = VALUES(relationId), + relationStatus = VALUES(relationStatus), + releaseVersion = VALUES(releaseVersion), + specification = VALUES(specification), + specificationCode = VALUES(specificationCode), + udiCode = VALUES(udiCode) + + + + diff --git a/src/main/resources/mybatis/mapper/udchs/YbHcxxMapper.xml b/src/main/resources/mybatis/mapper/udchs/YbHcxxMapper.xml new file mode 100644 index 0000000..03b094e --- /dev/null +++ b/src/main/resources/mybatis/mapper/udchs/YbHcxxMapper.xml @@ -0,0 +1,125 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + id, specificationCode, hcflCodeFk, catalogname1, catalogname2, catalogname3, characteristic, + codeCount, codeCounts, commonname, compCounts, companyName, matrial, model, proCounts, + prodCount, productName, productionCode, regCount, regCounts, regcardName, regcardnm, + releaseVersion, specCount, specCounts, specification, totals + + + + + INSERT INTO + yb_hcxx + ( + specificationCode, hcflCodeFk, catalogname1, catalogname2, catalogname3, characteristic, + codeCount, codeCounts, commonname, compCounts, companyName, matrial, model, proCounts, + prodCount, productName, productionCode, regCount, regCounts, regcardName, regcardnm, + releaseVersion, specCount, specCounts, specification, totals + ) + VALUES + + ( + #{item.specificationCode}, + #{item.hcflCodeFk}, + #{item.catalogname1}, + #{item.catalogname2}, + #{item.catalogname3}, + #{item.characteristic}, + #{item.codeCount}, + #{item.codeCounts}, + #{item.commonname}, + #{item.compCounts}, + #{item.companyName}, + #{item.matrial}, + #{item.model}, + #{item.proCounts}, + #{item.prodCount}, + #{item.productName}, + #{item.productionCode}, + #{item.regCount}, + #{item.regCounts}, + #{item.regcardName}, + #{item.regcardnm}, + #{item.releaseVersion}, + #{item.specCount}, + #{item.specCounts}, + #{item.specification}, + #{item.totals} + ) + + ON DUPLICATE KEY UPDATE + hcflCodeFk = VALUES(hcflCodeFk), + catalogname1 = VALUES(catalogname1), + catalogname2 = VALUES(catalogname2), + catalogname3 = VALUES(catalogname3), + characteristic = VALUES(characteristic), + codeCount = VALUES(codeCount), + codeCounts = VALUES(codeCounts), + commonname = VALUES(commonname), + compCounts = VALUES(compCounts), + companyName = VALUES(companyName), + matrial = VALUES(matrial), + model = VALUES(model), + proCounts = VALUES(proCounts), + prodCount = VALUES(prodCount), + productName = VALUES(productName), + productionCode = VALUES(productionCode), + regCount = VALUES(regCount), + regCounts = VALUES(regCounts), + regcardName = VALUES(regcardName), + regcardnm = VALUES(regcardnm), + releaseVersion = VALUES(releaseVersion), + specCounts = VALUES(specCounts), + specification = VALUES(specification), + totals = VALUES(totals) + + + + +