1、修复测试bug
parent
928bcdc25e
commit
aac0aa136f
|
|
@ -32,7 +32,7 @@ public class CorpCertificateAddExe {
|
||||||
BeanUtils.copyProperties(cmd, corpCertificateE);
|
BeanUtils.copyProperties(cmd, corpCertificateE);
|
||||||
|
|
||||||
Boolean certificate = corpCertificateGateway.checkCertificateExist(corpCertificateE);
|
Boolean certificate = corpCertificateGateway.checkCertificateExist(corpCertificateE);
|
||||||
if (!certificate) {
|
if (certificate) {
|
||||||
throw new BizException("证照编号已存在");
|
throw new BizException("证照编号已存在");
|
||||||
}
|
}
|
||||||
SSOUser ssoUser = AuthContext.getCurrentUser();
|
SSOUser ssoUser = AuthContext.getCurrentUser();
|
||||||
|
|
|
||||||
|
|
@ -4,6 +4,8 @@ import com.alibaba.cola.dto.PageQuery;
|
||||||
import io.swagger.annotations.ApiModelProperty;
|
import io.swagger.annotations.ApiModelProperty;
|
||||||
import lombok.Data;
|
import lombok.Data;
|
||||||
|
|
||||||
|
import javax.validation.Valid;
|
||||||
|
|
||||||
@Data
|
@Data
|
||||||
public class CorpCertificateStatPageQry extends PageQuery {
|
public class CorpCertificateStatPageQry extends PageQuery {
|
||||||
|
|
||||||
|
|
@ -12,4 +14,10 @@ public class CorpCertificateStatPageQry extends PageQuery {
|
||||||
|
|
||||||
@ApiModelProperty(value = "企业名称-模糊查询")
|
@ApiModelProperty(value = "企业名称-模糊查询")
|
||||||
private String corpName;
|
private String corpName;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "查询开始时间")
|
||||||
|
private String geCertificateDateStart;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "查询结束时间")
|
||||||
|
private String leCertificateDateEnd;
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -1,9 +1,11 @@
|
||||||
package com.zcloud.certificate.gatewayimpl;
|
package com.zcloud.certificate.gatewayimpl;
|
||||||
|
|
||||||
|
import cn.hutool.core.collection.CollectionUtil;
|
||||||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||||
import com.zcloud.certificate.domain.gateway.CorpCertificateGateway;
|
import com.zcloud.certificate.domain.gateway.CorpCertificateGateway;
|
||||||
import com.zcloud.certificate.domain.model.CorpCertificateE;
|
import com.zcloud.certificate.domain.model.CorpCertificateE;
|
||||||
import com.zcloud.certificate.persistence.dataobject.CorpCertificateDO;
|
import com.zcloud.certificate.persistence.dataobject.CorpCertificateDO;
|
||||||
|
import com.zcloud.certificate.persistence.dataobject.UserCertificateDO;
|
||||||
import com.zcloud.certificate.persistence.repository.CorpCertificateRepository;
|
import com.zcloud.certificate.persistence.repository.CorpCertificateRepository;
|
||||||
import lombok.AllArgsConstructor;
|
import lombok.AllArgsConstructor;
|
||||||
import org.springframework.beans.BeanUtils;
|
import org.springframework.beans.BeanUtils;
|
||||||
|
|
@ -11,6 +13,7 @@ import org.springframework.stereotype.Service;
|
||||||
|
|
||||||
import java.util.Arrays;
|
import java.util.Arrays;
|
||||||
import java.util.Collections;
|
import java.util.Collections;
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* web-infrastructure
|
* web-infrastructure
|
||||||
|
|
@ -53,10 +56,11 @@ public class CorpCertificateGatewayImpl implements CorpCertificateGateway {
|
||||||
public Boolean checkCertificateExist(CorpCertificateE corpCertificateE) {
|
public Boolean checkCertificateExist(CorpCertificateE corpCertificateE) {
|
||||||
CorpCertificateDO d = new CorpCertificateDO();
|
CorpCertificateDO d = new CorpCertificateDO();
|
||||||
BeanUtils.copyProperties(corpCertificateE, d);
|
BeanUtils.copyProperties(corpCertificateE, d);
|
||||||
CorpCertificateDO queryDO = corpCertificateRepository.getOne(new LambdaQueryWrapper<CorpCertificateDO>()
|
Long count = corpCertificateRepository.lambdaQuery()
|
||||||
.eq(CorpCertificateDO::getCertificateCode, d.getCertificateCode())
|
.eq(CorpCertificateDO::getCertificateCode, d.getCertificateCode())
|
||||||
);
|
.ne(corpCertificateE.getCorpCertificateId() != null, CorpCertificateDO::getCorpCertificateId, corpCertificateE.getCorpCertificateId())
|
||||||
return queryDO == null;
|
.count();
|
||||||
|
return count > 0;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -1,9 +1,11 @@
|
||||||
package com.zcloud.certificate.persistence.mapper;
|
package com.zcloud.certificate.persistence.mapper;
|
||||||
|
|
||||||
|
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||||
import com.zcloud.certificate.persistence.dataobject.CorpCertificateDO;
|
import com.zcloud.certificate.persistence.dataobject.CorpCertificateDO;
|
||||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||||
import com.zcloud.certificate.persistence.dataobject.CorpInfoDO;
|
import com.zcloud.certificate.persistence.dataobject.CorpInfoDO;
|
||||||
import org.apache.ibatis.annotations.Mapper;
|
import org.apache.ibatis.annotations.Mapper;
|
||||||
|
import org.apache.ibatis.annotations.Param;
|
||||||
|
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
import java.util.Map;
|
import java.util.Map;
|
||||||
|
|
@ -17,7 +19,7 @@ import java.util.Map;
|
||||||
@Mapper
|
@Mapper
|
||||||
public interface CorpCertificateMapper extends BaseMapper<CorpCertificateDO> {
|
public interface CorpCertificateMapper extends BaseMapper<CorpCertificateDO> {
|
||||||
|
|
||||||
List<CorpInfoDO> selectCorpCertStatPage(Map<String, Object> params);
|
IPage<CorpInfoDO> selectCorpCertStatPage(IPage<CorpInfoDO> page, @Param("params") Map<String, Object> params);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -55,15 +55,9 @@ public class CorpCertificateRepositoryImpl extends BaseRepositoryImpl<CorpCertif
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public PageResponse<CorpInfoDO> statPage(Map<String, Object> params) {
|
public PageResponse<CorpInfoDO> statPage(Map<String, Object> params) {
|
||||||
Integer pageIndex = (Integer) params.get("pageIndex");
|
IPage<CorpInfoDO> iPage = new Query<CorpInfoDO>().getPage(params);
|
||||||
Integer pageSize = (Integer) params.get("pageSize");
|
IPage<CorpInfoDO> page = corpCertificateMapper.selectCorpCertStatPage(iPage, params);
|
||||||
params.put("offset", (pageIndex - 1) * pageSize);
|
return PageHelper.pageToResponse(page, iPage.getRecords());
|
||||||
|
|
||||||
List<CorpInfoDO> rows = corpCertificateMapper.selectCorpCertStatPage(params);
|
|
||||||
|
|
||||||
long total = rows.isEmpty() ? 0 : rows.get(0).getTotalCount();
|
|
||||||
|
|
||||||
return PageResponse.of(rows, (int)total, pageSize, pageIndex);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -19,26 +19,32 @@
|
||||||
cc.corpinfo_id = ci.id
|
cc.corpinfo_id = ci.id
|
||||||
AND
|
AND
|
||||||
(cc.delete_enum IS NULL OR cc.delete_enum <> 'true')
|
(cc.delete_enum IS NULL OR cc.delete_enum <> 'true')
|
||||||
|
|
||||||
|
<if test="params.geCertificateDateStart != null and params.geCertificateDateStart != ''">
|
||||||
|
AND cc.certificate_date_start >= #{params.geCertificateDateStart}
|
||||||
|
</if>
|
||||||
|
|
||||||
|
<if test="params.leCertificateDateEnd != null and params.leCertificateDateEnd != ''">
|
||||||
|
AND cc.certificate_date_end <= #{params.leCertificateDateEnd}
|
||||||
|
</if>
|
||||||
|
|
||||||
WHERE
|
WHERE
|
||||||
1 = 1
|
1 = 1
|
||||||
<if test="corpType != null">
|
<if test="params.corpType != null">
|
||||||
AND (
|
AND (
|
||||||
(#{corpType} = 0 AND ci.type IN (0,1))
|
(#{params.corpType} = 0 AND ci.type IN (0,1))
|
||||||
OR (#{corpType} = 1 AND ci.type IN (3,4,5))
|
OR (#{params.corpType} = 1 AND ci.type IN (3,4,5))
|
||||||
)
|
)
|
||||||
</if>
|
</if>
|
||||||
|
|
||||||
<if test="corpName != null and corpName != ''">
|
<if test="params.corpName != null and params.corpName != ''">
|
||||||
AND ci.corp_name LIKE CONCAT('%', #{corpName}, '%')
|
AND ci.corp_name LIKE CONCAT('%', #{params.corpName}, '%')
|
||||||
</if>
|
</if>
|
||||||
|
|
||||||
GROUP BY
|
GROUP BY
|
||||||
ci.id, ci.corp_name, ci.type
|
ci.id, ci.corp_name, ci.type
|
||||||
ORDER BY
|
ORDER BY
|
||||||
ci.id DESC
|
ci.id DESC
|
||||||
LIMIT #{offset}, #{pageSize}
|
|
||||||
|
|
||||||
|
|
||||||
</select>
|
</select>
|
||||||
|
|
||||||
</mapper>
|
</mapper>
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue