diff --git a/src/main/java/com/cm/tenlion/pollutantdata/controller/api/enterprisepoll/EnterprisePollController.java b/src/main/java/com/cm/tenlion/pollutantdata/controller/api/enterprisepoll/EnterprisePollController.java new file mode 100644 index 0000000..b2955fa --- /dev/null +++ b/src/main/java/com/cm/tenlion/pollutantdata/controller/api/enterprisepoll/EnterprisePollController.java @@ -0,0 +1,112 @@ +package com.cm.tenlion.pollutantdata.controller.api.enterprisepoll; + +import com.cm.common.annotation.CheckRequestBodyAnnotation; +import com.cm.common.base.AbstractController; +import com.cm.common.constants.ISystemConstant; + +import com.cm.common.pojo.ListPage; +import com.cm.common.result.ErrorResult; +import com.cm.common.result.SuccessResult; +import com.cm.common.result.SuccessResultData; +import com.cm.common.result.SuccessResultList; +import com.cm.tenlion.pollutantdata.pojo.dtos.enterprisepoll.EnterprisePollDTO; +import com.cm.tenlion.pollutantdata.pojo.vos.enterprisepoll.EnterprisePollVO; +import com.cm.tenlion.pollutantdata.service.enterprisepoll.IEnterprisePollService; +import io.swagger.annotations.*; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.web.bind.annotation.*; + +import java.util.Arrays; +import java.util.List; +import java.util.Map; + +/** + * @ClassName: EnterprisePollController + * @Description: 企业监控污染因子 + * @Author: CodeFactory + * @Date: 2021-08-06 14:19:31 + * @Version: 3.0 + **/ +@Api(tags = ISystemConstant.API_TAGS_SYSTEM_PREFIX + "企业监控污染因子接口") +@RestController +@RequestMapping(ISystemConstant.API_PREFIX + "/enterprisepoll") +public class EnterprisePollController extends AbstractController { + + @Autowired + private IEnterprisePollService enterprisePollService; + + @ApiOperation(value = "新增企业监控污染因子", notes = "新增企业监控污染因子接口") + @ApiResponses({@ApiResponse(code = 400, message = "请求失败", response = ErrorResult.class)}) + @PostMapping("save") + @CheckRequestBodyAnnotation + public SuccessResult save(@RequestBody EnterprisePollVO enterprisePollVO)throws Exception { + enterprisePollService.save(enterprisePollVO); + return new SuccessResult(); + } + + @ApiOperation(value = "删除企业监控污染因子", notes = "删除企业监控污染因子接口") + @ApiImplicitParams({ + @ApiImplicitParam(name = "ids", value = "ID列表,用下划线分隔", paramType = "path", example = "1_2_3") + }) + @ApiResponses({@ApiResponse(code = 400, message = "请求失败", response = ErrorResult.class)}) + @DeleteMapping("remove/{ids}") + public SuccessResult remove(@PathVariable("ids") String ids) { + enterprisePollService.remove(Arrays.asList(ids.split("\\_"))); + return new SuccessResult(); + } + + @ApiOperation(value = "修改企业监控污染因子", notes = "修改企业监控污染因子接口") + @ApiImplicitParams({ + @ApiImplicitParam(name = "enterprisePollId", value = "企业监控污染因子ID", paramType = "path") + }) + @ApiResponses({@ApiResponse(code = 400, message = "请求失败", response = ErrorResult.class)}) + @PutMapping("update/{enterprisePollId}") + @CheckRequestBodyAnnotation + public SuccessResult update(@PathVariable("enterprisePollId") String enterprisePollId, @RequestBody EnterprisePollVO enterprisePollVO) throws Exception { + enterprisePollService.update(enterprisePollId, enterprisePollVO); + return new SuccessResult(); + } + + @ApiOperation(value = "企业监控污染因子详情", notes = "企业监控污染因子详情接口") + @ApiImplicitParams({ + @ApiImplicitParam(name = "enterprisePollId", value = "企业监控污染因子ID", paramType = "path") + }) + @ApiResponses({@ApiResponse(code = 400, message = "请求失败", response = ErrorResult.class)}) + @GetMapping("get/{enterprisePollId}") + public EnterprisePollDTO get(@PathVariable("enterprisePollId") String enterprisePollId) { + return enterprisePollService.get(enterprisePollId); + } + + @ApiOperation(value = "企业监控污染因子列表", notes = "企业监控污染因子列表接口") + @ApiResponses({@ApiResponse(code = 400, message = "请求失败", response = ErrorResult.class)}) + @GetMapping("list") + public List list() { + Map params = requestParams(); + return enterprisePollService.list(params); + } + + @ApiOperation(value = "企业监控污染因子分页列表", notes = "企业监控污染因子分页列表接口") + @ApiImplicitParams({ + @ApiImplicitParam(name = "page", value = "当前页码", paramType = "query", dataType = "int", defaultValue = "1"), + @ApiImplicitParam(name = "rows", value = "显示数量", paramType = "query", dataType = "int", defaultValue = "20"), + @ApiImplicitParam(name = "keywords", value = "关键字", paramType = "query", dataType = "String"), + @ApiImplicitParam(name = "startTime", value = "开始时间", paramType = "query", dataType = "String"), + @ApiImplicitParam(name = "endTime", value = "结束时间", paramType = "query", dataType = "String") + }) + @ApiResponses({@ApiResponse(code = 400, message = "请求失败", response = ErrorResult.class)}) + @GetMapping("listpage") + public SuccessResultList> listPage(ListPage page) { + Map params = requestParams(); + page.setParams(params); + return enterprisePollService.listPage(page); + } + + @ApiOperation(value = "企业监控污染因子统计", notes = "企业监控污染因子统计接口") + @ApiResponses({@ApiResponse(code = 400, message = "请求失败", response = ErrorResult.class)}) + @GetMapping("count") + SuccessResultData count() { + Map params = requestParams(); + return new SuccessResultData<>(enterprisePollService.count(params)); + } + +} \ No newline at end of file diff --git a/src/main/java/com/cm/tenlion/pollutantdata/controller/app/resource/BigDataResult.java b/src/main/java/com/cm/tenlion/pollutantdata/controller/app/resource/BigDataResult.java new file mode 100644 index 0000000..4871e72 --- /dev/null +++ b/src/main/java/com/cm/tenlion/pollutantdata/controller/app/resource/BigDataResult.java @@ -0,0 +1,60 @@ +package com.cm.tenlion.pollutantdata.controller.app.resource; + +import java.util.ArrayList; +import java.util.HashMap; +import java.util.List; +import java.util.Map; + + +/** + * 大数据页面返回实体 + */ +public class BigDataResult { + + private Map data = new HashMap(); + + private List list = new ArrayList(); + + private String msg = "加载成功"; + + private String state = "200"; + + public static BigDataResult getInstance() { + return new BigDataResult(); + } + + public Map getData() { + return data; + } + + public void setData(Map data) { + this.data = data; + } + + public List getList() { + if (list == null) { + return new ArrayList<>(); + } + return list; + } + + public void setList(List list) { + this.list = list; + } + + public String getMsg() { + return msg == null ? "" : msg; + } + + public void setMsg(String msg) { + this.msg = msg; + } + + public String getState() { + return state == null ? "" : state; + } + + public void setState(String state) { + this.state = state; + } +} diff --git a/src/main/java/com/cm/tenlion/pollutantdata/controller/app/resource/alarmlog/AlarmlogAppResourceController.java b/src/main/java/com/cm/tenlion/pollutantdata/controller/app/resource/alarmlog/AlarmlogAppResourceController.java new file mode 100644 index 0000000..c5949c1 --- /dev/null +++ b/src/main/java/com/cm/tenlion/pollutantdata/controller/app/resource/alarmlog/AlarmlogAppResourceController.java @@ -0,0 +1,152 @@ +package com.cm.tenlion.pollutantdata.controller.app.resource.alarmlog; + + +import com.cm.common.base.AbstractController; +import com.cm.common.constants.ISystemConstant; +import com.cm.common.pojo.ListPage; +import com.cm.common.result.ErrorResult; +import com.cm.common.result.SuccessResultList; +import com.cm.common.utils.DateUtil; +import com.cm.tenlion.pollutantdata.controller.app.resource.BigDataResult; +import com.cm.tenlion.pollutantdata.pojo.dtos.alarmlog.AlarmLogDTO; +import com.cm.tenlion.pollutantdata.pojo.dtos.enterprisepoll.EnterprisePollDTO; +import com.cm.tenlion.pollutantdata.pojo.dtos.poll.PollDTO; +import com.cm.tenlion.pollutantdata.service.alarmlog.IAlarmLogService; +import com.cm.tenlion.pollutantdata.service.enterprisepoll.IEnterprisePollService; +import com.cm.tenlion.pollutantdata.service.poll.IPollService; +import io.swagger.annotations.*; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.web.bind.annotation.GetMapping; +import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.web.bind.annotation.RestController; + +import java.text.ParseException; +import java.text.SimpleDateFormat; +import java.util.*; + +@Api(tags = ISystemConstant.API_TAGS_APP_PREFIX + "报警日志接口") +@RestController +@RequestMapping(ISystemConstant.APP_PREFIX + "/alarmlog/" + ISystemConstant.APP_RELEASE_SUFFIX) +public class AlarmlogAppResourceController extends AbstractController { + + @Autowired + private IAlarmLogService alarmLogService; + @Autowired + private IEnterprisePollService enterprisePollService; + @Autowired + private IPollService pollService; + + + @ApiOperation(value = "获取当月报警数据", notes = "获取当月报警数据接口") + @ApiResponses({@ApiResponse(code = 400, message = "请求失败", response = ErrorResult.class)}) + @GetMapping("get-nowmonth") + public BigDataResult getNowMonth(){ + BigDataResult result = new BigDataResult(); + Map params = new HashMap<>(); + params.put("month","month"); + Integer count = alarmLogService.count(params); + params.clear(); + params.put("value",count); + result.setData(params); + return result; + } + + + + + @ApiOperation(value = "警告日志分页列表", notes = "警告日志分页列表接口") + @ApiImplicitParams({ + @ApiImplicitParam(name = "page", value = "当前页码", paramType = "query", dataType = "int", defaultValue = "1"), + @ApiImplicitParam(name = "rows", value = "显示数量", paramType = "query", dataType = "int", defaultValue = "20"), + @ApiImplicitParam(name = "keywords", value = "关键字", paramType = "query", dataType = "String"), + @ApiImplicitParam(name = "startTime", value = "开始时间", paramType = "query", dataType = "String"), + @ApiImplicitParam(name = "endTime", value = "结束时间", paramType = "query", dataType = "String") + }) + @ApiResponses({@ApiResponse(code = 400, message = "请求失败", response = ErrorResult.class)}) + @GetMapping("listpage") + public SuccessResultList> listPage(ListPage page) { + Map params = requestParams(); + page.setParams(params); + return alarmLogService.listPage(page); + } + + + @ApiOperation(value = "警告日志分页列表前五条", notes = "警告日志分页列表前五条接口") + @GetMapping("list-five") + public BigDataResult listFive() throws Exception{ + BigDataResult result = new BigDataResult(); + List> list = new ArrayList<>(); + /* {title:'新体路 测试企业1',date:'2021-06-03 22:00:52',content:'污水超标 , 当前 26 升/秒, 超标20%',level:3}*/ + ListPage page = new ListPage(); + page.setPage(1); + page.setRows(5); + SuccessResultList> listSuccessResultList = alarmLogService.listPage(page); + for (AlarmLogDTO row : listSuccessResultList.getRows()) { + Map params = new HashMap<>(); + params.put("title",row.getEnterpriseName()); + params.put("date",row.getGmtCreate()); + Double poll = countContent(row.getEnterpriseId(),row.getPollId(),row.getRtd()); + String s = "污染因子超标,当前" +row.getRtd()+"超标" +poll+ "%"; + params.put("content",row.getPollName()+s); + params.put("level",countLevel(poll)); + list.add(params); + } + result.setList(list); + return result; + } + + + + + + + + /** + * 计算超标百分比 + * @param enterpriseId 企业ID + * @param pollId 污染因子ID + * @param rtd 实时值 + * @return + */ + private final Double countContent(String enterpriseId,String pollId, Double rtd) throws Exception { + // 实际值 - 报警值 \ 报警值 * 100% + Double count = 0.0; + //根据编码查询污染因子 + PollDTO pollDTO = pollService.getByNo(pollId); + if(pollDTO != null){ + //查询企业绑定监控污染因子 + Map params = new HashMap<>(); + params.put("enterpriseId",enterpriseId); + params.put("pollId",pollDTO.getPollId()); + EnterprisePollDTO enterprisePollDTO = enterprisePollService.get(params); + if(enterprisePollDTO != null){//按企业绑定报警值计算 + double v = (rtd - enterprisePollDTO.getEnterprisePollBeyond()) / pollDTO.getAlarmValue(); + count = v * 100; + }else{ + double v = (rtd - pollDTO.getAlarmValue()) / pollDTO.getAlarmValue(); + count = v * 100; + } + } + return count; + } + + + public final Integer countLevel(Double poll){ + Integer level = 0; + if(poll == 0.0){ + level = 1; + } + if(poll <= 20){ + level = 2; + } + if(poll == 60){ + level = 3; + } + if(poll == 90){ + level = 4; + } + + return level; + } + +} \ No newline at end of file diff --git a/src/main/java/com/cm/tenlion/pollutantdata/controller/app/resource/poll/PollAppResourceController.java b/src/main/java/com/cm/tenlion/pollutantdata/controller/app/resource/poll/PollAppResourceController.java new file mode 100644 index 0000000..b5f4d49 --- /dev/null +++ b/src/main/java/com/cm/tenlion/pollutantdata/controller/app/resource/poll/PollAppResourceController.java @@ -0,0 +1,78 @@ +package com.cm.tenlion.pollutantdata.controller.app.resource.poll; + +import com.cm.common.base.AbstractController; +import com.cm.common.constants.ISystemConstant; +import com.cm.common.result.ErrorResult; +import com.cm.tenlion.pollutantdata.controller.app.resource.BigDataResult; +import com.cm.tenlion.pollutantdata.pojo.dtos.poll.PollDTO; +import com.cm.tenlion.pollutantdata.service.poll.IPollService; +import io.swagger.annotations.*; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.web.bind.annotation.GetMapping; +import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.web.bind.annotation.RestController; + +import java.lang.reflect.Array; +import java.util.ArrayList; +import java.util.HashMap; +import java.util.List; +import java.util.Map; + + +@Api(tags = ISystemConstant.API_TAGS_APP_PREFIX + "污染因子接口") +@RestController +@RequestMapping(ISystemConstant.APP_PREFIX + "/poll/" + ISystemConstant.APP_RELEASE_SUFFIX) +public class PollAppResourceController extends AbstractController { + @Autowired + private IPollService pollService; + + + + @ApiOperation(value = "污染因子超标企业统计", notes = "污染因子超标企业统计接口") + @ApiResponses({@ApiResponse(code = 400, message = "请求失败", response = ErrorResult.class)}) + @GetMapping("listExcessiveCompany") + public BigDataResult listExcessiveCompany(){ + BigDataResult result = new BigDataResult(); + List list =new ArrayList<>(); + + List> listMaps = pollService.listExcessiveCompany(new HashMap<>()); + //分装数据 + for (Map map : listMaps) { + String[] arr = new String[3]; + arr[0] = map.get("pollName").toString(); + arr[1] = map.get("companyNum").toString(); + arr[2] = map.get("unitConcentration").toString(); + list.add(arr); + } + result.setList(list); + return result; + } + + + @ApiOperation(value = "污染因子列表", notes = "污染因子列表接口") + @ApiResponses({@ApiResponse(code = 400, message = "请求失败", response = ErrorResult.class)}) + @GetMapping("listPoll") + public BigDataResult listPoll(){ + /* {id:'1',name:'选择污染因子'}*/ + BigDataResult result = new BigDataResult(); + List> list = new ArrayList<>(); + + Map params = new HashMap<>(); + List pollList = pollService.list(params); + for (PollDTO pollDTO : pollList) { + Map params1 = new HashMap<>(); + params1.put("id",pollDTO.getPollId()); + params1.put("name",pollDTO.getPollName()); + list.add(params1); + } + result.setList(list); + return result; + } + + + + + + + +} diff --git a/src/main/java/com/cm/tenlion/pollutantdata/controller/route/enterprisepoll/EnterprisePollRouteController.java b/src/main/java/com/cm/tenlion/pollutantdata/controller/route/enterprisepoll/EnterprisePollRouteController.java new file mode 100644 index 0000000..5bd1355 --- /dev/null +++ b/src/main/java/com/cm/tenlion/pollutantdata/controller/route/enterprisepoll/EnterprisePollRouteController.java @@ -0,0 +1,42 @@ +package com.cm.tenlion.pollutantdata.controller.route.enterprisepoll; + + +import com.cm.common.base.AbstractController; +import com.cm.common.constants.ISystemConstant; +import io.swagger.annotations.*; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.web.bind.annotation.*; +import org.springframework.web.servlet.ModelAndView; + +import java.util.Arrays; +import java.util.List; +import java.util.Map; + +/** + * @ClassName: EnterprisePollController + * @Description: 企业监控污染因子 + * @Author: CodeFactory + * @Date: 2021-08-06 14:19:31 + * @Version: 3.0 + **/ +@Api(tags = ISystemConstant.ROUTE_TAGS_PREFIX + "企业监控污染因子路由") +@RestController +@RequestMapping(ISystemConstant.ROUTE_PREFIX + "/enterprisepoll") +public class EnterprisePollRouteController extends AbstractController { + + @GetMapping("save") + public ModelAndView save() { + return new ModelAndView("enterprisepoll/save"); + } + + @GetMapping("update") + public ModelAndView update() { + return new ModelAndView("enterprisepoll/update"); + } + + @GetMapping("list") + public ModelAndView list() { + return new ModelAndView("enterprisepoll/list"); + } + +} \ No newline at end of file diff --git a/src/main/java/com/cm/tenlion/pollutantdata/dao/enterprisepoll/IEnterprisePollDao.java b/src/main/java/com/cm/tenlion/pollutantdata/dao/enterprisepoll/IEnterprisePollDao.java new file mode 100644 index 0000000..afbc27b --- /dev/null +++ b/src/main/java/com/cm/tenlion/pollutantdata/dao/enterprisepoll/IEnterprisePollDao.java @@ -0,0 +1,121 @@ +package com.cm.tenlion.pollutantdata.dao.enterprisepoll; + + +import com.cm.common.exception.RemoveException; +import com.cm.common.exception.SaveException; +import com.cm.common.exception.SearchException; +import com.cm.common.exception.UpdateException; +import com.cm.tenlion.pollutantdata.pojo.bos.enterprisepoll.EnterprisePollBO; +import com.cm.tenlion.pollutantdata.pojo.pos.enterprisepoll.EnterprisePollPO; +import com.cm.tenlion.pollutantdata.pojo.dtos.enterprisepoll.EnterprisePollDTO; +import org.springframework.stereotype.Repository; + +import java.util.List; +import java.util.Map; + +/** + * @ClassName: IEnterprisePollDao + * @Description: 企业监控污染因子 + * @Author: CodeFactory + * @Date: 2021-08-06 14:19:31 + * @Version: 3.0 + **/ +@Repository +public interface IEnterprisePollDao { + + /** + * 新增企业监控污染因子 + * + * @param params + * @throws SaveException + */ + void save(Map params) throws SaveException; + + /** + * 删除企业监控污染因子 + * + * @param params + * @throws RemoveException + */ + void remove(Map params) throws RemoveException; + + /** + * 删除企业监控污染因子(物理) + * + * @param params + * @throws RemoveException + */ + void delete(Map params) throws RemoveException; + + /** + * 修改企业监控污染因子 + * + * @param params + * @throws UpdateException + */ + void update(Map params) throws UpdateException; + + /** + * 企业监控污染因子详情 + * + * @param params + * @return + * @throws SearchException + */ + EnterprisePollDTO get(Map params) throws SearchException; + + /** + * 企业监控污染因子详情 + * + * @param params + * @return + * @throws SearchException + */ + EnterprisePollBO getBO(Map params) throws SearchException; + + /** + * 企业监控污染因子详情 + * + * @param params + * @return + * @throws SearchException + */ + EnterprisePollPO getPO(Map params) throws SearchException; + + /** + * 企业监控污染因子列表 + * + * @param params + * @return + * @throws SearchException + */ + List list(Map params) throws SearchException; + + /** + * 企业监控污染因子列表 + * + * @param params + * @return + * @throws SearchException + */ + List listBO(Map params) throws SearchException; + + /** + * 企业监控污染因子列表 + * + * @param params + * @return + * @throws SearchException + */ + List listPO(Map params) throws SearchException; + + /** + * 企业监控污染因子统计 + * + * @param params + * @return + * @throws SearchException + */ + Integer count(Map params) throws SearchException; + +} \ No newline at end of file diff --git a/src/main/java/com/cm/tenlion/pollutantdata/dao/poll/IPollDao.java b/src/main/java/com/cm/tenlion/pollutantdata/dao/poll/IPollDao.java index 41a1501..c06c49c 100644 --- a/src/main/java/com/cm/tenlion/pollutantdata/dao/poll/IPollDao.java +++ b/src/main/java/com/cm/tenlion/pollutantdata/dao/poll/IPollDao.java @@ -22,6 +22,15 @@ import java.util.Map; @Repository public interface IPollDao { + + /** + * 污染因子超标企业统计 + * @param params + * @return + */ + List> listExcessiveCompany(Map params); + + /** * 新增污染因子 * diff --git a/src/main/java/com/cm/tenlion/pollutantdata/pojo/bos/enterprisepoll/EnterprisePollBO.java b/src/main/java/com/cm/tenlion/pollutantdata/pojo/bos/enterprisepoll/EnterprisePollBO.java new file mode 100644 index 0000000..e8a2a28 --- /dev/null +++ b/src/main/java/com/cm/tenlion/pollutantdata/pojo/bos/enterprisepoll/EnterprisePollBO.java @@ -0,0 +1,96 @@ +package com.cm.tenlion.pollutantdata.pojo.bos.enterprisepoll; + +/** + * + * @ClassName: EnterprisePollBO + * @Description: 企业监控污染因子 + * @Author: CodeFactory + * @Date: 2021-08-06 14:19:31 + * @Version: 3.0 + **/ +public class EnterprisePollBO { + + private String enterprisePollId; + private String enterpriseId; + private String pollId; + private String enterprisePollBeyond; + private String gmtCreate; + private String creator; + private String gmtModified; + private String modifier; + private Integer isDelete; + + public String getEnterprisePollId() { + return enterprisePollId == null ? "" : enterprisePollId.trim(); + } + + public void setEnterprisePollId(String enterprisePollId) { + this.enterprisePollId = enterprisePollId; + } + + public String getEnterpriseId() { + return enterpriseId == null ? "" : enterpriseId.trim(); + } + + public void setEnterpriseId(String enterpriseId) { + this.enterpriseId = enterpriseId; + } + + public String getPollId() { + return pollId == null ? "" : pollId.trim(); + } + + public void setPollId(String pollId) { + this.pollId = pollId; + } + + public String getEnterprisePollBeyond() { + return enterprisePollBeyond == null ? "" : enterprisePollBeyond.trim(); + } + + public void setEnterprisePollBeyond(String enterprisePollBeyond) { + this.enterprisePollBeyond = enterprisePollBeyond; + } + + public String getGmtCreate() { + return gmtCreate == null ? "" : gmtCreate.trim(); + } + + public void setGmtCreate(String gmtCreate) { + this.gmtCreate = gmtCreate; + } + + public String getCreator() { + return creator == null ? "" : creator.trim(); + } + + public void setCreator(String creator) { + this.creator = creator; + } + + public String getGmtModified() { + return gmtModified == null ? "" : gmtModified.trim(); + } + + public void setGmtModified(String gmtModified) { + this.gmtModified = gmtModified; + } + + public String getModifier() { + return modifier == null ? "" : modifier.trim(); + } + + public void setModifier(String modifier) { + this.modifier = modifier; + } + + public Integer getIsDelete() { + return isDelete == null ? 0 : isDelete; + } + + public void setIsDelete(Integer isDelete) { + this.isDelete = isDelete; + } + + +} diff --git a/src/main/java/com/cm/tenlion/pollutantdata/pojo/dtos/enterprise/EnterpriseDTO.java b/src/main/java/com/cm/tenlion/pollutantdata/pojo/dtos/enterprise/EnterpriseDTO.java index 60ca83a..fb5f053 100644 --- a/src/main/java/com/cm/tenlion/pollutantdata/pojo/dtos/enterprise/EnterpriseDTO.java +++ b/src/main/java/com/cm/tenlion/pollutantdata/pojo/dtos/enterprise/EnterpriseDTO.java @@ -24,6 +24,8 @@ public class EnterpriseDTO { private String enterpriseLat; @ApiModelProperty(name = "gmtCreate", value = "添加时间") private String gmtCreate; + @ApiModelProperty(name = "enterprisePollCount", value = "监控污染因子个数") + private Integer enterprisePollCount; public String getEnterpriseId() { return enterpriseId == null ? "" : enterpriseId.trim(); @@ -65,5 +67,11 @@ public class EnterpriseDTO { this.gmtCreate = gmtCreate; } + public Integer getEnterprisePollCount() { + return enterprisePollCount; + } + public void setEnterprisePollCount(Integer enterprisePollCount) { + this.enterprisePollCount = enterprisePollCount; + } } diff --git a/src/main/java/com/cm/tenlion/pollutantdata/pojo/dtos/enterprisepoll/EnterprisePollDTO.java b/src/main/java/com/cm/tenlion/pollutantdata/pojo/dtos/enterprisepoll/EnterprisePollDTO.java new file mode 100644 index 0000000..8608f58 --- /dev/null +++ b/src/main/java/com/cm/tenlion/pollutantdata/pojo/dtos/enterprisepoll/EnterprisePollDTO.java @@ -0,0 +1,88 @@ +package com.cm.tenlion.pollutantdata.pojo.dtos.enterprisepoll; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; + +/** + * + * @ClassName: EnterprisePollDTO + * @Description: 企业监控污染因子 + * @Author: CodeFactory + * @Date: 2021-08-06 14:19:31 + * @Version: 3.0 + **/ +@ApiModel +public class EnterprisePollDTO { + + + @ApiModelProperty(name = "enterprisePollId", value = "主键") + private String enterprisePollId; + @ApiModelProperty(name = "enterpriseId", value = "企业ID") + private String enterpriseId; + @ApiModelProperty(name = "enterpriseName", value = "企业名称") + private String enterpriseName; + @ApiModelProperty(name = "pollId", value = "污染因子ID") + private String pollId; + @ApiModelProperty(name = "pollName", value = "污染因子名称") + private String pollName; + @ApiModelProperty(name = "enterprisePollBeyond", value = "报警值") + private Double enterprisePollBeyond; + @ApiModelProperty(name = "gmtCreate", value = "创建时间") + private String gmtCreate; + + public String getEnterprisePollId() { + return enterprisePollId; + } + + public void setEnterprisePollId(String enterprisePollId) { + this.enterprisePollId = enterprisePollId; + } + + public String getEnterpriseId() { + return enterpriseId == null ? "" : enterpriseId.trim(); + } + + public void setEnterpriseId(String enterpriseId) { + this.enterpriseId = enterpriseId; + } + + public String getPollId() { + return pollId == null ? "" : pollId.trim(); + } + + public void setPollId(String pollId) { + this.pollId = pollId; + } + + public Double getEnterprisePollBeyond() { + return enterprisePollBeyond; + } + + public void setEnterprisePollBeyond(Double enterprisePollBeyond) { + this.enterprisePollBeyond = enterprisePollBeyond; + } + + public String getGmtCreate() { + return gmtCreate == null ? "" : gmtCreate.trim(); + } + + public void setGmtCreate(String gmtCreate) { + this.gmtCreate = gmtCreate; + } + + + public String getEnterpriseName() { + return enterpriseName; + } + + public void setEnterpriseName(String enterpriseName) { + this.enterpriseName = enterpriseName; + } + + public String getPollName() { + return pollName; + } + + public void setPollName(String pollName) { + this.pollName = pollName; + } +} diff --git a/src/main/java/com/cm/tenlion/pollutantdata/pojo/pos/enterprisepoll/EnterprisePollPO.java b/src/main/java/com/cm/tenlion/pollutantdata/pojo/pos/enterprisepoll/EnterprisePollPO.java new file mode 100644 index 0000000..e950abf --- /dev/null +++ b/src/main/java/com/cm/tenlion/pollutantdata/pojo/pos/enterprisepoll/EnterprisePollPO.java @@ -0,0 +1,96 @@ +package com.cm.tenlion.pollutantdata.pojo.pos.enterprisepoll; + +/** + * + * @ClassName: EnterprisePollPO + * @Description: 企业监控污染因子 + * @Author: CodeFactory + * @Date: 2021-08-06 14:19:31 + * @Version: 3.0 + **/ +public class EnterprisePollPO { + + private String enterprisePollId; + private String enterpriseId; + private String pollId; + private String enterprisePollBeyond; + private String gmtCreate; + private String creator; + private String gmtModified; + private String modifier; + private Integer isDelete; + + public String getEnterprisePollId() { + return enterprisePollId == null ? "" : enterprisePollId.trim(); + } + + public void setEnterprisePollId(String enterprisePollId) { + this.enterprisePollId = enterprisePollId; + } + + public String getEnterpriseId() { + return enterpriseId == null ? "" : enterpriseId.trim(); + } + + public void setEnterpriseId(String enterpriseId) { + this.enterpriseId = enterpriseId; + } + + public String getPollId() { + return pollId == null ? "" : pollId.trim(); + } + + public void setPollId(String pollId) { + this.pollId = pollId; + } + + public String getEnterprisePollBeyond() { + return enterprisePollBeyond == null ? "" : enterprisePollBeyond.trim(); + } + + public void setEnterprisePollBeyond(String enterprisePollBeyond) { + this.enterprisePollBeyond = enterprisePollBeyond; + } + + public String getGmtCreate() { + return gmtCreate == null ? "" : gmtCreate.trim(); + } + + public void setGmtCreate(String gmtCreate) { + this.gmtCreate = gmtCreate; + } + + public String getCreator() { + return creator == null ? "" : creator.trim(); + } + + public void setCreator(String creator) { + this.creator = creator; + } + + public String getGmtModified() { + return gmtModified == null ? "" : gmtModified.trim(); + } + + public void setGmtModified(String gmtModified) { + this.gmtModified = gmtModified; + } + + public String getModifier() { + return modifier == null ? "" : modifier.trim(); + } + + public void setModifier(String modifier) { + this.modifier = modifier; + } + + public Integer getIsDelete() { + return isDelete == null ? 0 : isDelete; + } + + public void setIsDelete(Integer isDelete) { + this.isDelete = isDelete; + } + + +} diff --git a/src/main/java/com/cm/tenlion/pollutantdata/pojo/vos/enterprisepoll/EnterprisePollVO.java b/src/main/java/com/cm/tenlion/pollutantdata/pojo/vos/enterprisepoll/EnterprisePollVO.java new file mode 100644 index 0000000..e0af866 --- /dev/null +++ b/src/main/java/com/cm/tenlion/pollutantdata/pojo/vos/enterprisepoll/EnterprisePollVO.java @@ -0,0 +1,48 @@ +package com.cm.tenlion.pollutantdata.pojo.vos.enterprisepoll; + + +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; + +/** + * + * @ClassName: EnterprisePollVO + * @Description: 企业监控污染因子 + * @Author: CodeFactory + * @Date: 2021-08-06 14:19:31 + * @Version: 3.0 + **/ +@ApiModel +public class EnterprisePollVO { + + @ApiModelProperty(name = "enterpriseId", value = "企业ID") + private String enterpriseId; + @ApiModelProperty(name = "pollId", value = "污染因子ID") + private String pollId; + @ApiModelProperty(name = "enterprisePollBeyond", value = "报警值") + private Double enterprisePollBeyond; + + public String getEnterpriseId() { + return enterpriseId == null ? "" : enterpriseId.trim(); + } + + public void setEnterpriseId(String enterpriseId) { + this.enterpriseId = enterpriseId; + } + + public String getPollId() { + return pollId == null ? "" : pollId.trim(); + } + + public void setPollId(String pollId) { + this.pollId = pollId; + } + + public Double getEnterprisePollBeyond() { + return enterprisePollBeyond; + } + + public void setEnterprisePollBeyond(Double enterprisePollBeyond) { + this.enterprisePollBeyond = enterprisePollBeyond; + } +} diff --git a/src/main/java/com/cm/tenlion/pollutantdata/service/enterprisepoll/IEnterprisePollService.java b/src/main/java/com/cm/tenlion/pollutantdata/service/enterprisepoll/IEnterprisePollService.java new file mode 100644 index 0000000..fdf050a --- /dev/null +++ b/src/main/java/com/cm/tenlion/pollutantdata/service/enterprisepoll/IEnterprisePollService.java @@ -0,0 +1,189 @@ +package com.cm.tenlion.pollutantdata.service.enterprisepoll; + + +import com.cm.common.pojo.ListPage; +import com.cm.common.result.SuccessResultList; +import com.cm.tenlion.pollutantdata.pojo.dtos.enterprisepoll.EnterprisePollDTO; +import com.cm.tenlion.pollutantdata.pojo.vos.enterprisepoll.EnterprisePollVO; +import com.cm.tenlion.pollutantdata.pojo.bos.enterprisepoll.EnterprisePollBO; +import com.cm.tenlion.pollutantdata.pojo.pos.enterprisepoll.EnterprisePollPO; + +import java.util.List; +import java.util.Map; + +/** + * @ClassName: IEnterprisePollService + * @Description: 企业监控污染因子 + * @Author: CodeFactory + * @Date: 2021-08-06 14:19:31 + * @Version: 3.0 + **/ +public interface IEnterprisePollService { + + /** + * 新增企业监控污染因子 + * + * @param enterprisePollVO + * @return + */ + void save(EnterprisePollVO enterprisePollVO) throws Exception; + + /** + * 新增企业监控污染因子 + * + * @param token + * @param enterprisePollVO + * @return + */ + void save(String token, EnterprisePollVO enterprisePollVO) throws Exception; + + /** + * 新增企业监控污染因子 + * + * @param enterprisePollVO + * @return enterprisePollId + */ + String saveReturnId(EnterprisePollVO enterprisePollVO) throws Exception; + + /** + * 新增企业监控污染因子 + * + * @param token + * @param enterprisePollVO + * @return enterprisePollId + */ + String saveReturnId(String token, EnterprisePollVO enterprisePollVO) throws Exception; + + /** + * 删除企业监控污染因子 + * + * @param ids id列表 + * @return + */ + void remove(List ids); + + + /** + * 删除企业监控污染因子 + * + * @param token + * @param ids id列表 + * @return + */ + void remove(String token, List ids); + + /** + * 删除企业监控污染因子(物理删除) + * + * @param ids id列表 + */ + void delete(List ids); + + /** + * 修改企业监控污染因子 + * + * @param enterprisePollId + * @param enterprisePollVO + * @return + */ + void update(String enterprisePollId, EnterprisePollVO enterprisePollVO) throws Exception; + + /** + * 修改企业监控污染因子 + * + * @param token + * @param enterprisePollId + * @param enterprisePollVO + * @return + */ + void update(String token, String enterprisePollId, EnterprisePollVO enterprisePollVO) throws Exception; + + /** + * 企业监控污染因子详情 + * + * @param params 参数Map + * @return + */ + EnterprisePollDTO get(Map params) throws Exception; + + /** + * 企业监控污染因子详情 + * + * @param enterprisePollId + * @return + */ + EnterprisePollDTO get(String enterprisePollId); + + /** + * 企业监控污染因子详情 + * + * @param params 参数Map + * @return + */ + EnterprisePollBO getBO(Map params); + + /** + * 企业监控污染因子详情 + * + * @param enterprisePollId + * @return + */ + EnterprisePollBO getBO(String enterprisePollId); + + /** + * 企业监控污染因子详情 + * + * @param params 参数Map + * @return + */ + EnterprisePollPO getPO(Map params); + + /** + * 企业监控污染因子详情 + * + * @param enterprisePollId + * @return + */ + EnterprisePollPO getPO(String enterprisePollId); + + /** + * 企业监控污染因子列表 + * + * @param params + * @return + */ + List list(Map params); + + /** + * 企业监控污染因子列表 + * + * @param params + * @return + */ + List listBO(Map params); + + /** + * 企业监控污染因子列表 + * + * @param params + * @return + */ + List listPO(Map params); + + /** + * 企业监控污染因子分页列表 + * + * @param page + * @return + */ + SuccessResultList> listPage(ListPage page); + + /** + * 企业监控污染因子统计 + * + * @param params + * @return + */ + Integer count(Map params); + +} \ No newline at end of file diff --git a/src/main/java/com/cm/tenlion/pollutantdata/service/enterprisepoll/impl/EnterprisePollServiceImpl.java b/src/main/java/com/cm/tenlion/pollutantdata/service/enterprisepoll/impl/EnterprisePollServiceImpl.java new file mode 100644 index 0000000..4f1d75f --- /dev/null +++ b/src/main/java/com/cm/tenlion/pollutantdata/service/enterprisepoll/impl/EnterprisePollServiceImpl.java @@ -0,0 +1,182 @@ +package com.cm.tenlion.pollutantdata.service.enterprisepoll.impl; + + +import com.cm.common.base.AbstractService; +import com.cm.common.exception.SaveException; +import com.cm.common.pojo.ListPage; +import com.cm.common.result.SuccessResultList; +import com.cm.common.utils.HashMapUtil; +import com.cm.common.utils.UUIDUtil; +import com.cm.tenlion.pollutantdata.dao.enterprisepoll.IEnterprisePollDao; +import com.cm.tenlion.pollutantdata.pojo.dtos.enterprisepoll.EnterprisePollDTO; +import com.cm.tenlion.pollutantdata.pojo.vos.enterprisepoll.EnterprisePollVO; +import com.cm.tenlion.pollutantdata.pojo.bos.enterprisepoll.EnterprisePollBO; +import com.cm.tenlion.pollutantdata.pojo.pos.enterprisepoll.EnterprisePollPO; +import com.cm.tenlion.pollutantdata.service.enterprisepoll.IEnterprisePollService; +import com.github.pagehelper.PageHelper; +import com.github.pagehelper.PageInfo; +import org.apache.commons.lang3.StringUtils; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; + +import java.util.*; + +/** + * @ClassName: EnterprisePollServiceImpl + * @Description: 企业监控污染因子 + * @Author: CodeFactory + * @Date: 2021-08-06 14:19:31 + * @Version: 3.0 + **/ +@Service +public class EnterprisePollServiceImpl extends AbstractService implements IEnterprisePollService { + + @Autowired + private IEnterprisePollDao enterprisePollDao; + + @Override + public void save(EnterprisePollVO enterprisePollVO) throws Exception { + saveReturnId(enterprisePollVO); + } + + @Override + public void save(String token, EnterprisePollVO enterprisePollVO) throws Exception{ + saveReturnId(token, enterprisePollVO); + } + + @Override + public String saveReturnId(EnterprisePollVO enterprisePollVO) throws Exception{ + return saveReturnId(null, enterprisePollVO); + } + + @Override + public String saveReturnId(String token, EnterprisePollVO enterprisePollVO) throws Exception{ + Map countParams = new HashMap<>(); + countParams.put("pollId",enterprisePollVO.getPollId()); + countParams.put("enterpriseId",enterprisePollVO.getEnterpriseId()); + Integer count = this.count(countParams); + if(count > 0){ + throw new SaveException("请勿重复添加"); + } + + String enterprisePollId = UUIDUtil.getUUID(); + Map params = HashMapUtil.beanToMap(enterprisePollVO); + params.put("enterprisePollId", enterprisePollId); + if (StringUtils.isBlank(token)) { + setSaveInfo(params); + } else { + setSaveInfo(token, params); + } + enterprisePollDao.save(params); + return enterprisePollId; + } + + + + @Override + public void remove(List ids) { + remove(null, ids); + } + + @Override + public void remove(String token, List ids) { + Map params = getHashMap(2); + params.put("enterprisePollIds", ids); + if (StringUtils.isBlank(token)) { + setUpdateInfo(params); + } else { + setUpdateInfo(token, params); + } + enterprisePollDao.remove(params); + } + + @Override + public void delete(List ids) { + Map params = getHashMap(2); + params.put("enterprisePollIds", ids); + enterprisePollDao.delete(params); + } + + @Override + public void update(String enterprisePollId, EnterprisePollVO enterprisePollVO) throws Exception{ + update(null, enterprisePollId, enterprisePollVO); + } + + @Override + public void update(String token, String enterprisePollId, EnterprisePollVO enterprisePollVO)throws Exception { + Map params = HashMapUtil.beanToMap(enterprisePollVO); + params.put("enterprisePollId", enterprisePollId); + if (StringUtils.isBlank(token)) { + setUpdateInfo(params); + } else { + setUpdateInfo(token, params); + } + enterprisePollDao.update(params); + } + + @Override + public EnterprisePollDTO get(Map params) { + return enterprisePollDao.get(params); + } + + @Override + public EnterprisePollDTO get(String enterprisePollId) { + Map params = super.getHashMap(2); + params.put("enterprisePollId", enterprisePollId); + return get(params); + } + + @Override + public EnterprisePollBO getBO(Map params) { + return enterprisePollDao.getBO(params); + } + + @Override + public EnterprisePollBO getBO(String enterprisePollId) { + Map params = super.getHashMap(2); + params.put("enterprisePollId", enterprisePollId); + return getBO(params); + } + + @Override + public EnterprisePollPO getPO(Map params) { + return enterprisePollDao.getPO(params); + } + + @Override + public EnterprisePollPO getPO(String enterprisePollId) { + Map params = super.getHashMap(2); + params.put("enterprisePollId", enterprisePollId); + return getPO(params); + } + + @Override + public List list(Map params) { + return enterprisePollDao.list(params); + } + + @Override + public List listBO(Map params) { + return enterprisePollDao.listBO(params); + } + + @Override + public List listPO(Map params) { + return enterprisePollDao.listPO(params); + } + + @Override + public SuccessResultList> listPage(ListPage page) { + PageHelper.startPage(page.getPage(), page.getRows()); + List enterprisePollDTOs = list(page.getParams()); + PageInfo pageInfo = new PageInfo<>(enterprisePollDTOs); + return new SuccessResultList<>(enterprisePollDTOs, pageInfo.getPageNum(), pageInfo.getTotal()); + } + + @Override + public Integer count(Map params) { + Integer count = enterprisePollDao.count(params); + return count == null ? 0 : count; + } + +} \ No newline at end of file diff --git a/src/main/java/com/cm/tenlion/pollutantdata/service/poll/IPollService.java b/src/main/java/com/cm/tenlion/pollutantdata/service/poll/IPollService.java index e88b866..3ac725e 100644 --- a/src/main/java/com/cm/tenlion/pollutantdata/service/poll/IPollService.java +++ b/src/main/java/com/cm/tenlion/pollutantdata/service/poll/IPollService.java @@ -19,6 +19,13 @@ import java.util.Map; **/ public interface IPollService { + /** + * 污染因子超标企业 + * @param params + * @return + */ + List> listExcessiveCompany(Map params); + /** * 新增污染因子 * diff --git a/src/main/java/com/cm/tenlion/pollutantdata/service/poll/impl/PollServiceImpl.java b/src/main/java/com/cm/tenlion/pollutantdata/service/poll/impl/PollServiceImpl.java index a018100..cf1ca37 100644 --- a/src/main/java/com/cm/tenlion/pollutantdata/service/poll/impl/PollServiceImpl.java +++ b/src/main/java/com/cm/tenlion/pollutantdata/service/poll/impl/PollServiceImpl.java @@ -34,6 +34,15 @@ public class PollServiceImpl extends AbstractService implements IPollService { @Autowired private IPollDao pollDao; + public List> listExcessiveCompany(Map params){ + return pollDao.listExcessiveCompany(params); + } + + + + + + @Override public void save(PollVO pollVO) throws Exception { saveReturnId(pollVO); diff --git a/src/main/resources/application-test.yml b/src/main/resources/application-test.yml index 59631fb..b4a00f6 100644 --- a/src/main/resources/application-test.yml +++ b/src/main/resources/application-test.yml @@ -1,6 +1,6 @@ server: - port: 7004 - url: http://192.168.0.103:7004/pollutant + port: 8080 + url: http://192.168.0.120:8080/pollutant title: 污染物上报系统 servlet: context-path: /pollutant @@ -22,11 +22,11 @@ spring: max-request-size: 1GB datasource: druid: - url: jdbc:mysql://192.168.0.151:3306/db_pollutant_data?useUnicode=true&characterEncoding=utf8&characterSetResults=utf8&autoReconnect=true&failOverReadOnly=false&useSSL=false&serverTimezone=UTC + url: jdbc:mysql://localhost:3306/db_pollutant_data?useUnicode=true&characterEncoding=utf8&characterSetResults=utf8&autoReconnect=true&failOverReadOnly=false&useSSL=false&serverTimezone=UTC db-type: mysql driver-class-name: com.mysql.jdbc.Driver username: root - password: root + password: 123456 initial-size: 2 min-idle: 2 max-active: 10 @@ -60,8 +60,8 @@ security: oauth-server: http://192.168.0.152:7001/usercenter oauth-logout: ${security.oauth2.oauth-server}/logout?redirect_uri=${server.url} client: - client-id: 2a347bba1dc54def83a47493c7578ae2 - client-secret: TEdsOHlnTnc4T2JwTXM3alZldzRSM1ROKzhaQkZaQ24vSWJxREd0TWVLMG1ac2wwZTJHWk5NbXh3L3h3U2c4Rg== + client-id: 74e4b55ad48840f9b4de86ce5da58b53 + client-secret: VjlWbUFFbkJKMmZ3U29lekROb2x3M3Q1SmEzOGlwV3NzT3ZqSDByQVZoWW1ac2wwZTJHWk5NbXh3L3h3U2c4Rg== user-authorization-uri: ${security.oauth2.oauth-server}/oauth_client/authorize access-token-uri: ${security.oauth2.oauth-server}/oauth_client/token grant-type: authorization_code @@ -75,7 +75,7 @@ security: api-path: user-center: ${security.oauth2.oauth-server} - inspection: http://192.168.0.103:7006/inspection + inspection: http://124.67.110.246:8081/inspection system: # 预警通知上限 alarm-notice-limit: 5 @@ -95,7 +95,7 @@ logging: swagger: title: 接口文档 description: 隐患排查系统接口文档 - service-url: http://192.168.0.103:7004/pollutant + service-url: http://106.12.218.237:8001/pollutant version: 1.0 swagger-base-package: com.cm diff --git a/src/main/resources/mybatis/mapper/alarmlog/alarm-log-mapper.xml b/src/main/resources/mybatis/mapper/alarmlog/alarm-log-mapper.xml index 234e1dc..d81b140 100644 --- a/src/main/resources/mybatis/mapper/alarmlog/alarm-log-mapper.xml +++ b/src/main/resources/mybatis/mapper/alarmlog/alarm-log-mapper.xml @@ -125,6 +125,10 @@ AND enterprise_id = #{enterpriseId} + + AND + DATE_FORMAT( LEFT(gmt_create, 19), '%Y%m' ) = DATE_FORMAT( CURDATE( ) , '%Y%m' ) + diff --git a/src/main/resources/mybatis/mapper/enterprise/enterprise-mapper.xml b/src/main/resources/mybatis/mapper/enterprise/enterprise-mapper.xml index 9444069..2c503d9 100644 --- a/src/main/resources/mybatis/mapper/enterprise/enterprise-mapper.xml +++ b/src/main/resources/mybatis/mapper/enterprise/enterprise-mapper.xml @@ -8,6 +8,7 @@ + @@ -177,7 +178,15 @@ t1.enterprise_name, t1.enterprise_lng, t1.enterprise_lat, - LEFT(t1.gmt_create, 19) gmt_create + LEFT(t1.gmt_create, 19) gmt_create, + ( + SELECT + count(*) + FROM + pollute_enterprise_poll t2 + WHERE t2.is_delete = 0 + AND t1.enterprise_id = t2.enterprise_id + ) AS enterprise_poll_count FROM pollute_enterprise t1 WHERE diff --git a/src/main/resources/mybatis/mapper/enterprisepoll/enterprise-poll-mapper.xml b/src/main/resources/mybatis/mapper/enterprisepoll/enterprise-poll-mapper.xml new file mode 100644 index 0000000..7ea923f --- /dev/null +++ b/src/main/resources/mybatis/mapper/enterprisepoll/enterprise-poll-mapper.xml @@ -0,0 +1,312 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + INSERT INTO pollute_enterprise_poll( + enterprise_poll_id, + enterprise_id, + poll_id, + enterprise_poll_beyond, + gmt_create, + creator, + gmt_modified, + modifier, + is_delete + ) VALUES( + #{enterprisePollId}, + #{enterpriseId}, + #{pollId}, + #{enterprisePollBeyond}, + #{gmtCreate}, + #{creator}, + #{gmtModified}, + #{modifier}, + #{isDelete} + ) + + + + + UPDATE + pollute_enterprise_poll + SET + gmt_modified = #{gmtModified}, + modifier = #{modifier}, + is_delete = 1 + WHERE + enterprise_poll_id IN + + #{enterprisePollIds[${index}]} + + + + + + DELETE FROM + pollute_enterprise_poll + WHERE + enterprise_poll_id IN + + #{enterprisePollIds[${index}]} + + + + + + UPDATE + pollute_enterprise_poll + SET + + enterprise_id = #{enterpriseId}, + + + poll_id = #{pollId}, + + + enterprise_poll_beyond = #{enterprisePollBeyond}, + + gmt_modified = #{gmtModified}, + modifier = #{modifier}, + enterprise_poll_id = enterprise_poll_id + WHERE + enterprise_poll_id = #{enterprisePollId} + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/src/main/resources/mybatis/mapper/poll/poll-mapper.xml b/src/main/resources/mybatis/mapper/poll/poll-mapper.xml index 160aaa9..f59d0df 100644 --- a/src/main/resources/mybatis/mapper/poll/poll-mapper.xml +++ b/src/main/resources/mybatis/mapper/poll/poll-mapper.xml @@ -306,4 +306,26 @@ 1 = 1 + + + + \ No newline at end of file diff --git a/src/main/resources/templates/enterprise/list.html b/src/main/resources/templates/enterprise/list.html index a14c29e..4f6ceed 100644 --- a/src/main/resources/templates/enterprise/list.html +++ b/src/main/resources/templates/enterprise/list.html @@ -115,6 +115,12 @@ return rowData; } }, + {field: 'cz', width: 180, title: '操作', align:'center', + templet: function(row) { + var enterprisePollCount = row['enterprisePollCount']; + return ''; + } + }, ] ], page: true, @@ -271,6 +277,14 @@ height: '500px', onClose: function() {} }); + }else if(event === 'enterprisePollEvent'){ + top.dialog.open({ + url: top.restAjax.path('route/enterprisepoll/list?enterpriseId={enterpriseId}', [data.enterpriseId]), + title: '【'+ data.enterpriseName +'】的监控污染因子数据', + width: '80%', + height: '80%', + onClose: function() {} + }); } }); }); diff --git a/src/main/resources/templates/enterprisepoll/list.html b/src/main/resources/templates/enterprisepoll/list.html new file mode 100644 index 0000000..3e3a6d4 --- /dev/null +++ b/src/main/resources/templates/enterprisepoll/list.html @@ -0,0 +1,247 @@ + + + + + + + + + + + + + +
+
+
+
+
+
+
+ +
+ +
+
+ + +
+
+
+
+
+ + + + + \ No newline at end of file diff --git a/src/main/resources/templates/enterprisepoll/save.html b/src/main/resources/templates/enterprisepoll/save.html new file mode 100644 index 0000000..dfb4feb --- /dev/null +++ b/src/main/resources/templates/enterprisepoll/save.html @@ -0,0 +1,189 @@ + + + + + + + + + + + + + + +
+
+ +
+
+
+ +
+ +
+
+ +
+ +
+
+
+
+ +
+
+
+
+
+
+ + + + + + + \ No newline at end of file diff --git a/src/main/resources/templates/enterprisepoll/update.html b/src/main/resources/templates/enterprisepoll/update.html new file mode 100644 index 0000000..b568c52 --- /dev/null +++ b/src/main/resources/templates/enterprisepoll/update.html @@ -0,0 +1,212 @@ + + + + + + + + + + + + + + +
+
+ +
+
+
+ +
+ +
+
+
+ +
+ +
+
+ +
+ +
+
+
+
+ +
+
+
+
+
+
+ + + + + + + \ No newline at end of file