Merge remote-tracking branch 'origin/master'

# Conflicts:
#	src/main/java/com/glxp/api/controller/purchase/SupProductController.java
master
薛宇 2 years ago
commit 9283b2cb56

@ -70,7 +70,8 @@ public class ResgitserCertController {
if (bindingResult.hasErrors()) {
return ResultVOUtils.error(ResultEnum.PARAM_VERIFY_FALL, bindingResult.getFieldError().getDefaultMessage());
}
certRequest.setBusinessId(Long.valueOf(getCompanyId()));
if (certRequest.getBusinessId() == null)
certRequest.setBusinessId(Long.valueOf(getCompanyId()));
List<UserCertEntity> userCertEntities = userCertService.selectBybId(certRequest);
PageInfo<UserCertEntity> pageInfo;
pageInfo = new PageInfo<>(userCertEntities);

@ -1,6 +1,8 @@
package com.glxp.api.controller.basic;
import cn.hutool.core.collection.CollUtil;
import cn.hutool.core.util.IdUtil;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.github.pagehelper.PageInfo;
import com.glxp.api.annotation.AuthRuleAnnotation;
import com.glxp.api.common.enums.ResultEnum;
@ -9,6 +11,7 @@ import com.glxp.api.common.util.ResultVOUtils;
import com.glxp.api.constant.ConstantStatus;
import com.glxp.api.entity.auth.AuthAdmin;
import com.glxp.api.entity.basic.BasicCorpEntity;
import com.glxp.api.entity.sup.UserCompanyEntity;
import com.glxp.api.exception.JsonException;
import com.glxp.api.req.basic.BasicUnitMaintainFilterRequest;
import com.glxp.api.req.system.DeleteRequest;
@ -16,6 +19,7 @@ import com.glxp.api.res.PageSimpleResponse;
import com.glxp.api.res.basic.BasicCorpResponse;
import com.glxp.api.service.auth.AuthAdminService;
import com.glxp.api.service.basic.BasicCorpService;
import com.glxp.api.service.sup.UserCompanyService;
import com.glxp.api.util.CustomUtil;
import org.springframework.beans.BeanUtils;
import org.springframework.validation.BindingResult;
@ -52,6 +56,8 @@ public class BasicCorpController {
}
List<BasicCorpResponse> basicUnitMaintainEntities;
basicUnitMaintainEntities = basicUnitMaintainService.filterList(basicUnitMaintainFilterRequest);
PageInfo<BasicCorpResponse> pageInfo = new PageInfo<>(basicUnitMaintainEntities);
PageSimpleResponse<BasicCorpResponse> pageSimpleResponse = new PageSimpleResponse<>();
pageSimpleResponse.setTotal(pageInfo.getTotal());
@ -60,6 +66,9 @@ public class BasicCorpController {
return ResultVOUtils.success(pageSimpleResponse);
}
@Resource
UserCompanyService userCompanyService;
@GetMapping("/udiwms/basic/unit/app/filter")
public BaseResponse filterAppBasicUnit(BasicUnitMaintainFilterRequest basicUnitMaintainFilterRequest,
BindingResult bindingResult) {
@ -67,14 +76,25 @@ public class BasicCorpController {
if (bindingResult.hasErrors()) {
return ResultVOUtils.error(ResultEnum.PARAM_VERIFY_FALL, bindingResult.getFieldError().getDefaultMessage());
}
if (basicUnitMaintainFilterRequest.getCompanyIdFk() == null)
return ResultVOUtils.error(500, "企业ID不能为空");
List<BasicCorpResponse> basicUnitMaintainEntities;
long customerCount = basicUnitMaintainService.count(new QueryWrapper<BasicCorpEntity>().eq("companyIdFk", basicUnitMaintainFilterRequest.getCompanyIdFk()).eq("corpType", 1));
long supplierCount = basicUnitMaintainService.count(new QueryWrapper<BasicCorpEntity>().eq("companyIdFk", basicUnitMaintainFilterRequest.getCompanyIdFk()).eq("corpType", 2));
basicUnitMaintainEntities = basicUnitMaintainService.filterList(basicUnitMaintainFilterRequest);
if (CollUtil.isNotEmpty(basicUnitMaintainEntities)) {
for (BasicCorpResponse basicCorpResponse : basicUnitMaintainEntities) {
long i = userCompanyService.count(new QueryWrapper<UserCompanyEntity>().eq("creditNum", basicCorpResponse.getCreditNo()));
if (i > 0) {
basicCorpResponse.setRegStatus(1);
} else
basicCorpResponse.setRegStatus(3);
}
}
PageInfo<BasicCorpResponse> pageInfo = new PageInfo<>(basicUnitMaintainEntities);
PageSimpleResponse<BasicCorpResponse> pageSimpleResponse = new PageSimpleResponse<>();
pageSimpleResponse.setSupplierCount(customerCount);
pageSimpleResponse.setCustomerCount(supplierCount);
pageSimpleResponse.setTotal(pageInfo.getTotal());
pageSimpleResponse.setList(basicUnitMaintainEntities);
@ -166,6 +186,7 @@ public class BasicCorpController {
String companyId = request.getHeader("companyId");
return companyId;
}
public String getCustomerId() {
ServletRequestAttributes attributes = (ServletRequestAttributes) RequestContextHolder.getRequestAttributes();
if (attributes == null) {

@ -37,6 +37,7 @@ import org.springframework.web.bind.annotation.RestController;
import org.springframework.web.context.request.RequestContextHolder;
import org.springframework.web.context.request.ServletRequestAttributes;
import com.glxp.api.entity.sup.UserCompanyEntity;
import javax.annotation.Resource;
import javax.servlet.http.HttpServletRequest;
import java.util.*;
@ -73,7 +74,7 @@ public class SupCompanyController {
@GetMapping("/api/pur/getSupComapnys")
public BaseResponse getComapnys(FilterUserCompanyRequest userCompanyRequest) {
List<UserCompanyEntity> userCompanyEntities=companyService.filterUserCompany(userCompanyRequest);
List<UserCompanyEntity> userCompanyEntities = companyService.filterUserCompany(userCompanyRequest);
PageInfo<UserCompanyEntity> pageInfo = new PageInfo<>(userCompanyEntities);
PageSimpleResponse<UserCompanyEntity> pageSimpleResponse = new PageSimpleResponse<>();
pageSimpleResponse.setTotal(pageInfo.getTotal());
@ -205,7 +206,7 @@ public class SupCompanyController {
if (!basicCorpDao.exists(new QueryWrapper<BasicCorpEntity>().eq("erpId", companyEntity.getCustomerId()))) {
basicCorpEntity.setId(IdUtil.getSnowflakeNextId());
basicCorpService.insert(basicCorpEntity);
}else {
} else {
}

@ -21,11 +21,13 @@ import com.glxp.api.entity.sup.UserCompanyEntity;
import com.glxp.api.exception.JsonException;
import com.glxp.api.req.basic.FilterUdiRelRequest;
import com.glxp.api.req.purchase.FilterCertSetsRequest;
import com.glxp.api.req.purchase.FilterPoductRequest;
import com.glxp.api.req.purchase.FilterSupCertRequest;
import com.glxp.api.req.purchase.FilterSupManufacturerRequest;
import com.glxp.api.req.system.DeleteRequest;
import com.glxp.api.res.PageSimpleResponse;
import com.glxp.api.res.basic.BasicUdiRelResponse;
import com.glxp.api.res.purchase.SupProductResponse;
import com.glxp.api.service.auth.AuthAdminService;
import com.glxp.api.service.basic.BasicUdiRelService;
import com.glxp.api.service.purchase.SupCertService;
@ -405,6 +407,25 @@ public class SupManufacturerController {
}
@GetMapping("/sup/manufacturer/app/cert/search")
public BaseResponse getProductCert(FilterSupManufacturerRequest filterSupManufacturerRequest) {
if (StrUtil.isEmpty(filterSupManufacturerRequest.getCompanyName()))
return ResultVOUtils.error(500, "生产企业名称不能为空!");
List<SupManufacturerEntity> companyEntities = supManufacturerService.getCompany(filterSupManufacturerRequest);
if (CollUtil.isEmpty(companyEntities))
return ResultVOUtils.error(500, "未查询到该生产企业资质信息");
SupManufacturerEntity supProductResponse = companyEntities.get(0);
FilterSupCertRequest filterSupCertRequest = new FilterSupCertRequest();
filterSupCertRequest.setManufacturerIdFk(supProductResponse.getManufacturerId());
List<SupCertEntity> supCertEntities = supCertService.selectCompanyCert(filterSupCertRequest);
PageInfo<SupCertEntity> pageInfo = new PageInfo<SupCertEntity>(supCertEntities);
PageSimpleResponse<SupCertEntity> pageSimpleResponse = new PageSimpleResponse<>();
pageSimpleResponse.setTotal(pageInfo.getTotal());
pageSimpleResponse.setList(supCertEntities);
return ResultVOUtils.success(pageSimpleResponse);
}
public String getCustomerId() {
ServletRequestAttributes attributes = (ServletRequestAttributes) RequestContextHolder.getRequestAttributes();
if (attributes == null) {

@ -20,7 +20,16 @@ public class PageSimpleResponse<T> {
private List<T> list;
public void setTotal(Long total) {
this.total = total.intValue();
}
/**
*
*/
private Long customerCount;
/**
*
*/
private Long supplierCount;
}

@ -1,10 +1,15 @@
package com.glxp.api.res.basic;
import com.glxp.api.entity.basic.BasicCorpEntity;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
@Data
public class BasicCorpResponse extends BasicCorpEntity {
private String companyName;
/**
* "注册状态 1已注册2已禁用; 3:未注册"
*/
private Integer regStatus;
}

@ -29,8 +29,6 @@ public class SupCompanyServiceImpl extends ServiceImpl<SupCompanyDao, SupCompany
}
// @Override
// public SupCompanyEntity findCompanyByUnitFk(String unitFk) {
// FilterSupCompanyRequest filterSupCompanyRequest = new FilterSupCompanyRequest();
@ -107,7 +105,7 @@ public class SupCompanyServiceImpl extends ServiceImpl<SupCompanyDao, SupCompany
return supCompanyDao.modifyCompany(companyEntity);
}
// @Override
// @Override
// public boolean insertCompany(SupCompanyEntity companyEntity) {
// return supCompanyDao.insertCompany(companyEntity);
// }
@ -117,16 +115,16 @@ public class SupCompanyServiceImpl extends ServiceImpl<SupCompanyDao, SupCompany
// public boolean deleteCompany(String customerId) {
// return supCompanyDao.deleteCompany(customerId);
// }
@Override
public SupCompanyEntity findCompanyByUnitFk(String unitFk) {
FilterSupCompanyRequest filterSupCompanyRequest = new FilterSupCompanyRequest();
filterSupCompanyRequest.setUnitIdFk(unitFk);
List<SupCompanyEntity> companyEntities = supCompanyDao.filterCompany(filterSupCompanyRequest);
if (companyEntities != null && companyEntities.size() > 0) {
return companyEntities.get(0);
@Override
public SupCompanyEntity findCompanyByUnitFk(String unitFk) {
FilterSupCompanyRequest filterSupCompanyRequest = new FilterSupCompanyRequest();
filterSupCompanyRequest.setUnitIdFk(unitFk);
List<SupCompanyEntity> companyEntities = supCompanyDao.filterCompany(filterSupCompanyRequest);
if (companyEntities != null && companyEntities.size() > 0) {
return companyEntities.get(0);
}
return null;
}
return null;
}
@Override
public List<SupCompanyEntity> getSubCompany(FilterSupCompanyRequest commitRequest) {
@ -171,6 +169,6 @@ public SupCompanyEntity findCompanyByUnitFk(String unitFk) {
@Override
public boolean update(SupCompanyEntity supCompanyEntity) {
return supCompanyDao.updateById(supCompanyEntity)>0;
return supCompanyDao.updateById(supCompanyEntity) > 0;
}
}

@ -77,20 +77,14 @@
(SELECT count(*) FROM sup_product WHERE user_company.customerId=sup_product.customerId AND (sup_product.auditStatus=1 OR sup_product.auditStatus=4) ) as prouctPassCout
</if>
FROM user_company
-- left JOIN basic_udi_product p on bur.uuid = p.uuid
<where>
checkStatus=1
and bussinessStatus =1
<if test="companyName != null and companyName != ''">
and companyName like concat('%',#{companyName},'%')
</if>
<if test="creditNum != null and creditNum != ''">
and creditNum like concat('%',#{creditNum},'%')
</if>
</where>
</select>

Loading…
Cancel
Save