fix: 修复

dev_drug
chenhc 1 month ago
parent c525ac090f
commit b399225f27

@ -4,6 +4,8 @@ import cn.hutool.core.bean.BeanUtil;
import cn.hutool.core.collection.CollUtil;
import cn.hutool.core.util.IdUtil;
import cn.hutool.core.util.StrUtil;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.github.pagehelper.PageInfo;
import com.glxp.api.annotation.AuthRuleAnnotation;
import com.glxp.api.annotation.Log;
@ -12,7 +14,9 @@ import com.glxp.api.common.util.ResultVOUtils;
import com.glxp.api.constant.*;
import com.glxp.api.controller.BaseController;
import com.glxp.api.controller.sync.SpsSyncWebSocket;
import com.glxp.api.dao.basic.BasicProductsRegistrationCertDao;
import com.glxp.api.dto.BasicProductsCreateDto;
import com.glxp.api.entity.basic.BasicProductsRegistrationCertEntity;
import com.glxp.api.entity.basic.ProductInfoEntity;
import com.glxp.api.entity.basic.UdiProductEntity;
import com.glxp.api.entity.basic.UdiRelevanceEntity;
@ -79,6 +83,8 @@ public class UdiContrastController extends BaseController{
@Resource
SpsSyncWebSocket webSocketServer;
@Resource
BasicProductsRegistrationCertDao registrationCertDao;
/**
*
@ -438,6 +444,16 @@ public class UdiContrastController extends BaseController{
List<DiLevelResponse> diLevelResponses = udiProductService.findLevelByRelId(filterUdiRelRequest.getId());
return ResultVOUtils.success(diLevelResponses);
}
/**
* DI
*/
@AuthRuleAnnotation("")
@GetMapping("/udiwms/udi/local/getzczbhhzbapzbhs")
public BaseResponse getzczbhhzbapzbhs(FilterUdiRelRequest filterUdiRelRequest) {
List<BasicProductsRegistrationCertEntity> basicProductsRegistrationCertEntities = registrationCertDao.selectList
(new QueryWrapper<BasicProductsRegistrationCertEntity>().eq("nameCode", filterUdiRelRequest.getNameCode()));
return ResultVOUtils.success(basicProductsRegistrationCertEntities);
}
public void updateDi(UdiRelevanceEntity udiRelevanceEntity, String key) {
List<UdiProductEntity> udiInfoEntities = udiDlHttpClient.getOrUpdateByUuid(key);

@ -406,6 +406,7 @@ public class UdiRelevanceController extends BaseController {
udiProductEntity.setRequireScanCode(udiRelevanceSaveRequest.getRequireScanCode());
udiProductEntity.setFlbm(udiRelevanceSaveRequest.getFlbm());
udiProductEntity.setWorkPlaceCount(udiRelevanceSaveRequest.getWorkPlaceCount());
udiProductEntity.setZczbhhzbapzbhSys(udiRelevanceSaveRequest.getZczbhhzbapzbhSys());
udiProductEntity.setUpdateTime(new Date());
// udiProductEntity = UdiInfoUtil.initUdiInfoEntity(udiProductEntity);
if (StrUtil.isNotEmpty(udiRelevanceSaveRequest.getOriginUuid())) {

@ -3,14 +3,19 @@ package com.glxp.api.controller.basic;
import cn.hutool.core.bean.BeanUtil;
import cn.hutool.core.collection.CollUtil;
import cn.hutool.core.util.StrUtil;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.github.pagehelper.Page;
import com.github.pagehelper.PageInfo;
import com.glxp.api.annotation.AuthRuleAnnotation;
import com.glxp.api.common.res.BaseResponse;
import com.glxp.api.common.util.ResultVOUtils;
import com.glxp.api.constant.AsyncDiDlHelper;
import com.glxp.api.controller.BaseController;
import com.glxp.api.dao.basic.BasicProductsRegistrationCertDao;
import com.glxp.api.dto.DictDto;
import com.glxp.api.entity.basic.*;
import com.glxp.api.entity.dev.DeviceInfoEntity;
import com.glxp.api.req.basic.*;
import com.glxp.api.res.PageSimpleResponse;
import com.glxp.api.service.basic.*;
@ -22,6 +27,7 @@ import org.springframework.web.bind.annotation.RestController;
import javax.annotation.Resource;
import java.util.ArrayList;
import java.util.Date;
import java.util.List;
import java.util.stream.Collectors;
@ -30,7 +36,7 @@ import java.util.stream.Collectors;
*/
@Slf4j
@RestController
public class UdiSyncController {
public class UdiSyncController extends BaseController {
@Resource
UdiRelevanceService udiRelevanceService;
@ -44,6 +50,8 @@ public class UdiSyncController {
ProductInfoService productInfoService;
@Resource
UdiCompanyService udiCompanyService;
@Resource
BasicProductsRegistrationCertDao registrationCertDao;
//获取同步库UDI信息
@ -224,6 +232,8 @@ public class UdiSyncController {
List<ProductInfoEntity> productInfoEntityList = listBaseResponse.getData();
if (CollUtil.isNotEmpty(productInfoEntityList)) {
productInfoService.insertProductInfos(productInfoEntityList);
//处理注册证插入
handleRegistrationCert(productInfoEntityList);
udiDlDeviceResponse = syncUdiService.filterUdi(productInfoFilterRequest);
} else {
ResultVOUtils.error(500, "未查询到该产品DI");
@ -266,6 +276,37 @@ public class UdiSyncController {
}
}
private void handleRegistrationCert(List<ProductInfoEntity> productInfoEntityList) {
for (int i = 0; i < productInfoEntityList.size(); i++) {
ProductInfoEntity productInfoEntity = productInfoEntityList.get(i);
String zczbhhzbapzbh = productInfoEntity.getZczbhhzbapzbh();
if (StrUtil.isNotEmpty(zczbhhzbapzbh)){
// 使用逗号作为分隔符进行分割
String[] parts = zczbhhzbapzbh.split(",");
// 将结果转换为一个列表如果你需要使用List类型
java.util.List<String> resultList = java.util.Arrays.asList(parts);
List<BasicProductsRegistrationCertEntity> adds = new ArrayList<>();
BasicProductsRegistrationCertEntity oBean = new BasicProductsRegistrationCertEntity();
oBean.setUuid(productInfoEntity.getUuid());
oBean.setNameCode(productInfoEntity.getNameCode());
oBean.setCreateUser(String.valueOf(getUser().getId()));
oBean.setCreateTime(new Date());
resultList.forEach( item -> {
BasicProductsRegistrationCertEntity addBean = new BasicProductsRegistrationCertEntity();
BeanUtils.copyProperties(oBean,addBean);
addBean.setZczbhhzbapzbh(item);
adds.add(addBean);
});
//删除当前已保存的 nameCode 的证书列表
registrationCertDao.delete(new QueryWrapper<BasicProductsRegistrationCertEntity>().eq("nameCode", productInfoEntity.getNameCode()));
//进行批量保存
registrationCertDao.insertBatch(adds);
}
}
}
@AuthRuleAnnotation("")
@GetMapping("/udiwms/basic/instrument/maintain/filterProduct")
public BaseResponse filterProduct(FilterUdiRelRequest filterUdiRelRequest) {

@ -0,0 +1,10 @@
package com.glxp.api.dao.basic;
import com.glxp.api.dao.BaseMapperPlus;
import com.glxp.api.entity.basic.BasicBusTypeChangeEntity;
import com.glxp.api.entity.basic.BasicProductsRegistrationCertEntity;
import org.apache.ibatis.annotations.Mapper;
@Mapper
public interface BasicProductsRegistrationCertDao extends BaseMapperPlus<BasicProductsRegistrationCertDao, BasicProductsRegistrationCertEntity, BasicProductsRegistrationCertEntity> {
}

@ -0,0 +1,49 @@
package com.glxp.api.entity.basic;
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.ApiModelProperty;
import lombok.Data;
import java.math.BigDecimal;
import java.util.Date;
@Data
@TableName(value = "basic_products_registration_cert")
public class BasicProductsRegistrationCertEntity {
@TableId(value = "id", type = IdType.INPUT)
private Long id;
/**
* UUID
*/
@TableField(value = "uuid")
private String uuid;
/**
*
*/
@TableField(value = "nameCode")
private String nameCode;
/**
* "/
*/
@TableField(value = "zczbhhzbapzbh")
private String zczbhhzbapzbh;
/**
*
*/
@TableField(value = "createTime")
private Date createTime;
/**
*
*/
@TableField(value = "createUser")
private String createUser;
}

@ -350,6 +350,9 @@ public class UdiProductEntity {
// @TableField(value = "detailSort")
// private Integer detailSort;
@TableField(value = "zczbhhzbapzbhSys")
private String zczbhhzbapzbhSys;
public Integer getMyBhxjsl() {
if (bhxjsl == null || bhxjsl == 0)
return 1;

@ -166,6 +166,7 @@ public class UdiRelevanceSaveRequest {
private Integer distributeLevelCount;
private String useLevelDi;
private String useLevelUnit;
private String zczbhhzbapzbhSys;
private Integer useLeverCount;
private Integer useLevel;
private Integer distributeLevel;

@ -335,4 +335,6 @@ public class UdiRelevanceResponse {
*/
private Integer detailSort;
private String zczbhhzbapzbhSys;
}

@ -0,0 +1,8 @@
<?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd" >
<mapper namespace="com.glxp.api.dao.basic.BasicProductsRegistrationCertDao">
</mapper>

@ -600,6 +600,9 @@
<if test="zczbhhzbapzbh != null">
zczbhhzbapzbh=#{zczbhhzbapzbh},
</if>
<if test="zczbhhzbapzbhSys != null">
zczbhhzbapzbhSys=#{zczbhhzbapzbhSys},
</if>
<if test="ylqxzcrbarywmc != null">
ylqxzcrbarywmc=#{ylqxzcrbarywmc},
</if>

@ -434,6 +434,7 @@
basic_products.tyshxydm,
basic_products.ylqxzcrbarmc,
basic_products.zczbhhzbapzbh,
basic_products.zczbhhzbapzbhSys,
basic_products.ylqxzcrbarywmc,
basic_products.sydycpbs,
basic_products.sjcpbm,

@ -1280,3 +1280,20 @@ INSERT ignore INTO `sys_param_config` (`id`, `parentId`, `paramName`, `paramKey
VALUES (20101, 0, '新增送货单立即提交前置通过参数设置', 'create_order_pass_type', '3', 1, 0, '1必须全部扫齐才可以通过 2必须选择了马上放心才能提交 3必须有码才可以', NULL);
INSERT ignore INTO `sys_param_config`(`id`, `parentId`, `paramName`, `paramKey`, `paramValue`, `paramStatus`, `paramType`, `paramExplain`, `updateTime`) VALUES (90001, 0, '是否调用阿里关联关系模式', 'aliRelCodeDetail', '1', 1, 1, '值为0 是关闭 1是开启',now());
CREATE TABLE IF NOT EXISTS `basic_products_registration_cert` (
`id` bigint NOT NULL AUTO_INCREMENT,
`uuid` varchar(60) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci DEFAULT NULL COMMENT 'UUID',
`nameCode` varchar(60) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci DEFAULT NULL COMMENT '最小销售产品标识',
`zczbhhzbapzbh` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci DEFAULT NULL COMMENT '"注册/备案证号,',
`createTime` datetime DEFAULT NULL COMMENT '创建时间',
`createUser` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci DEFAULT NULL COMMENT '创建人',
PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=1 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci;
CALL Pro_Temp_ColumnWork('basic_products', 'zczbhhzbapzbhSys',
'varchar(60) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci DEFAULT NULL COMMENT ''注册/备案证号系统使用''',
1);
Loading…
Cancel
Save