Merge remote-tracking branch 'origin/jtdev' into jtdev
86 files modified
49 files added
| | |
| | | <artifactId>skjcmanager-sm-api</artifactId> |
| | | <version>3.0.1.RELEASE</version> |
| | | </dependency> |
| | | <dependency> |
| | | <groupId>cn.gistack</groupId> |
| | | <artifactId>skjcmanager-pwd-api</artifactId> |
| | | <version>3.0.1.RELEASE</version> |
| | | </dependency> |
| | | <!--安全模块--> |
| | | <dependency> |
| | | <groupId>org.springframework.boot</groupId> |
| | |
| | | package cn.gistack.auth.service; |
| | | |
| | | import cn.gistack.auth.constant.AuthConstant; |
| | | import cn.gistack.common.utils.Base64Utils; |
| | | import cn.gistack.pwd.dto.CBCResultDTO; |
| | | import cn.gistack.pwd.dto.ResultDTO; |
| | | import cn.gistack.pwd.fegin.IPwdClient; |
| | | import cn.gistack.sm.collect.feign.ICollectClient; |
| | | import cn.gistack.sm.collect.feign.ICollectClientFallback; |
| | | import cn.gistack.sm.sjztmd.entity.AttResManagePerson; |
| | | import cn.gistack.sm.sjztmd.feign.IAttResManagePersonClient; |
| | | import cn.gistack.system.entity.Dept; |
| | | import cn.gistack.system.user.supo.UserSUPO; |
| | | import com.alibaba.fastjson.JSONObject; |
| | | import com.alibaba.nacos.common.utils.StringUtils; |
| | | import io.jsonwebtoken.Claims; |
| | | import lombok.AllArgsConstructor; |
| | |
| | | import org.springframework.stereotype.Service; |
| | | import javax.servlet.http.HttpServletRequest; |
| | | import java.time.Duration; |
| | | import java.util.Base64; |
| | | import java.util.List; |
| | | |
| | | /** |
| | |
| | | private final JwtProperties jwtProperties; |
| | | |
| | | private final ICollectClient collectClient; |
| | | |
| | | private final IPwdClient pwdClient; |
| | | |
| | | @Override |
| | | @SneakyThrows |
| | |
| | | String collectResIds = collectClient.getMyCollect(user.getId().toString()); |
| | | userInfo.getDetail().set("collect",collectResIds); |
| | | |
| | | User loginUserInfo = userInfo.getUser(); |
| | | |
| | | //获取解密后的Base64字符串 |
| | | R<ResultDTO> encryptRes = pwdClient.getDecrypt(loginUserInfo.getSm4iv(), loginUserInfo.getKeyindexs(),loginUserInfo.getEncdata()); |
| | | |
| | | if (encryptRes.getCode() != 200){ |
| | | throw new UserDeniedAuthorizationException("获取密钥失败"); |
| | | } |
| | | |
| | | //解码Base64 |
| | | String base64Decode = Base64Utils.getBase64Decode(encryptRes.getData().getData()); |
| | | |
| | | UserSUPO userSUPO = JSONObject.parseObject(base64Decode, UserSUPO.class); |
| | | |
| | | //若登录用户的电话、角色、部门与原加密数据不符,登录失败 |
| | | if (!(loginUserInfo.getPhone().equals(userSUPO.getPhone()) && loginUserInfo.getRoleId().equals(userSUPO.getRoleId()) && loginUserInfo.getDeptId().equals(userSUPO.getDeptId())) ){ |
| | | throw new UserDeniedAuthorizationException("用户信息异常,请联系管理员"); |
| | | } |
| | | |
| | | return new BladeUserDetails(user.getId(), |
| | | user.getTenantId(), StringPool.EMPTY, user.getName(), user.getRealName(), user.getDeptId(), user.getPostId(), user.getRoleId(), Func.join(userInfo.getRoles()), Func.toStr(user.getAvatar(), TokenUtil.DEFAULT_AVATAR), |
| | | username, AuthConstant.ENCRYPT + user.getPassword(), userInfo.getDetail(), true, true, true, true, |
| | |
| | | social: |
| | | enabled: true |
| | | domain: http://127.0.0.1:1888 |
| | | |
| | | #oauth2统一单点登录 |
| | | oauth: |
| | | config: |
| | | client-id: hbxskkey |
| | | client-secret: hbxsksecret |
| | | app-key: uaq775d4a7ufmefyf7sm16vs |
| | | app-secret: qjq1qizyo1baoyvzdlbu226hkhrs4vl2 |
| | | server-url-prefix: http://10.42.6.99:30000/api/IAM |
| | | token-url: ${oauth.config.server-url-prefix}/cas/oauth2.0/accessToken |
| | | profile-url: ${oauth.config.server-url-prefix}/api-auth/inspur/cas/oauth2.0/profile |
| | | redirect-uri: http://10.10.3.99:32182/api/blade-auth/oauth/tokenLoginUI |
| | | redirect-web-uri: http://10.10.3.99:32182/#/tokenlogin |
| | | redirect-exit-uri: http://10.10.3.99:32182/#/index |
| | |
| | | /** |
| | | * nacos prod 地址 |
| | | */ |
| | | String NACOS_PROD_ADDR = "127.0.0.1:8888"; |
| | | // String NACOS_PROD_ADDR = "nacos01.zhsk.svc.cluster.local:8848"; |
| | | String NACOS_PROD_ADDR = "nacos.zhsk:8848"; |
| | | |
| | | String NACOS_USERNAME = "nacos"; |
| | | |
| | |
| | | /** |
| | | * nacos test 地址 |
| | | */ |
| | | String NACOS_TEST_ADDR = "172.30.0.48:8848"; |
| | | String NACOS_TEST_ADDR = "127.0.0.1:8888"; |
| | | |
| | | /** |
| | | * sentinel dev 地址 |
| New file |
| | |
| | | package cn.gistack.common.utils; |
| | | |
| | | import java.io.UnsupportedEncodingException; |
| | | import java.nio.charset.StandardCharsets; |
| | | import java.util.Base64; |
| | | |
| | | public class Base64Utils { |
| | | |
| | | // 加密 |
| | | public static String getBase64Encode(String str) { |
| | | // String-->byte[] |
| | | byte [] data = str.getBytes(StandardCharsets.UTF_8); |
| | | // 编码(base64字符串) |
| | | String base64Str = Base64.getEncoder().encodeToString(data); |
| | | return base64Str; |
| | | } |
| | | |
| | | /** |
| | | * 对Base64字符串进行解码 |
| | | * @param base64Str |
| | | * @return |
| | | */ |
| | | public static String getBase64Decode(String base64Str) { |
| | | // 解码 |
| | | byte [] base64Data = Base64.getDecoder().decode(base64Str); |
| | | // byte[]-->String(解码后的字符串) |
| | | String str = new String(base64Data, StandardCharsets.UTF_8); |
| | | return str; |
| | | } |
| | | } |
| New file |
| | |
| | | package cn.gistack.resource.entity; |
| | | |
| | | 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 io.swagger.annotations.ApiModelProperty; |
| | | import lombok.Data; |
| | | import lombok.EqualsAndHashCode; |
| | | import lombok.experimental.Accessors; |
| | | import org.springframework.format.annotation.DateTimeFormat; |
| | | |
| | | import java.util.Date; |
| | | |
| | | /** |
| | | * 考证附件表 |
| | | * |
| | | * @author zhongrj |
| | | * @date 2023-09-13 |
| | | */ |
| | | @Data |
| | | @TableName(value = "sm_textual_research_attach") |
| | | @EqualsAndHashCode(callSuper = false) |
| | | @Accessors(chain = true) |
| | | public class TextualResearchAttach { |
| | | |
| | | /** |
| | | * id |
| | | */ |
| | | @ApiModelProperty(value = "id") |
| | | @TableId(value = "id",type = IdType.ASSIGN_ID) |
| | | private Long id; |
| | | |
| | | /** |
| | | * 名称 |
| | | */ |
| | | @ApiModelProperty(value = "名称") |
| | | private String name; |
| | | |
| | | /** |
| | | * 文件类型 |
| | | */ |
| | | @ApiModelProperty(value = "文件类型") |
| | | private Integer type; |
| | | |
| | | /** |
| | | * 路径 |
| | | */ |
| | | @ApiModelProperty(value = "路径") |
| | | private String path; |
| | | |
| | | /** |
| | | * 水库编号 |
| | | */ |
| | | @ApiModelProperty(value = "水库编号") |
| | | private String resGuid; |
| | | |
| | | /** |
| | | * 创建时间 |
| | | */ |
| | | @JsonFormat(timezone = "GMT+8", pattern = "yyyy-MM-dd HH:mm:ss") |
| | | @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss") |
| | | @ApiModelProperty(value = "创建时间") |
| | | private Date createTime; |
| | | } |
| New file |
| | |
| | | package cn.gistack.resource.vo; |
| | | |
| | | import cn.gistack.resource.entity.TextualResearchAttach; |
| | | import lombok.Data; |
| | | |
| | | @Data |
| | | public class TextualResearchAttachVO extends TextualResearchAttach { |
| | | |
| | | /** |
| | | * 是否分页 传值就不分页 |
| | | */ |
| | | private Integer isPage; |
| | | } |
| New file |
| | |
| | | package cn.gistack.resource.controller; |
| | | |
| | | |
| | | import cn.gistack.resource.entity.TextualResearchAttach; |
| | | import cn.gistack.resource.service.TextualResearchAttachService; |
| | | import cn.gistack.resource.vo.TextualResearchAttachVO; |
| | | import com.baomidou.mybatisplus.core.metadata.IPage; |
| | | import io.swagger.annotations.ApiOperation; |
| | | import lombok.AllArgsConstructor; |
| | | import org.springblade.core.mp.support.Condition; |
| | | import org.springblade.core.mp.support.Query; |
| | | import org.springblade.core.tool.api.R; |
| | | import org.springframework.web.bind.annotation.*; |
| | | |
| | | import java.util.Arrays; |
| | | |
| | | /** |
| | | * 考证附件控制层 |
| | | * @author zhongrj |
| | | * @date 2023-05-29 |
| | | */ |
| | | @RestController |
| | | @AllArgsConstructor |
| | | @RequestMapping("/textualResearchAttach/textualResearchAttach") |
| | | public class TextualResearchAttachController { |
| | | |
| | | private final TextualResearchAttachService textualResearchAttachService; |
| | | |
| | | /** |
| | | * 分页列表查询 |
| | | * |
| | | * @param textualResearchAttach |
| | | * @return |
| | | */ |
| | | @ApiOperation(value="考证附件-分页列表查询", notes="考证附件-分页列表查询") |
| | | @GetMapping(value = "/list") |
| | | public R queryPageList(TextualResearchAttach textualResearchAttach, Query query) { |
| | | IPage<TextualResearchAttach> pageList = textualResearchAttachService.page(Condition.getPage(query), Condition.getQueryWrapper(textualResearchAttach)); |
| | | return R.data(pageList); |
| | | } |
| | | |
| | | /** |
| | | * 自定义分页列表查询 |
| | | * @param query |
| | | * @param textualResearchAttach |
| | | * @return |
| | | */ |
| | | @ApiOperation(value="考证附件-自定义分页列表查询", notes="考证附件-自定义分页列表查询") |
| | | @GetMapping(value = "/page") |
| | | public R page(TextualResearchAttachVO textualResearchAttach, Query query) { |
| | | return R.data( textualResearchAttachService.selectTextualResearchAttachPage(Condition.getPage(query),textualResearchAttach)); |
| | | } |
| | | |
| | | /** |
| | | * 添加 |
| | | * |
| | | * @param textualResearchAttach |
| | | * @return |
| | | */ |
| | | @ApiOperation(value="考证附件-添加", notes="考证附件-添加") |
| | | @PostMapping(value = "/add") |
| | | public R add(@RequestBody TextualResearchAttach textualResearchAttach) { |
| | | return R.data(textualResearchAttachService.save(textualResearchAttach)); |
| | | } |
| | | |
| | | /** |
| | | * 编辑 |
| | | * |
| | | * @param textualResearchAttach |
| | | * @return |
| | | */ |
| | | @ApiOperation(value="考证附件-编辑", notes="考证附件-编辑") |
| | | @RequestMapping(value = "/edit", method = {RequestMethod.PUT,RequestMethod.POST}) |
| | | public R edit(@RequestBody TextualResearchAttach textualResearchAttach) { |
| | | return R.data(textualResearchAttachService.updateById(textualResearchAttach)); |
| | | } |
| | | |
| | | /** |
| | | * 通过id删除 |
| | | * |
| | | * @param id |
| | | * @return |
| | | */ |
| | | @ApiOperation(value="考证附件-通过id删除", notes="考证附件-通过id删除") |
| | | @PostMapping(value = "/delete") |
| | | public R delete(@RequestParam(name="id",required=true) String id) { |
| | | return R.data(textualResearchAttachService.removeById(id)); |
| | | } |
| | | |
| | | /** |
| | | * 批量删除 |
| | | * |
| | | * @param ids |
| | | * @return |
| | | */ |
| | | @ApiOperation(value="考证附件-批量删除", notes="考证附件-批量删除") |
| | | @PostMapping(value = "/deleteBatch") |
| | | public R deleteBatch(@RequestParam(name="ids",required=true) String ids) { |
| | | return R.data(this.textualResearchAttachService.removeByIds(Arrays.asList(ids.split(",")))); |
| | | } |
| | | |
| | | /** |
| | | * 通过id查询 |
| | | * |
| | | * @param id |
| | | * @return |
| | | */ |
| | | @ApiOperation(value="考证附件-通过id查询", notes="考证附件-通过id查询") |
| | | @GetMapping(value = "/queryById") |
| | | public R queryById(@RequestParam(name="id",required=true) String id) { |
| | | TextualResearchAttach textualResearchAttach = textualResearchAttachService.getById(id); |
| | | return R.data(textualResearchAttach); |
| | | } |
| | | |
| | | } |
| | |
| | | package cn.gistack.resource.endpoint; |
| | | |
| | | import cn.gistack.resource.builder.oss.OssBuilder; |
| | | import cn.gistack.resource.entity.TextualResearchAttach; |
| | | import cn.gistack.resource.service.IAttachService; |
| | | import cn.gistack.resource.service.TextualResearchAttachService; |
| | | import io.swagger.annotations.Api; |
| | | import lombok.AllArgsConstructor; |
| | | import lombok.SneakyThrows; |
| | |
| | | import org.springframework.web.bind.annotation.*; |
| | | import org.springframework.web.multipart.MultipartFile; |
| | | |
| | | import java.util.ArrayList; |
| | | import java.util.HashMap; |
| | | import java.util.List; |
| | | import java.util.Map; |
| | | import java.util.*; |
| | | |
| | | /** |
| | | * 对象存储端点 |
| | |
| | | * 附件表服务 |
| | | */ |
| | | private final IAttachService attachService; |
| | | |
| | | /** |
| | | * 附件表服务 |
| | | */ |
| | | private final TextualResearchAttachService textualResearchAttachService; |
| | | |
| | | /** |
| | | * 创建存储桶 |
| | |
| | | } |
| | | |
| | | /** |
| | | * 考证附件上传并保存 |
| | | * @param file 文件 |
| | | * @param resGuid 水库编号 |
| | | * @return |
| | | */ |
| | | @SneakyThrows |
| | | @PostMapping("/put-file-by-textualResearchAttach") |
| | | public R putFileByPrefixTextualResearchAttach(@RequestParam MultipartFile file,String resGuid,Integer type) { |
| | | BladeFile bladeFile = ossBuilder.templateByPrefixPath("textualResearchAttach").putFile(file.getOriginalFilename(), file.getInputStream()); |
| | | buildTextualResearchAttach(resGuid,bladeFile,type); |
| | | return R.data(bladeFile); |
| | | } |
| | | |
| | | /** |
| | | * 保存考证附件上传数据 |
| | | * @param bladeFile |
| | | */ |
| | | private void buildTextualResearchAttach(String resGuid,BladeFile bladeFile,Integer type) { |
| | | TextualResearchAttach attach = new TextualResearchAttach(); |
| | | attach.setResGuid(resGuid); |
| | | attach.setType(type); |
| | | attach.setPath(bladeFile.getName()); |
| | | attach.setName(bladeFile.getOriginalName()); |
| | | attach.setCreateTime(new Date()); |
| | | // 保存 |
| | | textualResearchAttachService.save(attach); |
| | | } |
| | | |
| | | /** |
| | | * 上传文件 |
| | | * |
| | | * @param fileName 存储桶对象名称 |
| New file |
| | |
| | | package cn.gistack.resource.mapper; |
| | | |
| | | |
| | | import cn.gistack.resource.entity.TextualResearchAttach; |
| | | import cn.gistack.resource.vo.TextualResearchAttachVO; |
| | | import com.baomidou.mybatisplus.core.mapper.BaseMapper; |
| | | import com.baomidou.mybatisplus.core.metadata.IPage; |
| | | import org.apache.ibatis.annotations.Param; |
| | | |
| | | import java.util.List; |
| | | |
| | | /** |
| | | * 考证附件详情mapper映射层 |
| | | * @author zhongrj |
| | | * @date 2023-09-13 |
| | | */ |
| | | public interface TextualResearchAttachMapper extends BaseMapper<TextualResearchAttach> { |
| | | |
| | | /** |
| | | * 自定义分页列表查询 |
| | | * @param page |
| | | * @param textualResearchAttach |
| | | * @return |
| | | */ |
| | | List<TextualResearchAttachVO> selectTextualResearchAttachPage(IPage<TextualResearchAttachVO> page, |
| | | @Param("textualResearchAttach") TextualResearchAttachVO textualResearchAttach); |
| | | } |
| New file |
| | |
| | | <?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="cn.gistack.resource.mapper.TextualResearchAttachMapper"> |
| | | |
| | | <!--自定义分页列表查询--> |
| | | <select id="selectTextualResearchAttachPage" resultType="cn.gistack.resource.vo.TextualResearchAttachVO"> |
| | | select * from sm_textual_research_attach |
| | | where 1=1 |
| | | <if test="textualResearchAttach.resGuid!=null and textualResearchAttach.resGuid!=''"> |
| | | and res_guid = #{textualResearchAttach.resGuid} |
| | | </if> |
| | | <if test="textualResearchAttach.type!=null"> |
| | | and type = #{textualResearchAttach.type} |
| | | </if> |
| | | </select> |
| | | |
| | | </mapper> |
| New file |
| | |
| | | package cn.gistack.resource.service; |
| | | |
| | | |
| | | import cn.gistack.resource.entity.TextualResearchAttach; |
| | | import cn.gistack.resource.vo.TextualResearchAttachVO; |
| | | import com.baomidou.mybatisplus.core.metadata.IPage; |
| | | import com.baomidou.mybatisplus.extension.service.IService; |
| | | |
| | | /** |
| | | * 考证附件服务层 |
| | | * @author zhongrj |
| | | * @date 2023-09-12 |
| | | */ |
| | | public interface TextualResearchAttachService extends IService<TextualResearchAttach> { |
| | | |
| | | /** |
| | | * 自定义分页列表查询 |
| | | * @param page |
| | | * @param textualResearchAttach |
| | | * @return |
| | | */ |
| | | Object selectTextualResearchAttachPage(IPage<TextualResearchAttachVO> page, TextualResearchAttachVO textualResearchAttach); |
| | | } |
| New file |
| | |
| | | package cn.gistack.resource.service.impl; |
| | | |
| | | |
| | | |
| | | import cn.gistack.resource.entity.TextualResearchAttach; |
| | | import cn.gistack.resource.mapper.TextualResearchAttachMapper; |
| | | import cn.gistack.resource.service.TextualResearchAttachService; |
| | | import cn.gistack.resource.vo.TextualResearchAttachVO; |
| | | import com.baomidou.mybatisplus.core.metadata.IPage; |
| | | import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; |
| | | import org.springframework.stereotype.Service; |
| | | |
| | | /** |
| | | * 考证附件服务实现层 |
| | | * @author zhongrj |
| | | * @date 2023-09-13 |
| | | */ |
| | | @Service |
| | | public class TextualResearchAttachServiceImpl extends ServiceImpl<TextualResearchAttachMapper, TextualResearchAttach> implements TextualResearchAttachService { |
| | | |
| | | /** |
| | | * 自定义分页列表查询 |
| | | * @param page |
| | | * @param textualResearchAttach |
| | | * @return |
| | | */ |
| | | @Override |
| | | public Object selectTextualResearchAttachPage(IPage<TextualResearchAttachVO> page, TextualResearchAttachVO textualResearchAttach) { |
| | | if (null!=textualResearchAttach.getIsPage()){ |
| | | // 不分页 |
| | | return baseMapper.selectTextualResearchAttachPage(null,textualResearchAttach); |
| | | } |
| | | return page.setRecords(baseMapper.selectTextualResearchAttachPage(page,textualResearchAttach)); |
| | | } |
| | | } |
| | |
| | | private String createAlarmType; |
| | | |
| | | /** |
| | | * 校验规则名称 |
| | | */ |
| | | private String ruleName; |
| | | |
| | | /** |
| | | * 是否导出 |
| | | */ |
| | | private Integer isExport; |
| | | |
| | | /** |
| | | * 开始时间 |
| | | */ |
| | | private String startTime; |
| | | |
| | | /** |
| | | * 结束时间 |
| | | */ |
| | | private String endTime; |
| | | |
| | | /** |
| | | * 水库规模 |
| | | */ |
| | | private String engScal; |
| | | |
| | | /** |
| | | * 水库注册码 |
| | | */ |
| | | private String resRegCode; |
| | | |
| | | /** |
| | | * 市州名称 |
| | | */ |
| | | private String cityName; |
| | | |
| | | /** |
| | | * 区县 |
| | | */ |
| | | private String countyName; |
| | | |
| | | /** |
| | | * 乡镇 |
| | | */ |
| | | private String townName; |
| | | } |
| New file |
| | |
| | | package cn.gistack.alerts.alarmRule.vo; |
| | | |
| | | import lombok.Data; |
| | | |
| | | import java.io.Serializable; |
| | | |
| | | @Data |
| | | public class StatisticAlarmRecord implements Serializable { |
| | | |
| | | /** |
| | | * 区域名称 |
| | | */ |
| | | private String adName; |
| | | |
| | | /** |
| | | * 规则名称 |
| | | */ |
| | | private String ruleName; |
| | | |
| | | /** |
| | | * 数量 |
| | | */ |
| | | private Integer num; |
| | | } |
| | |
| | | private String remark; |
| | | |
| | | /** |
| | | * 短信类型 |
| | | * 短信类型(登录,告警,,,) |
| | | */ |
| | | @ApiModelProperty(value = "短信类型") |
| | | private Integer smsType; |
| | |
| | | */ |
| | | private String smsType; |
| | | |
| | | /** |
| | | * 告警规则名称 |
| | | */ |
| | | private String ruleName; |
| | | |
| | | } |
| | |
| | | private String startTime; |
| | | private String endTime; |
| | | |
| | | private String typeName; |
| | | |
| | | } |
| | |
| | | <groupId>org.springblade</groupId> |
| | | <artifactId>blade-starter-cache</artifactId> |
| | | </dependency> |
| | | <!--excel--> |
| | | <dependency> |
| | | <groupId>org.springblade</groupId> |
| | | <artifactId>blade-starter-excel</artifactId> |
| | | </dependency> |
| | | </dependencies> |
| | | |
| | | </project> |
| New file |
| | |
| | | package cn.gistack.sm.intelligentCall.excel; |
| | | |
| | | import com.alibaba.excel.annotation.ExcelProperty; |
| | | import com.alibaba.excel.annotation.write.style.ColumnWidth; |
| | | import com.alibaba.excel.annotation.write.style.ContentRowHeight; |
| | | import com.alibaba.excel.annotation.write.style.HeadRowHeight; |
| | | import lombok.Data; |
| | | |
| | | import java.io.Serializable; |
| | | @Data |
| | | @ColumnWidth(25) |
| | | @HeadRowHeight(20) |
| | | @ContentRowHeight(18) |
| | | public class CallExcel implements Serializable { |
| | | |
| | | private static final long serialVersionUID = 1L; |
| | | |
| | | @ColumnWidth(15) |
| | | @ExcelProperty("水库代码") |
| | | private String waterCode; |
| | | } |
| New file |
| | |
| | | package cn.gistack.sm.intelligentCall.listener; |
| | | |
| | | import com.alibaba.excel.context.AnalysisContext; |
| | | import com.alibaba.excel.event.AnalysisEventListener; |
| | | |
| | | import java.util.ArrayList; |
| | | import java.util.List; |
| | | |
| | | /** |
| | | * 自定义excel 解析监听器 |
| | | * @param <T> |
| | | */ |
| | | public final class ExcelListener<T> extends AnalysisEventListener<T> { |
| | | |
| | | /** |
| | | * 自定义用于暂时存储data |
| | | * 可以通过实例获取该值 |
| | | */ |
| | | private List<T> datas = new ArrayList<>(); |
| | | |
| | | /** |
| | | * 每解析一行都会回调invoke()方法 |
| | | * @param object 读取后的数据对象 |
| | | * @param context 内容 |
| | | */ |
| | | @Override |
| | | @SuppressWarnings("unchecked") |
| | | public void invoke(Object object, AnalysisContext context) { |
| | | T map = (T) object; |
| | | //数据存储到list,供批量处理,或后续自己业务逻辑处理。 |
| | | datas.add(map); |
| | | } |
| | | |
| | | @Override |
| | | public void doAfterAllAnalysed(AnalysisContext context) { |
| | | //解析结束销毁不用的资源 |
| | | //注意不要调用datas.clear(),否则getDatas为null |
| | | } |
| | | |
| | | /** |
| | | * 返回数据 |
| | | * @return 返回读取的数据集合 |
| | | **/ |
| | | public List<T> getDatas() { |
| | | return datas; |
| | | } |
| | | |
| | | /** |
| | | * 设置读取的数据集合 |
| | | * @param datas 设置读取的数据集合 |
| | | **/ |
| | | public void setDatas(List<T> datas) { |
| | | this.datas = datas; |
| | | } |
| | | } |
| | |
| | | * 所在区县 |
| | | */ |
| | | private String countyName; |
| | | |
| | | /** |
| | | * 所在乡镇 |
| | | */ |
| | | private String townName; |
| | | /** |
| | | * 是否巡查责任人 0:未知或空 1:不是巡查责任人 2:是巡查责任人 |
| | | */ |
| | |
| | | private String countyName; |
| | | |
| | | /** |
| | | * 乡镇名称 |
| | | */ |
| | | private String townName; |
| | | |
| | | /** |
| | | * 水库规模 |
| | | */ |
| | | private String engScal; |
| | | |
| | | /** |
| | | * 水库注册码 |
| | | */ |
| | | private String resRegCode; |
| | | |
| | | /** |
| | | * 是否短信反馈 |
| | | */ |
| | | private String isSmsFill; |
| | |
| | | String API_PREFIX = "/client"; |
| | | String CREATE_TASK_JOB_HANDLER = API_PREFIX + "/createTaskJobHandler"; |
| | | |
| | | String CREATE_TASK_JOB_BY_CONDITION_HANDLER = API_PREFIX+"/createTaskJobByConditionHandler"; |
| | | |
| | | /** |
| | | * 给巡查责任人定时创建任务执行器 |
| | | * @param processDefinitionId |
| | |
| | | @RequestParam("taskType") String taskType, |
| | | @RequestParam("title") String title, |
| | | @RequestParam("content") String content); |
| | | |
| | | /** |
| | | * 给巡查责任人定时创建任务执行器 |
| | | * @param processDefinitionId |
| | | * @param taskType |
| | | * @param title |
| | | * @param content |
| | | * @return |
| | | */ |
| | | @GetMapping(CREATE_TASK_JOB_BY_CONDITION_HANDLER) |
| | | List<Integer> createTaskJobByConditionHandler(@RequestParam("processDefinitionId") String processDefinitionId, |
| | | @RequestParam("taskType") String taskType, |
| | | @RequestParam("title") String title, |
| | | @RequestParam("content") String content); |
| | | } |
| | |
| | | public List<Integer> createTaskJobHandler(String processDefinitionId, String taskType, String title, String content) { |
| | | return null; |
| | | } |
| | | |
| | | @Override |
| | | public List<Integer> createTaskJobByConditionHandler(String processDefinitionId, String taskType, String title, String content) { |
| | | return null; |
| | | } |
| | | } |
| | |
| | | */ |
| | | private String postId; |
| | | |
| | | /**以下4个为加密字段**/ |
| | | private String sm4iv; |
| | | private String keyindexs; |
| | | private String maced; |
| | | private String encdata; |
| | | |
| | | } |
| | |
| | | String UPDATE_USER = API_PREFIX + "/upate-user"; |
| | | String REMOVE_USER = API_PREFIX + "/remove-user"; |
| | | String GET_ALL_USER_LIST = API_PREFIX+ "/get-all-user-list"; |
| | | |
| | | String ENCRYPT_USER = API_PREFIX + "/encrypt-user"; |
| | | /** |
| | | * 获取用户信息 |
| | | * |
| | |
| | | @GetMapping(GET_ALL_USER_LIST) |
| | | R<List<User>> getAllUserList(); |
| | | |
| | | /** |
| | | * 更新用户信息并加密 |
| | | * @return |
| | | */ |
| | | @GetMapping(ENCRYPT_USER) |
| | | String encryptUser(); |
| | | } |
| New file |
| | |
| | | package cn.gistack.system.user.supo; |
| | | |
| | | import lombok.Data; |
| | | |
| | | /** |
| | | * 用户加密类 |
| | | */ |
| | | @Data |
| | | public class UserSUPO { |
| | | /** |
| | | * 手机号 |
| | | */ |
| | | private String phone; |
| | | /** |
| | | * 角色id |
| | | */ |
| | | private String roleId; |
| | | /** |
| | | * 部门id |
| | | */ |
| | | private String deptId; |
| | | } |
| | |
| | | */ |
| | | @ApiOperation(value="告警记录-自定义分页列表查询", notes="告警记录-自定义分页列表查询") |
| | | @GetMapping(value = "/page") |
| | | public R page(AlarmRecordVO alarmRecord, Query query) { |
| | | public R selectAlarmPage(AlarmRecordVO alarmRecord, Query query) { |
| | | return R.data( alarmRecordService.selectAlarmRecordPage(Condition.getPage(query),alarmRecord)); |
| | | } |
| | | |
| | |
| | | return R.data(alarmRecord); |
| | | } |
| | | |
| | | /** |
| | | * 按行政区统计告警-按三大类 |
| | | * @param alarmRecord |
| | | * @return |
| | | */ |
| | | @ApiOperation(value="告警记录-告警统计-按三大类", notes="告警记录-告警统计-按三大类") |
| | | @GetMapping(value = "/statisticAlarmRecordByType") |
| | | public R statisticAlarmRecordByType(AlarmRecordVO alarmRecord) { |
| | | return R.data(alarmRecordService.statisticAlarmRecordByType(alarmRecord)); |
| | | } |
| | | |
| | | /** |
| | | * 按行政区统计告警 |
| | | * @param alarmRecord |
| | | * @return |
| | | */ |
| | | @ApiOperation(value="告警记录-告警统计", notes="告警记录-告警统计") |
| | | @GetMapping(value = "/statisticAlarmRecord") |
| | | public R statisticAlarmRecord(AlarmRecordVO alarmRecord) { |
| | | return R.data(alarmRecordService.statisticAlarmRecord(alarmRecord)); |
| | | } |
| | | |
| | | } |
| | |
| | | return R.data(alarmRuleService.getDetail(id)); |
| | | } |
| | | |
| | | /** |
| | | * 通过告警规则类型查询生成告警规则类型 |
| | | * @param alarmRuleType |
| | | * @return |
| | | */ |
| | | @ApiOperation(value="通过告警规则类型查询生成告警规则类型", notes="通过告警规则类型查询生成告警规则类型") |
| | | @GetMapping(value = "/getCreateRuleType") |
| | | public R getCreateRuleType(String alarmRuleType) { |
| | | return R.data(alarmRuleService.getCreateRuleType(alarmRuleType)); |
| | | } |
| | | |
| | | /** |
| | | * 通过成告警规则类型查询告警规则名称 |
| | | * @param createAlarmType |
| | | * @return |
| | | */ |
| | | @ApiOperation(value="通过成告警规则类型查询告警规则名称", notes="通过成告警规则类型查询告警规则名称") |
| | | @GetMapping(value = "/getAlarmRuleName") |
| | | public R getAlarmRuleName(String createAlarmType) { |
| | | return R.data(alarmRuleService.getAlarmRuleName(createAlarmType)); |
| | | } |
| | | |
| | | } |
| | |
| | | package cn.gistack.alerts.alarmRule.mapper; |
| | | |
| | | import cn.gistack.alerts.alarmRule.entity.AlarmRecord; |
| | | import cn.gistack.alerts.alarmRule.entity.AlarmRule; |
| | | import cn.gistack.alerts.alarmRule.vo.AlarmRecordVO; |
| | | import cn.gistack.alerts.alarmRule.vo.StatisticAlarmRecord; |
| | | import com.baomidou.mybatisplus.annotation.InterceptorIgnore; |
| | | import com.baomidou.mybatisplus.core.mapper.BaseMapper; |
| | | import com.baomidou.mybatisplus.core.metadata.IPage; |
| | | import org.apache.ibatis.annotations.Param; |
| | |
| | | * @return |
| | | */ |
| | | List<AlarmRecordVO> selectAlarmRecordPage(IPage<AlarmRecordVO> page,@Param("alarmRecord") AlarmRecordVO alarmRecord); |
| | | |
| | | /** |
| | | * 查询告警统计数据-按三大类 |
| | | * @param alarmRecord |
| | | * @return |
| | | */ |
| | | @InterceptorIgnore(tenantLine = "true") |
| | | List<StatisticAlarmRecord> statisticAlarmRecordByType(@Param("alarmRecord") AlarmRecordVO alarmRecord); |
| | | |
| | | /** |
| | | * 查询告警统计数据 |
| | | * @param alarmRecord |
| | | * @return |
| | | */ |
| | | List<StatisticAlarmRecord> statisticAlarmRecord(@Param("alarmRecord") AlarmRecordVO alarmRecord); |
| | | |
| | | /** |
| | | * 按行政区code 查询下级行政区 |
| | | * @param adCode |
| | | * @return |
| | | */ |
| | | List<String> getAdNameList(@Param("adCode") String adCode); |
| | | |
| | | /** |
| | | * 查询符合条件的告警类型 |
| | | * @param alarmRecord |
| | | * @return |
| | | */ |
| | | List<AlarmRule> listAlarmRule(@Param("alarmRecord") AlarmRecordVO alarmRecord); |
| | | } |
| | |
| | | <select id="selectAlarmRecordPage" resultType="cn.gistack.alerts.alarmRule.vo.AlarmRecordVO"> |
| | | select |
| | | sar.*, |
| | | sar1.type,sar1.alarm_rule_type as alarmRuleType,sar1.create_alarm_type as createAlarmType, |
| | | arb."name" as reservoirName,aab."ad_name" as areaName |
| | | sar1.type,sar1.alarm_rule_type as alarmRuleType,sar1.create_alarm_type as createAlarmType,sar1.rule_name as ruleName, |
| | | a."name" as reservoirName,a."res_reg_code" as resRegCode,a."eng_scal" as engScal, |
| | | case when b."ad_grad" = 4 THEN b."ad_name" |
| | | ELSE NULL END AS townName, |
| | | case when b."ad_grad" = 3 THEN b."ad_name" |
| | | when c."ad_grad" = 3 THEN C."ad_name" |
| | | END AS countyName, |
| | | case when b."ad_grad" = 2 THEN b."ad_name" |
| | | when c."ad_grad" = 2 THEN c."ad_name" |
| | | ELSE d."ad_name" END AS cityName |
| | | from YWXT.sm_alarm_record sar |
| | | left join YWXT.sm_alarm_rule sar1 on sar.alarm_rule_id = sar1.id and sar1.is_deleted = 0 |
| | | left join SJZT_MD."att_res_base" arb on arb."guid" = sar.reservoir_number |
| | | left join SJZT_MD."att_ad_base" aab on aab."guid" = arb."interior_ad_guid" |
| | | left join SJZT_MD."att_res_base" a on a."guid" = sar.reservoir_number |
| | | left join SJZT_MD."att_ad_base" b on b."guid" = a."interior_ad_guid" |
| | | LEFT JOIN SJZT_MD."att_ad_base" c ON b."p_ad_code" = c."guid" |
| | | LEFT JOIN SJZT_MD."att_ad_base" d ON c."p_ad_code" = d."guid" |
| | | where sar.is_deleted = 0 |
| | | <if test="alarmRecord.reservoirName!=null and alarmRecord.reservoirName!=''"> |
| | | and arb."name" like concat('%',#{alarmRecord.reservoirName},'%') |
| | | and a."name" like concat('%',#{alarmRecord.reservoirName},'%') |
| | | </if> |
| | | <if test="alarmRecord.type!=null and alarmRecord.type!=''"> |
| | | and sar1.type = #{alarmRecord.type} |
| | |
| | | <if test="alarmRecord.createAlarmType!=null and alarmRecord.createAlarmType!=''"> |
| | | and sar1.create_alarm_type = #{alarmRecord.createAlarmType} |
| | | </if> |
| | | <if test="alarmRecord.ruleName!=null and alarmRecord.ruleName!=''"> |
| | | and sar1.rule_name = #{alarmRecord.ruleName} |
| | | </if> |
| | | <if test="alarmRecord.startTime!=null and alarmRecord.startTime!=''"> |
| | | and date_format(sar.create_time,'%Y-%m-%d') >= #{alarmRecord.startTime} |
| | | </if> |
| | | <if test="alarmRecord.endTime!=null and alarmRecord.endTime!=''"> |
| | | and date_format(sar.create_time,'%Y-%m-%d') <= #{alarmRecord.endTime} |
| | | </if> |
| | | order by sar.id desc |
| | | </select> |
| | | |
| | | <!--按行政区code 查询下级行政区--> |
| | | <select id="getAdNameList" resultType="java.lang.String"> |
| | | select "ad_name" from SJZT_MD."att_ad_base" where "p_ad_code" = #{adCode} order by "guid" |
| | | </select> |
| | | |
| | | <!--查询告警统计数据--> |
| | | <select id="statisticAlarmRecord" resultType="cn.gistack.alerts.alarmRule.vo.StatisticAlarmRecord"> |
| | | select cityName as adName,rule_name as ruleName,count(*) num from ( |
| | | select |
| | | sar.id,sar.alarm_rule_id,sar.create_time,sar.reservoir_number, |
| | | arb."name", |
| | | e.rule_name, |
| | | case when b."ad_grad" = 4 THEN b."ad_name" ELSE NULL END AS townName, |
| | | case when b."ad_grad" = 3 THEN b."ad_name" |
| | | when c."ad_grad" = 3 THEN c."ad_name" END AS countyName, |
| | | case when b."ad_grad" = 3 THEN b."ad_code" |
| | | when c."ad_grad" = 3 THEN c."ad_code" END AS countyCode, |
| | | case when b."ad_grad" = 2 THEN b."ad_code" |
| | | when c."ad_grad" = 2 THEN c."ad_code" |
| | | ELSE d."ad_code" END AS cityCode, |
| | | case when b."ad_grad" = 2 THEN b."ad_name" |
| | | when c."ad_grad" = 2 THEN c."ad_name" |
| | | ELSE d."ad_name" END AS cityName |
| | | from YWXT.sm_alarm_record sar |
| | | left join SJZT_MD."att_res_base" arb on arb."guid" = sar.reservoir_number |
| | | left join SJZT_MD."att_ad_base" b ON arb."interior_ad_guid" = b."guid" |
| | | left join SJZT_MD."att_ad_base" c ON b."p_ad_code" = c."guid" |
| | | left join SJZT_MD."att_ad_base" d ON c."p_ad_code" = d."guid" |
| | | left join YWXT.sm_alarm_rule e on e.id = sar.alarm_rule_id |
| | | where sar.is_deleted = 0 |
| | | <if test="alarmRecord.reservoirName!=null and alarmRecord.reservoirName!=''"> |
| | | and arb."name" like concat('%',#{alarmRecord.reservoirName},'%') |
| | | </if> |
| | | <if test="alarmRecord.type!=null and alarmRecord.type!=''"> |
| | | and e.type = #{alarmRecord.type} |
| | | </if> |
| | | <if test="alarmRecord.alarmRuleType!=null and alarmRecord.alarmRuleType!=''"> |
| | | and e.alarm_rule_type = #{alarmRecord.alarmRuleType} |
| | | </if> |
| | | <if test="alarmRecord.createAlarmType!=null and alarmRecord.createAlarmType!=''"> |
| | | and e.create_alarm_type = #{alarmRecord.createAlarmType} |
| | | </if> |
| | | <if test="alarmRecord.ruleName!=null and alarmRecord.ruleName!=''"> |
| | | and e.rule_name = #{alarmRecord.ruleName} |
| | | </if> |
| | | <if test="alarmRecord.startTime!=null and alarmRecord.startTime!=''"> |
| | | and date_format(sar.create_time,'%Y-%m-%d') >= #{alarmRecord.startTime} |
| | | </if> |
| | | <if test="alarmRecord.endTime!=null and alarmRecord.endTime!=''"> |
| | | and date_format(sar.create_time,'%Y-%m-%d') <= #{alarmRecord.endTime} |
| | | </if> |
| | | ) f |
| | | group by cityName,rule_name |
| | | </select> |
| | | |
| | | <!--查询告警统计数据-按三大类--> |
| | | <select id="statisticAlarmRecordByType" resultType="cn.gistack.alerts.alarmRule.vo.StatisticAlarmRecord"> |
| | | select |
| | | a.dict_value as ruleName, |
| | | case when ifnull(b.type,0)='0' then 0 else b.num end as num |
| | | from |
| | | ( |
| | | select dict_value from YWXT.blade_dict_biz where code = 'ALARM_TYPE' and dict_key!= '-1' and is_deleted = 0 |
| | | ) a left join |
| | | ( |
| | | select type,count(*) num |
| | | from YWXT.sm_alarm_record sar |
| | | left join YWXT.sm_alarm_rule e on e.id = sar.alarm_rule_id |
| | | where sar.is_deleted = 0 |
| | | <if test="alarmRecord.startTime!=null and alarmRecord.startTime!=''"> |
| | | and date_format(sar.create_time,'%Y-%m-%d') >= #{alarmRecord.startTime} |
| | | </if> |
| | | <if test="alarmRecord.endTime!=null and alarmRecord.endTime!=''"> |
| | | and date_format(sar.create_time,'%Y-%m-%d') <= #{alarmRecord.endTime} |
| | | </if> |
| | | group by type |
| | | ) b on a.dict_value = b.type |
| | | </select> |
| | | |
| | | <!--查询符合条件的告警类型--> |
| | | <select id="listAlarmRule" resultType="cn.gistack.alerts.alarmRule.entity.AlarmRule"> |
| | | select * from YWXT.sm_alarm_rule where is_deleted = 0 |
| | | <if test="alarmRecord.type!=null and alarmRecord.type!=''"> |
| | | and type = #{alarmRecord.type} |
| | | </if> |
| | | <if test="alarmRecord.alarmRuleType!=null and alarmRecord.alarmRuleType!=''"> |
| | | and alarm_rule_type = #{alarmRecord.alarmRuleType} |
| | | </if> |
| | | <if test="alarmRecord.createAlarmType!=null and alarmRecord.createAlarmType!=''"> |
| | | and create_alarm_type = #{alarmRecord.createAlarmType} |
| | | </if> |
| | | <if test="alarmRecord.ruleName!=null and alarmRecord.ruleName!=''"> |
| | | and rule_name = #{alarmRecord.ruleName} |
| | | </if> |
| | | </select> |
| | | |
| | | </mapper> |
| | |
| | | import cn.gistack.alerts.alarmRule.entity.AlarmRule; |
| | | import cn.gistack.alerts.alarmRule.vo.AlarmRuleDetailVO; |
| | | import cn.gistack.alerts.alarmRule.vo.AlarmRuleVO; |
| | | import cn.gistack.system.entity.DictBiz; |
| | | import com.baomidou.mybatisplus.core.mapper.BaseMapper; |
| | | import com.baomidou.mybatisplus.core.metadata.IPage; |
| | | import org.apache.ibatis.annotations.Param; |
| | |
| | | * @return |
| | | */ |
| | | List<String> getAlarmRuleDetailListByAlarmRuleId(@Param("id") String alarmRuleId); |
| | | |
| | | /** |
| | | * 通过告警规则类型查询生成告警规则类型 |
| | | * @param alarmRuleType |
| | | * @return |
| | | */ |
| | | List<DictBiz> getCreateRuleType(@Param("alarmRuleType") String alarmRuleType); |
| | | |
| | | /** |
| | | * 通过成告警规则类型查询告警规则名称 |
| | | * @param createAlarmType |
| | | * @return |
| | | */ |
| | | List<DictBiz> getAlarmRuleName(@Param("createAlarmType") String createAlarmType); |
| | | } |
| | |
| | | <if test="alarmRule.ruleName!=null and alarmRule.ruleName!=''"> |
| | | and sar.rule_name like concat(concat('%',#{alarmRule.ruleName}),'%') |
| | | </if> |
| | | <if test="alarmRule.target!=null and alarmRule.target!=''"> |
| | | and sar.target = #{alarmRule.target} |
| | | </if> |
| | | </select> |
| | | |
| | | <!--通过id查询--> |
| | |
| | | where sard.alarm_rule_id = #{id} |
| | | </select> |
| | | |
| | | <!--通过告警规则类型查询生成告警规则类型--> |
| | | <select id="getCreateRuleType" resultType="cn.gistack.system.entity.DictBiz"> |
| | | select create_alarm_type as dictValue,create_alarm_type as dictKey from sm_alarm_rule |
| | | where is_deleted =0 |
| | | and alarm_rule_type = #{alarmRuleType} |
| | | group by create_alarm_type |
| | | </select> |
| | | |
| | | <!--通过成告警规则类型查询告警规则名称--> |
| | | <select id="getAlarmRuleName" resultType="cn.gistack.system.entity.DictBiz"> |
| | | select rule_name as dictValue,rule_name as dictKey from sm_alarm_rule |
| | | where is_deleted =0 |
| | | and create_alarm_type = #{createAlarmType} |
| | | group by rule_name |
| | | </select> |
| | | |
| | | </mapper> |
| | |
| | | * @return |
| | | */ |
| | | Object selectAlarmRecordPage(IPage<AlarmRecordVO> page, AlarmRecordVO alarmRecord); |
| | | |
| | | /** |
| | | * 按行政区统计告警-按三大类 |
| | | * @param alarmRecord |
| | | * @return |
| | | */ |
| | | Object statisticAlarmRecordByType(AlarmRecordVO alarmRecord); |
| | | |
| | | /** |
| | | * 按行政区统计告警 |
| | | * @param alarmRecord |
| | | * @return |
| | | */ |
| | | Object statisticAlarmRecord(AlarmRecordVO alarmRecord); |
| | | } |
| | |
| | | * @return |
| | | */ |
| | | List<String> getAlarmRuleDetailList(String alarmRuleId); |
| | | |
| | | /** |
| | | * 通过告警规则类型查询生成告警规则类型 |
| | | * @param alarmRuleType |
| | | * @return |
| | | */ |
| | | Object getCreateRuleType(String alarmRuleType); |
| | | |
| | | /** |
| | | * 通过成告警规则类型查询告警规则名称 |
| | | * @param createAlarmType |
| | | * @return |
| | | */ |
| | | Object getAlarmRuleName(String createAlarmType); |
| | | } |
| | |
| | | package cn.gistack.alerts.alarmRule.service.impl; |
| | | |
| | | import cn.gistack.alerts.alarmRule.entity.AlarmRecord; |
| | | import cn.gistack.alerts.alarmRule.entity.AlarmRule; |
| | | import cn.gistack.alerts.alarmRule.mapper.AlarmRecordMapper; |
| | | import cn.gistack.alerts.alarmRule.service.AlarmRecordService; |
| | | import cn.gistack.alerts.alarmRule.service.AlarmRuleService; |
| | | import cn.gistack.alerts.alarmRule.vo.AlarmRecordVO; |
| | | import cn.gistack.alerts.alarmRule.vo.StatisticAlarmRecord; |
| | | import cn.gistack.alerts.sms.vo.Temp; |
| | | import cn.gistack.sm.intelligentCall.entity.Scene; |
| | | import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; |
| | | import com.baomidou.mybatisplus.core.metadata.IPage; |
| | | import org.springblade.core.mp.base.BaseServiceImpl; |
| | | import org.springblade.core.secure.utils.AuthUtil; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.stereotype.Service; |
| | | |
| | | import java.util.ArrayList; |
| | | import java.util.HashMap; |
| | | import java.util.List; |
| | | import java.util.Map; |
| | | import java.util.stream.Collectors; |
| | | |
| | | /** |
| | | * 告警记录服务实现层 |
| | |
| | | */ |
| | | @Service |
| | | public class AlarmRecordServiceImpl extends BaseServiceImpl<AlarmRecordMapper, AlarmRecord> implements AlarmRecordService { |
| | | |
| | | @Autowired |
| | | private AlarmRuleService alarmRuleService; |
| | | |
| | | /** |
| | | * 自定义分页列表查询 |
| | |
| | | } |
| | | return page.setRecords(baseMapper.selectAlarmRecordPage(page,alarmRecord)); |
| | | } |
| | | |
| | | /** |
| | | * 按行政区统计告警-按三大类 |
| | | * @param alarmRecord |
| | | * @return |
| | | */ |
| | | @Override |
| | | public Object statisticAlarmRecordByType(AlarmRecordVO alarmRecord) { |
| | | // 获取当前用户的行政区划 |
| | | String adCode = "420000000000"; |
| | | // 查询统计数据 |
| | | List<StatisticAlarmRecord> list = baseMapper.statisticAlarmRecordByType(alarmRecord); |
| | | // 返回数据 |
| | | return list; |
| | | } |
| | | |
| | | /** |
| | | * 按行政区统计告警 |
| | | * @param alarmRecord |
| | | * @return |
| | | */ |
| | | @Override |
| | | public Object statisticAlarmRecord(AlarmRecordVO alarmRecord) { |
| | | // 获取当前用户的行政区划 |
| | | String adCode = "420000000000"; |
| | | // 查询所有的市级行政区 |
| | | List<String> adNameList = baseMapper.getAdNameList(adCode); |
| | | // 查询符合条件的告警类型 |
| | | List<AlarmRule> alarmRuleList = baseMapper.listAlarmRule(alarmRecord); |
| | | // 查询统计数据 |
| | | List<StatisticAlarmRecord> list = baseMapper.statisticAlarmRecord(alarmRecord); |
| | | // 按行政区分组 |
| | | Map<String, List<StatisticAlarmRecord>> listMap = list.stream().filter(item->null!=item.getAdName()).collect(Collectors.groupingBy(StatisticAlarmRecord::getAdName)); |
| | | // 补全行政区 |
| | | for (String adName : adNameList) { |
| | | if (!listMap.containsKey(adName)){ |
| | | List<StatisticAlarmRecord> arrayList = new ArrayList<>(); |
| | | listMap.put(adName,arrayList); |
| | | } |
| | | } |
| | | List<String> ruleNameList = alarmRuleList.stream().map(alarmRule -> alarmRule.getRuleName()).collect(Collectors.toList()); |
| | | // 补全告警类型 |
| | | listMap.forEach((adName,statisticAlarmRecords)->{ |
| | | // 取出已有的告警类型 |
| | | List<String> newRuleNameList = statisticAlarmRecords.stream().map(alarmRule -> alarmRule.getRuleName()).collect(Collectors.toList()); |
| | | // 取差集 |
| | | List<String> resultAlarmRuleList = ruleNameList.stream().filter(item -> !newRuleNameList.contains(item)).collect(Collectors.toList()); |
| | | for (String ruleName : resultAlarmRuleList) { |
| | | StatisticAlarmRecord newStatisticAlarmRecord = new StatisticAlarmRecord(); |
| | | newStatisticAlarmRecord.setRuleName(ruleName); |
| | | newStatisticAlarmRecord.setNum(0); |
| | | newStatisticAlarmRecord.setAdName(adName); |
| | | statisticAlarmRecords.add(newStatisticAlarmRecord); |
| | | } |
| | | }); |
| | | List<Object> objects = new ArrayList<>(); |
| | | // 重新录入排序 |
| | | for (String adName : adNameList) { |
| | | if (listMap.containsKey(adName)){ |
| | | objects.add(listMap.get(adName)); |
| | | } |
| | | } |
| | | // 返回数据 |
| | | return objects; |
| | | } |
| | | } |
| | |
| | | public List<String> getAlarmRuleDetailList(String alarmRuleId) { |
| | | return baseMapper.getAlarmRuleDetailListByAlarmRuleId(alarmRuleId); |
| | | } |
| | | |
| | | /** |
| | | * 通过告警规则类型查询生成告警规则类型 |
| | | * @param alarmRuleType |
| | | * @return |
| | | */ |
| | | @Override |
| | | public Object getCreateRuleType(String alarmRuleType) { |
| | | return baseMapper.getCreateRuleType(alarmRuleType); |
| | | } |
| | | |
| | | /** |
| | | * 通过成告警规则类型查询告警规则名称 |
| | | * @param createAlarmType |
| | | * @return |
| | | */ |
| | | @Override |
| | | public Object getAlarmRuleName(String createAlarmType) { |
| | | return baseMapper.getAlarmRuleName(createAlarmType); |
| | | } |
| | | } |
| | |
| | | */ |
| | | public static List<String> waterInfoNotList = new ArrayList<String>() |
| | | {{ |
| | | add("county_nm,town_nm"); |
| | | // add("county_nm,town_nm"); |
| | | add("res_nm"); |
| | | }}; |
| | | |
| | |
| | | */ |
| | | public static List<String> waterDataExcList = new ArrayList<String>() |
| | | {{ |
| | | add("county_nm,town_nm"); |
| | | // add("county_nm,town_nm"); |
| | | add("res_nm"); |
| | | // add("rz"); |
| | | }}; |
| | |
| | | add("rz"); |
| | | }}; |
| | | |
| | | /** |
| | | * 19.坝安全监测告警 |
| | | */ |
| | | public static List<String> damSafetyList = new ArrayList<String>() |
| | | {{ |
| | | // add("county_nm,town_nm"); |
| | | add("res_nm"); |
| | | add("ms_flag"); |
| | | }}; |
| | | } |
| | |
| | | public static final String url_prefix_prod = "http://10.42.6.192"; |
| | | |
| | | /** |
| | | * 请求头url 前缀(prod) |
| | | */ |
| | | public static final String url_prefix_test = "http://10.42.6.192"; |
| | | |
| | | /** |
| | | * 水位数据缺失 |
| | | */ |
| | | public static final String res_z_null_api = "/services/1234567890ABCDEFGHIJKLMN/res/z_null"; |
| | |
| | | */ |
| | | public static final String alarm_rain_6_over_api = "/services/1234567890ABCDEFGHIJKLMN/alarm/rain/6/over/api"; |
| | | |
| | | /** |
| | | * 19. 大坝安全监测告警 |
| | | */ |
| | | public static final String alarm_db_api = "/services/1234567890ABCDEFGHIJKLMN/alarm/db/api"; |
| | | |
| | | } |
| | |
| | | Boolean isSendStation, |
| | | String uuid) { |
| | | Map<String, Object> map = new HashMap<>(); |
| | | // String uuid = alarmRuleDetail.getTemplateId() + UUID.randomUUID().toString(); |
| | | // 只发短信,将发短信信息组装好 |
| | | SmsRequestTemplate smsRequestTemplate |
| | | = noticeHandle.getSendSmsTemplate(ztData,alarmRule,alarmRuleDetail,columnList ,flag,adCode,uuid,isSendStation); |
| | |
| | | Boolean isSendStation, |
| | | String uuid) { |
| | | Map<String, Object> map = new HashMap<>(); |
| | | // String uuid = alarmRuleDetail.getTemplateId() + UUID.randomUUID().toString(); |
| | | // 只发短信,将发短信信息组装好 |
| | | SmsRequestTemplate smsRequestTemplate |
| | | = noticeHandle.getSendSmsTemplate(ztData,alarmRule,alarmRuleDetail,columnList ,flag,adCode,uuid,isSendStation); |
| | |
| | | return map; |
| | | } |
| | | |
| | | |
| | | /** |
| | | * 策略19: 大坝安全监测告警-短信 |
| | | * |
| | | * @param alarmRule 告警规则信息 |
| | | * @param alarmRuleDetail 告警规则详情信息 |
| | | * @param ztData 告警数据 |
| | | * @param columnList 告警模板动态内容key |
| | | * @param flag 是否包含日期 |
| | | * @param adCode 行政区code用户过滤数据 |
| | | * @param isSendStation 是否发送站内信 |
| | | * @return |
| | | */ |
| | | @Async |
| | | public Map<String, Object> damSafetyHandle(AlarmRule alarmRule, |
| | | AlarmRuleDetail alarmRuleDetail, |
| | | JSONArray ztData, |
| | | List<String> columnList, |
| | | Boolean flag, |
| | | String adCode, |
| | | Boolean isSendStation, |
| | | String uuid) { |
| | | Map<String, Object> map = new HashMap<>(); |
| | | // 只发短信,将发短信信息组装好 |
| | | SmsRequestTemplate smsRequestTemplate |
| | | = noticeHandle.getSendSmsTemplate(ztData,alarmRule,alarmRuleDetail,columnList ,flag,adCode,uuid,isSendStation); |
| | | // 拼接后面内容 |
| | | if (smsRequestTemplate.getPersonVOList().size() > 0) { |
| | | for (List<String> list : smsRequestTemplate.getTemplateContent()) { |
| | | // 保存告警记录信息 |
| | | AlarmRecord alarmRecord = noticeHandle.saveAlarmRecord(list, alarmRule, uuid); |
| | | if (null != alarmRecord) { |
| | | list.add(alarmRecord.getId().toString()); |
| | | } |
| | | } |
| | | map = smsService.sendSignMsg(smsRequestTemplate); |
| | | // 调用短信服务 |
| | | return map; |
| | | } |
| | | return map; |
| | | } |
| | | } |
| | |
| | | // 超汛限水位 |
| | | if (s.equals("over_z")) { |
| | | String is_danger_res = "is_danger_res"; |
| | | if (jsonArray.getJSONObject(i).getString(is_danger_res).equals("true")) { |
| | | if (null!= jsonArray.getJSONObject(i).getString(is_danger_res) && jsonArray.getJSONObject(i).getString(is_danger_res).equals("true")) { |
| | | format = format + "控制运用水位" + jsonArray.getJSONObject(i).getString(s); |
| | | } else if (jsonArray.getJSONObject(i).getString(is_danger_res).equals("false")) { |
| | | } else if (null!= jsonArray.getJSONObject(i).getString(is_danger_res) && jsonArray.getJSONObject(i).getString(is_danger_res).equals("false")) { |
| | | format = format + "汛限水位" + jsonArray.getJSONObject(i).getString(s); |
| | | } else { |
| | | format = format + jsonArray.getJSONObject(i).getString(s); |
| | |
| | | }else { |
| | | format = format + "已漫过坝顶" + (-parseDouble); |
| | | } |
| | | }else { |
| | | format = format + jsonArray.getJSONObject(i).getString(s); |
| | | } |
| | | } else if (s.equals("ms_flag")) { |
| | | // 水位 |
| | | String ms_flag = "ms_flag"; |
| | | if (null!= jsonArray.getJSONObject(i).getString(ms_flag) && jsonArray.getJSONObject(i).getString(ms_flag).equals("sy")) { |
| | | format = format + "渗压"; |
| | | } else if (null!= jsonArray.getJSONObject(i).getString(ms_flag) && jsonArray.getJSONObject(i).getString(ms_flag).equals("sl")) { |
| | | format = format + "渗流" ; |
| | | } else if (null!= jsonArray.getJSONObject(i).getString(ms_flag) && jsonArray.getJSONObject(i).getString(ms_flag).equals("by")) { |
| | | format = format + "白蚁" ; |
| | | } else if (null!= jsonArray.getJSONObject(i).getString(ms_flag) && jsonArray.getJSONObject(i).getString(ms_flag).equals("bx")) { |
| | | format = format + "变形" ; |
| | | }else { |
| | | format = format + jsonArray.getJSONObject(i).getString(s); |
| | | } |
| | |
| | | if (activeProfile.equals("prod")){ |
| | | url = ZtApiUrlConstant.url_prefix_prod + url; |
| | | } |
| | | if (activeProfile.equals("test")){ |
| | | url = ZtApiUrlConstant.url_prefix_test + url; |
| | | } |
| | | //设置请求头 |
| | | HttpHeaders headers = new HttpHeaders(); |
| | | headers.add(ZtConfigConstant.header_key, ZtConfigConstant.header_value); |
| | |
| | | // if (alarmRuleDetail.getAlarmMode().equals("电话")) { |
| | | // asyncNoticeHandle.outCallHandleCall(alarmRule, alarmRuleDetail, ztData,ZtApiDataColumnConstant.waterComeDesignList2,true, adCode, false,uuid); |
| | | // } |
| | | // if (alarmRuleDetail.getAlarmMode().equals("站内信")) { |
| | | // asyncNoticeHandle.waterComeDesignHandleStation(alarmRule, alarmRuleDetail, ztData,ZtApiDataColumnConstant.waterComeDesignList3,true, adCode, true,uuid); |
| | | // } |
| | | if (alarmRuleDetail.getAlarmMode().equals("站内信")) { |
| | | asyncNoticeHandle.waterComeDesignHandleStation(alarmRule, alarmRuleDetail, ztData,ZtApiDataColumnConstant.waterComeDesignList3,true, adCode, true,uuid); |
| | | } |
| | | } |
| | | } |
| | | } |
| | |
| | | return "6小时降雨告警"; |
| | | } |
| | | |
| | | |
| | | /** |
| | | * 策略19: 大坝安全监测告警 |
| | | * |
| | | * @param arg1 |
| | | * @param arg2 |
| | | * @return |
| | | */ |
| | | public String damSafetyHandle(String arg1, String arg2) { |
| | | //String adCode = "420607000000"; |
| | | String uuid = UUID.randomUUID().toString(); |
| | | String adCode = null; |
| | | // 查询当前策略对应的告警规则信息 |
| | | AlarmRule alarmRule = alarmRuleService.getOne(new QueryWrapper<AlarmRule>().eq("rule_name", arg1)); |
| | | // 调用中台服务接口查询数据 |
| | | JSONArray ztData = noticeHandle.getZtData("", ZtApiUrlConstant.alarm_db_api); |
| | | // 获取告警规则详情,判断告警类型(短信,电话,站内信) |
| | | if (null!=alarmRule) { |
| | | // 查询告警详情信息 |
| | | List<AlarmRuleDetail> alarmRuleDetailList = alarmRuleDetailService.list(new QueryWrapper<AlarmRuleDetail>().eq("alarm_rule_id", alarmRule.getId())); |
| | | if (alarmRuleDetailList.size()>0){ |
| | | // 遍历 |
| | | for (AlarmRuleDetail alarmRuleDetail : alarmRuleDetailList) { |
| | | if (alarmRuleDetail.getAlarmMode().equals("短信")) { |
| | | asyncNoticeHandle.damSafetyHandle(alarmRule, alarmRuleDetail, ztData,ZtApiDataColumnConstant.damSafetyList,true, adCode, false,uuid); |
| | | } |
| | | } |
| | | } |
| | | } |
| | | // 返回 |
| | | return "大坝安全监测告警"; |
| | | } |
| | | |
| | | } |
| | |
| | | strategyMap.put("alreadyRainstormHandle", (arg1, arg2) -> noticeStrategyImpl.alreadyRainstormHandle(arg1, arg2)); |
| | | strategyMap.put("twoHourRainHandle", (arg1, arg2) -> noticeStrategyImpl.twoHourRainHandle(arg1, arg2)); |
| | | strategyMap.put("sixHourRainHandle", (arg1, arg2) -> noticeStrategyImpl.sixHourRainHandle(arg1, arg2)); |
| | | strategyMap.put("damSafetyHandle", (arg1, arg2) -> noticeStrategyImpl.damSafetyHandle(arg1, arg2)); |
| | | } |
| | | |
| | | /** |
| | |
| | | } |
| | | |
| | | /** |
| | | * 通过用户id推送消息,用于2.0测试(多人) |
| | | * @param pushVO |
| | | * @return |
| | | */ |
| | | @PostMapping("/pushMessageByUserList") |
| | | public R pushMessageByUserList(PushVO pushVO){ |
| | | return R.data(pushService.pushMessageByUserList(pushVO)); |
| | | } |
| | | |
| | | |
| | | |
| | | |
| | | /** |
| | | * 清空redis中的缓存 |
| | | * @param userId |
| | | * @return |
| | |
| | | * @return |
| | | */ |
| | | Boolean geTuiPushMessage(PushVO pushVO); |
| | | |
| | | Boolean pushMessageByUserList(PushVO pushVO); |
| | | } |
| | |
| | | import org.springframework.web.client.RestTemplate; |
| | | |
| | | import java.util.*; |
| | | import java.util.concurrent.atomic.AtomicReference; |
| | | |
| | | @Service |
| | | @AllArgsConstructor |
| | |
| | | @Override |
| | | public Boolean pushMessageList(List<MessageRecord> messageRecordList) { |
| | | // 加入测试人员 |
| | | addSendMsgTest(messageRecordList); |
| | | // addSendMsgTest(messageRecordList); |
| | | List<String> cIdList = new ArrayList<>(); |
| | | AtomicReference<Boolean> push = new AtomicReference<>(false); |
| | | //相同的消息推送给多用户 |
| | | messageRecordList.forEach(messageRecord -> { |
| | | //获取用户cId |
| | | String clientId = getClientIdByUserId(messageRecord.getRecipient()); |
| | | if (null!=clientId && !clientId.equals("")) { |
| | | cIdList.add(clientId); |
| | | }); |
| | | |
| | | //uni-push 一次推送最多500名用户,所以分批推送 |
| | | List<List<String>> groupList = groupListByQuantity(cIdList, 400); |
| | | groupList.forEach(item->{ |
| | | PushVO pushVO = new PushVO(); |
| | | |
| | | pushVO.setCIds(cIdList); |
| | | pushVO.setTitle(messageRecordList.get(0).getTheme()); |
| | | pushVO.setContent(messageRecordList.get(0).getContent()); |
| | | pushVO.setTitle(messageRecord.getTheme()); |
| | | pushVO.setContent(messageRecord.getContent()); |
| | | |
| | | HashMap<String,Object> payload = new HashMap<>(); |
| | | payload.put("title",messageRecordList.get(0).getTheme()); |
| | | payload.put("content",messageRecordList.get(0).getContent()); |
| | | payload.put("title",messageRecord.getTheme()); |
| | | payload.put("content", messageRecord.getContent()); |
| | | payload.put("payload","test"); |
| | | pushVO.setPayload(payload); |
| | | pushMessage(pushVO); |
| | | |
| | | push.set(pushMessage(pushVO)); |
| | | } |
| | | }); |
| | | return true; |
| | | return push.get(); |
| | | } |
| | | |
| | | /** |
| | | * 新增测试信息 |
| | | * |
| | | * @param messageRecordList |
| | | */ |
| | | private void addSendMsgTest(List<MessageRecord> messageRecordList) { |
| | |
| | | return geTuiUtils.myPushMessage(cIdList, pushVO.getTitle(), pushVO.getContent()); |
| | | } |
| | | |
| | | @Override |
| | | public Boolean pushMessageByUserList(PushVO pushVO) { |
| | | |
| | | if (Func.isEmpty(pushVO.getUserId())) { |
| | | throw new ServiceException("请填写用户id!"); |
| | | } |
| | | |
| | | //获取userIdList |
| | | List<String> userIdList = Arrays.asList(pushVO.getUserId().split(",")); |
| | | List<MessageRecord> messageRecordList = new ArrayList<>(); |
| | | |
| | | userIdList.forEach(userId->{ |
| | | MessageRecord messageRecord = new MessageRecord(); |
| | | |
| | | messageRecord.setContent(pushVO.getContent()); |
| | | messageRecord.setTheme(pushVO.getTitle()); |
| | | messageRecord.setRecipient(userId); |
| | | |
| | | messageRecordList.add(messageRecord); |
| | | }); |
| | | |
| | | Boolean aBoolean = pushMessageList(messageRecordList); |
| | | |
| | | return aBoolean; |
| | | } |
| | | |
| | | /** |
| | | * 根据用户id从redis中获取cid |
| | | * |
| | |
| | | |
| | | /** |
| | | * 对集合按指定数量进行分组 |
| | | * |
| | | * @param list 分组的集合 |
| | | * @param quantity 数量 |
| | | * @param <T> |
| | |
| | | private String userId; |
| | | |
| | | private HashMap<String,Object> payload; |
| | | |
| | | } |
| | |
| | | import cn.gistack.alerts.sms.entity.SmsRequest; |
| | | import cn.gistack.alerts.sms.entity.SmsResult; |
| | | import cn.gistack.alerts.sms.excel.SendRainSmsExcel; |
| | | import cn.gistack.alerts.sms.excel.SendSmsExcel; |
| | | import cn.gistack.alerts.sms.listener.ExcelListener; |
| | | import cn.gistack.alerts.sms.service.SmsService; |
| | | import cn.gistack.alerts.sms.util.SmsUtils; |
| | | import cn.gistack.alerts.sms.vo.SmsRequestTemplate; |
| | | import cn.gistack.alerts.sms.vo.SmsResponseVO; |
| | | import cn.gistack.sm.intelligentCall.excel.CallExcel; |
| | | import cn.gistack.system.user.entity.User; |
| | | import cn.gistack.system.user.feign.IUserClient; |
| | | import com.alibaba.excel.EasyExcel; |
| | | import io.swagger.annotations.ApiOperation; |
| | | import lombok.AllArgsConstructor; |
| | | import lombok.extern.slf4j.Slf4j; |
| | | import org.springblade.core.excel.util.ExcelUtil; |
| | | import org.springblade.core.redis.cache.BladeRedis; |
| | | import org.springblade.core.tool.api.R; |
| | | import org.springframework.web.bind.annotation.*; |
| | | import org.springframework.web.multipart.MultipartFile; |
| | | |
| | | import javax.servlet.http.HttpServletResponse; |
| | | import java.io.IOException; |
| | | import java.util.ArrayList; |
| | | import java.util.Arrays; |
| | | import java.util.List; |
| | | import java.util.Map; |
| | |
| | | // 导入并返回 |
| | | return R.data(smsService.batchSendSms(map)); |
| | | } |
| | | |
| | | |
| | | /** |
| | | * 导入表格发送预警短信 |
| | | * @param file excel文件 |
| | | * @param templateId 模板id |
| | | * @param param 通用参数 |
| | | * @param content 发送内容 |
| | | * @return |
| | | */ |
| | | @PostMapping("/import-send-sms") |
| | | public R importSendSms(MultipartFile file,String templateId,String param,String content){ |
| | | ExcelListener<SendSmsExcel> listener = new ExcelListener<>(); |
| | | //headRowNumber(1)从第2行开始读取,使用getDatas()方法取出数据 |
| | | try { |
| | | EasyExcel.read(file.getInputStream(), SendSmsExcel.class, listener).headRowNumber(1).sheet(0).doRead(); |
| | | } catch (IOException e) { |
| | | e.printStackTrace(); |
| | | } |
| | | List<SendSmsExcel> list = listener.getDatas(); |
| | | // 导入并返回 |
| | | return R.data(smsService.importSendSms(list,templateId,param,content)); |
| | | } |
| | | |
| | | |
| | | /** |
| | | * 导出模板 |
| | | */ |
| | | @GetMapping("/export-template") |
| | | @ApiOperation(value = "导出模板") |
| | | public void exportTemplate(HttpServletResponse response) { |
| | | List<SendSmsExcel> list = new ArrayList<>(); |
| | | ExcelUtil.export(response, "短信发送数据模板", "短信发送数据表", list, SendSmsExcel.class); |
| | | } |
| | | } |
| New file |
| | |
| | | package cn.gistack.alerts.sms.excel; |
| | | |
| | | import com.alibaba.excel.annotation.ExcelProperty; |
| | | import com.alibaba.excel.annotation.write.style.ColumnWidth; |
| | | import com.alibaba.excel.annotation.write.style.ContentRowHeight; |
| | | import com.alibaba.excel.annotation.write.style.HeadRowHeight; |
| | | import lombok.Data; |
| | | |
| | | import java.io.Serializable; |
| | | |
| | | @Data |
| | | @ColumnWidth(25) |
| | | @HeadRowHeight(20) |
| | | @ContentRowHeight(18) |
| | | public class SendSmsExcel implements Serializable { |
| | | |
| | | private static final long serialVersionUID = 1L; |
| | | |
| | | @ColumnWidth(15) |
| | | @ExcelProperty("手机号码") |
| | | private String phone; |
| | | } |
| | |
| | | |
| | | <!--自定义分页列表查询--> |
| | | <select id="selectSmsResultPage" resultType="cn.gistack.alerts.sms.vo.SmsResultVO"> |
| | | select ssr.*,sst.content templateContent,sst.sms_type as smsType |
| | | select ssr.*, |
| | | sar.rule_name as ruleName, |
| | | sst.content templateContent,sst.sms_type as smsType |
| | | from sm_sms_result ssr |
| | | left join sm_sms_template sst on sst.template_id = ssr.template_id and sst.is_deleted = 0 |
| | | left join YWXT.sm_alarm_rule_detail sard on sard.template_id = sst.id |
| | | left join YWXT.sm_alarm_rule sar on sar.id = sard.alarm_rule_id |
| | | where 1=1 and ssr.is_deleted = 0 |
| | | <if test="smsResult.templateId!=null and smsResult.templateId!=''"> |
| | | and ssr.template_id = #{smsResult.templateId} |
| | | </if> |
| | | <if test="smsResult.resCode==0"> |
| | | and ssr.res_code =0 |
| | | </if> |
| | | <if test="smsResult.resCode==1"> |
| | | and ssr.res_code !=0 |
| | | </if> |
| | | <if test="smsResult.templateContent!=null and smsResult.templateContent!=''"> |
| | | and sst.content like concat('%',#{smsResult.templateContent},'%') |
| | | </if> |
| | |
| | | <if test="smsTemplate.type!=null and smsTemplate.type!=''"> |
| | | and type = #{smsTemplate.type} |
| | | </if> |
| | | <if test="smsTemplate.smsType!=null"> |
| | | and sms_type = #{smsTemplate.smsType} |
| | | </if> |
| | | <if test="smsTemplate.noticeMode!=null and smsTemplate.noticeMode!=''"> |
| | | and notice_mode = #{smsTemplate.noticeMode} |
| | | </if> |
| | |
| | | import cn.gistack.alerts.sms.entity.SmsRequest; |
| | | import cn.gistack.alerts.sms.entity.SmsResult; |
| | | import cn.gistack.alerts.sms.excel.SendRainSmsExcel; |
| | | import cn.gistack.alerts.sms.excel.SendSmsExcel; |
| | | import cn.gistack.alerts.sms.vo.SmsRequestTemplate; |
| | | import cn.gistack.alerts.sms.vo.SmsResponseVO; |
| | | |
| | |
| | | * @return |
| | | */ |
| | | Object batchSendSms(Map<String, Object> map); |
| | | |
| | | /** |
| | | * 导入表格发送预警短信 |
| | | * @param list 集合数据 |
| | | * @param templateId 模板id |
| | | * @param param 通用参数 |
| | | * @param content 发送内容 |
| | | * @return |
| | | */ |
| | | Object importSendSms(List<SendSmsExcel> list,String templateId,String param, String content); |
| | | } |
| | |
| | | } |
| | | if (null!=smsResult.getIsExport()){ |
| | | // 导出,不分页 |
| | | return baseMapper.selectSmsResultPage(null,smsResult,list); |
| | | List<SmsResultVO> resultVOList = baseMapper.selectSmsResultPage(null, smsResult, list); |
| | | // 设置统计值 |
| | | return resultVOList; |
| | | } |
| | | // 查询返回 |
| | | return page.setRecords(baseMapper.selectSmsResultPage(page,smsResult,list)); |
| | |
| | | import cn.gistack.alerts.sms.entity.SmsResult; |
| | | import cn.gistack.alerts.sms.entity.SmsTemplate; |
| | | import cn.gistack.alerts.sms.excel.SendRainSmsExcel; |
| | | import cn.gistack.alerts.sms.excel.SendSmsExcel; |
| | | import cn.gistack.alerts.sms.service.ISmsRecordService; |
| | | import cn.gistack.alerts.sms.service.ISmsResultService; |
| | | import cn.gistack.alerts.sms.service.ISmsTemplateService; |
| | |
| | | import cn.gistack.alerts.sms.vo.SmsResponseVO; |
| | | import cn.gistack.alerts.sms.vo.Temp; |
| | | import cn.gistack.sm.intelligentCall.entity.CallNotFillRecord; |
| | | import cn.gistack.sm.intelligentCall.excel.CallExcel; |
| | | import cn.gistack.sm.intelligentCall.feign.OutCallClient; |
| | | import cn.gistack.sm.message.entity.MessageRecord; |
| | | import cn.gistack.sm.sjztmd.feign.IAttResManagePersonClient; |
| | | import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; |
| | | import com.baomidou.mybatisplus.core.toolkit.IdWorker; |
| | | import com.google.common.collect.Lists; |
| | | import com.google.common.collect.Sets; |
| | | import org.jetbrains.annotations.NotNull; |
| | | import org.springblade.core.redis.cache.BladeRedis; |
| | | import org.springblade.core.secure.utils.AuthUtil; |
| | |
| | | }); |
| | | } |
| | | |
| | | // /** |
| | | // * 发送合并水库名短信 |
| | | // * @param smsRequestTemplate |
| | | // */ |
| | | // @Override |
| | | // public void sendMergeSignMsg(SmsRequestTemplate smsRequestTemplate) { |
| | | // // 取出数据 |
| | | // SMSSendRequest request = new SMSSendRequest(); |
| | | // SmsTemplate smsTemplate = smsRequestTemplate.getSmsTemplate(); |
| | | // request.setTemplateId(smsTemplate.getTemplateId()); |
| | | // List<List<String>> templateContent = smsRequestTemplate.getTemplateContent(); |
| | | // List<Temp> tempList = new ArrayList<>(); |
| | | // // 合并数据 |
| | | // for (List<String> list : templateContent) { |
| | | // Temp temp = new Temp(); |
| | | // temp.setPhone(list.get(1)); |
| | | // temp.setReservoirCode(list.get(0)); |
| | | // temp.setReservoirName(list.get(3)); |
| | | // temp.setAlarmRecordId(list.get(list.size()-1)); |
| | | // // 放入临时集合 |
| | | // tempList.add(temp); |
| | | // } |
| | | // // 按手机号分组 |
| | | // Map<String, List<Temp>> listMap = tempList.stream().collect(Collectors.groupingBy(Temp::getPhone)); |
| | | // // 短信发送行数据 |
| | | // List<String> rowList = new ArrayList<>(); |
| | | // // 告警记录详情数据 |
| | | // List<AlarmRecordDetailVO> alarmRecordDetailList = new ArrayList<>(); |
| | | // // 遍历 map 发送短信,组装数据 |
| | | // listMap.forEach((s, temps) -> { |
| | | // StringBuilder builder = new StringBuilder(); |
| | | // StringBuilder smsRecordBuilder = new StringBuilder(); |
| | | // builder.append(s).append(","); |
| | | // // 如果一人对应水库数量超过30个,则分批发送 |
| | | // List<List<Temp>> lists = Lists.partition(new ArrayList<>(temps), 30); |
| | | // for (List<Temp> list : lists) { |
| | | // // 遍历 |
| | | // for (Temp temp : list) { |
| | | // builder.append(temp.getReservoirName()).append(","); |
| | | // smsRecordBuilder.append(temp.getReservoirName()).append(","); |
| | | // AlarmRecordDetailVO alarmRecordDetail = new AlarmRecordDetailVO(); |
| | | // alarmRecordDetail.setReservoirNumber(temp.getReservoirCode()); |
| | | // alarmRecordDetail.setAlarmRecordId(Long.parseLong(temp.getAlarmRecordId())); |
| | | // alarmRecordDetail.setAlarmMode("短信"); |
| | | // alarmRecordDetail.setPhone(temp.getPhone()); |
| | | // alarmRecordDetail.setReservoirName(temp.getReservoirName()); |
| | | // // 加入集合 |
| | | // alarmRecordDetailList.add(alarmRecordDetail); |
| | | // } |
| | | // String row = builder.substring(0, builder.length() - 1); |
| | | // rowList.add(row); |
| | | // } |
| | | // }); |
| | | // // 批量发送短信 |
| | | // mergeBatchSendSms(smsRequestTemplate,request,smsTemplate,rowList,alarmRecordDetailList); |
| | | // } |
| | | |
| | | /** |
| | | * 批量发送合并水库的短信 |
| | | */ |
| | | public void mergeBatchSendSms(SmsRequestTemplate smsRequestTemplate, |
| | | SMSSendRequest request, |
| | | SmsTemplate smsTemplate, |
| | | List<String> rowList, |
| | | List<AlarmRecordDetailVO> alarmRecordDetailList) { |
| | | // 组装数据 |
| | | String[] titleArr = smsRequestTemplate.getTitle().split(","); |
| | | String[][] dyns = new String[rowList.size() + 1][titleArr.length]; |
| | | dyns[0] = titleArr; |
| | | int rowNum = 1; |
| | | for (String row : rowList) { |
| | | String[] cols = row.split(","); |
| | | dyns[rowNum++] = cols; |
| | | } |
| | | //请求参数 |
| | | ComResult<DynSMSSendDataResult> resultComResult = sendDynSMSSendDataResultComResult(smsTemplate.getTemplateId(), dyns); |
| | | // 先保存结果记录 |
| | | SmsResult smsResult = saveSendResult(resultComResult.getCode().toString(),resultComResult.getMsg(),request, rowList.size()); |
| | | List<AlarmRecordDetail> alarmRecordDetailArrayList = new ArrayList<>(); |
| | | // 遍历 |
| | | for (AlarmRecordDetailVO alarmRecordDetailVO : alarmRecordDetailList) { |
| | | // 设置手机号 |
| | | request.setUserNumber(alarmRecordDetailVO.getPhone()); |
| | | // 内容处理 |
| | | String str = smsTemplate.getContent().replaceAll("\\{.+?\\}", "%s"); |
| | | // 格式转换 |
| | | String formatContent = String.format(str, alarmRecordDetailVO.getReservoirName().split(",")); |
| | | // 设置内容 |
| | | request.setMessageContent(formatContent); |
| | | // 保存短信发送记录 |
| | | SmsRecord smsRecord = saveSendRecord(request, resultComResult.getCode().toString(), resultComResult.getMsg(), smsResult.getId()); |
| | | AlarmRecordDetail alarmRecordDetail1 = new AlarmRecordDetail(); |
| | | // 短信内容拼接(完成发送的结果信息) |
| | | alarmRecordDetail1.setAlarmContent(formatContent); |
| | | alarmRecordDetail1.setSendRecordId(smsRecord.getId()); |
| | | alarmRecordDetail1.setCreateTime(new Date()); |
| | | alarmRecordDetail1.setReservoirNumber(alarmRecordDetailVO.getReservoirNumber()); |
| | | alarmRecordDetail1.setAlarmRecordId(alarmRecordDetailVO.getAlarmRecordId()); |
| | | alarmRecordDetail1.setAlarmMode(alarmRecordDetailVO.getAlarmMode()); |
| | | alarmRecordDetail1.setPhone(alarmRecordDetailVO.getPhone()); |
| | | alarmRecordDetailArrayList.add(alarmRecordDetail1); |
| | | } |
| | | // 保存告警记录详情信息 |
| | | boolean save = alarmRecordDetailService.saveBatch(alarmRecordDetailArrayList); |
| | | } |
| | | |
| | | /** |
| | | * 批量发送短信(集合数据) |
| | | * @param map (保护参数 1:短信模板id 2:数据集合 list<Map<String,Object>>) |
| | |
| | | // 返回 |
| | | return batchSendSmsMap; |
| | | } |
| | | |
| | | /** |
| | | * 导入表格发送预警短信 |
| | | * @param list 集合数据 |
| | | * @param templateId 模板id |
| | | * @param param 通用参数 |
| | | * @param content 发送内容 |
| | | * @return |
| | | */ |
| | | @Override |
| | | public Object importSendSms(List<SendSmsExcel> list,String templateId,String param, String content) { |
| | | // 查询短信模板 |
| | | SmsTemplate smsTemplate = smsTemplateService.getOne(new QueryWrapper<SmsTemplate>().eq("template_id", templateId)); |
| | | // 判断模板是否为具名变量模板(目前已筛选出都是具名变量模板) |
| | | // 判断模板中是否包含参数,如果无参数,对比是否传参数 |
| | | boolean validate = validatorParam(smsTemplate,param); |
| | | if (!validate){ |
| | | return R.data(400,"参数个数不对应,请检查后修改导入!",null); |
| | | } |
| | | // 转换 |
| | | List<String> stringList = list.stream().map(SendSmsExcel::getPhone).collect(Collectors.toList()); |
| | | // 获取水库个数 |
| | | List<String> errPhones = new ArrayList<>(); |
| | | // 去重 |
| | | Set<String> hashSet = new HashSet<>(stringList); |
| | | // 拼接短信标题数组 |
| | | String [] titleArr = getSmsTitleArr(smsTemplate); |
| | | // 批量发送不能超过1000 个号码,需分组发送 |
| | | List<String> arrayList = new ArrayList<>(hashSet); |
| | | List<List<String>> partition = Lists.partition(arrayList, 1000); |
| | | int i = 0; |
| | | String errMsg = ""; |
| | | for (List<String> phoneList : partition) { |
| | | HashSet<String> sets = new HashSet<>(phoneList); |
| | | // 批量发送短信 |
| | | Map<String, Object> batchSendSmsMap = batchSendSms(sets, titleArr, param, smsTemplate,errPhones); |
| | | // 取出发送结果 |
| | | ComResult<DynSMSSendDataResult> resultComResult = (ComResult<DynSMSSendDataResult>) batchSendSmsMap.get("resultComResult"); |
| | | // |
| | | if(!resultComResult.getCode().equals(0)){ |
| | | i++; |
| | | errMsg = resultComResult.getMsg(); |
| | | break; |
| | | } |
| | | } |
| | | if (i>0){ |
| | | // 返回resultComResult |
| | | return R.data(400,"发送失败!" + errMsg,null); |
| | | } |
| | | // 返回resultComResult |
| | | return R.data(200,"发送成功!",null); |
| | | } |
| | | |
| | | /** |
| | | * 校验参数 |
| | | * @param smsTemplate |
| | | * @param param |
| | | */ |
| | | private boolean validatorParam(SmsTemplate smsTemplate, String param) { |
| | | int length = 0; |
| | | if (null!= param && !param.equals("")) { |
| | | length = Arrays.asList(param.split(",")).size(); |
| | | } |
| | | // 解析模板 |
| | | String str = smsTemplate.getContent().replaceAll("\\{.+?\\}", "%s"); |
| | | int countChar = countChar(str, '%'); |
| | | if (length==countChar){ |
| | | return true; |
| | | }else { |
| | | return false; |
| | | } |
| | | } |
| | | |
| | | /** |
| | | * 计算某个字符在字符串中的个数 |
| | | * @param str 字符串 |
| | | * @param target 字符 |
| | | * @return |
| | | */ |
| | | public int countChar(String str, char target) { |
| | | String targetStr = String.valueOf(target); |
| | | String replacedStr = str.replaceAll(targetStr, ""); |
| | | return str.length() - replacedStr.length(); |
| | | } |
| | | } |
| New file |
| | |
| | | #服务器端口 |
| | | server: |
| | | port: 8111 |
| | | |
| | | #数据源配置 |
| | | #spring: |
| | | # datasource: |
| | | # url: ${blade.datasource.test.url} |
| | | # username: ${blade.datasource.test.username} |
| | | # password: ${blade.datasource.test.password} |
| | | |
| | | #多数据源配置 |
| | | spring: |
| | | #排除DruidDataSourceAutoConfigure |
| | | autoconfigure: |
| | | exclude: com.alibaba.druid.spring.boot.autoconfigure.DruidDataSourceAutoConfigure |
| | | datasource: |
| | | dynamic: |
| | | #设置默认的数据源或者数据源组,默认值即为master |
| | | primary: master |
| | | datasource: |
| | | master: |
| | | url: ${blade.datasource.test.url} |
| | | username: ${blade.datasource.test.username} |
| | | password: ${blade.datasource.test.password} |
| | | zt: |
| | | url: ${blade.datasource.test.zt.url} |
| | | username: ${blade.datasource.test.zt.username} |
| | | password: ${blade.datasource.test.zt.password} |
| | | # 智能外呼数据库 |
| | | ztznwh: |
| | | url: ${blade.datasource.test.ztznwh.url} |
| | | username: ${blade.datasource.test.ztznwh.username} |
| | | password: ${blade.datasource.test.ztznwh.password} |
| | | ## 定时器数据源 |
| | | xxljob: |
| | | url: ${blade.datasource.test.xxljob.url} |
| | | username: ${blade.datasource.test.xxljob.username} |
| | | password: ${blade.datasource.test.xxljob.password} |
| | | ## 智能外呼数据源(mysql) |
| | | znwh: |
| | | driver-class-name: ${blade.datasource.test.znwh.driver-class-name} |
| | | url: ${blade.datasource.test.znwh.url} |
| | | username: ${blade.datasource.test.znwh.username} |
| | | password: ${blade.datasource.test.znwh.password} |
| | | main: |
| | | allow-circular-references: true |
| | | getui: |
| | | appId: "zyUET0RTBHAzLyMhV7dY32" |
| | | appKey: "wuY8226sbu66P6tF9T0Fj5" |
| | | appSecret: "IN3UEIeUccAiYgcBTLcK3A" |
| | | masterSecret: "vlhKpASV66AJEfWnCgFsB2" |
| | | # Url前缀 |
| | | baseUrl: "https://restapi.getui.com/v2/" |
| | |
| | | AND dam_id = #{vo.damId} |
| | | </select> |
| | | <select id="getAlarmDetailPage" resultType="cn.gistack.nky.vo.AlarmGetVO"> |
| | | SELECT * FROM NKY_ALARM_GET |
| | | SELECT |
| | | ID,DAM_ID,POINT_ID,TYPE, |
| | | ( |
| | | CASE |
| | | WHEN TYPE=1 THEN '渗压' |
| | | WHEN TYPE=2 THEN '渗流' |
| | | WHEN (TYPE=3 OR TYPE=4 OR TYPE=5) THEN '位移' |
| | | END) AS typeName, |
| | | "TIME","VALUE","DESC",CREATE_TIME,TASK_CATEGORY,"LEVEL",BAOJINGZHI,ORIGIN_ID,FORWARD,"REVERSE",RATIO,STATUS |
| | | |
| | | FROM YWXT.NKY_ALARM_GET |
| | | WHERE 1=1 |
| | | <if test="vo.startTime != null and vo.startTime != ''"> |
| | | AND DATE_FORMAT(time,'%Y-%m-%d') >= #{vo.startTime} |
| | |
| | | <if test="vo.status != null and vo.status !='' "> |
| | | AND status = #{vo.status} |
| | | </if> |
| | | <if test="vo.type != null and vo.type !='' "> |
| | | <if test="vo.type != null and vo.type !='' and vo.type == 1 "> |
| | | AND type = #{vo.type} |
| | | </if> |
| | | <if test="vo.type != null and vo.type !='' and vo.type == 2"> |
| | | AND type = #{vo.type} |
| | | </if> |
| | | <if test="vo.type != null and vo.type !='' and vo.type == 3"> |
| | | AND (type = '3' or type = '4' or type = '5') |
| | | </if> |
| | | <if test="vo.pointId != null and vo.pointId !='' "> |
| | | AND POINT_id = #{vo.pointId} |
| | | </if> |
| New file |
| | |
| | | #服务器端口 |
| | | server: |
| | | port: 8115 |
| | | |
| | | #数据源配置 |
| | | #spring: |
| | | # datasource: |
| | | # url: ${blade.datasource.test.url} |
| | | # username: ${blade.datasource.test.username} |
| | | # password: ${blade.datasource.test.password} |
| | | |
| | | #多数据源配置 |
| | | spring: |
| | | rabbitmq: |
| | | host: 10.42.7.146 |
| | | port: 5672 |
| | | username: algo |
| | | password: P6#yzdd7 |
| | | virtual-host: / |
| | | #排除DruidDataSourceAutoConfigure |
| | | autoconfigure: |
| | | exclude: com.alibaba.druid.spring.boot.autoconfigure.DruidDataSourceAutoConfigure |
| | | datasource: |
| | | dynamic: |
| | | #设置默认的数据源或者数据源组,默认值即为master |
| | | primary: master |
| | | datasource: |
| | | master: |
| | | url: ${blade.datasource.test.url} |
| | | username: ${blade.datasource.test.username} |
| | | password: ${blade.datasource.test.password} |
| | | zt: |
| | | url: ${blade.datasource.test.zt.url} |
| | | username: ${blade.datasource.test.zt.username} |
| | | password: ${blade.datasource.test.zt.password} |
| | | |
| | | main: |
| | | allow-circular-references: true |
| | | |
| New file |
| | |
| | | #服务器端口 |
| | | server: |
| | | port: 8120 |
| | | |
| | | #数据源配置 |
| | | #spring: |
| | | # datasource: |
| | | # url: ${blade.datasource.test.url} |
| | | # username: ${blade.datasource.test.username} |
| | | # password: ${blade.datasource.test.password} |
| | | |
| | | #多数据源配置 |
| | | spring: |
| | | #排除DruidDataSourceAutoConfigure |
| | | autoconfigure: |
| | | exclude: com.alibaba.druid.spring.boot.autoconfigure.DruidDataSourceAutoConfigure |
| | | datasource: |
| | | dynamic: |
| | | #设置默认的数据源或者数据源组,默认值即为master |
| | | primary: master |
| | | datasource: |
| | | master: |
| | | url: ${blade.datasource.test.url} |
| | | username: ${blade.datasource.test.username} |
| | | password: ${blade.datasource.test.password} |
| | | zt: |
| | | url: ${blade.datasource.test.zt.url} |
| | | username: ${blade.datasource.test.zt.username} |
| | | password: ${blade.datasource.test.zt.password} |
| | | |
| | | main: |
| | | allow-circular-references: true |
| | | |
| | | yunPwd: |
| | | config: |
| | | url-prefix: http://10.10.1.1 |
| | |
| | | info."guid" AS resCd, |
| | | info."name" AS resName, |
| | | info."eng_scal" AS engScal, |
| | | info."res_reg_code" AS resRegCode, |
| | | info."town_ad_code" AS townCode, |
| | | info."town_ad_name" AS townName, |
| | | info."county_ad_code" AS countyCode, |
| | |
| | | a."guid", |
| | | a."name", |
| | | a."eng_scal", |
| | | a."res_reg_code", |
| | | case when b."ad_grad" = 4 THEN b."ad_code" ELSE NULL END AS "town_ad_code", |
| | | case when b."ad_grad" = 4 THEN b."ad_name" ELSE NULL END AS "town_ad_name", |
| | | case when b."ad_grad" = 4 THEN b."order_id" ELSE NULL END AS "town_order_id", |
| | |
| | | */ |
| | | private String resCd; |
| | | |
| | | |
| | | /** |
| | | * 水库名称 |
| | | */ |
| | | private String resName; |
| | | |
| | | /** |
| | | * 水库注册码 |
| | | */ |
| | | private String resRegCode; |
| | | |
| | | /** |
| | | * 地市 |
| | | */ |
| | | private String cityName; |
| | |
| | | */ |
| | | public static final String eventSubscriptionViewURLs = "/api/eventService/v1/eventSubscriptionView"; |
| | | |
| | | /** |
| | | * 区域的批量添加 |
| | | */ |
| | | public static final String batchAddURLs = "/api/resource/v1/region/batch/add"; |
| | | |
| | | |
| | | |
| | | |
| | |
| | | import cn.gistack.sm.hk.constant.ProtocolConstant; |
| | | import cn.gistack.sm.hk.service.HkService; |
| | | import cn.gistack.sm.hk.vo.HkVO; |
| | | import cn.gistack.sm.hk.vo.VideoVO; |
| | | import com.alibaba.fastjson.JSON; |
| | | import com.alibaba.fastjson.JSONObject; |
| | | import io.swagger.annotations.Api; |
| | | import io.swagger.annotations.ApiOperation; |
| | |
| | | import org.springblade.core.tool.api.R; |
| | | import org.springframework.web.bind.annotation.*; |
| | | |
| | | import java.util.ArrayList; |
| | | import java.util.List; |
| | | import java.util.Map; |
| | | |
| | | import static cn.gistack.sm.hk.util.GetCameraUtils.*; |
| | |
| | | return R.data(common(null==hk.getType()?1:hk.getType(),HkConstant.presetsDeletionURLs, body)); |
| | | } |
| | | |
| | | /** |
| | | * 同步水库设备信息 |
| | | * @param hk 水库设备 |
| | | * @return |
| | | */ |
| | | @ApiOperation(value = "海康设备-同步水库设备信息", notes = "海康设备-同步水库设备信息") |
| | | @PostMapping(value = "/syncVideo") |
| | | public R syncVideo(@RequestBody HkVO hk) { |
| | | /** |
| | | * 组装请求参数 |
| | | */ |
| | | List<VideoVO> list = new ArrayList<>(); |
| | | VideoVO video = new VideoVO(); |
| | | video.setRegionName(hk.getRegionName()); |
| | | video.setRegionIndexCode(hk.getRegionIndexCode()); |
| | | video.setParentIndexCode("root000000"); |
| | | video.setRegionType(10); |
| | | list.add(video); |
| | | String body = JSON.toJSONString(list); |
| | | |
| | | /** |
| | | * 调用接口并返回数据 |
| | | * post请求application/json类型参数; |
| | | */ |
| | | return R.data(JSONObject.parseObject(common(null==hk.getType()?2:hk.getType(),HkConstant.batchAddURLs, body))); |
| | | } |
| | | |
| | | } |
| | |
| | | * 扩展 |
| | | */ |
| | | private String expand; |
| | | |
| | | /** |
| | | * 水库/区域名称 |
| | | */ |
| | | private String regionName; |
| | | |
| | | /** |
| | | * 水库/区域编号 |
| | | */ |
| | | private String regionIndexCode; |
| | | } |
| New file |
| | |
| | | package cn.gistack.sm.hk.vo; |
| | | |
| | | import lombok.Data; |
| | | |
| | | import java.io.Serializable; |
| | | |
| | | @Data |
| | | public class VideoVO implements Serializable { |
| | | |
| | | private String parentIndexCode; |
| | | |
| | | /** |
| | | * 水库名称 |
| | | */ |
| | | private String regionName; |
| | | |
| | | /** |
| | | * 水库编号 |
| | | */ |
| | | private String regionIndexCode; |
| | | |
| | | private Integer regionType; |
| | | |
| | | } |
| | |
| | | |
| | | import cn.gistack.sm.intelligentCall.entity.CallTaskResult; |
| | | import cn.gistack.sm.intelligentCall.entity.Scene; |
| | | import cn.gistack.sm.intelligentCall.excel.CallExcel; |
| | | import cn.gistack.sm.intelligentCall.listener.ExcelListener; |
| | | import cn.gistack.sm.intelligentCall.service.CallService; |
| | | import cn.gistack.sm.intelligentCall.service.ICallSmsNoticeTaskService; |
| | | import cn.gistack.sm.intelligentCall.vo.CallTaskResultVO; |
| | | import cn.gistack.sm.intelligentCall.vo.CallTaskStatistic; |
| | | import com.alibaba.excel.EasyExcel; |
| | | import io.swagger.annotations.Api; |
| | | import io.swagger.annotations.ApiOperation; |
| | | import lombok.AllArgsConstructor; |
| | | import lombok.extern.slf4j.Slf4j; |
| | | import org.springblade.core.excel.util.ExcelUtil; |
| | | import org.springblade.core.mp.support.Condition; |
| | | import org.springblade.core.mp.support.Query; |
| | | import org.springblade.core.tool.api.R; |
| | | import org.springframework.web.bind.annotation.*; |
| | | import org.springframework.web.multipart.MultipartFile; |
| | | |
| | | import javax.servlet.http.HttpServletResponse; |
| | | import java.io.IOException; |
| | | import java.util.*; |
| | | |
| | | /** |
| | |
| | | // 返回 |
| | | return R.data(callService.getCallResultListTemp(Condition.getPage(query),callTaskResult)); |
| | | } |
| | | |
| | | |
| | | /** |
| | | * 导入表格发送智能外呼 |
| | | * @param file excel文件 |
| | | * @param time 呼叫时间(空的话默认选择当前时间) |
| | | * @return |
| | | */ |
| | | @PostMapping("/import-call") |
| | | public R importCall(MultipartFile file,String time){ |
| | | ExcelListener<CallExcel> listener = new ExcelListener<>(); |
| | | //headRowNumber(1)从第2行开始读取,使用getDatas()方法取出数据 |
| | | try { |
| | | EasyExcel.read(file.getInputStream(), CallExcel.class, listener).headRowNumber(1).sheet(0).doRead(); |
| | | } catch (IOException e) { |
| | | e.printStackTrace(); |
| | | } |
| | | List<CallExcel> list = listener.getDatas(); |
| | | // 导入并返回 |
| | | return R.data(callService.importCall(list,time)); |
| | | } |
| | | |
| | | /** |
| | | * 导出模板 |
| | | */ |
| | | @GetMapping("/export-template") |
| | | @ApiOperation(value = "导出模板") |
| | | public void exportTemplate(HttpServletResponse response) { |
| | | List<CallExcel> list = new ArrayList<>(); |
| | | ExcelUtil.export(response, "智能外呼数据模板", "智能外呼数据表", list, CallExcel.class); |
| | | } |
| | | } |
| | |
| | | */ |
| | | @InterceptorIgnore(tenantLine = "true") |
| | | List<CallTaskStatistic> getCallResultList(@Param("page") IPage<CallTaskStatistic> page, |
| | | @Param("list") List<String> list, |
| | | @Param("callTaskStatistic") CallTaskStatistic callTaskStatistic); |
| | | |
| | | /** |
| | |
| | | <!--查询智能外呼统计数据-按日期-行政区统计--> |
| | | <select id="getOutgoingStatisticList" resultType="cn.gistack.sm.intelligentCall.vo.CallTaskStatistic"> |
| | | select |
| | | aab."guid",aab."ad_name", |
| | | aab."guid",aab."ad_name",aab."ad_grad" as grad, |
| | | ifnull(totalCount,0) as calleeNumberCount, |
| | | ifnull(connectCount,0) as connectionCount, |
| | | ifnull(threeNotConnectCount,0) as threeNoConnectCount, |
| | |
| | | <!--查询当前天除去日常呼叫外的统计数据--> |
| | | <select id="getNoDayOutgoingStatisticList" resultType="cn.gistack.sm.intelligentCall.vo.CallTaskStatistic"> |
| | | select |
| | | aab."guid",aab."ad_name", |
| | | aab."guid",aab."ad_name",aab."ad_grad" as grad, |
| | | ifnull(totalCount,0) as calleeNumberCount, |
| | | ifnull(connectCount,0) as connectionCount, |
| | | ifnull(threeNotConnectCount,0) as threeNoConnectCount, |
| | |
| | | |
| | | <!--按日期行政区呼叫结果详情列表信息--> |
| | | <select id="getCallResultList" resultType="cn.gistack.sm.intelligentCall.vo.CallTaskStatistic"> |
| | | select x.* from ( |
| | | select |
| | | e."gmt_create" as createTime,e."call_id",e.waterCode,e.callResult,e."callee_number", |
| | | aab."guid",aab."ad_name" as adName, |
| | | bu.real_name as realName, |
| | | if(ifnull(scnfr.call_id,0)='0','','已反馈') isSmsFill, |
| | | case when aab."ad_grad"= 3 then aab."p_ad_name" |
| | | when e."ad_grad"= 2 then e."ad_name" |
| | | when e."ad_grad"= 3 then e."p_ad_name" |
| | | end as cityName, |
| | | case when e."ad_grad"= 4 then e."p_ad_name" |
| | | when e."ad_grad"= 3 then e."ad_name" |
| | | end as countyName, |
| | | arb."name" as waterName |
| | | arb."name" as waterName,arb."eng_scal" as engScal,arb."res_reg_code" as resRegCode, |
| | | case when b."ad_grad" = 4 THEN b."ad_name" ELSE NULL END AS townName, |
| | | case when b."ad_grad" = 3 THEN b."ad_name" |
| | | when c."ad_grad" = 3 THEN c."ad_name" END AS countyName, |
| | | case when b."ad_grad" = 3 THEN b."ad_code" |
| | | when c."ad_grad" = 3 THEN c."ad_code" END AS countyCode, |
| | | case when b."ad_grad" = 2 THEN b."ad_code" |
| | | when c."ad_grad" = 2 THEN c."ad_code" |
| | | ELSE d."ad_code" END AS cityCode, |
| | | case when b."ad_grad" = 2 THEN b."ad_name" |
| | | when c."ad_grad" = 2 THEN c."ad_name" |
| | | ELSE d."ad_name" END AS cityName |
| | | from ( |
| | | select date_format(ctc."gmt_create",'%Y-%m-%d') "gmt_create",ctc."call_id",ctr."ad_grad",ctr."ad_name",ctr."p_ad_name", |
| | | ctc."task_id",JSON_VALUE(ctc."call_task_callee_content",'$."$水库编码$"') as waterCode ,ctr."call_result" as callResult,ctr."callee_number" |
| | | select date_format(ctc."gmt_create",'%Y-%m-%d') "gmt_create",ctc."call_id",ctc."task_id",JSON_VALUE(ctc."call_task_callee_content",'$."$水库编码$"') as waterCode , |
| | | ctr."call_result" as callResult,ctr."callee_number" |
| | | from "SJZT_ODS"."call_task_callee" ctc |
| | | join ( |
| | | select d.*,aab."ad_grad",aab."ad_name",aab."p_ad_name" from ( |
| | | select d.* from ( |
| | | select ctr.*,waterCode from SJZT_ODS."call_task_result" ctr right join |
| | | ( |
| | | select max("gmt_create") "gmt_create",waterCode,"callee_number" from ( |
| | |
| | | ) a group by date_format("gmt_create",'%Y-%m-%d'),waterCode,"callee_number" |
| | | ) b on ctr."gmt_create" = b."gmt_create" and ctr."callee_number" = b."callee_number" |
| | | ) d left join "YWXT".sm_call_not_fill_record scnfr on scnfr.call_id = d."call_id" |
| | | left join "SJZT_MD"."att_res_base" arb on d.waterCode = arb."code" |
| | | left join "SJZT_MD"."att_ad_base" aab on aab."guid" = concat(arb."ad_guid",'000000') |
| | | where 1=1 |
| | | <if test="callTaskStatistic.count==2"> |
| | | and d."call_result" = '200000' or scnfr.task_id is not null |
| | |
| | | </if> |
| | | union all |
| | | |
| | | select ctr.*,waterCode,aab."ad_grad",aab."ad_name",aab."p_ad_name" from SJZT_ODS."call_task_result" ctr |
| | | select ctr.*,waterCode from SJZT_ODS."call_task_result" ctr |
| | | left join ( |
| | | select "call_id",JSON_VALUE("call_task_callee_content",'$."$水库编码$"') as waterCode from "SJZT_ODS"."call_task_callee" |
| | | ) ctc on ctr."call_id" = ctc."call_id" |
| | | left join "YWXT".sm_call_not_fill_record scnfr on scnfr.call_id = ctr."call_id" |
| | | left join SJZT_ODS."call_task" ct on ct."id" = ctr."task_id" |
| | | left join YWXT.sm_daily_call_task sdct on sdct.task_id = ct."id" |
| | | left join "SJZT_MD"."att_res_base" arb on ctc.waterCode = arb."code" |
| | | left join "SJZT_MD"."att_ad_base" aab on aab."guid" = concat(arb."ad_guid",'000000') |
| | | where date_format(ctr."gmt_create",'%Y-%m-%d') >= #{callTaskStatistic.startTime} |
| | | and date_format(ctr."gmt_create",'%Y-%m-%d') <= #{callTaskStatistic.endTime} |
| | | and sdct.task_id is null |
| | |
| | | </if> |
| | | )ctr on ctc."call_id" = ctr."call_id" |
| | | )e |
| | | left join "SJZT_MD"."att_res_base" arb on locate(arb."code",e.waterCode)>0 |
| | | left join "SJZT_MD"."att_ad_base" aab on aab."guid" = concat(arb."ad_guid",'000000') |
| | | left join "YWXT".sm_call_not_fill_record scnfr on scnfr.call_id = e."call_id" |
| | | left join "YWXT".blade_user bu on bu.phone = e."callee_number" and bu.is_deleted = 0 |
| | | where aab."ad_name" is not null |
| | | <if test="list != null and list.size()>0"> |
| | | and aab."ad_code" in |
| | | <foreach collection="list" item="adCode" separator ="," open="(" close=")"> |
| | | #{adCode} |
| | | </foreach> |
| | | </if> |
| | | left join YWXT.sm_call_not_fill_record scnfr on scnfr.call_id = e."call_id" |
| | | left join YWXT.blade_user bu on bu.phone = e."callee_number" and bu.is_deleted = 0 |
| | | left join SJZT_MD."att_res_base" arb on locate(arb."code",e.waterCode)>0 |
| | | left join SJZT_MD."att_ad_base" b ON arb."interior_ad_guid" = b."guid" |
| | | left join SJZT_MD."att_ad_base" c ON b."p_ad_code" = c."guid" |
| | | left join SJZT_MD."att_ad_base" d ON c."p_ad_code" = d."guid" |
| | | <if test="callTaskStatistic.realName!=null and callTaskStatistic.realName!=''"> |
| | | and bu.real_name like concat('%',#{callTaskStatistic.realName},'%') |
| | | </if> |
| | | <if test="callTaskStatistic.waterName!=null and callTaskStatistic.waterName!=''"> |
| | | and arb."name" like concat('%',#{callTaskStatistic.waterName},'%') |
| | | </if> |
| | | ) x |
| | | where 1=1 |
| | | <if test="callTaskStatistic.grad==2"> |
| | | and x.cityCode = #{callTaskStatistic.adCode} |
| | | </if> |
| | | <if test="callTaskStatistic.grad==3"> |
| | | and x.countyCode = #{callTaskStatistic.adCode} |
| | | </if> |
| | | </select> |
| | | |
| | |
| | | arb."rv_name" rvName, |
| | | REGEXP_SUBSTR (arb."res_loc",'[^-]+',1,2) as cityName, |
| | | REGEXP_SUBSTR (arb."res_loc",'[^-]+',1,3) as countyName, |
| | | REGEXP_SUBSTR (arb."res_loc",'[^-]+',1,4) as townName, |
| | | if(ifnull(scnfr.call_id,0)='0','','已反馈') isSmsFill, |
| | | case when ctr."call_result"!='200000' then if(ifnull(scnfr.is_danger,0)>'0',if(scnfr.is_danger='是',2,1),0) |
| | | else if(ifnull(cas."tag_title",0)>'0',if(instr(cas."tag_title",'未发现险情')>0,1,if(instr(cas."tag_title",'发现险情')>0,2,0)),0) end as isDange, |
| | |
| | | |
| | | |
| | | import cn.gistack.sm.intelligentCall.entity.CallNotFillRecord; |
| | | import cn.gistack.sm.intelligentCall.excel.CallExcel; |
| | | import cn.gistack.sm.intelligentCall.vo.CallTaskResultVO; |
| | | import cn.gistack.sm.intelligentCall.vo.CallTaskStatistic; |
| | | import com.baomidou.mybatisplus.core.metadata.IPage; |
| | |
| | | * @return |
| | | */ |
| | | List<String> createOutCallTaskByAlarm(Map<String, Object> map); |
| | | |
| | | /** |
| | | * 导入表格发送智能外呼 |
| | | * @param list |
| | | * @param time |
| | | * @return |
| | | */ |
| | | Object importCall(List<CallExcel> list,String time); |
| | | } |
| | |
| | | import cn.gistack.sm.intelligentCall.constant.CallConstant; |
| | | import cn.gistack.sm.intelligentCall.constant.ZtConstant; |
| | | import cn.gistack.sm.intelligentCall.entity.Scene; |
| | | import cn.gistack.sm.intelligentCall.excel.CallExcel; |
| | | import cn.gistack.sm.intelligentCall.mapper.CallTaskMapper; |
| | | import cn.gistack.sm.intelligentCall.service.CallService; |
| | | import cn.gistack.sm.intelligentCall.vo.CallTaskResultVO; |
| | | import cn.gistack.sm.intelligentCall.vo.CallTaskStatistic; |
| | | import cn.gistack.sm.sjztmd.entity.AttAdBase; |
| | | import cn.gistack.sm.sjztmd.service.IAttAdBaseService; |
| | | import cn.gistack.sm.sjztmd.service.IAttResManagePersonService; |
| | | import cn.gistack.sm.sjztmd.vo.AttAdBaseVO; |
| | | import com.alibaba.fastjson.JSON; |
| | | import com.alibaba.fastjson.JSONArray; |
| | |
| | | import org.apache.commons.lang3.StringUtils; |
| | | import org.jetbrains.annotations.NotNull; |
| | | import org.springblade.core.redis.cache.BladeRedis; |
| | | import org.springblade.core.tool.api.R; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.http.*; |
| | | import org.springframework.stereotype.Service; |
| | |
| | | |
| | | @Autowired |
| | | private BladeRedis bladeRedis; |
| | | |
| | | @Autowired |
| | | private IAttResManagePersonService attResManagePersonService; |
| | | |
| | | @Autowired |
| | | private AsyncCallService asyncCallService; |
| | |
| | | */ |
| | | @Override |
| | | public Object getCallResultList(IPage<CallTaskStatistic> page, CallTaskStatistic callTaskStatistic) { |
| | | List<String> list = new ArrayList<>(); |
| | | if (null!= callTaskStatistic.getAdCode() && !callTaskStatistic.getAdCode().equals("")){ |
| | | // 查询所有下级区域code |
| | | list = getAllChildrenAreaByAreaCode(callTaskStatistic.getAdCode()); |
| | | } |
| | | if (null!=callTaskStatistic.getIsPage()){ |
| | | // 不分页 |
| | | return callTaskMapper.getCallResultList(null, list,callTaskStatistic); |
| | | return callTaskMapper.getCallResultList(null,callTaskStatistic); |
| | | } |
| | | List<CallTaskStatistic> callNotConnectResultList = callTaskMapper.getCallResultList(page,list, callTaskStatistic); |
| | | List<CallTaskStatistic> callNotConnectResultList = callTaskMapper.getCallResultList(page, callTaskStatistic); |
| | | // 返回 |
| | | return page.setRecords(callNotConnectResultList); |
| | | } |
| | |
| | | // 不分页 |
| | | return callTaskMapper.getCallResultListTemp(null,callTaskResult,list); |
| | | } |
| | | |
| | | /** |
| | | * 导入表格发送智能外呼 |
| | | * @param list |
| | | * @param time |
| | | * @return |
| | | */ |
| | | @Override |
| | | public Object importCall(List<CallExcel> list,String time) { |
| | | // 转换 |
| | | List<String> stringList = list.stream().map(CallExcel::getWaterCode).collect(Collectors.toList()); |
| | | // 通过水库代码获取水库及巡查责任人信息 |
| | | Set<Scene> personList = attResManagePersonService.getPatrolPersonListByWaterCodeList(stringList); |
| | | Map<String, Object> params = new HashMap<>(); |
| | | //传入调度时间和随机得到的人员信息进行任务的创建并返回 |
| | | params.put("list",setForListMap(personList)); |
| | | // 调度时间处理 |
| | | if (null!=time && !time.equals("")){ |
| | | params.put("taskScheduleTime",time); |
| | | }else { |
| | | params.put("taskScheduleTime",new SimpleDateFormat("yyyy-MM-dd HH:mm:ss").format(new Date())); |
| | | } |
| | | // 创建任务并返回结果 |
| | | List<String> task = createTask(params); |
| | | if (null!=task.get(1) && !task.get(1).equals("")){ |
| | | String successMsg = "外呼任务创建成功"; |
| | | // 返回 |
| | | return R.data(200,successMsg,null); |
| | | } |
| | | String errorMsg = task.get(0); |
| | | // 返回 |
| | | return R.data(400,errorMsg,null); |
| | | } |
| | | } |
| | |
| | | |
| | | <select id="getStatistics" resultType="cn.gistack.sm.jcsb.vo.StatisticsVO"> |
| | | SELECT * FROM |
| | | (SELECT COUNT(1)AS patrolCount FROM SM_PATROL_TASK WHERE PROJECT_ID =#{resGuid} AND IS_DELETED = 0)p, |
| | | (SELECT COUNT(1)AS patrolCount FROM SM_PATROL_TASK WHERE PROJECT_ID =#{resGuid} AND state = 3 AND IS_DELETED = 0)p, |
| | | (SELECT COUNT(1)AS dangerCount FROM SM_DANGER_REPORT WHERE RESERVOIR_ID = #{resGuid} AND IS_DELETED = 0)SDR |
| | | </select> |
| | | </mapper> |
| | |
| | | |
| | | dangerReportSUPO.setReservoirName(encodeReservoirName); |
| | | dangerReport.setReservoirName(attResBase.getName()); // 保存水库名称 |
| | | dangerReport.setReservoirId(attResBase.getGuid()); |
| | | |
| | | // 获取用户 |
| | | dangerReportSUPO.setCreateUserName(encodeCreateUserName); |
| | |
| | | <result property="cityName" column="cityName"/> |
| | | <result property="county" column="county"/> |
| | | <result property="countyName" column="countyName"/> |
| | | <result property="engScal" column="engScal"/> |
| | | <result property="resRegCode" column="resRegCode"/> |
| | | <result property="town" column="town"/> |
| | | <result property="townName" column="townName"/> |
| | | <result property="materialsType" column="MATERIALS_TYPE"/> |
| | |
| | | |
| | | <select id="selectMyPage" resultMap="vo"> |
| | | SELECT MM.*, |
| | | aab1."ad_name" cityName, |
| | | aab2."ad_name" countyName, |
| | | aab3."ad_name" townName, |
| | | arb."res_reg_code" as resRegCode,arb."eng_scal" as engScal, |
| | | case when b."ad_grad" = 4 THEN b."ad_name" ELSE NULL |
| | | END AS townName, |
| | | case when b."ad_grad" = 3 THEN b."ad_name" |
| | | when c."ad_grad" = 3 THEN c."ad_name" |
| | | END AS countyName, |
| | | case when b."ad_grad" = 2 THEN b."ad_name" |
| | | when c."ad_grad" = 2 THEN c."ad_name" |
| | | ELSE d."ad_name" END AS cityName, |
| | | BDB.DICT_VALUE materialTypeName |
| | | FROM SM_MATERIALS_MANAGE MM |
| | | LEFT JOIN SJZT_MD."att_ad_base" aab1 ON aab1."guid" = MM.city |
| | | LEFT JOIN SJZT_MD."att_ad_base" aab2 ON aab2."guid" = MM.county |
| | | LEFT JOIN SJZT_MD."att_ad_base" aab3 ON aab3."guid" = MM.town |
| | | LEFT JOIN SJZT_MD."att_res_base" arb ON MM.res_guid = arb."guid" |
| | | LEFT JOIN SJZT_MD."att_ad_base" b ON arb."interior_ad_guid" = b."guid" |
| | | LEFT JOIN SJZT_MD."att_ad_base" c ON b."p_ad_code" = c."guid" |
| | | LEFT JOIN SJZT_MD."att_ad_base" d ON c."p_ad_code" = d."guid" |
| | | LEFT JOIN BLADE_DICT_BIZ BDB ON MM.MATERIALS_TYPE = BDB.DICT_KEY |
| | | WHERE MM.IS_DELETED = 0 AND BDB.CODE='MATERIALS_TYPE' |
| | | <if test="vo.resName !=null and vo.resName !=''"> |
| | |
| | | <!--namespace根据自己需要创建的的mapper的路径和名称填写--> |
| | | <select id="selectMyPage" resultType="cn.gistack.sm.materials.vo.RescueTeamManageVO"> |
| | | SELECT RM.*, |
| | | aab1."ad_name" cityName, |
| | | aab2."ad_name" countyName, |
| | | aab3."ad_name" townName |
| | | arb."res_reg_code" as resRegCode,arb."eng_scal" as engScal, |
| | | case when b."ad_grad" = 4 THEN b."ad_name" ELSE NULL |
| | | END AS townName, |
| | | case when b."ad_grad" = 3 THEN b."ad_name" |
| | | when c."ad_grad" = 3 THEN c."ad_name" |
| | | END AS countyName, |
| | | case when b."ad_grad" = 2 THEN b."ad_name" |
| | | when c."ad_grad" = 2 THEN c."ad_name" |
| | | ELSE d."ad_name" END AS cityName |
| | | FROM SM_RESCUETEAM_MANAGE RM |
| | | LEFT JOIN SJZT_MD."att_ad_base" aab1 ON aab1."guid" = RM.city |
| | | LEFT JOIN SJZT_MD."att_ad_base" aab2 ON aab2."guid" = RM.county |
| | | LEFT JOIN SJZT_MD."att_ad_base" aab3 ON aab3."guid" = RM.town |
| | | LEFT JOIN SJZT_MD."att_res_base" arb ON RM.res_guid = arb."guid" |
| | | LEFT JOIN SJZT_MD."att_ad_base" b ON arb."interior_ad_guid" = b."guid" |
| | | LEFT JOIN SJZT_MD."att_ad_base" c ON b."p_ad_code" = c."guid" |
| | | LEFT JOIN SJZT_MD."att_ad_base" d ON c."p_ad_code" = d."guid" |
| | | WHERE RM.IS_DELETED = 0 |
| | | <if test="vo.resName !=null and vo.resName !=''"> |
| | | AND RM.RES_NAME LIKE CONCAT('%',#{vo.resName},'%') |
| | |
| | | public class MaterialsManageVO extends MaterialsManage { |
| | | |
| | | /** |
| | | * 水库注册码 |
| | | */ |
| | | private String resRegCode; |
| | | |
| | | /** |
| | | * 工程规模 |
| | | */ |
| | | private String engScal; |
| | | |
| | | /** |
| | | * 市名 |
| | | */ |
| | | private String cityName; |
| | |
| | | @Data |
| | | public class RescueTeamManageVO extends RescueTeamManage { |
| | | |
| | | /** |
| | | * 水库注册码 |
| | | */ |
| | | private String resRegCode; |
| | | |
| | | /** |
| | | * 工程规模 |
| | | */ |
| | | private String engScal; |
| | | |
| | | /** |
| | | * 市名 |
| | | */ |
| | |
| | | <if test="messageRecord.source!=null and messageRecord.source!=''"> |
| | | and source = #{messageRecord.source} |
| | | </if> |
| | | |
| | | <if test="messageRecord.createTime != null"> |
| | | AND DATE_FORMAT(create_time,'%Y-%m-%d') = DATE_FORMAT(#{messageRecord.createTime},'%Y-%m-%d') |
| | | </if> |
| | | |
| | | |
| | | ORDER BY ID DESC |
| | | </select> |
| | | </mapper> |
| | |
| | | package cn.gistack.sm.patrol.feign; |
| | | |
| | | import cn.gistack.sm.intelligentCall.constant.ZtConstant; |
| | | import cn.gistack.sm.intelligentCall.service.CallService; |
| | | import cn.gistack.sm.patrol.entity.PatrolTask; |
| | | import cn.gistack.sm.patrol.service.IPatrolTaskService; |
| | | import cn.gistack.sm.sjztmd.entity.PatrolResponsiblePerson; |
| | | import cn.gistack.sm.sjztmd.service.IAttResManagePersonService; |
| | | import com.alibaba.fastjson.JSON; |
| | | import com.alibaba.fastjson.JSONArray; |
| | | import com.alibaba.fastjson.JSONObject; |
| | | import lombok.AllArgsConstructor; |
| | | import lombok.extern.slf4j.Slf4j; |
| | | import org.springblade.core.tenant.annotation.NonDS; |
| | | import org.springblade.core.tool.utils.DateUtil; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.http.HttpEntity; |
| | | import org.springframework.http.HttpHeaders; |
| | | import org.springframework.http.HttpMethod; |
| | | import org.springframework.http.ResponseEntity; |
| | | import org.springframework.util.MultiValueMap; |
| | | import org.springframework.web.bind.annotation.GetMapping; |
| | | import org.springframework.web.bind.annotation.RestController; |
| | | import org.springframework.web.client.RestTemplate; |
| | | import springfox.documentation.annotations.ApiIgnore; |
| | | |
| | | import java.util.ArrayList; |
| | | import java.util.Date; |
| | | import java.util.List; |
| | | import java.util.Map; |
| | | import java.util.concurrent.atomic.AtomicInteger; |
| | | |
| | | /** |
| | |
| | | @Slf4j |
| | | public class PatrolTaskImplClient implements PatrolTaskClient { |
| | | |
| | | //本地测试 |
| | | private static final String LOCAL = "https://sk.hubeishuiyi.cn"; |
| | | //线上 |
| | | private static final String ONLINE = "http://10.42.6.192"; |
| | | private final IPatrolTaskService patrolTaskService; |
| | | |
| | | private final IAttResManagePersonService attResManagePersonService; |
| | | |
| | | @Autowired |
| | | private RestTemplate restTemplate; |
| | | |
| | | /** |
| | | * 超汛限(包含汛限值0) |
| | | */ |
| | | private static final String GET_OVER_RZ =ONLINE + "/services/1234567890ABCDEFGHIJKLMN/over_z_last/patr_person/api?start_over=0&pageNo=1&pageSize=2000"; |
| | | /** |
| | | * 病险水库 |
| | | */ |
| | | private static final String GET_ILL_RESERVOIR =ONLINE + "/services/1234567890ABCDEFGHIJKLMN/res/main_st/rsvr?eng_scal=&res_nm=&is_danger=true&res_cds=&is_video=&flag=&data_sta=&gate=&is_order=1&label=&bas_nm=&pageNo=1&pageSize=10000"; |
| | | |
| | | |
| | | /** |
| | | * 给巡查责任人定时创建任务执行器 |
| | |
| | | String title, |
| | | String content) { |
| | | List<PatrolResponsiblePerson> patrolResponsiblePersonList = attResManagePersonService.getPatrolResponsiblePersonAll(); |
| | | List<Integer> taskJob = createTaskJob(processDefinitionId, taskType, title, content, patrolResponsiblePersonList); |
| | | return taskJob; |
| | | } |
| | | |
| | | @Override |
| | | @GetMapping(CREATE_TASK_JOB_BY_CONDITION_HANDLER) |
| | | public List<Integer> createTaskJobByConditionHandler(String processDefinitionId, String taskType, String title, String content) { |
| | | |
| | | List<String> reservoirList = new ArrayList<>(); |
| | | |
| | | //获取病险水库数据 |
| | | JSONArray overList = apiRequestResult(null, GET_OVER_RZ); |
| | | for (int i = 0; i < overList.size(); i++) { |
| | | JSONObject reservoir = overList.getJSONObject(i); |
| | | reservoirList.add(reservoir.getString("res_cd")); |
| | | } |
| | | |
| | | JSONArray illList = apiRequestData(null, GET_ILL_RESERVOIR); |
| | | for (int i = 0; i < illList.size(); i++) { |
| | | JSONObject reservoir = illList.getJSONObject(i); |
| | | reservoirList.add(reservoir.getString("res_cd")); |
| | | } |
| | | |
| | | List<PatrolResponsiblePerson> patrolResponsiblePersonList = attResManagePersonService.getPatrolResponsiblePersonByResCdList(reservoirList); |
| | | |
| | | List<Integer> taskJob = createTaskJob(processDefinitionId, taskType, title, content, patrolResponsiblePersonList); |
| | | |
| | | return taskJob; |
| | | } |
| | | |
| | | |
| | | /** |
| | | * 请求中台接口,返回resultList结果集 |
| | | * @param params |
| | | * @return |
| | | */ |
| | | private JSONArray apiRequestResult(Map<String, Object> params,String url) { |
| | | //设置请求头 |
| | | HttpHeaders headers = new HttpHeaders(); |
| | | headers.add(ZtConstant.header_key, ZtConstant.header_value); |
| | | //封装请求头 |
| | | HttpEntity<MultiValueMap<String, Object>> formEntity = new HttpEntity<MultiValueMap<String, Object>>(headers); |
| | | try { |
| | | //有请求头,有参数请求 |
| | | ResponseEntity<String> responseEntity = |
| | | restTemplate.exchange(url, |
| | | HttpMethod.GET, |
| | | formEntity, |
| | | String.class); |
| | | JSONObject jsonObject = JSON.parseObject(responseEntity.getBody()); |
| | | JSONArray jsonArray = JSONArray.parseArray(jsonObject.get("resultList").toString()); |
| | | // 返回 |
| | | return jsonArray; |
| | | } catch (Exception e) { |
| | | e.printStackTrace(); |
| | | } |
| | | return null; |
| | | } |
| | | |
| | | /** |
| | | * 请求中台接口,返回data结果集 |
| | | * @param params |
| | | * @return |
| | | */ |
| | | private JSONArray apiRequestData(Map<String, Object> params,String url) { |
| | | //设置请求头 |
| | | HttpHeaders headers = new HttpHeaders(); |
| | | headers.add(ZtConstant.header_key, ZtConstant.header_value); |
| | | //封装请求头 |
| | | HttpEntity<MultiValueMap<String, Object>> formEntity = new HttpEntity<MultiValueMap<String, Object>>(headers); |
| | | try { |
| | | //有请求头,有参数请求 |
| | | ResponseEntity<String> responseEntity = |
| | | restTemplate.exchange(url, |
| | | HttpMethod.GET, |
| | | formEntity, |
| | | String.class); |
| | | JSONObject jsonObject = JSON.parseObject(responseEntity.getBody()); |
| | | JSONObject data = JSON.parseObject(jsonObject.get("data").toString()); |
| | | |
| | | JSONArray dataList = data.getJSONArray("data"); |
| | | |
| | | // 返回 |
| | | return dataList; |
| | | } catch (Exception e) { |
| | | e.printStackTrace(); |
| | | } |
| | | return null; |
| | | } |
| | | |
| | | |
| | | |
| | | /** |
| | | * 创建任务的方法 |
| | | * @param processDefinitionId |
| | | * @param taskType |
| | | * @param title |
| | | * @param content |
| | | * @param patrolResponsiblePersonList |
| | | * @return |
| | | */ |
| | | public List<Integer> createTaskJob(String processDefinitionId, |
| | | String taskType, |
| | | String title, |
| | | String content,List<PatrolResponsiblePerson> patrolResponsiblePersonList){ |
| | | AtomicInteger failureCount = new AtomicInteger(); |
| | | patrolResponsiblePersonList.forEach(item -> { |
| | | log.info("当前创建任务对象:" + JSON.toJSONString(item)); |
| | |
| | | // 返回 |
| | | return list; |
| | | } |
| | | |
| | | |
| | | } |
| New file |
| | |
| | | package cn.gistack.sm.point.controller; |
| | | |
| | | |
| | | import cn.gistack.sm.point.entity.Point; |
| | | import cn.gistack.sm.point.service.PointService; |
| | | import cn.gistack.sm.point.vo.PointVO; |
| | | import com.baomidou.mybatisplus.core.metadata.IPage; |
| | | import io.swagger.annotations.ApiOperation; |
| | | import lombok.AllArgsConstructor; |
| | | import org.springblade.core.mp.support.Condition; |
| | | import org.springblade.core.mp.support.Query; |
| | | import org.springblade.core.tool.api.R; |
| | | import org.springframework.web.bind.annotation.*; |
| | | |
| | | import java.util.Arrays; |
| | | import java.util.Date; |
| | | |
| | | /** |
| | | * 点位控制层 |
| | | * @author zhongrj |
| | | * @date 2023-09-23 |
| | | */ |
| | | @RestController |
| | | @AllArgsConstructor |
| | | @RequestMapping("/point/point") |
| | | public class PointController { |
| | | |
| | | private final PointService pointService; |
| | | |
| | | /** |
| | | * 分页列表查询 |
| | | * |
| | | * @param point |
| | | * @return |
| | | */ |
| | | @ApiOperation(value="点位-分页列表查询", notes="点位-分页列表查询") |
| | | @GetMapping(value = "/list") |
| | | public R queryPageList(Point point, Query query) { |
| | | IPage<Point> pageList = pointService.page(Condition.getPage(query), Condition.getQueryWrapper(point)); |
| | | return R.data(pageList); |
| | | } |
| | | |
| | | /** |
| | | * 自定义分页列表查询 |
| | | * @param query |
| | | * @param point |
| | | * @return |
| | | */ |
| | | @ApiOperation(value="点位-自定义分页列表查询", notes="点位-自定义分页列表查询") |
| | | @GetMapping(value = "/page") |
| | | public R page(PointVO point, Query query) { |
| | | return R.data( pointService.selectPointPage(Condition.getPage(query),point)); |
| | | } |
| | | |
| | | /** |
| | | * 添加 |
| | | * |
| | | * @param point |
| | | * @return |
| | | */ |
| | | @ApiOperation(value="点位-添加", notes="点位-添加") |
| | | @PostMapping(value = "/add") |
| | | public R add(@RequestBody Point point) { |
| | | point.setCreateTime(new Date()); |
| | | return R.data(pointService.save(point)); |
| | | } |
| | | |
| | | /** |
| | | * 编辑 |
| | | * |
| | | * @param point |
| | | * @return |
| | | */ |
| | | @ApiOperation(value="点位-编辑", notes="点位-编辑") |
| | | @RequestMapping(value = "/edit", method = {RequestMethod.PUT,RequestMethod.POST}) |
| | | public R edit(@RequestBody Point point) { |
| | | return R.data(pointService.updateById(point)); |
| | | } |
| | | |
| | | /** |
| | | * 通过id删除 |
| | | * |
| | | * @param id |
| | | * @return |
| | | */ |
| | | @ApiOperation(value="点位-通过id删除", notes="点位-通过id删除") |
| | | @PostMapping(value = "/delete") |
| | | public R delete(@RequestParam(name="id",required=true) String id) { |
| | | return R.data(pointService.removeById(id)); |
| | | } |
| | | |
| | | /** |
| | | * 批量删除 |
| | | * |
| | | * @param ids |
| | | * @return |
| | | */ |
| | | @ApiOperation(value="点位-批量删除", notes="点位-批量删除") |
| | | @PostMapping(value = "/deleteBatch") |
| | | public R deleteBatch(@RequestParam(name="ids",required=true) String ids) { |
| | | return R.data(this.pointService.removeByIds(Arrays.asList(ids.split(",")))); |
| | | } |
| | | |
| | | /** |
| | | * 通过id查询 |
| | | * |
| | | * @param id |
| | | * @return |
| | | */ |
| | | @ApiOperation(value="点位-通过id查询", notes="点位-通过id查询") |
| | | @GetMapping(value = "/queryById") |
| | | public R queryById(@RequestParam(name="id",required=true) String id) { |
| | | Point point = pointService.getById(id); |
| | | return R.data(point); |
| | | } |
| | | |
| | | |
| | | /** |
| | | * 通过图片id删除 |
| | | * @param id |
| | | * @return |
| | | */ |
| | | @ApiOperation(value="点位-通过图片id删除", notes="点位-通过图片id删除") |
| | | @PostMapping(value = "/deleteByPicId") |
| | | public R deleteByPicId(@RequestParam(name="id",required=true) String id) { |
| | | return R.data(pointService.deleteByPicId(id)); |
| | | } |
| | | |
| | | } |
| New file |
| | |
| | | package cn.gistack.sm.point.entity; |
| | | |
| | | 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 io.swagger.annotations.ApiModelProperty; |
| | | import lombok.Data; |
| | | import lombok.EqualsAndHashCode; |
| | | import lombok.experimental.Accessors; |
| | | import org.springframework.format.annotation.DateTimeFormat; |
| | | |
| | | import java.util.Date; |
| | | |
| | | /** |
| | | * 点位 |
| | | * |
| | | * @author zhongrj |
| | | * @date 2023-09-23 |
| | | */ |
| | | @Data |
| | | @TableName(value = "sm_point") |
| | | @EqualsAndHashCode(callSuper = false) |
| | | @Accessors(chain = true) |
| | | public class Point { |
| | | |
| | | /** |
| | | * id |
| | | */ |
| | | @ApiModelProperty(value = "id") |
| | | @TableId(value = "id",type = IdType.ASSIGN_ID) |
| | | private Long id; |
| | | |
| | | /** |
| | | * 水库编号 |
| | | */ |
| | | @ApiModelProperty(value = "水库编号") |
| | | private String resGuid; |
| | | |
| | | /** |
| | | * 测点名称 |
| | | */ |
| | | @ApiModelProperty(value = "测点名称") |
| | | private String name; |
| | | |
| | | /** |
| | | * 测点类型 |
| | | */ |
| | | @ApiModelProperty(value = "测点类型") |
| | | private String type; |
| | | |
| | | /** |
| | | * 图片id,关联考证表id |
| | | */ |
| | | @ApiModelProperty(value = "图片id,关联考证表id") |
| | | private String picId; |
| | | |
| | | /** |
| | | * x |
| | | */ |
| | | @ApiModelProperty(value = "x") |
| | | private String x; |
| | | |
| | | /** |
| | | * y |
| | | */ |
| | | @ApiModelProperty(value = "y") |
| | | private String y; |
| | | |
| | | /** |
| | | * 创建时间 |
| | | */ |
| | | @JsonFormat(timezone = "GMT+8", pattern = "yyyy-MM-dd HH:mm:ss") |
| | | @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss") |
| | | @ApiModelProperty(value = "创建时间") |
| | | private Date createTime; |
| | | } |
| New file |
| | |
| | | package cn.gistack.sm.point.mapper; |
| | | |
| | | |
| | | import cn.gistack.sm.point.entity.Point; |
| | | import cn.gistack.sm.point.vo.PointVO; |
| | | import com.baomidou.mybatisplus.core.mapper.BaseMapper; |
| | | import com.baomidou.mybatisplus.core.metadata.IPage; |
| | | import org.apache.ibatis.annotations.Param; |
| | | |
| | | import java.util.List; |
| | | |
| | | /** |
| | | * 点位详情mapper映射层 |
| | | * @author zhongrj |
| | | * @date 2023-05-29 |
| | | */ |
| | | public interface PointMapper extends BaseMapper<Point> { |
| | | |
| | | /** |
| | | * 自定义分页列表查询 |
| | | * @param page |
| | | * @param point |
| | | * @return |
| | | */ |
| | | List<PointVO> selectPointPage(IPage<PointVO> page, @Param("point") PointVO point); |
| | | |
| | | /** |
| | | * 删除考证表附件信息 |
| | | * @param id |
| | | */ |
| | | int deletePicByPicAttach(@Param("id") String id); |
| | | } |
| New file |
| | |
| | | <?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="cn.gistack.sm.point.mapper.PointMapper"> |
| | | |
| | | <!--自定义分页列表查询--> |
| | | <select id="selectPointPage" resultType="cn.gistack.sm.point.vo.PointVO"> |
| | | select * from sm_point |
| | | where 1=1 |
| | | <if test="point.resGuid!=null and point.resGuid!=''"> |
| | | and res_guid like concat('%',#{point.resGuid},'%') |
| | | </if> |
| | | <if test="point.name!=null and point.name!=''"> |
| | | and name like concat('%',#{point.name},'%') |
| | | </if> |
| | | <if test="point.type!=null"> |
| | | and type = #{point.type} |
| | | </if> |
| | | <if test="point.picId!=null and point.picId!=''"> |
| | | and pic_id = #{point.picId} |
| | | </if> |
| | | </select> |
| | | |
| | | <!--删除考证表附件信息--> |
| | | <delete id="deletePicByPicAttach"> |
| | | delete from sm_textual_research_attach where id = #{id} |
| | | </delete> |
| | | |
| | | </mapper> |
| New file |
| | |
| | | package cn.gistack.sm.point.service; |
| | | |
| | | |
| | | import cn.gistack.sm.point.entity.Point; |
| | | import cn.gistack.sm.point.vo.PointVO; |
| | | import com.baomidou.mybatisplus.core.metadata.IPage; |
| | | import com.baomidou.mybatisplus.extension.service.IService; |
| | | |
| | | /** |
| | | * 点位服务层 |
| | | * @author zhongrj |
| | | * @date 2023-09-23 |
| | | */ |
| | | public interface PointService extends IService<Point> { |
| | | |
| | | /** |
| | | * 自定义分页列表查询 |
| | | * @param page |
| | | * @param point |
| | | * @return |
| | | */ |
| | | Object selectPointPage(IPage<PointVO> page, PointVO point); |
| | | |
| | | /** |
| | | * 通过图片id删除 |
| | | * @param id |
| | | * @return |
| | | */ |
| | | Boolean deleteByPicId(String id); |
| | | } |
| New file |
| | |
| | | package cn.gistack.sm.point.service.impl; |
| | | |
| | | |
| | | import cn.gistack.sm.point.entity.Point; |
| | | import cn.gistack.sm.point.mapper.PointMapper; |
| | | import cn.gistack.sm.point.service.PointService; |
| | | import cn.gistack.sm.point.vo.PointVO; |
| | | import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; |
| | | import com.baomidou.mybatisplus.core.metadata.IPage; |
| | | import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; |
| | | import org.springframework.stereotype.Service; |
| | | import org.springframework.transaction.annotation.Transactional; |
| | | |
| | | /** |
| | | * 点位服务实现层 |
| | | * @author zhongrj |
| | | * @date 2023-09-23 |
| | | */ |
| | | @Service |
| | | public class PointServiceImpl extends ServiceImpl<PointMapper, Point> implements PointService { |
| | | |
| | | /** |
| | | * 自定义分页列表查询 |
| | | * @param page |
| | | * @param point |
| | | * @return |
| | | */ |
| | | @Override |
| | | public IPage<PointVO> selectPointPage(IPage<PointVO> page, PointVO point) { |
| | | return page.setRecords(baseMapper.selectPointPage(page,point)); |
| | | } |
| | | |
| | | /** |
| | | * 通过图片id删除 |
| | | * @param id |
| | | * @return |
| | | */ |
| | | @Override |
| | | @Transactional(rollbackFor = Exception.class) |
| | | public Boolean deleteByPicId(String id) { |
| | | Boolean flag = false; |
| | | // 先删除图片附件 |
| | | int i = baseMapper.deletePicByPicAttach(id); |
| | | // 在删除对应的点位数据 |
| | | if(i>0){ |
| | | QueryWrapper<Point> wrapper = new QueryWrapper<>(); |
| | | wrapper.eq("pic_id",id); |
| | | int delete = baseMapper.delete(wrapper); |
| | | if (delete>0){ |
| | | flag = true; |
| | | } |
| | | } |
| | | return flag; |
| | | } |
| | | } |
| New file |
| | |
| | | package cn.gistack.sm.point.vo; |
| | | |
| | | import cn.gistack.sm.point.entity.Point; |
| | | import lombok.Data; |
| | | |
| | | @Data |
| | | public class PointVO extends Point { |
| | | } |
| | |
| | | */ |
| | | @ApiModelProperty(value = "巡查责任人-职务") |
| | | private String patrolPosition; |
| | | |
| | | /** |
| | | * 巡查责任人-所属单位 |
| | | */ |
| | | @ApiModelProperty(value = "巡查责任人-所属单位") |
| | | private String patrolUnitName; |
| | | |
| | | /** |
| | | * 市州名称 |
| | | */ |
| | | @ApiModelProperty(value = "市州名称") |
| | | private String cityName; |
| | | |
| | | /** |
| | | * 区县名称 |
| | | */ |
| | | @ApiModelProperty(value = "区县名称") |
| | | private String countyName; |
| | | |
| | | /** |
| | | * 乡镇名称 |
| | | */ |
| | | @ApiModelProperty(value = "乡镇名称") |
| | | private String townName; |
| | | |
| | | } |
| | |
| | | private String resGuid; |
| | | |
| | | /** |
| | | * 运行状态 |
| | | */ |
| | | @ApiModelProperty(value = "运行状态") |
| | | @TableField("\"run_status\"") |
| | | private String runStatus; |
| | | |
| | | /** |
| | | * 是否有水雨情测报雨量 |
| | | */ |
| | | @ApiModelProperty(value = "是否有水雨情测报雨量") |
| | |
| | | private Integer ocType; |
| | | |
| | | /** |
| | | * 启闭动力 |
| | | */ |
| | | @ApiModelProperty(value = "启闭动力") |
| | | @TableField("\"oc_power\"") |
| | | private String ocPower; |
| | | |
| | | /** |
| | | * 消能方式 |
| | | */ |
| | | @ApiModelProperty(value = "消能方式") |
| | |
| | | private String ocType; |
| | | |
| | | /** |
| | | * 启闭动力 |
| | | */ |
| | | @ApiModelProperty(value = "启闭动力") |
| | | @TableField("\"oc_power\"") |
| | | private String ocPower; |
| | | |
| | | /** |
| | | * 填报状态(0:填写中,1:审核中,2:审核通过) |
| | | */ |
| | | @ApiModelProperty(value = "填报状态(0:填写中,1:审核中,2:审核通过) ") |
| | |
| | | private String ocType; |
| | | |
| | | /** |
| | | * 启闭动力 |
| | | */ |
| | | @ApiModelProperty(value = "启闭动力") |
| | | @TableField("\"oc_power\"") |
| | | private String ocPower; |
| | | |
| | | /** |
| | | * 输水道是否穿过坝体 |
| | | */ |
| | | @ApiModelProperty(value = "输水道是否穿过坝体") |
| | | @TableField("\"is_across_dam_body\"") |
| | | private String isAcrossDamBody; |
| | | |
| | | /** |
| | | * 填报状态(0:填写中,1:审核中,2:审核通过) |
| | | */ |
| | | @ApiModelProperty(value = "填报状态(0:填写中,1:审核中,2:审核通过) ") |
| | |
| | | private String constructionPeriodDataPath; |
| | | |
| | | /** |
| | | * 除险加固资料路径 |
| | | * 改扩建资料 |
| | | */ |
| | | @ApiModelProperty(value = "除险加固资料路径") |
| | | @ApiModelProperty(value = "改扩建资料") |
| | | @TableField("\"reconstruction_and_expansion_data\"") |
| | | private String reconstructionAndExpansionData; |
| | | |
| | | /** |
| | | * 安全鉴定资料路径 |
| | | */ |
| | | @ApiModelProperty(value = "安全鉴定资料路径") |
| | | @TableField("\"safety_appraisal_data_path\"") |
| | | private String safetyAppraisalDataPath; |
| | | |
| | | /** |
| | | * 除险加固报告资料路径 |
| | | */ |
| | | @ApiModelProperty(value = "除险加固报告资料路径") |
| | | @TableField("\"reinforce_data_path\"") |
| | | private String reinforceDataPath; |
| | | |
| | | /** |
| | | * 第一次除险加固资料路径 |
| | | * 除险加固批复资料路径 |
| | | */ |
| | | @ApiModelProperty(value = "第一次除险加固资料路径") |
| | | @TableField("\"first_reinforce_data_path\"") |
| | | private String firstReinforceDataPath; |
| | | @ApiModelProperty(value = "除险加固批复资料路径") |
| | | @TableField("\"reinforce_approval_path\"") |
| | | private String reinforceApprovalPath; |
| | | |
| | | /** |
| | | * 第二次除险加固资料路径 |
| | | * 调度规程资料路径 |
| | | */ |
| | | @ApiModelProperty(value = "第二次除险加固资料路径") |
| | | @TableField("\"second_reinforce_data_path\"") |
| | | private String secondReinforceDataPath; |
| | | @ApiModelProperty(value = "调度规程资料路径") |
| | | @TableField("\"dispatch_regulation_data_path\"") |
| | | private String dispatchRegulationDataPath; |
| | | |
| | | /** |
| | | * 第三次除险加固资料路径 |
| | | * 调度规程批复资料路径 |
| | | */ |
| | | @ApiModelProperty(value = "第三次除险加固资料路径") |
| | | @TableField("\"third_reinforce_data_path\"") |
| | | private String thirdReinforceDataPath; |
| | | @ApiModelProperty(value = "调度规程批复资料路径") |
| | | @TableField("\"dispatch_regulation_approval_path\"") |
| | | private String dispatchRegulationApprovalPath; |
| | | |
| | | /** |
| | | * 日常运行管理资料路径 |
| | |
| | | private String waterAerialView; |
| | | |
| | | /** |
| | | * 其他资料路径 |
| | | */ |
| | | @ApiModelProperty(value = "其他资料路径") |
| | | @TableField("\"other_data_path\"") |
| | | private String otherDataPath; |
| | | |
| | | /** |
| | | * 填报状态(0:填写中,1:审核中,2:审核通过) |
| | | */ |
| | | @ApiModelProperty(value = "填报状态(0:填写中,1:审核中,2:审核通过) ") |
| | |
| | | package cn.gistack.sm.sjztmd.mapper; |
| | | |
| | | import cn.gistack.common.node.TreeNode; |
| | | import cn.gistack.sm.sjztmd.vo.PersonVO; |
| | | import cn.gistack.sm.sjztmd.entity.AttAdBase; |
| | | import cn.gistack.sm.sjztmd.vo.AttAdBaseVO; |
| | | import cn.gistack.sm.sjztmd.vo.PersonVO; |
| | | import com.baomidou.mybatisplus.core.mapper.BaseMapper; |
| | | import org.apache.ibatis.annotations.MapKey; |
| | | import org.apache.ibatis.annotations.Param; |
| | | import org.springframework.web.bind.annotation.PostMapping; |
| | | |
| | | import java.util.List; |
| | | import java.util.Map; |
| | |
| | | <select id="getAttResBaseUserPage" resultType="cn.gistack.sm.sjztmd.dto.AttResBaseUserDTO"> |
| | | select |
| | | arb."guid", arb."name", arb."res_loc" as place, arb."res_reg_code" as resRegCode, arb."eng_scal" as engScal, |
| | | REGEXP_SUBSTR (arb."res_loc",'[^-]+',1,2) as cityName, |
| | | REGEXP_SUBSTR (arb."res_loc",'[^-]+',1,3) as countyName, |
| | | REGEXP_SUBSTR (arb."res_loc",'[^-]+',1,4) as townName, |
| | | aab."ad_name" as adName, |
| | | trmp1."user_unit" areaUnitName,trmp1."user_name" areaUsername,trmp1."user_phone" areaPhone,trmp1."position" areaPosition,trmp1."guid" areaUserGuid, |
| | | trmp2."user_unit" customsUnitName,trmp2."user_name" customsUsername,trmp2."user_phone" customsPhone,trmp2."position" customsPosition,trmp2."guid" customsUserGuid, |
| | |
| | | package cn.gistack.sm.sjztmd.mapper; |
| | | |
| | | import cn.gistack.sm.intelligentCall.entity.Scene; |
| | | import cn.gistack.sm.sjztmd.entity.AttResManagePerson; |
| | | import cn.gistack.sm.sjztmd.entity.PatrolResponsiblePerson; |
| | | import cn.gistack.sm.sjztmd.vo.PersonVO; |
| | |
| | | List<PersonVO> getCityCountyPersonListByResGuid(@Param("adCode") String res_cd, |
| | | @Param("roleAlias") String roleAlias, |
| | | @Param("type") String type); |
| | | |
| | | List<PatrolResponsiblePerson> getPatrolResponsiblePersonByResCdList(@Param("ids") List<String> reservoirList); |
| | | |
| | | /** |
| | | * 通过水库代码获取水库及巡查责任人信息 |
| | | * @param list |
| | | * @return |
| | | */ |
| | | @DS("zt") |
| | | Set<Scene> getPatrolPersonListByWaterCodeList(@Param("list") List<String> list); |
| | | } |
| | |
| | | group by b."user_phone" |
| | | </select> |
| | | |
| | | <!--通过水库代码获取巡查责任人及技术责任人手机号--> |
| | | <select id="getPatrolPersonListByWaterCodeList" resultType="cn.gistack.sm.intelligentCall.entity.Scene"> |
| | | SELECT |
| | | a."guid" as waterCode, |
| | | a."name" as waterName, |
| | | b."user_name" as username, |
| | | b."user_phone" as userId, |
| | | b."user_phone" as phone |
| | | FROM SJZT_MD."att_res_base" a |
| | | LEFT JOIN SJZT_MD."att_res_manage_person" b ON a."guid" = b."res_guid" |
| | | where 1=1 and b."type" = 5 |
| | | <choose> |
| | | <when test="list!=null and list.size()>0"> |
| | | and "sk_code" in |
| | | <foreach collection="list" item="id" open="(" close=")" separator=","> |
| | | #{id} |
| | | </foreach> |
| | | </when> |
| | | <otherwise> |
| | | and "sk_code" in ('') |
| | | </otherwise> |
| | | </choose> |
| | | </select> |
| | | |
| | | <!--根据水库编号查询市县水利部人员姓名及联系方式--> |
| | | <select id="getCityCountyPersonListByResGuid" resultType="cn.gistack.sm.sjztmd.vo.PersonVO"> |
| | | select real_name as name,phone,#{type} as type from YWXT.blade_user bu |
| | |
| | | and bd.ad_code = #{adCode} |
| | | limit 3 |
| | | </select> |
| | | <select id="getPatrolResponsiblePersonByResCdList" |
| | | resultType="cn.gistack.sm.sjztmd.entity.PatrolResponsiblePerson"> |
| | | |
| | | select DISTINCT a."res_guid", c."name", b.id as user_id |
| | | from "SJZT_MD"."att_res_manage_person" a, |
| | | "BLADE_USER" b, |
| | | "SJZT_MD"."att_res_base" c |
| | | WHERE a."user_phone" = b.PHONE |
| | | and a."res_guid" = c."guid" |
| | | and a."type" = 5 |
| | | <choose> |
| | | <when test="ids!=null and ids.size()>0"> |
| | | and "res_guid" in |
| | | <foreach collection="ids" item="id" open="(" close=")" separator=","> |
| | | #{id} |
| | | </foreach> |
| | | </when> |
| | | <otherwise> |
| | | and "res_guid" in ('') |
| | | </otherwise> |
| | | </choose> |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | </select> |
| | | |
| | | </mapper> |
| | |
| | | package cn.gistack.sm.sjztmd.service; |
| | | |
| | | import cn.gistack.sm.intelligentCall.entity.Scene; |
| | | import cn.gistack.sm.sjztmd.entity.AttResManagePerson; |
| | | import cn.gistack.sm.sjztmd.entity.PatrolResponsiblePerson; |
| | | import cn.gistack.sm.sjztmd.vo.PersonVO; |
| | | import cn.gistack.sm.sjztmd.vo.UserPersonVO; |
| | | import com.baomidou.mybatisplus.extension.service.IService; |
| | | import org.springblade.core.tool.api.R; |
| | | |
| | |
| | | * @return |
| | | */ |
| | | List<PersonVO> getCityCountyPersonListByResGuid(String res_cd); |
| | | |
| | | /** |
| | | * 根据水库id集合查询巡查责任人 |
| | | * @param reservoirList |
| | | * @return |
| | | */ |
| | | List<PatrolResponsiblePerson> getPatrolResponsiblePersonByResCdList(List<String> reservoirList); |
| | | |
| | | /** |
| | | * 通过水库代码获取水库及巡查责任人信息 |
| | | * @param stringList |
| | | * @return |
| | | */ |
| | | Set<Scene> getPatrolPersonListByWaterCodeList(List<String> stringList); |
| | | } |
| | |
| | | |
| | | import cn.gistack.common.node.TreeNode; |
| | | import cn.gistack.common.utils.NodeTreeUtil; |
| | | import cn.gistack.sm.sjztmd.vo.PersonVO; |
| | | import cn.gistack.sm.sjztmd.entity.AttAdBase; |
| | | import cn.gistack.sm.sjztmd.mapper.AttAdBaseMapper; |
| | | import cn.gistack.sm.sjztmd.service.IAttAdBaseService; |
| | | import cn.gistack.sm.sjztmd.vo.AttAdBaseVO; |
| | | import cn.gistack.sm.sjztmd.vo.PersonVO; |
| | | import com.baomidou.dynamic.datasource.annotation.DS; |
| | | import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; |
| | | import org.springframework.stereotype.Service; |
| | |
| | | package cn.gistack.sm.sjztmd.service.impl; |
| | | |
| | | import cn.gistack.sm.sjztmd.entity.AttResBase; |
| | | import cn.gistack.sm.intelligentCall.entity.Scene; |
| | | import cn.gistack.sm.sjztmd.entity.AttResManagePerson; |
| | | import cn.gistack.sm.sjztmd.entity.PatrolResponsiblePerson; |
| | | import cn.gistack.sm.sjztmd.mapper.AttResManagePersonMapper; |
| | |
| | | // 返回 |
| | | return personVOList; |
| | | } |
| | | |
| | | @DS("master") |
| | | @Override |
| | | public List<PatrolResponsiblePerson> getPatrolResponsiblePersonByResCdList(List<String> reservoirList) { |
| | | return baseMapper.getPatrolResponsiblePersonByResCdList(reservoirList); |
| | | } |
| | | |
| | | /** |
| | | * 通过水库代码获取水库及巡查责任人信息 |
| | | * @param stringList |
| | | * @return |
| | | */ |
| | | @Override |
| | | public Set<Scene> getPatrolPersonListByWaterCodeList(List<String> stringList) { |
| | | return baseMapper.getPatrolPersonListByWaterCodeList(stringList); |
| | | } |
| | | } |
| New file |
| | |
| | | package cn.gistack.sm.sjztods.controller; |
| | | |
| | | import cn.gistack.sm.sjztmd.excel.AttResStagCapDiscExcel; |
| | | import cn.gistack.sm.sjztmd.excel.AttResStagCapDiscImport; |
| | | import cn.gistack.sm.sjztods.entity.SkxsQkTj; |
| | | import cn.gistack.sm.sjztods.excel.SkxsQkTjExcel; |
| | | import cn.gistack.sm.sjztods.excel.SkxsQkTjImport; |
| | | import cn.gistack.sm.sjztods.service.ISkxsQkTjService; |
| | | import cn.gistack.sm.sjztods.vo.SkxsQkTjVO; |
| | | import io.swagger.annotations.Api; |
| | | import io.swagger.annotations.ApiOperation; |
| | | import lombok.AllArgsConstructor; |
| | | import lombok.extern.slf4j.Slf4j; |
| | | import org.springblade.core.excel.util.ExcelUtil; |
| | | import org.springblade.core.mp.support.Condition; |
| | | import org.springblade.core.mp.support.Query; |
| | | import org.springblade.core.secure.utils.AuthUtil; |
| | | import org.springblade.core.tool.api.R; |
| | | import org.springblade.core.tool.utils.DateUtil; |
| | | import org.springframework.web.bind.annotation.*; |
| | | import org.springframework.web.multipart.MultipartFile; |
| | | |
| | | import javax.servlet.http.HttpServletResponse; |
| | | import java.util.ArrayList; |
| | | import java.util.Date; |
| | | import java.util.List; |
| | | |
| | | |
| | | /** |
| | | * |
| | | * @ClassName SkxsQkTjController |
| | | * @author zhongrj |
| | | * @date 2023-10-19 |
| | | */ |
| | | @Slf4j |
| | | @Api(tags = "大中型水库蓄水情况统计表") |
| | | @RestController |
| | | @RequestMapping("/sjztods/skxsQkTj") |
| | | @AllArgsConstructor |
| | | public class SkxsQkTjController { |
| | | |
| | | private final ISkxsQkTjService skxsQkTjService; |
| | | |
| | | /** |
| | | * 上报 |
| | | * @param skxsQkTj |
| | | * @return |
| | | */ |
| | | @ApiOperation(value = "大中型水库蓄水情况统计-上报", notes = "大中型水库蓄水情况统计-上报") |
| | | @PostMapping(value = "/exportSkxsQkTj") |
| | | public R exportSkxsQkTj(@RequestBody SkxsQkTj skxsQkTj) { |
| | | return R.status(skxsQkTjService.exportSkxsQkTj(skxsQkTj)); |
| | | } |
| | | |
| | | /** |
| | | * 分页列表数据查询 |
| | | * @param skxsQkTj |
| | | * @param query |
| | | * @return |
| | | */ |
| | | @GetMapping(value = "/page") |
| | | public R page(SkxsQkTjVO skxsQkTj, Query query) { |
| | | return R.data(skxsQkTjService.selectSkxsQkTjPage(Condition.getPage(query), skxsQkTj)); |
| | | } |
| | | |
| | | /** |
| | | * 按行政区统计 |
| | | * @param skxsQkTj |
| | | * @return |
| | | */ |
| | | @ApiOperation(value = "大中型水库蓄水情况统计-按行政区统计", notes = "大中型水库蓄水情况统计-按行政区统计") |
| | | @GetMapping(value = "/getStatisticList") |
| | | public R getStatisticList(SkxsQkTjVO skxsQkTj) { |
| | | return R.data(skxsQkTjService.getStatisticList(skxsQkTj)); |
| | | } |
| | | |
| | | /** |
| | | * 导入 |
| | | * @param file |
| | | * @return |
| | | */ |
| | | @PostMapping("/import-skxsQkTj") |
| | | public R importSkxsQkTj(MultipartFile file) { |
| | | SkxsQkTjImport skxsQkTjImport = new SkxsQkTjImport(skxsQkTjService); |
| | | ExcelUtil.save(file, skxsQkTjImport, SkxsQkTjExcel.class); |
| | | return R.success("操作成功"); |
| | | } |
| | | |
| | | /** |
| | | * 导出 |
| | | * @param skxsQkTj |
| | | */ |
| | | @GetMapping("/export-skxsQkTj") |
| | | public void exportSkxsQkTj(HttpServletResponse response,SkxsQkTjVO skxsQkTj) { |
| | | List<SkxsQkTjExcel> list = skxsQkTjService.exportSkxsQkTjList(skxsQkTj); |
| | | ExcelUtil.export(response, "水库统计数据" + DateUtil.time(), "水库统计数据表", list, SkxsQkTjExcel.class); |
| | | } |
| | | |
| | | } |
| New file |
| | |
| | | package cn.gistack.sm.sjztods.controller; |
| | | |
| | | import cn.gistack.sm.sjztods.entity.ZdxSkZh; |
| | | import cn.gistack.sm.sjztods.service.IZdxSkZhService; |
| | | import io.swagger.annotations.Api; |
| | | import io.swagger.annotations.ApiOperation; |
| | | import lombok.AllArgsConstructor; |
| | | import lombok.extern.slf4j.Slf4j; |
| | | import org.springblade.core.tool.api.R; |
| | | import org.springframework.web.bind.annotation.*; |
| | | |
| | | import java.util.Date; |
| | | |
| | | |
| | | /** |
| | | * |
| | | * @ClassName ZdxSkZhController |
| | | * @author zhongrj |
| | | * @date 2023-10-09 |
| | | */ |
| | | @Slf4j |
| | | @Api(tags = "中大型数据整合填报") |
| | | @RestController |
| | | @RequestMapping("/sjztmd/zdSkZh") |
| | | @AllArgsConstructor |
| | | public class ZdxSkZhController { |
| | | |
| | | private final IZdxSkZhService zdxSkZhService; |
| | | |
| | | /** |
| | | * 新增 |
| | | * @param zdxSkZh |
| | | * @return |
| | | */ |
| | | @ApiOperation(value = "中大型数据整合-新增", notes = "中大型数据整合-新增") |
| | | @PostMapping(value = "/save") |
| | | public R save(@RequestBody ZdxSkZh zdxSkZh) { |
| | | zdxSkZh.setCreateTime(new Date()); |
| | | zdxSkZh.setUpdateTime(new Date()); |
| | | zdxSkZh.setSysResource("zj"); |
| | | return R.status(zdxSkZhService.saveZdxSkZh(zdxSkZh)); |
| | | } |
| | | |
| | | } |
| New file |
| | |
| | | package cn.gistack.sm.sjztods.entity; |
| | | |
| | | import com.baomidou.mybatisplus.annotation.IdType; |
| | | import com.baomidou.mybatisplus.annotation.TableField; |
| | | import com.baomidou.mybatisplus.annotation.TableId; |
| | | import com.baomidou.mybatisplus.annotation.TableName; |
| | | import com.fasterxml.jackson.annotation.JsonFormat; |
| | | import io.swagger.annotations.ApiModel; |
| | | import io.swagger.annotations.ApiModelProperty; |
| | | import lombok.Data; |
| | | import org.springframework.format.annotation.DateTimeFormat; |
| | | |
| | | import java.io.Serializable; |
| | | import java.util.Date; |
| | | |
| | | /** |
| | | * 大中型水库蓄水情况统计表-按水库 |
| | | * @author zhongrj |
| | | * @date 2023-10-18 |
| | | */ |
| | | @Data |
| | | @TableName("\"skxs_qk_tj\"") |
| | | @ApiModel(value = "大中型水库蓄水情况统计表", description = "大中型水库蓄水情况统计表") |
| | | public class SkxsQkTj implements Serializable { |
| | | private static final long serialVersionUID = 1L; |
| | | |
| | | /** |
| | | * 主键 |
| | | */ |
| | | @ApiModelProperty(value = "主键") |
| | | @TableId(value = "\"guid\"",type = IdType.ASSIGN_ID) |
| | | private String guid; |
| | | |
| | | /** |
| | | * 水库编号 |
| | | */ |
| | | @ApiModelProperty(value = "水库编号") |
| | | @TableField("\"res_code\"") |
| | | private String resCode; |
| | | |
| | | /** |
| | | * 水库名称 |
| | | */ |
| | | @ApiModelProperty(value = "水库名称") |
| | | @TableField("\"res_name\"") |
| | | private String resName; |
| | | |
| | | /** |
| | | * 总库容 |
| | | */ |
| | | @ApiModelProperty(value = "总库容") |
| | | @TableField("\"total_cap\"") |
| | | private Double totalCap; |
| | | |
| | | /** |
| | | * 当前水位 |
| | | */ |
| | | @ApiModelProperty(value = "当前水位") |
| | | @TableField("\"rz\"") |
| | | private Double rz; |
| | | |
| | | /** |
| | | * 当日蓄水量 |
| | | */ |
| | | @ApiModelProperty(value = "当日蓄水量") |
| | | @TableField("\"ws\"") |
| | | private Double ws; |
| | | |
| | | /** |
| | | * 上月最后一天蓄水量 |
| | | */ |
| | | @ApiModelProperty(value = "上月最后一天蓄水量") |
| | | @TableField("\"up_month_ws\"") |
| | | private Double upMonthWs; |
| | | |
| | | /** |
| | | * 去年同期蓄水量 |
| | | */ |
| | | @ApiModelProperty(value = "去年同期蓄水量") |
| | | @TableField("\"last_year_ws\"") |
| | | private Double lastYearWs; |
| | | |
| | | /** |
| | | * 历史同期蓄水量 |
| | | */ |
| | | @ApiModelProperty(value = "历史同期蓄水量") |
| | | @TableField("\"his_ws\"") |
| | | private Double hisWs; |
| | | |
| | | /** |
| | | * 今年以来灌溉放水量 |
| | | */ |
| | | @ApiModelProperty(value = "今年以来灌溉放水量") |
| | | @TableField("\"now_year_irr_dw\"") |
| | | private Double nowYearIrrDw; |
| | | |
| | | /** |
| | | * 今年以来生活放水量 |
| | | */ |
| | | @ApiModelProperty(value = "今年以来生活放水量") |
| | | @TableField("\"now_year_live_dw\"") |
| | | private Double nowYearLiveDw; |
| | | |
| | | /** |
| | | * 今年以来生态放水量 |
| | | */ |
| | | @ApiModelProperty(value = "今年以来生态放水量 ") |
| | | @TableField("\"now_year_zoo_dw\"") |
| | | private Double nowYearZooDw; |
| | | |
| | | /** |
| | | * 总蓄水现有-历史 |
| | | */ |
| | | @ApiModelProperty(value = "总蓄水现有-历史 ") |
| | | @TableField("\"total_ws_dif\"") |
| | | private String totalWsDif; |
| | | |
| | | /** |
| | | * 总蓄水较历史同期(%) |
| | | */ |
| | | @ApiModelProperty(value = "总蓄水较历史同期(%)") |
| | | @TableField("\"total_ws_his_pro\"") |
| | | private String totalWsHisPro; |
| | | |
| | | /** |
| | | * 死库容 |
| | | */ |
| | | @ApiModelProperty(value = "死库容") |
| | | @TableField("\"dead_cap\"") |
| | | private Double deadCap; |
| | | |
| | | /** |
| | | * 当前有效蓄水 |
| | | */ |
| | | @ApiModelProperty(value = "当前有效蓄水 ") |
| | | @TableField("\"now_valid_ws\"") |
| | | private Double nowValidWs; |
| | | |
| | | /** |
| | | * 兴利库容 |
| | | */ |
| | | @ApiModelProperty(value = "兴利库容 ") |
| | | @TableField("\"ben_res_cap\"") |
| | | private Double benResCap; |
| | | |
| | | /** |
| | | * 有效蓄水/兴利(%) |
| | | */ |
| | | @ApiModelProperty(value = "有效蓄水/兴利(%) ") |
| | | @TableField("\"valid_ws_ben_pro\"") |
| | | private String validWsBenPro; |
| | | /** |
| | | * 历史同期有效蓄水 |
| | | */ |
| | | @ApiModelProperty(value = "历史同期有效蓄水 ") |
| | | @TableField("\"his_valid_ws\"") |
| | | private Double hisValidWs; |
| | | /** |
| | | * 当前有效比历史同期(%) |
| | | */ |
| | | @ApiModelProperty(value = "当前有效比历史同期(%) ") |
| | | @TableField("\"now_valid_his_pro\"") |
| | | private String nowValidHisPro; |
| | | |
| | | /** |
| | | * 去年有效蓄水 |
| | | */ |
| | | @ApiModelProperty(value = "去年有效蓄水 ") |
| | | @TableField("\"last_year_valid_ws\"") |
| | | private Double lastYearValidWs; |
| | | |
| | | /** |
| | | * 当前有效比去年同期(%) |
| | | */ |
| | | @ApiModelProperty(value = "当前有效比去年同期(%) ") |
| | | @TableField("\"now_valid_last_pro\"") |
| | | private String nowValidLastPro; |
| | | |
| | | /** |
| | | * 统计时间 |
| | | */ |
| | | @ApiModelProperty(value = "统计时间 ") |
| | | @TableField("\"statistic_time\"") |
| | | @DateTimeFormat(pattern = "yyyy-MM-dd") |
| | | @JsonFormat(pattern = "yyyy-MM-dd") |
| | | private Date statisticTime; |
| | | |
| | | /** |
| | | * 创建人 |
| | | */ |
| | | @ApiModelProperty(value = "创建人") |
| | | @TableField("\"create_user\"") |
| | | private Long createUser; |
| | | |
| | | /** |
| | | * 创建时间 |
| | | */ |
| | | @ApiModelProperty(value = "创建时间 ") |
| | | @TableField("\"create_time\"") |
| | | @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss") |
| | | @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss") |
| | | private Date createTime; |
| | | |
| | | |
| | | /** |
| | | * 更新人 |
| | | */ |
| | | @ApiModelProperty(value = "更新人") |
| | | @TableField("\"update_user\"") |
| | | private Long updateUser; |
| | | |
| | | /** |
| | | * 更新时间 |
| | | */ |
| | | @ApiModelProperty(value = "更新时间 ") |
| | | @TableField("\"update_time\"") |
| | | @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss") |
| | | @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss") |
| | | private Date updateTime; |
| | | |
| | | /** |
| | | * 来源 |
| | | */ |
| | | @ApiModelProperty(value = "来源 ") |
| | | @TableField("\"sys_resource\"") |
| | | private String sysResource; |
| | | |
| | | } |
| New file |
| | |
| | | package cn.gistack.sm.sjztods.entity; |
| | | |
| | | import com.baomidou.mybatisplus.annotation.IdType; |
| | | import com.baomidou.mybatisplus.annotation.TableField; |
| | | import com.baomidou.mybatisplus.annotation.TableId; |
| | | import com.baomidou.mybatisplus.annotation.TableName; |
| | | import com.fasterxml.jackson.annotation.JsonFormat; |
| | | import io.swagger.annotations.ApiModel; |
| | | import io.swagger.annotations.ApiModelProperty; |
| | | import lombok.Data; |
| | | import org.springframework.format.annotation.DateTimeFormat; |
| | | |
| | | import java.io.Serializable; |
| | | import java.util.Date; |
| | | |
| | | /** |
| | | * 蓄水放水情况统计表-按行政区域 |
| | | * @author zhongrj |
| | | * @date 2023-10-18 |
| | | */ |
| | | @Data |
| | | @TableName("\"xsfs_qktj\"") |
| | | @ApiModel(value = "蓄水放水情况统计表", description = "蓄水放水情况统计表") |
| | | public class XsfsQktj implements Serializable { |
| | | private static final long serialVersionUID = 1L; |
| | | |
| | | /** |
| | | * 主键 |
| | | */ |
| | | @ApiModelProperty(value = "主键") |
| | | @TableId(value = "\"guid\"",type = IdType.ASSIGN_ID) |
| | | private String guid; |
| | | |
| | | /** |
| | | * 区域名称 |
| | | */ |
| | | @ApiModelProperty(value = "区域名称") |
| | | @TableField("\"ad_name\"") |
| | | private String adName; |
| | | |
| | | /** |
| | | * 区域等级 |
| | | */ |
| | | @ApiModelProperty(value = "区域等级") |
| | | @TableField("\"ad_grad\"") |
| | | private String adGrad; |
| | | |
| | | /** |
| | | * 区域编号 |
| | | */ |
| | | @ApiModelProperty(value = "区域编号") |
| | | @TableField("\"ad_code\"") |
| | | private String adCode; |
| | | |
| | | /** |
| | | * 总蓄水合计 |
| | | */ |
| | | @ApiModelProperty(value = "总蓄水合计") |
| | | @TableField("\"zxs_total\"") |
| | | private Double zxsTotal; |
| | | |
| | | /** |
| | | * 总蓄水较上次 |
| | | */ |
| | | @ApiModelProperty(value = "总蓄水较上次") |
| | | @TableField("\"zxs_sc\"") |
| | | private String zxsSc; |
| | | |
| | | /** |
| | | * 总蓄水较历史同期 |
| | | */ |
| | | @ApiModelProperty(value = "总蓄水较历史同期") |
| | | @TableField("\"zxs_his_tq\"") |
| | | private String zxsHisTq; |
| | | |
| | | /** |
| | | * 总蓄水较历史同期增减(%) |
| | | */ |
| | | @ApiModelProperty(value = "总蓄水较历史同期增减(%)") |
| | | @TableField("\"zxs_his_tqzj\"") |
| | | private String zxsHisTqzj; |
| | | |
| | | /** |
| | | * 总蓄水较去年同期 |
| | | */ |
| | | @ApiModelProperty(value = "总蓄水较去年同期") |
| | | @TableField("\"zxs_last_year_tq\"") |
| | | private String zxsLastYearTq; |
| | | |
| | | /** |
| | | * 总蓄水较去年同期增减(%) |
| | | */ |
| | | @ApiModelProperty(value = "总蓄水较去年同期增减(%)") |
| | | @TableField("\"zxs_last_year_tqzj\"") |
| | | private String zxsLastYearTqzj; |
| | | |
| | | /** |
| | | * 有效蓄水合计 |
| | | */ |
| | | @ApiModelProperty(value = "有效蓄水合计") |
| | | @TableField("\"yxxs_total\"") |
| | | private Double yxxsTotal; |
| | | |
| | | /** |
| | | * 有效蓄水较同期历史有效蓄水增减(%) |
| | | */ |
| | | @ApiModelProperty(value = "有效蓄水较同期历史有效蓄水增减(%) ") |
| | | @TableField("\"yxxs_his_tqzj\"") |
| | | private String yxxsHisTqzj; |
| | | |
| | | /** |
| | | * 有效蓄水较同期去年有效蓄水增减(%) |
| | | */ |
| | | @ApiModelProperty(value = "有效蓄水较同期去年有效蓄水增减(%) ") |
| | | @TableField("\"yxxs_last_year_tqzj\"") |
| | | private String yxxsLastYearTqzj; |
| | | |
| | | /** |
| | | * 占兴利库容百分比(%) |
| | | */ |
| | | @ApiModelProperty(value = "占兴利库容百分比(%)") |
| | | @TableField("\"yxxs_z_xlkr\"") |
| | | private String yxxsZXlkr; |
| | | |
| | | /** |
| | | * 大型水库蓄水合计 |
| | | */ |
| | | @ApiModelProperty(value = "大型水库蓄水合计") |
| | | @TableField("\"dxsk_xs_total\"") |
| | | private Double dxskXsTotal; |
| | | |
| | | /** |
| | | * 大型水库蓄水较历史同期 |
| | | */ |
| | | @ApiModelProperty(value = "大型水库蓄水较历史同期 ") |
| | | @TableField("\"dxsk_xs_his\"") |
| | | private String dxskXsHis; |
| | | /** |
| | | * 大型水库蓄水较去年同期 |
| | | */ |
| | | @ApiModelProperty(value = "大型水库蓄水较去年同期 ") |
| | | @TableField("\"dxsk_xs_last_year\"") |
| | | private String dxskXsLastYear; |
| | | /** |
| | | * 大型水库有效蓄水 |
| | | */ |
| | | @ApiModelProperty(value = "大型水库有效蓄水 ") |
| | | @TableField("\"dxsk_yxxs\"") |
| | | private Double dxskYxxs; |
| | | /** |
| | | * 中型水库蓄水合计 |
| | | */ |
| | | @ApiModelProperty(value = "中型水库蓄水合计 ") |
| | | @TableField("\"zxsk_xs_total\"") |
| | | private Double zxskXsTotal; |
| | | /** |
| | | * 中型水库较历史同期 |
| | | */ |
| | | @ApiModelProperty(value = "中型水库较历史同期 ") |
| | | @TableField("\"zxsk_xs_his\"") |
| | | private String zxskXsHis; |
| | | |
| | | /** |
| | | * 中型水库较去年同期 |
| | | */ |
| | | @ApiModelProperty(value = "中型水库较去年同期 ") |
| | | @TableField("\"zxsk_xs_last_year\"") |
| | | private String zxskXsLastYear; |
| | | |
| | | /** |
| | | * 中型水库有效蓄水 |
| | | */ |
| | | @ApiModelProperty(value = "中型水库有效蓄水 ") |
| | | @TableField("\"zxsk_yxxs\"") |
| | | private Double zxskYxxs; |
| | | |
| | | /** |
| | | * 小型水库蓄水合计 |
| | | */ |
| | | @ApiModelProperty(value = "小型水库蓄水合计 ") |
| | | @TableField("\"xxsk_xs_total\"") |
| | | private Double xxskXsTotal; |
| | | |
| | | /** |
| | | * 小型水库有效蓄水 |
| | | */ |
| | | @ApiModelProperty(value = "小型水库有效蓄水 ") |
| | | @TableField("\"xxsk_yxxs\"") |
| | | private Double xxskYxxs; |
| | | |
| | | /** |
| | | * 统计时间 |
| | | */ |
| | | @ApiModelProperty(value = "统计时间 ") |
| | | @TableField("\"statistic_time\"") |
| | | @DateTimeFormat(pattern = "yyyy-MM-dd") |
| | | @JsonFormat(pattern = "yyyy-MM-dd") |
| | | private Date statisticTime; |
| | | |
| | | |
| | | /** |
| | | * 创建人 |
| | | */ |
| | | @ApiModelProperty(value = "创建人") |
| | | @TableField("\"create_user\"") |
| | | private Long createUser; |
| | | |
| | | /** |
| | | * 创建时间 |
| | | */ |
| | | @ApiModelProperty(value = "创建时间 ") |
| | | @TableField("\"create_time\"") |
| | | @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss") |
| | | @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss") |
| | | private Date createTime; |
| | | |
| | | |
| | | /** |
| | | * 更新人 |
| | | */ |
| | | @ApiModelProperty(value = "更新人") |
| | | @TableField("\"update_user\"") |
| | | private Long updateUser; |
| | | |
| | | /** |
| | | * 更新时间 |
| | | */ |
| | | @ApiModelProperty(value = "更新时间 ") |
| | | @TableField("\"update_time\"") |
| | | @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss") |
| | | @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss") |
| | | private Date updateTime; |
| | | |
| | | /** |
| | | * 来源 |
| | | */ |
| | | @ApiModelProperty(value = "来源 ") |
| | | @TableField("\"sys_resource\"") |
| | | private String sysResource; |
| | | |
| | | } |
| New file |
| | |
| | | package cn.gistack.sm.sjztods.entity; |
| | | |
| | | import com.baomidou.mybatisplus.annotation.TableField; |
| | | import com.baomidou.mybatisplus.annotation.TableName; |
| | | import com.fasterxml.jackson.annotation.JsonFormat; |
| | | import io.swagger.annotations.ApiModel; |
| | | import io.swagger.annotations.ApiModelProperty; |
| | | import lombok.Data; |
| | | import org.springframework.format.annotation.DateTimeFormat; |
| | | import java.io.Serializable; |
| | | import java.util.Date; |
| | | |
| | | /** |
| | | * 中大型数据整合 |
| | | * @author zhongrj |
| | | * @date 2023-10-09 |
| | | */ |
| | | @Data |
| | | @TableName("\"zdx_sk_zh\"") |
| | | @ApiModel(value = "中大型数据整合", description = "中大型数据整合") |
| | | public class ZdxSkZh implements Serializable { |
| | | private static final long serialVersionUID = 1L; |
| | | |
| | | /** |
| | | * 水库编码 |
| | | */ |
| | | @ApiModelProperty(value = "水库编码") |
| | | @TableField("\"res_code\"") |
| | | private String resCode; |
| | | |
| | | /** |
| | | * 水库名称 |
| | | */ |
| | | @ApiModelProperty(value = "水库名称") |
| | | @TableField("\"res_name\"") |
| | | private String resName; |
| | | |
| | | /** |
| | | * 行政区划编码 |
| | | */ |
| | | @ApiModelProperty(value = "行政区划编码") |
| | | @TableField("\"ad_code\"") |
| | | private String adCode; |
| | | |
| | | /** |
| | | * 管理部门行政区划编码 |
| | | */ |
| | | @ApiModelProperty(value = "管理部门行政区划编码") |
| | | @TableField("\"mgr_ad_code\"") |
| | | private String mgrAdCode; |
| | | |
| | | /** |
| | | * 内部行政区划编码 |
| | | */ |
| | | @ApiModelProperty(value = "内部行政区划编码") |
| | | @TableField("\"interior_ad_guid\"") |
| | | private String interiorAdGuid; |
| | | |
| | | /** |
| | | * 工程规模 |
| | | */ |
| | | @ApiModelProperty(value = "工程规模") |
| | | @TableField("\"eng_scal\"") |
| | | private String engScal; |
| | | |
| | | /** |
| | | * 水库功能 |
| | | */ |
| | | @ApiModelProperty(value = "水库功能") |
| | | @TableField("\"res_func\"") |
| | | private String resFunc; |
| | | |
| | | /** |
| | | * 水库类型 |
| | | */ |
| | | @ApiModelProperty(value = "水库类型") |
| | | @TableField("\"res_type\"") |
| | | private String resType; |
| | | |
| | | /** |
| | | * 水库所在位置 |
| | | */ |
| | | @ApiModelProperty(value = "水库所在位置") |
| | | @TableField("\"res_loc\"") |
| | | private String resLoc; |
| | | |
| | | /** |
| | | * 管理部门 |
| | | */ |
| | | @ApiModelProperty(value = "管理部门 ") |
| | | @TableField("\"mgr_dept\"") |
| | | private String mgrDept; |
| | | |
| | | /** |
| | | * 所属行业部门 |
| | | */ |
| | | @ApiModelProperty(value = "所属行业部门 ") |
| | | @TableField("\"industry_dept\"") |
| | | private String industryDept; |
| | | |
| | | /** |
| | | * 测站编码 |
| | | */ |
| | | @ApiModelProperty(value = "测站编码") |
| | | @TableField("\"st_code\"") |
| | | private String stCode; |
| | | |
| | | /** |
| | | * 正常蓄水位 |
| | | */ |
| | | @ApiModelProperty(value = "正常蓄水位") |
| | | @TableField("\"norm_pool_stag\"") |
| | | private Double normPoolStag; |
| | | |
| | | /** |
| | | * 死水位 |
| | | */ |
| | | @ApiModelProperty(value = "死水位 ") |
| | | @TableField("\"dead_stag\"") |
| | | private Double deadStag; |
| | | /** |
| | | * 防洪高水位 |
| | | */ |
| | | @ApiModelProperty(value = "防洪高水位 ") |
| | | @TableField("\"flpr_high_stag\"") |
| | | private Double flprHighStag; |
| | | /** |
| | | * 兴利水位 |
| | | */ |
| | | @ApiModelProperty(value = "兴利水位 ") |
| | | @TableField("\"ben_res_stag\"") |
| | | private Double benResStag; |
| | | /** |
| | | * 讯限水位 |
| | | */ |
| | | @ApiModelProperty(value = "讯限水位 ") |
| | | @TableField("\"flse_lim_stag\"") |
| | | private Double flseLimStag; |
| | | /** |
| | | * 设计洪水位 |
| | | */ |
| | | @ApiModelProperty(value = "设计洪水位 ") |
| | | @TableField("\"des_fl_stag\"") |
| | | private Double desFlStag; |
| | | /** |
| | | * 校核洪水位 |
| | | */ |
| | | @ApiModelProperty(value = "校核洪水位 ") |
| | | @TableField("\"chec_fl_stag\"") |
| | | private Double checFlStag; |
| | | /** |
| | | * 总库容 |
| | | */ |
| | | @ApiModelProperty(value = "总库容 ") |
| | | @TableField("\"tot_cap\"") |
| | | private Double totCap; |
| | | /** |
| | | * 死库容 |
| | | */ |
| | | @ApiModelProperty(value = "死库容 ") |
| | | @TableField("\"dead_cap\"") |
| | | private Double deadCap; |
| | | /** |
| | | * 坝顶高程 |
| | | */ |
| | | @ApiModelProperty(value = "坝顶高程 ") |
| | | @TableField("\"dam_top_elev\"") |
| | | private Double damTopElev; |
| | | /** |
| | | * 堰顶高程 |
| | | */ |
| | | @ApiModelProperty(value = "堰顶高程 ") |
| | | @TableField("\"weir_top_elev\"") |
| | | private Double weirTopElev; |
| | | /** |
| | | * 集雨面积 |
| | | */ |
| | | @ApiModelProperty(value = "集雨面积 ") |
| | | @TableField("\"wat_shed_area\"") |
| | | private Double watShedArea; |
| | | |
| | | /** |
| | | * 创建时间 |
| | | */ |
| | | @ApiModelProperty(value = "创建时间 ") |
| | | @TableField("\"create_time\"") |
| | | @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss") |
| | | @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss") |
| | | private Date createTime; |
| | | |
| | | /** |
| | | * 更新时间 |
| | | */ |
| | | @ApiModelProperty(value = "更新时间 ") |
| | | @TableField("\"update_time\"") |
| | | @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss") |
| | | @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss") |
| | | private Date updateTime; |
| | | |
| | | /** |
| | | * 来源 |
| | | */ |
| | | @ApiModelProperty(value = "来源 ") |
| | | @TableField("\"sys_resource\"") |
| | | private String sysResource; |
| | | |
| | | } |
| New file |
| | |
| | | package cn.gistack.sm.sjztods.excel; |
| | | |
| | | import com.alibaba.excel.annotation.ExcelProperty; |
| | | import com.alibaba.excel.annotation.write.style.ColumnWidth; |
| | | import com.alibaba.excel.annotation.write.style.ContentRowHeight; |
| | | import com.alibaba.excel.annotation.write.style.HeadRowHeight; |
| | | import com.baomidou.mybatisplus.annotation.TableField; |
| | | import io.swagger.annotations.ApiModelProperty; |
| | | import lombok.Data; |
| | | |
| | | import java.io.Serializable; |
| | | |
| | | @Data |
| | | @ColumnWidth(25) |
| | | @HeadRowHeight(20) |
| | | @ContentRowHeight(18) |
| | | public class SkxsQkTjExcel implements Serializable { |
| | | private static final long serialVersionUID = 1L; |
| | | |
| | | /** |
| | | * 水库编号 |
| | | */ |
| | | @ColumnWidth(15) |
| | | @ExcelProperty("水库编号") |
| | | private String resCode; |
| | | |
| | | /** |
| | | * 水库名称 |
| | | */ |
| | | @ColumnWidth(15) |
| | | @ExcelProperty("水库名称") |
| | | private String resName; |
| | | |
| | | /** |
| | | * 市州名称 |
| | | */ |
| | | @ColumnWidth(15) |
| | | @ExcelProperty("市州名称") |
| | | private String cityName; |
| | | |
| | | /** |
| | | * 区县名称 |
| | | */ |
| | | @ColumnWidth(15) |
| | | @ExcelProperty("区县名称") |
| | | private String countyName; |
| | | |
| | | /** |
| | | * 乡镇名称 |
| | | */ |
| | | @ColumnWidth(15) |
| | | @ExcelProperty("乡镇名称") |
| | | private String townName; |
| | | |
| | | /** |
| | | * 总库容 |
| | | */ |
| | | @ColumnWidth(15) |
| | | @ExcelProperty("总库容") |
| | | private Double totalCap; |
| | | |
| | | /** |
| | | * 当前水位 |
| | | */ |
| | | @ColumnWidth(15) |
| | | @ExcelProperty("当前水位") |
| | | private Double rz; |
| | | |
| | | /** |
| | | * 当日蓄水量 |
| | | */ |
| | | @ColumnWidth(15) |
| | | @ExcelProperty("当日蓄水量") |
| | | private Double ws; |
| | | |
| | | /** |
| | | * 上月 |
| | | */ |
| | | @ColumnWidth(15) |
| | | @ExcelProperty("上月") |
| | | private Double upMonthWs; |
| | | |
| | | /** |
| | | * 去年同期蓄水量 |
| | | */ |
| | | @ColumnWidth(15) |
| | | @ExcelProperty("去年同期蓄水量") |
| | | private Double lastYearWs; |
| | | |
| | | /** |
| | | * 历史同期蓄水量 |
| | | */ |
| | | @ColumnWidth(15) |
| | | @ExcelProperty("历史同期蓄水量") |
| | | private Double hisWs; |
| | | |
| | | /** |
| | | * 今年以来灌溉放水量 |
| | | */ |
| | | @ColumnWidth(15) |
| | | @ExcelProperty("今年以来灌溉放水量") |
| | | private Double nowYearIrrDw; |
| | | |
| | | /** |
| | | * 今年以来生活放水量 |
| | | */ |
| | | @ColumnWidth(15) |
| | | @ExcelProperty("今年以来生活放水量") |
| | | private Double nowYearLiveDw; |
| | | |
| | | /** |
| | | * 今年以来生态放水量 |
| | | */ |
| | | @ColumnWidth(15) |
| | | @ExcelProperty("今年以来生态放水量") |
| | | private Double nowYearZooDw; |
| | | |
| | | /** |
| | | * 总蓄水现有-历史 |
| | | */ |
| | | @ColumnWidth(15) |
| | | @ExcelProperty("总蓄水现有-历史") |
| | | private String totalWsDif; |
| | | |
| | | /** |
| | | * 总蓄水较历史同期(%) |
| | | */ |
| | | @ColumnWidth(15) |
| | | @ExcelProperty("总蓄水较历史同期(%)") |
| | | private String totalWsHisPro; |
| | | |
| | | /** |
| | | * 死库容 |
| | | */ |
| | | @ColumnWidth(15) |
| | | @ExcelProperty("死库容") |
| | | private Double deadCap; |
| | | |
| | | /** |
| | | * 当前有效蓄水 |
| | | */ |
| | | @ColumnWidth(15) |
| | | @ExcelProperty("当前有效蓄水") |
| | | private Double nowValidWs; |
| | | |
| | | /** |
| | | * 兴利库容 |
| | | */ |
| | | @ColumnWidth(15) |
| | | @ExcelProperty("兴利库容") |
| | | private Double benResCap; |
| | | |
| | | /** |
| | | * 有效蓄水/兴利(%) |
| | | */ |
| | | @ColumnWidth(15) |
| | | @ExcelProperty("有效蓄水/兴利(%)") |
| | | private String validWsBenPro; |
| | | |
| | | /** |
| | | * 历史同期有效蓄水 |
| | | */ |
| | | @ColumnWidth(15) |
| | | @ExcelProperty("历史同期有效蓄水") |
| | | private Double hisValidWs; |
| | | |
| | | /** |
| | | * 当前有效比历史同期(%) |
| | | */ |
| | | @ColumnWidth(15) |
| | | @ExcelProperty("当前有效比历史同期(%)") |
| | | private String nowValidHisPro; |
| | | |
| | | /** |
| | | * 去年有效蓄水 |
| | | */ |
| | | @ColumnWidth(15) |
| | | @ExcelProperty("去年有效蓄水") |
| | | private Double lastYearValidWs; |
| | | |
| | | /** |
| | | * 当前有效比去年同期(%) |
| | | */ |
| | | @ColumnWidth(15) |
| | | @ExcelProperty("当前有效比去年同期(%)") |
| | | private String nowValidLastPro; |
| | | |
| | | } |
| New file |
| | |
| | | package cn.gistack.sm.sjztods.excel; |
| | | |
| | | import cn.gistack.sm.sjztmd.service.IAttResStagCapDicsService; |
| | | import cn.gistack.sm.sjztods.service.ISkxsQkTjService; |
| | | import lombok.RequiredArgsConstructor; |
| | | import org.springblade.core.excel.support.ExcelImporter; |
| | | |
| | | import java.util.List; |
| | | |
| | | /** |
| | | * 导入水库库容数据 |
| | | * @author zhongrj |
| | | * @date 2023-09-04 |
| | | */ |
| | | @RequiredArgsConstructor |
| | | public class SkxsQkTjImport implements ExcelImporter<SkxsQkTjExcel> { |
| | | |
| | | private final ISkxsQkTjService service; |
| | | |
| | | @Override |
| | | public void save(List<SkxsQkTjExcel> data) { |
| | | service.importSkxsQkTjData(data); |
| | | } |
| | | } |
| New file |
| | |
| | | package cn.gistack.sm.sjztods.mapper; |
| | | |
| | | import cn.gistack.sm.sjztods.entity.SkxsQkTj; |
| | | import cn.gistack.sm.sjztods.excel.SkxsQkTjExcel; |
| | | import cn.gistack.sm.sjztods.vo.SkxsQkTjVO; |
| | | import com.baomidou.dynamic.datasource.annotation.DS; |
| | | import com.baomidou.mybatisplus.core.mapper.BaseMapper; |
| | | import com.baomidou.mybatisplus.core.metadata.IPage; |
| | | import org.apache.ibatis.annotations.Param; |
| | | |
| | | import java.util.List; |
| | | |
| | | |
| | | /** |
| | | * SkxsQkTjMapper 接口 |
| | | * |
| | | * @author zhongrj |
| | | * @date 2023-10-19 |
| | | */ |
| | | @DS("ztznwh") |
| | | public interface SkxsQkTjMapper extends BaseMapper<SkxsQkTj> { |
| | | |
| | | /** |
| | | * 分页列表数据查询 |
| | | * @param page |
| | | * @param skxsQkTj |
| | | * @return |
| | | */ |
| | | List<SkxsQkTjVO> selectSkxsQkTjPage(@Param("page") IPage<SkxsQkTjVO> page,@Param("skxsQkTj") SkxsQkTjVO skxsQkTj); |
| | | |
| | | /** |
| | | * 按行政区统计 |
| | | * @param skxsQkTj |
| | | * @return |
| | | */ |
| | | Object getStatisticList(@Param("skxsQkTj") SkxsQkTjVO skxsQkTj); |
| | | |
| | | /** |
| | | * 查询导出数据 |
| | | * @param skxsQkTj |
| | | * @return |
| | | */ |
| | | List<SkxsQkTjExcel> exportSkxsQkTjList(@Param("skxsQkTj") SkxsQkTjVO skxsQkTj); |
| | | } |
| New file |
| | |
| | | <?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="cn.gistack.sm.sjztods.mapper.SkxsQkTjMapper"> |
| | | |
| | | <!--分页列表数据查询--> |
| | | <select id="selectSkxsQkTjPage" resultType="cn.gistack.sm.sjztods.vo.SkxsQkTjVO"> |
| | | select * from ( |
| | | select |
| | | sqt.*, |
| | | arb."res_reg_code" resRegCode,arb."eng_scal" engScal, |
| | | case when b."ad_grad" = 4 THEN b."ad_name" ELSE NULL END AS townName, |
| | | case when b."ad_grad" = 4 THEN b."ad_code" ELSE NULL END AS townCode, |
| | | case when b."ad_grad" = 3 THEN b."ad_name" |
| | | when c."ad_grad" = 3 THEN c."ad_name" END AS countyName, |
| | | case when b."ad_grad" = 3 THEN b."ad_code" |
| | | when c."ad_grad" = 3 THEN c."ad_code" END AS countyCode, |
| | | case when b."ad_grad" = 2 THEN b."ad_code" |
| | | when c."ad_grad" = 2 THEN c."ad_code" |
| | | ELSE d."ad_code" END AS cityCode, |
| | | case when b."ad_grad" = 2 THEN b."ad_name" |
| | | when c."ad_grad" = 2 THEN c."ad_name" |
| | | ELSE d."ad_name" END AS cityName |
| | | from SJZT_ODS."skxs_qk_tj" sqt |
| | | left join SJZT_MD."att_res_base" arb on arb."guid" = sqt."res_code" |
| | | left join SJZT_MD."att_ad_base" b ON arb."interior_ad_guid" = b."guid" |
| | | left join SJZT_MD."att_ad_base" c ON b."p_ad_code" = c."guid" |
| | | left join SJZT_MD."att_ad_base" d ON c."p_ad_code" = d."guid" |
| | | where 1=1 |
| | | <if test="skxsQkTj.statisticTime!=null"> |
| | | and date_format(sqt."statistic_time","%Y-%m-%d") = #{skxsQkTj.statisticTime} |
| | | </if> |
| | | <if test="skxsQkTj.resName!=null and skxsQkTj.resName!=''"> |
| | | and sqt."res_name" like concat('%',#{skxsQkTj.resName},'%') |
| | | </if> |
| | | ) x |
| | | <if test="skxsQkTj.adCode!=null and skxsQkTj.adCode!=''"> |
| | | and (townCode = #{skxsQkTj.adCode} or countyCode = #{skxsQkTj.adCode} or cityCode = #{skxsQkTj.adCode}) |
| | | </if> |
| | | </select> |
| | | |
| | | <!--按行政区统计--> |
| | | <select id="getStatisticList" resultType="cn.gistack.sm.sjztods.vo.SkxsQkTjVO"> |
| | | |
| | | </select> |
| | | |
| | | |
| | | <!--查询导出数据--> |
| | | <select id="exportSkxsQkTjList" resultType="cn.gistack.sm.sjztods.excel.SkxsQkTjExcel"> |
| | | select * from ( |
| | | select |
| | | sqt.*, |
| | | arb."res_reg_code" resRegCode,arb."eng_scal" engScal, |
| | | case when b."ad_grad" = 4 THEN b."ad_name" ELSE NULL END AS townName, |
| | | case when b."ad_grad" = 4 THEN b."ad_code" ELSE NULL END AS townCode, |
| | | case when b."ad_grad" = 3 THEN b."ad_name" |
| | | when c."ad_grad" = 3 THEN c."ad_name" END AS countyName, |
| | | case when b."ad_grad" = 3 THEN b."ad_code" |
| | | when c."ad_grad" = 3 THEN c."ad_code" END AS countyCode, |
| | | case when b."ad_grad" = 2 THEN b."ad_code" |
| | | when c."ad_grad" = 2 THEN c."ad_code" |
| | | ELSE d."ad_code" END AS cityCode, |
| | | case when b."ad_grad" = 2 THEN b."ad_name" |
| | | when c."ad_grad" = 2 THEN c."ad_name" |
| | | ELSE d."ad_name" END AS cityName |
| | | from SJZT_ODS."skxs_qk_tj" sqt |
| | | left join SJZT_MD."att_res_base" arb on arb."guid" = sqt."res_code" |
| | | left join SJZT_MD."att_ad_base" b ON arb."interior_ad_guid" = b."guid" |
| | | left join SJZT_MD."att_ad_base" c ON b."p_ad_code" = c."guid" |
| | | left join SJZT_MD."att_ad_base" d ON c."p_ad_code" = d."guid" |
| | | where 1=1 |
| | | <if test="skxsQkTj.statisticTime!=null"> |
| | | and date_format(sqt."statistic_time","%Y-%m-%d") = #{skxsQkTj.statisticTime} |
| | | </if> |
| | | <if test="skxsQkTj.resName!=null and skxsQkTj.resName!=''"> |
| | | and sqt."res_name" like concat('%',#{skxsQkTj.resName},'%') |
| | | </if> |
| | | ) x |
| | | <if test="skxsQkTj.adCode!=null and skxsQkTj.adCode!=''"> |
| | | and (townCode = #{skxsQkTj.adCode} or countyCode = #{skxsQkTj.adCode} or cityCode = #{skxsQkTj.adCode}) |
| | | </if> |
| | | </select> |
| | | </mapper> |
| New file |
| | |
| | | package cn.gistack.sm.sjztods.mapper; |
| | | |
| | | import cn.gistack.sm.sjztods.entity.ZdxSkZh; |
| | | import com.baomidou.dynamic.datasource.annotation.DS; |
| | | import com.baomidou.mybatisplus.core.mapper.BaseMapper; |
| | | |
| | | |
| | | /** |
| | | * ZdxSkZhMapper 接口 |
| | | * |
| | | * @author zhongrj |
| | | * @date 2023-10-09 |
| | | */ |
| | | @DS("ztznwh") |
| | | public interface ZdxSkZhMapper extends BaseMapper<ZdxSkZh> { |
| | | } |
| New file |
| | |
| | | <?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="cn.gistack.sm.sjztods.mapper.ZdxSkZhMapper"> |
| | | |
| | | |
| | | </mapper> |
| New file |
| | |
| | | package cn.gistack.sm.sjztods.service; |
| | | |
| | | import cn.gistack.sm.sjztods.entity.SkxsQkTj; |
| | | import cn.gistack.sm.sjztods.excel.SkxsQkTjExcel; |
| | | import cn.gistack.sm.sjztods.vo.SkxsQkTjVO; |
| | | import com.baomidou.mybatisplus.core.metadata.IPage; |
| | | import com.baomidou.mybatisplus.extension.service.IService; |
| | | |
| | | import java.util.List; |
| | | |
| | | /** |
| | | * @ClassName ISkxsQkTjService |
| | | * @author zhongrj |
| | | * @date 2023-10-19 |
| | | */ |
| | | public interface ISkxsQkTjService extends IService<SkxsQkTj> { |
| | | |
| | | /** |
| | | * 上报 |
| | | * @param skxsQkTj |
| | | * @return |
| | | */ |
| | | boolean exportSkxsQkTj(SkxsQkTj skxsQkTj); |
| | | |
| | | /** |
| | | * 分页列表数据查询 |
| | | * @param skxsQkTj |
| | | * @param page |
| | | * @return |
| | | */ |
| | | Object selectSkxsQkTjPage(IPage<SkxsQkTjVO> page, SkxsQkTjVO skxsQkTj); |
| | | |
| | | /** |
| | | * 按行政区统计 |
| | | * @param skxsQkTj |
| | | * @return |
| | | */ |
| | | Object getStatisticList(SkxsQkTjVO skxsQkTj); |
| | | |
| | | /** |
| | | * 导入统计上报数据 |
| | | * @param data |
| | | */ |
| | | void importSkxsQkTjData(List<SkxsQkTjExcel> data); |
| | | |
| | | /** |
| | | * 查询导出数据 |
| | | * @param skxsQkTj |
| | | * @return |
| | | */ |
| | | List<SkxsQkTjExcel> exportSkxsQkTjList(SkxsQkTjVO skxsQkTj); |
| | | } |
| New file |
| | |
| | | package cn.gistack.sm.sjztods.service; |
| | | |
| | | import cn.gistack.sm.sjztods.entity.ZdxSkZh; |
| | | import com.baomidou.mybatisplus.extension.service.IService; |
| | | |
| | | /** |
| | | * @ClassName IZdxSkZhService |
| | | * @author zhongrj |
| | | * @date 2023-10-09 |
| | | */ |
| | | public interface IZdxSkZhService extends IService<ZdxSkZh> { |
| | | |
| | | /** |
| | | * 新增 |
| | | * @param zdxSkZh |
| | | * @return |
| | | */ |
| | | boolean saveZdxSkZh(ZdxSkZh zdxSkZh); |
| | | } |
| New file |
| | |
| | | package cn.gistack.sm.sjztods.service.impl; |
| | | |
| | | import cn.gistack.sm.sjztods.entity.SkxsQkTj; |
| | | import cn.gistack.sm.sjztods.excel.SkxsQkTjExcel; |
| | | import cn.gistack.sm.sjztods.mapper.SkxsQkTjMapper; |
| | | import cn.gistack.sm.sjztods.service.ISkxsQkTjService; |
| | | import cn.gistack.sm.sjztods.vo.SkxsQkTjVO; |
| | | import cn.gistack.system.user.entity.User; |
| | | import com.baomidou.dynamic.datasource.annotation.DS; |
| | | import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; |
| | | import com.baomidou.mybatisplus.core.metadata.IPage; |
| | | import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; |
| | | import org.springblade.core.secure.utils.AuthUtil; |
| | | import org.springblade.core.tool.utils.BeanUtil; |
| | | import org.springframework.stereotype.Service; |
| | | |
| | | import java.util.Date; |
| | | import java.util.List; |
| | | import java.util.Objects; |
| | | |
| | | /** |
| | | * @ClassName SkxsQkTjServiceImpl |
| | | * @author zhongrj |
| | | * @date 2023-10-19 |
| | | */ |
| | | @Service |
| | | @DS("ztznwh") |
| | | public class SkxsQkTjServiceImpl extends ServiceImpl<SkxsQkTjMapper, SkxsQkTj> implements ISkxsQkTjService { |
| | | |
| | | /** |
| | | * 上报 |
| | | * @param skxsQkTj |
| | | * @return |
| | | */ |
| | | @Override |
| | | @DS("ztznwh") |
| | | public boolean exportSkxsQkTj(SkxsQkTj skxsQkTj) { |
| | | // 查询库中是否包含当前日期,当前行政区的数据,如果有,则更新,没有则新增 |
| | | QueryWrapper<SkxsQkTj> wrapper = new QueryWrapper<>(); |
| | | wrapper.eq("\"statistic_time\"",skxsQkTj.getStatisticTime()) |
| | | .eq("\"res_code\"",skxsQkTj.getResCode()); |
| | | SkxsQkTj qkTj = baseMapper.selectOne(wrapper); |
| | | // 设置更新人员,更新时间,来源信息 |
| | | skxsQkTj.setUpdateTime(new Date()); |
| | | skxsQkTj.setUpdateUser(AuthUtil.getUserId()); |
| | | skxsQkTj.setSysResource("sb"); |
| | | if (null!= qkTj){ |
| | | skxsQkTj.setGuid(qkTj.getGuid()); |
| | | // 更新并返回 |
| | | return updateById(skxsQkTj); |
| | | } |
| | | // 设置创建人员,时间信息 |
| | | skxsQkTj.setCreateUser(AuthUtil.getUserId()); |
| | | skxsQkTj.setCreateTime(new Date()); |
| | | // 保存并返回 |
| | | return save(skxsQkTj); |
| | | } |
| | | |
| | | /** |
| | | * 分页列表数据查询 |
| | | * @param skxsQkTj |
| | | * @param page |
| | | * @return |
| | | */ |
| | | @Override |
| | | public Object selectSkxsQkTjPage(IPage<SkxsQkTjVO> page, SkxsQkTjVO skxsQkTj) { |
| | | if (null!=skxsQkTj.getIsExport()){ |
| | | // 导出,查询所有数据 |
| | | return baseMapper.selectSkxsQkTjPage(null,skxsQkTj); |
| | | } |
| | | return page.setRecords(baseMapper.selectSkxsQkTjPage(page,skxsQkTj)); |
| | | } |
| | | |
| | | /** |
| | | * 按行政区统计 |
| | | * @param skxsQkTj |
| | | * @return |
| | | */ |
| | | @Override |
| | | public Object getStatisticList(SkxsQkTjVO skxsQkTj) { |
| | | return baseMapper.getStatisticList(skxsQkTj); |
| | | } |
| | | |
| | | /** |
| | | * 导入统计上报数据 |
| | | * @param data |
| | | */ |
| | | @Override |
| | | public void importSkxsQkTjData(List<SkxsQkTjExcel> data) { |
| | | if (data.size()>0){ |
| | | // 遍历 |
| | | data.forEach(skxsQkTjExcel -> { |
| | | SkxsQkTj skxsQkTj = Objects.requireNonNull(BeanUtil.copy(skxsQkTjExcel, SkxsQkTj.class)); |
| | | // 查询库中是否包含当前日期,当前行政区的数据,如果有,则更新,没有则新增 |
| | | QueryWrapper<SkxsQkTj> wrapper = new QueryWrapper<>(); |
| | | wrapper.eq("\"statistic_time\"",skxsQkTj.getStatisticTime()) |
| | | .eq("\"res_code\"",skxsQkTj.getResCode()); |
| | | SkxsQkTj qkTj = baseMapper.selectOne(wrapper); |
| | | // 设置更新人员,更新时间,来源信息 |
| | | skxsQkTj.setUpdateTime(new Date()); |
| | | skxsQkTj.setUpdateUser(AuthUtil.getUserId()); |
| | | skxsQkTj.setSysResource("sb"); |
| | | if (null!= qkTj){ |
| | | skxsQkTj.setGuid(qkTj.getGuid()); |
| | | // 更新并返回 |
| | | updateById(skxsQkTj); |
| | | return; |
| | | } |
| | | // 设置创建人员,时间信息 |
| | | skxsQkTj.setCreateUser(AuthUtil.getUserId()); |
| | | skxsQkTj.setCreateTime(new Date()); |
| | | // 保存并返回 |
| | | save(skxsQkTj); |
| | | return; |
| | | }); |
| | | } |
| | | } |
| | | |
| | | /** |
| | | * 查询导出数据 |
| | | * @param skxsQkTj |
| | | * @return |
| | | */ |
| | | @Override |
| | | public List<SkxsQkTjExcel> exportSkxsQkTjList(SkxsQkTjVO skxsQkTj) { |
| | | return baseMapper.exportSkxsQkTjList(skxsQkTj); |
| | | } |
| | | } |
| | | |
| New file |
| | |
| | | package cn.gistack.sm.sjztods.service.impl; |
| | | |
| | | import cn.gistack.sm.sjztods.entity.ZdxSkZh; |
| | | import cn.gistack.sm.sjztods.mapper.ZdxSkZhMapper; |
| | | import cn.gistack.sm.sjztods.service.IZdxSkZhService; |
| | | import com.baomidou.dynamic.datasource.annotation.DS; |
| | | import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; |
| | | import org.springframework.stereotype.Service; |
| | | |
| | | /** |
| | | * @ClassName ZdxSkZhServiceImpl |
| | | * @author zhongrj |
| | | * @date 2023-10-09 |
| | | */ |
| | | @Service |
| | | @DS("ztznwh") |
| | | public class ZdxSkZhServiceImpl extends ServiceImpl<ZdxSkZhMapper, ZdxSkZh> implements IZdxSkZhService { |
| | | |
| | | /** |
| | | * 新增 |
| | | * @param zdxSkZh |
| | | * @return |
| | | */ |
| | | @Override |
| | | @DS("ztznwh") |
| | | public boolean saveZdxSkZh(ZdxSkZh zdxSkZh) { |
| | | return save(zdxSkZh); |
| | | } |
| | | } |
| | | |
| New file |
| | |
| | | package cn.gistack.sm.sjztods.vo; |
| | | |
| | | import cn.gistack.sm.sjztods.entity.SkxsQkTj; |
| | | import lombok.Data; |
| | | |
| | | @Data |
| | | public class SkxsQkTjVO extends SkxsQkTj { |
| | | |
| | | /** |
| | | * 按行政区划统计 |
| | | */ |
| | | private String adCode; |
| | | |
| | | /** |
| | | * 水库规模 |
| | | */ |
| | | private String engScal; |
| | | |
| | | /** |
| | | * 水库注册码 |
| | | */ |
| | | private String resRegCode; |
| | | |
| | | /** |
| | | * 水库规模 |
| | | */ |
| | | private Integer isExport; |
| | | |
| | | /** |
| | | * 市州名称 |
| | | */ |
| | | private String cityName; |
| | | |
| | | /** |
| | | * 区县名称 |
| | | */ |
| | | private String countyName; |
| | | |
| | | /** |
| | | * 乡镇名称 |
| | | */ |
| | | private String townName; |
| | | } |
| New file |
| | |
| | | package cn.gistack.sm.waterKnowledge.controller; |
| | | |
| | | |
| | | import cn.gistack.sm.waterKnowledge.entity.WaterKnowledge; |
| | | import cn.gistack.sm.waterKnowledge.service.WaterKnowledgeService; |
| | | import cn.gistack.sm.waterKnowledge.vo.WaterKnowledgeVO; |
| | | import com.baomidou.mybatisplus.core.metadata.IPage; |
| | | import io.swagger.annotations.ApiOperation; |
| | | import lombok.AllArgsConstructor; |
| | | import org.springblade.core.mp.support.Condition; |
| | | import org.springblade.core.mp.support.Query; |
| | | import org.springblade.core.tool.api.R; |
| | | import org.springframework.web.bind.annotation.*; |
| | | |
| | | import java.util.Arrays; |
| | | import java.util.Date; |
| | | |
| | | /** |
| | | * 水知识控制层 |
| | | * @author zhongrj |
| | | * @date 2023-05-29 |
| | | */ |
| | | @RestController |
| | | @AllArgsConstructor |
| | | @RequestMapping("/waterKnowledge/waterKnowledge") |
| | | public class WaterKnowledgeController { |
| | | |
| | | private final WaterKnowledgeService waterKnowledgeService; |
| | | |
| | | /** |
| | | * 分页列表查询 |
| | | * |
| | | * @param waterKnowledge |
| | | * @return |
| | | */ |
| | | @ApiOperation(value="水知识-分页列表查询", notes="水知识-分页列表查询") |
| | | @GetMapping(value = "/list") |
| | | public R queryPageList(WaterKnowledge waterKnowledge, Query query) { |
| | | IPage<WaterKnowledge> pageList = waterKnowledgeService.page(Condition.getPage(query), Condition.getQueryWrapper(waterKnowledge)); |
| | | return R.data(pageList); |
| | | } |
| | | |
| | | /** |
| | | * 自定义分页列表查询 |
| | | * @param query |
| | | * @param waterKnowledge |
| | | * @return |
| | | */ |
| | | @ApiOperation(value="水知识-自定义分页列表查询", notes="水知识-自定义分页列表查询") |
| | | @GetMapping(value = "/page") |
| | | public R page(WaterKnowledgeVO waterKnowledge, Query query) { |
| | | return R.data( waterKnowledgeService.selectWaterKnowledgePage(Condition.getPage(query),waterKnowledge)); |
| | | } |
| | | |
| | | /** |
| | | * 添加 |
| | | * |
| | | * @param waterKnowledge |
| | | * @return |
| | | */ |
| | | @ApiOperation(value="水知识-添加", notes="水知识-添加") |
| | | @PostMapping(value = "/add") |
| | | public R add(@RequestBody WaterKnowledge waterKnowledge) { |
| | | waterKnowledge.setCreateTime(new Date()); |
| | | return R.data(waterKnowledgeService.save(waterKnowledge)); |
| | | } |
| | | |
| | | /** |
| | | * 编辑 |
| | | * |
| | | * @param waterKnowledge |
| | | * @return |
| | | */ |
| | | @ApiOperation(value="水知识-编辑", notes="水知识-编辑") |
| | | @RequestMapping(value = "/edit", method = {RequestMethod.PUT,RequestMethod.POST}) |
| | | public R edit(@RequestBody WaterKnowledge waterKnowledge) { |
| | | return R.data(waterKnowledgeService.updateById(waterKnowledge)); |
| | | } |
| | | |
| | | /** |
| | | * 通过id删除 |
| | | * |
| | | * @param id |
| | | * @return |
| | | */ |
| | | @ApiOperation(value="水知识-通过id删除", notes="水知识-通过id删除") |
| | | @PostMapping(value = "/delete") |
| | | public R delete(@RequestParam(name="id",required=true) String id) { |
| | | return R.data(waterKnowledgeService.removeById(id)); |
| | | } |
| | | |
| | | /** |
| | | * 批量删除 |
| | | * |
| | | * @param ids |
| | | * @return |
| | | */ |
| | | @ApiOperation(value="水知识-批量删除", notes="水知识-批量删除") |
| | | @PostMapping(value = "/deleteBatch") |
| | | public R deleteBatch(@RequestParam(name="ids",required=true) String ids) { |
| | | return R.data(this.waterKnowledgeService.removeByIds(Arrays.asList(ids.split(",")))); |
| | | } |
| | | |
| | | /** |
| | | * 通过id查询 |
| | | * |
| | | * @param id |
| | | * @return |
| | | */ |
| | | @ApiOperation(value="水知识-通过id查询", notes="水知识-通过id查询") |
| | | @GetMapping(value = "/queryById") |
| | | public R queryById(@RequestParam(name="id",required=true) String id) { |
| | | WaterKnowledge waterKnowledge = waterKnowledgeService.getById(id); |
| | | return R.data(waterKnowledge); |
| | | } |
| | | |
| | | } |
| New file |
| | |
| | | package cn.gistack.sm.waterKnowledge.entity; |
| | | |
| | | 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 io.swagger.annotations.ApiModelProperty; |
| | | import lombok.Data; |
| | | import lombok.EqualsAndHashCode; |
| | | import lombok.experimental.Accessors; |
| | | import org.springframework.format.annotation.DateTimeFormat; |
| | | import java.util.Date; |
| | | |
| | | /** |
| | | * 水知识 |
| | | * |
| | | * @author zhongrj |
| | | * @date 2023-09-12 |
| | | */ |
| | | @Data |
| | | @TableName(value = "sm_water_knowledge") |
| | | @EqualsAndHashCode(callSuper = false) |
| | | @Accessors(chain = true) |
| | | public class WaterKnowledge { |
| | | |
| | | /** |
| | | * id |
| | | */ |
| | | @ApiModelProperty(value = "id") |
| | | @TableId(value = "id",type = IdType.ASSIGN_ID) |
| | | private Long id; |
| | | |
| | | /** |
| | | * 标题 |
| | | */ |
| | | @ApiModelProperty(value = "标题") |
| | | private String title; |
| | | |
| | | /** |
| | | * 类型 |
| | | */ |
| | | @ApiModelProperty(value = "类型") |
| | | private String type; |
| | | |
| | | /** |
| | | * 简要内容 |
| | | */ |
| | | @ApiModelProperty(value = "简要内容") |
| | | private String briefContent; |
| | | |
| | | /** |
| | | * 作者 |
| | | */ |
| | | @ApiModelProperty(value = "作者") |
| | | private String author; |
| | | |
| | | /** |
| | | * 来源 |
| | | */ |
| | | @ApiModelProperty(value = "来源") |
| | | private String source; |
| | | |
| | | /** |
| | | * 内容 |
| | | */ |
| | | @ApiModelProperty(value = "内容") |
| | | private String content; |
| | | |
| | | /** |
| | | * 发布时间 |
| | | */ |
| | | @JsonFormat(timezone = "GMT+8", pattern = "yyyy-MM-dd HH:mm:ss") |
| | | @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss") |
| | | @ApiModelProperty(value = "发布时间") |
| | | private Date issueTime; |
| | | |
| | | /** |
| | | * 创建时间 |
| | | */ |
| | | @JsonFormat(timezone = "GMT+8", pattern = "yyyy-MM-dd HH:mm:ss") |
| | | @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss") |
| | | @ApiModelProperty(value = "创建时间") |
| | | private Date createTime; |
| | | } |
| New file |
| | |
| | | package cn.gistack.sm.waterKnowledge.mapper; |
| | | |
| | | |
| | | import cn.gistack.sm.waterKnowledge.entity.WaterKnowledge; |
| | | import cn.gistack.sm.waterKnowledge.vo.WaterKnowledgeVO; |
| | | import com.baomidou.mybatisplus.core.mapper.BaseMapper; |
| | | import com.baomidou.mybatisplus.core.metadata.IPage; |
| | | import org.apache.ibatis.annotations.Param; |
| | | |
| | | import java.util.List; |
| | | |
| | | /** |
| | | * 水知识详情mapper映射层 |
| | | * @author zhongrj |
| | | * @date 2023-05-29 |
| | | */ |
| | | public interface WaterKnowledgeMapper extends BaseMapper<WaterKnowledge> { |
| | | |
| | | /** |
| | | * 自定义分页列表查询 |
| | | * @param page |
| | | * @param waterKnowledge |
| | | * @return |
| | | */ |
| | | List<WaterKnowledgeVO> selectWaterKnowledgePage(IPage<WaterKnowledgeVO> page, @Param("waterKnowledge") WaterKnowledgeVO waterKnowledge); |
| | | } |
| New file |
| | |
| | | <?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="cn.gistack.sm.waterKnowledge.mapper.WaterKnowledgeMapper"> |
| | | |
| | | <!--自定义分页列表查询--> |
| | | <select id="selectWaterKnowledgePage" resultType="cn.gistack.sm.waterKnowledge.vo.WaterKnowledgeVO"> |
| | | select * from sm_water_knowledge |
| | | where 1=1 |
| | | <if test="waterKnowledge.title!=null and waterKnowledge.title!=''"> |
| | | and title like concat('%',#{waterKnowledge.title},'%') |
| | | </if> |
| | | </select> |
| | | |
| | | </mapper> |
| New file |
| | |
| | | package cn.gistack.sm.waterKnowledge.service; |
| | | |
| | | |
| | | import cn.gistack.sm.waterKnowledge.entity.WaterKnowledge; |
| | | import cn.gistack.sm.waterKnowledge.vo.WaterKnowledgeVO; |
| | | import com.baomidou.mybatisplus.core.metadata.IPage; |
| | | import com.baomidou.mybatisplus.extension.service.IService; |
| | | |
| | | /** |
| | | * 水知识服务层 |
| | | * @author zhongrj |
| | | * @date 2023-09-12 |
| | | */ |
| | | public interface WaterKnowledgeService extends IService<WaterKnowledge> { |
| | | |
| | | /** |
| | | * 自定义分页列表查询 |
| | | * @param page |
| | | * @param waterKnowledge |
| | | * @return |
| | | */ |
| | | Object selectWaterKnowledgePage(IPage<WaterKnowledgeVO> page, WaterKnowledgeVO waterKnowledge); |
| | | } |
| New file |
| | |
| | | package cn.gistack.sm.waterKnowledge.service.impl; |
| | | |
| | | |
| | | import cn.gistack.sm.waterKnowledge.entity.WaterKnowledge; |
| | | import cn.gistack.sm.waterKnowledge.mapper.WaterKnowledgeMapper; |
| | | import cn.gistack.sm.waterKnowledge.service.WaterKnowledgeService; |
| | | import cn.gistack.sm.waterKnowledge.vo.WaterKnowledgeVO; |
| | | import com.baomidou.mybatisplus.core.metadata.IPage; |
| | | import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; |
| | | import org.springframework.stereotype.Service; |
| | | |
| | | /** |
| | | * 水知识服务实现层 |
| | | * @author zhongrj |
| | | * @date 2023-09-12 |
| | | */ |
| | | @Service |
| | | public class WaterKnowledgeServiceImpl extends ServiceImpl<WaterKnowledgeMapper, WaterKnowledge> implements WaterKnowledgeService { |
| | | |
| | | /** |
| | | * 自定义分页列表查询 |
| | | * @param page |
| | | * @param waterKnowledge |
| | | * @return |
| | | */ |
| | | @Override |
| | | public IPage<WaterKnowledgeVO> selectWaterKnowledgePage(IPage<WaterKnowledgeVO> page, WaterKnowledgeVO waterKnowledge) { |
| | | return page.setRecords(baseMapper.selectWaterKnowledgePage(page,waterKnowledge)); |
| | | } |
| | | } |
| New file |
| | |
| | | package cn.gistack.sm.waterKnowledge.vo; |
| | | |
| | | import cn.gistack.sm.waterKnowledge.entity.WaterKnowledge; |
| | | import lombok.Data; |
| | | |
| | | @Data |
| | | public class WaterKnowledgeVO extends WaterKnowledge { |
| | | } |
| | |
| | | password: ${blade.datasource.prod.znwh.password} |
| | | main: |
| | | allow-circular-references: true |
| | | #xxl: |
| | | # job: |
| | | # accessToken: '' |
| | | # admin: |
| | | # ### 调度中心部署根地址 [选填]:如调度中心集群部署存在多个地址则用逗号分隔。执行器将会使用该地址进行"执行器心跳注册"和"任务结果回调";为空则关闭自动注册; |
| | | # addresses: http://127.0.0.1:7009/xxl-job-admin |
| | | # executor: |
| | | # ### 执行器AppName [选填]:执行器心跳注册分组依据;为空则关闭自动注册 |
| | | # appname: blade-xxljob |
| | | # ### 执行器IP [选填]:默认为空表示自动获取IP,多网卡时可手动设置指定IP,该IP不会绑定Host仅作为通讯实用;地址信息用于 "执行器注册" 和 "调度中心请求并触发任务"; |
| | | # ip: 127.0.0.1 |
| | | # ### 执行器运行日志文件存储磁盘路径 [选填] :需要对该路径拥有读写权限;为空则使用默认路径; |
| | | # logpath: ../data/applogs/xxl-job/jobhandler |
| | | # ### 执行器日志文件保存天数 [选填] : 过期日志自动清理, 限制值大于等于3时生效; 否则, 如-1, 关闭自动清理功能; |
| | | # logretentiondays: -1 |
| | | # ### 执行器端口号 [选填]:小于等于0则自动获取;默认端口为9999,单机部署多个执行器时,注意要配置不同执行器端口; |
| | | # port: 7018 |
| New file |
| | |
| | | #服务器端口 |
| | | server: |
| | | port: 8110 |
| | | |
| | | #数据源配置 |
| | | #spring: |
| | | # datasource: |
| | | # url: ${blade.datasource.test.url} |
| | | # username: ${blade.datasource.test.username} |
| | | # password: ${blade.datasource.test.password} |
| | | |
| | | #多数据源配置 |
| | | spring: |
| | | #排除DruidDataSourceAutoConfigure |
| | | autoconfigure: |
| | | exclude: com.alibaba.druid.spring.boot.autoconfigure.DruidDataSourceAutoConfigure |
| | | datasource: |
| | | dynamic: |
| | | #设置默认的数据源或者数据源组,默认值即为master |
| | | primary: master |
| | | datasource: |
| | | master: |
| | | url: ${blade.datasource.test.url} |
| | | username: ${blade.datasource.test.username} |
| | | password: ${blade.datasource.test.password} |
| | | zt: |
| | | url: ${blade.datasource.test.zt.url} |
| | | username: ${blade.datasource.test.zt.username} |
| | | password: ${blade.datasource.test.zt.password} |
| | | # 智能外呼数据库 |
| | | ztznwh: |
| | | url: ${blade.datasource.test.ztznwh.url} |
| | | username: ${blade.datasource.test.ztznwh.username} |
| | | password: ${blade.datasource.test.ztznwh.password} |
| | | ## 定时器数据源 |
| | | xxljob: |
| | | url: ${blade.datasource.test.xxljob.url} |
| | | username: ${blade.datasource.test.xxljob.username} |
| | | password: ${blade.datasource.test.xxljob.password} |
| | | ## 智能外呼数据源(mysql) |
| | | znwh: |
| | | driver-class-name: ${blade.datasource.test.znwh.driver-class-name} |
| | | url: ${blade.datasource.test.znwh.url} |
| | | username: ${blade.datasource.test.znwh.username} |
| | | password: ${blade.datasource.test.znwh.password} |
| | | main: |
| | | allow-circular-references: true |
| | |
| | | <if test="param1!=null"> |
| | | <choose> |
| | | <when test="param2.super!=null and param1==0"> |
| | | and menu.parent_id = #{param1} and (menu.name = 'web' or menu.name = 'newWeb' or menu.name = 'app') |
| | | and menu.parent_id = #{param1} and (menu.name = 'web' or menu.name = 'newWeb' or menu.name='superWeb' or menu.name = 'app') |
| | | </when> |
| | | <otherwise> |
| | | and menu.parent_id = #{param1} |
| | |
| | | <!--查询菜单列表(排除 web,app 之外的菜单)--> |
| | | <select id="grantTreeNew" resultMap="treeNodeResultMap"> |
| | | select id, parent_id, name as title, id as "value", id as "key" from blade_menu |
| | | where is_deleted = 0 start with ( name = 'web' or name = 'app' or name = 'newWeb') CONNECT BY PRIOR id = parent_id order by sort asc |
| | | where is_deleted = 0 start with ( name = 'web' or name = 'app' or name = 'newWeb' or name ='superWeb') CONNECT BY PRIOR id = parent_id order by sort asc |
| | | </select> |
| | | |
| | | </mapper> |
| | |
| | | |
| | | List<MenuVO> list = routes.stream().filter(r -> Func.equals(r.getAlias(), "web")).collect(Collectors.toList()); |
| | | list.addAll(routes.stream().filter(r -> Func.equals(r.getAlias(), "newWeb")).collect(Collectors.toList())); |
| | | list.addAll(routes.stream().filter(r -> Func.equals(r.getAlias(), "superWeb")).collect(Collectors.toList())); |
| | | if (list.size()>0){ |
| | | MenuVO menuVO = list.get(0); |
| | | // int level = 0; |
| | |
| | | <artifactId>skjcmanager-system-api</artifactId> |
| | | <version>3.0.1.RELEASE</version> |
| | | </dependency> |
| | | <dependency> |
| | | <groupId>cn.gistack</groupId> |
| | | <artifactId>skjcmanager-pwd-api</artifactId> |
| | | <version>3.0.1.RELEASE</version> |
| | | </dependency> |
| | | </dependencies> |
| | | |
| | | <build> |
| | |
| | | return R.data(service.list()); |
| | | } |
| | | |
| | | @GetMapping(ENCRYPT_USER) |
| | | @Override |
| | | public String encryptUser() { |
| | | //查询所有用户 |
| | | List<User> list = service.list(); |
| | | int count = 0; |
| | | |
| | | for (User user : list){ |
| | | boolean b = service.updateById(user); |
| | | if (b){ |
| | | count++; |
| | | } |
| | | } |
| | | return "共:<span style='color:red'>"+ list.size() + "</span>名用户,成功加密:<span style='color:red'>"+ count + "</span>名用户"; |
| | | } |
| | | |
| | | } |
| | |
| | | package cn.gistack.system.user.service.impl; |
| | | |
| | | |
| | | import cn.gistack.pwd.dto.CBCResultDTO; |
| | | import cn.gistack.pwd.dto.ResultDTO; |
| | | import cn.gistack.pwd.fegin.IPwdClient; |
| | | import cn.gistack.system.cache.DictCache; |
| | | import cn.gistack.system.cache.ParamCache; |
| | | import cn.gistack.system.cache.SysCache; |
| | |
| | | import cn.gistack.system.user.service.IUserDeptService; |
| | | import cn.gistack.system.user.service.IUserOauthService; |
| | | import cn.gistack.system.user.service.IUserService; |
| | | import cn.gistack.system.user.supo.UserSUPO; |
| | | import cn.gistack.system.user.vo.UserVO; |
| | | import com.alibaba.fastjson.JSONObject; |
| | | import com.baomidou.mybatisplus.core.conditions.Wrapper; |
| | | import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; |
| | | import com.baomidou.mybatisplus.core.metadata.IPage; |
| | |
| | | private final ISysClient sysClient; |
| | | private final BladeTenantProperties tenantProperties; |
| | | |
| | | private final IPwdClient pwdClient; |
| | | |
| | | @Override |
| | | @Transactional(rollbackFor = Exception.class) |
| | | public boolean submit(User user) { |
| | |
| | | return save(user) && submitUserDept(user); |
| | | } |
| | | |
| | | public Boolean encryptUserInfo(User user){ |
| | | UserSUPO userSUPO = new UserSUPO(); |
| | | userSUPO.setPhone(user.getPhone()); |
| | | userSUPO.setRoleId(user.getRoleId()); |
| | | userSUPO.setDeptId(user.getDeptId()); |
| | | |
| | | String message = JSONObject.toJSONString(userSUPO); |
| | | |
| | | R<CBCResultDTO> cbcRres = pwdClient.getCBCMacEncipher(message); |
| | | if (cbcRres.getCode() != 200){ |
| | | return false; |
| | | } |
| | | CBCResultDTO data = cbcRres.getData(); |
| | | String keyIndex = data.getKeyIndex(); |
| | | String maced = data.getMaced(); |
| | | String sm4IV = data.getSm4IV(); |
| | | |
| | | user.setKeyindexs(keyIndex); |
| | | user.setMaced(maced); |
| | | user.setSm4iv(sm4IV); |
| | | |
| | | R<ResultDTO> encryptRes = pwdClient.getEncrypt(sm4IV, keyIndex, message); |
| | | if (encryptRes.getCode() != 200){ |
| | | return false; |
| | | } |
| | | user.setEncdata(encryptRes.getData().getData()); |
| | | |
| | | return true; |
| | | } |
| | | |
| | | |
| | | @Override |
| | | public boolean save(User entity) { |
| | | //对User进行加密 |
| | | encryptUserInfo(entity); |
| | | return super.save(entity); |
| | | } |
| | | |
| | | @Override |
| | | @Transactional(rollbackFor = Exception.class) |
| | | public boolean updateUser(User user) { |
| | |
| | | return updateById(user); |
| | | } |
| | | |
| | | @Override |
| | | public boolean updateById(User entity) { |
| | | |
| | | encryptUserInfo(entity); |
| | | |
| | | return super.updateById(entity); |
| | | } |
| | | |
| | | private boolean submitUserDept(User user) { |
| | | List<Long> deptIdList = Func.toLongList(user.getDeptId()); |
| | | List<UserDept> userDeptList = new ArrayList<>(); |
| | |
| | | <artifactId>skjcmanager-nky-api</artifactId> |
| | | <version>3.0.1.RELEASE</version> |
| | | </dependency> |
| | | <dependency> |
| | | <groupId>cn.gistack</groupId> |
| | | <artifactId>skjcmanager-user-api</artifactId> |
| | | <version>3.0.1.RELEASE</version> |
| | | </dependency> |
| | | </dependencies> |
| | | |
| | | <build> |
| | |
| | | // 返回 |
| | | return ReturnT.SUCCESS; |
| | | } |
| | | |
| | | /** |
| | | * 策略19: 大坝安全监测告警-监测数据缺失-定时任务执行器 |
| | | * @param param |
| | | * @return |
| | | * @throws Exception |
| | | */ |
| | | @XxlJob("damSafetyHandle") |
| | | public ReturnT<String> damSafetyHandle(String param){ |
| | | XxlJobLogger.log("开始执行任务..."); |
| | | // 创建外呼任务 |
| | | noticeClient.createAlarmNoticeTaskJobHandler("监测数据缺失","","damSafetyHandle"); |
| | | XxlJobLogger.log("结束自动创建任务..."); |
| | | // 返回 |
| | | return ReturnT.SUCCESS; |
| | | } |
| | | } |
| | |
| | | XxlJobLogger.log("总数量:<span style='color:red'>" + taskJobHandler.get(0) + "</span> ... 失败数量:<span style='color:red'>" + taskJobHandler.get(1) + "</span> "); |
| | | return ReturnT.SUCCESS; |
| | | } |
| | | |
| | | /** |
| | | * 给巡查责任人定时创建任务执行器 |
| | | * @param param |
| | | * @return |
| | | * @throws Exception |
| | | */ |
| | | @XxlJob("createTaskJobByConditionHandler") |
| | | public ReturnT<String> createTaskJobByConditionHandler(String param){ |
| | | XxlJobLogger.log("开始自动创建任务..."); |
| | | JSONObject jsonParam = JSON.parseObject(param); |
| | | String processDefinitionId = jsonParam.getString("processDefinitionId"); |
| | | String taskType = jsonParam.getString("taskType"); |
| | | String title = jsonParam.getString("title"); |
| | | String content = jsonParam.getString("content"); |
| | | // 远程调用 |
| | | List<Integer> taskJobHandler = patrolTasClient.createTaskJobByConditionHandler(processDefinitionId, taskType, title, content); |
| | | // 打印响应数据 |
| | | XxlJobLogger.log("结束自动创建任务..."); |
| | | XxlJobLogger.log("总数量:<span style='color:red'>" + taskJobHandler.get(0) + "</span> ... 失败数量:<span style='color:red'>" + taskJobHandler.get(1) + "</span> "); |
| | | return ReturnT.SUCCESS; |
| | | } |
| | | } |
| | |
| | | package cn.gistack.job.executor.jobhandler; |
| | | |
| | | import cn.gistack.sm.sjztmd.feign.IAttResManagePersonClient; |
| | | import cn.gistack.system.user.feign.IUserClient; |
| | | import com.xxl.job.core.biz.model.ReturnT; |
| | | import com.xxl.job.core.handler.annotation.XxlJob; |
| | | import com.xxl.job.core.log.XxlJobLogger; |
| | |
| | | @Autowired |
| | | private IAttResManagePersonClient attResManagePersonClient; |
| | | |
| | | @Autowired |
| | | private IUserClient userClient; |
| | | |
| | | /** |
| | | * 用户同步调度器 |
| | | * @return |
| | |
| | | return ReturnT.SUCCESS; |
| | | } |
| | | |
| | | /** |
| | | * 用户同步调度器 |
| | | * @return |
| | | */ |
| | | @XxlJob("encryptUserJobHandler") |
| | | public ReturnT<String> encryptUser(String param) { |
| | | XxlJobLogger.log("开始更新用户数据"); |
| | | |
| | | String message = userClient.encryptUser(); |
| | | XxlJobLogger.log(message); |
| | | XxlJobLogger.log("结束更新用户数据"); |
| | | return ReturnT.SUCCESS; |
| | | } |
| | | |
| | | } |
| New file |
| | |
| | | #多数据源配置 |
| | | spring: |
| | | #排除DruidDataSourceAutoConfigure |
| | | autoconfigure: |
| | | exclude: com.alibaba.druid.spring.boot.autoconfigure.DruidDataSourceAutoConfigure |
| | | datasource: |
| | | dynamic: |
| | | #设置默认的数据源或者数据源组,默认值即为master |
| | | primary: master |
| | | datasource: |
| | | master: |
| | | url: ${blade.datasource.test.url} |
| | | username: ${blade.datasource.test.username} |
| | | password: ${blade.datasource.test.password} |
| | | zt: |
| | | url: ${blade.datasource.test.zt.url} |
| | | username: ${blade.datasource.test.zt.username} |
| | | password: ${blade.datasource.test.zt.password} |
| | | # 智能外呼数据库 |
| | | ztznwh: |
| | | url: ${blade.datasource.test.ztznwh.url} |
| | | username: ${blade.datasource.test.ztznwh.username} |
| | | password: ${blade.datasource.test.ztznwh.password} |
| | | ## 定时器数据源 |
| | | xxljob: |
| | | url: ${blade.datasource.test.xxljob.url} |
| | | username: ${blade.datasource.test.xxljob.username} |
| | | password: ${blade.datasource.test.xxljob.password} |
| | | main: |
| | | allow-circular-references: true |
| | | |
| | | xxl: |
| | | job: |
| | | accessToken: '' |
| | | admin: |
| | | addresses: ${xxl.job.test.addresses} |
| | | executor: |
| | | appname: blade-xxljob |
| | | ip: ${xxl.job.test.ip} |
| | | logpath: ${xxl.job.test.logpath} |
| | | logretentiondays: -1 |
| | | port: ${xxl.job.test.port} |