Compare commits

...

4 Commits

Author SHA1 Message Date
yewj b4f3a89cec 层级分类 6 months ago
anthonywj 3730a9578f 国家库V3重构 9 months ago
anthonywj eca102392b V3版本修改,下载历史版本 9 months ago
anthonywj 0cb7316059 V3版本修改 9 months ago

@ -7,6 +7,7 @@ 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.udid.UdiEntity;
import com.glxp.udidl.admin.exception.JsonException;
import com.glxp.udidl.admin.req.FilterUdiInfoRequest;
import com.glxp.udidl.admin.req.MutiAppScanRequest;
import com.glxp.udidl.admin.req.MutiScanRequest;
@ -20,6 +21,8 @@ import com.glxp.udidl.admin.util.DateUtil;
import com.glxp.udidl.admin.util.FilterUdiUtils;
import com.glxp.udidl.admin.util.ResultVOUtils;
import io.swagger.annotations.ApiOperation;
import lombok.extern.slf4j.Slf4j;
import org.apache.commons.lang3.exception.ExceptionUtils;
import org.springframework.beans.BeanUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
@ -32,6 +35,7 @@ import javax.annotation.Resource;
import java.util.ArrayList;
import java.util.List;
@Slf4j
@RestController
public class UdiInfoController {
@ -71,14 +75,14 @@ public class UdiInfoController {
}
List<ProductInfoEntity> results = productInfoService.selectByUuid(productInfoEntityList.get(0).getUuid());
boolean checkSuccess = true;
Boolean checkSuccess = true;
String lostMsg = "";
if (udiEntity == null) {
return ResultVOUtils.error(500, "UDI码格式错误");
} else {
if (StrUtil.isNotEmpty(udiEntity.getUdi())) {
ProductInfoEntity productInfoEntity = productInfoEntityList.get(0);
lostMsg = getErrMsg(productInfoEntity, udiEntity, lostMsg);
lostMsg = getErrMsg(productInfoEntity, udiEntity, lostMsg, checkSuccess);
//缺少GS1强行添加分隔符进行判断
processUdiEntity(udiEntity, lostMsg);
for (ProductInfoEntity temp : results) {
@ -87,9 +91,12 @@ public class UdiInfoController {
temp.setProduceDate(udiEntity.getProduceDate());
temp.setSerialNo(udiEntity.getSerialNo());
}
lostMsg = getErrMsg(productInfoEntity, udiEntity, "扫码识别格式错误已进行AI自动校正");
lostMsg = getErrMsg(productInfoEntity, udiEntity, "", checkSuccess);
}
}
if (lostMsg.contains("校验成功")) {
checkSuccess = true;
} else checkSuccess = false;
UdiAppResponse udiAppResponse = new UdiAppResponse();
udiAppResponse.setVailResult(checkSuccess);
udiAppResponse.setVailMsg(lostMsg);
@ -147,21 +154,22 @@ public class UdiInfoController {
}
private boolean extractSerialNumber(UdiEntity udiEntity, String batchNo, String serialNumberCode) {
int index = batchNo.indexOf(serialNumberCode)+2;
if (index != -1 && index + 2 <= batchNo.length()) {
int index = batchNo.indexOf(serialNumberCode) + 2;
if (index != -1 && index + 2 <= batchNo.length() && batchNo.contains(serialNumberCode)) {
// 假设序列号是6位数字此处可以根据实际需求进行调整
String serialNumber = batchNo.substring(index);
String serialNumber = batchNo.substring(index + 2);
// 对序列号进行一些合法性校验,如果需要
// ...
if (serialNumber.length() > 5) {
udiEntity.setSerialNo(serialNumber); // 假设存在此方法,用于设置序列号
udiEntity.setBatchNo(batchNo.substring(0, index-2));
udiEntity.setBatchNo(batchNo.substring(0, index - 2));
}
return true;
}
return false;
}
public String getErrMsg(ProductInfoEntity productInfoEntity, UdiEntity udiEntity, String lostMsg) {
boolean checkSuccess = true;
public String getErrMsg(ProductInfoEntity productInfoEntity, UdiEntity udiEntity, String lostMsg, Boolean checkSuccess) {
if ("是".equals(productInfoEntity.getScbssfbhph()) && StrUtil.isEmpty(udiEntity.getBatchNo())) {
checkSuccess = false;
lostMsg = lostMsg + ",批次号";
@ -457,7 +465,7 @@ public class UdiInfoController {
return ResultVOUtils.success(pageSimpleResponse);
} catch (Exception e) {
e.printStackTrace();
log.error(ExceptionUtils.getStackTrace(e));
return ResultVOUtils.error(500, "连接UDI数据下载服务出错");
}
}
@ -552,6 +560,7 @@ public class UdiInfoController {
} catch (Exception e) {
e.printStackTrace();
log.error(ExceptionUtils.getStackTrace(e));
return ResultVOUtils.error(500, "连接UDI数据下载服务出错");
}
}

@ -49,7 +49,7 @@ public class CompanyController {
public BaseResponse vailUdiToken(@RequestBody TokenRequest tokenRequest) {
if (StrUtil.isEmpty(tokenRequest.getTyshxydm())) {
if (StrUtil.isEmpty(tokenRequest.getTYSHXYDM())) {
return ResultVOUtils.error(500, "统一社会信用代码不能为空!");
}

@ -12,6 +12,8 @@ import io.swagger.annotations.Api;
import io.swagger.annotations.ApiImplicitParam;
import io.swagger.annotations.ApiImplicitParams;
import io.swagger.annotations.ApiOperation;
import lombok.extern.slf4j.Slf4j;
import org.apache.commons.lang3.exception.ExceptionUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
@ -27,6 +29,7 @@ import java.util.List;
@Api(tags = "阳光采购平台产品信息接口")
@RestController
@RequestMapping("udplat/goods")
@Slf4j
public class UdplatGoodsController {
@Autowired
@ -47,6 +50,7 @@ public class UdplatGoodsController {
try {
return udplatGoodsService.importExcel(file.getInputStream(), type);
} catch (Exception e) {
log.error(ExceptionUtils.getStackTrace(e));
return ResultVOUtils.error(-1, e.getMessage());
}
}

@ -1,6 +1,8 @@
package com.glxp.udidl.admin.converter;
import org.apache.commons.lang3.exception.ExceptionUtils;
import java.util.ArrayList;
import java.util.Collections;
import java.util.List;

@ -13,6 +13,7 @@ import com.baomidou.mybatisplus.core.toolkit.*;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.baomidou.mybatisplus.extension.toolkit.SqlHelper;
import com.glxp.udidl.admin.util.BeanCopyUtils;
import org.apache.commons.lang3.exception.ExceptionUtils;
import org.apache.ibatis.binding.MapperMethod;
import org.apache.ibatis.logging.Log;
import org.apache.ibatis.logging.LogFactory;
@ -263,6 +264,7 @@ public interface BaseMapperPlus<M, T, V> extends BaseMapper<T> {
}
}
} catch (Exception e) {
log.error(ExceptionUtils.getStackTrace(e));
log.error("insertIgnoreBatch fail", e);
return false;
}
@ -314,6 +316,7 @@ public interface BaseMapperPlus<M, T, V> extends BaseMapper<T> {
}
}
} catch (Exception e) {
log.error(ExceptionUtils.getStackTrace(e));
log.error("insertIgnoreBatch fail", e);
return false;
}

@ -0,0 +1,9 @@
package com.glxp.udidl.admin.dao.udi;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.glxp.udidl.admin.entity.udi.DiProductEntity;
import org.apache.ibatis.annotations.Mapper;
@Mapper
public interface DiProductMapper extends BaseMapper<DiProductEntity> {
}

@ -0,0 +1,9 @@
package com.glxp.udidl.admin.dao.udi;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.glxp.udidl.admin.entity.udi.DiProductSpecEntity;
import org.apache.ibatis.annotations.Mapper;
@Mapper
public interface DiProductSpecMapper extends BaseMapper<DiProductSpecEntity> {
}

@ -0,0 +1,106 @@
package com.glxp.udidl.admin.entity.udi;
import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import java.io.Serializable;
import java.util.Date;
import lombok.Data;
@ApiModel(value="com-glxp-udidl-admin-entity-udi-DiProduct")
@Data
@TableName(value = "di_product")
public class DiProductEntity implements Serializable {
@TableId(value = "id", type = IdType.INPUT)
@ApiModelProperty(value="")
private Integer id;
/**
*
*/
@TableField(value = "`key`")
@ApiModelProperty(value="唯一键")
private Long key;
/**
*
*/
@TableField(value = "cpmctymc")
@ApiModelProperty(value="产品名称,通用名称")
private String cpmctymc;
/**
*
*/
@TableField(value = "flbm")
@ApiModelProperty(value="分类编码")
private String flbm;
/**
*
*/
@TableField(value = "tyshxydm")
@ApiModelProperty(value="统一社会信用代码证号")
private String tyshxydm;
/**
* /
*/
@TableField(value = "ylqxzcrbarmc")
@ApiModelProperty(value="注册/备案人名称")
private String ylqxzcrbarmc;
/**
* /
*/
@TableField(value = "ylqxzcrbarywmc")
@ApiModelProperty(value="注册/备案人名称英文名称")
private String ylqxzcrbarywmc;
/**
*
*/
@TableField(value = "spmc")
@ApiModelProperty(value="商品名称")
private String spmc;
/**
*
*/
@TableField(value = "cplx")
@ApiModelProperty(value="产品类型(器械类别)")
private String cplx;
/**
*
*/
@TableField(value = "hchzsb")
@ApiModelProperty(value="耗材或者设备(产品类别)")
private String hchzsb;
/**
*
*/
@TableField(value = "remark")
@ApiModelProperty(value="备注")
private String remark;
/**
*
*/
@TableField(value = "createTime")
@ApiModelProperty(value="创建时间")
private Date createTime;
/**
*
*/
@TableField(value = "updateTime")
@ApiModelProperty(value="更新时间")
private Date updateTime;
private static final long serialVersionUID = 1L;
}

@ -0,0 +1,251 @@
package com.glxp.udidl.admin.entity.udi;
import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import java.io.Serializable;
import java.util.Date;
import lombok.Data;
@ApiModel(value="com-glxp-udidl-admin-entity-udi-DiProductSpec")
@Data
@TableName(value = "di_product_spec")
public class DiProductSpecEntity implements Serializable {
@TableId(value = "id", type = IdType.INPUT)
@ApiModelProperty(value="")
private Integer id;
@TableField(value = "`key`")
@ApiModelProperty(value="")
private Long key;
/**
* KEY
*/
@TableField(value = "productKey")
@ApiModelProperty(value="产品KEY外键")
private Long productKey;
/**
* key
*/
@TableField(value = "deviceRecordKey")
@ApiModelProperty(value="数据库记录key国家库")
private String deviceRecordKey;
/**
*
*/
@TableField(value = "zxxsdycpbs")
@ApiModelProperty(value="最小销售单元产品标识")
private String zxxsdycpbs;
/**
*
*/
@TableField(value = "ggxh")
@ApiModelProperty(value="规格型号")
private String ggxh;
/**
* 使
*/
@TableField(value = "sydycpbs")
@ApiModelProperty(value="使用单元产品标识")
private String sydycpbs;
/**
*
*/
@TableField(value = "versionNumber")
@ApiModelProperty(value="历史版本号,最高为最新")
private Integer versionNumber;
/**
*
*/
@TableField(value = "ybbm")
@ApiModelProperty(value="医保编码")
private String ybbm;
/**
*
*/
@TableField(value = "scbssfbhph")
@ApiModelProperty(value="是否包含批号")
private String scbssfbhph;
/**
*
*/
@TableField(value = "scbssfbhxlh")
@ApiModelProperty(value="是否包含序列号")
private String scbssfbhxlh;
/**
*
*/
@TableField(value = "scbssfbhscrq")
@ApiModelProperty(value="是否包含生产日期")
private String scbssfbhscrq;
/**
*
*/
@TableField(value = "scbssfbhsxrq")
@ApiModelProperty(value="是否包含失效日期")
private String scbssfbhsxrq;
/**
*
*/
@TableField(value = "cpms")
@ApiModelProperty(value="产品描述")
private String cpms;
/**
* / 1 0
*/
@TableField(value = "sfwblztlcp")
@ApiModelProperty(value="是否为包类产品/组套类产品; 1 是 0 否")
private String sfwblztlcp;
/**
* MR 0 1 28
3 MR
*/
@TableField(value = "cgzmraqxgxx")
@ApiModelProperty(value="共振MR 安全相关信息; 0 安全 1 条件安全, 28,不安全 3 说明书或标签上面不包括 MR 安全信息")
private String cgzmraqxgxx;
/**
* 使:0 1
*/
@TableField(value = "sfbjwycxsy")
@ApiModelProperty(value="标记为一次性使用:0 否, 1 是")
private String sfbjwycxsy;
/**
*
*/
@TableField(value = "qtxxdwzlj")
@ApiModelProperty(value="其他信息的网址链接")
private String qtxxdwzlj;
/**
*
*/
@TableField(value = "tscchcztj")
@ApiModelProperty(value="特殊存储或操作条件")
private String tscchcztj;
/**
* 使
*/
@TableField(value = "tsccsm")
@ApiModelProperty(value="特殊使用尺寸说明")
private String tsccsm;
/**
*
*/
@TableField(value = "tsrq")
@ApiModelProperty(value="医疗器械在流通领域停止销售的时间")
private String tsrq;
/**
* 1 ,2 3 RFID4
*/
@TableField(value = "bszt")
@ApiModelProperty(value="标识载体1 一维码,2 二维码3 RFID4 其他")
private String bszt;
/**
* :2019-09-12
*/
@TableField(value = "cpbsfbrq")
@ApiModelProperty(value="标识发布时间;格式:2019-09-12")
private String cpbsfbrq;
/**
*
*/
@TableField(value = "btcpbs")
@ApiModelProperty(value="本体标识医疗器械本体标识中的产品标识")
private String btcpbs;
/**
* 1 0
*/
@TableField(value = "sfyzcbayz")
@ApiModelProperty(value="是否包含本体标识: 1 是 0 否")
private String sfyzcbayz;
/**
* GS1MA IDcode
*/
@TableField(value = "cpbsbmtxmc")
@ApiModelProperty(value="产品标识编码体系名称,如 GS1MA 码IDcode")
private String cpbsbmtxmc;
/**
* 使
*/
@TableField(value = "zdcfsycs")
@ApiModelProperty(value="最大重复使用次数")
private String zdcfsycs;
/**
* :1 0
*/
@TableField(value = "sfwwjbz")
@ApiModelProperty(value="是否为已灭菌产品:1 是 0 否")
private String sfwwjbz;
/**
* 使:1 0
*/
@TableField(value = "syqsfxyjxmj")
@ApiModelProperty(value="使用前是否需要进行灭菌:1 是 0 否")
private String syqsfxyjxmj;
/**
*
*/
@TableField(value = "mjfs")
@ApiModelProperty(value="灭菌方式")
private String mjfs;
/**
*
*/
@TableField(value = "hchzsb")
@ApiModelProperty(value="耗材或者设备(产品类别)")
private String hchzsb;
/**
*
*/
@TableField(value = "remark")
@ApiModelProperty(value="备注")
private String remark;
/**
*
*/
@TableField(value = "createTime")
@ApiModelProperty(value="创建时间")
private Date createTime;
/**
*
*/
@TableField(value = "udpateTime")
@ApiModelProperty(value="更新时间")
private Date udpateTime;
private static final long serialVersionUID = 1L;
}

@ -159,6 +159,16 @@ public class ProductInfoEntity {
@ApiModelProperty(value = "'分类编码名称'")
private String categoryName;
private String zxxsdycpbs;
private String tscchcztj;
private String tsccsm;
private String tsrq;
private String bszt;
private String cpbsfbrq;
private String btcpbs;
private String sfyzcbayz;
//额外字段
@ApiModelProperty(value = "批次号")
@TableField(exist = false)

@ -164,6 +164,10 @@ public class Device {
@ApiModelProperty(value = "产品类型")
private String cplx;
private String correctionNumber;
private String correctionTime;
private String correctionRemark;
private String deviceHistoryKey;
private String deviceRecordKey;

@ -160,6 +160,11 @@ public class DeviceEntity {
@ApiModelProperty(value = "产品类型")
private String cplx;
private String correctionNumber;
private String correctionTime;
private String correctionRemark;
@ApiModelProperty(value = "联系人信息")
private List<Contactlist> contactlistList;

@ -15,17 +15,22 @@ public class DeviceRequest {
* currentPageNumber : , 1
*/
@ApiModelProperty(value = "接口调用凭据")
private String accessToken;
@ApiModelProperty(value = "数据类型", example = "1 新发布")
private String dataType;
@ApiModelProperty(value = "请求时间范围")
private String rangeValue;
@ApiModelProperty(value = "请求分页数,初始请求时,从 1 开始")
private String currentPageNumber;
///无用数据
@ApiModelProperty(value = "接口调用凭据")
private String accessToken;
@ApiModelProperty(value = "请求范围1 按天请求2 按月请求")
private String requestType;
@ApiModelProperty(value = "请求时间范围")
private String rangeValue;
@ApiModelProperty(value = "最小销售单元产品标识;精准查询")
@JsonProperty("ZXXSDYCPBS")
@ -47,8 +52,6 @@ public class DeviceRequest {
@JsonProperty("ZCZBHHZBAPZBH")
private String ZCZBHHZBAPZBH;
@ApiModelProperty(value = "请求分页数,初始请求时,从 1 开始")
private String currentPageNumber;
@ApiModelProperty(value = "下载方式: auto自动 manual手动")
private String downloadType;

@ -0,0 +1,18 @@
package com.glxp.udidl.admin.req.udid;
import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Data;
import lombok.NoArgsConstructor;
@Builder
@AllArgsConstructor
@NoArgsConstructor
@Data
public class DeviceV3Request {
private String dataType;
private String rangeValue;
private Integer currentPageNumber;
private String ZXXSDYCPBS;
}

@ -1,29 +1,14 @@
package com.glxp.udidl.admin.req.udid;
import lombok.Data;
@Data
public class DownloadDiRequest {
/**
* accessToken : 70ACE0818B99E99D10046C6AAA6271109A0FD7643D57E0B4E4936E271757EF79F905F86F4492CC6C4388019B0AB925927216652B7D17090B794A9F34B10CD3B101A09182AF0AC9313FF8436964D5AF47E1600795405BCF94
* primaryDeviceId : 08714729040347
*/
private String ZXXSDYCPBS;
private String accessToken;
private String primaryDeviceId;
public String getAccessToken() {
return accessToken;
}
public void setAccessToken(String accessToken) {
this.accessToken = accessToken;
}
public String getPrimaryDeviceId() {
return primaryDeviceId;
}
public void setPrimaryDeviceId(String primaryDeviceId) {
this.primaryDeviceId = primaryDeviceId;
}
}

@ -12,5 +12,5 @@ public class TokenRequest {
private String appSecret;
@ApiModelProperty(value = "统一社会信用代码", required = true)
@JSONField(name = "TYSHXYDM")
private String tyshxydm;//统一社会信用代码 必须大写
private String TYSHXYDM;//统一社会信用代码 必须大写
}

@ -76,6 +76,10 @@ public class DataSetResult {
//文档有,接口返回无该字段
private String cplx; //"产品类型1 器械2 体外诊断试剂
private String hchzsb; //耗材或者设备:0 耗材, 1 设备
private String correctionNumber;
private String correctionTime;
private String correctionRemark;
private List<ContactInfo> contactList;
}

@ -1,6 +1,7 @@
package com.glxp.udidl.admin.service.dataSync;
import cn.hutool.core.bean.BeanUtil;
import cn.hutool.core.util.StrUtil;
import cn.hutool.json.JSONUtil;
import com.alibaba.fastjson.JSON;
@ -11,10 +12,7 @@ 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;
import com.glxp.udidl.admin.req.udid.DownloadDiRequest;
import com.glxp.udidl.admin.req.udid.DownloadHistoryRequest;
import com.glxp.udidl.admin.req.udid.TokenRequest;
import com.glxp.udidl.admin.req.udid.*;
import com.glxp.udidl.admin.res.BaseResponse;
import com.glxp.udidl.admin.res.udid.DataSetHistoryResult;
import com.glxp.udidl.admin.res.udid.DataSetResult;
@ -24,11 +22,9 @@ 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;
import com.glxp.udidl.admin.util.RedisUtil;
import com.glxp.udidl.admin.util.ResultVOUtils;
import com.glxp.udidl.admin.util.*;
import lombok.extern.slf4j.Slf4j;
import org.apache.commons.lang3.exception.ExceptionUtils;
import org.springframework.stereotype.Service;
import javax.annotation.Resource;
@ -46,14 +42,9 @@ import java.util.stream.Collectors;
public class DeviceDownloadService {
private String token = "";
private int reCount = 0;
private CompanyEntity companyEntity;
private String url = "sharing/get";
@Resource
private CompanyService companyService;
@Resource
@ -73,6 +64,10 @@ public class DeviceDownloadService {
private static List<Map<String, String>> tokenList = new ArrayList<>();
@Resource
OkHttpCli okHttpCli;
/**
* token
*
@ -86,8 +81,10 @@ public class DeviceDownloadService {
TokenRequest tokenRequest = new TokenRequest();
tokenRequest.setAppId(companyEntity.getAppId());
tokenRequest.setAppSecret(companyEntity.getAppSecret());
tokenRequest.setTyshxydm(companyEntity.getTyshxydm());
String response = HttpClient.post("token/get", tokenRequest);
tokenRequest.setTYSHXYDM(companyEntity.getTyshxydm());
String json = JSONUtil.toJsonStr(tokenRequest);
String response = okHttpCli.doPostJson(UdidConfig.apiUrl + "token/get", json);
// String response = HttpClient.post("token/get", tokenRequest);
TokenEntity tokenEntity = (TokenEntity) JSONObject.parseObject(response, TokenEntity.class);
token = tokenEntity.getAccessToken();
redisUtil.setEx("UDISYNC_TOKEN", token, 1 * 60 * 60 * 6);
@ -97,7 +94,8 @@ public class DeviceDownloadService {
public String getTokenNow(TokenRequest tokenRequest) {
try {
String response = HttpClient.post("token/get", tokenRequest);
String json = JSONUtil.toJsonStr(tokenRequest);
String response = okHttpCli.doPostJson(UdidConfig.apiUrl + "token/get", json);
TokenEntity tokenEntity = (TokenEntity) JSONObject.parseObject(response, TokenEntity.class);
if (tokenEntity.getReturnCode() == 1) {
token = tokenEntity.getAccessToken();
@ -107,6 +105,7 @@ public class DeviceDownloadService {
}
} catch (Exception e) {
log.error(ExceptionUtils.getStackTrace(e));
log.error("国家库网络服务器异常", e);
return "国家库网络服务器异常!";
}
@ -122,12 +121,13 @@ public class DeviceDownloadService {
public DataSetSingleResult downloadByDi(String deviceId) {
DataSetSingleResult result = new DataSetSingleResult();
DownloadDiRequest downloadDiRequest = new DownloadDiRequest();
downloadDiRequest.setAccessToken(getToken());
downloadDiRequest.setPrimaryDeviceId(deviceId);
downloadDiRequest.setZXXSDYCPBS(deviceId);
String json = JSONUtil.toJsonStr(downloadDiRequest);
String response = "";
try {
response = HttpClient.post("sharing/single", downloadDiRequest);
response = okHttpCli.doPostJson(UdidConfig.apiUrl + "sharing/single", json, getHeaders());
} catch (Exception e) {
log.error(ExceptionUtils.getStackTrace(e));
log.error("下载产品标识详情数据异常,响应结果:{}", response);
result.setReturnCode(-1);
result.setReturnMsg(e.getMessage());
@ -136,6 +136,14 @@ public class DeviceDownloadService {
return JSONObject.parseObject(response, DataSetSingleResult.class);
}
public String[] getHeaders() {
List<String> header = new ArrayList<>();
header.add("accessToken");
header.add(getToken());
String[] strArray = new String[header.size()];
return header.toArray(strArray);
}
/**
*
*
@ -146,15 +154,18 @@ public class DeviceDownloadService {
*/
private DataSetResult getData(String rangeValue, int requestType, int page) {
DataSetResult result = new DataSetResult();
DeviceRequest deviceRequest = new DeviceRequest();
deviceRequest.setAccessToken(getToken());
deviceRequest.setRequestType(requestType + "");
deviceRequest.setRangeValue(rangeValue);
deviceRequest.setCurrentPageNumber(page + "");
DeviceV3Request deviceRequest = DeviceV3Request.builder()
.dataType("1")
.currentPageNumber(page)
.ZXXSDYCPBS(null)
.rangeValue(rangeValue).build();
String response = "";
try {
Thread.sleep(3 * 1000);
response = HttpClient.post(url, deviceRequest);
String json = JSONUtil.toJsonStr(deviceRequest);
response = okHttpCli.doPostJson(UdidConfig.apiUrl + "sharing/get", json, getHeaders());
} catch (InterruptedException e) {
result.setReturnCode(-1);
result.setReturnMsg(e.getMessage());
@ -170,17 +181,18 @@ public class DeviceDownloadService {
* @return
*/
private synchronized DataSetResult getData(DeviceRequest deviceRequest, int page) {
deviceRequest.setAccessToken(getToken());
deviceRequest.setCurrentPageNumber(page + "");
String response = "";
DeviceV3Request deviceV3Request = new DeviceV3Request();
BeanUtil.copyProperties(deviceRequest, deviceV3Request);
deviceV3Request.setCurrentPageNumber(page);
String key = "downloadUdiData";
if (redisUtil.getLock(key)) {
log.info("获取到锁");
redisUtil.setEx("downloadUdiData", "1", 5);
//目前限制为5秒访问一次
log.info("获取到锁的参数:" + page);
response = HttpClient.post(url, deviceRequest);
String json = JSONUtil.toJsonStr(deviceV3Request);
response = okHttpCli.doPostJson(UdidConfig.apiUrl + "sharing/get", json, getHeaders());
log.info("获取到结果," + response);
}
log.info("开始解析结果");
@ -292,7 +304,7 @@ public class DeviceDownloadService {
}
boolean hasData = true; //是否还有数据,如无退出
while (hasData) {
redisUtil.set("allUpdatePage", page+"");
redisUtil.set("allUpdatePage", page + "");
DataSetResult dataSetResult = getData(deviceRequest, page);
if (dataSetResult.getReturnCode() != 1 && reCount == 0) {
token = "";
@ -300,6 +312,7 @@ public class DeviceDownloadService {
try {
dataSetResult = getData(deviceRequest, page);
} catch (Exception e) {
log.error(ExceptionUtils.getStackTrace(e));
jobLog.setStatus(1);
jobLog.setType(Constant.LOG_TYPE_ERROR);
jobLog.setMsg("下载失败:" + e.getMessage());
@ -334,7 +347,7 @@ public class DeviceDownloadService {
jobLog.setLastUploadRequest(JSONUtil.toJsonStr(deviceRequest));
jobLogService.update(jobLog);
} catch (Exception e) {
log.error("插入数据失败", e);
log.error(ExceptionUtils.getStackTrace(e));
jobLog.setStatus(1);
jobLog.setType(Constant.LOG_TYPE_ERROR);
jobLog.setMsg("数据写入失败" + e.getMessage());
@ -414,7 +427,8 @@ public class DeviceDownloadService {
String response = "";
try {
Thread.sleep(3 * 1000);
response = HttpClient.post(historyUrl, deviceHistoryRequest);
String json = JSONUtil.toJsonStr(deviceHistoryRequest);
response = okHttpCli.doPostJson(UdidConfig.apiUrl + historyUrl, json, getHeaders());
} catch (InterruptedException e) {
log.error(e.getMessage(), e);
results.setCode(-1);
@ -544,7 +558,7 @@ public class DeviceDownloadService {
jobLog.setCreateTime(new Date());
jobLogService.insert(jobLog);
} catch (Exception e) {
log.error(e.getMessage(), e);
log.error(ExceptionUtils.getStackTrace(e));
JobLog jobLog = new JobLog();
jobLog.setDownloadType(Constant.DOWNLOAD_TYPE_MANUAL);
jobLog.setTaskType(Constant.JOB_TASK_TYPE_DOWNLOAD);
@ -610,7 +624,7 @@ public class DeviceDownloadService {
jobLog.setCreateTime(new Date());
jobLogService.insert(jobLog);
} catch (Exception e) {
log.error(e.getMessage(), e);
log.error(ExceptionUtils.getStackTrace(e));
JobLog jobLog = new JobLog();
jobLog.setDownloadType(Constant.DOWNLOAD_TYPE_MANUAL);
jobLog.setTaskType(Constant.JOB_TASK_TYPE_DOWNLOAD);

@ -1,17 +1,25 @@
package com.glxp.udidl.admin.service.dataSync;
import cn.hutool.core.util.IdUtil;
import cn.hutool.core.util.StrUtil;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.glxp.udidl.admin.constant.Constant;
import com.glxp.udidl.admin.entity.udi.DiProductEntity;
import com.glxp.udidl.admin.entity.udi.DiProductSpecEntity;
import com.glxp.udidl.admin.entity.udi.ProductInfoEntity;
import com.glxp.udidl.admin.entity.udid.*;
import com.glxp.udidl.admin.res.udid.DataSetResult;
import com.glxp.udidl.admin.service.inout.DeviceService;
import com.glxp.udidl.admin.service.inout.ProductInfoService;
import com.glxp.udidl.admin.service.udi.DiProductService;
import com.glxp.udidl.admin.service.udi.DiProductSpecService;
import com.glxp.udidl.admin.service.udi.UdiCompanyService;
import com.glxp.udidl.admin.thread.UdiTransferUtils;
import com.glxp.udidl.admin.util.BeanUtils;
import com.glxp.udidl.admin.util.DateUtil;
import com.glxp.udidl.admin.util.IntUtil;
import lombok.extern.slf4j.Slf4j;
import org.apache.commons.lang3.exception.ExceptionUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
@ -26,12 +34,18 @@ import java.util.stream.Collectors;
*
*/
@Service
@Slf4j
public class DeviceSaveService {
@Resource
private DeviceService deviceService;
@Resource
private UdiTransferUtils udiTransferUtils;
@Resource
private DiProductService diProductService;
@Resource
private DiProductSpecService diProductSpecService;
/**
*
*
@ -56,7 +70,7 @@ public class DeviceSaveService {
String uuid = null;
Device originDevice = deviceService.selectDiIsSame(item.getZxxsdycpbs(), item.getVersionNumber() + "");
if (dlType == Constant.DL_TYPE_ADD) {
if (originDevice != null){
if (originDevice != null) {
updateNewest(originDevice);
continue;
}
@ -184,19 +198,48 @@ public class DeviceSaveService {
}
//7存储品种信息
DiProductEntity exitEntity = diProductService.getOne(new QueryWrapper<DiProductEntity>()
.eq("cpmctymc", device.getCpmctymc()).eq("tyshxydm", device.getTyshxydm()));
if (exitEntity == null) {
exitEntity = new DiProductEntity();
BeanUtils.copyProperties(device, exitEntity);
exitEntity.setKey(IdUtil.getSnowflakeNextId());
diProductService.save(exitEntity);
} else {
BeanUtils.copyProperties(device, exitEntity);
diProductService.updateById(exitEntity);
}
//8存储规格信息
DiProductSpecEntity exitSpecEntity = diProductSpecService.getOne(new QueryWrapper<DiProductSpecEntity>()
.eq("zxxsdycpbs", device.getZxxsdycpbs()).eq("versionNumber", device.getVersionnumber()));
if (exitSpecEntity == null) {
exitSpecEntity = new DiProductSpecEntity();
BeanUtils.copyProperties(device, exitSpecEntity);
exitSpecEntity.setDeviceRecordKey(device.getDevicerecordkey());
exitSpecEntity.setProductKey(exitEntity.getKey());
exitSpecEntity.setKey(IdUtil.getSnowflakeNextId());
diProductSpecService.save(exitSpecEntity);
} else {
BeanUtils.copyProperties(device, exitSpecEntity);
diProductSpecService.updateById(exitSpecEntity);
}
//7存储productInfo信息
productInfoSave(uuid);
}
}
return result;
}
@Resource
ProductInfoService productInfoService;
public void updateNewest(Device device){
if(!productInfoService.selectNewst(device.getDevicerecordkey(),true, IntUtil.value(device.getVersionnumber()))){
productInfoService.updateNoNewst(device.getDevicerecordkey(),false,null);
productInfoService.updateNoNewst(device.getDevicerecordkey(),true, IntUtil.value(device.getVersionnumber()));
public void updateNewest(Device device) {
if (!productInfoService.selectNewst(device.getDevicerecordkey(), true, IntUtil.value(device.getVersionnumber()))) {
productInfoService.updateNoNewst(device.getDevicerecordkey(), false, null);
productInfoService.updateNoNewst(device.getDevicerecordkey(), true, IntUtil.value(device.getVersionnumber()));
}
}
@ -316,6 +359,7 @@ public class DeviceSaveService {
try {
return Integer.parseInt(s);
} catch (Exception e) {
log.error(ExceptionUtils.getStackTrace(e));
return 0;
}
}

@ -19,6 +19,7 @@ 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.apache.commons.lang3.exception.ExceptionUtils;
import org.springframework.beans.BeanUtils;
import org.springframework.scheduling.annotation.Async;
import org.springframework.stereotype.Service;
@ -92,7 +93,7 @@ public class DeviceSyncService {
try {
downloadAndSave(day, downloadType, Constant.DL_TYPE_UPDATE);
} catch (Exception e) {
log.error("下载UDI国家库信息异常", e);
log.error(ExceptionUtils.getStackTrace(e));
JobLog jobLog = new JobLog();
jobLog.setDownloadType(downloadType);
jobLog.setDownloadDate(DateUtil.parseDate(day));
@ -231,7 +232,7 @@ public class DeviceSyncService {
jobLog.setType(Constant.LOG_TYPE_SUCCESS);
jobLogService.update(jobLog);
} catch (Exception e) {
log.error("下载产品信息失败", e);
log.error(ExceptionUtils.getStackTrace(e));
jobLog.setMsg("下载失败:" + res.getReturnMsg());
jobLog.setType(Constant.LOG_TYPE_ERROR);
jobLogService.update(jobLog);

@ -11,6 +11,7 @@ import com.glxp.udidl.admin.service.inout.ProductInfoService;
import com.glxp.udidl.admin.util.DateUtil;
import com.glxp.udidl.admin.util.ResultVOUtils;
import lombok.extern.slf4j.Slf4j;
import org.apache.commons.lang3.exception.ExceptionUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
@ -94,7 +95,7 @@ public class ProductInfoDlService {
}
zip.close();
} catch (Exception e) {
log.error(e.getMessage(), e);
log.error(ExceptionUtils.getStackTrace(e));
return ResultVOUtils.error(-1, e.getMessage());
}
return ResultVOUtils.success();

@ -14,6 +14,7 @@ import com.glxp.udidl.admin.util.Md5Utils;
import com.glxp.udidl.admin.util.ResultVOUtils;
import com.google.gson.reflect.TypeToken;
import lombok.extern.slf4j.Slf4j;
import org.apache.commons.lang3.exception.ExceptionUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.core.ParameterizedTypeReference;
import org.springframework.http.HttpEntity;
@ -46,7 +47,7 @@ public class UdplatDownloadService {
try {
userName = URLEncoder.encode(globalConfig.getUdplat_userName(), "utf-8");
} catch (Exception e) {
log.error(e.getMessage(), e);
log.error(ExceptionUtils.getStackTrace(e));
}
return userName;
}

@ -18,6 +18,8 @@ import com.glxp.udidl.admin.service.udi.ProductClassifyService;
import com.glxp.udidl.admin.service.udi.UdiCompanyService;
import com.glxp.udidl.admin.util.BeanUtils;
import com.glxp.udidl.admin.util.DateUtil;
import lombok.extern.slf4j.Slf4j;
import org.apache.commons.lang3.exception.ExceptionUtils;
import org.springframework.stereotype.Service;
import javax.annotation.Resource;
@ -27,6 +29,7 @@ import java.util.stream.Collectors;
/**
*
*/
@Slf4j
@Service
public class DeviceParseService {
@ -282,6 +285,7 @@ public class DeviceParseService {
try {
return Integer.parseInt(s);
} catch (Exception e) {
log.error(ExceptionUtils.getStackTrace(e));
return 0;
}
}

@ -5,6 +5,7 @@ import cn.hutool.core.date.DatePattern;
import cn.hutool.core.date.DateTime;
import cn.hutool.core.date.DateUtil;
import cn.hutool.core.util.StrUtil;
import cn.hutool.json.JSONUtil;
import com.alibaba.fastjson.JSONObject;
import com.glxp.udidl.admin.constant.Constant;
import com.glxp.udidl.admin.entity.info.CompanyEntity;
@ -20,12 +21,16 @@ 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.HttpClient;
import com.glxp.udidl.admin.util.OkHttpCli;
import com.glxp.udidl.admin.util.RedisUtil;
import com.glxp.udidl.admin.util.UdidConfig;
import lombok.extern.slf4j.Slf4j;
import org.apache.commons.lang3.exception.ExceptionUtils;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import javax.annotation.Resource;
import java.util.ArrayList;
import java.util.Collections;
import java.util.Date;
import java.util.List;
@ -36,7 +41,6 @@ import java.util.List;
public class DeviceUpdateService {
private String token;
private String url = "sharing/get";
@Resource
private RedisUtil redisUtil;
@ -104,8 +108,9 @@ public class DeviceUpdateService {
TokenRequest tokenRequest = new TokenRequest();
tokenRequest.setAppId(companyEntity.getAppId());
tokenRequest.setAppSecret(companyEntity.getAppSecret());
tokenRequest.setTyshxydm(companyEntity.getTyshxydm());
String response = HttpClient.post("token/get", tokenRequest);
tokenRequest.setTYSHXYDM(companyEntity.getTyshxydm());
String json = JSONUtil.toJsonStr(tokenRequest);
String response = okHttpCli.doPostJson(UdidConfig.apiUrl + "token/get", json);
TokenEntity tokenEntity = JSONObject.parseObject(response, TokenEntity.class);
token = tokenEntity.getAccessToken();
redisUtil.setEx("UDI_UPDATE_TOKEN", token, 1 * 60 * 60 * 6);
@ -113,6 +118,10 @@ public class DeviceUpdateService {
return token;
}
@Resource
OkHttpCli okHttpCli;
/**
*
*
@ -122,12 +131,13 @@ public class DeviceUpdateService {
public DataSetSingleResult downloadByDi(String deviceId) {
DataSetSingleResult result = new DataSetSingleResult();
DownloadDiRequest downloadDiRequest = new DownloadDiRequest();
downloadDiRequest.setAccessToken(getToken());
downloadDiRequest.setPrimaryDeviceId(deviceId);
downloadDiRequest.setZXXSDYCPBS(deviceId);
String json = JSONUtil.toJsonStr(downloadDiRequest);
String response = "";
try {
response = HttpClient.post("sharing/single", downloadDiRequest);
response = okHttpCli.doPostJson(UdidConfig.apiUrl + "sharing/single", json, getHeaders());
} catch (Exception e) {
log.error(ExceptionUtils.getStackTrace(e));
log.error("下载产品标识详情数据异常,响应结果:{}", response);
result.setReturnCode(-1);
result.setReturnMsg(e.getMessage());
@ -136,4 +146,12 @@ public class DeviceUpdateService {
return JSONObject.parseObject(response, DataSetSingleResult.class);
}
public String[] getHeaders() {
List<String> header = new ArrayList<>();
header.add("accessToken");
header.add(getToken());
String[] strArray = new String[header.size()];
return header.toArray(strArray);
}
}

@ -0,0 +1,10 @@
package com.glxp.udidl.admin.service.udi;
import org.springframework.stereotype.Service;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.glxp.udidl.admin.dao.udi.DiProductMapper;
import com.glxp.udidl.admin.entity.udi.DiProductEntity;
@Service
public class DiProductService extends ServiceImpl<DiProductMapper, DiProductEntity> {
}

@ -0,0 +1,10 @@
package com.glxp.udidl.admin.service.udi;
import org.springframework.stereotype.Service;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.glxp.udidl.admin.entity.udi.DiProductSpecEntity;
import com.glxp.udidl.admin.dao.udi.DiProductSpecMapper;
@Service
public class DiProductSpecService extends ServiceImpl<DiProductSpecMapper, DiProductSpecEntity> {
}

@ -15,6 +15,7 @@ import com.glxp.udidl.admin.service.udplat.UdplatGoodsService;
import com.glxp.udidl.admin.service.udplat.UdplatLogService;
import com.glxp.udidl.admin.util.*;
import lombok.extern.slf4j.Slf4j;
import org.apache.commons.lang3.exception.ExceptionUtils;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
@ -74,6 +75,7 @@ public class UdplatGoodsServiceImpl implements UdplatGoodsService {
logService.insert(udplatLog);
return ResultVOUtils.success(count);
} catch (Exception e) {
log.error(ExceptionUtils.getStackTrace(e));
UdplatLog udplatLog = new UdplatLog();
udplatLog.setDownloadType("import");
udplatLog.setTbName("udplat_goods");
@ -109,8 +111,7 @@ public class UdplatGoodsServiceImpl implements UdplatGoodsService {
}
}
} catch (Exception e) {
log.error(e.getMessage(), e);
log.error(JSON.toJSONString(e.getStackTrace()));
log.error(ExceptionUtils.getStackTrace(e));
UdplatLog udplatLog = new UdplatLog();
udplatLog.setDownloadType(downloadType);
udplatLog.setTbName("udplat_goods");

@ -9,6 +9,7 @@ import com.glxp.udidl.admin.service.dataSync.UdplatSyncService;
import com.glxp.udidl.admin.service.udplat.UdplatLogService;
import com.glxp.udidl.admin.util.DateUtil;
import lombok.extern.slf4j.Slf4j;
import org.apache.commons.lang3.exception.ExceptionUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.scheduling.annotation.EnableScheduling;
import org.springframework.scheduling.annotation.SchedulingConfigurer;
@ -49,6 +50,7 @@ public class DownloadTaskUdplat implements SchedulingConfigurer {
try {
udplatSyncService.downloadByDay("auto");
} catch (Exception e) {
log.error(ExceptionUtils.getStackTrace(e));
UdplatLog udplatLog = new UdplatLog();
udplatLog.setDownloadType("auto");
udplatLog.setType("error");

@ -1,6 +1,7 @@
package com.glxp.udidl.admin.util;
import lombok.extern.slf4j.Slf4j;
import org.apache.commons.lang3.exception.ExceptionUtils;
import javax.servlet.ServletOutputStream;
import javax.servlet.http.HttpServletResponse;
@ -23,13 +24,14 @@ public class FileUtils {
buff.flush();
buff.close();
} catch (Exception e) {
log.error(ExceptionUtils.getStackTrace(e));
} finally {
try {
buff.close();
;
outStr.close();
} catch (Exception e) {
log.error(ExceptionUtils.getStackTrace(e));
}
}
@ -42,6 +44,7 @@ public class FileUtils {
bw.newLine();
bw.close();
} catch (Exception e) {
log.error(ExceptionUtils.getStackTrace(e));
return e.getMessage();
}
return "success";
@ -68,7 +71,7 @@ public class FileUtils {
out.close();
in.close();
} catch (Exception e) {
log.error(e.getMessage(), e);
log.error(ExceptionUtils.getStackTrace(e));
}
}
@ -77,6 +80,7 @@ public class FileUtils {
cnName = new String(cnName.getBytes("gb2312"), "ISO8859-1");
} catch (Exception e) {
log.error(ExceptionUtils.getStackTrace(e));
cnName = defaultName;
}
return cnName;

@ -15,7 +15,7 @@ import java.util.Map;
public class HttpClient {
private static final Logger logger = LoggerFactory.getLogger(HttpClient.class);
public static String post(String url, Object object) {
public static String post1111(String url, Object object) {
RestTemplate restTemplate = new RestTemplate();
String json = JSONObject.toJSONString(object);
MultiValueMap<String, Object> postParameters = new LinkedMultiValueMap<>();

@ -1,6 +1,7 @@
package com.glxp.udidl.admin.util;
import lombok.extern.slf4j.Slf4j;
import org.apache.commons.lang3.exception.ExceptionUtils;
import javax.servlet.http.HttpServletRequest;
import java.net.InetAddress;
@ -31,7 +32,7 @@ public class IpUtils {
inet = InetAddress.getLocalHost();
ip = inet.getHostAddress();
} catch (Exception e) {
log.error(e.getMessage(), e);
log.error(ExceptionUtils.getStackTrace(e));
}
}
}

@ -126,12 +126,12 @@ public class OkHttpCli {
* @return string
*/
public String doPostJson(String url, String json) {
log.info("do post request and url[{}]", url);
log.info(url + "\n" + json);
return exectePost(url, json, JSON);
}
public String doPostJson(String url, String json, String... headers) {
log.info("do post request and url[{}]", url);
log.info(url + "\n" + json);
return exectePost(url, json, JSON, headers);
}
@ -167,6 +167,7 @@ public class OkHttpCli {
Response response = null;
try {
response = okHttpClient.newCall(request).execute();
log.info("response code is [{}]", response.toString());
if (response.isSuccessful()) {
return response.body().string();
}

@ -2,6 +2,7 @@ package com.glxp.udidl.admin.util;
import cn.hutool.core.collection.CollUtil;
import lombok.extern.slf4j.Slf4j;
import org.apache.commons.lang3.exception.ExceptionUtils;
import org.springframework.data.redis.core.RedisTemplate;
import org.springframework.data.redis.serializer.StringRedisSerializer;
import org.springframework.stereotype.Component;
@ -59,6 +60,7 @@ public class RedisUtil<T> {
}
result = true;
} catch (Exception e) {
log.error(ExceptionUtils.getStackTrace(e));
log.error("RedisUtil setEx 发生异常参数列表key {} value {}", key, value, e);
}
return result;
@ -97,6 +99,7 @@ public class RedisUtil<T> {
redisTemplate.opsForValue().set(key, value);
result = true;
} catch (Exception e) {
log.error(ExceptionUtils.getStackTrace(e));
log.error("RedisUtil set 发生异常参数列表key {} value {}", key, value, e);
}
return result;
@ -114,6 +117,7 @@ public class RedisUtil<T> {
try {
Thread.sleep(expireTime * 1000);
} catch (Exception e) {
log.error(ExceptionUtils.getStackTrace(e));
log.error("获取锁异常", e);
}
}
@ -142,6 +146,7 @@ public class RedisUtil<T> {
redisTemplate.delete(key);
result = true;
} catch (Exception e) {
log.error(ExceptionUtils.getStackTrace(e));
log.error("RedisUtil del 删除key值key {} ", key, e);
}
return result;

@ -1,16 +1,21 @@
package com.glxp.udidl.admin.util;
import cn.hutool.json.JSONUtil;
import com.alibaba.fastjson.JSONObject;
import com.glxp.udidl.admin.entity.info.CompanyEntity;
import com.glxp.udidl.admin.entity.udid.TokenEntity;
import com.glxp.udidl.admin.req.udid.TokenRequest;
import org.springframework.stereotype.Component;
import javax.annotation.Resource;
/**
* UDI
*/
@Component
public class UdiHttpClient {
@Resource
OkHttpCli okHttpCli;
/**
* UDItoken
@ -22,8 +27,9 @@ public class UdiHttpClient {
TokenRequest tokenRequest = new TokenRequest();
tokenRequest.setAppId(companyEntity.getAppId());
tokenRequest.setAppSecret(companyEntity.getAppSecret());
tokenRequest.setTyshxydm(companyEntity.getTyshxydm());
String response = HttpClient.post("token/get", tokenRequest);
tokenRequest.setTYSHXYDM(companyEntity.getTyshxydm());
String json = JSONUtil.toJsonStr(tokenRequest);
String response = okHttpCli.doPostJson(UdidConfig.apiUrl+"token/get", json);
TokenEntity tokenEntity = (TokenEntity) JSONObject.parseObject(response, TokenEntity.class);
String token = tokenEntity.getAccessToken();
return token;

@ -4,8 +4,8 @@ public class UdidConfig {
public static final String betaUrl = "https://udid.nmpa.gov.cn/api/beta/v1/";
public static final String apiUrl = "https://udid.nmpa.gov.cn/api/v2/";//"https://udid.nmpa.gov.cn/api/v1/";
// public static final String apiUrl = "https://udid.nmpa.gov.cn/api/v2/";//"https://udid.nmpa.gov.cn/api/v1/";
public static final String apiUrl = "https://udid.nmpa.gov.cn/api/v3/";
public static final String AppId = "371ced236e844272ad14bbe9051fd25a";
public static final String AppSecret = "592e7a00a7304f52a86a82e7fac9d2c0";

@ -0,0 +1,26 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.glxp.udidl.admin.dao.udi.DiProductMapper">
<resultMap id="BaseResultMap" type="com.glxp.udidl.admin.entity.udi.DiProductEntity">
<!--@mbg.generated-->
<!--@Table di_product-->
<id column="id" jdbcType="INTEGER" property="id" />
<result column="key" jdbcType="BIGINT" property="key" />
<result column="cpmctymc" jdbcType="VARCHAR" property="cpmctymc" />
<result column="flbm" jdbcType="VARCHAR" property="flbm" />
<result column="tyshxydm" jdbcType="VARCHAR" property="tyshxydm" />
<result column="ylqxzcrbarmc" jdbcType="VARCHAR" property="ylqxzcrbarmc" />
<result column="ylqxzcrbarywmc" jdbcType="VARCHAR" property="ylqxzcrbarywmc" />
<result column="spmc" jdbcType="VARCHAR" property="spmc" />
<result column="cplx" jdbcType="VARCHAR" property="cplx" />
<result column="hchzsb" jdbcType="VARCHAR" property="hchzsb" />
<result column="remark" jdbcType="VARCHAR" property="remark" />
<result column="createTime" jdbcType="TIMESTAMP" property="createTime" />
<result column="updateTime" jdbcType="TIMESTAMP" property="updateTime" />
</resultMap>
<sql id="Base_Column_List">
<!--@mbg.generated-->
id, `key`, cpmctymc, flbm, tyshxydm, ylqxzcrbarmc, ylqxzcrbarywmc, spmc, cplx, hchzsb,
remark, createTime, updateTime
</sql>
</mapper>

@ -0,0 +1,49 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.glxp.udidl.admin.dao.udi.DiProductSpecMapper">
<resultMap id="BaseResultMap" type="com.glxp.udidl.admin.entity.udi.DiProductSpecEntity">
<!--@mbg.generated-->
<!--@Table di_product_spec-->
<id column="id" jdbcType="INTEGER" property="id" />
<result column="key" jdbcType="BIGINT" property="key" />
<result column="productKey" jdbcType="BIGINT" property="productKey" />
<result column="deviceRecordKey" jdbcType="VARCHAR" property="deviceRecordKey" />
<result column="zxxsdycpbs" jdbcType="VARCHAR" property="zxxsdycpbs" />
<result column="ggxh" jdbcType="VARCHAR" property="ggxh" />
<result column="sydycpbs" jdbcType="VARCHAR" property="sydycpbs" />
<result column="versionNumber" jdbcType="INTEGER" property="versionNumber" />
<result column="ybbm" jdbcType="VARCHAR" property="ybbm" />
<result column="scbssfbhph" jdbcType="VARCHAR" property="scbssfbhph" />
<result column="scbssfbhxlh" jdbcType="VARCHAR" property="scbssfbhxlh" />
<result column="scbssfbhscrq" jdbcType="VARCHAR" property="scbssfbhscrq" />
<result column="scbssfbhsxrq" jdbcType="VARCHAR" property="scbssfbhsxrq" />
<result column="cpms" jdbcType="LONGVARCHAR" property="cpms" />
<result column="sfwblztlcp" jdbcType="VARCHAR" property="sfwblztlcp" />
<result column="cgzmraqxgxx" jdbcType="VARCHAR" property="cgzmraqxgxx" />
<result column="sfbjwycxsy" jdbcType="VARCHAR" property="sfbjwycxsy" />
<result column="qtxxdwzlj" jdbcType="VARCHAR" property="qtxxdwzlj" />
<result column="tscchcztj" jdbcType="VARCHAR" property="tscchcztj" />
<result column="tsccsm" jdbcType="VARCHAR" property="tsccsm" />
<result column="tsrq" jdbcType="VARCHAR" property="tsrq" />
<result column="bszt" jdbcType="VARCHAR" property="bszt" />
<result column="cpbsfbrq" jdbcType="VARCHAR" property="cpbsfbrq" />
<result column="btcpbs" jdbcType="VARCHAR" property="btcpbs" />
<result column="sfyzcbayz" jdbcType="VARCHAR" property="sfyzcbayz" />
<result column="cpbsbmtxmc" jdbcType="VARCHAR" property="cpbsbmtxmc" />
<result column="zdcfsycs" jdbcType="VARCHAR" property="zdcfsycs" />
<result column="sfwwjbz" jdbcType="VARCHAR" property="sfwwjbz" />
<result column="syqsfxyjxmj" jdbcType="VARCHAR" property="syqsfxyjxmj" />
<result column="mjfs" jdbcType="VARCHAR" property="mjfs" />
<result column="hchzsb" jdbcType="VARCHAR" property="hchzsb" />
<result column="remark" jdbcType="VARCHAR" property="remark" />
<result column="createTime" jdbcType="TIMESTAMP" property="createTime" />
<result column="udpateTime" jdbcType="TIMESTAMP" property="udpateTime" />
</resultMap>
<sql id="Base_Column_List">
<!--@mbg.generated-->
id, `key`, productKey, deviceRecordKey, zxxsdycpbs, ggxh, sydycpbs, versionNumber,
ybbm, scbssfbhph, scbssfbhxlh, scbssfbhscrq, scbssfbhsxrq, cpms, sfwblztlcp, cgzmraqxgxx,
sfbjwycxsy, qtxxdwzlj, tscchcztj, tsccsm, tsrq, bszt, cpbsfbrq, btcpbs, sfyzcbayz,
cpbsbmtxmc, zdcfsycs, sfwwjbz, syqsfxyjxmj, mjfs, hchzsb, remark, createTime, udpateTime
</sql>
</mapper>

@ -387,7 +387,8 @@
, diType, scbssfbhph, scbssfbhxlh, scbssfbhscrq, scbssfbhsxrq,
ybbm, spmc, cphhhbh, cpms, cpbsbmtxmc, isNewest, updateTime, hchzsb, cplx, sfwblztlcp, cgzmraqxgxx,
sfbjwycxsy, zdcfsycs,
sfwwjbz, syqsfxyjxmj, mjfs, qtxxdwzlj, categoryName)
sfwwjbz, syqsfxyjxmj, mjfs, qtxxdwzlj, categoryName, zxxsdycpbs, tscchcztj, tsccsm ,tsrq,bszt,
cpbsfbrq, btcpbs, sfyzcbayz)
values (#{nameCode},
#{packRatio},
#{packLevel},
@ -435,7 +436,8 @@
#{syqsfxyjxmj},
#{mjfs},
#{qtxxdwzlj},
#{categoryName})
#{categoryName}, #{zxxsdycpbs}, #{tscchcztj}, #{tsccsm}, #{tsrq}, #{bszt}, #{cpbsfbrq}, #{btcpbs}
, #{sfyzcbayz})
</insert>
<delete id="deleteById" parameterType="Map">
@ -569,6 +571,30 @@
<if test="categoryName != null">
categoryName=#{categoryName},
</if>
<if test="zxxsdycpbs != null">
zxxsdycpbs=#{zxxsdycpbs},
</if>
<if test="tscchcztj != null">
tscchcztj=#{tscchcztj},
</if>
<if test="tsccsm != null">
tsccsm=#{tsccsm},
</if>
<if test="tsrq != null">
tsrq=#{tsrq},
</if>
<if test="bszt != null">
bszt=#{bszt},
</if>
<if test="cpbsfbrq != null">
cpbsfbrq=#{cpbsfbrq},
</if>
<if test="btcpbs != null">
btcpbs=#{btcpbs},
</if>
<if test="sfyzcbayz != null">
sfyzcbayz=#{sfyzcbayz},
</if>
</set>
WHERE id = #{id}
</update>
@ -642,6 +668,30 @@
<if test="categoryName != null">
categoryName=#{categoryName},
</if>
<if test="zxxsdycpbs != null">
zxxsdycpbs=#{zxxsdycpbs},
</if>
<if test="tscchcztj != null">
tscchcztj=#{tscchcztj},
</if>
<if test="tsccsm != null">
tsccsm=#{tsccsm},
</if>
<if test="tsrq != null">
tsrq=#{tsrq},
</if>
<if test="bszt != null">
bszt=#{bszt},
</if>
<if test="cpbsfbrq != null">
cpbsfbrq=#{cpbsfbrq},
</if>
<if test="btcpbs != null">
btcpbs=#{btcpbs},
</if>
<if test="sfyzcbayz != null">
sfyzcbayz=#{sfyzcbayz},
</if>
</set>
WHERE uuid = #{uuid}
</update>
@ -702,7 +752,8 @@
ybbm, spmc, cphhhbh, cpms, cpbsbmtxmc, isNewest, updateTime, hchzsb, cplx, sfwblztlcp, cgzmraqxgxx,
sfbjwycxsy,
zdcfsycs,
sfwwjbz, syqsfxyjxmj, mjfs, qtxxdwzlj, categoryName)
sfwwjbz, syqsfxyjxmj, mjfs, qtxxdwzlj, categoryName, zxxsdycpbs, tscchcztj, tsccsm, tsrq, bszt,
cpbsfbrq, btcpbs, sfyzcbayz)
values (#{id},
#{nameCode},
#{packRatio},
@ -751,8 +802,7 @@
#{syqsfxyjxmj},
#{mjfs},
#{qtxxdwzlj},
#{categoryName})
#{categoryName}, #{zxxsdycpbs}, #{tscchcztj}, #{tsccsm}, #{tsrq}, #{bszt}, #{cpbsfbrq}, #{btcpbs}
, #{sfyzcbayz})
</insert>
</mapper>

@ -3,20 +3,21 @@
CALL Pro_Temp_ColumnWork('ty_supplier', 'year', 'varchar(60)', 1);
INSERT IGNORE INTO scheduled(`id`, `cronName`, `cron`, `customerId`) VALUES (8, 'ybChsHcflTask', '0 0 1 * * *', NULL);
INSERT IGNORE INTO scheduled(`id`, `cronName`, `cron`, `customerId`) VALUES (9, 'ybChsHcxxGgTask', '0 0 1 * * *', NULL);
INSERT IGNORE INTO scheduled(`id`, `cronName`, `cron`, `customerId`) VALUES (10, 'ybChsHcxxTask', '0 0 1 * * *', NULL);
INSERT IGNORE INTO scheduled(`id`, `cronName`, `cron`, `customerId`)
VALUES (8, 'ybChsHcflTask', '0 0 1 * * *', NULL);
INSERT IGNORE INTO scheduled(`id`, `cronName`, `cron`, `customerId`)
VALUES (9, 'ybChsHcxxGgTask', '0 0 1 * * *', NULL);
INSERT IGNORE INTO scheduled(`id`, `cronName`, `cron`, `customerId`)
VALUES (10, 'ybChsHcxxTask', '0 0 1 * * *', NULL);
CREATE TABLE IF NOT EXISTS `yb_hcfl` (
CREATE TABLE IF NOT EXISTS `yb_hcfl`
(
`id` bigint(0) NOT NULL AUTO_INCREMENT,
`specificationCode` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NOT NULL COMMENT '医用耗材分类代码',
`specificationId` int(0) NULL DEFAULT NULL,
`catalogcode` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NULL DEFAULT NULL COMMENT '三级分类代码',
`catalogname1` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NULL DEFAULT NULL COMMENT '一级分类名称(学科,品名)',
`catalogname2` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NULL DEFAULT NULL COMMENT '二级分类名称(用途、品目)',
`catalogname3` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NULL DEFAULT NULL COMMENT '三级分类名称(部位、功能、品种)',
`commonnamecode` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NULL DEFAULT NULL COMMENT '医保通用代码',
@ -36,13 +37,18 @@ CREATE TABLE IF NOT EXISTS `yb_hcfl` (
`regCount` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NULL DEFAULT NULL,
`goodsCount` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NULL DEFAULT NULL,
PRIMARY KEY (`id`) USING BTREE,
UNIQUE INDEX `specificationCode`(`specificationCode`) USING BTREE
) ENGINE = InnoDB AUTO_INCREMENT = 26329 CHARACTER SET = utf8mb4 COLLATE = utf8mb4_0900_ai_ci COMMENT = '医保耗材分类' ROW_FORMAT = Dynamic;
UNIQUE INDEX `specificationCode` (`specificationCode`) USING BTREE
) ENGINE = InnoDB
AUTO_INCREMENT = 26329
CHARACTER SET = utf8mb4
COLLATE = utf8mb4_0900_ai_ci COMMENT = '医保耗材分类'
ROW_FORMAT = Dynamic;
-- ----------------------------
-- Table structure for yb_hcxx
-- ----------------------------
CREATE TABLE IF NOT EXISTS `yb_hcxx` (
CREATE TABLE IF NOT EXISTS `yb_hcxx`
(
`id` int(0) NOT NULL AUTO_INCREMENT,
`specificationCode` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NOT NULL COMMENT '医用耗材代码',
`hcflCodeFk` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NULL DEFAULT NULL COMMENT '耗材分类代码(外键)',
@ -71,13 +77,18 @@ CREATE TABLE IF NOT EXISTS `yb_hcxx` (
`specification` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NULL DEFAULT NULL,
`totals` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NULL DEFAULT NULL,
PRIMARY KEY (`id`) USING BTREE,
UNIQUE INDEX `specificationCode`(`specificationCode`) USING BTREE
) ENGINE = InnoDB AUTO_INCREMENT = 113462 CHARACTER SET = utf8mb4 COLLATE = utf8mb4_0900_ai_ci COMMENT = '医保耗材信息' ROW_FORMAT = Dynamic;
UNIQUE INDEX `specificationCode` (`specificationCode`) USING BTREE
) ENGINE = InnoDB
AUTO_INCREMENT = 113462
CHARACTER SET = utf8mb4
COLLATE = utf8mb4_0900_ai_ci COMMENT = '医保耗材信息'
ROW_FORMAT = Dynamic;
-- ----------------------------
-- Table structure for yb_hcxx_gg
-- ----------------------------
CREATE TABLE IF NOT EXISTS `yb_hcxx_gg` (
CREATE TABLE IF NOT EXISTS `yb_hcxx_gg`
(
`id` int(0) NOT NULL AUTO_INCREMENT,
`addTime` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NULL DEFAULT NULL COMMENT '创建时间',
`addUserId` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NULL DEFAULT NULL COMMENT '创建用户ID',
@ -119,11 +130,101 @@ CREATE TABLE IF NOT EXISTS `yb_hcxx_gg` (
`specificationCode` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NULL DEFAULT NULL COMMENT '型号规格编码C0101010010100103941',
`udiCode` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NULL DEFAULT NULL COMMENT 'udi-di',
PRIMARY KEY (`id`) USING BTREE,
UNIQUE INDEX `codeShow`(`codeShow`) USING BTREE
) ENGINE = InnoDB AUTO_INCREMENT = 4220005 CHARACTER SET = utf8mb4 COLLATE = utf8mb4_0900_ai_ci COMMENT = '医保耗材信息规格' ROW_FORMAT = Dynamic;
UNIQUE INDEX `codeShow` (`codeShow`) USING BTREE
) ENGINE = InnoDB
AUTO_INCREMENT = 4220005
CHARACTER SET = utf8mb4
COLLATE = utf8mb4_0900_ai_ci COMMENT = '医保耗材信息规格'
ROW_FORMAT = Dynamic;
SET FOREIGN_KEY_CHECKS = 1;
CALL Pro_Temp_ColumnWork('device', 'correctionNumber', 'varchar(20) NULL DEFAULT NULL COMMENT ''纠错次数''', 1);
CALL Pro_Temp_ColumnWork('device', 'correctionTime', 'varchar(60) NULL DEFAULT NULL COMMENT ''纠错时间''', 1);
CALL Pro_Temp_ColumnWork('device', 'correctionRemark', 'varchar(255) NULL DEFAULT NULL COMMENT ''纠错说明''', 1);
CALL Pro_Temp_ColumnWork('productinfo', 'zxxsdycpbs', 'varchar(120) NULL DEFAULT NULL COMMENT ''最小销售单元产品标识''', 1);
CALL Pro_Temp_ColumnWork('productinfo', 'tscchcztj', 'varchar(255) NULL DEFAULT NULL COMMENT ''特殊存储或操作条件''', 1);
CALL Pro_Temp_ColumnWork('productinfo', 'tsccsm', 'varchar(255) NULL DEFAULT NULL COMMENT ''特殊使用尺寸说明''', 1);
CALL Pro_Temp_ColumnWork('productinfo', 'tsrq', 'varchar(60) NULL DEFAULT NULL COMMENT ''医疗器械在流通领域停止销售的时间''', 1);
CALL Pro_Temp_ColumnWork('productinfo', 'bszt', 'varchar(60) NULL DEFAULT NULL COMMENT ''标识载体1一维码,2二维码3RFID4其他''',
1);
CALL Pro_Temp_ColumnWork('productinfo', 'cpbsfbrq', 'varchar(20) NULL DEFAULT NULL COMMENT ''标识发布时间;格式:2019-09-1''', 1);
CALL Pro_Temp_ColumnWork('productinfo', 'btcpbs', 'varchar(120) NULL DEFAULT NULL COMMENT ''本体标识医疗器械本体标识中的产品标识''', 1);
CALL Pro_Temp_ColumnWork('productinfo', 'sfyzcbayz', 'varchar(10) NULL DEFAULT NULL COMMENT ''是否与注册/备案标识一致1是0否''', 1);
CREATE TABLE IF NOT EXISTS `di_product`
(
`id` int NOT NULL AUTO_INCREMENT,
`key` bigint NOT NULL COMMENT '唯一键',
`cpmctymc` varchar(100) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NULL DEFAULT NULL COMMENT '产品名称,通用名称',
`flbm` varchar(20) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NULL DEFAULT NULL COMMENT '分类编码',
`tyshxydm` varchar(100) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NULL DEFAULT NULL COMMENT '统一社会信用代码证号',
`ylqxzcrbarmc` varchar(150) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NULL DEFAULT NULL COMMENT '注册/备案人名称',
`ylqxzcrbarywmc` varchar(150) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NULL DEFAULT NULL COMMENT '注册/备案人名称英文名称',
`spmc` varchar(100) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NULL DEFAULT NULL COMMENT '商品名称',
`cplx` varchar(40) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NULL DEFAULT NULL COMMENT '产品类型(器械类别)',
`hchzsb` varchar(20) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NULL DEFAULT NULL COMMENT '耗材或者设备(产品类别)',
`remark` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NULL DEFAULT NULL COMMENT '备注',
`createTime` datetime(0) NULL DEFAULT NULL COMMENT '创建时间',
`updateTime` datetime(0) NULL DEFAULT NULL COMMENT '更新时间',
PRIMARY KEY (`id`) USING BTREE,
UNIQUE INDEX `product` (`cpmctymc`, `tyshxydm`) USING BTREE,
INDEX `cpmctymc` (`cpmctymc`) USING BTREE,
INDEX `ylqxzcrbarmc` (`ylqxzcrbarmc`) USING BTREE
) ENGINE = InnoDB
AUTO_INCREMENT = 54
CHARACTER SET = utf8mb4
COLLATE = utf8mb4_0900_ai_ci
ROW_FORMAT = DYNAMIC;
SET FOREIGN_KEY_CHECKS = 1;
CREATE TABLE IF NOT EXISTS `di_product_spec`
(
`id` int NOT NULL AUTO_INCREMENT,
`key` bigint NULL DEFAULT NULL,
`productKey` bigint NULL DEFAULT NULL COMMENT '产品KEY外键',
`deviceRecordKey` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NULL DEFAULT NULL COMMENT '数据库记录key国家库',
`zxxsdycpbs` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NULL DEFAULT NULL COMMENT '最小销售单元产品标识',
`ggxh` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NULL DEFAULT NULL COMMENT '规格型号',
`sydycpbs` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NULL DEFAULT NULL COMMENT '使用单元产品标识',
`versionNumber` int NULL DEFAULT NULL COMMENT '历史版本号,最高为最新',
`ybbm` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NULL DEFAULT NULL COMMENT '医保编码',
`scbssfbhph` varchar(10) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NULL DEFAULT NULL COMMENT '是否包含批号',
`scbssfbhxlh` varchar(10) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NULL DEFAULT NULL COMMENT '是否包含序列号',
`scbssfbhscrq` varchar(10) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NULL DEFAULT NULL COMMENT '是否包含生产日期',
`scbssfbhsxrq` varchar(10) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NULL DEFAULT NULL COMMENT '是否包含失效日期',
`cpms` text CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NULL COMMENT '产品描述',
`sfwblztlcp` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NULL DEFAULT NULL COMMENT '是否为包类产品/组套类产品; 1 是 0 否',
`cgzmraqxgxx` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NULL DEFAULT NULL COMMENT '共振MR 安全相关信息; 0 安全 1 条件安全, 28\n不安全 3 说明书或标签上面不包括 MR 安全信息',
`sfbjwycxsy` varchar(10) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NULL DEFAULT NULL COMMENT '标记为一次性使用:0 否, 1 是',
`qtxxdwzlj` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NULL DEFAULT NULL COMMENT '其他信息的网址链接',
`tscchcztj` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NULL DEFAULT NULL COMMENT '特殊存储或操作条件',
`tsccsm` varchar(512) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NULL DEFAULT NULL COMMENT '特殊使用尺寸说明',
`tsrq` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NULL DEFAULT NULL COMMENT '医疗器械在流通领域停止销售的时间',
`bszt` varchar(20) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NULL DEFAULT NULL COMMENT '标识载体1 一维码,2 二维码3 RFID4 其他',
`cpbsfbrq` varchar(20) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NULL DEFAULT NULL COMMENT '标识发布时间;格式:2019-09-12',
`btcpbs` varchar(20) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NULL DEFAULT NULL COMMENT '本体标识医疗器械本体标识中的产品标识',
`sfyzcbayz` varchar(10) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NULL DEFAULT NULL COMMENT '是否包含本体标识: 1 是 0 否',
`cpbsbmtxmc` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NULL DEFAULT NULL COMMENT '产品标识编码体系名称,如 GS1MA 码IDcode',
`zdcfsycs` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NULL DEFAULT NULL COMMENT '最大重复使用次数',
`sfwwjbz` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NULL DEFAULT NULL COMMENT '是否为已灭菌产品:1 是 0 否',
`syqsfxyjxmj` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NULL DEFAULT NULL COMMENT '使用前是否需要进行灭菌:1 是 0 否',
`mjfs` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NULL DEFAULT NULL COMMENT '灭菌方式',
`hchzsb` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NULL DEFAULT NULL COMMENT '耗材或者设备(产品类别)',
`remark` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NULL DEFAULT NULL COMMENT '备注',
`createTime` datetime(0) NULL DEFAULT NULL COMMENT '创建时间',
`udpateTime` datetime(0) NULL DEFAULT NULL ON UPDATE CURRENT_TIMESTAMP(0) COMMENT '更新时间',
PRIMARY KEY (`id`) USING BTREE,
UNIQUE INDEX `zxxsdycpbs` (`zxxsdycpbs`) USING BTREE
) ENGINE = InnoDB
AUTO_INCREMENT = 440
CHARACTER SET = utf8mb4
COLLATE = utf8mb4_0900_ai_ci
ROW_FORMAT = DYNAMIC;
SET FOREIGN_KEY_CHECKS = 1;

Loading…
Cancel
Save