接口转发

cert
schry 2 years ago
parent 7794dc5ac8
commit b2c400afde

@ -214,5 +214,18 @@ public class UdiRelevanceController extends BaseController {
return ResultVOUtils.success(pageSimpleResponse);
}
//资质证书选入产品列表 产品名称,生产企业过滤
@AuthRuleAnnotation("")
@GetMapping("/directToCpt/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);
}
}

@ -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("选入成功!");
}
}

@ -187,7 +187,7 @@ public class SupProductController {
@AuthRuleAnnotation("")
@PostMapping("/sup/product/modifyRegistration")
@PostMapping("/directToCpt/sup/product/modifyRegistration")
@Log(title = "资质证书", businessType = BusinessType.UPDATE)
public BaseResponse modifyRegistration(@RequestBody SupProductEntity supProductEntity) {

@ -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);
}

@ -12,11 +12,79 @@ import java.util.List;
@Mapper
public interface UdiProductDao {
List<UdiProductEntity> filterUdiInfo(FilterUdiRelRequest filterUdiRelRequest);
UdiProductEntity findByNameCode(@Param("nameCode") String nameCode);
UdiProductEntity findByUuid(@Param("uuid") String uuid);
List<UdiProductEntity> findByUuids(@Param("uuid") String uuid);
List<UdiProductEntity> findByOriginUuid(@Param("originUuid") String originUuid);
UdiProductEntity findById(@Param("id") String id);
boolean insertUdiInfo(UdiProductEntity udiProductEntity);
boolean insertUdiInfos(@Param("udiInfoEntities") List<UdiProductEntity> udiInfoEntities);
/**
* nameCode
*/
boolean updateUdiInfo(UdiProductEntity udiProductEntity);
/**
* UUID
*/
boolean updateUdiInfoByUuid(UdiProductEntity udiProductEntity);
/**
* ID
*/
boolean updateUdiInfoById(UdiProductEntity udiProductEntity);
boolean deleteById(@Param("id") String id);
boolean deleteByUuid(@Param("uuid") String uuid);
/**
* UUID
*/
List<UdiProductEntity> batchSelectByUuid(@Param("uuids") List<String> uuids);
List<UdiRelevanceResponse> filterUdiInfo2(FilterUdiRelRequest filterUdiRelRequest);
/**
*
*/
void importUdiInfo(@Param("udiInfoEntities") List<UdiProductEntity> udiInfoEntities);
/**
*
*
* @param nameCode
* @return
*/
Integer selectPackLevel(@Param("nameCode") String nameCode);
/**
*
*
* @param relId
* @return
*/
List<String> selectGgxhList(@Param("relId") String relId);
boolean updateUdiInfoNotAll(UdiInfoRequest udiInfoRequest);
/**
* DI
*
* @param nameCode
* @return
*/
UdiProductEntity selectAllowNoBatch(@Param("nameCode") String nameCode);
}

@ -1,8 +1,12 @@
package com.glxp.api.dao.system;
import com.glxp.api.entity.auth.AliKeyEntity;
import com.glxp.api.entity.system.CompanyEntity;
import com.glxp.api.req.auth.FilterCompanyRequest;
import org.apache.ibatis.annotations.Mapper;
import java.util.List;
@Mapper
public interface CompanyDao {
@ -11,4 +15,19 @@ public interface CompanyDao {
boolean modifyCompany(CompanyEntity companyEntity);
boolean insertCompany(CompanyEntity companyEntity);
CompanyEntity findCompany(String CustomerId);
CompanyEntity findCompanyByName(String companyName);
List<CompanyEntity> getSubCompany(FilterCompanyRequest companyRequest);
List<CompanyEntity> getSubCompany2(FilterCompanyRequest companyRequest);
List<CompanyEntity> filterCompany(FilterCompanyRequest companyRequest);
boolean deleteCompany(Long customerId);
AliKeyEntity findKey(String customerId);
}

@ -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;
}

@ -2,6 +2,8 @@ package com.glxp.api.entity.basic;
import lombok.Data;
import java.util.Date;
/**
*
*/
@ -77,6 +79,7 @@ public class UdiProductEntity {
private String relId;//关联ID主键
private Integer status;
private String supId;
private Date updateTime;
private Long relSupId;

@ -1,8 +1,12 @@
package com.glxp.api.entity.system;
import com.fasterxml.jackson.annotation.JsonFormat;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import java.util.Date;
@ApiModel(value = "公司实体")
@Data
public class CompanyEntity {
@ -24,4 +28,66 @@ public class CompanyEntity {
private String appSecret;
@ApiModelProperty(value = "审核评论")
private String auditComment;
private String companyName; //企业名称
private Integer bussinessStatus; //企业类型
private String creditNum; //统一社会信用代码
private String area;
private String areaCode;
private String detailAddr;
private String customerId;
private String contacts;
private String mobile;
private String tel;
private String email;
private String refEntId;
private String entId;
private int networkType;
private int certIdFk;
private String parentCompany;
private String parentIdFk;
private String contactsPapersType;
private String contactsPapersCode;
private String registerStatus;
private String jyxkzh;
private String jyxkzfzjg;
@JsonFormat(shape = JsonFormat.Shape.STRING, pattern = "yyyy-MM-dd")
private Date jyxkzyxq;
private String jybapzh;
private String jybabm;
@JsonFormat(shape = JsonFormat.Shape.STRING, pattern = "yyyy-MM-dd")
private Date fzrq;
private String suihao;
private String kaihuhang;
private String kaihuzhanghao;
private String auditStatus;
private String unitIdFk;
private String filePath;
private String newFilePath;
private String filePath2;
private String newFilePath2;
private String filePath3;
private String newFilePath3;
private String filePath4;
private String newFilePath4;
private String updateCause;
private String newAuditStatus;
private String noPassCause;
private String auditor;
private String auditStatusList;
}

@ -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);
}
}

@ -1,6 +1,10 @@
package com.glxp.api.service.system;
import com.glxp.api.entity.auth.AliKeyEntity;
import com.glxp.api.entity.system.CompanyEntity;
import com.glxp.api.req.auth.FilterCompanyRequest;
import java.util.List;
public interface CompanyService {
@ -8,4 +12,24 @@ public interface CompanyService {
boolean modifyCompany(CompanyEntity companyEntity);
CompanyEntity findCompanyByUnitFk(String unitFk);
List<CompanyEntity> filterCompany(FilterCompanyRequest companyRequest);
CompanyEntity findCompany(String CustomerId);
List<CompanyEntity> getSubCompany(FilterCompanyRequest commitRequest);
List<CompanyEntity> getSubCompany2(FilterCompanyRequest commitRequest);
CompanyEntity findCompanyByName(String companyName);
// boolean insertCompany(CompanyEntity companyEntity);
AliKeyEntity findKey(String customerId);
boolean deleteCompany(Long customerId);
boolean insertCompany(CompanyEntity companyEntity);
}

@ -1,12 +1,17 @@
package com.glxp.api.service.system.impl;
import com.github.pagehelper.PageHelper;
import com.glxp.api.dao.system.CompanyDao;
import com.glxp.api.entity.auth.AliKeyEntity;
import com.glxp.api.entity.system.CompanyEntity;
import com.glxp.api.req.auth.FilterCompanyRequest;
import com.glxp.api.service.system.CompanyService;
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)
@ -15,6 +20,54 @@ public class CompanyServiceImpl implements CompanyService {
@Resource
CompanyDao companyDao;
@Override
public CompanyEntity findCompanyByUnitFk(String unitFk) {
FilterCompanyRequest filterCompanyRequest = new FilterCompanyRequest();
filterCompanyRequest.setUnitIdFk(unitFk);
List<CompanyEntity> companyEntities = companyDao.filterCompany(filterCompanyRequest);
if (companyEntities != null && companyEntities.size() > 0) {
return companyEntities.get(0);
}
return null;
}
@Override
public List<CompanyEntity> filterCompany(FilterCompanyRequest companyRequest) {
return companyDao.filterCompany(companyRequest);
}
@Override
public CompanyEntity findCompany(String CustomerId) {
return companyDao.findCompany(CustomerId);
}
@Override
public List<CompanyEntity> getSubCompany(FilterCompanyRequest commitRequest) {
if (commitRequest == null) {
return Collections.emptyList();
}
int offset = (commitRequest.getPage() - 1) * commitRequest.getLimit();
PageHelper.offsetPage(offset, commitRequest.getLimit());
List<CompanyEntity> companyEntities = companyDao.getSubCompany(commitRequest);
return companyEntities;
}
@Override
public List<CompanyEntity> getSubCompany2(FilterCompanyRequest commitRequest) {
if (commitRequest == null) {
return Collections.emptyList();
}
int offset = (commitRequest.getPage() - 1) * commitRequest.getLimit();
PageHelper.offsetPage(offset, commitRequest.getLimit());
List<CompanyEntity> companyEntities = companyDao.getSubCompany2(commitRequest);
return companyEntities;
}
@Override
public CompanyEntity findCompanyByName(String companyName) {
return companyDao.findCompanyByName(companyName);
}
@Override
public CompanyEntity findCompany() {
return companyDao.findCompany();
@ -28,4 +81,18 @@ public class CompanyServiceImpl implements CompanyService {
} else
return companyDao.modifyCompany(companyEntity);
}
@Override
public boolean insertCompany(CompanyEntity companyEntity) {
return companyDao.insertCompany(companyEntity);
}
@Override
public AliKeyEntity findKey(String customerId) {
return companyDao.findKey(customerId);
}
@Override
public boolean deleteCompany(Long customerId) {
return companyDao.deleteCompany(customerId);
}
}

@ -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

@ -32,6 +32,277 @@
#{appId},
#{appSecret})
</insert>
<select id="findCompany" parameterType="java.lang.String"
resultType="com.glxp.api.entity.system.CompanyEntity">
SELECT *
FROM sup_company
where customerId = #{CustomerId}
</select>
<select id="filterCompany" parameterType="com.glxp.api.req.auth.FilterCompanyRequest"
resultType="com.glxp.api.entity.system.CompanyEntity">
SELECT *
FROM sup_company
<where>
<if test="customerId != null and customerId != ''">
and parentIdFk = #{customerId}
</if>
<if test="companyName != null and companyName != ''">
and companyName like concat('%', #{companyName}, '%')
</if>
<if test="creditNum != null and creditNum != ''">
and creditNum like concat('%', #{creditNum}, '%')
</if>
<if test="auditStatus != null and auditStatus != ''">
and auditStatus = #{auditStatus}
</if>
<if test="unitIdFk != null and unitIdFk != ''">
and unitIdFk = #{unitIdFk}
</if>
</where>
</select>
<delete id="deleteCompany" parameterType="java.lang.Long">
delete
from sup_company
where customerId = #{customerId}
</delete>
<select id="findCompanyByName" parameterType="java.lang.String"
resultType="com.glxp.api.entity.system.CompanyEntity">
SELECT *
FROM sup_company
where companyName = #{companyName}
</select>
<select id="getSubCompany" parameterType="com.glxp.api.req.auth.FilterCompanyRequest"
resultType="com.glxp.api.entity.system.CompanyEntity">
SELECT *
FROM sup_company
<where>
<if test="customerId != null and customerId != ''">
and parentIdFk = #{customerId}
</if>
<if test="companyName != null and companyName != ''">
and companyName like concat('%', #{companyName}, '%')
</if>
<if test="creditNum != null and creditNum != ''">
and creditNum like concat('%', #{creditNum}, '%')
</if>
<if test="auditStatus != null and auditStatus != ''">
and auditStatus = #{auditStatus}
</if>
<if test="unitIdFk != null and unitIdFk != ''">
and unitIdFk = #{unitIdFk}
</if>
<if test="(auditStatus == null or auditStatus == '') and auditStatusList != null and auditStatusList.size() > 0">
<foreach collection="auditStatusList" item="auditStatus" open="AND (" separator="OR" close=")">
auditStatus = #{auditStatus,jdbcType=VARCHAR}
</foreach>
</if>
</where>
</select>
<select id="getSubCompany2" parameterType="com.glxp.api.req.auth.FilterCompanyRequest"
resultType="com.glxp.api.entity.system.CompanyEntity">
SELECT *
FROM (sup_company
inner JOIN company_product_relevance
ON sup_company.customerId = company_product_relevance.customerId)
<where>
<if test="customerId != null and customerId != ''">
and parentIdFk = #{customerId}
</if>
<if test="companyName != null and companyName != ''">
and companyName like concat('%', #{companyName}, '%')
</if>
<if test="creditNum != null and creditNum != ''">
and creditNum like concat('%', #{creditNum}, '%')
</if>
<if test="auditStatus != null and auditStatus != ''">
and (sup_company.auditStatus = #{auditStatus}
or company_product_relevance.auditStatus = #{auditStatus}
)
</if>
<if test="(auditStatus == null or auditStatus == '') and auditStatusList != null and auditStatusList.size() > 0">
<foreach collection="auditStatusList" item="auditStatus" open="AND (" separator="OR" close=")">
auditStatus = #{auditStatus,jdbcType=VARCHAR}
</foreach>
</if>
</where>
</select>
<update id="modifyCompany" parameterType="com.glxp.api.entity.system.CompanyEntity">
UPDATE sup_company
<trim prefix="set" suffixOverrides=",">
<if test="companyName != null">
companyName=#{companyName},
</if>
<if test="bussinessStatus != null">
bussinessStatus=#{bussinessStatus},
</if>
<if test="creditNum != null">
creditNum=#{creditNum},
</if>
<if test="classes != null">
classes=#{classes},
</if>
<if test="area != null">
area=#{area},
</if>
<if test="detailAddr != null">
detailAddr=#{detailAddr},
</if>
<if test="appId != null">
appId=#{appId},
</if>
<if test="appSecret != null">
appSecret=#{appSecret},
</if>
<if test="contacts != null">
contacts=#{contacts},
</if>
<if test="mobile != null">
mobile=#{mobile},
</if>
<if test="tel != null">
tel=#{tel},
</if>
<if test="email != null">
email=#{email},
</if>
<if test="refEntId != null">
refEntId=#{refEntId},
</if>
<if test="entId != null">
entId=#{entId},
</if>
<if test="networkType != null">
networkType=#{networkType},
</if>
<if test="certIdFk != null">
certIdFk=#{certIdFk},
</if>
<if test="areaCode != null">
areaCode=#{areaCode},
</if>
<if test="parentCompany != null">
parentCompany=#{parentCompany},
</if>
<if test="parentIdFk != null">
parentIdFk=#{parentIdFk},
</if>
<if test="contactsPapersType != null">
contactsPapersType=#{contactsPapersType},
</if>
<if test="contactsPapersCode != null">
contactsPapersCode=#{contactsPapersCode},
</if>
<if test="registerStatus != null">
registerStatus=#{registerStatus},
</if>
<if test="jyxkzh != null">
jyxkzh=#{jyxkzh},
</if>
<if test="jyxkzfzjg != null">
jyxkzfzjg=#{jyxkzfzjg},
</if>
<if test="jyxkzyxq != null">
jyxkzyxq=#{jyxkzyxq},
</if>
<if test="jybapzh != null">
jybapzh=#{jybapzh},
</if>
<if test="jybabm != null">
jybabm=#{jybabm},
</if>
<if test="fzrq != null">
fzrq=#{fzrq},
</if>
<if test="suihao != null">
suihao=#{suihao},
</if>
<if test="kaihuhang != null">
kaihuhang=#{kaihuhang},
</if>
<if test="kaihuzhanghao != null">
kaihuzhanghao=#{kaihuzhanghao},
</if>
<if test="auditStatus != null">
auditStatus=#{auditStatus},
</if>
<if test="filePath != null">
filePath=#{filePath},
</if>
<if test="filePath2 != null">
filePath2=#{filePath2},
</if>
<if test="filePath3 != null">
filePath3=#{filePath3},
</if>
<if test="filePath4 != null">
filePath4=#{filePath4},
</if>
<if test="unitIdFk != null">
unitIdFk=#{unitIdFk},
</if>
</trim>
WHERE customerId = #{customerId}
</update>
<insert id="insertCompany" parameterType="com.glxp.api.entity.system.CompanyEntity">
INSERT INTO sup_company(companyName, bussinessStatus, creditNum, classes, area,
detailAddr, appId, appSecret, contacts, mobile, tel, email, customerId, areaCode,
refEntId, entId, networkType, certIdFk, parentCompany, parentIdFk,
contactsPapersType, contactsPapersCode, registerStatus, jyxkzh, jyxkzfzjg, jyxkzyxq,
jybapzh, jybabm, fzrq, suihao, kaihuhang, kaihuzhanghao, auditStatus,
filePath, filePath2, filePath3, filePath4, unitIdFk)
values (#{companyName},
#{bussinessStatus},
#{creditNum},
#{classes},
#{area},
#{detailAddr},
#{appId},
#{appSecret},
#{contacts},
#{mobile},
#{tel},
#{email},
#{customerId},
#{areaCode},
#{refEntId},
#{entId},
#{networkType},
#{certIdFk},
#{parentCompany},
#{parentIdFk},
#{contactsPapersType},
#{contactsPapersCode},
#{registerStatus},
#{jyxkzh},
#{jyxkzfzjg},
#{jyxkzyxq},
#{jybapzh},
#{jybabm},
#{fzrq},
#{suihao},
#{kaihuhang},
#{kaihuzhanghao},
#{auditStatus},
#{filePath},
#{filePath2},
#{filePath3},
#{filePath4}, #{unitIdFk})
</insert>
<select id="findKey" parameterType="java.lang.String"
resultType="com.glxp.api.entity.auth.AliKeyEntity">
SELECT sup_company.refEntId,
sup_company.entId,
alicert.appKey,
alicert.appSecret
from sup_company
INNER JOIN alicert on sup_company.certIdFk = alicert.id
where sup_company.customerId = #{customerId}
</select>
</mapper>
</mapper>

Loading…
Cancel
Save