修改路径

This commit is contained in:
haozq 2024-03-26 18:35:43 +08:00
parent 4322f829cd
commit b46253ddff
8 changed files with 26 additions and 17 deletions

View File

@ -18,6 +18,10 @@ public class AreaDto {
* 工程类型 * 工程类型
*/ */
private String proType; private String proType;
/**
* 区域id
*/
private String areaId;

View File

@ -23,4 +23,8 @@ public class SelectDto {
@ApiModelProperty(value = "gtId") @ApiModelProperty(value = "gtId")
private String gtId; private String gtId;
@ApiModelProperty(value = "orgId")
private String orgId;
@ApiModelProperty(value = "cityName")
private String cityName;
} }

View File

@ -14,9 +14,7 @@ import com.securitycontrol.entity.background.vo.DeviceVo;
import io.swagger.annotations.ApiOperation; import io.swagger.annotations.ApiOperation;
import lombok.extern.slf4j.Slf4j; import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping; import org.springframework.web.bind.annotation.*;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import javax.validation.Valid; import javax.validation.Valid;
import java.util.ArrayList; import java.util.ArrayList;
@ -26,6 +24,8 @@ import java.util.List;
* 区域管理接口 * 区域管理接口
* @author 黑子 * @author 黑子
*/ */
@RestController
@RequestMapping("/back/area/")
@Slf4j @Slf4j
public class TbAreaController extends BaseController { public class TbAreaController extends BaseController {
@ -77,7 +77,7 @@ public class TbAreaController extends BaseController {
*/ */
@PostMapping("deleteArea") @PostMapping("deleteArea")
@Log(title = "修改区域", menu = "基础管理->区域管理", grade = OperationType.QUERY_BUSINESS, details = "删除区域", type = "业务日志") @Log(title = "修改区域", menu = "基础管理->区域管理", grade = OperationType.QUERY_BUSINESS, details = "删除区域", type = "业务日志")
public Result<String> deleteArea(@RequestBody @Valid AreaVo dto) { public Result<String> deleteArea(@RequestBody @Valid AreaDto dto) {
return service.deleteArea(dto); return service.deleteArea(dto);
} }

View File

@ -2,6 +2,7 @@ package com.securitycontrol.background.mapper;
import com.securitycontrol.entity.background.dto.AreaDto; import com.securitycontrol.entity.background.dto.AreaDto;
import com.securitycontrol.entity.background.vo.AreaVo; import com.securitycontrol.entity.background.vo.AreaVo;
import org.apache.ibatis.annotations.Param;
import org.springframework.stereotype.Repository; import org.springframework.stereotype.Repository;
import java.util.List; import java.util.List;
@ -42,8 +43,8 @@ public interface TbAreaMapper {
/** /**
* 删除区域 * 删除区域
* @param dto * @param id
* @return * @return
*/ */
int deleteArea(AreaVo dto); int deleteArea(@Param("areaId") String id);
} }

View File

@ -39,5 +39,5 @@ public interface TbAreaService {
* @param dto * @param dto
* @return * @return
*/ */
Result<String> deleteArea(AreaVo dto); Result<String> deleteArea(AreaDto dto);
} }

View File

@ -86,7 +86,7 @@ public class TbAreaServiceImpl implements TbAreaService {
* @return * @return
*/ */
@Override @Override
public Result<String> deleteArea(AreaVo dto) { public Result<String> deleteArea(AreaDto dto) {
try{ try{
if(StringHelper.isEmpty(dto.getAreaId())){ if(StringHelper.isEmpty(dto.getAreaId())){
return Result.fail("修改失败,条件不能为空!"); return Result.fail("修改失败,条件不能为空!");
@ -95,7 +95,7 @@ public class TbAreaServiceImpl implements TbAreaService {
List<String> list= Arrays.asList(ids.split("@")); List<String> list= Arrays.asList(ids.split("@"));
AtomicBoolean isDel= new AtomicBoolean(true); AtomicBoolean isDel= new AtomicBoolean(true);
list.forEach(id->{ list.forEach(id->{
int num=mapper.deleteArea(dto); int num=mapper.deleteArea(id);
if (num!=SystemGlobal.SUCCESS_NUM){ if (num!=SystemGlobal.SUCCESS_NUM){
isDel.set(false); isDel.set(false);
} }
@ -104,7 +104,7 @@ public class TbAreaServiceImpl implements TbAreaService {
if(isDel.get()){ if(isDel.get()){
return Result.ok("删除成功","删除成功"); return Result.ok("删除成功","删除成功");
} }
return Result.fail("删除失败,请联系管理员!"); return Result.fail("删除失败,数据不存在!");
}catch (Exception e){ }catch (Exception e){
log.error(e.toString(),e); log.error(e.toString(),e);
return Result.fail("系统升级中,请稍后重试!"); return Result.fail("系统升级中,请稍后重试!");

View File

@ -20,7 +20,7 @@
#{areaId},#{areaName},#{bidCode},#{remarks},#{areaCode},now(),#{gtId},0) #{areaId},#{areaName},#{bidCode},#{remarks},#{areaCode},now(),#{gtId},0)
</insert> </insert>
<update id="updateData"> <update id="updateData">
update tb_area set area_name=#{areaName},bid_code=#{bidCode},remarks=#{remarks},gt_id=#{gtId} update tb_area set area_name=#{areaName},bid_code=#{bidCode},remarks=#{remarks},gt_id=#{gtId},
area_code=#{areaCode},update_time=now() area_code=#{areaCode},update_time=now()
where area_id=#{areaId} where area_id=#{areaId}
</update> </update>
@ -32,9 +32,9 @@
select area_id,area_name,pro.bid_code, remarks,area_code,pro.pro_name, select area_id,area_name,pro.bid_code, remarks,area_code,pro.pro_name,
area.create_time,area.update_time, area.gt_id,gt.gt_name area.create_time,area.update_time, area.gt_id,gt.gt_name
from tb_area area from tb_area area
left join tb_project pro on pro.bid_code=area.bid_code left join tb_project pro on pro.bid_code=area.bid_code and pro.del_flag=0
LEFT JOIN t_pro_gt gt on area.gt_id=gt.gt_id LEFT JOIN t_pro_gt gt on area.gt_id=gt.gt_id and gt.del_flag=0
where area.del_flag=0 and pro.del_flag=0 and gt.del_flag=0 where area.del_flag=0
</select> </select>
<select id="getProjectTypeByBidCode" resultType="java.lang.String"> <select id="getProjectTypeByBidCode" resultType="java.lang.String">
select pro_type select pro_type

View File

@ -111,15 +111,15 @@
</select> </select>
<!--工程下拉选--> <!--工程下拉选-->
<select id="getProList" resultType="com.securitycontrol.entity.system.vo.SelectVo"> <select id="getProList" resultType="com.securitycontrol.entity.system.vo.SelectVo">
select pro.bid_code,pro.pro_name select pro.bid_code bidCode,pro.pro_name name
from tb_project pro from tb_project pro
LEFT JOIN sys_build sb on sb.org_id=pro.org LEFT JOIN sys_build sb on sb.org_id=pro.org
where pro.del_flag =0 where pro.del_flag =0
<if test="proType!=null and proType!=''"> <if test="proType!=null and proType!=''">
and pro.pro_type=#{proType} and pro.pro_type=#{proType}
</if> </if>
<if test="org!=null and org!=''"> <if test="orgId!=null and orgId!=''">
and pro.org=#{org} and pro.org=#{orgId}
</if> </if>
<if test="cityName!=null and cityName!=''"> <if test="cityName!=null and cityName!=''">
and sb.city_name=#{cityName} and sb.city_name=#{cityName}