diff --git a/pom.xml b/pom.xml
index 5f6da07..34f68ee 100644
--- a/pom.xml
+++ b/pom.xml
@@ -28,7 +28,7 @@
com.alibaba
fastjson
- 1.2.51
+ 2.0.4
diff --git a/src/main/java/com/glxp/udidl/admin/controller/device/DownloadDeviceHelper.java b/src/main/java/com/glxp/udidl/admin/controller/device/DownloadDeviceHelper.java
index dd7a4c8..3cd0ce5 100644
--- a/src/main/java/com/glxp/udidl/admin/controller/device/DownloadDeviceHelper.java
+++ b/src/main/java/com/glxp/udidl/admin/controller/device/DownloadDeviceHelper.java
@@ -175,6 +175,29 @@ public class DownloadDeviceHelper {
return result;
}
+ public int simpleDownloadDevices(ProductInfoService productInfoService, DeviceService deviceService, DeviceRequest deviceRequest) {
+ String response = HttpClient.post(url, deviceRequest);
+ int result = -1;
+ List dataSetBeanList = null;
+ MedicalResonse medicalResonse = null;
+ if (url.equals("sharing/get")) {
+ medicalResonse = (MedicalResonse) JSONObject.parseObject(response, MedicalResonse.class);
+ result = medicalResonse.getReturnCode();
+ dataSetBeanList = medicalResonse.getDataSet();
+ }
+
+ if (dataSetBeanList != null && dataSetBeanList.size() > 0) {
+ for (int i = 0; i < dataSetBeanList.size(); i++) {
+ DataSetBean dataSetBean = dataSetBeanList.get(i);
+ Device device = WarehousBeanUtils.responseToDevice(dataSetBean);
+ }
+ }
+ if (Integer.parseInt(deviceRequest.getCurrentPageNumber()) >= medicalResonse.getTotalPageCount()) {
+ return -1;
+ }
+ return result;
+ }
+
//下载生产企业
public int downloadProduct(ProductInfoService productInfoService, DeviceService deviceService, DeviceRequest deviceRequest) {
String response = HttpClient.post(url, deviceRequest);
diff --git a/src/main/java/com/glxp/udidl/admin/controller/device/ProductInfoController.java b/src/main/java/com/glxp/udidl/admin/controller/device/ProductInfoController.java
index 59e9ad4..9281ba6 100644
--- a/src/main/java/com/glxp/udidl/admin/controller/device/ProductInfoController.java
+++ b/src/main/java/com/glxp/udidl/admin/controller/device/ProductInfoController.java
@@ -3,12 +3,15 @@ package com.glxp.udidl.admin.controller.device;
import com.github.pagehelper.PageInfo;
import com.glxp.udidl.admin.annotation.AuthRuleAnnotation;
import com.glxp.udidl.admin.entity.udi.ProductInfoEntity;
+import com.glxp.udidl.admin.entity.udi.UdiCompanyEntity;
import com.glxp.udidl.admin.entity.udid.UdiEntity;
import com.glxp.udidl.admin.req.ProductInfoFilterRequest;
+import com.glxp.udidl.admin.req.UdiCompanyRequest;
import com.glxp.udidl.admin.res.BaseResponse;
import com.glxp.udidl.admin.res.PageSimpleResponse;
import com.glxp.udidl.admin.res.udid.ProductInfoResponse;
import com.glxp.udidl.admin.service.inout.ProductInfoService;
+import com.glxp.udidl.admin.service.udi.UdiCompanyService;
import com.glxp.udidl.admin.thread.AsyncDownloadTask;
import com.glxp.udidl.admin.util.FilterUdiUtils;
import com.glxp.udidl.admin.util.ResultVOUtils;
@@ -31,6 +34,8 @@ public class ProductInfoController {
@Resource
ProductInfoService productInfoService;
@Resource
+ UdiCompanyService udiCompanyService;
+ @Resource
AsyncDownloadTask asyncDownloadTask;
//手持枪扫码查询
@@ -123,6 +128,13 @@ public class ProductInfoController {
return ResultVOUtils.success(productInfoEntityList);
}
+ //出入库同步下载
+ @AuthRuleAnnotation("udidl_company_all")
+ @GetMapping("udidl/udiwms/syncCompany")
+ public BaseResponse syncCompany(UdiCompanyRequest udiCompanyRequest) {
+ List udiCompanyEntities = udiCompanyService.syncDlCompany(udiCompanyRequest);
+ return ResultVOUtils.success(udiCompanyEntities);
+ }
//开放查询 查询只查询主DI,
@ApiOperation(value = "根据主DI查询产品信息", response = ProductInfoEntity.class)
@@ -163,9 +175,9 @@ public class ProductInfoController {
}
}
- if (productInfoFilterRequest.getCpmctymc() != null && !productInfoFilterRequest.getCpmctymc().equals("") && productInfoFilterRequest.getCpmctymc().length() < 4) {
+ /* if (productInfoFilterRequest.getCpmctymc() != null && !productInfoFilterRequest.getCpmctymc().equals("") && productInfoFilterRequest.getCpmctymc().length() < 4) {
return ResultVOUtils.error(500, "请输入完整的产品通用名称!");
- }
+ }*/
productInfoFilterRequest.setIsNewest(1);
productInfoFilterRequest.setDiType("1");
List productInfoEntityList = productInfoService.filterUdi(productInfoFilterRequest);
@@ -230,7 +242,7 @@ public class ProductInfoController {
return ResultVOUtils.success(pageSimpleResponse);
}
- @ApiOperation(value = "根据UUID查询产品信息",response = ProductInfoEntity.class)
+ @ApiOperation(value = "根据UUID查询产品信息", response = ProductInfoEntity.class)
@AuthRuleAnnotation("udidl/device/filterByUuid")
@GetMapping("udidl/device/filterByUuid")
public BaseResponse filterByUuid(ProductInfoFilterRequest productInfoFilterRequest) {
@@ -238,7 +250,7 @@ public class ProductInfoController {
return ResultVOUtils.success(productInfoEntityList);
}
- @ApiOperation(value = "根据最小标识查询产品信息",response = ProductInfoEntity.class)
+ @ApiOperation(value = "根据最小标识查询产品信息", response = ProductInfoEntity.class)
@AuthRuleAnnotation("udidl/device/filterByNameCode")
@GetMapping("udidl/device/filterByNameCode")
public BaseResponse filterByNameCode(ProductInfoFilterRequest productInfoFilterRequest) {
diff --git a/src/main/java/com/glxp/udidl/admin/controller/device/TestController.java b/src/main/java/com/glxp/udidl/admin/controller/device/TestController.java
index bf1c9de..94bc2e2 100644
--- a/src/main/java/com/glxp/udidl/admin/controller/device/TestController.java
+++ b/src/main/java/com/glxp/udidl/admin/controller/device/TestController.java
@@ -2,8 +2,13 @@ package com.glxp.udidl.admin.controller.device;
import com.alibaba.fastjson.JSONObject;
import com.glxp.udidl.admin.dao.udi.ProductInfoMapper;
+import com.glxp.udidl.admin.entity.udi.ProductInfoEntity;
+import com.glxp.udidl.admin.entity.udi.UdiCompanyEntity;
+import com.glxp.udidl.admin.entity.udid.Contactlist;
import com.glxp.udidl.admin.entity.udid.Device;
import com.glxp.udidl.admin.req.ListPageRequest;
+import com.glxp.udidl.admin.req.ProductInfoFilterRequest;
+import com.glxp.udidl.admin.req.UdiCompanyRequest;
import com.glxp.udidl.admin.res.BaseResponse;
import com.glxp.udidl.admin.service.dataSync.DeviceSyncService;
import com.glxp.udidl.admin.service.dataSync.UdplatDownloadService;
@@ -24,6 +29,7 @@ import org.springframework.web.bind.annotation.RestController;
import springfox.documentation.annotations.ApiIgnore;
import javax.annotation.Resource;
+import java.util.Date;
import java.util.List;
@ApiIgnore
@@ -96,6 +102,13 @@ public class TestController {
asyncDownloadTask.downloadByMonth(month, page);
}
+ @GetMapping("udidl/device/dlBymonthTest")
+ public void dlBymonthTest(String month, int page) {
+
+ logger.info(month + "---按月开启下载");
+ asyncDownloadTask.downloadByMonthTest(month, page);
+ }
+
@GetMapping("/test/getDistributor")
public String udplatTest() {
return udplatDownloadService.getDistributor();
@@ -131,4 +144,40 @@ public class TestController {
public JSONObject getDistributeOrderDetails(Long orderId) {
return udplatDownloadService.getDistributeOrderDetails(orderId);
}
+
+ @GetMapping("/test/transferUdiCompany")
+ public BaseResponse transferUdiCompany(String nameCode) {
+ //更新为最新版本
+ ProductInfoFilterRequest filterRequest1 = new ProductInfoFilterRequest();
+ filterRequest1.setNameCode(nameCode);
+ List updateEntitys = productInfoService.filterUdi(filterRequest1);
+ ProductInfoEntity productInfoEntity;
+ if (updateEntitys != null && updateEntitys.size() > 0) {
+ //获取最高版本号
+ productInfoEntity = updateEntitys.get(0);
+ //更新厂家信息,
+ UdiCompanyRequest udiCompanyRequest = new UdiCompanyRequest();
+ udiCompanyRequest.setTyshxydm(productInfoEntity.getTyshxydm());
+ List udiCompanyEntitys = udiCompanyService.filterUdiCompany(udiCompanyRequest);
+ if (udiCompanyEntitys == null || udiCompanyEntitys.size() == 0) {
+ UdiCompanyEntity udiCompanyEntity = new UdiCompanyEntity();
+ udiCompanyEntity.setTyshxydm(productInfoEntity.getTyshxydm());
+ udiCompanyEntity.setUpdateTime(new Date());
+ udiCompanyEntity.setYlqxzcrbarywmc(productInfoEntity.getYlqxzcrbarywmc());
+ udiCompanyEntity.setYlqxzcrbarmc(productInfoEntity.getYlqxzcrbarmc());
+ List contactlists = udiCompanyService.selectContactBykey(productInfoEntity.getDeviceRecordKey());
+ if (contactlists != null && contactlists.size() > 0) {
+ udiCompanyEntity.setQylxrcz(contactlists.get(0).getQylxrcz());
+ udiCompanyEntity.setQylxrdh(contactlists.get(0).getQylxrdh());
+ udiCompanyEntity.setQylxryx(contactlists.get(0).getQylxryx());
+ }
+ udiCompanyEntity.setUpdateTime(new Date());
+ udiCompanyService.insertUdiCompany(udiCompanyEntity);
+ return ResultVOUtils.success(udiCompanyEntity);
+ }
+
+ }
+ return ResultVOUtils.error(500, "未查询到数据");
+ }
+
}
diff --git a/src/main/java/com/glxp/udidl/admin/controller/device/UdidlDeviceController.java b/src/main/java/com/glxp/udidl/admin/controller/device/UdidlDeviceController.java
index 3dc5a5c..a6fe6fb 100644
--- a/src/main/java/com/glxp/udidl/admin/controller/device/UdidlDeviceController.java
+++ b/src/main/java/com/glxp/udidl/admin/controller/device/UdidlDeviceController.java
@@ -59,6 +59,13 @@ public class UdidlDeviceController {
return deviceSyncService.downloadByDi(deviceId);
}
+
+ @AuthRuleAnnotation("udidl_udidlDevice_all")
+ @GetMapping("udidl/device/serchDlByDi")
+ public BaseResponse serchDlByDi(String deviceId) {
+ return deviceSyncService.searchDlByDi(deviceId);
+ }
+
/**
* 获取产品标识详情
*
diff --git a/src/main/java/com/glxp/udidl/admin/dao/udi/ProductInfoMapper.java b/src/main/java/com/glxp/udidl/admin/dao/udi/ProductInfoMapper.java
index 7d09b96..c5db4b0 100644
--- a/src/main/java/com/glxp/udidl/admin/dao/udi/ProductInfoMapper.java
+++ b/src/main/java/com/glxp/udidl/admin/dao/udi/ProductInfoMapper.java
@@ -48,4 +48,6 @@ public interface ProductInfoMapper extends BaseMapper {
List findAllTyshxyh();
List selectByDeviceRecordKey(String key);
+
+ boolean updateCplx(ProductInfoEntity productInfoEntity);
}
diff --git a/src/main/java/com/glxp/udidl/admin/dao/udi/UdiCompanyMapper.java b/src/main/java/com/glxp/udidl/admin/dao/udi/UdiCompanyMapper.java
index 8c814ac..0368ad7 100644
--- a/src/main/java/com/glxp/udidl/admin/dao/udi/UdiCompanyMapper.java
+++ b/src/main/java/com/glxp/udidl/admin/dao/udi/UdiCompanyMapper.java
@@ -28,4 +28,6 @@ public interface UdiCompanyMapper extends BaseMapper {
List searchByName(String name);//公司名称搜索
+ List syncDlCompany(UdiCompanyRequest udiCompanyRequest);
+
}
diff --git a/src/main/java/com/glxp/udidl/admin/dao/udid/DeviceMapper.java b/src/main/java/com/glxp/udidl/admin/dao/udid/DeviceMapper.java
index 3e065cf..c175386 100644
--- a/src/main/java/com/glxp/udidl/admin/dao/udid/DeviceMapper.java
+++ b/src/main/java/com/glxp/udidl/admin/dao/udid/DeviceMapper.java
@@ -60,4 +60,6 @@ public interface DeviceMapper extends BaseMapper {
List findAllByZxxscpbs();
List findAllByZxxscpbsPage(ListPageRequest listPageRequest);
+
+ boolean updateCplx(Device device);
}
\ No newline at end of file
diff --git a/src/main/java/com/glxp/udidl/admin/entity/udi/ProductInfoEntity.java b/src/main/java/com/glxp/udidl/admin/entity/udi/ProductInfoEntity.java
index fcad03b..d72d600 100644
--- a/src/main/java/com/glxp/udidl/admin/entity/udi/ProductInfoEntity.java
+++ b/src/main/java/com/glxp/udidl/admin/entity/udi/ProductInfoEntity.java
@@ -138,4 +138,11 @@ public class ProductInfoEntity {
@ApiModelProperty(value = "更新时间", example = "2022-05-09 14:36:00")
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
private Date updateTime;
+
+ @ApiModelProperty(value = "是否最新")
+ private String hchzsb;
+
+ @ApiModelProperty(value = "产品类型")
+ private String cplx;
+
}
diff --git a/src/main/java/com/glxp/udidl/admin/entity/udid/Device.java b/src/main/java/com/glxp/udidl/admin/entity/udid/Device.java
index aca11ff..6692782 100644
--- a/src/main/java/com/glxp/udidl/admin/entity/udid/Device.java
+++ b/src/main/java/com/glxp/udidl/admin/entity/udid/Device.java
@@ -156,6 +156,11 @@ public class Device {
@ApiModelProperty(value = "请求日期")
private Date requestDate;
+ private String hchzsb;
+
+ @ApiModelProperty(value = "产品类型")
+ private String cplx;
+
public Date getRequestDate() {
return requestDate;
}
@@ -188,6 +193,22 @@ public class Device {
this.btcpbs = btcpbs == null ? null : btcpbs.trim();
}
+ public String getHchzsb() {
+ return hchzsb;
+ }
+
+ public void setHchzsb(String hchzsb) {
+ this.hchzsb = hchzsb;
+ }
+
+ public String getCplx() {
+ return cplx;
+ }
+
+ public void setCplx(String cplx) {
+ this.cplx = cplx;
+ }
+
public String getBtcpbsyzxxsdycpbssfyz() {
return btcpbsyzxxsdycpbssfyz;
}
diff --git a/src/main/java/com/glxp/udidl/admin/entity/udid/DeviceEntity.java b/src/main/java/com/glxp/udidl/admin/entity/udid/DeviceEntity.java
index 52316f8..fde2f26 100644
--- a/src/main/java/com/glxp/udidl/admin/entity/udid/DeviceEntity.java
+++ b/src/main/java/com/glxp/udidl/admin/entity/udid/DeviceEntity.java
@@ -203,6 +203,11 @@ public class DeviceEntity {
@ApiModelProperty(value = "")
private boolean check;
+ private String hchzsb;
+
+ @ApiModelProperty(value = "产品类型")
+ private String cplx;
+
@ApiModelProperty(value = "联系人信息")
private List contactlistList;
diff --git a/src/main/java/com/glxp/udidl/admin/req/UdiCompanyRequest.java b/src/main/java/com/glxp/udidl/admin/req/UdiCompanyRequest.java
index ca66dd8..6d47a61 100644
--- a/src/main/java/com/glxp/udidl/admin/req/UdiCompanyRequest.java
+++ b/src/main/java/com/glxp/udidl/admin/req/UdiCompanyRequest.java
@@ -23,4 +23,6 @@ public class UdiCompanyRequest extends ListPageRequest {
@ApiModelProperty(value = "区域代码")
private String areaCode;
+ @ApiModelProperty(value = "更新时间")
+ private String updateTime;
}
diff --git a/src/main/java/com/glxp/udidl/admin/res/udid/DataSetBean.java b/src/main/java/com/glxp/udidl/admin/res/udid/DataSetBean.java
index 23ed3a0..32db5fd 100644
--- a/src/main/java/com/glxp/udidl/admin/res/udid/DataSetBean.java
+++ b/src/main/java/com/glxp/udidl/admin/res/udid/DataSetBean.java
@@ -92,6 +92,8 @@ public class DataSetBean {
private String ylqxzcrbarywmc;
private String zxxsdyzsydydsl;
private String tsrq;
+ private String hchzsb;
+ private String cplx;
private String bszt;
private String sfyzcbayz;
@@ -102,6 +104,22 @@ public class DataSetBean {
private List deviceStorage;
private List contactList;
+ public String getHchzsb() {
+ return hchzsb;
+ }
+
+ public void setHchzsb(String hchzsb) {
+ this.hchzsb = hchzsb;
+ }
+
+ public String getCplx() {
+ return cplx;
+ }
+
+ public void setCplx(String cplx) {
+ this.cplx = cplx;
+ }
+
public String getDeviceHistoryRecordKey() {
return deviceHistoryRecordKey;
}
diff --git a/src/main/java/com/glxp/udidl/admin/res/udid/DataSetResult.java b/src/main/java/com/glxp/udidl/admin/res/udid/DataSetResult.java
index 3094128..96f7525 100644
--- a/src/main/java/com/glxp/udidl/admin/res/udid/DataSetResult.java
+++ b/src/main/java/com/glxp/udidl/admin/res/udid/DataSetResult.java
@@ -75,7 +75,7 @@ public class DataSetResult {
private String bssjzt; //"标识数据状态
//文档有,接口返回无该字段
private String cplx; //"产品类型:1 器械,2 体外诊断试剂
- private String HCHZSB; //耗材或者设备:0 耗材, 1 设备
+ private String hchzsb; //耗材或者设备:0 耗材, 1 设备
private List contactList;
}
diff --git a/src/main/java/com/glxp/udidl/admin/service/dataSync/DeviceDownloadService.java b/src/main/java/com/glxp/udidl/admin/service/dataSync/DeviceDownloadService.java
index 05b01e9..cc489f4 100644
--- a/src/main/java/com/glxp/udidl/admin/service/dataSync/DeviceDownloadService.java
+++ b/src/main/java/com/glxp/udidl/admin/service/dataSync/DeviceDownloadService.java
@@ -4,6 +4,8 @@ package com.glxp.udidl.admin.service.dataSync;
import com.alibaba.fastjson.JSON;
import com.alibaba.fastjson.JSONObject;
import com.glxp.udidl.admin.entity.info.CompanyEntity;
+import com.glxp.udidl.admin.entity.udi.ProductInfoEntity;
+import com.glxp.udidl.admin.entity.udid.Device;
import com.glxp.udidl.admin.entity.udid.JobLog;
import com.glxp.udidl.admin.entity.udid.TokenEntity;
import com.glxp.udidl.admin.req.udid.DeviceRequest;
@@ -16,6 +18,8 @@ import com.glxp.udidl.admin.res.udid.DataSetResult;
import com.glxp.udidl.admin.res.udid.DataSetSingleResult;
import com.glxp.udidl.admin.res.udid.DataSetTotalResult;
import com.glxp.udidl.admin.service.info.CompanyService;
+import com.glxp.udidl.admin.service.inout.DeviceService;
+import com.glxp.udidl.admin.service.inout.ProductInfoService;
import com.glxp.udidl.admin.service.udi.JobLogService;
import com.glxp.udidl.admin.util.DateUtil;
import com.glxp.udidl.admin.util.HttpClient;
@@ -50,6 +54,10 @@ public class DeviceDownloadService {
JobLogService jobLogService; //日志
@Autowired
DeviceSaveService deviceSaveService;
+ @Autowired
+ private DeviceService deviceService;
+ @Autowired
+ private ProductInfoService productInfoService;
private void SetTokenEmpty() {
token = "";
@@ -362,4 +370,70 @@ public class DeviceDownloadService {
}
return ResultVOUtils.success();
}
+
+ //按月份下载 边下载边保存
+ public BaseResponse downloadByMonthTest(String month, int page) {
+ try {
+ int totalPage = page;
+ int totalRecordCount = 0;
+ while (page <= totalPage) {
+ DataSetResult dataSetResult = getData(month, 2, page);
+ if (dataSetResult.getReturnCode() != 1) {
+ String msg = "下载到第" + page + "页发生错误";
+ //发生错误,存储日志
+ JobLog jobLog = new JobLog();
+ jobLog.setDownloadType("manual");
+ jobLog.setType("error");
+ jobLog.setMsg(msg);
+ jobLog.setContent(dataSetResult.getReturnMsg());
+ jobLog.setCreateTime(new Date());
+ jobLogService.insert(jobLog);
+ return ResultVOUtils.error(-1, msg + ",错误信息:" + dataSetResult.getReturnMsg());
+ } else if (dataSetResult.getDataSet().getDeviceInfo() != null && dataSetResult.getDataSet().getDeviceInfo().size() > 0) {
+ //存储数据
+ List dataSets = new ArrayList<>();
+ dataSets.add(dataSetResult.getDataSet());
+ for (DataSetResult.DataSet ds : dataSets) {
+ for (DataSetResult.DeviceInfo item : ds.getDeviceInfo()) {
+ Device device = new Device();
+ device.setHchzsb(item.getHchzsb());
+ device.setCplx(item.getCplx());
+ device.setDevicerecordkey(item.getDeviceRecordKey());
+ deviceService.updateCplx(device);
+
+
+ ProductInfoEntity productInfoEntity = new ProductInfoEntity();
+ productInfoEntity.setHchzsb(item.getHchzsb());
+ productInfoEntity.setCplx(item.getCplx());
+ productInfoEntity.setDeviceRecordKey(item.getDeviceRecordKey());
+ productInfoService.updateCplx(productInfoEntity);
+
+ }
+ }
+ }
+ totalPage = dataSetResult.getTotalPageCount();
+ totalRecordCount = dataSetResult.getTotalRecordCount();
+ page++;
+ }
+ JobLog jobLog = new JobLog();
+ jobLog.setType("info");
+ jobLog.setDownloadType("manual");
+ jobLog.setMsg("月份:" + month + ",执行成功!");
+ jobLog.setCreateTime(new Date());
+ jobLogService.insert(jobLog);
+ } catch (Exception e) {
+ e.printStackTrace();
+ JobLog jobLog = new JobLog();
+ jobLog.setDownloadType("manual");
+ jobLog.setType("error");
+ jobLog.setMsg("月份:" + month + ",执行失败:" + e.getMessage());
+ jobLog.setContent(JSON.toJSONString(e.getStackTrace()));
+ jobLog.setCreateTime(new Date());
+ jobLogService.insert(jobLog);
+ return ResultVOUtils.error(-1, jobLog.getMsg());
+ }
+
+ return ResultVOUtils.success();
+ }
+
}
diff --git a/src/main/java/com/glxp/udidl/admin/service/dataSync/DeviceSaveService.java b/src/main/java/com/glxp/udidl/admin/service/dataSync/DeviceSaveService.java
index c2eba51..d8fc641 100644
--- a/src/main/java/com/glxp/udidl/admin/service/dataSync/DeviceSaveService.java
+++ b/src/main/java/com/glxp/udidl/admin/service/dataSync/DeviceSaveService.java
@@ -206,6 +206,8 @@ public class DeviceSaveService {
device.setZxxsdyzsydydsl(dataSetBean.getZxxsdyzsydydsl());
device.setBssjzt(dataSetBean.getBssjzt());
device.setLastModifyTime(DateUtil.formatDateTime(new Date()));
+ device.setCplx(dataSetBean.getCplx());
+ device.setHchzsb(dataSetBean.getHchzsb());
return device;
}
diff --git a/src/main/java/com/glxp/udidl/admin/service/dataSync/DeviceSyncService.java b/src/main/java/com/glxp/udidl/admin/service/dataSync/DeviceSyncService.java
index 822f4a6..76b327b 100644
--- a/src/main/java/com/glxp/udidl/admin/service/dataSync/DeviceSyncService.java
+++ b/src/main/java/com/glxp/udidl/admin/service/dataSync/DeviceSyncService.java
@@ -1,22 +1,26 @@
package com.glxp.udidl.admin.service.dataSync;
+import cn.hutool.core.collection.CollUtil;
import com.alibaba.fastjson.JSON;
+import com.glxp.udidl.admin.entity.udi.ProductInfoEntity;
import com.glxp.udidl.admin.entity.udid.*;
+import com.glxp.udidl.admin.req.ProductInfoFilterRequest;
import com.glxp.udidl.admin.res.BaseResponse;
import com.glxp.udidl.admin.res.udid.DataSetResult;
import com.glxp.udidl.admin.res.udid.DataSetSingleHistoryResult;
import com.glxp.udidl.admin.res.udid.DataSetSingleResult;
import com.glxp.udidl.admin.res.udid.DataSetTotalResult;
+import com.glxp.udidl.admin.service.inout.ProductInfoService;
import com.glxp.udidl.admin.service.udi.JobLogService;
import com.glxp.udidl.admin.util.DateUtil;
import com.glxp.udidl.admin.util.ResultVOUtils;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.BeanUtils;
-import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.scheduling.annotation.Async;
import org.springframework.stereotype.Service;
import org.springframework.util.CollectionUtils;
+import javax.annotation.Resource;
import java.util.ArrayList;
import java.util.Date;
import java.util.List;
@@ -26,12 +30,14 @@ import java.util.stream.Collectors;
@Service
public class DeviceSyncService {
- @Autowired
+ @Resource
private DeviceSaveService deviceSaveService;
- @Autowired
+ @Resource
private DeviceDownloadService deviceDownloadService;
- @Autowired
+ @Resource
JobLogService jobLogService; //日志
+ @Resource
+ private ProductInfoService productInfoService;
public void downloadAndSave(String day, String downloadType) {
//1.下载唯一标识数据
@@ -142,6 +148,41 @@ public class DeviceSyncService {
return ResultVOUtils.success("执行完成,详情请查看日志!");
}
+ public BaseResponse searchDlByDi(String deviceId) {
+ ProductInfoFilterRequest productInfoFilterRequest = new ProductInfoFilterRequest();
+ productInfoFilterRequest.setNameCode(deviceId);
+ List productInfoEntityList = productInfoService.findAll(productInfoFilterRequest);
+ if (CollUtil.isEmpty(productInfoEntityList)) {
+ DataSetSingleResult result1 = deviceDownloadService.downloadByDi(deviceId);
+ if (result1.getReturnCode() != 1)
+ return ResultVOUtils.error(-1, result1.getReturnMsg());
+
+ if (CollUtil.isNotEmpty(result1.getDataSet().getDeviceInfo())) {
+ List dataSets = new ArrayList<>();
+ dataSets.add(result1.getDataSet());
+ deviceSaveService.DeviceSave(dataSets, new Date());
+ productInfoEntityList = productInfoService.findAll(productInfoFilterRequest);
+ } else {
+ return ResultVOUtils.error(501, "医疗器械唯一标识数据库未找到此产品DI,请检查是否输入正确或联系厂家是否已上传");
+ }
+
+ }
+ return ResultVOUtils.success(productInfoEntityList);
+ }
+
+ public void dlHistory(DataSetSingleResult result1) {
+
+ DataSetSingleHistoryResult result = new DataSetSingleHistoryResult();
+ result.setDataSet(result1.getDataSet());
+ if (result1.getDataSet().getDeviceInfo() != null && result1.getDataSet().getDeviceInfo().size() > 0) {
+ List keyList = deviceDownloadService.getKeyList(result1.getDataSet());
+ if (keyList.size() > 0) {
+ DataSetTotalResult result2 = deviceDownloadService.getHistoryData(keyList);
+ result.setDataList(result2.getData());
+ }
+ }
+ }
+
public BaseResponse downloadByDi(String deviceId) {
DataSetSingleResult result1 = deviceDownloadService.downloadByDi(deviceId);
if (result1.getReturnCode() != 1)
@@ -155,6 +196,9 @@ public class DeviceSyncService {
result.setDataList(result2.getData());
}
}
+ List dataSets = new ArrayList<>();
+ dataSets.add(result1.getDataSet());
+ deviceSaveService.DeviceSave(dataSets, new Date());
return ResultVOUtils.success(result);
}
@@ -162,8 +206,10 @@ public class DeviceSyncService {
DataSetSingleResult res = deviceDownloadService.downloadByDi(deviceId);
if (res.getReturnCode() != 1)
return ResultVOUtils.error(-1, res.getReturnMsg());
+ List dataSets = new ArrayList<>();
+ dataSets.add(res.getDataSet());
+ deviceSaveService.DeviceSave(dataSets, new Date());
return ResultVOUtils.success(Convert(res.getDataSet()));
-
}
/**
diff --git a/src/main/java/com/glxp/udidl/admin/service/inout/DeviceService.java b/src/main/java/com/glxp/udidl/admin/service/inout/DeviceService.java
index 5e2466d..4e7cb86 100644
--- a/src/main/java/com/glxp/udidl/admin/service/inout/DeviceService.java
+++ b/src/main/java/com/glxp/udidl/admin/service/inout/DeviceService.java
@@ -42,4 +42,6 @@ public interface DeviceService {
List findAllByZxxscpbs();
List findAllByZxxscpbsPage(ListPageRequest listPageRequest);
+
+ boolean updateCplx(Device device);
}
diff --git a/src/main/java/com/glxp/udidl/admin/service/inout/ProductInfoService.java b/src/main/java/com/glxp/udidl/admin/service/inout/ProductInfoService.java
index df0cc29..2b11d00 100644
--- a/src/main/java/com/glxp/udidl/admin/service/inout/ProductInfoService.java
+++ b/src/main/java/com/glxp/udidl/admin/service/inout/ProductInfoService.java
@@ -42,5 +42,5 @@ public interface ProductInfoService {
boolean updateProductInfo(ProductInfoEntity productInfoEntity);
-
+ boolean updateCplx(ProductInfoEntity productInfoEntity);
}
diff --git a/src/main/java/com/glxp/udidl/admin/service/inout/impl/DeviceServiceImpl.java b/src/main/java/com/glxp/udidl/admin/service/inout/impl/DeviceServiceImpl.java
index 6fc2628..14fee05 100644
--- a/src/main/java/com/glxp/udidl/admin/service/inout/impl/DeviceServiceImpl.java
+++ b/src/main/java/com/glxp/udidl/admin/service/inout/impl/DeviceServiceImpl.java
@@ -206,6 +206,12 @@ public class DeviceServiceImpl implements DeviceService {
return deviceMapper.findAllByZxxscpbsPage(listPageRequest);
}
+ @Transactional(rollbackFor = Exception.class)
+ @Override
+ public boolean updateCplx(Device device) {
+ return deviceMapper.updateCplx(device);
+ }
+
@Transactional(rollbackFor = Exception.class)
@Override
public boolean insertDevice(Device device) {
diff --git a/src/main/java/com/glxp/udidl/admin/service/inout/impl/ProductInfoServiceImpl.java b/src/main/java/com/glxp/udidl/admin/service/inout/impl/ProductInfoServiceImpl.java
index 31bf9b8..dbb27b5 100644
--- a/src/main/java/com/glxp/udidl/admin/service/inout/impl/ProductInfoServiceImpl.java
+++ b/src/main/java/com/glxp/udidl/admin/service/inout/impl/ProductInfoServiceImpl.java
@@ -138,6 +138,12 @@ public class ProductInfoServiceImpl implements ProductInfoService {
return productInfoDao.updateProductInfo(productInfoEntity);
}
+ @Transactional(rollbackFor = Exception.class)
+ @Override
+ public boolean updateCplx(ProductInfoEntity productInfoEntity) {
+ return productInfoDao.updateCplx(productInfoEntity);
+ }
+
@Transactional(rollbackFor = Exception.class)
@Override
public boolean deleteById(String id) {
diff --git a/src/main/java/com/glxp/udidl/admin/service/udi/UdiCompanyService.java b/src/main/java/com/glxp/udidl/admin/service/udi/UdiCompanyService.java
index 732800e..1bce2d1 100644
--- a/src/main/java/com/glxp/udidl/admin/service/udi/UdiCompanyService.java
+++ b/src/main/java/com/glxp/udidl/admin/service/udi/UdiCompanyService.java
@@ -26,4 +26,6 @@ public interface UdiCompanyService {
boolean updateUdiCompany(UdiCompanyEntity udiCompanyEntity);
BaseResponse searchByName(String name);//公司名称搜索
+
+ List syncDlCompany(UdiCompanyRequest udiCompanyRequest);
}
diff --git a/src/main/java/com/glxp/udidl/admin/service/udi/impl/UdiCompanyServiceImpl.java b/src/main/java/com/glxp/udidl/admin/service/udi/impl/UdiCompanyServiceImpl.java
index 05d977b..08d1e7b 100644
--- a/src/main/java/com/glxp/udidl/admin/service/udi/impl/UdiCompanyServiceImpl.java
+++ b/src/main/java/com/glxp/udidl/admin/service/udi/impl/UdiCompanyServiceImpl.java
@@ -67,4 +67,12 @@ public class UdiCompanyServiceImpl implements UdiCompanyService {
List result = udiCompanyDao.searchByName(name);
return ResultVOUtils.success(result);
}
+
+ @Override
+ public List syncDlCompany(UdiCompanyRequest udiCompanyRequest) {
+ int offset = (udiCompanyRequest.getPage() - 1) * udiCompanyRequest.getLimit() + 1;
+ udiCompanyRequest.setPage(offset);
+ return udiCompanyDao.syncDlCompany(udiCompanyRequest);
+ }
+
}
diff --git a/src/main/java/com/glxp/udidl/admin/thread/AsyncDownloadTask.java b/src/main/java/com/glxp/udidl/admin/thread/AsyncDownloadTask.java
index 45acde5..b5773b3 100644
--- a/src/main/java/com/glxp/udidl/admin/thread/AsyncDownloadTask.java
+++ b/src/main/java/com/glxp/udidl/admin/thread/AsyncDownloadTask.java
@@ -39,9 +39,9 @@ public class AsyncDownloadTask {
@Async
public void downloadByDi(String primaryDeviceId) {
DownloadDeviceHelper downloadDeviceHelper = new DownloadDeviceHelper(companyService, udiCompanyService);
- TokenEntity token = downloadDeviceHelper.getToken();
+ String token = deviceDownloadService.getToken();
DownloadDiRequest downloadDiRequest = new DownloadDiRequest();
- downloadDiRequest.setAccessToken(token.getAccessToken());
+ downloadDiRequest.setAccessToken(token);
downloadDiRequest.setPrimaryDeviceId(primaryDeviceId);
downloadDeviceHelper.downloadBydi(downloadDiRequest, deviceService, productInfoService);
}
@@ -54,6 +54,28 @@ public class AsyncDownloadTask {
}
+ @Async
+ public void downloadByMonthTest(String month, int page) {
+ deviceDownloadService.downloadByMonthTest(month, page);
+
+ /*int curpage = page;
+ DownloadDeviceHelper downloadDeviceHelper = new DownloadDeviceHelper(companyService,udiCompanyService);
+ TokenEntity token = downloadDeviceHelper.getToken();
+ while (true) {
+ DeviceRequest deviceRequest = new DeviceRequest();
+ deviceRequest.setAccessToken(token.getAccessToken());
+ deviceRequest.setRequestType("2");
+ deviceRequest.setRangeValue(month);
+ deviceRequest.setCurrentPageNumber(curpage + "");
+ int result = downloadDeviceHelper.downloadDevices(productInfoService, deviceService, deviceRequest);
+ if (result == -1) {
+ return;// ResultVOUtils.error(505, "下载出错");
+ }
+ curpage++;
+ }*/
+ }
+
+
//按天下载UDI , 手动下载
@Async
public void downloadByDay(String day) {
diff --git a/src/main/java/com/glxp/udidl/admin/thread/UdiCompanyTask.java b/src/main/java/com/glxp/udidl/admin/thread/UdiCompanyTask.java
index 16ed181..f9d8ed9 100644
--- a/src/main/java/com/glxp/udidl/admin/thread/UdiCompanyTask.java
+++ b/src/main/java/com/glxp/udidl/admin/thread/UdiCompanyTask.java
@@ -12,6 +12,7 @@ import org.springframework.scheduling.annotation.Async;
import org.springframework.stereotype.Service;
import javax.annotation.Resource;
+import java.util.Date;
import java.util.List;
@Service
@@ -39,6 +40,7 @@ public class UdiCompanyTask {
udiCompanyEntity.setQylxrcz(contactlist.getQylxrcz());
udiCompanyEntity.setQylxrdh(contactlist.getQylxrdh());
udiCompanyEntity.setQylxryx(contactlist.getQylxryx());
+ udiCompanyEntity.setUpdateTime(new Date());
}
}
udiCompanyService.insertUdiCompany(udiCompanyEntity);
diff --git a/src/main/java/com/glxp/udidl/admin/thread/UdiTransferUtils.java b/src/main/java/com/glxp/udidl/admin/thread/UdiTransferUtils.java
index 385da3c..1c9a106 100644
--- a/src/main/java/com/glxp/udidl/admin/thread/UdiTransferUtils.java
+++ b/src/main/java/com/glxp/udidl/admin/thread/UdiTransferUtils.java
@@ -49,6 +49,8 @@ public class UdiTransferUtils {
productInfoEntity.setCphhhbh(deviceEntity.getCphhhbh());
productInfoEntity.setCpms(deviceEntity.getCpms());
productInfoEntity.setCpbsbmtxmc(deviceEntity.getCpbsbmtxmc());
+ productInfoEntity.setCplx(deviceEntity.getCplx());
+ productInfoEntity.setHchzsb(deviceEntity.getHchzsb());
productInfoEntity.setVersionNumber(Integer.parseInt(deviceEntity.getVersionnumber()));
if (deviceEntity.getSydycpbs() != null && !deviceEntity.getSydycpbs().equals("")) {
@@ -179,9 +181,6 @@ public class UdiTransferUtils {
update.setUpdateTime(new Date());
productInfoService.updateProductInfo(update);
}
-// updateEntity.setIsNewest(true);
-// updateEntity.setUpdateTime(new Date());
-// productInfoService.updateProductInfo(updateEntity);
}
//更新厂家信息,
@@ -191,6 +190,7 @@ public class UdiTransferUtils {
if (udiCompanyEntitys == null || udiCompanyEntitys.size() == 0) {
UdiCompanyEntity udiCompanyEntity = new UdiCompanyEntity();
udiCompanyEntity.setTyshxydm(productInfoEntity.getTyshxydm());
+ udiCompanyEntity.setUpdateTime(new Date());
udiCompanyEntity.setYlqxzcrbarywmc(productInfoEntity.getYlqxzcrbarywmc());
udiCompanyEntity.setYlqxzcrbarmc(productInfoEntity.getYlqxzcrbarmc());
List contactlists = udiCompanyService.selectContactBykey(productInfoEntity.getDeviceRecordKey());
diff --git a/src/main/java/com/glxp/udidl/admin/util/DateUtils.java b/src/main/java/com/glxp/udidl/admin/util/DateUtils.java
index a39c5c2..3369368 100644
--- a/src/main/java/com/glxp/udidl/admin/util/DateUtils.java
+++ b/src/main/java/com/glxp/udidl/admin/util/DateUtils.java
@@ -2,7 +2,7 @@ package com.glxp.udidl.admin.util;
import java.util.Date;
-public class DateUtils extends cn.hutool.core.date.DateUtil{
+public class DateUtils extends cn.hutool.core.date.DateUtil {
/**
* 日期型字符串转化为日期 格式
*/
diff --git a/src/main/resources/mybatis/mapper/udi/ProductInfoMapper.xml b/src/main/resources/mybatis/mapper/udi/ProductInfoMapper.xml
index 2bb4c1c..60c6b17 100644
--- a/src/main/resources/mybatis/mapper/udi/ProductInfoMapper.xml
+++ b/src/main/resources/mybatis/mapper/udi/ProductInfoMapper.xml
@@ -2,19 +2,19 @@
-
diff --git a/src/main/resources/mybatis/mapper/udi/UdiCompanyMapper.xml b/src/main/resources/mybatis/mapper/udi/UdiCompanyMapper.xml
index cc78d37..92609af 100644
--- a/src/main/resources/mybatis/mapper/udi/UdiCompanyMapper.xml
+++ b/src/main/resources/mybatis/mapper/udi/UdiCompanyMapper.xml
@@ -2,88 +2,107 @@
-
- SELECT deviceRecordKey,tyshxydm,ylqxzcrbarmc,ylqxzcrbarywmc FROM device
+ SELECT deviceRecordKey, tyshxydm, ylqxzcrbarmc, ylqxzcrbarywmc
+ FROM device
GROUP BY tyshxydm
-
- SELECT qylxrdh,qylxryx,qylxrcz from contactlist
- WHERE deviceRecordKey = #{deviceRecordKey}
+ SELECT qylxrdh, qylxryx, qylxrcz
+ from contactlist
+ WHERE deviceRecordKey = #{deviceRecordKey}
- SELECT * FROM udicompany
+ SELECT *
+ FROM udicompany
- AND ylqxzcrbarmc LIKE concat('%',#{ylqxzcrbarmc},'%')
+ AND ylqxzcrbarmc LIKE concat('%', #{ylqxzcrbarmc}, '%')
- AND tyshxydm =#{tyshxydm}
+ AND tyshxydm = #{tyshxydm}
- AND SUBSTRING(tyshxydm,3,2) = #{provinceCode}
+ AND SUBSTRING(tyshxydm, 3, 2) = #{provinceCode}
- AND SUBSTRING(tyshxydm,3,4) = #{cityCode}
+ AND SUBSTRING(tyshxydm, 3, 4) = #{cityCode}
- AND SUBSTRING(tyshxydm,3,6) = #{areaCode}
+ AND SUBSTRING(tyshxydm, 3, 6) = #{areaCode}
+
+
+
+ SELECT *
+ FROM udicompany
+
+
+ = DATE_FORMAT(#{updateTime}
+ , '%Y-%m-%d %H:%i:%S')
+ ]]>
+
+
+ limit #{page}
+ ,#{limit}
+
+
- select ylqxzcrbarmc from udicompany where ylqxzcrbarmc like concat('%',#{name},'%') limit 50
+ select ylqxzcrbarmc
+ from udicompany
+ where ylqxzcrbarmc like concat('%', #{name}, '%')
+ limit 50
- REPLACE INTO udicompany
- (
- tyshxydm,ylqxzcrbarmc,ylqxzcrbarywmc,qylxrdh,
- qylxrcz,qylxryx
- )
- values
- (
- #{tyshxydm},
- #{ylqxzcrbarmc},
- #{ylqxzcrbarywmc},
- #{qylxrdh},
- #{qylxrcz},
- #{qylxryx}
- )
+ REPLACE
+ INTO udicompany
+ (tyshxydm, ylqxzcrbarmc, ylqxzcrbarywmc, qylxrdh,
+ qylxrcz, qylxryx, updateTime)
+ values (#{tyshxydm},
+ #{ylqxzcrbarmc},
+ #{ylqxzcrbarywmc},
+ #{qylxrdh},
+ #{qylxrcz},
+ #{qylxryx},
+ #{updateTime})
- replace INTO udicompany(
- tyshxydm,ylqxzcrbarmc,ylqxzcrbarywmc,qylxrdh,
- qylxrcz,qylxryx)
- values
+ replace INTO udicompany(tyshxydm, ylqxzcrbarmc, ylqxzcrbarywmc, qylxrdh,
+ qylxrcz, qylxryx, updateTime)
+ values
-
- (
- #{item.tyshxydm},
- #{item.ylqxzcrbarmc},
- #{item.ylqxzcrbarywmc},
- #{item.qylxrdh},
- #{item.qylxrcz},
- #{item.qylxryx})
+ (#{item.tyshxydm},
+ #{item.ylqxzcrbarmc},
+ #{item.ylqxzcrbarywmc},
+ #{item.qylxrdh},
+ #{item.qylxrcz},
+ #{item.qylxryx}),#{item.updateTime}
-
- DELETE FROM udicompany WHERE id = #{id}
+ DELETE
+ FROM udicompany
+ WHERE id = #{id}
- DELETE FROM udicompany WHERE id in
+ DELETE
+ FROM udicompany WHERE id in
#{item}
@@ -92,12 +111,27 @@
UPDATE udicompany
- tyshxydm=#{tyshxydm},
- ylqxzcrbarmc=#{ylqxzcrbarmc},
- ylqxzcrbarywmc=#{ylqxzcrbarywmc},
- qylxrdh=#{qylxrdh},
- qylxrcz=#{qylxrcz},
- qylxryx=#{qylxryx},
+
+ tyshxydm=#{tyshxydm},
+
+
+ ylqxzcrbarmc=#{ylqxzcrbarmc},
+
+
+ ylqxzcrbarywmc=#{ylqxzcrbarywmc},
+
+
+ qylxrdh=#{qylxrdh},
+
+
+ qylxrcz=#{qylxrcz},
+
+
+ qylxryx=#{qylxryx},
+
+
+ updateTime=#{updateTime},
+
WHERE id = #{id}
diff --git a/src/main/resources/mybatis/mapper/udid/DeviceMapper.xml b/src/main/resources/mybatis/mapper/udid/DeviceMapper.xml
index 665efe5..e68d22f 100644
--- a/src/main/resources/mybatis/mapper/udid/DeviceMapper.xml
+++ b/src/main/resources/mybatis/mapper/udid/DeviceMapper.xml
@@ -16,6 +16,7 @@
+
@@ -49,6 +50,7 @@
+
@@ -111,14 +113,16 @@
- uuid, deviceRecordKey, btcpbs, btcpbsyzxxsdycpbssfyz, cgzmraqxgxx, cpbsbmtxmc, cpbsfbrq,
- cphhhbh, cplb, cpmctymc, cpms, flbm, ggxh, mjfs, qtxxdwzlj, qxlb, scbssfbhph, scbssfbhscrq,
- scbssfbhsxrq, scbssfbhxlh, sfbjwycxsy, sfwblztlcp, sfwwjbz, sfybtzjbs, spmc, sydycpbs,
- syqsfxyjxmj, tscchcztj, tsccsm, tsrq, tyshxydm, versionNumber, versionStatus, versionTime,
- ybbm, yflbm, ylqxzcrbarmc, ylqxzcrbarywmc, zczbhhzbapzbh, zdcfsycs, zxxsdycpbs, bszt,
- sfyzcbayz, zcbacpbs, zxxsdyzsydydsl, deviceHistoryRecordKey, bssjzt
-
-
+ uuid
+ , deviceRecordKey, btcpbs, btcpbsyzxxsdycpbssfyz, cgzmraqxgxx, cpbsbmtxmc, cpbsfbrq,
+ cphhhbh, cplb, cpmctymc, cpms, flbm, ggxh, mjfs, qtxxdwzlj, qxlb, scbssfbhph, scbssfbhscrq,
+ scbssfbhsxrq, scbssfbhxlh, sfbjwycxsy, sfwblztlcp, sfwwjbz, sfybtzjbs, spmc, sydycpbs,
+ syqsfxyjxmj, tscchcztj, tsccsm, tsrq, tyshxydm, versionNumber, versionStatus, versionTime,
+ ybbm, yflbm, ylqxzcrbarmc, ylqxzcrbarywmc, zczbhhzbapzbh, zdcfsycs, zxxsdycpbs, bszt,
+ sfyzcbayz, zcbacpbs, zxxsdyzsydydsl, deviceHistoryRecordKey, bssjzt,hchzsb,cplx
+
+
select
distinct
@@ -139,9 +143,10 @@
where uuid = #{uuid,jdbcType=VARCHAR}
- delete from device
- where uuid = #{uuid,jdbcType=VARCHAR}
-
+ delete
+ from device
+ where uuid = #{uuid,jdbcType=VARCHAR}
+
delete from device
@@ -149,39 +154,41 @@
- insert into device (uuid, deviceRecordKey, btcpbs,
- btcpbsyzxxsdycpbssfyz, cgzmraqxgxx, cpbsbmtxmc,
- cpbsfbrq, cphhhbh, cplb,
- cpmctymc, cpms, flbm,
- ggxh, mjfs, qtxxdwzlj,
- qxlb, scbssfbhph, scbssfbhscrq,
- scbssfbhsxrq, scbssfbhxlh, sfbjwycxsy,
- sfwblztlcp, sfwwjbz, sfybtzjbs,
- spmc, sydycpbs, syqsfxyjxmj,
- tscchcztj, tsccsm, tsrq,
- tyshxydm, versionNumber, versionStatus,
- versionTime, ybbm, yflbm,
- ylqxzcrbarmc, ylqxzcrbarywmc, zczbhhzbapzbh,
- zdcfsycs, zxxsdycpbs, bszt,
- sfyzcbayz, zcbacpbs, zxxsdyzsydydsl,
- deviceHistoryRecordKey, bssjzt,lastModifyTime,requestDate)
- values (#{uuid,jdbcType=VARCHAR}, #{devicerecordkey,jdbcType=VARCHAR}, #{btcpbs,jdbcType=VARCHAR},
- #{btcpbsyzxxsdycpbssfyz,jdbcType=VARCHAR}, #{cgzmraqxgxx,jdbcType=VARCHAR}, #{cpbsbmtxmc,jdbcType=VARCHAR},
- #{cpbsfbrq,jdbcType=VARCHAR}, #{cphhhbh,jdbcType=VARCHAR}, #{cplb,jdbcType=VARCHAR},
- #{cpmctymc,jdbcType=VARCHAR}, #{cpms,jdbcType=VARCHAR}, #{flbm,jdbcType=VARCHAR},
- #{ggxh,jdbcType=VARCHAR}, #{mjfs,jdbcType=VARCHAR}, #{qtxxdwzlj,jdbcType=VARCHAR},
- #{qxlb,jdbcType=VARCHAR}, #{scbssfbhph,jdbcType=VARCHAR}, #{scbssfbhscrq,jdbcType=VARCHAR},
- #{scbssfbhsxrq,jdbcType=VARCHAR}, #{scbssfbhxlh,jdbcType=VARCHAR}, #{sfbjwycxsy,jdbcType=VARCHAR},
- #{sfwblztlcp,jdbcType=VARCHAR}, #{sfwwjbz,jdbcType=VARCHAR}, #{sfybtzjbs,jdbcType=VARCHAR},
- #{spmc,jdbcType=VARCHAR}, #{sydycpbs,jdbcType=VARCHAR}, #{syqsfxyjxmj,jdbcType=VARCHAR},
- #{tscchcztj,jdbcType=VARCHAR}, #{tsccsm,jdbcType=VARCHAR}, #{tsrq,jdbcType=VARCHAR},
- #{tyshxydm,jdbcType=VARCHAR}, #{versionnumber,jdbcType=VARCHAR}, #{versionstatus,jdbcType=VARCHAR},
- #{versiontime,jdbcType=VARCHAR}, #{ybbm,jdbcType=VARCHAR}, #{yflbm,jdbcType=VARCHAR},
- #{ylqxzcrbarmc,jdbcType=VARCHAR}, #{ylqxzcrbarywmc,jdbcType=VARCHAR}, #{zczbhhzbapzbh,jdbcType=VARCHAR},
- #{zdcfsycs,jdbcType=VARCHAR}, #{zxxsdycpbs,jdbcType=VARCHAR}, #{bszt,jdbcType=VARCHAR},
- #{sfyzcbayz,jdbcType=VARCHAR}, #{zcbacpbs,jdbcType=VARCHAR}, #{zxxsdyzsydydsl,jdbcType=VARCHAR},
- #{devicehistoryrecordkey,jdbcType=VARCHAR}, #{bssjzt,jdbcType=VARCHAR},#{lastModifyTime,jdbcType=VARCHAR},#{requestDate})
-
+ insert into device (uuid, deviceRecordKey, btcpbs,
+ btcpbsyzxxsdycpbssfyz, cgzmraqxgxx, cpbsbmtxmc,
+ cpbsfbrq, cphhhbh, cplb,
+ cpmctymc, cpms, flbm,
+ ggxh, mjfs, qtxxdwzlj,
+ qxlb, scbssfbhph, scbssfbhscrq,
+ scbssfbhsxrq, scbssfbhxlh, sfbjwycxsy,
+ sfwblztlcp, sfwwjbz, sfybtzjbs,
+ spmc, sydycpbs, syqsfxyjxmj,
+ tscchcztj, tsccsm, tsrq,
+ tyshxydm, versionNumber, versionStatus,
+ versionTime, ybbm, yflbm,
+ ylqxzcrbarmc, ylqxzcrbarywmc, zczbhhzbapzbh,
+ zdcfsycs, zxxsdycpbs, bszt,
+ sfyzcbayz, zcbacpbs, zxxsdyzsydydsl,
+ deviceHistoryRecordKey, bssjzt, lastModifyTime, requestDate,hchzsb,cplx)
+ values (#{uuid,jdbcType=VARCHAR}, #{devicerecordkey,jdbcType=VARCHAR}, #{btcpbs,jdbcType=VARCHAR},
+ #{btcpbsyzxxsdycpbssfyz,jdbcType=VARCHAR}, #{cgzmraqxgxx,jdbcType=VARCHAR},
+ #{cpbsbmtxmc,jdbcType=VARCHAR},
+ #{cpbsfbrq,jdbcType=VARCHAR}, #{cphhhbh,jdbcType=VARCHAR}, #{cplb,jdbcType=VARCHAR},
+ #{cpmctymc,jdbcType=VARCHAR}, #{cpms,jdbcType=VARCHAR}, #{flbm,jdbcType=VARCHAR},
+ #{ggxh,jdbcType=VARCHAR}, #{mjfs,jdbcType=VARCHAR}, #{qtxxdwzlj,jdbcType=VARCHAR},
+ #{qxlb,jdbcType=VARCHAR}, #{scbssfbhph,jdbcType=VARCHAR}, #{scbssfbhscrq,jdbcType=VARCHAR},
+ #{scbssfbhsxrq,jdbcType=VARCHAR}, #{scbssfbhxlh,jdbcType=VARCHAR}, #{sfbjwycxsy,jdbcType=VARCHAR},
+ #{sfwblztlcp,jdbcType=VARCHAR}, #{sfwwjbz,jdbcType=VARCHAR}, #{sfybtzjbs,jdbcType=VARCHAR},
+ #{spmc,jdbcType=VARCHAR}, #{sydycpbs,jdbcType=VARCHAR}, #{syqsfxyjxmj,jdbcType=VARCHAR},
+ #{tscchcztj,jdbcType=VARCHAR}, #{tsccsm,jdbcType=VARCHAR}, #{tsrq,jdbcType=VARCHAR},
+ #{tyshxydm,jdbcType=VARCHAR}, #{versionnumber,jdbcType=VARCHAR}, #{versionstatus,jdbcType=VARCHAR},
+ #{versiontime,jdbcType=VARCHAR}, #{ybbm,jdbcType=VARCHAR}, #{yflbm,jdbcType=VARCHAR},
+ #{ylqxzcrbarmc,jdbcType=VARCHAR}, #{ylqxzcrbarywmc,jdbcType=VARCHAR}, #{zczbhhzbapzbh,jdbcType=VARCHAR},
+ #{zdcfsycs,jdbcType=VARCHAR}, #{zxxsdycpbs,jdbcType=VARCHAR}, #{bszt,jdbcType=VARCHAR},
+ #{sfyzcbayz,jdbcType=VARCHAR}, #{zcbacpbs,jdbcType=VARCHAR}, #{zxxsdyzsydydsl,jdbcType=VARCHAR},
+ #{devicehistoryrecordkey,jdbcType=VARCHAR}, #{bssjzt,jdbcType=VARCHAR},
+ #{lastModifyTime,jdbcType=VARCHAR}, #{requestDate},#{hchzsb},#{cplx})
+
insert into device
@@ -326,6 +333,10 @@
bssjzt,
+
+ hchzsb,
+
+
@@ -469,6 +480,10 @@
#{bssjzt,jdbcType=VARCHAR},
+
+ #{hchzsb,jdbcType=VARCHAR},
+
+
bssjzt = #{bssjzt,jdbcType=VARCHAR},
+
+ hchzsb = #{bssjzt,jdbcType=VARCHAR},
+
+
where uuid = #{uuid,jdbcType=VARCHAR}
- update device
- set deviceRecordKey = #{devicerecordkey,jdbcType=VARCHAR},
- btcpbs = #{btcpbs,jdbcType=VARCHAR},
- btcpbsyzxxsdycpbssfyz = #{btcpbsyzxxsdycpbssfyz,jdbcType=VARCHAR},
- cgzmraqxgxx = #{cgzmraqxgxx,jdbcType=VARCHAR},
- cpbsbmtxmc = #{cpbsbmtxmc,jdbcType=VARCHAR},
- cpbsfbrq = #{cpbsfbrq,jdbcType=VARCHAR},
- cphhhbh = #{cphhhbh,jdbcType=VARCHAR},
- cplb = #{cplb,jdbcType=VARCHAR},
- cpmctymc = #{cpmctymc,jdbcType=VARCHAR},
- cpms = #{cpms,jdbcType=VARCHAR},
- flbm = #{flbm,jdbcType=VARCHAR},
- ggxh = #{ggxh,jdbcType=VARCHAR},
- mjfs = #{mjfs,jdbcType=VARCHAR},
- qtxxdwzlj = #{qtxxdwzlj,jdbcType=VARCHAR},
- qxlb = #{qxlb,jdbcType=VARCHAR},
- scbssfbhph = #{scbssfbhph,jdbcType=VARCHAR},
- scbssfbhscrq = #{scbssfbhscrq,jdbcType=VARCHAR},
- scbssfbhsxrq = #{scbssfbhsxrq,jdbcType=VARCHAR},
- scbssfbhxlh = #{scbssfbhxlh,jdbcType=VARCHAR},
- sfbjwycxsy = #{sfbjwycxsy,jdbcType=VARCHAR},
- sfwblztlcp = #{sfwblztlcp,jdbcType=VARCHAR},
- sfwwjbz = #{sfwwjbz,jdbcType=VARCHAR},
- sfybtzjbs = #{sfybtzjbs,jdbcType=VARCHAR},
- spmc = #{spmc,jdbcType=VARCHAR},
- sydycpbs = #{sydycpbs,jdbcType=VARCHAR},
- syqsfxyjxmj = #{syqsfxyjxmj,jdbcType=VARCHAR},
- tscchcztj = #{tscchcztj,jdbcType=VARCHAR},
- tsccsm = #{tsccsm,jdbcType=VARCHAR},
- tsrq = #{tsrq,jdbcType=VARCHAR},
- tyshxydm = #{tyshxydm,jdbcType=VARCHAR},
- versionNumber = #{versionnumber,jdbcType=VARCHAR},
- versionStatus = #{versionstatus,jdbcType=VARCHAR},
- versionTime = #{versiontime,jdbcType=VARCHAR},
- ybbm = #{ybbm,jdbcType=VARCHAR},
- yflbm = #{yflbm,jdbcType=VARCHAR},
- ylqxzcrbarmc = #{ylqxzcrbarmc,jdbcType=VARCHAR},
- ylqxzcrbarywmc = #{ylqxzcrbarywmc,jdbcType=VARCHAR},
- zczbhhzbapzbh = #{zczbhhzbapzbh,jdbcType=VARCHAR},
- zdcfsycs = #{zdcfsycs,jdbcType=VARCHAR},
- zxxsdycpbs = #{zxxsdycpbs,jdbcType=VARCHAR},
- bszt = #{bszt,jdbcType=VARCHAR},
- sfyzcbayz = #{sfyzcbayz,jdbcType=VARCHAR},
- zcbacpbs = #{zcbacpbs,jdbcType=VARCHAR},
- zxxsdyzsydydsl = #{zxxsdyzsydydsl,jdbcType=VARCHAR},
- deviceHistoryRecordKey = #{devicehistoryrecordkey,jdbcType=VARCHAR},
- bssjzt = #{bssjzt,jdbcType=VARCHAR}
- where uuid = #{uuid,jdbcType=VARCHAR}
-
+ update device
+ set deviceRecordKey = #{devicerecordkey,jdbcType=VARCHAR},
+ btcpbs = #{btcpbs,jdbcType=VARCHAR},
+ btcpbsyzxxsdycpbssfyz = #{btcpbsyzxxsdycpbssfyz,jdbcType=VARCHAR},
+ cgzmraqxgxx = #{cgzmraqxgxx,jdbcType=VARCHAR},
+ cpbsbmtxmc = #{cpbsbmtxmc,jdbcType=VARCHAR},
+ cpbsfbrq = #{cpbsfbrq,jdbcType=VARCHAR},
+ cphhhbh = #{cphhhbh,jdbcType=VARCHAR},
+ cplb = #{cplb,jdbcType=VARCHAR},
+ cpmctymc = #{cpmctymc,jdbcType=VARCHAR},
+ cpms = #{cpms,jdbcType=VARCHAR},
+ flbm = #{flbm,jdbcType=VARCHAR},
+ ggxh = #{ggxh,jdbcType=VARCHAR},
+ mjfs = #{mjfs,jdbcType=VARCHAR},
+ qtxxdwzlj = #{qtxxdwzlj,jdbcType=VARCHAR},
+ qxlb = #{qxlb,jdbcType=VARCHAR},
+ scbssfbhph = #{scbssfbhph,jdbcType=VARCHAR},
+ scbssfbhscrq = #{scbssfbhscrq,jdbcType=VARCHAR},
+ scbssfbhsxrq = #{scbssfbhsxrq,jdbcType=VARCHAR},
+ scbssfbhxlh = #{scbssfbhxlh,jdbcType=VARCHAR},
+ sfbjwycxsy = #{sfbjwycxsy,jdbcType=VARCHAR},
+ sfwblztlcp = #{sfwblztlcp,jdbcType=VARCHAR},
+ sfwwjbz = #{sfwwjbz,jdbcType=VARCHAR},
+ sfybtzjbs = #{sfybtzjbs,jdbcType=VARCHAR},
+ spmc = #{spmc,jdbcType=VARCHAR},
+ sydycpbs = #{sydycpbs,jdbcType=VARCHAR},
+ syqsfxyjxmj = #{syqsfxyjxmj,jdbcType=VARCHAR},
+ tscchcztj = #{tscchcztj,jdbcType=VARCHAR},
+ tsccsm = #{tsccsm,jdbcType=VARCHAR},
+ tsrq = #{tsrq,jdbcType=VARCHAR},
+ tyshxydm = #{tyshxydm,jdbcType=VARCHAR},
+ versionNumber = #{versionnumber,jdbcType=VARCHAR},
+ versionStatus = #{versionstatus,jdbcType=VARCHAR},
+ versionTime = #{versiontime,jdbcType=VARCHAR},
+ ybbm = #{ybbm,jdbcType=VARCHAR},
+ yflbm = #{yflbm,jdbcType=VARCHAR},
+ ylqxzcrbarmc = #{ylqxzcrbarmc,jdbcType=VARCHAR},
+ ylqxzcrbarywmc = #{ylqxzcrbarywmc,jdbcType=VARCHAR},
+ zczbhhzbapzbh = #{zczbhhzbapzbh,jdbcType=VARCHAR},
+ zdcfsycs = #{zdcfsycs,jdbcType=VARCHAR},
+ zxxsdycpbs = #{zxxsdycpbs,jdbcType=VARCHAR},
+ bszt = #{bszt,jdbcType=VARCHAR},
+ sfyzcbayz = #{sfyzcbayz,jdbcType=VARCHAR},
+ zcbacpbs = #{zcbacpbs,jdbcType=VARCHAR},
+ zxxsdyzsydydsl = #{zxxsdyzsydydsl,jdbcType=VARCHAR},
+ deviceHistoryRecordKey = #{devicehistoryrecordkey,jdbcType=VARCHAR},
+ bssjzt = #{bssjzt,jdbcType=VARCHAR}
+ hchzsb = #{hchzsb,jdbcType=VARCHAR}
+
+ where uuid = #{uuid,jdbcType=VARCHAR}
+
- select * from device WHERE ( zxxsdycpbs like concat(#{key},'%') or cpmctymc like concat(#{key},'%') ) limit #{page},#{limit}
+ select *
+ from device
+ WHERE (zxxsdycpbs like concat(#{key}, '%') or cpmctymc like concat(#{key}, '%')) limit #{page}
+ , #{limit}
- SELECT * FROM device WHERE `zxxsdycpbs`= #{zxxsdycpbs}
+ SELECT *
+ FROM device
+ WHERE `zxxsdycpbs` = #{zxxsdycpbs}
@@ -931,42 +957,71 @@
- DELETE FROM device WHERE deviceRecordKey = #{deviceRecordKey}
+ DELETE
+ FROM device
+ WHERE deviceRecordKey = #{deviceRecordKey}
- SELECT * from device WHERE deviceRecordKey = #{deviceRecordKey} ORDER BY versionNumber DESC LIMIT 1
+ SELECT *
+ from device
+ WHERE deviceRecordKey = #{deviceRecordKey}
+ ORDER BY versionNumber DESC LIMIT 1
- SELECT * from device
+ SELECT *
+ from device
- WHERE zxxsdycpbs = #{zxxsdycpbs}
+ WHERE zxxsdycpbs = #{zxxsdycpbs}
- ORDER BY versionNumber DESC LIMIT 1
+ ORDER BY versionNumber DESC LIMIT 1
- SELECT * from device WHERE deviceRecordKey = #{deviceRecordKey}
+ SELECT *
+ from device
+ WHERE deviceRecordKey = #{deviceRecordKey}
- SELECT uuid from device WHERE deviceRecordKey = #{deviceRecordKey} and versionNumber = #{versionNumber} limit 1
+ SELECT uuid
+ from device
+ WHERE deviceRecordKey = #{deviceRecordKey}
+ and versionNumber = #{versionNumber} limit 1
- SELECT uuid from device WHERE zxxsdycpbs = #{zxxsdycpbs} limit 1
+ SELECT uuid
+ from device
+ WHERE zxxsdycpbs = #{zxxsdycpbs} limit 1
-
- SELECT uuid from device
+
+ SELECT uuid
+ from device
-
- SELECT uuid from device limit #{page},#{limit}
+
+
+ SELECT uuid
+ from device limit #{page},#{limit}
+
- select * from device
- limit #{page},#{limit}
+ select *
+ from device limit #{page},#{limit}
+
+
+
+ UPDATE device
+
+ hchzsb=#{hchzsb},
+ cplx=#{cplx},
+
+ WHERE devicerecordkey=#{devicerecordkey}
+
+
\ No newline at end of file