|
|
@ -18,7 +18,7 @@ import com.glxp.api.res.auth.AuthAdminResponse;
|
|
|
|
import com.glxp.api.res.basic.BasicUdiRelResponse;
|
|
|
|
import com.glxp.api.res.basic.BasicUdiRelResponse;
|
|
|
|
import com.glxp.api.res.basic.UdiRelevanceResponse;
|
|
|
|
import com.glxp.api.res.basic.UdiRelevanceResponse;
|
|
|
|
import com.glxp.api.service.auth.CustomerService;
|
|
|
|
import com.glxp.api.service.auth.CustomerService;
|
|
|
|
import com.glxp.api.service.basic.BasicUdiRelService;
|
|
|
|
import com.glxp.api.service.basic.*;
|
|
|
|
import io.swagger.annotations.Api;
|
|
|
|
import io.swagger.annotations.Api;
|
|
|
|
import io.swagger.annotations.ApiOperation;
|
|
|
|
import io.swagger.annotations.ApiOperation;
|
|
|
|
import lombok.Data;
|
|
|
|
import lombok.Data;
|
|
|
@ -34,9 +34,6 @@ import com.glxp.api.common.res.BaseResponse;
|
|
|
|
import com.glxp.api.common.util.ResultVOUtils;
|
|
|
|
import com.glxp.api.common.util.ResultVOUtils;
|
|
|
|
import com.glxp.api.constant.AsyncDiDlHelper;
|
|
|
|
import com.glxp.api.constant.AsyncDiDlHelper;
|
|
|
|
import com.glxp.api.res.PageSimpleResponse;
|
|
|
|
import com.glxp.api.res.PageSimpleResponse;
|
|
|
|
import com.glxp.api.service.basic.ProductInfoService;
|
|
|
|
|
|
|
|
import com.glxp.api.service.basic.SyncUdiService;
|
|
|
|
|
|
|
|
import com.glxp.api.service.basic.UdiCompanyService;
|
|
|
|
|
|
|
|
import com.glxp.api.util.udi.FilterUdiUtils;
|
|
|
|
import com.glxp.api.util.udi.FilterUdiUtils;
|
|
|
|
|
|
|
|
|
|
|
|
import cn.hutool.core.util.StrUtil;
|
|
|
|
import cn.hutool.core.util.StrUtil;
|
|
|
@ -61,6 +58,8 @@ public class UdiSyncController extends BaseController {
|
|
|
|
BasicUdiRelService basicUdiRelService;
|
|
|
|
BasicUdiRelService basicUdiRelService;
|
|
|
|
@Resource
|
|
|
|
@Resource
|
|
|
|
CustomerService customerService;
|
|
|
|
CustomerService customerService;
|
|
|
|
|
|
|
|
@Resource
|
|
|
|
|
|
|
|
BasicUdiProductService basicUdiProductService;
|
|
|
|
|
|
|
|
|
|
|
|
//获取同步库UDI信息
|
|
|
|
//获取同步库UDI信息
|
|
|
|
@ApiIgnore
|
|
|
|
@ApiIgnore
|
|
|
@ -154,6 +153,7 @@ public class UdiSyncController extends BaseController {
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
//产品信息关联新增
|
|
|
|
//产品信息关联新增
|
|
|
|
|
|
|
|
@ApiIgnore
|
|
|
|
@AuthRuleAnnotation("")
|
|
|
|
@AuthRuleAnnotation("")
|
|
|
|
@ApiOperation(value = "注册企业新增医疗器械信息", response = BaseResponse.class)
|
|
|
|
@ApiOperation(value = "注册企业新增医疗器械信息", response = BaseResponse.class)
|
|
|
|
@PostMapping("udi/basic/rel/save")
|
|
|
|
@PostMapping("udi/basic/rel/save")
|
|
|
@ -174,15 +174,29 @@ public class UdiSyncController extends BaseController {
|
|
|
|
@PostMapping("udi/basic/rel/batch/save")
|
|
|
|
@PostMapping("udi/basic/rel/batch/save")
|
|
|
|
public BaseResponse batchSaveRel(@RequestBody UdiSelectRequest udiSelectRequest) {
|
|
|
|
public BaseResponse batchSaveRel(@RequestBody UdiSelectRequest udiSelectRequest) {
|
|
|
|
String userId = customerService.getUserId() + "";
|
|
|
|
String userId = customerService.getUserId() + "";
|
|
|
|
if (CollUtil.isNotEmpty(udiSelectRequest.getKeys())) {
|
|
|
|
if (CollUtil.isNotEmpty(udiSelectRequest.getProducts())) {
|
|
|
|
for (String uuid : udiSelectRequest.getKeys()) {
|
|
|
|
for (BasicUdiRelRequest basicUdiRelRequest : udiSelectRequest.getProducts()) {
|
|
|
|
BasicUdiRelEntity basicUdiRelEntity = new BasicUdiRelEntity();
|
|
|
|
if (!basicUdiRelService.isExit(basicUdiRelRequest.getUuid(), udiSelectRequest.getCompanyId())) {
|
|
|
|
basicUdiRelEntity.setUuid(uuid);
|
|
|
|
BasicUdiRelEntity basicUdiRelEntity = new BasicUdiRelEntity();
|
|
|
|
basicUdiRelEntity.setCompanyIdFk(udiSelectRequest.getCompanyId());
|
|
|
|
basicUdiRelEntity.setUuid(basicUdiRelRequest.getUuid());
|
|
|
|
basicUdiRelEntity.setUpdateTime(new Date());
|
|
|
|
basicUdiRelEntity.setCompanyIdFk(udiSelectRequest.getCompanyId());
|
|
|
|
basicUdiRelEntity.setUpdateUser(userId);
|
|
|
|
basicUdiRelEntity.setUpdateTime(new Date());
|
|
|
|
basicUdiRelEntity.setId(IdUtil.getSnowflakeNextId());
|
|
|
|
basicUdiRelEntity.setUpdateUser(userId);
|
|
|
|
basicUdiRelService.save(basicUdiRelEntity);
|
|
|
|
basicUdiRelEntity.setId(IdUtil.getSnowflakeNextId());
|
|
|
|
|
|
|
|
basicUdiRelService.save(basicUdiRelEntity);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
List<ProductInfoEntity> productInfoEntities = productInfoService.selectByUuid(basicUdiRelRequest.getUuid());
|
|
|
|
|
|
|
|
if (CollUtil.isNotEmpty(productInfoEntities)) {
|
|
|
|
|
|
|
|
for (ProductInfoEntity productInfoEntity : productInfoEntities) {
|
|
|
|
|
|
|
|
// basicUdiProductService
|
|
|
|
|
|
|
|
BasicUdiProductEntity basicUdiProductEntity = new BasicUdiProductEntity();
|
|
|
|
|
|
|
|
BeanUtils.copyProperties(productInfoEntity, basicUdiProductEntity);
|
|
|
|
|
|
|
|
basicUdiProductEntity.setId(IdUtil.getSnowflakeNextId());
|
|
|
|
|
|
|
|
basicUdiProductService.save(basicUdiProductEntity);
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
return ResultVOUtils.success("添加成功!");
|
|
|
|
return ResultVOUtils.success("添加成功!");
|
|
|
@ -198,7 +212,10 @@ public class UdiSyncController extends BaseController {
|
|
|
|
//产品信息关联修改
|
|
|
|
//产品信息关联修改
|
|
|
|
@AuthRuleAnnotation("")
|
|
|
|
@AuthRuleAnnotation("")
|
|
|
|
@PostMapping("udi/basic/rel/update")
|
|
|
|
@PostMapping("udi/basic/rel/update")
|
|
|
|
public BaseResponse updateRel(@RequestBody BasicUdiRelEntity basicUdiRelEntity) {
|
|
|
|
public BaseResponse updateRel(@RequestBody BasicUdiRelRequest basicUdiRelRequest) {
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
BasicUdiRelEntity basicUdiRelEntity = new BasicUdiRelEntity();
|
|
|
|
|
|
|
|
BeanUtils.copyProperties(basicUdiRelRequest, basicUdiRelEntity);
|
|
|
|
basicUdiRelEntity.setUpdateTime(new Date());
|
|
|
|
basicUdiRelEntity.setUpdateTime(new Date());
|
|
|
|
basicUdiRelEntity.setUpdateUser(customerService.getUserId() + "");
|
|
|
|
basicUdiRelEntity.setUpdateUser(customerService.getUserId() + "");
|
|
|
|
basicUdiRelService.updateById(basicUdiRelEntity);
|
|
|
|
basicUdiRelService.updateById(basicUdiRelEntity);
|
|
|
|