1、修复测试bug

main
shenzhidan 2026-02-28 13:53:02 +08:00
parent e233a762c6
commit eaebadeaa0
13 changed files with 69 additions and 20 deletions

View File

@ -1,17 +1,17 @@
package com.zcloud.zcGbsServicer.web;
import com.zcloud.zcGbsServicer.api.RescueTeamServiceI;
import com.zcloud.zcGbsServicer.dto.RescueTeamAddCmd;
import com.zcloud.zcGbsServicer.dto.RescueTeamPageQry;
import com.zcloud.zcGbsServicer.dto.RescueTeamUpdateCmd;
import com.zcloud.zcGbsServicer.dto.clientobject.RescueTeamCO;
import com.alibaba.cola.dto.MultiResponse;
import com.alibaba.cola.dto.PageResponse;
import com.alibaba.cola.dto.Response;
import com.alibaba.cola.dto.SingleResponse;
import com.jjb.saas.framework.auth.model.SSOUser;
import com.jjb.saas.framework.auth.utils.AuthContext;
import com.zcloud.zcGbsServicer.api.RescueTeamServiceI;
import com.zcloud.zcGbsServicer.dto.RescueTeamAddCmd;
import com.zcloud.zcGbsServicer.dto.RescueTeamNameCheckQry;
import com.zcloud.zcGbsServicer.dto.RescueTeamPageQry;
import com.zcloud.zcGbsServicer.dto.RescueTeamUpdateCmd;
import com.zcloud.zcGbsServicer.dto.clientobject.RescueTeamCO;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import lombok.AllArgsConstructor;
@ -20,6 +20,7 @@ import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.*;
import java.util.ArrayList;
/**
* web-adapter
* @Author makejava
@ -46,6 +47,12 @@ public class RescueTeamController {
return rescueTeamService.listPage(qry);
}
@ApiOperation("名称判重")
@PostMapping("/checkName")
public SingleResponse<Boolean> checkName(@Validated @RequestBody RescueTeamNameCheckQry qry) {
return rescueTeamService.checkName(qry);
}
@ApiOperation("所有数据")
@GetMapping("/listAll")
public MultiResponse<RescueTeamCO> listAll() {
@ -79,4 +86,3 @@ public class RescueTeamController {
return SingleResponse.buildSuccess();
}
}

View File

@ -6,6 +6,7 @@ import com.zcloud.zcGbsServicer.command.convertor.RescueTeamCoConvertor;
import com.zcloud.zcGbsServicer.command.convertor.ResourcePersonCoConvertor;
import com.zcloud.zcGbsServicer.domain.model.RescueTeamE;
import com.zcloud.zcGbsServicer.domain.model.ResourcePersonE;
import com.zcloud.zcGbsServicer.dto.RescueTeamNameCheckQry;
import com.zcloud.zcGbsServicer.dto.RescueTeamPageQry;
import com.zcloud.zcGbsServicer.dto.clientobject.RescueTeamCO;
import com.zcloud.zcGbsServicer.persistence.dataobject.RescueTeamDO;
@ -89,5 +90,9 @@ public class RescueTeamQueryExe {
return rescueTeamCoConvertor.converEToCO(rescueTeamE);
}
public Boolean checkName(RescueTeamNameCheckQry qry) {
return rescueTeamRepository.existsByTeamName(qry.getTeamName(), qry.getId());
}
}

View File

@ -6,6 +6,7 @@ import com.zcloud.zcGbsServicer.command.RescueTeamRemoveExe;
import com.zcloud.zcGbsServicer.command.RescueTeamUpdateExe;
import com.zcloud.zcGbsServicer.command.query.RescueTeamQueryExe;
import com.zcloud.zcGbsServicer.dto.RescueTeamAddCmd;
import com.zcloud.zcGbsServicer.dto.RescueTeamNameCheckQry;
import com.zcloud.zcGbsServicer.dto.RescueTeamPageQry;
import com.zcloud.zcGbsServicer.dto.RescueTeamUpdateCmd;
import com.zcloud.zcGbsServicer.dto.clientobject.RescueTeamCO;
@ -60,5 +61,10 @@ public class RescueTeamServiceImpl implements RescueTeamServiceI {
public RescueTeamCO get(Long id) {
return rescueTeamQueryExe.getById(id);
}
@Override
public SingleResponse<Boolean> checkName(RescueTeamNameCheckQry qry) {
return SingleResponse.of(rescueTeamQueryExe.checkName(qry));
}
}

View File

@ -1,6 +1,7 @@
package com.zcloud.zcGbsServicer.api;
import com.zcloud.zcGbsServicer.dto.RescueTeamAddCmd;
import com.zcloud.zcGbsServicer.dto.RescueTeamNameCheckQry;
import com.zcloud.zcGbsServicer.dto.RescueTeamPageQry;
import com.zcloud.zcGbsServicer.dto.RescueTeamUpdateCmd;
import com.zcloud.zcGbsServicer.dto.clientobject.RescueTeamCO;
@ -25,5 +26,7 @@ public interface RescueTeamServiceI {
void removeBatch(Long[] ids);
RescueTeamCO get(Long id);
SingleResponse<Boolean> checkName(RescueTeamNameCheckQry qry);
}

View File

@ -53,7 +53,7 @@ public class RescueTeamAddCmd extends Command {
private String commandCrew;
@ApiModelProperty(value = "建立日期", name = "establishDate", required = true)
@NotNull(message = "建立日期不能为空")
// @NotNull(message = "建立日期不能为空")
private LocalDate establishDate;
@ApiModelProperty(value = "所属区域或范围(字典码)", name = "regionScope", required = true)

View File

@ -0,0 +1,17 @@
package com.zcloud.zcGbsServicer.dto;
import com.alibaba.cola.dto.Query;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import javax.validation.constraints.NotEmpty;
@Data
public class RescueTeamNameCheckQry extends Query {
@ApiModelProperty(value = "主键", name = "id")
private Long id;
@ApiModelProperty(value = "救援队名称", name = "teamName", required = true)
@NotEmpty(message = "救援队名称不能为空")
private String teamName;
}

View File

@ -15,5 +15,6 @@ import java.util.Map;
public interface RescueTeamRepository extends BaseRepository<RescueTeamDO> {
PageResponse<RescueTeamDO> listPage(Map<String,Object> params);
boolean existsByTeamName(String teamName, Long excludeId);
}

View File

@ -1,5 +1,6 @@
package com.zcloud.zcGbsServicer.persistence.repository.impl;
import cn.hutool.core.util.StrUtil;
import com.jjb.saas.framework.repository.common.PageHelper;
import com.zcloud.zcGbsServicer.persistence.dataobject.RescueTeamDO;
import com.zcloud.zcGbsServicer.persistence.mapper.RescueTeamMapper;
@ -39,5 +40,19 @@ public class RescueTeamRepositoryImpl extends BaseRepositoryImpl<RescueTeamMappe
return PageHelper.pageToResponse(result, result.getRecords());
}
@Override
public boolean existsByTeamName(String teamName, Long excludeId) {
if (StrUtil.isBlank(teamName)) {
return false;
}
QueryWrapper<RescueTeamDO> queryWrapper = new QueryWrapper<>();
queryWrapper.eq("delete_enum", "FALSE");
queryWrapper.eq("team_name", teamName.trim());
if (excludeId != null) {
queryWrapper.ne("id", excludeId);
}
return this.count(queryWrapper) > 0;
}
}

View File

@ -11,7 +11,7 @@
control_room
<where>
delete_enum = 'FALSE'
<if test="ew != null and ew.sqlSegment != null and ew.sqlSegment != ''">
<if test="ew != null and ew.expression != null and ew.sqlSegment != null and ew.sqlSegment != ''">
AND ${ew.sqlSegment}
</if>
</where>
@ -20,4 +20,3 @@
</select>
</mapper>

View File

@ -15,15 +15,15 @@
FROM
corp_info ci
<where>
ci.delete_enum = 'false'
ci.delete_enum = 'FALSE'
AND
ci.type IN(0, 1, 6)
<if test="corpName != null and corpName != ''">
AND ci.corp_name LIKE CONCAT('%', #{corpName}, '%')
</if>
</where>
ORDER BY
ci.id
ORDER BY ci.corp_order ASC,
ci.create_time Desc
</select>
</mapper>

View File

@ -11,7 +11,7 @@
pump_room
<where>
delete_enum = 'FALSE'
<if test="ew != null and ew.sqlSegment != null and ew.sqlSegment != ''">
<if test="ew != null and ew.expression != null and ew.sqlSegment != null and ew.sqlSegment != ''">
AND ${ew.sqlSegment}
</if>
</where>
@ -20,4 +20,3 @@
</select>
</mapper>

View File

@ -11,7 +11,7 @@
rescue_team
<where>
delete_enum = 'FALSE'
<if test="ew != null and ew.sqlSegment != null and ew.sqlSegment != ''">
<if test="ew != null and ew.expression != null and ew.sqlSegment != null and ew.sqlSegment != ''">
AND ${ew.sqlSegment}
</if>
</where>
@ -20,4 +20,3 @@
</select>
</mapper>

View File

@ -11,7 +11,7 @@
water_source
<where>
delete_enum = 'FALSE'
<if test="ew != null and ew.sqlSegment != null and ew.sqlSegment != ''">
<if test="ew != null and ew.expression != null and ew.sqlSegment != null and ew.sqlSegment != ''">
AND ${ew.sqlSegment}
</if>
</where>
@ -20,4 +20,3 @@
</select>
</mapper>