|
|
|
@ -3,6 +3,7 @@ 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.github.pagehelper.PageInfo;
|
|
|
|
|
import com.glxp.api.annotation.AuthRuleAnnotation;
|
|
|
|
|
import com.glxp.api.annotation.Log;
|
|
|
|
@ -16,6 +17,7 @@ import com.glxp.api.constant.SyncDelType;
|
|
|
|
|
import com.glxp.api.controller.BaseController;
|
|
|
|
|
import com.glxp.api.controller.sync.SpsSyncWebSocket;
|
|
|
|
|
import com.glxp.api.dao.basic.UdiRelevanceDao;
|
|
|
|
|
import com.glxp.api.dao.thrsys.YbDrugMapper;
|
|
|
|
|
import com.glxp.api.dto.DictDto;
|
|
|
|
|
import com.glxp.api.entity.basic.*;
|
|
|
|
|
import com.glxp.api.entity.sync.SocketMsgEntity;
|
|
|
|
@ -23,6 +25,7 @@ import com.glxp.api.entity.system.SystemParamConfigEntity;
|
|
|
|
|
import com.glxp.api.entity.thrsys.CodeRel;
|
|
|
|
|
import com.glxp.api.entity.thrsys.ThrProductsEntity;
|
|
|
|
|
import com.glxp.api.entity.thrsys.ThrSystemEntity;
|
|
|
|
|
import com.glxp.api.entity.thrsys.YbDrug;
|
|
|
|
|
import com.glxp.api.httpClient.serviceClient.ErpBasicClient;
|
|
|
|
|
import com.glxp.api.req.basic.*;
|
|
|
|
|
import com.glxp.api.req.system.DeleteRequest;
|
|
|
|
@ -39,6 +42,7 @@ import com.glxp.api.service.inv.InvProductService;
|
|
|
|
|
import com.glxp.api.service.system.SystemParamConfigService;
|
|
|
|
|
import com.glxp.api.service.thrsys.ThrDataService;
|
|
|
|
|
import com.glxp.api.service.thrsys.ThrSystemService;
|
|
|
|
|
import com.glxp.api.util.IntUtil;
|
|
|
|
|
import com.glxp.api.util.udi.FilterUdiUtils;
|
|
|
|
|
import org.springframework.beans.BeanUtils;
|
|
|
|
|
import org.springframework.validation.BindingResult;
|
|
|
|
@ -83,8 +87,7 @@ public class UdiRelevanceController extends BaseController {
|
|
|
|
|
//手持终端下载UDI产品信息
|
|
|
|
|
@AuthRuleAnnotation("")
|
|
|
|
|
@GetMapping("/udi/udirel/download")
|
|
|
|
|
public BaseResponse downloadProducts(FilterUdiRelRequest filterUdiRelRequest,
|
|
|
|
|
BindingResult bindingResult) {
|
|
|
|
|
public BaseResponse downloadProducts(FilterUdiRelRequest filterUdiRelRequest, BindingResult bindingResult) {
|
|
|
|
|
|
|
|
|
|
if (bindingResult.hasErrors()) {
|
|
|
|
|
return ResultVOUtils.error(ResultEnum.PARAM_VERIFY_FALL, bindingResult.getFieldError().getDefaultMessage());
|
|
|
|
@ -100,8 +103,7 @@ public class UdiRelevanceController extends BaseController {
|
|
|
|
|
|
|
|
|
|
@AuthRuleAnnotation("")
|
|
|
|
|
@GetMapping("/udi/udirel/mutil/download")
|
|
|
|
|
public BaseResponse downloadMutilProducts(FilterUdiRelRequest filterUdiRelRequest,
|
|
|
|
|
BindingResult bindingResult) {
|
|
|
|
|
public BaseResponse downloadMutilProducts(FilterUdiRelRequest filterUdiRelRequest, BindingResult bindingResult) {
|
|
|
|
|
|
|
|
|
|
if (bindingResult.hasErrors()) {
|
|
|
|
|
return ResultVOUtils.error(ResultEnum.PARAM_VERIFY_FALL, bindingResult.getFieldError().getDefaultMessage());
|
|
|
|
@ -126,8 +128,7 @@ public class UdiRelevanceController extends BaseController {
|
|
|
|
|
//基础信息-耗材字典-查询页面、业务单据-选入耗材字典-查询页面
|
|
|
|
|
@AuthRuleAnnotation("")
|
|
|
|
|
@GetMapping("/udi/udirel/filterUdi")
|
|
|
|
|
public BaseResponse filterUdiGp(FilterUdiRelRequest filterUdiRelRequest,
|
|
|
|
|
BindingResult bindingResult) {
|
|
|
|
|
public BaseResponse filterUdiGp(FilterUdiRelRequest filterUdiRelRequest, BindingResult bindingResult) {
|
|
|
|
|
if (bindingResult.hasErrors()) {
|
|
|
|
|
return ResultVOUtils.error(ResultEnum.PARAM_VERIFY_FALL, bindingResult.getFieldError().getDefaultMessage());
|
|
|
|
|
}
|
|
|
|
@ -156,7 +157,16 @@ public class UdiRelevanceController extends BaseController {
|
|
|
|
|
} else {
|
|
|
|
|
filterUdiRelRequest.setDiType(1);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
List<UdiRelevanceResponse> udiRelevanceResponses = udiRelevanceService.filterUdiGp(filterUdiRelRequest);
|
|
|
|
|
|
|
|
|
|
if (IntUtil.value(filterUdiRelRequest.getMiniApp())) {
|
|
|
|
|
for (UdiRelevanceResponse udiRelevanceResponse : udiRelevanceResponses) {
|
|
|
|
|
YbDrug ybDrug = ybDrugMapper.selectOne(new LambdaQueryWrapper<YbDrug>().eq(YbDrug::getGoodsCode, udiRelevanceResponse.getYbbm()).last("limit 1"));
|
|
|
|
|
if (ybDrug != null)
|
|
|
|
|
udiRelevanceResponse.setYbUnit(ybDrug.getFactor() + "/" + ybDrug.getUnit() + "/" + ybDrug.getMinUnit());
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
PageInfo<UdiRelevanceResponse> pageInfo = new PageInfo<>(udiRelevanceResponses);
|
|
|
|
|
PageSimpleResponse<UdiRelevanceResponse> pageSimpleResponse = new PageSimpleResponse<>();
|
|
|
|
|
pageSimpleResponse.setTotal(pageInfo.getTotal());
|
|
|
|
@ -164,12 +174,13 @@ public class UdiRelevanceController extends BaseController {
|
|
|
|
|
return ResultVOUtils.success(pageSimpleResponse);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
@Resource
|
|
|
|
|
YbDrugMapper ybDrugMapper;
|
|
|
|
|
|
|
|
|
|
//供应商器械信息选入
|
|
|
|
|
@AuthRuleAnnotation("")
|
|
|
|
|
@GetMapping("/udi/udirel/filterSmUdi")
|
|
|
|
|
public BaseResponse filterSmUdi(FilterUdiRelRequest filterUdiRelRequest,
|
|
|
|
|
BindingResult bindingResult) {
|
|
|
|
|
public BaseResponse filterSmUdi(FilterUdiRelRequest filterUdiRelRequest, BindingResult bindingResult) {
|
|
|
|
|
|
|
|
|
|
if (bindingResult.hasErrors()) {
|
|
|
|
|
return ResultVOUtils.error(ResultEnum.PARAM_VERIFY_FALL, bindingResult.getFieldError().getDefaultMessage());
|
|
|
|
@ -196,8 +207,7 @@ public class UdiRelevanceController extends BaseController {
|
|
|
|
|
udiRelevanceResponses = udiRelevanceService.filterUdiGp(filterUdiRelRequest);
|
|
|
|
|
if (udiRelevanceResponses != null && udiRelevanceResponses.size() > 0) {
|
|
|
|
|
for (UdiRelevanceResponse udiRelevanceResponse : udiRelevanceResponses) {
|
|
|
|
|
UdiRlSupEntity companyProductRelevanceEntity =
|
|
|
|
|
udiRlSupService.findCompanyProductRelevanceByUdiRlIdFk(udiRelevanceResponse.getId() + "", filterUdiRelRequest.getCustomerId());
|
|
|
|
|
UdiRlSupEntity companyProductRelevanceEntity = udiRlSupService.findCompanyProductRelevanceByUdiRlIdFk(udiRelevanceResponse.getId() + "", filterUdiRelRequest.getCustomerId());
|
|
|
|
|
if (companyProductRelevanceEntity != null) {
|
|
|
|
|
udiRelevanceResponse.setIsSelect(true);
|
|
|
|
|
} else {
|
|
|
|
@ -504,8 +514,7 @@ public class UdiRelevanceController extends BaseController {
|
|
|
|
|
if (!udiCombineRequest.getSupEnable()) {
|
|
|
|
|
errMsg = basicUpdateProductService.addLocalProduct(udiCombineRequest);
|
|
|
|
|
}
|
|
|
|
|
if (StrUtil.isEmpty(errMsg))
|
|
|
|
|
return ResultVOUtils.success("添加成功!");
|
|
|
|
|
if (StrUtil.isEmpty(errMsg)) return ResultVOUtils.success("添加成功!");
|
|
|
|
|
else {
|
|
|
|
|
return ResultVOUtils.error(500, errMsg);
|
|
|
|
|
}
|
|
|
|
@ -531,8 +540,7 @@ public class UdiRelevanceController extends BaseController {
|
|
|
|
|
//获取产品信息详情(多平台)
|
|
|
|
|
@AuthRuleAnnotation("")
|
|
|
|
|
@GetMapping("/udiwms/udirel/thirdSys/filter")
|
|
|
|
|
public BaseResponse getThirdSysfilter(FilterUdiRelRequest filterUdiRelRequest,
|
|
|
|
|
BindingResult bindingResult) {
|
|
|
|
|
public BaseResponse getThirdSysfilter(FilterUdiRelRequest filterUdiRelRequest, BindingResult bindingResult) {
|
|
|
|
|
|
|
|
|
|
if (bindingResult.hasErrors()) {
|
|
|
|
|
return ResultVOUtils.error(ResultEnum.PARAM_VERIFY_FALL, bindingResult.getFieldError().getDefaultMessage());
|
|
|
|
@ -561,8 +569,7 @@ public class UdiRelevanceController extends BaseController {
|
|
|
|
|
//获取产品信息详情(多平台)
|
|
|
|
|
@AuthRuleAnnotation("")
|
|
|
|
|
@GetMapping("/udiwms/udirel/thirdSys/filterOptimize")
|
|
|
|
|
public BaseResponse getThirdSysfilterOptimize(FilterUdiRelRequest filterUdiRelRequest,
|
|
|
|
|
BindingResult bindingResult) {
|
|
|
|
|
public BaseResponse getThirdSysfilterOptimize(FilterUdiRelRequest filterUdiRelRequest, BindingResult bindingResult) {
|
|
|
|
|
|
|
|
|
|
if (bindingResult.hasErrors()) {
|
|
|
|
|
return ResultVOUtils.error(ResultEnum.PARAM_VERIFY_FALL, bindingResult.getFieldError().getDefaultMessage());
|
|
|
|
@ -592,8 +599,7 @@ public class UdiRelevanceController extends BaseController {
|
|
|
|
|
//获取对照过滤列表
|
|
|
|
|
@AuthRuleAnnotation("")
|
|
|
|
|
@GetMapping("/udiwms/udirel/thirdSys/detail")
|
|
|
|
|
public BaseResponse getThirdSysDetail(FilterUdiRelRequest filterUdiRelRequest,
|
|
|
|
|
BindingResult bindingResult) {
|
|
|
|
|
public BaseResponse getThirdSysDetail(FilterUdiRelRequest filterUdiRelRequest, BindingResult bindingResult) {
|
|
|
|
|
|
|
|
|
|
if (bindingResult.hasErrors()) {
|
|
|
|
|
return ResultVOUtils.error(ResultEnum.PARAM_VERIFY_FALL, bindingResult.getFieldError().getDefaultMessage());
|
|
|
|
|