对比新文件 |
| | |
| | | package com.gkhy.safePlatform.emergency.controller; |
| | | |
| | | import com.gkhy.safePlatform.commons.query.PageQuery; |
| | | import com.gkhy.safePlatform.commons.utils.PageUtils; |
| | | import com.gkhy.safePlatform.commons.vo.ResultVO; |
| | | import com.gkhy.safePlatform.emergency.model.dto.req.EmergencySuppliesReqDTO; |
| | | import com.gkhy.safePlatform.emergency.model.dto.resp.EmergencySuppliesDetailRespDTO; |
| | | import com.gkhy.safePlatform.emergency.model.dto.resp.EmergencySuppliesPageRespDTO; |
| | | import com.gkhy.safePlatform.emergency.query.EmergencySuppliesQuery; |
| | | import com.gkhy.safePlatform.emergency.service.EmergencySuppliesService; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.web.bind.annotation.*; |
| | | |
| | | import java.security.Principal; |
| | | import java.util.List; |
| | | |
| | | @RestController |
| | | @RequestMapping("/emergencySupplies") |
| | | public class EmergencySuppliesController { |
| | | |
| | | @Autowired |
| | | private EmergencySuppliesService emergencySuppliesService; |
| | | |
| | | /** |
| | | * 应急预案列表 |
| | | */ |
| | | @RequestMapping(value = "/page/list" ,method = RequestMethod.POST) |
| | | private ResultVO<List<EmergencySuppliesPageRespDTO>> list (@RequestBody PageQuery<EmergencySuppliesQuery> pageQuery){ |
| | | PageUtils.checkCheck(pageQuery.getPageIndex(), pageQuery.getPageSize()); |
| | | return emergencySuppliesService.selectEmergencySuppliesList(pageQuery); |
| | | } |
| | | |
| | | /** |
| | | * 应急预案新增 |
| | | */ |
| | | @RequestMapping(value = "/add",method = RequestMethod.POST) |
| | | public ResultVO addEmergencySupplies(Principal principal, @RequestBody EmergencySuppliesReqDTO emergencySuppliesReqDTO) { |
| | | String uid = principal.getName(); |
| | | return emergencySuppliesService.addEmergencySupplies(Long.valueOf(uid), emergencySuppliesReqDTO); |
| | | } |
| | | |
| | | /** |
| | | * 应急预案详情 |
| | | */ |
| | | @RequestMapping(value = "/info/{id}",method = RequestMethod.GET) |
| | | public ResultVO<EmergencySuppliesDetailRespDTO> getEmergencySuppliesById(@PathVariable("id")Long id){ |
| | | return emergencySuppliesService.getEmergencySuppliesById(id); |
| | | } |
| | | |
| | | /** |
| | | * 应急预案修改 |
| | | */ |
| | | @RequestMapping(value = "/update",method = RequestMethod.POST) |
| | | public ResultVO updateEmergencySupplies(Principal principal, @RequestBody EmergencySuppliesReqDTO emergencySuppliesReqDTO) { |
| | | String uid = principal.getName(); |
| | | return emergencySuppliesService.updateEmergencySupplies(Long.valueOf(uid), emergencySuppliesReqDTO); |
| | | } |
| | | |
| | | /** |
| | | * 应急预案删除/批量删除 |
| | | */ |
| | | @RequestMapping(value = "/batchDelete/{ids}",method = RequestMethod.GET) |
| | | public ResultVO batchDeleteEmergencySupplies(@PathVariable("ids")String ids){ |
| | | return emergencySuppliesService.batchDeleteEmergencySupplies(ids); |
| | | } |
| | | } |
对比新文件 |
| | |
| | | package com.gkhy.safePlatform.emergency.entity; |
| | | |
| | | import com.baomidou.mybatisplus.annotation.IdType; |
| | | import com.baomidou.mybatisplus.annotation.TableId; |
| | | import com.baomidou.mybatisplus.annotation.TableName; |
| | | |
| | | import java.util.Date; |
| | | |
| | | @TableName("emergency_supplies") |
| | | public class EmergencySuppliesInfo { |
| | | |
| | | @TableId(type = IdType.AUTO) |
| | | private Long id; |
| | | private Boolean delFlag; |
| | | private Date gmtCreate; |
| | | private Date gmtModitify; |
| | | private Long createUid; |
| | | private Long updateUid; |
| | | |
| | | private Date productionDate; |
| | | private Date useDate; |
| | | private Date inspectDate; |
| | | private Date nextInspectDate; |
| | | private Integer inspectPeriod; |
| | | private Integer count; |
| | | private Integer usePeriod; |
| | | private Long departmentId; |
| | | private Long principalUserUid; |
| | | private String status; |
| | | private String classification; |
| | | private String name; |
| | | private String number; |
| | | private String model; |
| | | private String longitude; |
| | | private String latitude; |
| | | private String use; |
| | | private Long areaId; |
| | | private String place; |
| | | private String useExplain; |
| | | |
| | | public Long getId() { |
| | | return id; |
| | | } |
| | | |
| | | public void setId(Long id) { |
| | | this.id = id; |
| | | } |
| | | |
| | | public Boolean getDelFlag() { |
| | | return delFlag; |
| | | } |
| | | |
| | | public void setDelFlag(Boolean delFlag) { |
| | | this.delFlag = delFlag; |
| | | } |
| | | |
| | | public Date getGmtCreate() { |
| | | return gmtCreate; |
| | | } |
| | | |
| | | public void setGmtCreate(Date gmtCreate) { |
| | | this.gmtCreate = gmtCreate; |
| | | } |
| | | |
| | | public Date getGmtModitify() { |
| | | return gmtModitify; |
| | | } |
| | | |
| | | public void setGmtModitify(Date gmtModitify) { |
| | | this.gmtModitify = gmtModitify; |
| | | } |
| | | |
| | | public Long getCreateUid() { |
| | | return createUid; |
| | | } |
| | | |
| | | public void setCreateUid(Long createUid) { |
| | | this.createUid = createUid; |
| | | } |
| | | |
| | | public Long getUpdateUid() { |
| | | return updateUid; |
| | | } |
| | | |
| | | public void setUpdateUid(Long updateUid) { |
| | | this.updateUid = updateUid; |
| | | } |
| | | |
| | | public Date getProductionDate() { |
| | | return productionDate; |
| | | } |
| | | |
| | | public void setProductionDate(Date productionDate) { |
| | | this.productionDate = productionDate; |
| | | } |
| | | |
| | | public Date getUseDate() { |
| | | return useDate; |
| | | } |
| | | |
| | | public void setUseDate(Date useDate) { |
| | | this.useDate = useDate; |
| | | } |
| | | |
| | | public Date getInspectDate() { |
| | | return inspectDate; |
| | | } |
| | | |
| | | public void setInspectDate(Date inspectDate) { |
| | | this.inspectDate = inspectDate; |
| | | } |
| | | |
| | | public Date getNextInspectDate() { |
| | | return nextInspectDate; |
| | | } |
| | | |
| | | public void setNextInspectDate(Date nextInspectDate) { |
| | | this.nextInspectDate = nextInspectDate; |
| | | } |
| | | |
| | | public Integer getInspectPeriod() { |
| | | return inspectPeriod; |
| | | } |
| | | |
| | | public void setInspectPeriod(Integer inspectPeriod) { |
| | | this.inspectPeriod = inspectPeriod; |
| | | } |
| | | |
| | | public Integer getCount() { |
| | | return count; |
| | | } |
| | | |
| | | public void setCount(Integer count) { |
| | | this.count = count; |
| | | } |
| | | |
| | | public Integer getUsePeriod() { |
| | | return usePeriod; |
| | | } |
| | | |
| | | public void setUsePeriod(Integer usePeriod) { |
| | | this.usePeriod = usePeriod; |
| | | } |
| | | |
| | | public Long getDepartmentId() { |
| | | return departmentId; |
| | | } |
| | | |
| | | public void setDepartmentId(Long departmentId) { |
| | | this.departmentId = departmentId; |
| | | } |
| | | |
| | | public Long getPrincipalUserUid() { |
| | | return principalUserUid; |
| | | } |
| | | |
| | | public void setPrincipalUserUid(Long principalUserUid) { |
| | | this.principalUserUid = principalUserUid; |
| | | } |
| | | |
| | | public String getStatus() { |
| | | return status; |
| | | } |
| | | |
| | | public void setStatus(String status) { |
| | | this.status = status; |
| | | } |
| | | |
| | | public String getClassification() { |
| | | return classification; |
| | | } |
| | | |
| | | public void setClassification(String classification) { |
| | | this.classification = classification; |
| | | } |
| | | |
| | | public String getName() { |
| | | return name; |
| | | } |
| | | |
| | | public void setName(String name) { |
| | | this.name = name; |
| | | } |
| | | |
| | | public String getNumber() { |
| | | return number; |
| | | } |
| | | |
| | | public void setNumber(String number) { |
| | | this.number = number; |
| | | } |
| | | |
| | | public String getModel() { |
| | | return model; |
| | | } |
| | | |
| | | public void setModel(String model) { |
| | | this.model = model; |
| | | } |
| | | |
| | | public String getLongitude() { |
| | | return longitude; |
| | | } |
| | | |
| | | public void setLongitude(String longitude) { |
| | | this.longitude = longitude; |
| | | } |
| | | |
| | | public String getLatitude() { |
| | | return latitude; |
| | | } |
| | | |
| | | public void setLatitude(String latitude) { |
| | | this.latitude = latitude; |
| | | } |
| | | |
| | | public String getUse() { |
| | | return use; |
| | | } |
| | | |
| | | public void setUse(String use) { |
| | | this.use = use; |
| | | } |
| | | |
| | | public Long getAreaId() { |
| | | return areaId; |
| | | } |
| | | |
| | | public void setAreaId(Long areaId) { |
| | | this.areaId = areaId; |
| | | } |
| | | |
| | | public String getPlace() { |
| | | return place; |
| | | } |
| | | |
| | | public void setPlace(String place) { |
| | | this.place = place; |
| | | } |
| | | |
| | | public String getUseExplain() { |
| | | return useExplain; |
| | | } |
| | | |
| | | public void setUseExplain(String useExplain) { |
| | | this.useExplain = useExplain; |
| | | } |
| | | |
| | | @Override |
| | | public String toString() { |
| | | return "EmergencySuppliesInfo{" + |
| | | "id=" + id + |
| | | ", delFlag=" + delFlag + |
| | | ", gmtCreate=" + gmtCreate + |
| | | ", gmtModitify=" + gmtModitify + |
| | | ", createUid=" + createUid + |
| | | ", updateUid=" + updateUid + |
| | | ", productionDate=" + productionDate + |
| | | ", useDate=" + useDate + |
| | | ", inspectDate=" + inspectDate + |
| | | ", nextInspectDate=" + nextInspectDate + |
| | | ", inspectPeriod=" + inspectPeriod + |
| | | ", count=" + count + |
| | | ", usePeriod=" + usePeriod + |
| | | ", departmentId=" + departmentId + |
| | | ", principalUserUid=" + principalUserUid + |
| | | ", status='" + status + '\'' + |
| | | ", classification='" + classification + '\'' + |
| | | ", name='" + name + '\'' + |
| | | ", number='" + number + '\'' + |
| | | ", model='" + model + '\'' + |
| | | ", longitude='" + longitude + '\'' + |
| | | ", latitude='" + latitude + '\'' + |
| | | ", use='" + use + '\'' + |
| | | ", areaId=" + areaId + |
| | | ", place='" + place + '\'' + |
| | | ", useExplain='" + useExplain + '\'' + |
| | | '}'; |
| | | } |
| | | } |
对比新文件 |
| | |
| | | package com.gkhy.safePlatform.emergency.entity; |
| | | |
| | | import com.baomidou.mybatisplus.annotation.IdType; |
| | | import com.baomidou.mybatisplus.annotation.TableId; |
| | | import com.baomidou.mybatisplus.annotation.TableName; |
| | | |
| | | import java.util.Date; |
| | | |
| | | @TableName("emergency_supplies") |
| | | public class EmergencySuppliesInfoDetailDO { |
| | | |
| | | @TableId(type = IdType.AUTO) |
| | | private Long id; |
| | | private Date productionDate; |
| | | private Date useDate; |
| | | private Date inspectDate; |
| | | private Date nextInspectDate; |
| | | private Integer inspectPeriod; |
| | | private Integer count; |
| | | private Integer usePeriod; |
| | | private Long departmentId; |
| | | private Long principalUserUid; |
| | | private String status; |
| | | private String classification; |
| | | private String name; |
| | | private String number; |
| | | private String model; |
| | | private String longitude; |
| | | private String latitude; |
| | | private String use; |
| | | private Long areaId; |
| | | private String place; |
| | | private String useExplain; |
| | | |
| | | public Long getId() { |
| | | return id; |
| | | } |
| | | |
| | | public void setId(Long id) { |
| | | this.id = id; |
| | | } |
| | | |
| | | public Date getProductionDate() { |
| | | return productionDate; |
| | | } |
| | | |
| | | public void setProductionDate(Date productionDate) { |
| | | this.productionDate = productionDate; |
| | | } |
| | | |
| | | public Date getUseDate() { |
| | | return useDate; |
| | | } |
| | | |
| | | public void setUseDate(Date useDate) { |
| | | this.useDate = useDate; |
| | | } |
| | | |
| | | public Date getInspectDate() { |
| | | return inspectDate; |
| | | } |
| | | |
| | | public void setInspectDate(Date inspectDate) { |
| | | this.inspectDate = inspectDate; |
| | | } |
| | | |
| | | public Date getNextInspectDate() { |
| | | return nextInspectDate; |
| | | } |
| | | |
| | | public void setNextInspectDate(Date nextInspectDate) { |
| | | this.nextInspectDate = nextInspectDate; |
| | | } |
| | | |
| | | public Integer getInspectPeriod() { |
| | | return inspectPeriod; |
| | | } |
| | | |
| | | public void setInspectPeriod(Integer inspectPeriod) { |
| | | this.inspectPeriod = inspectPeriod; |
| | | } |
| | | |
| | | public Integer getCount() { |
| | | return count; |
| | | } |
| | | |
| | | public void setCount(Integer count) { |
| | | this.count = count; |
| | | } |
| | | |
| | | public Integer getUsePeriod() { |
| | | return usePeriod; |
| | | } |
| | | |
| | | public void setUsePeriod(Integer usePeriod) { |
| | | this.usePeriod = usePeriod; |
| | | } |
| | | |
| | | public Long getDepartmentId() { |
| | | return departmentId; |
| | | } |
| | | |
| | | public void setDepartmentId(Long departmentId) { |
| | | this.departmentId = departmentId; |
| | | } |
| | | |
| | | public Long getPrincipalUserUid() { |
| | | return principalUserUid; |
| | | } |
| | | |
| | | public void setPrincipalUserUid(Long principalUserUid) { |
| | | this.principalUserUid = principalUserUid; |
| | | } |
| | | |
| | | public String getStatus() { |
| | | return status; |
| | | } |
| | | |
| | | public void setStatus(String status) { |
| | | this.status = status; |
| | | } |
| | | |
| | | public String getClassification() { |
| | | return classification; |
| | | } |
| | | |
| | | public void setClassification(String classification) { |
| | | this.classification = classification; |
| | | } |
| | | |
| | | public String getName() { |
| | | return name; |
| | | } |
| | | |
| | | public void setName(String name) { |
| | | this.name = name; |
| | | } |
| | | |
| | | public String getNumber() { |
| | | return number; |
| | | } |
| | | |
| | | public void setNumber(String number) { |
| | | this.number = number; |
| | | } |
| | | |
| | | public String getModel() { |
| | | return model; |
| | | } |
| | | |
| | | public void setModel(String model) { |
| | | this.model = model; |
| | | } |
| | | |
| | | public String getLongitude() { |
| | | return longitude; |
| | | } |
| | | |
| | | public void setLongitude(String longitude) { |
| | | this.longitude = longitude; |
| | | } |
| | | |
| | | public String getLatitude() { |
| | | return latitude; |
| | | } |
| | | |
| | | public void setLatitude(String latitude) { |
| | | this.latitude = latitude; |
| | | } |
| | | |
| | | public String getUse() { |
| | | return use; |
| | | } |
| | | |
| | | public void setUse(String use) { |
| | | this.use = use; |
| | | } |
| | | |
| | | public Long getAreaId() { |
| | | return areaId; |
| | | } |
| | | |
| | | public void setAreaId(Long areaId) { |
| | | this.areaId = areaId; |
| | | } |
| | | |
| | | public String getPlace() { |
| | | return place; |
| | | } |
| | | |
| | | public void setPlace(String place) { |
| | | this.place = place; |
| | | } |
| | | |
| | | public String getUseExplain() { |
| | | return useExplain; |
| | | } |
| | | |
| | | public void setUseExplain(String useExplain) { |
| | | this.useExplain = useExplain; |
| | | } |
| | | |
| | | @Override |
| | | public String toString() { |
| | | return "EmergencySuppliesInfo{" + |
| | | "id=" + id + |
| | | ", productionDate=" + productionDate + |
| | | ", useDate=" + useDate + |
| | | ", inspectDate=" + inspectDate + |
| | | ", nextInspectDate=" + nextInspectDate + |
| | | ", inspectPeriod=" + inspectPeriod + |
| | | ", count=" + count + |
| | | ", usePeriod=" + usePeriod + |
| | | ", departmentId=" + departmentId + |
| | | ", principalUserUid=" + principalUserUid + |
| | | ", status='" + status + '\'' + |
| | | ", classification='" + classification + '\'' + |
| | | ", name='" + name + '\'' + |
| | | ", number='" + number + '\'' + |
| | | ", model='" + model + '\'' + |
| | | ", longitude='" + longitude + '\'' + |
| | | ", latitude='" + latitude + '\'' + |
| | | ", use='" + use + '\'' + |
| | | ", areaId=" + areaId + |
| | | ", place='" + place + '\'' + |
| | | ", useExplain='" + useExplain + '\'' + |
| | | '}'; |
| | | } |
| | | } |
对比新文件 |
| | |
| | | package com.gkhy.safePlatform.emergency.entity; |
| | | |
| | | import com.baomidou.mybatisplus.annotation.IdType; |
| | | import com.baomidou.mybatisplus.annotation.TableId; |
| | | import com.baomidou.mybatisplus.annotation.TableName; |
| | | |
| | | import java.util.Date; |
| | | |
| | | @TableName("emergency_supplies") |
| | | public class EmergencySuppliesInfoPageDO { |
| | | |
| | | @TableId(type = IdType.AUTO) |
| | | private Long id; |
| | | |
| | | private String name; |
| | | private String number; |
| | | private Long departmentId; |
| | | private String classification; |
| | | private String place; |
| | | private Integer count; |
| | | |
| | | public Long getId() { |
| | | return id; |
| | | } |
| | | |
| | | public void setId(Long id) { |
| | | this.id = id; |
| | | } |
| | | |
| | | public String getName() { |
| | | return name; |
| | | } |
| | | |
| | | public void setName(String name) { |
| | | this.name = name; |
| | | } |
| | | |
| | | public String getNumber() { |
| | | return number; |
| | | } |
| | | |
| | | public void setNumber(String number) { |
| | | this.number = number; |
| | | } |
| | | |
| | | public Long getDepartmentId() { |
| | | return departmentId; |
| | | } |
| | | |
| | | public void setDepartmentId(Long departmentId) { |
| | | this.departmentId = departmentId; |
| | | } |
| | | |
| | | public String getClassification() { |
| | | return classification; |
| | | } |
| | | |
| | | public void setClassification(String classification) { |
| | | this.classification = classification; |
| | | } |
| | | |
| | | public String getPlace() { |
| | | return place; |
| | | } |
| | | |
| | | public void setPlace(String place) { |
| | | this.place = place; |
| | | } |
| | | |
| | | public Integer getCount() { |
| | | return count; |
| | | } |
| | | |
| | | public void setCount(Integer count) { |
| | | this.count = count; |
| | | } |
| | | |
| | | @Override |
| | | public String toString() { |
| | | return "EmergencySuppliesInfoPageDO{" + |
| | | "id=" + id + |
| | | ", name='" + name + '\'' + |
| | | ", number='" + number + '\'' + |
| | | ", departmentId=" + departmentId + |
| | | ", classification='" + classification + '\'' + |
| | | ", place='" + place + '\'' + |
| | | ", count=" + count + |
| | | '}'; |
| | | } |
| | | } |
| | |
| | | |
| | | DRILL_EXECUTE_NULL("D1004" , "应急演练实施不可为空"), |
| | | |
| | | DRILL_EVALUATION_NOT_EXIST("D1004" , "应急演练实施评价不存在"), |
| | | DRILL_EVALUATION_NOT_EXIST("D1005" , "应急演练实施评价不存在"), |
| | | |
| | | DRILL_EVALUATION_NULL("D1005" , "应急演练实施评价不可为空"), |
| | | DRILL_EVALUATION_NULL("D1006" , "应急演练实施评价不可为空"), |
| | | |
| | | SUPPLIES_NULL("S1001" , "应急物资不可为空"), |
| | | |
| | | SUPPLIES_NOT_EXIST("S1002" , "应急物资不存在"), |
| | | |
| | | ERROR("A3000", "未知错误"); |
| | | |
对比新文件 |
| | |
| | | package com.gkhy.safePlatform.emergency.model.dto.req; |
| | | |
| | | import com.baomidou.mybatisplus.annotation.IdType; |
| | | import com.baomidou.mybatisplus.annotation.TableId; |
| | | import com.baomidou.mybatisplus.annotation.TableName; |
| | | |
| | | import java.util.Date; |
| | | |
| | | public class EmergencySuppliesReqDTO { |
| | | |
| | | @TableId(type = IdType.AUTO) |
| | | private Long id; |
| | | private Date productionDate; |
| | | private Date useDate; |
| | | private Date inspectDate; |
| | | private Date nextInspectDate; |
| | | private Integer inspectPeriod; |
| | | private Integer count; |
| | | private Integer usePeriod; |
| | | private Long departmentId; |
| | | private Long principalUserUid; |
| | | private String status; |
| | | private String classification; |
| | | private String name; |
| | | private String number; |
| | | private String model; |
| | | private String longitude; |
| | | private String latitude; |
| | | private String use; |
| | | private Long areaId; |
| | | private String place; |
| | | private String useExplain; |
| | | |
| | | public Long getId() { |
| | | return id; |
| | | } |
| | | |
| | | public void setId(Long id) { |
| | | this.id = id; |
| | | } |
| | | |
| | | public Date getProductionDate() { |
| | | return productionDate; |
| | | } |
| | | |
| | | public void setProductionDate(Date productionDate) { |
| | | this.productionDate = productionDate; |
| | | } |
| | | |
| | | public Date getUseDate() { |
| | | return useDate; |
| | | } |
| | | |
| | | public void setUseDate(Date useDate) { |
| | | this.useDate = useDate; |
| | | } |
| | | |
| | | public Date getInspectDate() { |
| | | return inspectDate; |
| | | } |
| | | |
| | | public void setInspectDate(Date inspectDate) { |
| | | this.inspectDate = inspectDate; |
| | | } |
| | | |
| | | public Date getNextInspectDate() { |
| | | return nextInspectDate; |
| | | } |
| | | |
| | | public void setNextInspectDate(Date nextInspectDate) { |
| | | this.nextInspectDate = nextInspectDate; |
| | | } |
| | | |
| | | public Integer getInspectPeriod() { |
| | | return inspectPeriod; |
| | | } |
| | | |
| | | public void setInspectPeriod(Integer inspectPeriod) { |
| | | this.inspectPeriod = inspectPeriod; |
| | | } |
| | | |
| | | public Integer getCount() { |
| | | return count; |
| | | } |
| | | |
| | | public void setCount(Integer count) { |
| | | this.count = count; |
| | | } |
| | | |
| | | public Integer getUsePeriod() { |
| | | return usePeriod; |
| | | } |
| | | |
| | | public void setUsePeriod(Integer usePeriod) { |
| | | this.usePeriod = usePeriod; |
| | | } |
| | | |
| | | public Long getDepartmentId() { |
| | | return departmentId; |
| | | } |
| | | |
| | | public void setDepartmentId(Long departmentId) { |
| | | this.departmentId = departmentId; |
| | | } |
| | | |
| | | public Long getPrincipalUserUid() { |
| | | return principalUserUid; |
| | | } |
| | | |
| | | public void setPrincipalUserUid(Long principalUserUid) { |
| | | this.principalUserUid = principalUserUid; |
| | | } |
| | | |
| | | public String getStatus() { |
| | | return status; |
| | | } |
| | | |
| | | public void setStatus(String status) { |
| | | this.status = status; |
| | | } |
| | | |
| | | public String getClassification() { |
| | | return classification; |
| | | } |
| | | |
| | | public void setClassification(String classification) { |
| | | this.classification = classification; |
| | | } |
| | | |
| | | public String getName() { |
| | | return name; |
| | | } |
| | | |
| | | public void setName(String name) { |
| | | this.name = name; |
| | | } |
| | | |
| | | public String getNumber() { |
| | | return number; |
| | | } |
| | | |
| | | public void setNumber(String number) { |
| | | this.number = number; |
| | | } |
| | | |
| | | public String getModel() { |
| | | return model; |
| | | } |
| | | |
| | | public void setModel(String model) { |
| | | this.model = model; |
| | | } |
| | | |
| | | public String getLongitude() { |
| | | return longitude; |
| | | } |
| | | |
| | | public void setLongitude(String longitude) { |
| | | this.longitude = longitude; |
| | | } |
| | | |
| | | public String getLatitude() { |
| | | return latitude; |
| | | } |
| | | |
| | | public void setLatitude(String latitude) { |
| | | this.latitude = latitude; |
| | | } |
| | | |
| | | public String getUse() { |
| | | return use; |
| | | } |
| | | |
| | | public void setUse(String use) { |
| | | this.use = use; |
| | | } |
| | | |
| | | public Long getAreaId() { |
| | | return areaId; |
| | | } |
| | | |
| | | public void setAreaId(Long areaId) { |
| | | this.areaId = areaId; |
| | | } |
| | | |
| | | public String getPlace() { |
| | | return place; |
| | | } |
| | | |
| | | public void setPlace(String place) { |
| | | this.place = place; |
| | | } |
| | | |
| | | public String getUseExplain() { |
| | | return useExplain; |
| | | } |
| | | |
| | | public void setUseExplain(String useExplain) { |
| | | this.useExplain = useExplain; |
| | | } |
| | | |
| | | @Override |
| | | public String toString() { |
| | | return "EmergencySuppliesInfo{" + |
| | | "id=" + id + |
| | | ", productionDate=" + productionDate + |
| | | ", useDate=" + useDate + |
| | | ", inspectDate=" + inspectDate + |
| | | ", nextInspectDate=" + nextInspectDate + |
| | | ", inspectPeriod=" + inspectPeriod + |
| | | ", count=" + count + |
| | | ", usePeriod=" + usePeriod + |
| | | ", departmentId=" + departmentId + |
| | | ", principalUserUid=" + principalUserUid + |
| | | ", status='" + status + '\'' + |
| | | ", classification='" + classification + '\'' + |
| | | ", name='" + name + '\'' + |
| | | ", number='" + number + '\'' + |
| | | ", model='" + model + '\'' + |
| | | ", longitude='" + longitude + '\'' + |
| | | ", latitude='" + latitude + '\'' + |
| | | ", use='" + use + '\'' + |
| | | ", areaId=" + areaId + |
| | | ", place='" + place + '\'' + |
| | | ", useExplain='" + useExplain + '\'' + |
| | | '}'; |
| | | } |
| | | } |
对比新文件 |
| | |
| | | package com.gkhy.safePlatform.emergency.model.dto.resp; |
| | | |
| | | import com.baomidou.mybatisplus.annotation.IdType; |
| | | import com.baomidou.mybatisplus.annotation.TableId; |
| | | import com.baomidou.mybatisplus.annotation.TableName; |
| | | import com.fasterxml.jackson.annotation.JsonFormat; |
| | | |
| | | import java.util.Date; |
| | | |
| | | public class EmergencySuppliesDetailRespDTO { |
| | | |
| | | @TableId(type = IdType.AUTO) |
| | | private Long id; |
| | | @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss") |
| | | private Date productionDate; |
| | | @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss") |
| | | private Date useDate; |
| | | @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss") |
| | | private Date inspectDate; |
| | | @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss") |
| | | private Date nextInspectDate; |
| | | private Integer inspectPeriod; |
| | | private Integer count; |
| | | private Integer usePeriod; |
| | | private Long departmentId; |
| | | private Long principalUserUid; |
| | | private String status; |
| | | private String classification; |
| | | private String name; |
| | | private String number; |
| | | private String model; |
| | | private String longitude; |
| | | private String latitude; |
| | | private String use; |
| | | private Long areaId; |
| | | private String place; |
| | | private String useExplain; |
| | | |
| | | public Long getId() { |
| | | return id; |
| | | } |
| | | |
| | | public void setId(Long id) { |
| | | this.id = id; |
| | | } |
| | | |
| | | public Date getProductionDate() { |
| | | return productionDate; |
| | | } |
| | | |
| | | public void setProductionDate(Date productionDate) { |
| | | this.productionDate = productionDate; |
| | | } |
| | | |
| | | public Date getUseDate() { |
| | | return useDate; |
| | | } |
| | | |
| | | public void setUseDate(Date useDate) { |
| | | this.useDate = useDate; |
| | | } |
| | | |
| | | public Date getInspectDate() { |
| | | return inspectDate; |
| | | } |
| | | |
| | | public void setInspectDate(Date inspectDate) { |
| | | this.inspectDate = inspectDate; |
| | | } |
| | | |
| | | public Date getNextInspectDate() { |
| | | return nextInspectDate; |
| | | } |
| | | |
| | | public void setNextInspectDate(Date nextInspectDate) { |
| | | this.nextInspectDate = nextInspectDate; |
| | | } |
| | | |
| | | public Integer getInspectPeriod() { |
| | | return inspectPeriod; |
| | | } |
| | | |
| | | public void setInspectPeriod(Integer inspectPeriod) { |
| | | this.inspectPeriod = inspectPeriod; |
| | | } |
| | | |
| | | public Integer getCount() { |
| | | return count; |
| | | } |
| | | |
| | | public void setCount(Integer count) { |
| | | this.count = count; |
| | | } |
| | | |
| | | public Integer getUsePeriod() { |
| | | return usePeriod; |
| | | } |
| | | |
| | | public void setUsePeriod(Integer usePeriod) { |
| | | this.usePeriod = usePeriod; |
| | | } |
| | | |
| | | public Long getDepartmentId() { |
| | | return departmentId; |
| | | } |
| | | |
| | | public void setDepartmentId(Long departmentId) { |
| | | this.departmentId = departmentId; |
| | | } |
| | | |
| | | public Long getPrincipalUserUid() { |
| | | return principalUserUid; |
| | | } |
| | | |
| | | public void setPrincipalUserUid(Long principalUserUid) { |
| | | this.principalUserUid = principalUserUid; |
| | | } |
| | | |
| | | public String getStatus() { |
| | | return status; |
| | | } |
| | | |
| | | public void setStatus(String status) { |
| | | this.status = status; |
| | | } |
| | | |
| | | public String getClassification() { |
| | | return classification; |
| | | } |
| | | |
| | | public void setClassification(String classification) { |
| | | this.classification = classification; |
| | | } |
| | | |
| | | public String getName() { |
| | | return name; |
| | | } |
| | | |
| | | public void setName(String name) { |
| | | this.name = name; |
| | | } |
| | | |
| | | public String getNumber() { |
| | | return number; |
| | | } |
| | | |
| | | public void setNumber(String number) { |
| | | this.number = number; |
| | | } |
| | | |
| | | public String getModel() { |
| | | return model; |
| | | } |
| | | |
| | | public void setModel(String model) { |
| | | this.model = model; |
| | | } |
| | | |
| | | public String getLongitude() { |
| | | return longitude; |
| | | } |
| | | |
| | | public void setLongitude(String longitude) { |
| | | this.longitude = longitude; |
| | | } |
| | | |
| | | public String getLatitude() { |
| | | return latitude; |
| | | } |
| | | |
| | | public void setLatitude(String latitude) { |
| | | this.latitude = latitude; |
| | | } |
| | | |
| | | public String getUse() { |
| | | return use; |
| | | } |
| | | |
| | | public void setUse(String use) { |
| | | this.use = use; |
| | | } |
| | | |
| | | public Long getAreaId() { |
| | | return areaId; |
| | | } |
| | | |
| | | public void setAreaId(Long areaId) { |
| | | this.areaId = areaId; |
| | | } |
| | | |
| | | public String getPlace() { |
| | | return place; |
| | | } |
| | | |
| | | public void setPlace(String place) { |
| | | this.place = place; |
| | | } |
| | | |
| | | public String getUseExplain() { |
| | | return useExplain; |
| | | } |
| | | |
| | | public void setUseExplain(String useExplain) { |
| | | this.useExplain = useExplain; |
| | | } |
| | | |
| | | @Override |
| | | public String toString() { |
| | | return "EmergencySuppliesInfo{" + |
| | | "id=" + id + |
| | | ", productionDate=" + productionDate + |
| | | ", useDate=" + useDate + |
| | | ", inspectDate=" + inspectDate + |
| | | ", nextInspectDate=" + nextInspectDate + |
| | | ", inspectPeriod=" + inspectPeriod + |
| | | ", count=" + count + |
| | | ", usePeriod=" + usePeriod + |
| | | ", departmentId=" + departmentId + |
| | | ", principalUserUid=" + principalUserUid + |
| | | ", status='" + status + '\'' + |
| | | ", classification='" + classification + '\'' + |
| | | ", name='" + name + '\'' + |
| | | ", number='" + number + '\'' + |
| | | ", model='" + model + '\'' + |
| | | ", longitude='" + longitude + '\'' + |
| | | ", latitude='" + latitude + '\'' + |
| | | ", use='" + use + '\'' + |
| | | ", areaId=" + areaId + |
| | | ", place='" + place + '\'' + |
| | | ", useExplain='" + useExplain + '\'' + |
| | | '}'; |
| | | } |
| | | } |
对比新文件 |
| | |
| | | package com.gkhy.safePlatform.emergency.model.dto.resp; |
| | | |
| | | import com.baomidou.mybatisplus.annotation.IdType; |
| | | import com.baomidou.mybatisplus.annotation.TableId; |
| | | import com.baomidou.mybatisplus.annotation.TableName; |
| | | |
| | | public class EmergencySuppliesPageRespDTO { |
| | | |
| | | @TableId(type = IdType.AUTO) |
| | | private Long id; |
| | | |
| | | private String name; |
| | | private String number; |
| | | private Long departmentId; |
| | | private String classification; |
| | | private String place; |
| | | private Integer count; |
| | | |
| | | public Long getId() { |
| | | return id; |
| | | } |
| | | |
| | | public void setId(Long id) { |
| | | this.id = id; |
| | | } |
| | | |
| | | public String getName() { |
| | | return name; |
| | | } |
| | | |
| | | public void setName(String name) { |
| | | this.name = name; |
| | | } |
| | | |
| | | public String getNumber() { |
| | | return number; |
| | | } |
| | | |
| | | public void setNumber(String number) { |
| | | this.number = number; |
| | | } |
| | | |
| | | public Long getDepartmentId() { |
| | | return departmentId; |
| | | } |
| | | |
| | | public void setDepartmentId(Long departmentId) { |
| | | this.departmentId = departmentId; |
| | | } |
| | | |
| | | public String getClassification() { |
| | | return classification; |
| | | } |
| | | |
| | | public void setClassification(String classification) { |
| | | this.classification = classification; |
| | | } |
| | | |
| | | public String getPlace() { |
| | | return place; |
| | | } |
| | | |
| | | public void setPlace(String place) { |
| | | this.place = place; |
| | | } |
| | | |
| | | public Integer getCount() { |
| | | return count; |
| | | } |
| | | |
| | | public void setCount(Integer count) { |
| | | this.count = count; |
| | | } |
| | | |
| | | @Override |
| | | public String toString() { |
| | | return "EmergencySuppliesInfoPageDO{" + |
| | | "id=" + id + |
| | | ", name='" + name + '\'' + |
| | | ", number='" + number + '\'' + |
| | | ", departmentId=" + departmentId + |
| | | ", classification='" + classification + '\'' + |
| | | ", place='" + place + '\'' + |
| | | ", count=" + count + |
| | | '}'; |
| | | } |
| | | } |
对比新文件 |
| | |
| | | package com.gkhy.safePlatform.emergency.query; |
| | | |
| | | public class EmergencySuppliesQuery { |
| | | |
| | | private String name ; |
| | | |
| | | |
| | | public String getName() { |
| | | return name; |
| | | } |
| | | |
| | | public void setName(String name) { |
| | | this.name = name; |
| | | } |
| | | |
| | | } |
对比新文件 |
| | |
| | | package com.gkhy.safePlatform.emergency.query.db; |
| | | |
| | | public class EmergencySuppliesDBQuery { |
| | | |
| | | private String name ; |
| | | |
| | | |
| | | public String getName() { |
| | | return name; |
| | | } |
| | | |
| | | public void setName(String name) { |
| | | this.name = name; |
| | | } |
| | | |
| | | } |
对比新文件 |
| | |
| | | package com.gkhy.safePlatform.emergency.repository; |
| | | |
| | | import com.baomidou.mybatisplus.core.mapper.BaseMapper; |
| | | import com.baomidou.mybatisplus.extension.plugins.pagination.Page; |
| | | import com.gkhy.safePlatform.emergency.entity.EmergencySuppliesInfo; |
| | | import com.gkhy.safePlatform.emergency.entity.EmergencySuppliesInfoDetailDO; |
| | | import com.gkhy.safePlatform.emergency.entity.EmergencySuppliesInfoPageDO; |
| | | import com.gkhy.safePlatform.emergency.query.db.EmergencySuppliesDBQuery; |
| | | import org.apache.ibatis.annotations.Param; |
| | | import org.springframework.stereotype.Repository; |
| | | |
| | | import java.util.List; |
| | | |
| | | @Repository |
| | | public interface EmergencySuppliesInfoRepository extends BaseMapper<EmergencySuppliesInfo> { |
| | | |
| | | List<EmergencySuppliesInfoPageDO> selectEmergencySuppliesList(Page<EmergencySuppliesInfoPageDO> page, @Param("query") EmergencySuppliesDBQuery emergencySuppliesDBQuery); |
| | | |
| | | void addEmergencySupplies(EmergencySuppliesInfo emergencySuppliesInfo); |
| | | |
| | | EmergencySuppliesInfoDetailDO selectEmergencySuppliesById(@Param("id") Long id); |
| | | |
| | | void updateEmergencySupplies(EmergencySuppliesInfo emergencySuppliesInfo); |
| | | |
| | | void deleteEmergencySupplies(@Param("id") Long id); |
| | | } |
对比新文件 |
| | |
| | | package com.gkhy.safePlatform.emergency.service; |
| | | |
| | | import com.gkhy.safePlatform.commons.query.PageQuery; |
| | | import com.gkhy.safePlatform.commons.vo.ResultVO; |
| | | import com.gkhy.safePlatform.commons.vo.SearchResultVO; |
| | | import com.gkhy.safePlatform.emergency.model.dto.req.EmergencySuppliesReqDTO; |
| | | import com.gkhy.safePlatform.emergency.model.dto.resp.EmergencySuppliesDetailRespDTO; |
| | | import com.gkhy.safePlatform.emergency.model.dto.resp.EmergencySuppliesPageRespDTO; |
| | | import com.gkhy.safePlatform.emergency.query.EmergencySuppliesQuery; |
| | | |
| | | import java.util.List; |
| | | |
| | | public interface EmergencySuppliesService { |
| | | |
| | | SearchResultVO<List<EmergencySuppliesPageRespDTO>> selectEmergencySuppliesList(PageQuery<EmergencySuppliesQuery> query); |
| | | |
| | | ResultVO addEmergencySupplies(Long uid, EmergencySuppliesReqDTO emergencySuppliesReqDTO); |
| | | |
| | | ResultVO<EmergencySuppliesDetailRespDTO> getEmergencySuppliesById(Long id); |
| | | |
| | | ResultVO updateEmergencySupplies(Long uid, EmergencySuppliesReqDTO emergencySuppliesReqDTO); |
| | | |
| | | ResultVO batchDeleteEmergencySupplies(String ids); |
| | | } |
对比新文件 |
| | |
| | | package com.gkhy.safePlatform.emergency.service.baseService; |
| | | |
| | | import com.baomidou.mybatisplus.extension.plugins.pagination.Page; |
| | | import com.baomidou.mybatisplus.extension.service.IService; |
| | | import com.gkhy.safePlatform.emergency.entity.EmergencySuppliesInfo; |
| | | import com.gkhy.safePlatform.emergency.entity.EmergencySuppliesInfoDetailDO; |
| | | import com.gkhy.safePlatform.emergency.entity.EmergencySuppliesInfoPageDO; |
| | | import com.gkhy.safePlatform.emergency.query.db.EmergencySuppliesDBQuery; |
| | | |
| | | import java.util.List; |
| | | |
| | | |
| | | public interface EmergencySuppliesInfoService extends IService<EmergencySuppliesInfo> { |
| | | |
| | | List<EmergencySuppliesInfoPageDO> selectEmergencySuppliesList(Page<EmergencySuppliesInfoPageDO> page, EmergencySuppliesDBQuery emergencySuppliesDBQuery); |
| | | |
| | | void addEmergencySupplies(EmergencySuppliesInfo emergencySuppliesInfo); |
| | | |
| | | EmergencySuppliesInfoDetailDO selectEmergencySuppliesById(Long id); |
| | | |
| | | void updateEmergencySupplies(EmergencySuppliesInfo emergencySuppliesInfo); |
| | | |
| | | void deleteEmergencySupplies(Long SuppliesId); |
| | | } |
对比新文件 |
| | |
| | | package com.gkhy.safePlatform.emergency.service.baseService.impl; |
| | | |
| | | import com.baomidou.mybatisplus.extension.plugins.pagination.Page; |
| | | import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; |
| | | import com.gkhy.safePlatform.emergency.entity.EmergencySuppliesInfo; |
| | | import com.gkhy.safePlatform.emergency.entity.EmergencySuppliesInfoDetailDO; |
| | | import com.gkhy.safePlatform.emergency.entity.EmergencySuppliesInfoPageDO; |
| | | import com.gkhy.safePlatform.emergency.query.db.EmergencySuppliesDBQuery; |
| | | import com.gkhy.safePlatform.emergency.repository.EmergencySuppliesInfoRepository; |
| | | import com.gkhy.safePlatform.emergency.service.baseService.EmergencySuppliesInfoService; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.stereotype.Service; |
| | | |
| | | import java.util.List; |
| | | |
| | | @Service("emergencySuppliesInfoService") |
| | | public class EmergencySuppliesInfoServiceImpl extends ServiceImpl<EmergencySuppliesInfoRepository, EmergencySuppliesInfo> implements EmergencySuppliesInfoService { |
| | | |
| | | @Autowired |
| | | private EmergencySuppliesInfoRepository emergencySuppliesInfoRepository; |
| | | |
| | | @Override |
| | | public List<EmergencySuppliesInfoPageDO> selectEmergencySuppliesList(Page<EmergencySuppliesInfoPageDO> page, EmergencySuppliesDBQuery emergencySuppliesDBQuery) { |
| | | return emergencySuppliesInfoRepository.selectEmergencySuppliesList(page,emergencySuppliesDBQuery); |
| | | } |
| | | |
| | | @Override |
| | | public void addEmergencySupplies(EmergencySuppliesInfo emergencySuppliesInfo) { |
| | | emergencySuppliesInfoRepository.addEmergencySupplies(emergencySuppliesInfo); |
| | | } |
| | | |
| | | @Override |
| | | public EmergencySuppliesInfoDetailDO selectEmergencySuppliesById(Long id) { |
| | | return emergencySuppliesInfoRepository.selectEmergencySuppliesById(id); |
| | | } |
| | | |
| | | @Override |
| | | public void updateEmergencySupplies(EmergencySuppliesInfo emergencySuppliesInfo) { |
| | | emergencySuppliesInfoRepository.updateEmergencySupplies(emergencySuppliesInfo); |
| | | } |
| | | |
| | | @Override |
| | | public void deleteEmergencySupplies(Long SuppliesId) { |
| | | emergencySuppliesInfoRepository.deleteEmergencySupplies(SuppliesId); |
| | | } |
| | | |
| | | |
| | | } |
对比新文件 |
| | |
| | | package com.gkhy.safePlatform.emergency.service.impl; |
| | | |
| | | import com.baomidou.mybatisplus.extension.plugins.pagination.Page; |
| | | import com.gkhy.safePlatform.commons.enums.ResultCodes; |
| | | import com.gkhy.safePlatform.commons.query.PageQuery; |
| | | import com.gkhy.safePlatform.commons.utils.BeanCopyUtils; |
| | | import com.gkhy.safePlatform.commons.utils.StringUtils; |
| | | import com.gkhy.safePlatform.commons.vo.ResultVO; |
| | | import com.gkhy.safePlatform.commons.vo.SearchResultVO; |
| | | import com.gkhy.safePlatform.emergency.entity.*; |
| | | import com.gkhy.safePlatform.emergency.enums.EmergencyResultCodes; |
| | | import com.gkhy.safePlatform.emergency.excepiton.EmergencyException; |
| | | import com.gkhy.safePlatform.emergency.model.dto.req.*; |
| | | import com.gkhy.safePlatform.emergency.model.dto.resp.*; |
| | | import com.gkhy.safePlatform.emergency.query.EmergencySuppliesQuery; |
| | | import com.gkhy.safePlatform.emergency.query.db.EmergencySuppliesDBQuery; |
| | | import com.gkhy.safePlatform.emergency.service.EmergencySuppliesService; |
| | | import com.gkhy.safePlatform.emergency.service.baseService.*; |
| | | import org.springframework.beans.BeanUtils; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.stereotype.Service; |
| | | |
| | | import java.util.Date; |
| | | import java.util.List; |
| | | |
| | | @Service("emergencySuppliesService") |
| | | public class EmergencySuppliesServiceImpl implements EmergencySuppliesService { |
| | | |
| | | @Autowired |
| | | private EmergencySuppliesInfoService emergencySuppliesInfoService; |
| | | |
| | | |
| | | @Override |
| | | public SearchResultVO<List<EmergencySuppliesPageRespDTO>> selectEmergencySuppliesList(PageQuery<EmergencySuppliesQuery> query) { |
| | | Long pageIndex = query.getPageIndex(); |
| | | Long pageSize = query.getPageSize(); |
| | | Page<EmergencySuppliesInfoPageDO> page = new Page<>(pageIndex, pageSize); |
| | | |
| | | EmergencySuppliesDBQuery emergencySuppliesDBQuery = new EmergencySuppliesDBQuery(); |
| | | if (query.getSearchParams() != null) { |
| | | BeanUtils.copyProperties(query.getSearchParams(), emergencySuppliesDBQuery); |
| | | } |
| | | List<EmergencySuppliesInfoPageDO> emergencySuppliesListDoInfoList = emergencySuppliesInfoService.selectEmergencySuppliesList(page,emergencySuppliesDBQuery); |
| | | List<EmergencySuppliesPageRespDTO> respList = BeanCopyUtils.copyBeanList(emergencySuppliesListDoInfoList, EmergencySuppliesPageRespDTO.class); |
| | | |
| | | return new SearchResultVO<>( |
| | | true, |
| | | pageIndex, |
| | | pageSize, |
| | | page.getTotal(), |
| | | respList, |
| | | ResultCodes.OK |
| | | ); |
| | | } |
| | | |
| | | @Override |
| | | public ResultVO addEmergencySupplies(Long uid, EmergencySuppliesReqDTO emergencySuppliesReqDTO) { |
| | | Date nowDate = new Date(); |
| | | // 新增应急物资 |
| | | EmergencySuppliesInfo emergencySuppliesInfo = new EmergencySuppliesInfo(); |
| | | BeanUtils.copyProperties(emergencySuppliesReqDTO,emergencySuppliesInfo); |
| | | emergencySuppliesInfo.setDelFlag(false); |
| | | emergencySuppliesInfo.setCreateUid(uid); |
| | | emergencySuppliesInfo.setGmtCreate(nowDate); |
| | | emergencySuppliesInfoService.addEmergencySupplies(emergencySuppliesInfo); |
| | | |
| | | return new ResultVO<>(ResultCodes.OK); |
| | | } |
| | | |
| | | @Override |
| | | public ResultVO<EmergencySuppliesDetailRespDTO> getEmergencySuppliesById(Long id) { |
| | | EmergencySuppliesDetailRespDTO emergencySuppliesDetailRespDTO = new EmergencySuppliesDetailRespDTO(); |
| | | // 查询是否存在 |
| | | EmergencySuppliesInfoDetailDO emergencySuppliesInfoDetailDO = emergencySuppliesInfoService.selectEmergencySuppliesById(id); |
| | | if (emergencySuppliesInfoDetailDO==null){ |
| | | throw new EmergencyException(EmergencyResultCodes.SUPPLIES_NOT_EXIST); |
| | | }else{ |
| | | BeanUtils.copyProperties(emergencySuppliesInfoDetailDO,emergencySuppliesDetailRespDTO); |
| | | return new ResultVO<>(ResultCodes.OK,emergencySuppliesDetailRespDTO); |
| | | } |
| | | } |
| | | |
| | | @Override |
| | | public ResultVO updateEmergencySupplies(Long uid, EmergencySuppliesReqDTO emergencySuppliesReqDTO) { |
| | | Date nowDate = new Date(); |
| | | // 查询是否存在 |
| | | EmergencySuppliesInfoDetailDO emergencySuppliesInfoDetailDO = emergencySuppliesInfoService.selectEmergencySuppliesById(emergencySuppliesReqDTO.getId()); |
| | | if (emergencySuppliesInfoDetailDO==null){ |
| | | throw new EmergencyException(EmergencyResultCodes.SUPPLIES_NOT_EXIST); |
| | | }else{ |
| | | EmergencySuppliesInfo emergencySuppliesInfo = new EmergencySuppliesInfo(); |
| | | BeanUtils.copyProperties(emergencySuppliesReqDTO,emergencySuppliesInfo); |
| | | emergencySuppliesInfo.setUpdateUid(uid); |
| | | emergencySuppliesInfo.setGmtModitify(nowDate); |
| | | emergencySuppliesInfoService.updateEmergencySupplies(emergencySuppliesInfo); |
| | | |
| | | return new ResultVO<>(ResultCodes.OK); |
| | | } |
| | | } |
| | | |
| | | @Override |
| | | public ResultVO batchDeleteEmergencySupplies(String ids) { |
| | | if (StringUtils.isBlank(ids)) { |
| | | throw new EmergencyException(EmergencyResultCodes.SUPPLIES_NULL); |
| | | } else { |
| | | String[] idArr = ids.split(","); |
| | | for (String id : idArr) { |
| | | deleteEmergencySupplies(Long.valueOf(id)); |
| | | } |
| | | return new ResultVO(ResultCodes.OK); |
| | | } |
| | | } |
| | | |
| | | private void deleteEmergencySupplies(Long id) { |
| | | //查询是否存在 |
| | | EmergencySuppliesInfoDetailDO emergencySuppliesInfoDetailDO = emergencySuppliesInfoService.selectEmergencySuppliesById(id); |
| | | if (emergencySuppliesInfoDetailDO==null){ |
| | | throw new EmergencyException(EmergencyResultCodes.SUPPLIES_NOT_EXIST); |
| | | }else{ |
| | | Long SuppliesId = emergencySuppliesInfoDetailDO.getId(); |
| | | emergencySuppliesInfoService.deleteEmergencySupplies(SuppliesId); |
| | | } |
| | | } |
| | | } |
对比新文件 |
| | |
| | | <?xml version="1.0" encoding="UTF-8" ?> |
| | | <!DOCTYPE mapper |
| | | PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" |
| | | "http://mybatis.org/dtd/mybatis-3-mapper.dtd"> |
| | | <mapper namespace="com.gkhy.safePlatform.emergency.repository.EmergencySuppliesInfoRepository"> |
| | | |
| | | <resultMap type="com.gkhy.safePlatform.emergency.entity.EmergencySuppliesInfoPageDO" id="emergencySuppliesInfoPageDOResult"> |
| | | <id column="id" property="id" jdbcType="BIGINT"/> |
| | | <result column="name" property="name"/> |
| | | <result column="number" property="number"/> |
| | | <result column="department_id" property="departmentId"/> |
| | | <result column="classification" property="classification"/> |
| | | <result column="place" property="place"/> |
| | | <result column="count" property="count"/> |
| | | </resultMap> |
| | | |
| | | <select id="selectEmergencySuppliesList" resultMap="emergencySuppliesInfoPageDOResult"> |
| | | select id,`name`,`number`,`department_id`,`classification`,place ,`count` from emergency_supplies where del_flag = 0 |
| | | <if test="query.name != null and query.name != ''">and `name` like concat('%', #{query.name}, '%')</if> |
| | | </select> |
| | | |
| | | <insert id="addEmergencySupplies" parameterType="com.gkhy.safePlatform.emergency.entity.EmergencySuppliesInfo" |
| | | keyProperty="id" useGeneratedKeys="true"> |
| | | insert into emergency_supplies |
| | | <trim prefix="(" suffix=")" suffixOverrides=","> |
| | | <if test="id != null ">id,</if> |
| | | <if test="delFlag != null ">del_flag,</if> |
| | | <if test="gmtCreate != null ">gmt_create,</if> |
| | | <if test="gmtModitify != null ">gmt_moditify,</if> |
| | | <if test="createUid != null ">create_uid,</if> |
| | | <if test="updateUid != null ">update_uid,</if> |
| | | <if test="productionDate != null ">production_date,</if> |
| | | <if test="useDate != null ">use_date,</if> |
| | | <if test="inspectDate != null ">inspect_date,</if> |
| | | <if test="nextInspectDate != null ">next_inspect_date,</if> |
| | | <if test="inspectPeriod != null ">inspect_period,</if> |
| | | <if test="count != null ">`count`,</if> |
| | | <if test="usePeriod != null ">use_period,</if> |
| | | <if test="departmentId != null ">department_id,</if> |
| | | <if test="principalUserUid != null ">`principal_user_uid`,</if> |
| | | <if test="status != null and status != ''">status,</if> |
| | | <if test="classification != null and classification != ''">`classification`,</if> |
| | | <if test="name != null and name != ''">`name`,</if> |
| | | <if test="number != null and number != ''">`number`,</if> |
| | | <if test="model != null and model != ''">`model`,</if> |
| | | <if test="longitude != null and longitude != ''">`longitude`,</if> |
| | | <if test="latitude != null and latitude != ''">`latitude`,</if> |
| | | <if test="use != null and use != ''">`use`,</if> |
| | | <if test="areaId != null ">`area_id`,</if> |
| | | <if test="place != null and place != ''">`place`,</if> |
| | | <if test="useExplain != null and useExplain != ''">`use_explain`,</if> |
| | | </trim> |
| | | <trim prefix="values (" suffix=")" suffixOverrides=","> |
| | | <if test="id != null ">#{id},</if> |
| | | <if test="delFlag != null ">#{delFlag},</if> |
| | | <if test="gmtCreate != null ">#{gmtCreate},</if> |
| | | <if test="gmtModitify != null ">#{gmtModitify},</if> |
| | | <if test="createUid != null ">#{createUid},</if> |
| | | <if test="updateUid != null ">#{updateUid},</if> |
| | | <if test="productionDate != null ">#{productionDate},</if> |
| | | <if test="useDate != null ">#{useDate},</if> |
| | | <if test="inspectDate != null ">#{inspectDate},</if> |
| | | <if test="nextInspectDate != null ">#{nextInspectDate},</if> |
| | | <if test="inspectPeriod != null ">#{inspectPeriod},</if> |
| | | <if test="count != null ">#{count},</if> |
| | | <if test="usePeriod != null ">#{usePeriod},</if> |
| | | <if test="departmentId != null ">#{departmentId},</if> |
| | | <if test="principalUserUid != null ">#{principalUserUid},</if> |
| | | <if test="status != null and status != ''">#{status},</if> |
| | | <if test="classification != null and classification != ''">#{classification},</if> |
| | | <if test="name != null and name != ''">#{name},</if> |
| | | <if test="number != null and number != ''">#{number},</if> |
| | | <if test="model != null and model != ''">#{model},</if> |
| | | <if test="longitude != null and longitude != ''">#{longitude},</if> |
| | | <if test="latitude != null and latitude != ''">#{latitude},</if> |
| | | <if test="use != null and use != ''">#{use},</if> |
| | | <if test="areaId != null ">#{areaId},</if> |
| | | <if test="place != null and place != ''">#{place},</if> |
| | | <if test="useExplain != null and useExplain != ''">#{useExplain},</if> |
| | | </trim> |
| | | </insert> |
| | | |
| | | |
| | | <resultMap type="com.gkhy.safePlatform.emergency.entity.EmergencySuppliesInfoDetailDO" id="emergencySuppliesInfoDetailDOResult"> |
| | | <id column="id" property="id" jdbcType="BIGINT"/> |
| | | <result column="production_date" property="productionDate"/> |
| | | <result column="use_date" property="useDate"/> |
| | | <result column="inspect_date" property="inspectDate"/> |
| | | <result column="next_inspect_date" property="nextInspectDate"/> |
| | | <result column="inspect_period" property="inspectPeriod"/> |
| | | <result column="count" property="count"/> |
| | | <result column="use_period" property="usePeriod"/> |
| | | <result column="department_id" property="departmentId"/> |
| | | <result column="principal_user_uid" property="principalUserUid"/> |
| | | <result column="status" property="status"/> |
| | | <result column="classification" property="classification"/> |
| | | <result column="name" property="name"/> |
| | | <result column="number" property="number"/> |
| | | <result column="model" property="model"/> |
| | | <result column="longitude" property="longitude"/> |
| | | <result column="latitude" property="latitude"/> |
| | | <result column="use" property="use"/> |
| | | <result column="area_id" property="areaId"/> |
| | | <result column="place" property="place"/> |
| | | <result column="use_explain" property="useExplain"/> |
| | | </resultMap> |
| | | |
| | | <select id="selectEmergencySuppliesById" resultMap="emergencySuppliesInfoDetailDOResult"> |
| | | select id ,`production_date`,`use_date`,`inspect_date`,`next_inspect_date`,inspect_period ,`count` ,use_period ,department_id ,principal_user_uid , |
| | | status ,classification ,`name` ,`number` ,model ,longitude ,latitude ,`use` ,area_id ,place ,use_explain |
| | | from emergency_supplies where del_flag = 0 and id = #{id} |
| | | </select> |
| | | |
| | | <update id="updateEmergencySupplies" parameterType="com.gkhy.safePlatform.emergency.entity.EmergencySuppliesInfo"> |
| | | update emergency_supplies |
| | | <trim prefix="SET" suffixOverrides=","> |
| | | <if test="gmtModitify != null ">gmt_moditify = #{gmtModitify},</if> |
| | | <if test="updateUid != null ">update_uid = #{updateUid},</if> |
| | | <if test="productionDate != null ">production_date = #{productionDate},</if> |
| | | <if test="useDate != null ">use_date = #{useDate},</if> |
| | | <if test="inspectDate != null ">inspect_date = #{inspectDate},</if> |
| | | <if test="nextInspectDate != null ">next_inspect_date = #{nextInspectDate},</if> |
| | | <if test="inspectPeriod != null ">inspect_period = #{inspectPeriod},</if> |
| | | <if test="count != null ">`count` = #{count},</if> |
| | | <if test="usePeriod != null ">use_period = #{usePeriod},</if> |
| | | <if test="departmentId != null ">department_id = #{departmentId},</if> |
| | | <if test="principalUserUid != null ">`principal_user_uid` = #{principalUserUid},</if> |
| | | <if test="status != null and status != ''">status = #{status},</if> |
| | | <if test="classification != null and classification != ''">`classification` = #{classification},</if> |
| | | <if test="name != null and name != ''">`name` = #{name},</if> |
| | | <if test="number != null and number != ''">`number` = #{number},</if> |
| | | <if test="model != null and model != ''">`model` = #{model},</if> |
| | | <if test="longitude != null and longitude != ''">`longitude` = #{longitude},</if> |
| | | <if test="latitude != null and latitude != ''">`latitude` = #{latitude},</if> |
| | | <if test="use != null and use != ''">`use` = #{use},</if> |
| | | <if test="areaId != null ">`area_id` = #{areaId},</if> |
| | | <if test="place != null and place != ''">`place` = #{place},</if> |
| | | <if test="useExplain != null and useExplain != ''">`use_explain` = #{useExplain},</if> |
| | | </trim> |
| | | where id = #{id} |
| | | </update> |
| | | |
| | | <update id="deleteEmergencySupplies"> |
| | | update emergency_supplies set del_flag = 1 where id = #{id} |
| | | </update> |
| | | </mapper> |