接口转发
parent
7794dc5ac8
commit
b2c400afde
@ -1,55 +1,88 @@
|
||||
package com.glxp.api.controller.basic;
|
||||
|
||||
import cn.hutool.core.collection.CollUtil;
|
||||
import cn.hutool.core.util.IdUtil;
|
||||
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.*;
|
||||
|
||||
import com.glxp.api.service.basic.UdiRlSupService;
|
||||
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.req.basic.CompanyProductRelevanceRequest;
|
||||
import com.glxp.api.req.basic.UdiInfoExportRequest;
|
||||
import com.glxp.api.res.basic.CompanyProductRelevanceResponse;
|
||||
import com.glxp.api.service.basic.CompanyProductRelevanceService;
|
||||
import com.glxp.api.service.basic.CompanyProductsRelService;
|
||||
import com.glxp.api.service.basic.UdiProductService;
|
||||
import com.glxp.api.service.basic.UdiRelevanceService;
|
||||
import com.glxp.api.service.system.CompanyService;
|
||||
import com.glxp.api.util.SupplementVailUtil;
|
||||
import org.springframework.beans.BeanUtils;
|
||||
import org.springframework.web.bind.annotation.PostMapping;
|
||||
import org.springframework.web.bind.annotation.RequestBody;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
import org.springframework.web.context.request.RequestContextHolder;
|
||||
import org.springframework.web.context.request.ServletRequestAttributes;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
import javax.servlet.http.HttpServletRequest;
|
||||
import java.util.ArrayList;
|
||||
import java.util.Date;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 供应商关联耗材字典信息
|
||||
*/
|
||||
@RestController
|
||||
public class UdiRlSupController extends BaseController {
|
||||
public class UdiRlSupController {
|
||||
@Resource
|
||||
private UdiRlSupService udiRlSupService;
|
||||
|
||||
|
||||
private CompanyService companyService;
|
||||
@Resource
|
||||
private CompanyProductRelevanceService companyProductRelevanceService;
|
||||
@Resource
|
||||
private SupplementVailUtil supplementVailUtil;
|
||||
@Resource
|
||||
private UdiProductService udiProductService;
|
||||
@Resource
|
||||
private UdiRelevanceService udiRelevanceService;
|
||||
@Resource
|
||||
private CompanyProductsRelService companyProductsRelService;
|
||||
|
||||
@AuthRuleAnnotation("")
|
||||
@PostMapping("/sale/info/insertCompanyProductRelevance")
|
||||
@PostMapping("/sale/info/insertFilter")
|
||||
@Log(title = "单据管理", businessType = BusinessType.INSERT)
|
||||
public BaseResponse insertCompanyProductRelevance(@RequestBody UdiRlSupEntity udiRlSupEntity) {
|
||||
if (udiRlSupService.findCompanyProductRelevanceByProductUuid(udiRlSupEntity) != null) {
|
||||
return ResultVOUtils.error(ResultEnum.DATA_REPEAT);
|
||||
public BaseResponse insertFilter(@RequestBody UdiInfoExportRequest udiInfoExportRequest) {
|
||||
CompanyEntity companyEntity = companyService.findCompany(udiInfoExportRequest.getCustomerId() + "");
|
||||
if (companyEntity != null) {
|
||||
if ("110".equals(companyEntity.getUnitIdFk())) {
|
||||
udiInfoExportRequest.setUnitFk(null);
|
||||
} else {
|
||||
udiInfoExportRequest.setUnitFk(companyEntity.getUnitIdFk());
|
||||
}
|
||||
}
|
||||
udiRlSupEntity.setUnitFk(null);
|
||||
udiRlSupEntity.setCreateTime(new Date());
|
||||
udiRlSupEntity.setUpdateTime(new Date());
|
||||
udiRlSupEntity.setAuditStatus("3");
|
||||
boolean b = udiRlSupService.insertCompanyProductRelevance(udiRlSupEntity);
|
||||
return ResultVOUtils.success("成功");
|
||||
}
|
||||
//查询本企业有没有选择该产品有选择不能选择
|
||||
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, "该企业已选择该产品,请勿重复选择!");
|
||||
}
|
||||
}
|
||||
|
||||
String vailResult = supplementVailUtil.vail(udiInfoExportRequest.getSupplementRequest(), SupplementVailUtil.SUP_SELECT);
|
||||
if (vailResult != null)
|
||||
return ResultVOUtils.error(500, vailResult);
|
||||
companyProductsRelService.insertCompanyProducts(udiInfoExportRequest);
|
||||
|
||||
UdiRelevanceEntity udiRelevanceEntity = new UdiRelevanceEntity();
|
||||
udiRelevanceEntity.setId(Long.parseLong(rlidStr));
|
||||
udiRelevanceEntity.setLockStatus(1);
|
||||
udiRelevanceService.updateUdiRelevance(udiRelevanceEntity);
|
||||
UdiProductEntity udiProductEntity = new UdiProductEntity();
|
||||
BeanUtils.copyProperties(udiInfoExportRequest.getSupplementRequest(), udiProductEntity);
|
||||
udiProductEntity.setId(IdUtil.getSnowflakeNextId());
|
||||
udiProductService.insertUdiInfo(udiProductEntity);
|
||||
return ResultVOUtils.success("选入成功!");
|
||||
}
|
||||
}
|
||||
|
@ -0,0 +1,17 @@
|
||||
package com.glxp.api.dao.basic;
|
||||
|
||||
|
||||
import com.glxp.api.entity.basic.BasicProductSetEntity;
|
||||
import com.glxp.api.req.basic.FilterBasicProductSetrequest;
|
||||
import org.apache.ibatis.annotations.Mapper;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
@Mapper
|
||||
public interface BasicProductSetDao {
|
||||
|
||||
List<BasicProductSetEntity> filterSetup(FilterBasicProductSetrequest filterBasicProductSetrequest);
|
||||
|
||||
boolean updateSetup(BasicProductSetEntity basicProductSetEntity);
|
||||
|
||||
}
|
@ -0,0 +1,24 @@
|
||||
package com.glxp.api.dao.basic;
|
||||
|
||||
|
||||
import com.glxp.api.dao.BaseMapperPlus;
|
||||
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> {
|
||||
|
||||
List<CompanyProductRelevanceResponse> filterUdiGp(CompanyProductRelevanceRequest basicInstrumentMaintainRequest);
|
||||
|
||||
boolean insertCompanyProductRelevance(CompanyProductRelevanceEntity companyCertEntity);
|
||||
|
||||
boolean importCompanyProductRelevance(CompanyProductRelevanceEntity companyProductRelevanceEntity);
|
||||
|
||||
boolean deleteById(String id);
|
||||
|
||||
boolean deleteByRlId(String id);
|
||||
}
|
@ -0,0 +1,13 @@
|
||||
package com.glxp.api.entity.auth;
|
||||
|
||||
import lombok.Data;
|
||||
|
||||
@Data
|
||||
public class AliKeyEntity {
|
||||
|
||||
private String refEntId;
|
||||
private String entId;
|
||||
private String appKey;
|
||||
private String appSecret;
|
||||
|
||||
}
|
@ -0,0 +1,18 @@
|
||||
package com.glxp.api.req.auth;
|
||||
|
||||
import com.glxp.api.util.page.ListPageRequest;
|
||||
import lombok.Data;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
@Data
|
||||
public class FilterCompanyRequest extends ListPageRequest {
|
||||
|
||||
private String customerId;
|
||||
private String companyName;
|
||||
private String creditNum;
|
||||
private String auditStatus;
|
||||
private String unitIdFk;
|
||||
|
||||
private List<String> auditStatusList;
|
||||
}
|
@ -0,0 +1,19 @@
|
||||
package com.glxp.api.service.basic;
|
||||
|
||||
|
||||
import com.glxp.api.entity.basic.BasicProductSetEntity;
|
||||
import com.glxp.api.req.basic.FilterBasicProductSetrequest;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
public interface BasicProductSetService {
|
||||
|
||||
List<BasicProductSetEntity> filterSetup(FilterBasicProductSetrequest filterBasicProductSetrequest);
|
||||
|
||||
Map<String, BasicProductSetEntity> filterAllEnable();
|
||||
|
||||
|
||||
boolean updateSetup(BasicProductSetEntity basicProductSetEntity);
|
||||
|
||||
}
|
@ -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);
|
||||
}
|
@ -0,0 +1,97 @@
|
||||
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.UdiRelevanceEntity;
|
||||
import com.glxp.api.req.basic.SupplementRequest;
|
||||
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;
|
||||
|
||||
@Service
|
||||
public class CompanyProductsRelService {
|
||||
|
||||
@Resource
|
||||
UdiRelevanceService udiRelevanceService;
|
||||
@Resource
|
||||
UdiProductService udiProductService;
|
||||
@Resource
|
||||
CompanyProductRelevanceService companyProductRelevanceService;
|
||||
|
||||
@Async
|
||||
public void insertCompanyProducts(UdiInfoExportRequest udiInfoExportRequest) {
|
||||
//选中导出
|
||||
if (udiInfoExportRequest.getRlIds().size() > 0) {
|
||||
if (udiInfoExportRequest.getRlIds() != null) {
|
||||
List<String> rlIdS = udiInfoExportRequest.getRlIds();
|
||||
for (String uuid : rlIdS) {
|
||||
CompanyProductRelevanceEntity companyProductRelevanceEntity = new CompanyProductRelevanceEntity();
|
||||
UdiRelevanceEntity udiRelevanceEntity = udiRelevanceService.selectById(Long.valueOf(uuid));
|
||||
UdiInfoRequest udiInfoRequest = new UdiInfoRequest();
|
||||
udiInfoRequest.setUuid(udiRelevanceEntity.getUuid());
|
||||
SupplementRequest supplementRequest = udiInfoExportRequest.getSupplementRequest();
|
||||
BeanUtils.copyProperties(udiInfoExportRequest.getSupplementRequest(), udiInfoRequest);
|
||||
BeanUtils.copyProperties(supplementRequest, udiRelevanceEntity);
|
||||
udiRelevanceService.updateUdiRelevance(udiRelevanceEntity);
|
||||
udiProductService.updateUdiInfoNotAll(udiInfoRequest);
|
||||
companyProductRelevanceEntity.setCreateTime(new Date());
|
||||
if (udiInfoExportRequest.getPrice() != null) {
|
||||
companyProductRelevanceEntity.setPrice(new BigDecimal(udiInfoExportRequest.getPrice()));
|
||||
}
|
||||
companyProductRelevanceEntity.setUpdateTime(new Date());
|
||||
companyProductRelevanceEntity.setAuditStatus("3");
|
||||
companyProductRelevanceEntity.setUnitFk(udiInfoExportRequest.getUnitFk());
|
||||
companyProductRelevanceEntity.setUdiRlIdFk(Long.valueOf(uuid));
|
||||
if (StrUtil.isNotEmpty(udiInfoExportRequest.getSupplementRequest().getPrice())) {
|
||||
companyProductRelevanceEntity.setPrice(new BigDecimal(udiInfoExportRequest.getSupplementRequest().getPrice()));
|
||||
}
|
||||
companyProductRelevanceEntity.setCustomerId(udiInfoExportRequest.getCustomerId() + "");
|
||||
boolean b = companyProductRelevanceService.insertCompanyProductRelevance(companyProductRelevanceEntity);
|
||||
|
||||
|
||||
}
|
||||
|
||||
} else {//一键导出 //todo暂时去掉
|
||||
// FilterUdiInfoRequest filterUdiInfoRequest = new FilterUdiInfoRequest();
|
||||
// BeanUtils.copyProperties(udiInfoExportRequest, filterUdiInfoRequest);
|
||||
// filterUdiInfoRequest.setPage(null);
|
||||
// List<UdiRelevanceResponse> udiRelevanceResponses = udiRelevanceService.filterUdiRelevance(filterUdiInfoRequest);
|
||||
// for (UdiRelevanceResponse udiRelevanceResponse : udiRelevanceResponses) {
|
||||
// CompanyProductRelevanceEntity companyProductRelevanceEntity = new CompanyProductRelevanceEntity();
|
||||
// companyProductRelevanceEntity.setCreate_time(new Date());
|
||||
// companyProductRelevanceEntity.setUpdate_time(new Date());
|
||||
// companyProductRelevanceEntity.setAuditStatus("3");
|
||||
// companyProductRelevanceEntity.setUnitFk(udiInfoExportRequest.getUnitFk());
|
||||
// companyProductRelevanceEntity.setUdiRlIdFk(udiRelevanceResponse.getId());
|
||||
// companyProductRelevanceEntity.setProductUuid(udiRelevanceResponse.getUuid());
|
||||
// companyProductRelevanceEntity.setCustomerId(udiInfoExportRequest.getCustomerId());
|
||||
// boolean b = companyProductRelevanceService.insertCompanyProductRelevance(companyProductRelevanceEntity);
|
||||
// }
|
||||
}
|
||||
} else {//一键导出 //todo暂时去掉
|
||||
// FilterUdiInfoRequest filterUdiInfoRequest = new FilterUdiInfoRequest();
|
||||
// BeanUtils.copyProperties(udiInfoExportRequest, filterUdiInfoRequest);
|
||||
// filterUdiInfoRequest.setPage(null);
|
||||
// List<UdiRelevanceResponse> udiRelevanceResponses = udiRelevanceService.filterUdiRelevance(filterUdiInfoRequest);
|
||||
// for (UdiRelevanceResponse udiRelevanceResponse : udiRelevanceResponses) {
|
||||
// CompanyProductRelevanceEntity companyProductRelevanceEntity = new CompanyProductRelevanceEntity();
|
||||
// companyProductRelevanceEntity.setCreate_time(new Date());
|
||||
// companyProductRelevanceEntity.setUpdate_time(new Date());
|
||||
// companyProductRelevanceEntity.setAuditStatus("3");
|
||||
// companyProductRelevanceEntity.setUnitFk(udiInfoExportRequest.getUnitFk());
|
||||
// companyProductRelevanceEntity.setUdiRlIdFk(udiRelevanceResponse.getId());
|
||||
// companyProductRelevanceEntity.setProductUuid(udiRelevanceResponse.getUuid());
|
||||
// companyProductRelevanceEntity.setCustomerId(udiInfoExportRequest.getCustomerId());
|
||||
// boolean b = companyProductRelevanceService.insertCompanyProductRelevance(companyProductRelevanceEntity);
|
||||
// }
|
||||
}
|
||||
}
|
||||
|
||||
}
|
@ -0,0 +1,64 @@
|
||||
package com.glxp.api.service.basic;
|
||||
|
||||
import com.glxp.api.entity.basic.UdiProductEntity;
|
||||
import com.glxp.api.req.basic.FilterUdiRelRequest;
|
||||
import com.glxp.api.req.basic.UdiInfoRequest;
|
||||
import com.glxp.api.res.basic.UdiRelevanceResponse;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 耗材字典-字典信息
|
||||
*/
|
||||
public interface UdiProductService {
|
||||
|
||||
List<UdiProductEntity> filterUdiInfo(FilterUdiRelRequest filterUdiRelRequest);
|
||||
|
||||
UdiProductEntity findBySptm(String sptm);
|
||||
|
||||
List<UdiRelevanceResponse> filterUdiInfo2(FilterUdiRelRequest filterUdiRelRequest);
|
||||
|
||||
List<UdiProductEntity> filterAllUdiInfo(FilterUdiRelRequest filterUdiRelRequest);
|
||||
|
||||
UdiProductEntity findByNameCode(String nameCode);
|
||||
|
||||
UdiProductEntity findById(String id);
|
||||
|
||||
UdiProductEntity findByUuid(String uuid);
|
||||
|
||||
List<UdiProductEntity> findByUuids(String uuid);
|
||||
|
||||
List<UdiProductEntity> findByOriginUuid(String originUuid);
|
||||
|
||||
boolean insertUdiInfo(UdiProductEntity udiProductEntity);
|
||||
|
||||
boolean insertUdiInfos(List<UdiProductEntity> udiInfoEntities);
|
||||
|
||||
boolean updateUdiInfo(UdiProductEntity udiProductEntity);
|
||||
|
||||
boolean updateUdiInfoByUuid(UdiProductEntity udiProductEntity);
|
||||
|
||||
boolean updateUdiInfoById(UdiProductEntity udiProductEntity);
|
||||
|
||||
boolean deleteById(String id);
|
||||
|
||||
boolean deleteByUuid(String uuid);
|
||||
|
||||
/**
|
||||
* 查询产品规格型号列表
|
||||
*
|
||||
* @param relId
|
||||
* @return
|
||||
*/
|
||||
List<String> getGgxhList(String relId);
|
||||
|
||||
boolean updateUdiInfoNotAll(UdiInfoRequest udiInfoRequest);
|
||||
|
||||
/**
|
||||
* 根据DI查询此产品是否允许无批次号
|
||||
*
|
||||
* @param nameCode
|
||||
* @return
|
||||
*/
|
||||
UdiProductEntity getAllowNoBatch(String nameCode);
|
||||
}
|
@ -0,0 +1,60 @@
|
||||
package com.glxp.api.service.basic.impl;
|
||||
|
||||
import cn.hutool.core.collection.CollUtil;
|
||||
import com.github.pagehelper.PageHelper;
|
||||
import com.glxp.api.dao.basic.BasicProductSetDao;
|
||||
import com.glxp.api.entity.basic.BasicProductSetEntity;
|
||||
import com.glxp.api.req.basic.FilterBasicProductSetrequest;
|
||||
import com.glxp.api.service.basic.BasicProductSetService;
|
||||
import org.springframework.stereotype.Service;
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
import java.util.Collections;
|
||||
import java.util.HashMap;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
@Service
|
||||
@Transactional(rollbackFor = Exception.class)
|
||||
public class BasicProductSetServiceImpl implements BasicProductSetService {
|
||||
@Resource
|
||||
BasicProductSetDao basicProductSetDao;
|
||||
|
||||
@Override
|
||||
public List<BasicProductSetEntity> filterSetup(FilterBasicProductSetrequest filterBasicProductSetrequest) {
|
||||
if (filterBasicProductSetrequest == null) {
|
||||
return Collections.emptyList();
|
||||
}
|
||||
if (filterBasicProductSetrequest.getPage() != null) {
|
||||
int offset = (filterBasicProductSetrequest.getPage() - 1) * filterBasicProductSetrequest.getLimit();
|
||||
PageHelper.offsetPage(offset, filterBasicProductSetrequest.getLimit());
|
||||
}
|
||||
return basicProductSetDao.filterSetup(filterBasicProductSetrequest);
|
||||
}
|
||||
|
||||
@Override
|
||||
public Map<String, BasicProductSetEntity> filterAllEnable() {
|
||||
|
||||
FilterBasicProductSetrequest filterBasicProductSetrequest = new FilterBasicProductSetrequest();
|
||||
filterBasicProductSetrequest.setEnable(true);
|
||||
List<BasicProductSetEntity> basicProductSetEntities = basicProductSetDao.filterSetup(filterBasicProductSetrequest);
|
||||
|
||||
Map<String, BasicProductSetEntity> basicProductSetEntityMap = new HashMap<>();
|
||||
|
||||
if (CollUtil.isNotEmpty(basicProductSetEntities)) {
|
||||
for (BasicProductSetEntity basicProductSetEntity : basicProductSetEntities) {
|
||||
basicProductSetEntityMap.put(basicProductSetEntity.getParmKey(), basicProductSetEntity);
|
||||
}
|
||||
}
|
||||
|
||||
return basicProductSetEntityMap;
|
||||
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean updateSetup(BasicProductSetEntity basicProductSetEntity) {
|
||||
return basicProductSetDao.updateSetup(basicProductSetEntity);
|
||||
}
|
||||
}
|
@ -0,0 +1,62 @@
|
||||
package com.glxp.api.service.basic.impl;
|
||||
|
||||
|
||||
import cn.hutool.core.util.IdUtil;
|
||||
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) {
|
||||
if (companyProductRelevanceEntity.getId() == null)
|
||||
companyProductRelevanceEntity.setId(IdUtil.getSnowflakeNextId());
|
||||
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));
|
||||
}
|
||||
}
|
@ -0,0 +1,169 @@
|
||||
package com.glxp.api.service.basic.impl;
|
||||
|
||||
import cn.hutool.core.collection.CollUtil;
|
||||
import cn.hutool.core.util.IdUtil;
|
||||
import cn.hutool.core.util.StrUtil;
|
||||
import com.github.pagehelper.PageHelper;
|
||||
import com.glxp.api.dao.basic.UdiProductDao;
|
||||
import com.glxp.api.entity.basic.UdiProductEntity;
|
||||
import com.glxp.api.req.basic.FilterUdiRelRequest;
|
||||
import com.glxp.api.req.basic.UdiInfoRequest;
|
||||
import com.glxp.api.res.basic.UdiRelevanceResponse;
|
||||
import com.glxp.api.service.basic.UdiProductService;
|
||||
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.Collections;
|
||||
import java.util.Date;
|
||||
import java.util.List;
|
||||
|
||||
@Service
|
||||
@Transactional(rollbackFor = Exception.class)
|
||||
public class UdiProductServiceImpl implements UdiProductService {
|
||||
|
||||
@Resource
|
||||
UdiProductDao udiProductDao;
|
||||
|
||||
@Override
|
||||
public List<UdiProductEntity> filterUdiInfo(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<UdiProductEntity> data = udiProductDao.filterUdiInfo(filterUdiRelRequest);
|
||||
return data;
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public UdiProductEntity findBySptm(String sptm) {
|
||||
FilterUdiRelRequest filterUdiRelRequest = new FilterUdiRelRequest();
|
||||
filterUdiRelRequest.setSptm(sptm);
|
||||
List<UdiProductEntity> data = udiProductDao.filterUdiInfo(filterUdiRelRequest);
|
||||
if (CollUtil.isNotEmpty(data)) {
|
||||
return data.get(0);
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<UdiRelevanceResponse> filterUdiInfo2(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 = udiProductDao.filterUdiInfo2(filterUdiRelRequest);
|
||||
return data;
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<UdiProductEntity> filterAllUdiInfo(FilterUdiRelRequest filterUdiRelRequest) {
|
||||
if (filterUdiRelRequest == null) {
|
||||
return Collections.emptyList();
|
||||
}
|
||||
List<UdiProductEntity> data = udiProductDao.filterUdiInfo(filterUdiRelRequest);
|
||||
return data;
|
||||
}
|
||||
|
||||
@Override
|
||||
public UdiProductEntity findByNameCode(String nameCode) {
|
||||
String prefix = FilterUdiUtils.getDiStr(nameCode);
|
||||
return udiProductDao.findByNameCode(prefix);
|
||||
}
|
||||
|
||||
@Override
|
||||
public UdiProductEntity findById(String id) {
|
||||
return udiProductDao.findById(id);
|
||||
}
|
||||
|
||||
@Override
|
||||
public UdiProductEntity findByUuid(String uuid) {
|
||||
return udiProductDao.findByUuid(uuid);
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<UdiProductEntity> findByUuids(String uuid) {
|
||||
return udiProductDao.findByUuids(uuid);
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<UdiProductEntity> findByOriginUuid(String originUuid) {
|
||||
return udiProductDao.findByOriginUuid(originUuid);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean insertUdiInfo(UdiProductEntity udiProductEntity) {
|
||||
udiProductEntity.setUpdateTime(new Date());
|
||||
if (udiProductEntity.getId() == null) {
|
||||
udiProductEntity.setId(IdUtil.getSnowflakeNextId());
|
||||
}
|
||||
return udiProductDao.insertUdiInfo(udiProductEntity);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean insertUdiInfos(List<UdiProductEntity> udiInfoEntities) {
|
||||
return udiProductDao.insertUdiInfos(udiInfoEntities);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean updateUdiInfo(UdiProductEntity udiProductEntity) {
|
||||
if (StrUtil.isEmpty(udiProductEntity.getNameCode()))
|
||||
return false;
|
||||
udiProductEntity.setUpdateTime(new Date());
|
||||
return udiProductDao.updateUdiInfo(udiProductEntity);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean updateUdiInfoByUuid(UdiProductEntity udiProductEntity) {
|
||||
if (StrUtil.isEmpty(udiProductEntity.getUuid()))
|
||||
return false;
|
||||
udiProductEntity.setUpdateTime(new Date());
|
||||
return udiProductDao.updateUdiInfoByUuid(udiProductEntity);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean updateUdiInfoById(UdiProductEntity udiProductEntity) {
|
||||
udiProductEntity.setUpdateTime(new Date());
|
||||
return udiProductDao.updateUdiInfoById(udiProductEntity);
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public boolean deleteById(String id) {
|
||||
return udiProductDao.deleteById(id);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean deleteByUuid(String uuid) {
|
||||
return udiProductDao.deleteByUuid(uuid);
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<String> getGgxhList(String relId) {
|
||||
return udiProductDao.selectGgxhList(relId);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean updateUdiInfoNotAll(UdiInfoRequest udiInfoRequest) {
|
||||
if (StrUtil.isEmpty(udiInfoRequest.getUuid()))
|
||||
return false;
|
||||
|
||||
return udiProductDao.updateUdiInfoNotAll(udiInfoRequest);
|
||||
}
|
||||
|
||||
@Override
|
||||
public UdiProductEntity getAllowNoBatch(String nameCode) {
|
||||
String di = FilterUdiUtils.getDiStr(nameCode);
|
||||
return udiProductDao.selectAllowNoBatch(di);
|
||||
}
|
||||
}
|
@ -0,0 +1,175 @@
|
||||
package com.glxp.api.util;
|
||||
|
||||
import cn.hutool.core.util.StrUtil;
|
||||
import com.glxp.api.entity.basic.BasicProductSetEntity;
|
||||
import com.glxp.api.entity.system.SystemParamConfigEntity;
|
||||
import com.glxp.api.req.basic.SupplementRequest;
|
||||
import com.glxp.api.service.basic.BasicProductSetService;
|
||||
import com.glxp.api.service.system.SystemParamConfigService;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
import java.util.Map;
|
||||
|
||||
@Service
|
||||
public class SupplementVailUtil {
|
||||
|
||||
@Resource
|
||||
BasicProductSetService basicProductSetService;
|
||||
@Resource
|
||||
SystemParamConfigService systemParamConfigService;
|
||||
|
||||
|
||||
public static final int SUP_SELECT = 1;
|
||||
public static final int SUP_ADD = 2;
|
||||
public static final int LOCAL_ADD = 3;
|
||||
public static final int LOCAL_EIDT = 4;
|
||||
|
||||
|
||||
public String vail(SupplementRequest supplementRequest, int type) {
|
||||
//验证产品信息是否必填
|
||||
Map<String, BasicProductSetEntity> basicProductSetEntityMap = basicProductSetService.filterAllEnable();
|
||||
Map<String, SystemParamConfigEntity> systemParamConfigEntityMap = systemParamConfigService.findBasicAll();
|
||||
if (basicProductSetEntityMap.size() > 0) {
|
||||
BasicProductSetEntity basicProductSetEntity = null;
|
||||
|
||||
basicProductSetEntity = basicProductSetEntityMap.get("sptm");
|
||||
if (isMustFill(type, basicProductSetEntity)) {
|
||||
if (StrUtil.isEmpty(supplementRequest.getSptm())) {
|
||||
return "商品条码不能为空";
|
||||
}
|
||||
}
|
||||
basicProductSetEntity = basicProductSetEntityMap.get("ybbm");
|
||||
if (isMustFill(type, basicProductSetEntity)) {
|
||||
if (StrUtil.isEmpty(supplementRequest.getYbbm())) {
|
||||
return "医保编码不能为空";
|
||||
}
|
||||
}
|
||||
basicProductSetEntity = basicProductSetEntityMap.get("measname");
|
||||
if (isMustFill(type, basicProductSetEntity)) {
|
||||
if (StrUtil.isEmptyIfStr(supplementRequest.getMeasname())) {
|
||||
return "计量单位不能为空";
|
||||
}
|
||||
}
|
||||
basicProductSetEntity = basicProductSetEntityMap.get("manufactory");
|
||||
if (isMustFill(type, basicProductSetEntity)) {
|
||||
if (StrUtil.isEmptyIfStr(supplementRequest.getManufactory())) {
|
||||
return "生产企业不能为空";
|
||||
}
|
||||
}
|
||||
|
||||
basicProductSetEntity = basicProductSetEntityMap.get("spmc");
|
||||
if (isMustFill(type, basicProductSetEntity)) {
|
||||
if (StrUtil.isEmptyIfStr(supplementRequest.getSpmc())) {
|
||||
return "商品名称不能为空";
|
||||
}
|
||||
}
|
||||
|
||||
basicProductSetEntity = basicProductSetEntityMap.get("cpms");
|
||||
if (isMustFill(type, basicProductSetEntity)) {
|
||||
if (StrUtil.isEmptyIfStr(supplementRequest.getCpms())) {
|
||||
return "产品描述不能为空";
|
||||
}
|
||||
}
|
||||
basicProductSetEntity = basicProductSetEntityMap.get("price");
|
||||
if (isMustFill(type, basicProductSetEntity)) {
|
||||
if (StrUtil.isEmptyIfStr(supplementRequest.getPrice())) {
|
||||
return "产品价格不能为空";
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
basicProductSetEntity = basicProductSetEntityMap.get("basicPrductRemak1");
|
||||
if (isMustFill(type, basicProductSetEntity)) {
|
||||
if (StrUtil.isEmpty(supplementRequest.getBasicPrductRemak1())) {
|
||||
SystemParamConfigEntity systemParamConfigEntity = systemParamConfigEntityMap.get("basicPrductRemak1");
|
||||
if (!systemParamConfigEntity.getParamValue().equals("0")) {
|
||||
return systemParamConfigEntity.getParamValue() + "不能为空";
|
||||
}
|
||||
}
|
||||
}
|
||||
basicProductSetEntity = basicProductSetEntityMap.get("basicPrductRemak2");
|
||||
if (isMustFill(type, basicProductSetEntity)) {
|
||||
if (StrUtil.isEmpty(supplementRequest.getBasicPrductRemak2())) {
|
||||
SystemParamConfigEntity systemParamConfigEntity = systemParamConfigEntityMap.get("basicPrductRemak2");
|
||||
if (!systemParamConfigEntity.getParamValue().equals("0")) {
|
||||
return systemParamConfigEntity.getParamValue() + "不能为空";
|
||||
}
|
||||
}
|
||||
}
|
||||
basicProductSetEntity = basicProductSetEntityMap.get("basicPrductRemak3");
|
||||
if (isMustFill(type, basicProductSetEntity)) {
|
||||
if (StrUtil.isEmpty(supplementRequest.getBasicPrductRemak3())) {
|
||||
SystemParamConfigEntity systemParamConfigEntity = systemParamConfigEntityMap.get("basicPrductRemak3");
|
||||
if (!systemParamConfigEntity.getParamValue().equals("0")) {
|
||||
return systemParamConfigEntity.getParamValue() + "不能为空";
|
||||
}
|
||||
}
|
||||
}
|
||||
basicProductSetEntity = basicProductSetEntityMap.get("basicPrductRemak4");
|
||||
if (isMustFill(type, basicProductSetEntity)) {
|
||||
if (StrUtil.isEmpty(supplementRequest.getBasicPrductRemak4())) {
|
||||
SystemParamConfigEntity systemParamConfigEntity = systemParamConfigEntityMap.get("basicPrductRemak4");
|
||||
if (!systemParamConfigEntity.getParamValue().equals("0")) {
|
||||
return systemParamConfigEntity.getParamValue() + "不能为空";
|
||||
}
|
||||
}
|
||||
}
|
||||
basicProductSetEntity = basicProductSetEntityMap.get("basicPrductRemak5");
|
||||
if (isMustFill(type, basicProductSetEntity)) {
|
||||
if (StrUtil.isEmpty(supplementRequest.getBasicPrductRemak5())) {
|
||||
SystemParamConfigEntity systemParamConfigEntity = systemParamConfigEntityMap.get("basicPrductRemak5");
|
||||
if (!systemParamConfigEntity.getParamValue().equals("0")) {
|
||||
return systemParamConfigEntity.getParamValue() + "不能为空";
|
||||
}
|
||||
}
|
||||
}
|
||||
basicProductSetEntity = basicProductSetEntityMap.get("basicPrductRemak6");
|
||||
if (isMustFill(type, basicProductSetEntity)) {
|
||||
if (StrUtil.isEmpty(supplementRequest.getBasicPrductRemak6())) {
|
||||
SystemParamConfigEntity systemParamConfigEntity = systemParamConfigEntityMap.get("basicPrductRemak6");
|
||||
if (!systemParamConfigEntity.getParamValue().equals("0")) {
|
||||
return systemParamConfigEntity.getParamValue() + "不能为空";
|
||||
}
|
||||
}
|
||||
}
|
||||
basicProductSetEntity = basicProductSetEntityMap.get("basicPrductRemak7");
|
||||
if (isMustFill(type, basicProductSetEntity)) {
|
||||
if (StrUtil.isEmpty(supplementRequest.getBasicPrductRemak7())) {
|
||||
SystemParamConfigEntity systemParamConfigEntity = systemParamConfigEntityMap.get("basicPrductRemak7");
|
||||
if (!systemParamConfigEntity.getParamValue().equals("0")) {
|
||||
return systemParamConfigEntity.getParamValue() + "不能为空";
|
||||
}
|
||||
}
|
||||
}
|
||||
basicProductSetEntity = basicProductSetEntityMap.get("basicPrductRemak8");
|
||||
if (isMustFill(type, basicProductSetEntity)) {
|
||||
if (StrUtil.isEmpty(supplementRequest.getBasicPrductRemak8())) {
|
||||
SystemParamConfigEntity systemParamConfigEntity = systemParamConfigEntityMap.get("basicPrductRemak8");
|
||||
if (!systemParamConfigEntity.getParamValue().equals("0")) {
|
||||
return systemParamConfigEntity.getParamValue() + "不能为空";
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
|
||||
public boolean isMustFill(int type, BasicProductSetEntity basicProductSetEntity) {
|
||||
if (basicProductSetEntity == null)
|
||||
return false;
|
||||
if (type == SUP_SELECT && basicProductSetEntity.isSupSelect()) {
|
||||
return true;
|
||||
} else if (type == SUP_ADD && basicProductSetEntity.isSupAdd()) {
|
||||
return true;
|
||||
} else if (type == LOCAL_ADD && basicProductSetEntity.isLocalAdd()) {
|
||||
return true;
|
||||
} else if (type == LOCAL_EIDT && basicProductSetEntity.isLocalEdit()) {
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
|
||||
}
|
||||
|
||||
}
|
@ -0,0 +1,42 @@
|
||||
<?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.BasicProductSetDao">
|
||||
|
||||
|
||||
<select id="filterSetup"
|
||||
parameterType="com.glxp.api.req.basic.FilterBasicProductSetrequest"
|
||||
resultType="com.glxp.api.entity.basic.BasicProductSetEntity">
|
||||
SELECT *
|
||||
FROM basic_product_set
|
||||
<where>
|
||||
<if test="parmName != '' and parmName!=null">
|
||||
and udiRlIdFk = #{udiRlIdFk}
|
||||
</if>
|
||||
<if test="enable != null ">
|
||||
and enable = #{enable}
|
||||
</if>
|
||||
</where>
|
||||
ORDER BY sort
|
||||
</select>
|
||||
|
||||
|
||||
<insert id="updateSetup" parameterType="com.glxp.api.entity.basic.BasicProductSetEntity">
|
||||
replace
|
||||
INTO basic_product_set(parmName,
|
||||
parmKey,enable,supSelect,supAdd,localAdd,remark,sort,localEdit) values
|
||||
(
|
||||
#{parmName},
|
||||
#{parmKey},
|
||||
#{enable} ,
|
||||
#{supSelect},
|
||||
#{supAdd},
|
||||
#{localAdd},
|
||||
#{remark},
|
||||
#{sort},
|
||||
#{localEdit}
|
||||
)
|
||||
</insert>
|
||||
|
||||
|
||||
</mapper>
|
@ -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" useGeneratedKeys="true"
|
||||
parameterType="com.glxp.api.entity.basic.CompanyProductRelevanceEntity">
|
||||
replace
|
||||
INTO company_product_relevance(id, customerId, productId, enterpriseId, registrationId,
|
||||
createTime, updateTime, auditStatus, productUuid, udiRlIdFk, unitFk,
|
||||
price)
|
||||
values (#{id}, #{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
Loading…
Reference in New Issue