Commit 92a11966 authored by 夏敏伟's avatar 夏敏伟

编写测试 解决bug

parent 744dd937
package com.zksy.szpt.controller;
import com.zksy.szpt.domain.dto.CommonDelDTO;
import com.zksy.szpt.domain.dto.CommonDelIntDTO;
import com.zksy.szpt.domain.dto.SzptClockInDTO;
import com.zksy.szpt.service.SzptClockInService;
import io.swagger.annotations.Api;
......@@ -33,8 +34,8 @@ public class SzptClockInController {
@ApiOperation(value = "删除szpt_clock_in数据")
@PostMapping("/deleteSzptClockIn")
public Integer deleteSzptClockIn(@RequestBody CommonDelDTO commonDelDTO) {
return szptClockInService.deleteSzptClockIn(commonDelDTO);
public Integer deleteSzptClockIn(@RequestBody CommonDelIntDTO commonDelIntDTO) {
return szptClockInService.deleteSzptClockIn(commonDelIntDTO);
}
......
package com.zksy.szpt.controller;
import com.zksy.szpt.domain.dto.CommonDelDTO;
import com.zksy.szpt.domain.dto.CommonDelIntDTO;
import com.zksy.szpt.domain.dto.SzptClockInRulesDTO;
import com.zksy.szpt.service.SzptClockInRulesService;
import io.swagger.annotations.Api;
......@@ -33,7 +34,7 @@ public class SzptClockInRulesController {
@ApiOperation(value = "删除SzptClockInRules数据")
@PostMapping("/deleteSzptClockInRules")
public Integer deleteSzptClockInRules(@RequestBody @Validated CommonDelDTO commonDelDTO) {
return szptClockInRulesService.deleteSzptClockInRules(commonDelDTO);
public Integer deleteSzptClockInRules(@RequestBody @Validated CommonDelIntDTO commonDelIntDTO) {
return szptClockInRulesService.deleteSzptClockInRules(commonDelIntDTO);
}
}
package com.zksy.szpt.controller;
import com.zksy.szpt.domain.dto.CommonDelDTO;
import com.zksy.szpt.domain.dto.CommonDelIntDTO;
import com.zksy.szpt.domain.dto.SzptXyzhXyxxDTO;
import com.zksy.szpt.service.SzptXyzhXyxxService;
import io.swagger.annotations.Api;
......@@ -35,7 +36,7 @@ public class SzptXyzhXyxxController {
@ApiOperation(value = "删除校园信息")
@PostMapping("/deleteSzptXyzhXyxx")
public Integer deleteSzptXyzhXyxx(@RequestBody @Validated CommonDelDTO commonDelDTO) {
return szptXyzhXyxxService.deleteSzptXyzhXyxx(commonDelDTO);
public Integer deleteSzptXyzhXyxx(@RequestBody @Validated CommonDelIntDTO commonDelIntDTO) {
return szptXyzhXyxxService.deleteSzptXyzhXyxx(commonDelIntDTO);
}
}
package com.zksy.szpt.domain.dto;
import javax.validation.constraints.NotEmpty;
import java.util.List;
public class CommonDelIntDTO {
/**
* 账户ID
*/
@NotEmpty(message = "账户ID不能为空")
private List<Integer> ids;
/**
* 数据所属单位
*/
@NotEmpty(message = "数据归属单位不能为空")
private String sjgsdwdm;
public List<Integer> getIds() {
return ids;
}
public void setIds(List<Integer> ids) {
this.ids = ids;
}
public String getSjgsdwdm() {
return sjgsdwdm;
}
public void setSjgsdwdm(String sjgsdwdm) {
this.sjgsdwdm = sjgsdwdm;
}
}
package com.zksy.szpt.domain.dto;
import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableId;
import com.fasterxml.jackson.annotation.JsonFormat;
import javax.validation.constraints.NotBlank;
......@@ -7,6 +9,12 @@ import javax.validation.constraints.NotEmpty;
import java.util.Date;
public class SzptGdYjDTO {
/**
* 预警ID
*/
@NotBlank(message = "预警ID不能为空")
private String id;
/**
* 工地ID
*/
......@@ -73,6 +81,14 @@ public class SzptGdYjDTO {
private String clrxm;
public String getId() {
return id;
}
public void setId(String id) {
this.id = id;
}
public String getCsid() {
return csid;
}
......
......@@ -30,7 +30,7 @@ public class IndexService {
public Integer deleteXxRwwcqk(CommonDelDTO commonDelDTO) {
LambdaQueryWrapper<XxRwwcqk> wrapper = new LambdaQueryWrapper<>();
wrapper.in(XxRwwcqk::getRwid, commonDelDTO);
wrapper.in(XxRwwcqk::getRwid, commonDelDTO.getIds());
return xxRwwcqkMapper.delete(wrapper);
}
}
......@@ -3,6 +3,7 @@ package com.zksy.szpt.service;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper;
import com.zksy.szpt.domain.dto.CommonDelDTO;
import com.zksy.szpt.domain.dto.CommonDelIntDTO;
import com.zksy.szpt.domain.dto.SzptClockInRulesDTO;
import com.zksy.szpt.domain.po.SzptClockInRules;
import com.zksy.szpt.mapper.SzptClockInRulesMapper;
......@@ -28,9 +29,9 @@ public class SzptClockInRulesService {
return szptClockInRulesMapper.update(szptClockInRules,wrapper);
}
public Integer deleteSzptClockInRules(CommonDelDTO commonDelDTO) {
public Integer deleteSzptClockInRules(CommonDelIntDTO commonDelIntDTO) {
LambdaQueryWrapper<SzptClockInRules> wrapper = new LambdaQueryWrapper<>();
wrapper.in(SzptClockInRules::getId, commonDelDTO);
wrapper.in(SzptClockInRules::getId, commonDelIntDTO.getIds());
return szptClockInRulesMapper.delete(wrapper);
}
}
......@@ -3,6 +3,7 @@ package com.zksy.szpt.service;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper;
import com.zksy.szpt.domain.dto.CommonDelDTO;
import com.zksy.szpt.domain.dto.CommonDelIntDTO;
import com.zksy.szpt.domain.dto.SzptClockInDTO;
import com.zksy.szpt.domain.po.SzptClockIn;
import com.zksy.szpt.mapper.SzptClockInMapper;
......@@ -28,9 +29,9 @@ public class SzptClockInService {
return szptClockInMapper.update(szptClockIn,wrapper);
}
public Integer deleteSzptClockIn(CommonDelDTO commonDelDTO) {
public Integer deleteSzptClockIn(CommonDelIntDTO commonDelIntDTO) {
LambdaQueryWrapper<SzptClockIn> wrapper = new LambdaQueryWrapper<>();
wrapper.in(SzptClockIn::getId, commonDelDTO);
wrapper.in(SzptClockIn::getId, commonDelIntDTO.getIds());
return szptClockInMapper.delete(wrapper);
}
}
......@@ -32,7 +32,8 @@ public class SzptFwxxService {
public Integer deleteSzptFwxx(CommonDelDTO commonDelDTO) {
LambdaQueryWrapper<SzptFwxx> wrapper = new LambdaQueryWrapper<>();
wrapper.in(SzptFwxx::getQyid, commonDelDTO);
wrapper.in(SzptFwxx::getQyid, commonDelDTO.getIds());
wrapper.eq(SzptFwxx::getSjgsdwdm, commonDelDTO.getSjgsdwdm());
return szptFwxxMapper.delete(wrapper);
}
}
......@@ -30,7 +30,7 @@ public class SzptGdCsyjhldxService {
public Integer deleteSzptGdCsyjhldx(CommonDelDTO commonDelDTO) {
LambdaQueryWrapper<SzptGdCsyjhldx> wrapper = new LambdaQueryWrapper<>();
wrapper.in(SzptGdCsyjhldx::getId, commonDelDTO);
wrapper.in(SzptGdCsyjhldx::getId, commonDelDTO.getIds());
return szptGdCsyjhldxMapper.delete(wrapper);
}
}
......@@ -30,7 +30,7 @@ public class SzptGdRyxxService {
public Integer deleteSzptGdRyxx(CommonDelDTO commonDelDTO) {
LambdaQueryWrapper<SzptGdRyxx> wrapper = new LambdaQueryWrapper<>();
wrapper.in(SzptGdRyxx::getRkbm, commonDelDTO);
wrapper.in(SzptGdRyxx::getRkbm, commonDelDTO.getIds());
return szptGdRyxxMapper.delete(wrapper);
}
}
......@@ -24,14 +24,15 @@ public class SzptGdSbxxService {
public Integer updateSzptGdSbxx(SzptGdSbxxDTO szptGdSbxxDTO) {
SzptGdSbxx szptGdSbxx = BeanMapperUtil.map(szptGdSbxxDTO, SzptGdSbxx.class);
LambdaUpdateWrapper<SzptGdSbxx> wrapper = new LambdaUpdateWrapper<>();
wrapper.eq(SzptGdSbxx::getId, szptGdSbxx.getId());
wrapper.eq(SzptGdSbxx::getSbbh, szptGdSbxx.getSbbh());
wrapper.eq(SzptGdSbxx::getSjgsdwdm, szptGdSbxx.getSjgsdwdm());
return szptGdSbxxMapper.update(szptGdSbxx,wrapper);
}
public Integer deleteSzptGdSbxx(CommonDelDTO commonDelDTO) {
LambdaQueryWrapper<SzptGdSbxx> wrapper = new LambdaQueryWrapper<>();
wrapper.in(SzptGdSbxx::getId, commonDelDTO);
wrapper.in(SzptGdSbxx::getSbbh, commonDelDTO.getIds());
wrapper.eq(SzptGdSbxx::getSjgsdwdm, commonDelDTO.getSjgsdwdm());
return szptGdSbxxMapper.delete(wrapper);
}
}
......@@ -31,7 +31,8 @@ public class SzptGdXxService {
public Integer deleteSzptGdXx(CommonDelDTO commonDelDTO) {
LambdaQueryWrapper<SzptGdXx> wrapper = new LambdaQueryWrapper<>();
wrapper.in(SzptGdXx::getId, commonDelDTO);
wrapper.in(SzptGdXx::getId, commonDelDTO.getIds());
wrapper.eq(SzptGdXx::getSjgsdwdm, commonDelDTO.getSjgsdwdm());
return szptGdXxMapper.delete(wrapper);
}
}
......@@ -29,7 +29,7 @@ public class SzptGdYjService {
public Integer deleteSzptGdYj(CommonDelDTO commonDelDTO) {
LambdaQueryWrapper<SzptGdYj> wrapper = new LambdaQueryWrapper<>();
wrapper.in(SzptGdYj::getId, commonDelDTO);
wrapper.in(SzptGdYj::getId, commonDelDTO.getIds());
return szptGdYjMapper.delete(wrapper);
}
}
......@@ -30,7 +30,7 @@ public class SzptQyxxService {
public Integer deleteSzptQyxx(CommonDelDTO commonDelDTO) {
LambdaQueryWrapper<SzptQyxx> wrapper = new LambdaQueryWrapper<>();
wrapper.in(SzptQyxx::getId, commonDelDTO);
wrapper.in(SzptQyxx::getId, commonDelDTO.getIds());
return szptQyxxMapper.delete(wrapper);
}
}
......@@ -30,7 +30,7 @@ public class SzptXyzhDkxxService {
public Integer deleteSzptXyzhDkxx(CommonDelDTO commonDelDTO) {
LambdaQueryWrapper<SzptXyzhDkxx> wrapper = new LambdaQueryWrapper<>();
wrapper.in(SzptXyzhDkxx::getDklsid, commonDelDTO);
wrapper.in(SzptXyzhDkxx::getDklsid, commonDelDTO.getIds());
return szptXyzhDkxxMapper.delete(wrapper);
}
}
......@@ -32,7 +32,7 @@ public class SzptXyzhKqmbService {
public Integer deleteSzptXyzhKqmb(CommonDelDTO commonDelDTO) {
LambdaQueryWrapper<SzptXyzhKqmb> wrapper = new LambdaQueryWrapper<>();
wrapper.in(SzptXyzhKqmb::getId, commonDelDTO);
wrapper.in(SzptXyzhKqmb::getId, commonDelDTO.getIds());
return szptXyzhKqmbMapper.delete(wrapper);
}
}
......@@ -32,7 +32,7 @@ public class SzptXyzhMbdhService {
public Integer deleteSzptXyzhMbdh(CommonDelDTO commonDelDTO) {
LambdaQueryWrapper<SzptXyzhMbdh> wrapper = new LambdaQueryWrapper<>();
wrapper.in(SzptXyzhMbdh::getId, commonDelDTO);
wrapper.in(SzptXyzhMbdh::getId, commonDelDTO.getIds());
return szptXyzhMbdhMapper.delete(wrapper);
}
}
......@@ -3,6 +3,7 @@ package com.zksy.szpt.service;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper;
import com.zksy.szpt.domain.dto.CommonDelDTO;
import com.zksy.szpt.domain.dto.CommonDelIntDTO;
import com.zksy.szpt.domain.dto.SzptXyzhMbdhDTO;
import com.zksy.szpt.domain.dto.SzptXyzhXyxxDTO;
import com.zksy.szpt.domain.po.SzptXyzhMbdh;
......@@ -30,9 +31,9 @@ public class SzptXyzhXyxxService {
return szptXyzhXyxxMapper.update(szptXyzhXyxx,wrapper);
}
public Integer deleteSzptXyzhXyxx(CommonDelDTO commonDelDTO) {
public Integer deleteSzptXyzhXyxx(CommonDelIntDTO commonDelIntDTO) {
LambdaQueryWrapper<SzptXyzhXyxx> wrapper = new LambdaQueryWrapper<>();
wrapper.in(SzptXyzhXyxx::getId, commonDelDTO);
wrapper.in(SzptXyzhXyxx::getId, commonDelIntDTO.getIds());
return szptXyzhXyxxMapper.delete(wrapper);
}
}
This diff is collapsed.
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment