Commit 2326a7b4 authored by hanbing's avatar hanbing

系统管理-设备管理-厂商管理-删除

parent dcf2838b
...@@ -7,6 +7,7 @@ import io.swagger.annotations.ApiResponse; ...@@ -7,6 +7,7 @@ import io.swagger.annotations.ApiResponse;
import io.swagger.annotations.ApiResponses; import io.swagger.annotations.ApiResponses;
import net.wanji.utc.po.ManufacturerInfoPO; import net.wanji.utc.po.ManufacturerInfoPO;
import net.wanji.utc.service.systemadmin.ManufacturerService; import net.wanji.utc.service.systemadmin.ManufacturerService;
import net.wanji.utc.vo.systemadmin.ManufacturerDeleteInVO;
import net.wanji.utc.vo.systemadmin.ManufacturerInsertOrUpdateInVO; import net.wanji.utc.vo.systemadmin.ManufacturerInsertOrUpdateInVO;
import net.wanji.utc.vo.systemadmin.ManufacturerListInVO; import net.wanji.utc.vo.systemadmin.ManufacturerListInVO;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
...@@ -42,12 +43,18 @@ public class ManufacturerAdminController { ...@@ -42,12 +43,18 @@ public class ManufacturerAdminController {
PageInfo<ManufacturerInfoPO> manufacturerInfoPOPageInfo = manufacturerService.list(manufacturerListInVO); PageInfo<ManufacturerInfoPO> manufacturerInfoPOPageInfo = manufacturerService.list(manufacturerListInVO);
return ResponseEntity.ok(manufacturerInfoPOPageInfo); return ResponseEntity.ok(manufacturerInfoPOPageInfo);
} }
//添加或修改
@ApiOperation(value = "厂商添加或修改", notes = "厂商添加或修改", consumes = MediaType.APPLICATION_JSON) @ApiOperation(value = "厂商添加或修改", notes = "厂商添加或修改", consumes = MediaType.APPLICATION_JSON)
@PostMapping(value = "/insertOrUpdate", consumes = MediaType.APPLICATION_JSON) @PostMapping(value = "/insertOrUpdate", consumes = MediaType.APPLICATION_JSON)
public ResponseEntity insertOrUpdate(@RequestBody ManufacturerInsertOrUpdateInVO inVO) { public ResponseEntity insertOrUpdate(@RequestBody ManufacturerInsertOrUpdateInVO inVO) {
manufacturerService.insertOrUpdate(inVO); manufacturerService.insertOrUpdate(inVO);
return ResponseEntity.ok("success"); return ResponseEntity.ok("success");
} }
//删除
@ApiOperation(value = "厂商删除", notes = "厂商删除", consumes = MediaType.APPLICATION_JSON)
@PostMapping(value = "/delete", consumes = MediaType.APPLICATION_JSON)
public ResponseEntity delete(@RequestBody ManufacturerDeleteInVO inVO) {
manufacturerService.delete(inVO);
return ResponseEntity.ok("success");
}
} }
...@@ -23,4 +23,6 @@ public interface ManufacturerInfoMapper { ...@@ -23,4 +23,6 @@ public interface ManufacturerInfoMapper {
void insertOne(ManufacturerInfoPO manufacturerInfoPO); void insertOne(ManufacturerInfoPO manufacturerInfoPO);
void updateOne(ManufacturerInfoPO manufacturerInfoPO); void updateOne(ManufacturerInfoPO manufacturerInfoPO);
void deleteBatch(@Param("ids") List<Integer> ids);
} }
...@@ -2,6 +2,7 @@ package net.wanji.utc.service.systemadmin; ...@@ -2,6 +2,7 @@ package net.wanji.utc.service.systemadmin;
import com.github.pagehelper.PageInfo; import com.github.pagehelper.PageInfo;
import net.wanji.utc.po.ManufacturerInfoPO; import net.wanji.utc.po.ManufacturerInfoPO;
import net.wanji.utc.vo.systemadmin.ManufacturerDeleteInVO;
import net.wanji.utc.vo.systemadmin.ManufacturerInsertOrUpdateInVO; import net.wanji.utc.vo.systemadmin.ManufacturerInsertOrUpdateInVO;
import net.wanji.utc.vo.systemadmin.ManufacturerListInVO; import net.wanji.utc.vo.systemadmin.ManufacturerListInVO;
...@@ -13,4 +14,6 @@ public interface ManufacturerService { ...@@ -13,4 +14,6 @@ public interface ManufacturerService {
PageInfo<ManufacturerInfoPO> list(ManufacturerListInVO manufacturerListInVO); PageInfo<ManufacturerInfoPO> list(ManufacturerListInVO manufacturerListInVO);
void insertOrUpdate(ManufacturerInsertOrUpdateInVO inVO); void insertOrUpdate(ManufacturerInsertOrUpdateInVO inVO);
void delete(ManufacturerDeleteInVO inVO);
} }
...@@ -5,6 +5,7 @@ import com.github.pagehelper.PageInfo; ...@@ -5,6 +5,7 @@ import com.github.pagehelper.PageInfo;
import net.wanji.utc.mapper.ManufacturerInfoMapper; import net.wanji.utc.mapper.ManufacturerInfoMapper;
import net.wanji.utc.po.ManufacturerInfoPO; import net.wanji.utc.po.ManufacturerInfoPO;
import net.wanji.utc.service.systemadmin.ManufacturerService; import net.wanji.utc.service.systemadmin.ManufacturerService;
import net.wanji.utc.vo.systemadmin.ManufacturerDeleteInVO;
import net.wanji.utc.vo.systemadmin.ManufacturerInsertOrUpdateInVO; import net.wanji.utc.vo.systemadmin.ManufacturerInsertOrUpdateInVO;
import net.wanji.utc.vo.systemadmin.ManufacturerListInVO; import net.wanji.utc.vo.systemadmin.ManufacturerListInVO;
import org.springframework.beans.BeanUtils; import org.springframework.beans.BeanUtils;
...@@ -49,4 +50,10 @@ public class ManufacturerServiceImpl implements ManufacturerService { ...@@ -49,4 +50,10 @@ public class ManufacturerServiceImpl implements ManufacturerService {
manufacturerInfoMapper.updateOne(manufacturerInfoPO); manufacturerInfoMapper.updateOne(manufacturerInfoPO);
} }
} }
@Override
public void delete(ManufacturerDeleteInVO inVO) {
List<Integer> ids = inVO.getIds();
manufacturerInfoMapper.deleteBatch(ids);
}
} }
package net.wanji.utc.vo.systemadmin;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import java.util.List;
/**
* @author Kent HAN
* @date 2022/11/24 10:10
*/
@Data
@ApiModel(value = "ManufacturerDeleteInVO", description = "厂商删除输入参数")
public class ManufacturerDeleteInVO {
/** 厂商ID列表 */
@ApiModelProperty(value = "厂商ID列表",notes = "")
private List<Integer> ids ;
}
...@@ -18,18 +18,18 @@ public class ManufacturerInsertOrUpdateInVO { ...@@ -18,18 +18,18 @@ public class ManufacturerInsertOrUpdateInVO {
@ApiModelProperty(value = "厂商ID。如果携带ID,即为修改;如果不携带ID,即为新增",notes = "") @ApiModelProperty(value = "厂商ID。如果携带ID,即为修改;如果不携带ID,即为新增",notes = "")
private Integer id ; private Integer id ;
/** 厂商代码 */ /** 厂商代码 */
@ApiModelProperty(value = "厂商代码",notes = "") @ApiModelProperty(required = true, value = "厂商代码",notes = "")
private String code ; private String code ;
/** 厂商名称 */ /** 厂商名称 */
@ApiModelProperty(value = "厂商名称",notes = "") @ApiModelProperty(required = true, value = "厂商名称",notes = "")
private String name ; private String name ;
/** 厂商简称 */ /** 厂商简称 */
@ApiModelProperty(value = "厂商简称",notes = "") @ApiModelProperty(required = true, value = "厂商简称",notes = "")
private String nickName ; private String nickName ;
/** 平台地址 */ /** 平台地址 */
@ApiModelProperty(value = "平台地址",notes = "") @ApiModelProperty(required = true, value = "平台地址",notes = "")
private String address ; private String address ;
/** 维护单位 */ /** 维护单位 */
@ApiModelProperty(value = "维护单位",notes = "") @ApiModelProperty(required = true, value = "维护单位",notes = "")
private String maintenanceUnit ; private String maintenanceUnit ;
} }
...@@ -38,6 +38,14 @@ ...@@ -38,6 +38,14 @@
where id = #{id} where id = #{id}
</update> </update>
<delete id="deleteBatch">
delete from t_manufacturer_info
where id in
<foreach collection="ids" item="id" separator="," open="(" close=")">
#{id}
</foreach>
</delete>
<select id="selectByAbbr" resultMap="BaseResultMap"> <select id="selectByAbbr" resultMap="BaseResultMap">
select select
id,code,name,nick_name,address,maintenance_unit,gmt_create,gmt_modified id,code,name,nick_name,address,maintenance_unit,gmt_create,gmt_modified
......
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