1、修复测试bug
parent
e233a762c6
commit
eaebadeaa0
|
|
@ -1,17 +1,17 @@
|
||||||
package com.zcloud.zcGbsServicer.web;
|
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.MultiResponse;
|
||||||
import com.alibaba.cola.dto.PageResponse;
|
import com.alibaba.cola.dto.PageResponse;
|
||||||
import com.alibaba.cola.dto.Response;
|
import com.alibaba.cola.dto.Response;
|
||||||
import com.alibaba.cola.dto.SingleResponse;
|
import com.alibaba.cola.dto.SingleResponse;
|
||||||
import com.jjb.saas.framework.auth.model.SSOUser;
|
import com.jjb.saas.framework.auth.model.SSOUser;
|
||||||
import com.jjb.saas.framework.auth.utils.AuthContext;
|
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.Api;
|
||||||
import io.swagger.annotations.ApiOperation;
|
import io.swagger.annotations.ApiOperation;
|
||||||
import lombok.AllArgsConstructor;
|
import lombok.AllArgsConstructor;
|
||||||
|
|
@ -20,6 +20,7 @@ import org.springframework.validation.annotation.Validated;
|
||||||
import org.springframework.web.bind.annotation.*;
|
import org.springframework.web.bind.annotation.*;
|
||||||
|
|
||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* web-adapter
|
* web-adapter
|
||||||
* @Author makejava
|
* @Author makejava
|
||||||
|
|
@ -46,6 +47,12 @@ public class RescueTeamController {
|
||||||
return rescueTeamService.listPage(qry);
|
return rescueTeamService.listPage(qry);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ApiOperation("名称判重")
|
||||||
|
@PostMapping("/checkName")
|
||||||
|
public SingleResponse<Boolean> checkName(@Validated @RequestBody RescueTeamNameCheckQry qry) {
|
||||||
|
return rescueTeamService.checkName(qry);
|
||||||
|
}
|
||||||
|
|
||||||
@ApiOperation("所有数据")
|
@ApiOperation("所有数据")
|
||||||
@GetMapping("/listAll")
|
@GetMapping("/listAll")
|
||||||
public MultiResponse<RescueTeamCO> listAll() {
|
public MultiResponse<RescueTeamCO> listAll() {
|
||||||
|
|
@ -67,7 +74,7 @@ public class RescueTeamController {
|
||||||
|
|
||||||
@ApiOperation("删除多个")
|
@ApiOperation("删除多个")
|
||||||
@DeleteMapping("/ids")
|
@DeleteMapping("/ids")
|
||||||
public Response removeBatch(@RequestParam Long[] ids) {
|
public Response removeBatch(@RequestParam Long[] ids) {
|
||||||
rescueTeamService.removeBatch(ids);
|
rescueTeamService.removeBatch(ids);
|
||||||
return SingleResponse.buildSuccess();
|
return SingleResponse.buildSuccess();
|
||||||
}
|
}
|
||||||
|
|
@ -79,4 +86,3 @@ public class RescueTeamController {
|
||||||
return SingleResponse.buildSuccess();
|
return SingleResponse.buildSuccess();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -6,6 +6,7 @@ import com.zcloud.zcGbsServicer.command.convertor.RescueTeamCoConvertor;
|
||||||
import com.zcloud.zcGbsServicer.command.convertor.ResourcePersonCoConvertor;
|
import com.zcloud.zcGbsServicer.command.convertor.ResourcePersonCoConvertor;
|
||||||
import com.zcloud.zcGbsServicer.domain.model.RescueTeamE;
|
import com.zcloud.zcGbsServicer.domain.model.RescueTeamE;
|
||||||
import com.zcloud.zcGbsServicer.domain.model.ResourcePersonE;
|
import com.zcloud.zcGbsServicer.domain.model.ResourcePersonE;
|
||||||
|
import com.zcloud.zcGbsServicer.dto.RescueTeamNameCheckQry;
|
||||||
import com.zcloud.zcGbsServicer.dto.RescueTeamPageQry;
|
import com.zcloud.zcGbsServicer.dto.RescueTeamPageQry;
|
||||||
import com.zcloud.zcGbsServicer.dto.clientobject.RescueTeamCO;
|
import com.zcloud.zcGbsServicer.dto.clientobject.RescueTeamCO;
|
||||||
import com.zcloud.zcGbsServicer.persistence.dataobject.RescueTeamDO;
|
import com.zcloud.zcGbsServicer.persistence.dataobject.RescueTeamDO;
|
||||||
|
|
@ -89,5 +90,9 @@ public class RescueTeamQueryExe {
|
||||||
return rescueTeamCoConvertor.converEToCO(rescueTeamE);
|
return rescueTeamCoConvertor.converEToCO(rescueTeamE);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public Boolean checkName(RescueTeamNameCheckQry qry) {
|
||||||
|
return rescueTeamRepository.existsByTeamName(qry.getTeamName(), qry.getId());
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -6,6 +6,7 @@ import com.zcloud.zcGbsServicer.command.RescueTeamRemoveExe;
|
||||||
import com.zcloud.zcGbsServicer.command.RescueTeamUpdateExe;
|
import com.zcloud.zcGbsServicer.command.RescueTeamUpdateExe;
|
||||||
import com.zcloud.zcGbsServicer.command.query.RescueTeamQueryExe;
|
import com.zcloud.zcGbsServicer.command.query.RescueTeamQueryExe;
|
||||||
import com.zcloud.zcGbsServicer.dto.RescueTeamAddCmd;
|
import com.zcloud.zcGbsServicer.dto.RescueTeamAddCmd;
|
||||||
|
import com.zcloud.zcGbsServicer.dto.RescueTeamNameCheckQry;
|
||||||
import com.zcloud.zcGbsServicer.dto.RescueTeamPageQry;
|
import com.zcloud.zcGbsServicer.dto.RescueTeamPageQry;
|
||||||
import com.zcloud.zcGbsServicer.dto.RescueTeamUpdateCmd;
|
import com.zcloud.zcGbsServicer.dto.RescueTeamUpdateCmd;
|
||||||
import com.zcloud.zcGbsServicer.dto.clientobject.RescueTeamCO;
|
import com.zcloud.zcGbsServicer.dto.clientobject.RescueTeamCO;
|
||||||
|
|
@ -60,5 +61,10 @@ public class RescueTeamServiceImpl implements RescueTeamServiceI {
|
||||||
public RescueTeamCO get(Long id) {
|
public RescueTeamCO get(Long id) {
|
||||||
return rescueTeamQueryExe.getById(id);
|
return rescueTeamQueryExe.getById(id);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public SingleResponse<Boolean> checkName(RescueTeamNameCheckQry qry) {
|
||||||
|
return SingleResponse.of(rescueTeamQueryExe.checkName(qry));
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -1,6 +1,7 @@
|
||||||
package com.zcloud.zcGbsServicer.api;
|
package com.zcloud.zcGbsServicer.api;
|
||||||
|
|
||||||
import com.zcloud.zcGbsServicer.dto.RescueTeamAddCmd;
|
import com.zcloud.zcGbsServicer.dto.RescueTeamAddCmd;
|
||||||
|
import com.zcloud.zcGbsServicer.dto.RescueTeamNameCheckQry;
|
||||||
import com.zcloud.zcGbsServicer.dto.RescueTeamPageQry;
|
import com.zcloud.zcGbsServicer.dto.RescueTeamPageQry;
|
||||||
import com.zcloud.zcGbsServicer.dto.RescueTeamUpdateCmd;
|
import com.zcloud.zcGbsServicer.dto.RescueTeamUpdateCmd;
|
||||||
import com.zcloud.zcGbsServicer.dto.clientobject.RescueTeamCO;
|
import com.zcloud.zcGbsServicer.dto.clientobject.RescueTeamCO;
|
||||||
|
|
@ -25,5 +26,7 @@ public interface RescueTeamServiceI {
|
||||||
void removeBatch(Long[] ids);
|
void removeBatch(Long[] ids);
|
||||||
|
|
||||||
RescueTeamCO get(Long id);
|
RescueTeamCO get(Long id);
|
||||||
|
|
||||||
|
SingleResponse<Boolean> checkName(RescueTeamNameCheckQry qry);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -53,7 +53,7 @@ public class RescueTeamAddCmd extends Command {
|
||||||
private String commandCrew;
|
private String commandCrew;
|
||||||
|
|
||||||
@ApiModelProperty(value = "建立日期", name = "establishDate", required = true)
|
@ApiModelProperty(value = "建立日期", name = "establishDate", required = true)
|
||||||
@NotNull(message = "建立日期不能为空")
|
// @NotNull(message = "建立日期不能为空")
|
||||||
private LocalDate establishDate;
|
private LocalDate establishDate;
|
||||||
|
|
||||||
@ApiModelProperty(value = "所属区域或范围(字典码)", name = "regionScope", required = true)
|
@ApiModelProperty(value = "所属区域或范围(字典码)", name = "regionScope", required = true)
|
||||||
|
|
|
||||||
|
|
@ -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;
|
||||||
|
}
|
||||||
|
|
@ -15,5 +15,6 @@ import java.util.Map;
|
||||||
public interface RescueTeamRepository extends BaseRepository<RescueTeamDO> {
|
public interface RescueTeamRepository extends BaseRepository<RescueTeamDO> {
|
||||||
PageResponse<RescueTeamDO> listPage(Map<String,Object> params);
|
PageResponse<RescueTeamDO> listPage(Map<String,Object> params);
|
||||||
|
|
||||||
|
boolean existsByTeamName(String teamName, Long excludeId);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -1,5 +1,6 @@
|
||||||
package com.zcloud.zcGbsServicer.persistence.repository.impl;
|
package com.zcloud.zcGbsServicer.persistence.repository.impl;
|
||||||
|
|
||||||
|
import cn.hutool.core.util.StrUtil;
|
||||||
import com.jjb.saas.framework.repository.common.PageHelper;
|
import com.jjb.saas.framework.repository.common.PageHelper;
|
||||||
import com.zcloud.zcGbsServicer.persistence.dataobject.RescueTeamDO;
|
import com.zcloud.zcGbsServicer.persistence.dataobject.RescueTeamDO;
|
||||||
import com.zcloud.zcGbsServicer.persistence.mapper.RescueTeamMapper;
|
import com.zcloud.zcGbsServicer.persistence.mapper.RescueTeamMapper;
|
||||||
|
|
@ -39,5 +40,19 @@ public class RescueTeamRepositoryImpl extends BaseRepositoryImpl<RescueTeamMappe
|
||||||
return PageHelper.pageToResponse(result, result.getRecords());
|
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;
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -11,7 +11,7 @@
|
||||||
control_room
|
control_room
|
||||||
<where>
|
<where>
|
||||||
delete_enum = 'FALSE'
|
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}
|
AND ${ew.sqlSegment}
|
||||||
</if>
|
</if>
|
||||||
</where>
|
</where>
|
||||||
|
|
@ -20,4 +20,3 @@
|
||||||
</select>
|
</select>
|
||||||
|
|
||||||
</mapper>
|
</mapper>
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -15,15 +15,15 @@
|
||||||
FROM
|
FROM
|
||||||
corp_info ci
|
corp_info ci
|
||||||
<where>
|
<where>
|
||||||
ci.delete_enum = 'false'
|
ci.delete_enum = 'FALSE'
|
||||||
AND
|
AND
|
||||||
ci.type IN(0, 1, 6)
|
ci.type IN(0, 1, 6)
|
||||||
<if test="corpName != null and corpName != ''">
|
<if test="corpName != null and corpName != ''">
|
||||||
AND ci.corp_name LIKE CONCAT('%', #{corpName}, '%')
|
AND ci.corp_name LIKE CONCAT('%', #{corpName}, '%')
|
||||||
</if>
|
</if>
|
||||||
</where>
|
</where>
|
||||||
ORDER BY
|
ORDER BY ci.corp_order ASC,
|
||||||
ci.id
|
ci.create_time Desc
|
||||||
</select>
|
</select>
|
||||||
|
|
||||||
</mapper>
|
</mapper>
|
||||||
|
|
|
||||||
|
|
@ -11,7 +11,7 @@
|
||||||
pump_room
|
pump_room
|
||||||
<where>
|
<where>
|
||||||
delete_enum = 'FALSE'
|
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}
|
AND ${ew.sqlSegment}
|
||||||
</if>
|
</if>
|
||||||
</where>
|
</where>
|
||||||
|
|
@ -20,4 +20,3 @@
|
||||||
</select>
|
</select>
|
||||||
|
|
||||||
</mapper>
|
</mapper>
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -11,7 +11,7 @@
|
||||||
rescue_team
|
rescue_team
|
||||||
<where>
|
<where>
|
||||||
delete_enum = 'FALSE'
|
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}
|
AND ${ew.sqlSegment}
|
||||||
</if>
|
</if>
|
||||||
</where>
|
</where>
|
||||||
|
|
@ -20,4 +20,3 @@
|
||||||
</select>
|
</select>
|
||||||
|
|
||||||
</mapper>
|
</mapper>
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -11,7 +11,7 @@
|
||||||
water_source
|
water_source
|
||||||
<where>
|
<where>
|
||||||
delete_enum = 'FALSE'
|
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}
|
AND ${ew.sqlSegment}
|
||||||
</if>
|
</if>
|
||||||
</where>
|
</where>
|
||||||
|
|
@ -20,4 +20,3 @@
|
||||||
</select>
|
</select>
|
||||||
|
|
||||||
</mapper>
|
</mapper>
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue