物资字典代码迁移,新增国家库同步到外网查询

master
anthonywj 2 years ago
parent a0d6f3cc06
commit bd7fd9691a

@ -4,12 +4,16 @@ import cn.hutool.core.collection.CollUtil;
import cn.hutool.core.util.StrUtil;
import com.github.pagehelper.PageInfo;
import com.glxp.api.annotation.AuthRuleAnnotation;
import com.glxp.api.annotation.Log;
import com.glxp.api.common.res.BaseResponse;
import com.glxp.api.common.util.ResultVOUtils;
import com.glxp.api.constant.BusinessType;
import com.glxp.api.constant.ConstantStatus;
import com.glxp.api.entity.basic.CompanyProductRelevanceEntity;
import com.glxp.api.entity.basic.ProductInfoEntity;
import com.glxp.api.entity.basic.UdiProductEntity;
import com.glxp.api.entity.basic.UdiRelevanceEntity;
import com.glxp.api.entity.system.CompanyEntity;
import com.glxp.api.entity.thrsys.ThrProductsEntity;
import com.glxp.api.entity.thrsys.ThrSystemEntity;
import com.glxp.api.http.NmpaUdiClient;
@ -20,10 +24,8 @@ import com.glxp.api.req.thrsys.FilterBasicThirdSysRequest;
import com.glxp.api.res.PageSimpleResponse;
import com.glxp.api.res.basic.UdiRelevanceResponse;
import com.glxp.api.service.auth.CustomerService;
import com.glxp.api.service.basic.ProductInfoService;
import com.glxp.api.service.basic.UdiContrastService;
import com.glxp.api.service.basic.UdiProductService;
import com.glxp.api.service.basic.UdiRelevanceService;
import com.glxp.api.service.basic.*;
import com.glxp.api.service.system.CompanyService;
import com.glxp.api.service.thrsys.ThrDataService;
import com.glxp.api.service.thrsys.ThrSystemService;
import com.glxp.api.util.CustomUtil;
@ -62,11 +64,13 @@ public class UdiContrastController {
@Resource
ThrDataService thrDataService;
/**
*
*/
@AuthRuleAnnotation("")
@PostMapping("/udi/udirel/revleance")
@Log(title = "耗材字典", businessType = BusinessType.INSERT)
public BaseResponse revleanceUdi(@RequestBody UdiCombineRequest udiCombineRequest) {
List<String> keys = udiCombineRequest.getKeys();
if (keys != null && keys.size() > 0) {
@ -120,6 +124,7 @@ public class UdiContrastController {
*/
@AuthRuleAnnotation("")
@PostMapping("/udi/udirel/changeVersion")
@Log(title = "耗材字典", businessType = BusinessType.UPDATE)
public BaseResponse changeVersion(@RequestBody UdiCombineRequest udiCombineRequest) {
UdiRelevanceEntity udiRelevanceEntity = udiRelevanceService.selectById(udiCombineRequest.getRelId());
if (udiContrastService.isExit(udiCombineRequest.getKeys().get(0), udiRelevanceEntity.getMainId(), null)) {
@ -144,6 +149,7 @@ public class UdiContrastController {
//更改关联第三方产品产品信息
@AuthRuleAnnotation("")
@PostMapping("/udi/udirel/modifyRel")
@Log(title = "耗材字典", businessType = BusinessType.UPDATE)
public BaseResponse modifyRel(@RequestBody UdiCombineRequest udiCombineRequest) {
UdiRelevanceEntity udiRelevanceEntity = udiRelevanceService.selectById(udiCombineRequest.getRelId());
udiRelevanceEntity = setThird(udiCombineRequest, udiRelevanceEntity);
@ -162,7 +168,15 @@ public class UdiContrastController {
}
}
//关联第三方产品信息若无值则由第三方产品信息带过来
UdiProductEntity udiProductEntity = udiProductService.findByUuid(udiRelevanceEntity.getUuid());
if (StrUtil.isEmpty(udiProductEntity.getManufactory())) {
udiProductEntity.setManufactory(udiCombineRequest.getManufactory());
}
if (StrUtil.isEmpty(udiProductEntity.getMeasname())) {
udiProductEntity.setMeasname(udiCombineRequest.getMeasname());
}
udiProductService.updateUdiInfo(udiProductEntity);
return ResultVOUtils.success("更新成功");
}
@ -170,6 +184,7 @@ public class UdiContrastController {
//解除绑定第三方产品信息
@AuthRuleAnnotation("")
@GetMapping("/udiwms/udirl/thirdSys/remove")
@Log(title = "耗材字典", businessType = BusinessType.UPDATE)
public BaseResponse removeThirdId(RemoveUdiRelRequest removeUdiRelRequest) {
UdiRelevanceEntity udiRelevanceEntity = udiRelevanceService.selectById(removeUdiRelRequest.getRelId());
List<UdiRelevanceEntity> udiRelevanceEntities = udiRelevanceService.selectByUuid(udiRelevanceEntity.getUuid());
@ -212,8 +227,9 @@ public class UdiContrastController {
//解除绑定DI器械信息
@AuthRuleAnnotation("")
@GetMapping("/udiwms/udirl/di/remove")
public BaseResponse removeDI(RemoveUdiRelRequest removeUdiRelRequest) {
UdiRelevanceEntity udiRelevanceEntity = udiRelevanceService.selectById(removeUdiRelRequest.getRelId());
@Log(title = "耗材字典", businessType = BusinessType.UPDATE)
public BaseResponse removeDI(RemoveUdiRelRequest removeRelRequest) {
UdiRelevanceEntity udiRelevanceEntity = udiRelevanceService.selectById(removeRelRequest.getRelId());
if (StrUtil.isEmpty(udiRelevanceEntity.getMainId())) {
return ResultVOUtils.error(500, "未关联第三方产品ID无法解除绑定");
}
@ -228,26 +244,25 @@ public class UdiContrastController {
}
ThrSystemEntity thrSystemEntity = thrSystemService.selectMainThrSys();
ThrProductsEntity thrProductsEntity = thrDataService.getProducts(udiRelevanceEntity.getMainId(), thrSystemEntity.getThirdId());
UdiProductEntity udiProductEntity = new UdiProductEntity();
BeanUtils.copyProperties(thrProductsEntity, udiProductEntity);
udiProductEntity.setNameCode(thrProductsEntity.getCode());
udiProductEntity.setCpmctymc(thrProductsEntity.getName());
udiProductEntity.setManufactory(thrProductsEntity.getManufactory());
udiProductEntity.setYlqxzcrbarmc(thrProductsEntity.getManufactory());
udiProductEntity.setGgxh(thrProductsEntity.getSpec());
udiProductEntity.setZczbhhzbapzbh(thrProductsEntity.getRegisterNo());
udiProductEntity.setUuid(CustomUtil.getUUId());
udiProductEntity.setProductType(ConstantStatus.PRODUCT_TYPE_THIRD);
udiProductEntity.setDiType(1);
udiProductService.insertUdiInfo(udiProductEntity);
udiRelevanceEntity.setUuid(udiProductEntity.getUuid());
UdiProductEntity UdiInfoRequest = new UdiProductEntity();
BeanUtils.copyProperties(thrProductsEntity, UdiInfoRequest);
UdiInfoRequest.setNameCode(thrProductsEntity.getCode());
UdiInfoRequest.setCpmctymc(thrProductsEntity.getName());
UdiInfoRequest.setManufactory(thrProductsEntity.getManufactory());
UdiInfoRequest.setYlqxzcrbarmc(thrProductsEntity.getManufactory());
UdiInfoRequest.setGgxh(thrProductsEntity.getSpec());
UdiInfoRequest.setZczbhhzbapzbh(thrProductsEntity.getRegisterNo());
UdiInfoRequest.setUuid(CustomUtil.getUUId());
UdiInfoRequest.setProductType(ConstantStatus.PRODUCT_TYPE_THIRD);
UdiInfoRequest.setDiType(1);
udiProductService.insertUdiInfo(UdiInfoRequest);
udiRelevanceEntity.setUuid(UdiInfoRequest.getUuid());
udiRelevanceEntity.setUpdateTime(new Date());
udiRelevanceEntity.setModifyTime(new Date());
udiRelevanceService.updateUdiRelevance(udiRelevanceEntity);
return ResultVOUtils.success("解除绑定成功!");
}
//获取DI版本号
@AuthRuleAnnotation("")
@GetMapping("/udiwms/syncdi/version")

@ -4,12 +4,15 @@ import cn.hutool.core.collection.CollUtil;
import cn.hutool.core.util.StrUtil;
import com.github.pagehelper.PageInfo;
import com.glxp.api.annotation.AuthRuleAnnotation;
import com.glxp.api.annotation.Log;
import com.glxp.api.common.enums.ResultEnum;
import com.glxp.api.common.res.BaseResponse;
import com.glxp.api.common.util.ResultVOUtils;
import com.glxp.api.constant.BusinessType;
import com.glxp.api.constant.ConstantStatus;
import com.glxp.api.controller.BaseController;
import com.glxp.api.entity.basic.*;
import com.glxp.api.entity.inv.InvProductEntity;
import com.glxp.api.entity.system.SystemParamConfigEntity;
import com.glxp.api.entity.thrsys.ThrProductsEntity;
import com.glxp.api.entity.thrsys.ThrSystemEntity;
@ -24,6 +27,9 @@ import com.glxp.api.res.basic.BasicProductThirdSysResponse;
import com.glxp.api.res.basic.UdiRelevanceResponse;
import com.glxp.api.service.auth.CustomerService;
import com.glxp.api.service.basic.*;
import com.glxp.api.service.inout.IoCodeService;
import com.glxp.api.service.inv.InvPreProductService;
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;
@ -38,6 +44,7 @@ import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RestController;
import javax.annotation.Resource;
import java.math.BigDecimal;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.Date;
@ -126,7 +133,7 @@ public class UdiRelevanceController extends BaseController {
}
List<UdiRelevanceResponse> temps = udiRelevanceService.filterUdiGp(filterUdiRelRequest);
if (temps != null && temps.size() > 0) {
filterUdiRelRequest.setUuid(temps.get(0).getUuid());
filterUdiRelRequest.setOriginUuid(temps.get(0).getOriginUuid());
filterUdiRelRequest.setNameCode(null);
}
} else {
@ -155,7 +162,7 @@ public class UdiRelevanceController extends BaseController {
filterUdiRelRequest.setNameCode(filterUdiRelRequest.getUnionCode());
List<UdiRelevanceResponse> temps = udiRelevanceService.filterUdiGp(filterUdiRelRequest);
if (temps != null && temps.size() > 0) {
filterUdiRelRequest.setUuid(temps.get(0).getUuid());
filterUdiRelRequest.setOriginUuid(temps.get(0).getOriginUuid());
filterUdiRelRequest.setNameCode(null);
}
} else {
@ -183,6 +190,19 @@ public class UdiRelevanceController extends BaseController {
}
//资质证书选入产品列表 产品名称,生产企业过滤
@AuthRuleAnnotation("")
@GetMapping("/udi/cert/filterUdi")
public BaseResponse filterCertUdi(FilterUdiRelRequest filterUdiRelRequest) {
List<UdiRelevanceResponse> udiRelevanceResponses = udiRelevanceService.filterCertUdi(filterUdiRelRequest);
PageInfo<UdiRelevanceResponse> pageInfo;
pageInfo = new PageInfo<>(udiRelevanceResponses);
PageSimpleResponse<UdiRelevanceResponse> pageSimpleResponse = new PageSimpleResponse<>();
pageSimpleResponse.setTotal(pageInfo.getTotal());
pageSimpleResponse.setList(udiRelevanceResponses);
return ResultVOUtils.success(pageSimpleResponse);
}
/**
* DI
*/
@ -214,6 +234,7 @@ public class UdiRelevanceController extends BaseController {
//多选删除
@AuthRuleAnnotation("")
@PostMapping("/udi/udirel/deleteAll")
@Log(title = "单据管理", businessType = BusinessType.DELETE)
public BaseResponse deleteAll(@RequestBody DeleteRequest deleteRequest, BindingResult bindingResult) {
if (bindingResult.hasErrors()) {
@ -224,8 +245,14 @@ public class UdiRelevanceController extends BaseController {
return ResultVOUtils.success("删除成功");
}
@Resource
IoCodeService codeService;
@Resource
CompanyProductRelevanceService companyProductRelevanceService;
@AuthRuleAnnotation("")
@PostMapping("/udi/udirel/deleteById")
@Log(title = "单据管理", businessType = BusinessType.DELETE)
public BaseResponse deleteById(@RequestBody DeleteRequest deleteRequest, BindingResult bindingResult) {
if (bindingResult.hasErrors()) {
@ -233,37 +260,15 @@ public class UdiRelevanceController extends BaseController {
}
String ids = deleteRequest.getId();
UdiRelevanceEntity udiRelevanceEntity = udiRelevanceService.selectById(Long.parseLong(ids));
//todo 单据未完成
// if (udiRelevanceEntity != null && udiRelevanceEntity.getUuid() != null) {
// List<UdiRelevanceEntity> udiRelevanceEntities = udiRelevanceService.selectByUuid(udiRelevanceEntity.getUuid());
// if (udiRelevanceEntities != null && !udiRelevanceEntities.isEmpty()) {
// for (UdiRelevanceEntity udiRelevanceEntity1 : udiRelevanceEntities) {
// List<UdiInfoEntity> udiInfoEntities = udiInfoService.findByUuids(udiRelevanceEntity1.getUuid());
// if (udiInfoEntities != null && udiInfoEntities.size() > 0) {
// for (int i = 0; i < udiInfoEntities.size(); i++) {
// List<WarehouseEntity> warehouseEntityList = warehouseService.searchCode(udiInfoEntities.get(i).getNameCode());
// if (warehouseEntityList != null && warehouseEntityList.size() > 0) {
// return ResultVOUtils.error(500, "该产品已被" + warehouseEntityList.get(0).getOrderId() + "订单关联不能删除");
// }
// }
// }
// }
// WarehouseQueryRequest warehouseQueryRequest = new WarehouseQueryRequest();
// warehouseQueryRequest.setRelId(ids);
// if (StrUtil.isNotEmpty(ids)) {
// List<WarehouseEntity> warehouseEntityList = warehouseService.findByOrderId(warehouseQueryRequest);
// if (CollUtil.isNotEmpty(warehouseEntityList)) {
// return ResultVOUtils.error(500, "该产品已被" + warehouseEntityList.get(0).getOrderId() + "订单关联不能删除");
// }
// }
// }
// }
//
// CompanyProductRelevanceEntity companyProductRelevanceEntity = companyProductRelevanceService.findByUdiRlIdUnitFk(ids, null);
// if (companyProductRelevanceEntity != null) {
// return ResultVOUtils.error(500, "该产品已被已被供应商选入" + "不能删除!");
// }
//
if (udiRelevanceEntity != null && udiRelevanceEntity.getUuid() != null) {
if (codeService.isExitByRelId(udiRelevanceEntity.getId() + "")) {
return ResultVOUtils.error(500, "该产品已关联单据,无法删除!");
}
if (companyProductRelevanceService.isExitByRelId(udiRelevanceEntity.getId() + "")) {
return ResultVOUtils.error(500, "该产品已被已被供应商选入,无法删除!");
}
}
udiRelevanceService.deleteById(ids);
List<UdiRelevanceEntity> udiRelevanceEntities = udiRelevanceService.selectByUuid(udiRelevanceEntity.getUuid());
@ -271,9 +276,6 @@ public class UdiRelevanceController extends BaseController {
udiProductService.deleteByUuid(udiRelevanceEntity.getUuid());
}
//todo
// companyProductRelevanceService.deleteByRlId(ids);//删除供应商关联表产品信息
return ResultVOUtils.success("删除成功");
}
@ -282,6 +284,7 @@ public class UdiRelevanceController extends BaseController {
@AuthRuleAnnotation("")
@PostMapping("/udi/udirel/update")
@Log(title = "单据管理", businessType = BusinessType.UPDATE)
public BaseResponse updateRelevanceEntity(@RequestBody UdiRelevanceSaveRequest udiRelevanceSaveRequest, BindingResult bindingResult) {
if (bindingResult.hasErrors()) {
@ -340,6 +343,7 @@ public class UdiRelevanceController extends BaseController {
@AuthRuleAnnotation("")
@PostMapping("/udi/udirel/update/di")
@Log(title = "单据管理", businessType = BusinessType.UPDATE)
public BaseResponse updateSingel(@RequestBody UdiRelevanceSaveRequest udiRelevanceSaveRequest, BindingResult bindingResult) {
if (bindingResult.hasErrors()) {
@ -370,6 +374,7 @@ public class UdiRelevanceController extends BaseController {
//新增或修改关联
@AuthRuleAnnotation("")
@PostMapping("/udi/udirel/check/udi")
public BaseResponse checkUdi(@RequestBody UdiCombineRequest udiCombineRequest) {
List<String> keys = udiCombineRequest.getKeys();
@ -395,20 +400,24 @@ public class UdiRelevanceController extends BaseController {
}
@Resource
InvProductService invProductService;
@Resource
InvPreProductService invPreProductService;
//查询产品是否可以被禁用 todo 库存还未完成
@AuthRuleAnnotation("")
@PostMapping("/udi/udirel/disable")
public BaseResponse disable(@RequestBody UdiCombineRequest udiCombineRequest) {
// InvProductEntity invProductEntity = invProductService.selectExit(combineRequest.getRelId());
// if (invProductEntity != null) {
// return ResultVOUtils.error(500, "库存已存在,无法禁用");
// }
//
// InvProductEntity invPreProductEntity = invPreProductService.selectExit(combineRequest.getRelId());
// if (invPreProductEntity != null) {
// return ResultVOUtils.error(500, "库存已存在,无法禁用");
// }
if (invProductService.isExitByRelId(udiCombineRequest.getRelId() + "")) {
return ResultVOUtils.error(500, "库存已存在,无法禁用");
}
if (invPreProductService.isExitByRelId(udiCombineRequest.getRelId() + "")) {
return ResultVOUtils.error(500, "寄售库存已存在,无法禁用");
}
return ResultVOUtils.success("更新成功");
}
@ -430,6 +439,7 @@ public class UdiRelevanceController extends BaseController {
//单独选入ERP产品
@AuthRuleAnnotation("")
@PostMapping("/udi/udirel/addErp")
@Log(title = "单据管理", businessType = BusinessType.INSERT)
public BaseResponse addErp(@RequestBody UdiCombineRequest udiCombineRequest) {
String errMsg = null;
@ -447,6 +457,7 @@ public class UdiRelevanceController extends BaseController {
//一键选入ERP产品
@AuthRuleAnnotation("")
@PostMapping("/udi/udirel/addAllErp")
@Log(title = "单据管理", businessType = BusinessType.INSERT)
public BaseResponse addAllErp(@RequestBody UdiCombineRequest udiCombineRequest) {
if (udiCombineRequest.getIsRlInv() != null && udiCombineRequest.getIsRlInv()) {
@ -626,6 +637,7 @@ public class UdiRelevanceController extends BaseController {
@AuthRuleAnnotation("")
@PostMapping("/udiwms/udirl/lock/status")
@Log(title = "单据管理", businessType = BusinessType.UPDATE)
public BaseResponse uploadThirdServcie(@RequestBody LockUdiRequest lockUdiRequest) {
if (lockUdiRequest.getLockStatus() != null && lockUdiRequest.getIds().size() > 0) {
for (Long id : lockUdiRequest.getIds()) {
@ -643,13 +655,20 @@ public class UdiRelevanceController extends BaseController {
@AuthRuleAnnotation("")
@PostMapping("/udi/udirel/updateById")
@Log(title = "单据管理", businessType = BusinessType.UPDATE)
public BaseResponse updateById(@RequestBody UdiProductEntity udiProductEntity, BindingResult bindingResult) {
if (bindingResult.hasErrors()) {
return ResultVOUtils.error(ResultEnum.PARAM_VERIFY_FALL, bindingResult.getFieldError().getDefaultMessage());
}
boolean falg = udiProductService.updateUdiInfoById(udiProductEntity);
if (udiProductEntity.getRelSupId() != null) {
UdiRlSupEntity udiRlSupEntity = new UdiRlSupEntity();
udiRlSupEntity.setUpdateTime(new Date());
udiRlSupEntity.setPrice(new BigDecimal(udiProductEntity.getPrice()));
udiRlSupEntity.setId(udiProductEntity.getRelSupId());
udiRlSupService.updateCompanyProductRelevance(udiRlSupEntity);
}
if (falg) {
return ResultVOUtils.success("更新成功");
} else {

@ -4,13 +4,15 @@ import cn.hutool.core.collection.CollUtil;
import cn.hutool.core.util.StrUtil;
import com.github.pagehelper.PageInfo;
import com.glxp.api.annotation.AuthRuleAnnotation;
import com.glxp.api.annotation.Log;
import com.glxp.api.common.enums.ResultEnum;
import com.glxp.api.common.res.BaseResponse;
import com.glxp.api.common.util.ResultVOUtils;
import com.glxp.api.constant.BusinessType;
import com.glxp.api.controller.BaseController;
import com.glxp.api.entity.auth.AuthAdmin;
import com.glxp.api.entity.basic.BasicCorpEntity;
import com.glxp.api.entity.basic.UdiEntity;
import com.glxp.api.entity.basic.UdiRlSupEntity;
import com.glxp.api.entity.basic.*;
import com.glxp.api.entity.system.CompanyEntity;
import com.glxp.api.exception.JsonException;
import com.glxp.api.req.basic.CompanyProductRelevanceRequest;
import com.glxp.api.req.basic.FilterCompanyProductRelevanceRequest;
@ -19,14 +21,14 @@ import com.glxp.api.req.basic.UdiInfoExportRequest;
import com.glxp.api.req.system.CompanyRequest;
import com.glxp.api.req.system.DeleteCompanyFileRequest;
import com.glxp.api.res.PageSimpleResponse;
import com.glxp.api.res.basic.CompanyProductRelevanceResponse;
import com.glxp.api.res.basic.UdiRlSupResponse;
import com.glxp.api.res.basic.UdiRelevanceResponse;
import com.glxp.api.service.auth.AuthAdminService;
import com.glxp.api.service.basic.BasicCorpService;
import com.glxp.api.service.basic.UdiRlSupService;
import com.glxp.api.service.basic.CompanyProductsRelService;
import com.glxp.api.service.basic.UdiRelevanceService;
import com.glxp.api.service.basic.*;
import com.glxp.api.service.system.CompanyService;
import com.glxp.api.util.udi.FilterUdiUtils;
import org.springframework.beans.BeanUtils;
import org.springframework.validation.BindingResult;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
@ -45,7 +47,7 @@ import java.util.List;
*
*/
@RestController
public class UdiRlSupController {
public class UdiRlSupController extends BaseController {
@Resource
private AuthAdminService authAdminService;
@Resource
@ -57,6 +59,12 @@ public class UdiRlSupController {
@Resource
private UdiRelevanceService udiRelevanceService;
@Resource
private CompanyService companyService;
@Resource
private CompanyProductRelevanceService companyProductRelevanceService;
@Resource
private UdiProductService udiProductService;
@AuthRuleAnnotation("")
@GetMapping("/sale/info/company/product/relevance/filter")
@ -65,6 +73,12 @@ public class UdiRlSupController {
if (bindingResult.hasErrors()) {
return ResultVOUtils.error(ResultEnum.PARAM_VERIFY_FALL, bindingResult.getFieldError().getDefaultMessage());
}
if (StrUtil.isNotEmpty(companyProductRelevanceRequest.getCustomerId())) {
String customerId = getCustomerId();
if (customerId.equals("110")) {
companyProductRelevanceRequest.setCustomerId(null);
}
}
companyProductRelevanceRequest.setIsDisable(false);
if (StrUtil.isNotEmpty(companyProductRelevanceRequest.getUdiCode())) {
@ -80,7 +94,7 @@ public class UdiRlSupController {
filterUdiInfoRequest.setNameCode(companyProductRelevanceRequest.getUnionCode());
List<UdiRelevanceResponse> temps = udiRelevanceService.filterUdiGp(filterUdiInfoRequest);
if (temps != null && temps.size() > 0) {
companyProductRelevanceRequest.setUuid(temps.get(0).getUuid());
companyProductRelevanceRequest.setOriginUuid(temps.get(0).getOriginUuid());
companyProductRelevanceRequest.setNameCode(filterUdiInfoRequest.getNameCode());
companyProductRelevanceRequest.setUnionCode(null);
}
@ -177,6 +191,7 @@ public class UdiRlSupController {
@AuthRuleAnnotation("")
@PostMapping("/sale/info/insertCompanyProductRelevance")
@Log(title = "单据管理", businessType = BusinessType.INSERT)
public BaseResponse insertCompanyProductRelevance(@RequestBody UdiRlSupEntity udiRlSupEntity) {
if (udiRlSupService.findCompanyProductRelevanceByProductUuid(udiRlSupEntity) != null) {
return ResultVOUtils.error(ResultEnum.DATA_REPEAT);
@ -191,25 +206,37 @@ public class UdiRlSupController {
@AuthRuleAnnotation("")
@PostMapping("/sale/info/insertFilter")
@Log(title = "单据管理", businessType = BusinessType.INSERT)
public BaseResponse insertFilter(@RequestBody UdiInfoExportRequest udiInfoExportRequest) {
if (StrUtil.isEmpty(udiInfoExportRequest.getUnitFk())) {
return ResultVOUtils.error(500, "未选择供应商!");
}
//先判断产品是否存在
CompanyProductRelevanceRequest filterUdiInfoRequest = new CompanyProductRelevanceRequest();
filterUdiInfoRequest.setNameCode(udiInfoExportRequest.getNameCode());
filterUdiInfoRequest.setCustomerId(udiInfoExportRequest.getUnitFk());
List<UdiRlSupResponse> udiRlSupResponses = udiRlSupService.filterUdiGp(filterUdiInfoRequest);
if (udiRlSupResponses.size() != 0) {
return ResultVOUtils.error(999, "产品已存在,请勿重复导入!");
//查询本企业有没有选择该产品有选择不能选择
CompanyProductRelevanceRequest companyProductRelevanceRequest = new CompanyProductRelevanceRequest();
companyProductRelevanceRequest.setCustomerId(udiInfoExportRequest.getCustomerId() + "");
List<CompanyProductRelevanceResponse> basicInstrumentMaintainRelevanceResponses = null;
companyProductRelevanceRequest.setDiType(1);
basicInstrumentMaintainRelevanceResponses = companyProductRelevanceService.filterUdiGp(companyProductRelevanceRequest);
String rlidStr = udiInfoExportRequest.getRlIds().get(0);
for (CompanyProductRelevanceResponse obj : basicInstrumentMaintainRelevanceResponses) {
String rlid = String.valueOf(obj.getRlId());
if (rlid.equals(rlidStr)) {
return ResultVOUtils.error(999, "该企业已选择该产品,请勿重复选择!");
}
}
companyProductsRelService.insertCompanyProducts(udiInfoExportRequest);
return ResultVOUtils.success("后台正在导入,请稍后刷新查看!");
UdiRelevanceEntity udiRelevanceEntity = new UdiRelevanceEntity();
udiRelevanceEntity.setId(Long.parseLong(rlidStr));
udiRelevanceEntity.setLockStatus(1);
udiRelevanceService.updateUdiRelevance(udiRelevanceEntity);
return ResultVOUtils.success("选入成功!");
}
@AuthRuleAnnotation("")
@PostMapping("/sale/info/updateCompanyProductRelevance")
@Log(title = "供应商字典管理", businessType = BusinessType.UPDATE)
public BaseResponse updateCompanyProductRelevance(@RequestBody UdiRlSupEntity udiRlSupEntity) {
udiRlSupEntity.setUpdateTime(new Date());
int b = udiRlSupService.updateCompanyProductRelevance(udiRlSupEntity);
@ -217,6 +244,7 @@ public class UdiRlSupController {
}
@PostMapping("/sale/info/deleteCompanyProductRelevance")
@Log(title = "供应商字典管理", businessType = BusinessType.DELETE)
public BaseResponse deleteCompanyProductRelevance(@RequestBody DeleteCompanyFileRequest deleteCompanyFileRequest, BindingResult bindingResult) {
boolean b = udiRlSupService.deleteById(deleteCompanyFileRequest.getId());
return ResultVOUtils.success("成功");

@ -3,8 +3,21 @@ package com.glxp.api.dao.basic;
import com.glxp.api.dao.BaseMapperPlus;
import com.glxp.api.entity.basic.BasicProductsEntity;
import com.glxp.api.entity.basic.CompanyProductRelevanceEntity;
import com.glxp.api.req.basic.CompanyProductRelevanceRequest;
import com.glxp.api.res.basic.CompanyProductRelevanceResponse;
import org.apache.ibatis.annotations.Mapper;
import java.util.List;
@Mapper
public interface CompanyProductRelevanceDao extends BaseMapperPlus<CompanyProductRelevanceDao, CompanyProductRelevanceEntity,CompanyProductRelevanceEntity> {
public interface CompanyProductRelevanceDao extends BaseMapperPlus<CompanyProductRelevanceDao, CompanyProductRelevanceEntity, CompanyProductRelevanceEntity> {
List<CompanyProductRelevanceResponse> filterUdiGp(CompanyProductRelevanceRequest basicInstrumentMaintainRequest);
boolean insertCompanyProductRelevance(CompanyProductRelevanceEntity companyCertEntity);
boolean importCompanyProductRelevance(CompanyProductRelevanceEntity companyProductRelevanceEntity);
boolean deleteById(String id);
boolean deleteByRlId(String id);
}

@ -76,4 +76,12 @@ public interface UdiProductDao {
List<String> selectGgxhList(@Param("relId") String relId);
boolean updateUdiInfoNotAll(UdiInfoRequest udiInfoRequest);
/**
* DI
*
* @param nameCode
* @return
*/
UdiProductEntity selectAllowNoBatch(@Param("nameCode") String nameCode);
}

@ -17,6 +17,8 @@ public interface UdiRelevanceDao extends BaseMapperPlus<UdiRelevanceDao, UdiRele
List<UdiRelevanceResponse> filterUdiJoinSup(FilterUdiRelRequest filterUdiRelRequest);
List<UdiRelevanceResponse> filterCertUdi(FilterUdiRelRequest filterUdiRelRequest);
List<UdiRelevanceResponse> filterUdiGp(FilterUdiRelRequest filterUdiRelRequest);
@ -101,4 +103,20 @@ public interface UdiRelevanceDao extends BaseMapperPlus<UdiRelevanceDao, UdiRele
* @return
*/
Long selectProductByRelCode(@Param("relCode") String relCode);
/**
* DIid
*
* @param nameCode
* @return
*/
String selectRelIdByNameCode(@Param("nameCode") String nameCode);
/**
*
*
* @param filterUdiRelRequest
* @return
*/
UdiRelevanceResponse selectOneUdiJoinSup(FilterUdiRelRequest filterUdiRelRequest);
}

@ -43,4 +43,12 @@ public interface UdiRlSupDao extends BaseMapperPlus<UdiRlSupDao, UdiRlSupEntity,
* @return
*/
List<String> selectUnitFkByRelId(@Param("relId") Long relId);
/**
*
*
* @param companyProductRelevanceRequest
* @return
*/
Long selectSupRlCount(CompanyProductRelevanceRequest companyProductRelevanceRequest);
}

@ -69,8 +69,8 @@ public class BasicProductsEntity {
private Integer bhzxxsbzsl;
/**
* 使:
使
* 使:
* 使
*/
@TableField(value = "zxxsbzbhsydysl")
private Integer zxxsbzbhsydysl;
@ -163,7 +163,7 @@ public class BasicProductsEntity {
* 1.2使3.4
*/
@TableField(value = "diType")
private Byte diType;
private Integer diType;
/**
*
@ -193,7 +193,7 @@ public class BasicProductsEntity {
* 0:UDI1
*/
@TableField(value = "productType")
private Byte productType;
private Integer productType;
/**
*
@ -229,19 +229,19 @@ public class BasicProductsEntity {
*
*/
@TableField(value = "allowNoBatch")
private Byte allowNoBatch;
private Boolean allowNoBatch;
/**
*
*/
@TableField(value = "allowNoExpire")
private Byte allowNoExpire;
private Boolean allowNoExpire;
/**
*
*/
@TableField(value = "allowNoProduct")
private Byte allowNoProduct;
private Boolean allowNoProduct;
/**
*
@ -461,4 +461,4 @@ public class BasicProductsEntity {
public static final String COL_UPDATEUSER = "updateUser";
public static final String COL_REMARK = "remark";
}
}

@ -19,7 +19,7 @@ public class SysMenuHelpEntity {
private String menuName;
@TableField(value = "`status`")
private Byte status;
private Integer status;
@TableField(value = "filePath")
private String filePath;

@ -57,7 +57,7 @@ public class SysPdfTemplateRelevanceBizEntity {
private String remark3;
@TableField(value = "`printType`")
private Byte printType;
private Integer printType;
@TableField(value = "`modelKey`")
private String modelKey;
@ -65,4 +65,4 @@ public class SysPdfTemplateRelevanceBizEntity {
@TableField(value = "updateTime")
private Date updateTime;
}
}

@ -58,7 +58,7 @@ public class SysPdfTemplateRelevanceCodeEntity {
private String remark3;
@TableField(value = "`printType`")
private Byte printType;
private Integer printType;
@TableField(value = "`modelKey`")
private String modelKey;

@ -57,11 +57,11 @@ public class SysPdfTemplateRelevanceLabelEntity {
private String remark3;
@TableField(value = "`printType`")
private Byte printType;
private Integer printType;
@TableField(value = "`modelKey`")
private String modelKey;
@TableField(value = "updateTime")
private Date updateTime;
}
}

@ -60,11 +60,11 @@ public class SysPdfTemplateRelevanceStatemenEntity {
* 01
*/
@TableField(value = "`printType`")
private Byte printType;
private Integer printType;
@TableField(value = "`modelKey`")
private String modelKey;
@TableField(value = "updateTime")
private Date updateTime;
}
}

@ -11,6 +11,7 @@ public class CompanyProductRelevanceRequest extends ListPageRequest {
private String cpmctymc;
private String nameCode;
private String uuid;
private String originUuid;
private String ggxh;
private String thirdId;
private String id;

@ -19,7 +19,7 @@ public class SysMenuHelpRequest extends ListPageRequest {
private String menuName;
private Byte status;
private Integer status;
private String filePath;

@ -0,0 +1,86 @@
package com.glxp.api.res.basic;
import lombok.Data;
@Data
public class CompanyProductRelevanceResponse {
private int id;
private Integer rlId;
private String thirdId;
private String thirdName;
private String uuid;
private String originUuid;
private String nameCode;
private String packLevel;
private String packRatio;
private Integer bhxjsl;
private Integer bhzxxsbzsl;
private Integer zxxsbzbhsydysl;
private String bhxjcpbm;
private String sjcpbm; //
private String bzcj;
private String deviceRecordKey;
private int isUseDy;
private String cpmctymc;
private String cplb;
private String flbm;
private String ggxh;
private String qxlb;
private String tyshxydm;
private String ylqxzcrbarmc;
private String zczbhhzbapzbh;
private String ylqxzcrbarywmc;
private String sydycpbs;
private int versionNumber;
private int diType;
private String thirdId1;
private String thirdId2;
private String thirdId3;
private String thirdId4;
private String thirdName1;
private String thirdName2;
private String thirdName3;
private String thirdName4;
private String ybbm;
private String sptm;
private String manufactory;
private String measname;
private Boolean isDisable;
private long customerId;
private String auditStatus;
private Boolean isLock;
private Integer lockStatus;
private String companyName;
private String mainId;
private String mainName;
private Boolean isAdavence;
private String scbssfbhph;
private String scbssfbhxlh;
private String scbssfbhscrq;
private String scbssfbhsxrq;
private String cpms;
private String supName;
private boolean allowNoBatch;
private boolean allowNoExpire;
private boolean allowNoProduct;
private boolean allowNoSerial;
private String spmc;
private Integer productType;
private String price;
//产品代理商
private String cpdls;
private String basicPrductRemak1;
private String basicPrductRemak2;
private String basicPrductRemak3;
private String basicPrductRemak4;
private String basicPrductRemak5;
private String basicPrductRemak6;
private String basicPrductRemak7;
private String basicPrductRemak8;
}

@ -0,0 +1,22 @@
package com.glxp.api.service.basic;
import com.baomidou.mybatisplus.extension.service.IService;
import com.glxp.api.entity.basic.CompanyProductRelevanceEntity;
import com.glxp.api.req.basic.CompanyProductRelevanceRequest;
import com.glxp.api.res.basic.CompanyProductRelevanceResponse;
import java.util.List;
public interface CompanyProductRelevanceService extends IService<CompanyProductRelevanceEntity> {
List<CompanyProductRelevanceResponse> filterUdiGp(CompanyProductRelevanceRequest basicInstrumentMaintainRequest);
boolean insertCompanyProductRelevance(CompanyProductRelevanceEntity companyCertEntity);
boolean deleteById(String id);
boolean deleteByRlId(String id);
boolean isExitByRelId(String relId);
}

@ -1,12 +1,17 @@
package com.glxp.api.service.basic;
import cn.hutool.core.util.StrUtil;
import com.glxp.api.entity.basic.CompanyProductRelevanceEntity;
import com.glxp.api.entity.basic.UdiRlSupEntity;
import com.glxp.api.entity.basic.UdiRelevanceEntity;
import com.glxp.api.req.basic.UdiInfoExportRequest;
import com.glxp.api.req.basic.UdiInfoRequest;
import org.springframework.beans.BeanUtils;
import org.springframework.scheduling.annotation.Async;
import org.springframework.stereotype.Service;
import javax.annotation.Resource;
import java.math.BigDecimal;
import java.util.Date;
import java.util.List;

@ -53,4 +53,11 @@ public interface UdiProductService {
boolean updateUdiInfoNotAll(UdiInfoRequest udiInfoRequest);
/**
* DI
*
* @param nameCode
* @return
*/
UdiProductEntity getAllowNoBatch(String nameCode);
}

@ -1,27 +1,35 @@
package com.glxp.api.service.basic;
import com.baomidou.mybatisplus.extension.service.IService;
import com.glxp.api.entity.basic.UdiRelevanceEntity;
import com.glxp.api.req.basic.FilterUdiRelRequest;
import com.glxp.api.res.basic.UdiRelevanceResponse;
import org.apache.ibatis.annotations.Param;
import java.util.List;
/**
*
*/
public interface UdiRelevanceService {
public interface UdiRelevanceService extends IService<UdiRelevanceEntity> {
List<UdiRelevanceResponse> filterUdiRelevance(FilterUdiRelRequest filterUdiRelRequest);
List<UdiRelevanceResponse> filterCertUdi(FilterUdiRelRequest filterUdiRelRequest);
List<UdiRelevanceResponse> filterUdiJoinSup(FilterUdiRelRequest filterUdiRelRequest);
List<UdiRelevanceEntity> filterUdiEntity(FilterUdiRelRequest filterUdiRelRequest);
UdiRelevanceResponse selectByNameCode(String nameCode);
UdiRelevanceResponse selectSupGroupById(Long id);
/**
* ID
*
* @param relId
* @return
*/
UdiRelevanceResponse selectByRelId(String relId);
//根据DI查询产品信息
List<UdiRelevanceResponse> selectAllByNameCode(String nameCode);
@ -45,6 +53,10 @@ public interface UdiRelevanceService {
UdiRelevanceResponse selectGroupById(Long id);
UdiRelevanceResponse selectUdiId(Long id);
UdiRelevanceResponse selectSupGroupById(Long id);
UdiRelevanceEntity selectUpdateByUuid(String uuid);
UdiRelevanceEntity selectUpdateByThirdId(String thirdId);
@ -81,4 +93,12 @@ public interface UdiRelevanceService {
List<UdiRelevanceResponse> selectGroupByNameCode(String nameCode, Boolean isDisable);
/**
* UDIID
*
* @param code
* @return
*/
String getRelIdByUdiCode(String code);
}

@ -30,9 +30,19 @@ public interface UdiRlSupService {
int updateCompanyProductRelevance(UdiRlSupEntity companyCertEntity);
int updateCompanyProductRelevanceByUdiFk(UdiRlSupEntity companyCertEntity);
boolean insertCompanyProductRelevance(UdiRlSupEntity companyCertEntity);
boolean deleteById(String id);
boolean deleteByRlId(String id);
/**
*
*
* @param companyProductRelevanceRequest
* @return
*/
boolean findExist(CompanyProductRelevanceRequest companyProductRelevanceRequest);
}

@ -0,0 +1,59 @@
package com.glxp.api.service.basic.impl;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.github.pagehelper.PageHelper;
import com.glxp.api.dao.basic.CompanyProductRelevanceDao;
import com.glxp.api.entity.basic.CompanyProductRelevanceEntity;
import com.glxp.api.req.basic.CompanyProductRelevanceRequest;
import com.glxp.api.res.basic.CompanyProductRelevanceResponse;
import com.glxp.api.service.basic.CompanyProductRelevanceService;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import javax.annotation.Resource;
import java.util.Collections;
import java.util.List;
@Service
@Transactional(rollbackFor = Exception.class)
public class CompanyProductRelevanceServiceImpl extends ServiceImpl<CompanyProductRelevanceDao, CompanyProductRelevanceEntity>
implements CompanyProductRelevanceService {
@Resource
CompanyProductRelevanceDao companyProductRelevanceDao;
@Override
public List<CompanyProductRelevanceResponse> filterUdiGp(CompanyProductRelevanceRequest basicInstrumentMaintainRequest) {
if (basicInstrumentMaintainRequest == null) {
return Collections.emptyList();
}
if (basicInstrumentMaintainRequest.getPage() != null) {
int offset = (basicInstrumentMaintainRequest.getPage() - 1) * basicInstrumentMaintainRequest.getLimit();
PageHelper.offsetPage(offset, basicInstrumentMaintainRequest.getLimit());
}
List<CompanyProductRelevanceResponse> data = companyProductRelevanceDao.filterUdiGp(basicInstrumentMaintainRequest);
return data;
}
@Override
public boolean insertCompanyProductRelevance(CompanyProductRelevanceEntity companyProductRelevanceEntity) {
return companyProductRelevanceDao.insertCompanyProductRelevance(companyProductRelevanceEntity);
}
@Override
public boolean deleteById(String id) {
return companyProductRelevanceDao.deleteById(id);
}
@Override
public boolean deleteByRlId(String id) {
return companyProductRelevanceDao.deleteByRlId(id);
}
@Override
public boolean isExitByRelId(String relId) {
return companyProductRelevanceDao.exists(new QueryWrapper<CompanyProductRelevanceEntity>().eq("udiRlIdFk", relId));
}
}

@ -145,4 +145,10 @@ public class UdiProductServiceImpl implements UdiProductService {
return false;
return udiProductDao.updateUdiInfoNotAll(udiInfoRequest);
}
@Override
public UdiProductEntity getAllowNoBatch(String nameCode) {
String di = FilterUdiUtils.getDiStr(nameCode);
return udiProductDao.selectAllowNoBatch(di);
}
}

@ -2,28 +2,28 @@ package com.glxp.api.service.basic.impl;
import cn.hutool.core.collection.CollUtil;
import cn.hutool.core.util.StrUtil;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.github.pagehelper.PageHelper;
import com.glxp.api.constant.ConstantStatus;
import com.glxp.api.dao.basic.UdiProductDao;
import com.glxp.api.dao.basic.UdiRelevanceDao;
import com.glxp.api.entity.basic.UdiEntity;
import com.glxp.api.entity.basic.UdiRelevanceEntity;
import com.glxp.api.entity.thrsys.ThrSystemEntity;
import com.glxp.api.req.basic.FilterUdiRelRequest;
import com.glxp.api.req.thrsys.FilterBasicThirdSysRequest;
import com.glxp.api.res.basic.UdiRelevanceResponse;
import com.glxp.api.service.basic.UdiRelevanceService;
import com.glxp.api.service.thrsys.ThrSystemService;
import com.glxp.api.util.udi.FilterUdiUtils;
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.List;
@Service
@Transactional(rollbackFor = Exception.class)
public class UdiRelevanceServiceImpl implements UdiRelevanceService {
public class UdiRelevanceServiceImpl extends ServiceImpl<UdiRelevanceDao, UdiRelevanceEntity> implements UdiRelevanceService {
@Resource
UdiRelevanceDao udiRelevanceDao;
@Resource
@ -42,6 +42,22 @@ public class UdiRelevanceServiceImpl implements UdiRelevanceService {
return data;
}
@Override
public List<UdiRelevanceResponse> filterCertUdi(FilterUdiRelRequest filterUdiRelRequest) {
if (filterUdiRelRequest == null) {
return Collections.emptyList();
}
if (filterUdiRelRequest.getPage() != null) {
int offset = (filterUdiRelRequest.getPage() - 1) * filterUdiRelRequest.getLimit();
PageHelper.offsetPage(offset, filterUdiRelRequest.getLimit());
}
List<UdiRelevanceResponse> data = udiRelevanceDao.filterCertUdi(filterUdiRelRequest);
return data;
}
@Override
public List<UdiRelevanceResponse> filterUdiJoinSup(FilterUdiRelRequest filterUdiRelRequest) {
if (filterUdiRelRequest == null) {
@ -72,23 +88,23 @@ public class UdiRelevanceServiceImpl implements UdiRelevanceService {
}
@Override
public UdiRelevanceResponse selectSupGroupById(Long id) {
public UdiRelevanceResponse selectByNameCode(String nameCode) {
FilterUdiRelRequest filterUdiRelRequest = new FilterUdiRelRequest();
filterUdiRelRequest.setId(id);
filterUdiRelRequest.setDiType(1);
List<UdiRelevanceResponse> data = udiRelevanceDao.filterUdiJoinSup(filterUdiRelRequest);
if (data != null && data.size() > 0)
return data.get(0);
filterUdiRelRequest.setUniqueNameCode(nameCode);
List<UdiRelevanceResponse> udiRelevanceResponses = filterUdiRelevance(filterUdiRelRequest);
if (udiRelevanceResponses != null && udiRelevanceResponses.size() > 0)
return udiRelevanceResponses.get(0);
return null;
}
@Override
public UdiRelevanceResponse selectByNameCode(String nameCode) {
public UdiRelevanceResponse selectByRelId(String relId) {
FilterUdiRelRequest filterUdiRelRequest = new FilterUdiRelRequest();
filterUdiRelRequest.setUniqueNameCode(nameCode);
filterUdiRelRequest.setRelId(relId);
List<UdiRelevanceResponse> udiRelevanceResponses = filterUdiRelevance(filterUdiRelRequest);
if (udiRelevanceResponses != null && udiRelevanceResponses.size() > 0)
if (CollUtil.isNotEmpty(udiRelevanceResponses)) {
return udiRelevanceResponses.get(0);
}
return null;
}
@ -181,6 +197,25 @@ public class UdiRelevanceServiceImpl implements UdiRelevanceService {
return null;
}
@Override
public UdiRelevanceResponse selectUdiId(Long id) {
FilterUdiRelRequest filterUdiRelRequest = new FilterUdiRelRequest();
filterUdiRelRequest.setId(id);
List<UdiRelevanceResponse> data = udiRelevanceDao.filterUdiRelevance(filterUdiRelRequest);
if (data != null && data.size() > 0)
return data.get(0);
return null;
}
@Override
public UdiRelevanceResponse selectSupGroupById(Long id) {
FilterUdiRelRequest filterUdiRelRequest = new FilterUdiRelRequest();
filterUdiRelRequest.setId(id);
filterUdiRelRequest.setDiType(1);
return udiRelevanceDao.selectOneUdiJoinSup(filterUdiRelRequest);
}
@Override
public UdiRelevanceEntity selectUpdateByUuid(String uuid) {
FilterUdiRelRequest filterUdiRelRequest = new FilterUdiRelRequest();
@ -356,4 +391,13 @@ public class UdiRelevanceServiceImpl implements UdiRelevanceService {
public List<UdiRelevanceResponse> selectGroupByNameCode(String nameCode, Boolean isDisable) {
return udiRelevanceDao.selectGroupByNameCode(nameCode, isDisable);
}
@Override
public String getRelIdByUdiCode(String code) {
if (StrUtil.isBlank(code)) {
return null;
}
UdiEntity udi = FilterUdiUtils.getUdi(code);
return udiRelevanceDao.selectRelIdByNameCode(udi.getUdi());
}
}

@ -1,5 +1,6 @@
package com.glxp.api.service.basic.impl;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.github.pagehelper.PageHelper;
import com.glxp.api.dao.basic.UdiRlSupDao;
import com.glxp.api.entity.basic.UdiRlSupEntity;
@ -103,6 +104,13 @@ public class UdiRlSupServiceImpl implements UdiRlSupService {
return udiRlSupDao.updateById(udiRlSupEntity);
}
@Override
public int updateCompanyProductRelevanceByUdiFk(UdiRlSupEntity companyCertEntity) {
QueryWrapper<UdiRlSupEntity> ew = new QueryWrapper<>();
ew.eq("udiRlIdFk", companyCertEntity.getUdiRlIdFk());
return udiRlSupDao.update(companyCertEntity, ew);
}
@Override
public boolean insertCompanyProductRelevance(UdiRlSupEntity udiRlSupEntity) {
return udiRlSupDao.insertCompanyProductRelevance(udiRlSupEntity);
@ -117,4 +125,10 @@ public class UdiRlSupServiceImpl implements UdiRlSupService {
public boolean deleteByRlId(String id) {
return udiRlSupDao.deleteByRlId(id);
}
@Override
public boolean findExist(CompanyProductRelevanceRequest companyProductRelevanceRequest) {
Long count = udiRlSupDao.selectSupRlCount(companyProductRelevanceRequest);
return null != count && count != 0;
}
}

@ -0,0 +1,226 @@
<?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.CompanyProductRelevanceDao">
<insert id="insertCompanyProductRelevance"
parameterType="com.glxp.api.entity.basic.CompanyProductRelevanceEntity">
replace
INTO company_product_relevance(customerId, productId, enterpriseId, registrationId,
createTime, updateTime, auditStatus, productUuid, udiRlIdFk, unitFk,
price)
values (#{customerId},
#{productId},
#{enterpriseId},
#{registrationId},
#{createTime},
#{updateTime},
#{auditStatus},
#{productUuid},
#{udiRlIdFk},
#{unitFk}, #{price})
</insert>
<insert id="importCompanyProductRelevance"
parameterType="com.glxp.api.entity.basic.CompanyProductRelevanceEntity">
replace
INTO company_product_relevance(id, customerId, productId, enterpriseId, registrationId,
create_time, update_time, auditStatus, productUuid, udiRlIdFk, unitFk,
price)
values (#{id},
#{customerId},
#{productId},
#{enterpriseId},
#{registrationId},
#{create_time},
#{update_time},
#{auditStatus},
#{productUuid},
#{udiRlIdFk},
#{unitFk}, #{price})
</insert>
<delete id="deleteById" parameterType="Map">
DELETE
FROM company_product_relevance
WHERE id = #{id}
</delete>
<delete id="deleteByRlId" parameterType="Map">
DELETE
FROM company_product_relevance
WHERE udiRlIdFk = #{id}
</delete>
<select id="filterUdiGp" parameterType="com.glxp.api.req.basic.CompanyProductRelevanceRequest"
resultType="com.glxp.api.res.basic.CompanyProductRelevanceResponse">
SELECT company_product_relevance.id,
company_product_relevance.customerId,
company_product_relevance.auditStatus,
basic_udirel.thirdId,
basic_udirel.id rlId,
basic_udirel.isUseDy,
basic_udirel.isLock,
basic_udirel.thirdId1,
basic_udirel.thirdId2,
basic_udirel.thirdId3,
basic_udirel.thirdId4,
basic_udirel.lockStatus,
basic_products.allowNoBatch,
basic_products.allowNoExpire,
basic_products.allowNoProduct,
basic_products.allowNoSerial,
basic_products.productType,
basic_products.nameCode,
basic_products.packRatio,
basic_products.packLevel,
basic_products.bhxjsl,
basic_products.bhzxxsbzsl,
basic_products.zxxsbzbhsydysl,
basic_products.bhxjcpbm,
basic_products.bzcj,
basic_udirel.isDisable,
basic_products.deviceRecordKey,
basic_products.cpmctymc,
basic_products.cplb,
basic_products.flbm,
basic_products.ggxh,
basic_products.qxlb,
basic_products.tyshxydm,
basic_products.ylqxzcrbarmc,
basic_products.zczbhhzbapzbh,
basic_products.ylqxzcrbarywmc,
basic_products.sydycpbs,
basic_products.uuid,
basic_products.sjcpbm,
basic_products.versionNumber,
basic_products.diType,
customer_info.companyName,
basic_udirel.mainId,
basic_udirel.isAdavence,
basic_products.scbssfbhph,
basic_products.scbssfbhxlh,
basic_products.scbssfbhscrq,
basic_products.cpdls,
basic_products.scbssfbhsxrq,
basic_products.cpms,
basic_products.originUuid,
company_product_relevance.price,
basic_products.spmc,
basic_products.basicPrductRemak1,
basic_products.basicPrductRemak2,
basic_products.basicPrductRemak3,
basic_products.basicPrductRemak4,
basic_products.basicPrductRemak5,
basic_products.basicPrductRemak6,
basic_products.basicPrductRemak7,
basic_products.basicPrductRemak8
FROM company_product_relevance
INNER JOIN basic_udirel ON company_product_relevance.udiRlIdFk = basic_udirel.id
INNER JOIN basic_products ON basic_udirel.uuid = basic_products.uuid
INNER JOIN customer_info ON customer_info.customerId = company_product_relevance.customerId
<where>
<if test="ylqxzcrbarmc != '' and ylqxzcrbarmc != null">
AND ylqxzcrbarmc LIKE concat(#{ylqxzcrbarmc}, '%')
</if>
<if test="cpmctymc != '' and cpmctymc != null">
AND cpmctymc LIKE concat(#{cpmctymc}, '%')
</if>
<if test="nameCode != '' and nameCode != null">
AND nameCode LIKE concat(#{nameCode}, '%')
</if>
<if test="ggxh != '' and ggxh != null">
AND ggxh LIKE concat('%', #{ggxh}, '%')
</if>
<if test="unionCode != '' and unionCode != null">
and (
nameCode LIKE concat('%', #{unionCode}, '%')
or basic_products.ybbm LIKE concat('%', #{unionCode}, '%')
or basic_products.sptm LIKE concat('%', #{unionCode}, '%')
)
</if>
<if test="thrPiId != '' and thrPiId != null">
and (
thirdId LIKE concat('%', #{thrPiId}, '%')
or thirdId1 LIKE concat('%', #{thrPiId}, '%')
or thirdId2 LIKE concat('%', #{thrPiId}, '%')
or thirdId3 LIKE concat('%', #{thrPiId}, '%')
or thirdId4 LIKE concat('%', #{thrPiId}, '%')
)
</if>
<if test="uuid != '' and uuid != null">
AND basic_udirel.uuid = #{uuid}
</if>
<if test="thirdId != '' and thirdId != null">
AND thirdId = #{thirdId}
</if>
<if test="zczbhhzbapzbh != '' and zczbhhzbapzbh != null">
AND zczbhhzbapzbh LIKE concat(#{zczbhhzbapzbh}, '%')
</if>
<if test="diType != '' and diType != null">
AND diType = #{diType}
</if>
<if test="filterType != null and filterType == 1">
AND (thirdId <![CDATA[<>]]> '' or thirdId1 <![CDATA[<>]]> '' or thirdId2 <![CDATA[<>]]> '' or
thirdId3 <![CDATA[<>]]> '' or thirdId4 <![CDATA[<>]]> '')
and basic_products.originUuid <![CDATA[<>]]> ''
</if>
<if test="filterType != null and filterType == 2">
AND basic_products.originUuid is NULL
</if>
<if test="filterType != null and filterType == 3">
AND mainId is NULL
and basic_products.originUuid <![CDATA[<>]]> ''
</if>
<if test="filterType != null and filterType == 4">
AND thirdId1 is NULL
and basic_products.flbm <![CDATA[<>]]> ''
</if>
<if test="filterType != null and filterType == 5">
AND thirdId2 is NULL
and basic_products.flbm <![CDATA[<>]]> ''
</if>
<if test="filterType != null and filterType == 6">
AND thirdId3 is NULL
and basic_products.flbm <![CDATA[<>]]> ''
</if>
<if test="filterType != null and filterType == 7">
AND thirdId4 is NULL
and basic_products.flbm <![CDATA[<>]]> ''
</if>
<if test="filterType != null and filterType == 10">
AND basic_udirel.updateTime is NULL
</if>
<if test="customerId != '' and customerId != null">
AND company_product_relevance.customerId = #{customerId}
</if>
<if test="auditStatus != '' and auditStatus != null">
AND company_product_relevance.auditStatus = #{auditStatus}
</if>
<if test="id != '' and id != null">
AND basic_udirel.id = #{id}
</if>
<if test="companyName != '' and companyName != null">
AND customer_info.companyName = #{companyName}
</if>
<if test="lockStatus != '' and lockStatus != null">
AND basic_udirel.lockStatus = #{lockStatus}
</if>
<if test="isAdavence != '' and isAdavence != null">
AND basic_udirel.isAdavence = #{isAdavence}
</if>
<if test="unitFk != null and unitFk != ''">
and unitFk = #{unitFk}
</if>
<if test="originUuid != null and originUuid != ''">
and originUuid = #{originUuid}
</if>
<if test="isDisable == false">
AND (basic_udirel.isDisable is null or basic_udirel.isDisable = false)
</if>
</where>
ORDER BY company_product_relevance.updateTime DESC
</select>
</mapper>

File diff suppressed because it is too large Load Diff

@ -43,6 +43,8 @@
basic_products.allowNoBatch,
basic_products.allowNoExpire,
basic_products.allowNoProduct,
basic_products.allowNoSerial,
basic_products.spmc,
basic_products.cplx,
basic_products.hchzsb,
@ -161,11 +163,12 @@
basic_products.allowNoBatch,
basic_products.allowNoExpire,
basic_products.allowNoProduct,
basic_products.allowNoSerial,
basic_products.spmc,
basic_products.cplx,
basic_products.hchzsb,
basic_products.cpdls,
basic_products.price,
company_product_relevance.price,
basic_products.basicPrductRemak1,
basic_products.basicPrductRemak2,
basic_products.basicPrductRemak3,
@ -251,62 +254,62 @@
<select id="filterUdiGp" parameterType="com.glxp.api.req.basic.FilterUdiRelRequest"
resultType="com.glxp.api.res.basic.UdiRelevanceResponse">
select basic_udirel.*,
bht.name classifyName,
basic_products.originUuid,
basic_products.nameCode,
basic_products.deviceRecordKey,
basic_products.packRatio,
basic_products.packUnit,
basic_products.packLevel,
basic_products.bhxjsl,
basic_products.bhzxxsbzsl,
basic_products.zxxsbzbhsydysl,
basic_products.bhxjcpbm,
basic_products.bzcj,
basic_products.cpmctymc,
basic_products.cplb,
basic_products.flbm,
basic_products.ggxh,
basic_products.qxlb,
basic_products.tyshxydm,
basic_products.ylqxzcrbarmc,
basic_products.zczbhhzbapzbh,
basic_products.ylqxzcrbarywmc,
basic_products.sydycpbs,
basic_products.sjcpbm,
basic_products.versionNumber,
basic_products.diType,
basic_products.ybbm,
basic_products.sptm,
basic_products.manufactory,
basic_products.measname,
basic_products.productType,
basic_products.scbssfbhph,
basic_products.scbssfbhxlh,
basic_products.scbssfbhscrq,
basic_products.scbssfbhsxrq,
basic_products.cpms,
basic_products.allowNoBatch,
basic_products.allowNoExpire,
basic_products.allowNoProduct,
basic_products.allowNoSerial,
basic_products.spmc,
basic_products.cplx,
basic_products.hchzsb,
basic_products.cpdls,
basic_products.price,
basic_products.basicPrductRemak1,
basic_products.basicPrductRemak2,
basic_products.basicPrductRemak3,
basic_products.basicPrductRemak4,
basic_products.basicPrductRemak5,
basic_products.basicPrductRemak6,
basic_products.basicPrductRemak7,
basic_products.basicPrductRemak8
bht.name classifyName,
basic_products.originUuid,
basic_products.nameCode,
basic_products.deviceRecordKey,
basic_products.packRatio,
basic_products.packUnit,
basic_products.packLevel,
basic_products.bhxjsl,
basic_products.bhzxxsbzsl,
basic_products.zxxsbzbhsydysl,
basic_products.bhxjcpbm,
basic_products.bzcj,
basic_products.cpmctymc,
basic_products.cplb,
basic_products.flbm,
basic_products.ggxh,
basic_products.qxlb,
basic_products.tyshxydm,
basic_products.ylqxzcrbarmc,
basic_products.zczbhhzbapzbh,
basic_products.ylqxzcrbarywmc,
basic_products.sydycpbs,
basic_products.sjcpbm,
basic_products.versionNumber,
basic_products.diType,
basic_products.ybbm,
basic_products.sptm,
basic_products.manufactory,
basic_products.measname,
basic_products.productType,
basic_products.scbssfbhph,
basic_products.scbssfbhxlh,
basic_products.scbssfbhscrq,
basic_products.scbssfbhsxrq,
basic_products.cpms,
basic_products.allowNoBatch,
basic_products.allowNoExpire,
basic_products.allowNoProduct,
basic_products.allowNoSerial,
basic_products.spmc,
basic_products.cplx,
basic_products.hchzsb,
basic_products.cpdls,
basic_products.price,
basic_products.basicPrductRemak1,
basic_products.basicPrductRemak2,
basic_products.basicPrductRemak3,
basic_products.basicPrductRemak4,
basic_products.basicPrductRemak5,
basic_products.basicPrductRemak6,
basic_products.basicPrductRemak7,
basic_products.basicPrductRemak8
FROM basic_products
inner JOIN basic_udirel
ON basic_products.uuid = basic_udirel.uuid
left join basic_hosp_type bht on basic_udirel.relCode = bht.code
inner JOIN basic_udirel
ON basic_products.uuid = basic_udirel.uuid
left join basic_hosp_type bht on basic_udirel.relCode = bht.code
<where>
<if test="ylqxzcrbarmc != '' and ylqxzcrbarmc != null">
AND ylqxzcrbarmc LIKE concat('%', #{ylqxzcrbarmc}, '%')
@ -316,7 +319,7 @@
</if>
<if test="bindType != '' and bindType != null">
AND (relCode is null
or trim(relCode) = '')
or trim(relCode) = '')
</if>
<if test="supName != '' and supName != null">
AND supName LIKE concat('%', #{supName}, '%')
@ -332,19 +335,19 @@
</if>
<if test="unionCode != '' and unionCode != null">
and (
nameCode LIKE concat('%', #{unionCode}, '%')
or ybbm LIKE concat('%', #{unionCode}, '%')
or sptm LIKE concat('%', #{unionCode}, '%'))
nameCode LIKE concat('%', #{unionCode}, '%')
or ybbm LIKE concat('%', #{unionCode}, '%')
or sptm LIKE concat('%', #{unionCode}, '%'))
</if>
<if test="isDisable == false">
AND (basic_udirel.isDisable is null or basic_udirel.isDisable = false)
</if>
<if test="thrPiId != '' and thrPiId != null">
and (thirdId LIKE concat('%', #{thrPiId}, '%')
or thirdId1 LIKE concat('%', #{thrPiId}, '%')
or thirdId2 LIKE concat('%', #{thrPiId}, '%')
or thirdId3 LIKE concat('%', #{thrPiId}, '%')
or thirdId4 LIKE concat('%', #{thrPiId}, '%'))
or thirdId1 LIKE concat('%', #{thrPiId}, '%')
or thirdId2 LIKE concat('%', #{thrPiId}, '%')
or thirdId3 LIKE concat('%', #{thrPiId}, '%')
or thirdId4 LIKE concat('%', #{thrPiId}, '%'))
</if>
<if test="uuid != '' and uuid != null">
AND basic_udirel.uuid = #{uuid}
@ -363,7 +366,7 @@
</if>
<if test="filterType != null and filterType == 1">
AND (thirdId <![CDATA[<>]]> '' or thirdId1 <![CDATA[<>]]> '' or thirdId2 <![CDATA[<>]]> '' or
thirdId3 <![CDATA[<>]]> '' or thirdId4 <![CDATA[<>]]> '')
thirdId3 <![CDATA[<>]]> '' or thirdId4 <![CDATA[<>]]> '')
and basic_products.originUuid <![CDATA[<>]]> ''
</if>
<if test="filterType != null and filterType == 2">
@ -405,7 +408,7 @@
and originUuid = #{originUuid}
</if>
<if test="manufactory != null and manufactory != ''">
and manufactory LIKE concat('%',#{manufactory},'%')
and manufactory LIKE concat('%', #{manufactory}, '%')
</if>
<if test="dispatch != null">
and basic_udirel.dispatch = #{dispatch}
@ -417,6 +420,176 @@
ORDER BY modifyTime DESC
</select>
<!-- 资质证书选入产品分组查询-->
<select id="filterCertUdi" parameterType="com.glxp.api.req.basic.FilterUdiRelRequest"
resultType="com.glxp.api.res.basic.UdiRelevanceResponse">
select basic_udirel.*,
bht.name classifyName,
basic_products.originUuid,
basic_products.nameCode,
basic_products.deviceRecordKey,
basic_products.packRatio,
basic_products.packUnit,
basic_products.packLevel,
basic_products.bhxjsl,
basic_products.bhzxxsbzsl,
basic_products.zxxsbzbhsydysl,
basic_products.bhxjcpbm,
basic_products.bzcj,
basic_products.cpmctymc,
basic_products.cplb,
basic_products.flbm,
basic_products.ggxh,
basic_products.qxlb,
basic_products.tyshxydm,
basic_products.ylqxzcrbarmc,
basic_products.zczbhhzbapzbh,
basic_products.ylqxzcrbarywmc,
basic_products.sydycpbs,
basic_products.sjcpbm,
basic_products.versionNumber,
basic_products.diType,
basic_products.ybbm,
basic_products.sptm,
basic_products.manufactory,
basic_products.measname,
basic_products.productType,
basic_products.scbssfbhph,
basic_products.scbssfbhxlh,
basic_products.scbssfbhscrq,
basic_products.scbssfbhsxrq,
basic_products.cpms,
basic_products.allowNoBatch,
basic_products.allowNoExpire,
basic_products.allowNoProduct,
basic_products.allowNoSerial,
basic_products.spmc,
basic_products.cplx,
basic_products.hchzsb,
basic_products.cpdls,
basic_products.price,
basic_products.basicPrductRemak1,
basic_products.basicPrductRemak2,
basic_products.basicPrductRemak3,
basic_products.basicPrductRemak4,
basic_products.basicPrductRemak5,
basic_products.basicPrductRemak6,
basic_products.basicPrductRemak7,
basic_products.basicPrductRemak8
FROM basic_products
inner JOIN basic_udirel
ON basic_products.uuid = basic_udirel.uuid
left join basic_hosp_type bht on basic_udirel.relCode = bht.code
inner join company_product_relevance on company_product_relevance.udiRlIdFk = basic_udirel.id
<where>
<if test="ylqxzcrbarmc != '' and ylqxzcrbarmc != null">
AND ylqxzcrbarmc LIKE concat('%', #{ylqxzcrbarmc}, '%')
</if>
<if test="manufactory != '' and manufactory != null">
AND manufactory LIKE concat('%', #{manufactory}, '%')
</if>
<if test="relCode != '' and relCode != null">
AND relCode = #{relCode}
</if>
<if test="bindType != '' and bindType != null">
AND relCode is null
or trim(relCode) = ''
</if>
<if test="supName != '' and supName != null">
AND supName LIKE concat('%', #{supName}, '%')
</if>
<if test="nameCode != '' and nameCode != null">
AND nameCode LIKE concat(#{nameCode}, '%')
</if>
<if test="cpmctymc != '' and cpmctymc != null">
AND cpmctymc LIKE concat('%', #{cpmctymc}, '%')
</if>
<if test="ggxh != '' and ggxh != null">
AND ggxh LIKE concat('%', #{ggxh}, '%')
</if>
<if test="unionCode != '' and unionCode != null">
and (
nameCode LIKE concat('%', #{unionCode}, '%')
or ybbm LIKE concat('%', #{unionCode}, '%')
or sptm LIKE concat('%', #{unionCode}, '%'))
</if>
<if test="isDisable == false">
AND (basic_udirel.isDisable is null or basic_udirel.isDisable = false)
</if>
<if test="thrPiId != '' and thrPiId != null">
and (thirdId LIKE concat('%', #{thrPiId}, '%')
or thirdId1 LIKE concat('%', #{thrPiId}, '%')
or thirdId2 LIKE concat('%', #{thrPiId}, '%')
or thirdId3 LIKE concat('%', #{thrPiId}, '%')
or thirdId4 LIKE concat('%', #{thrPiId}, '%'))
</if>
<if test="uuid != '' and uuid != null">
AND basic_udirel.uuid = #{uuid}
</if>
<if test="thirdId != '' and thirdId != null">
AND thirdId = #{thirdId}
</if>
<if test="udplatCode != '' and udplatCode != null">
AND udplatCode = #{udplatCode}
</if>
<if test="zczbhhzbapzbh != '' and zczbhhzbapzbh != null">
AND zczbhhzbapzbh LIKE concat(#{zczbhhzbapzbh}, '%')
</if>
<if test="diType != '' and diType != null">
AND diType = #{diType}
</if>
<if test="filterType != null and filterType == 1">
AND (thirdId <![CDATA[<>]]> '' or thirdId1 <![CDATA[<>]]> '' or thirdId2 <![CDATA[<>]]> '' or
thirdId3 <![CDATA[<>]]> '' or thirdId4 <![CDATA[<>]]> '')
and basic_products.originUuid <![CDATA[<>]]> ''
</if>
<if test="filterType != null and filterType == 2">
AND basic_products.originUuid is NULL
</if>
<if test="filterType != null and filterType == 3">
AND (mainId is NULL or mainId = '')
and basic_products.originUuid <![CDATA[<>]]> ''
</if>
<if test="filterType != null and filterType == 4">
AND thirdId1 is NULL
and basic_products.originUuid <![CDATA[<>]]> ''
</if>
<if test="filterType != null and filterType == 5">
AND thirdId2 is NULL
and basic_products.originUuid <![CDATA[<>]]> ''
</if>
<if test="filterType != null and filterType == 6">
AND thirdId3 is NULL
and basic_products.originUuid <![CDATA[<>]]> ''
</if>
<if test="filterType != null and filterType == 7">
AND thirdId4 is NULL
and basic_products.originUuid <![CDATA[<>]]> ''
</if>
<if test="filterType != null and filterType == 10">
AND basic_udirel.updateTime is NULL
</if>
<if test="lockStatus != '' and lockStatus != null">
AND basic_udirel.lockStatus = #{lockStatus}
</if>
<if test="mainId != '' and mainId != null">
AND mainId = #{mainId}
</if>
<if test="id != '' and id != null">
AND basic_udirel.id = #{id}
</if>
<if test="customerId != '' and customerId != null">
AND company_product_relevance.unitFk = #{customerId}
</if>
<if test="tyshxydm != '' and tyshxydm != null">
AND basic_products.tyshxydm = #{tyshxydm}
</if>
</where>
GROUP BY cpmctymc, manufactory
</select>
<select id="contrastJoinSelect" parameterType="com.glxp.api.req.basic.FilterUdiRelRequest"
resultType="com.glxp.api.res.basic.UdiRelevanceResponse">
select basic_udirel.*,
@ -457,6 +630,7 @@
basic_products.allowNoBatch,
basic_products.allowNoExpire,
basic_products.allowNoProduct,
basic_products.allowNoSerial,
basic_products.spmc,
basic_products.cplx,
basic_products.hchzsb,
@ -602,7 +776,7 @@
isLock,
lockStatus, isAdavence, useMuti, useNum, supName, createTime, updateTime, modifyTime, createUser,
updateUser,
remark, useExpireTime, dispatch, groupBuy)
remark, useExpireTime, dispatch, groupBuy, needCert)
values (#{id},
#{uuid},
#{mainId},
@ -625,7 +799,7 @@
#{modifyTime},
#{createUser},
#{updateUser},
#{remark}, #{useExpireTime}, #{dispatch}, #{groupBuy})
#{remark}, #{useExpireTime}, #{dispatch}, #{groupBuy}, #{needCert})
</insert>
<insert id="insertUdiRelevanceignore" keyProperty="id"
@ -637,7 +811,7 @@
isLock,
lockStatus, isAdavence, useMuti, useNum, supName, createTime, updateTime, modifyTime, createUser,
updateUser,
remark, useExpireTime, dispatch, groupBuy)
remark, useExpireTime, dispatch, groupBuy, needCert)
values (#{id},
#{uuid},
#{mainId},
@ -660,7 +834,7 @@
#{modifyTime},
#{createUser},
#{updateUser},
#{remark}, #{useExpireTime}, #{dispatch}, #{groupBuy})
#{remark}, #{useExpireTime}, #{dispatch}, #{groupBuy}, #{needCert})
</insert>
<delete id="deleteById" parameterType="Map">
@ -806,7 +980,7 @@
isLock,
lockStatus, isAdavence, useMuti, useNum, supName, createTime, updateTime, modifyTime, createUser,
updateUser,
remark, useExpireTime, dispatch, groupBuy)
remark, useExpireTime, dispatch, groupBuyneedCert)
values
<foreach collection="udiRelevanceEntities" item="item" index="index" separator=",">
@ -832,7 +1006,7 @@
#{item.modifyTime},
#{item.createUser},
#{item.updateUser},
#{item.remark}, #{item.useExpireTime}, #{item.dispatch}, #{item.groupBuy})
#{item.remark}, #{item.useExpireTime}, #{item.dispatch}, #{item.groupBuy}#{item.needCert})
</foreach>
</insert>
@ -876,6 +1050,7 @@
basic_products.allowNoBatch,
basic_products.allowNoExpire,
basic_products.allowNoProduct,
basic_products.allowNoSerial,
basic_products.spmc,
basic_products.cplx,
basic_products.hchzsb,
@ -928,7 +1103,7 @@
<select id="selectRemindParams" resultType="com.glxp.api.entity.basic.UdiRelevanceEntity">
select lowStockNum, overStockNum, recentDateTime
select id, lowStockNum, overStockNum, recentDateTime
from basic_udirel
where id = #{relId}
</select>
@ -939,4 +1114,138 @@
where basic_udirel.relCode = #{relCode}
</select>
<select id="selectRelIdByNameCode" resultType="java.lang.String">
select basic_udirel.id
from basic_udirel
inner join basic_products on basic_udirel.uuid = basic_products.uuid
where basic_products.nameCode = #{nameCode}
</select>
<select id="selectOneUdiJoinSup" resultType="com.glxp.api.res.basic.UdiRelevanceResponse">
select basic_udirel.*,
basic_products.originUuid,
basic_products.nameCode,
basic_products.deviceRecordKey,
basic_products.packRatio,
basic_products.packUnit,
basic_products.packLevel,
basic_products.bhxjsl,
basic_products.bhzxxsbzsl,
basic_products.zxxsbzbhsydysl,
basic_products.bhxjcpbm,
basic_products.bzcj,
basic_products.cpmctymc,
basic_products.cplb,
basic_products.flbm,
basic_products.ggxh,
basic_products.qxlb,
basic_products.tyshxydm,
basic_products.ylqxzcrbarmc,
basic_products.zczbhhzbapzbh,
basic_products.ylqxzcrbarywmc,
basic_products.sydycpbs,
basic_products.sjcpbm,
basic_products.versionNumber,
basic_products.diType,
basic_products.ybbm,
basic_products.sptm,
basic_products.manufactory,
basic_products.measname,
basic_products.productType,
basic_products.scbssfbhph,
basic_products.scbssfbhxlh,
basic_products.scbssfbhscrq,
basic_products.scbssfbhsxrq,
basic_products.cpms,
basic_products.allowNoBatch,
basic_products.allowNoExpire,
basic_products.allowNoProduct,
basic_products.allowNoSerial,
basic_products.spmc,
basic_products.cplx,
basic_products.hchzsb,
basic_products.cpdls,
company_product_relevance.price,
basic_products.basicPrductRemak1,
basic_products.basicPrductRemak2,
basic_products.basicPrductRemak3,
basic_products.basicPrductRemak4,
basic_products.basicPrductRemak5,
basic_products.basicPrductRemak6,
basic_products.basicPrductRemak7,
basic_products.basicPrductRemak8,
company_product_relevance.unitFk,
basic_corp.name companyName
FROM basic_udirel
inner JOIN basic_products
ON basic_products.uuid = basic_udirel.uuid
left join company_product_relevance
on basic_udirel.id = company_product_relevance.udiRlIdFk
left JOIN basic_corp on basic_corp.erpId = company_product_relevance.customerId
<where>
<if test="ylqxzcrbarmc != '' and ylqxzcrbarmc != null">
AND ylqxzcrbarmc LIKE concat('%', #{ylqxzcrbarmc}, '%')
</if>
<if test="supName != '' and supName != null">
AND supName LIKE concat('%', #{supName}, '%')
</if>
<if test="cpmctymc != '' and cpmctymc != null">
AND cpmctymc LIKE concat('%', #{cpmctymc}, '%')
</if>
<if test="nameCode != '' and nameCode != null">
AND nameCode LIKE concat(#{nameCode}, '%')
</if>
<if test="thirdId != '' and thirdId != null">
AND thirdId LIKE concat(#{thirdId}, '%')
</if>
<if test="uuid != '' and uuid != null">
AND basic_udirel.uuid = #{uuid}
</if>
<if test="unitFk != '' and unitFk != null">
AND company_product_relevance.unitFk = #{unitFk}
</if>
<if test="id != '' and id != null">
AND basic_udirel.id = #{id}
</if>
<if test="udplatCode != '' and udplatCode != null">
AND basic_udirel.udplatCode = #{udplatCode}
</if>
<if test="diType != null">
AND basic_products.diType = #{diType}
</if>
<if test="lockStatus != '' and lockStatus != null">
AND basic_udirel.lockStatus = #{lockStatus}
</if>
<if test="zczbhhzbapzbh != '' and zczbhhzbapzbh != null">
AND zczbhhzbapzbh LIKE concat(#{zczbhhzbapzbh}, '%')
</if>
<if test="lastUpdateTime != null and lastUpdateTime != ''">
<![CDATA[
and DATE_FORMAT(updateTime, '%Y-%m-%d %H:%i:%S') >= DATE_FORMAT(#{lastUpdateTime}, '%Y-%m-%d %H:%i:%S')
]]>
</if>
<if test="mainId != '' and mainId != null">
AND mainId = #{mainId}
</if>
<if test="unionFilterStr != '' and unionFilterStr != null">
or basic_products.cpmctymc LIKE concat('%', #{unionFilterStr}, '%')
or basic_products.ylqxzcrbarmc LIKE concat('%', #{unionFilterStr}, '%')
or basic_products.ggxh LIKE concat('%', #{unionFilterStr}, '%')
or basic_products.zczbhhzbapzbh LIKE concat('%', #{unionFilterStr}, '%')
</if>
<if test="isAdavence != '' and isAdavence != null">
AND isAdavence = #{isAdavence}
</if>
<if test="uniqueNameCode != '' and uniqueNameCode != null">
AND nameCode = #{uniqueNameCode}
</if>
<if test="relIds != null and relIds.size() > 0">
and basic_udirel.id in
<foreach collection="relIds" item="item" index="index" separator="," open="(" close=")">
#{item}
</foreach>
</if>
</where>
limit 1
</select>
</mapper>

@ -30,79 +30,89 @@
<select id="filterUdiGp" parameterType="com.glxp.api.req.basic.CompanyProductRelevanceRequest"
resultType="com.glxp.api.res.basic.UdiRlSupResponse">
select company_product_relevance.id,
company_product_relevance.customerId,
company_product_relevance.auditStatus,
basic_udirel.thirdId,
basic_udirel.id rlId,
basic_udirel.isUseDy,
basic_udirel.isLock,
basic_udirel.thirdId1,
basic_udirel.thirdId2,
basic_udirel.thirdId3,
basic_udirel.thirdId4,
basic_udirel.isLock,
basic_udirel.mainId,
basic_udirel.isAdavence,
basic_products.id AS proId,
basic_products.originUuid,
basic_products.nameCode,
basic_products.deviceRecordKey,
basic_products.packRatio,
basic_products.packUnit,
basic_products.packLevel,
basic_products.bhxjsl,
basic_products.bhzxxsbzsl,
basic_products.zxxsbzbhsydysl,
basic_products.bhxjcpbm,
basic_products.bzcj,
basic_products.cpmctymc,
basic_products.cplb,
basic_products.flbm,
basic_products.ggxh,
basic_products.qxlb,
basic_products.tyshxydm,
basic_products.ylqxzcrbarmc,
basic_products.zczbhhzbapzbh,
basic_products.ylqxzcrbarywmc,
basic_products.sydycpbs,
basic_products.sjcpbm,
basic_products.versionNumber,
basic_products.diType,
basic_products.ybbm,
basic_products.sptm,
basic_products.manufactory,
basic_products.measname,
basic_products.productType,
basic_products.scbssfbhph,
basic_products.scbssfbhxlh,
basic_products.scbssfbhscrq,
basic_products.scbssfbhsxrq,
basic_products.cpms,
basic_products.allowNoBatch,
basic_products.allowNoExpire,
basic_products.allowNoProduct,
basic_products.spmc,
basic_products.cplx,
basic_products.hchzsb,
basic_products.cpdls,
basic_products.price,
basic_products.basicPrductRemak1,
basic_products.basicPrductRemak2,
basic_products.basicPrductRemak3,
basic_products.basicPrductRemak4,
basic_products.basicPrductRemak5,
basic_products.basicPrductRemak6,
basic_products.basicPrductRemak7,
basic_products.basicPrductRemak8,
basic_corp.name companyName,
basic_products.price
FROM company_product_relevance
inner JOIN basic_udirel
ON company_product_relevance.udiRlIdFk = basic_udirel.id
inner JOIN basic_products
ON basic_udirel.uuid = basic_products.uuid
left JOIN basic_corp on basic_corp.erpId = company_product_relevance.customerId
company_product_relevance.customerId,
company_product_relevance.auditStatus,
company_product_relevance.price,
basic_udirel.uuid,
basic_udirel.thirdId,
basic_udirel.id rlId,
basic_udirel.isUseDy,
basic_udirel.useMuti,
basic_udirel.isLock,
basic_udirel.thirdId1,
basic_udirel.thirdId2,
basic_udirel.thirdId3,
basic_udirel.thirdId4,
basic_udirel.lockStatus,
basic_udirel.mainId,
basic_udirel.isAdavence,
basic_udirel.lowStockNum,
basic_udirel.overStockNum,
basic_udirel.recentDateTime,
basic_udirel.isDateBy,
bht.name classifyName,
basic_products.id as PRId,
basic_products.originUuid,
basic_products.nameCode,
basic_products.deviceRecordKey,
basic_products.packRatio,
basic_products.packUnit,
basic_products.packLevel,
basic_products.bhxjsl,
basic_products.bhzxxsbzsl,
basic_products.zxxsbzbhsydysl,
basic_products.bhxjcpbm,
basic_products.bzcj,
basic_products.cpmctymc,
basic_products.cplb,
basic_products.flbm,
basic_products.ggxh,
basic_products.qxlb,
basic_products.tyshxydm,
basic_products.ylqxzcrbarmc,
basic_products.zczbhhzbapzbh,
basic_products.ylqxzcrbarywmc,
basic_products.sydycpbs,
basic_products.sjcpbm,
basic_products.versionNumber,
basic_products.diType,
basic_products.ybbm,
basic_products.sptm,
basic_products.manufactory,
basic_products.measname,
basic_products.productType,
basic_products.scbssfbhph,
basic_products.scbssfbhxlh,
basic_products.scbssfbhscrq,
basic_products.scbssfbhsxrq,
basic_products.cpms,
basic_products.allowNoBatch,
basic_products.allowNoExpire,
basic_products.allowNoProduct,
basic_products.allowNoSerial,
basic_products.spmc,
basic_products.cplx,
basic_products.hchzsb,
basic_products.cpdls,
basic_products.basicPrductRemak1,
basic_products.basicPrductRemak2,
basic_products.basicPrductRemak3,
basic_products.basicPrductRemak4,
basic_products.basicPrductRemak5,
basic_products.basicPrductRemak6,
basic_products.basicPrductRemak7,
basic_products.basicPrductRemak8,
basic_corp.name companyName
FROM company_product_relevance
inner JOIN basic_udirel
ON company_product_relevance.udiRlIdFk = basic_udirel.id
inner JOIN basic_products
ON basic_udirel.uuid = basic_products.uuid
left JOIN basic_corp on basic_corp.erpId = company_product_relevance.customerId
left join basic_hosp_type bht on basic_udirel.relCode = bht.code
<where>
<if test="ylqxzcrbarmc != '' and ylqxzcrbarmc != null">
AND ylqxzcrbarmc LIKE concat(#{ylqxzcrbarmc}, '%')
@ -118,19 +128,19 @@
</if>
<if test="unionCode != '' and unionCode != null">
and (
nameCode LIKE concat('%', #{unionCode}, '%')
or basic_products.ybbm LIKE concat('%', #{unionCode}, '%')
or basic_products.sptm LIKE concat('%', #{unionCode}, '%')
)
nameCode LIKE concat('%', #{unionCode}, '%')
or basic_products.ybbm LIKE concat('%', #{unionCode}, '%')
or basic_products.sptm LIKE concat('%', #{unionCode}, '%')
)
</if>
<if test="thrPiId != '' and thrPiId != null">
and (
basic_udirel.thirdId LIKE concat('%', #{thrPiId}, '%')
or basic_udirel.thirdId1 LIKE concat('%', #{thrPiId}, '%')
or basic_udirel.thirdId2 LIKE concat('%', #{thrPiId}, '%')
or basic_udirel.thirdId3 LIKE concat('%', #{thrPiId}, '%')
or basic_udirel.thirdId4 LIKE concat('%', #{thrPiId}, '%')
)
basic_udirel.thirdId LIKE concat('%', #{thrPiId}, '%')
or basic_udirel.thirdId1 LIKE concat('%', #{thrPiId}, '%')
or basic_udirel.thirdId2 LIKE concat('%', #{thrPiId}, '%')
or basic_udirel.thirdId3 LIKE concat('%', #{thrPiId}, '%')
or basic_udirel.thirdId4 LIKE concat('%', #{thrPiId}, '%')
)
</if>
<if test="uuid != '' and uuid != null">
AND basic_udirel.uuid = #{uuid}
@ -146,15 +156,15 @@
</if>
<if test="filterType != null and filterType == 1">
AND (basic_udirel.thirdId <![CDATA[<>]]> '' or basic_udirel.thirdId1 <![CDATA[<>]]> '' or
basic_udirel.thirdId2 <![CDATA[<>]]> '' or
basic_udirel.thirdId3 <![CDATA[<>]]> '' or basic_udirel.thirdId4 <![CDATA[<>]]> '')
basic_udirel.thirdId2 <![CDATA[<>]]> '' or
basic_udirel.thirdId3 <![CDATA[<>]]> '' or basic_udirel.thirdId4 <![CDATA[<>]]> '')
and basic_products.originUuid <![CDATA[<>]]> ''
</if>
<if test="filterType != null and filterType == 2">
AND basic_products.originUuid is NULL
</if>
<if test="filterType != null and filterType == 3">
AND basic_udirel.thirdId is NULL
AND (basic_udirel.thirdId IS NULL or basic_udirel.thirdId='')
and basic_products.originUuid <![CDATA[<>]]> ''
</if>
<if test="filterType != null and filterType == 4">
@ -202,7 +212,7 @@
AND (basic_udirel.isDisable is null or basic_udirel.isDisable = false)
</if>
</where>
ORDER BY basic_udirel.updateTime DESC
ORDER BY company_product_relevance.updateTime DESC
</select>
@ -225,7 +235,7 @@
SELECT *
FROM company_product_relevance
where udiRlIdFk = #{udiRlIdFk}
and customerId = #{customerId}
and customerId = #{customerId}
</select>
@ -275,45 +285,45 @@
<insert id="insertCompanyProductRelevance"
parameterType="com.glxp.api.entity.basic.UdiRlSupEntity">
replace
INTO company_product_relevance(customerId, productId, enterpriseId, registrationId,
createTime, updateTime, auditStatus, productUuid, udiRlIdFk, unitFk,
price, createUser, updateUser)
INTO company_product_relevance(customerId, productId, enterpriseId, registrationId,
createTime, updateTime, auditStatus, productUuid, udiRlIdFk, unitFk,
price, createUser, updateUser)
values (#{customerId},
#{productId},
#{enterpriseId},
#{registrationId},
#{createTime},
#{updateTime},
#{auditStatus},
#{productUuid},
#{udiRlIdFk},
#{unitFk},
#{price},
#{createUser},
#{updateUser})
#{productId},
#{enterpriseId},
#{registrationId},
#{createTime},
#{updateTime},
#{auditStatus},
#{productUuid},
#{udiRlIdFk},
#{unitFk},
#{price},
#{createUser},
#{updateUser})
</insert>
<insert id="importCompanyProductRelevance"
parameterType="com.glxp.api.entity.basic.UdiRlSupEntity">
replace
INTO company_product_relevance(id, customerId, productId, enterpriseId, registrationId,
createTime, updateTime, auditStatus, productUuid, udiRlIdFk, unitFk,
price, createUser, updateUser)
INTO company_product_relevance(id, customerId, productId, enterpriseId, registrationId,
createTime, updateTime, auditStatus, productUuid, udiRlIdFk, unitFk,
price, createUser, updateUser)
values (#{id},
#{customerId},
#{productId},
#{enterpriseId},
#{registrationId},
#{createTime},
#{updateTime},
#{auditStatus},
#{productUuid},
#{udiRlIdFk},
#{unitFk},
#{price},
#{createUser},
#{updateUser})
#{customerId},
#{productId},
#{enterpriseId},
#{registrationId},
#{createTime},
#{updateTime},
#{auditStatus},
#{productUuid},
#{udiRlIdFk},
#{unitFk},
#{price},
#{createUser},
#{updateUser})
</insert>
<delete id="deleteById" parameterType="Map">
@ -340,4 +350,20 @@
from company_product_relevance
where udiRlIdFk = #{relId}
</select>
<select id="selectSupRlCount" resultType="java.lang.Long">
select count(*)
FROM company_product_relevance
inner JOIN basic_udirel
ON company_product_relevance.udiRlIdFk = basic_udirel.id
inner JOIN basic_products ON basic_udirel.uuid = basic_products.uuid
<where>
<if test="nameCode != '' and nameCode != null">
AND nameCode LIKE concat(#{nameCode}, '%')
</if>
<if test="unitFk != null and unitFk != ''">
and unitFk = #{unitFk}
</if>
</where>
</select>
</mapper>

Loading…
Cancel
Save