Browse Source

项目迭代

Astrid Wang 2 years ago
parent
commit
e819c8c80d

+ 5 - 0
pom.xml

@@ -111,6 +111,11 @@
             <version>1.9.1</version>
         </dependency>
 
+        <dependency>
+            <groupId>com.google.code.gson</groupId>
+            <artifactId>gson</artifactId>
+            <version>2.8.2</version>
+        </dependency>
 
     </dependencies>
 

+ 357 - 2
src/main/java/com/chuanghai/h3c_reporting/controller/InformationReportingController.java

@@ -1,29 +1,50 @@
 package com.chuanghai.h3c_reporting.controller;
 
+import com.alibaba.fastjson.JSON;
+import com.alibaba.fastjson.JSONObject;
+import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
+import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
 import com.chuanghai.h3c_reporting.anno.AdminLoginCheck;
 import com.chuanghai.h3c_reporting.bo.CloseReporting;
 import com.chuanghai.h3c_reporting.bo.DeleteReporting;
+import com.chuanghai.h3c_reporting.bo.ValidReporting;
+import com.chuanghai.h3c_reporting.common.http.HttpsClient;
 import com.chuanghai.h3c_reporting.common.utils.CommonResult;
 import com.chuanghai.h3c_reporting.common.utils.PageUtils;
 import com.chuanghai.h3c_reporting.controller.request.ReportQueryRequest;
 import com.chuanghai.h3c_reporting.dto.ReportingDownloadDTO;
 import com.chuanghai.h3c_reporting.entity.InformationReporting;
+import com.chuanghai.h3c_reporting.entity.SubscribeMessages;
 import com.chuanghai.h3c_reporting.entity.User;
 import com.chuanghai.h3c_reporting.service.InformationReportingService;
+import com.chuanghai.h3c_reporting.service.SubscribeMessagesService;
 import com.chuanghai.h3c_reporting.vo.InformationReportingVO;
+import com.sun.scenario.effect.impl.sw.sse.SSEBlend_SRC_OUTPeer;
 import lombok.extern.slf4j.Slf4j;
 import org.apache.ibatis.annotations.Param;
 import org.apache.tomcat.util.buf.StringUtils;
 import org.springframework.beans.BeanUtils;
 import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.beans.factory.annotation.Value;
+import org.springframework.http.ResponseEntity;
+import org.springframework.scheduling.annotation.Scheduled;
 import org.springframework.web.bind.annotation.*;
+import org.springframework.web.client.RestTemplate;
 
 import javax.servlet.http.HttpServletResponse;
 import javax.validation.Valid;
+import java.io.BufferedReader;
+import java.io.IOException;
+import java.io.InputStream;
+import java.io.InputStreamReader;
+import java.net.HttpURLConnection;
+import java.net.URL;
+import java.net.URLConnection;
 import java.time.LocalDateTime;
 import java.util.ArrayList;
 import java.util.Arrays;
 import java.util.List;
+import java.util.Map;
 
 /**
  * 报备模块
@@ -41,11 +62,25 @@ public class InformationReportingController {
     @Autowired
     private InformationReportingService informationReportingService;
 
+    @Autowired
+    private SubscribeMessagesService subscribeMessagesService;
+
+    @Value("${wx.app_id}")
+    private String appID;
+
+    @Value("${wx.secret}")
+    private String secret;
+
+    @Value("${wx.template_id}")
+    private String template_id;
+
+    private String access_token = "";
+
     /**
      * 信息上传
      */
     @PostMapping("/add")
-    public CommonResult<String> add(@Valid @RequestBody InformationReportingVO staffEntity) {
+    public CommonResult<String> add(@Valid @RequestBody InformationReportingVO staffEntity) throws IOException{
 
         String product = StringUtils.join(Arrays.asList(staffEntity.getBProduct()), ',');
         staffEntity.setProduct(product);
@@ -59,8 +94,16 @@ public class InformationReportingController {
         BeanUtils.copyProperties(staffEntity, reporting);
         LocalDateTime localDateTime = LocalDateTime.now();
         reporting.setReportingTime(localDateTime);
-        reporting.setStatus(1);
+
+        //Astrid Wang更改---1变为2,进行中变为已提交
+        reporting.setStatus(2);
         reporting.setDelStatus(1);
+
+        //String openid = getOpenId(staffEntity.getCode());
+        String openid = getOpenidByCode(staffEntity.getCode());
+
+        reporting.setOpenid(openid);
+
         boolean flag = informationReportingService.save(reporting);
         if (flag) {
             log.info("上传信息=========>>> 【{}】【微信绑定手机号:{}】成功上传了编号为【{}】的项目信息", reporting.getName(), reporting.getWxPhone(), reporting.getId());
@@ -118,6 +161,318 @@ public class InformationReportingController {
     }
 
     /**
+     * @author Astrid Wang
+     *
+     * 有效
+     *
+     */
+    @AdminLoginCheck
+    @DeleteMapping("/valid")
+    public CommonResult<String> valid(@RequestHeader("admin_token") String adminToken,
+                                      @RequestBody ValidReporting reporting) {
+
+        //根据 项目id 查询 openid
+        InformationReporting in = informationReportingService.getById(reporting.getItemId());
+
+        //System.out.println(in);
+
+        String openid = in.getOpenid();
+
+        //System.out.println(openid);
+
+        //向方法传入openid、ps、title
+        String ps = reporting.getPs();
+        String a = send(openid,ps,"项目有效");
+
+        //System.out.println(ps);
+        //System.out.println(a);
+        //System.out.println(a);
+
+        //变status状态
+        InformationReporting reporting1 = new InformationReporting();
+        reporting1.setId(reporting.getItemId());
+        //点击‘有效’变为‘进行中’---1
+        reporting1.setStatus(1);
+
+        boolean flag = informationReportingService.updateById(reporting1);
+        if (flag) {
+            log.info("点击<有效>的操作,成功,状态变为进行中=========>>> 管理员【{}】【id:{}】点击<有效>的操作成功,将编号为【{}】的项目状态变为进行中", reporting.getName(), reporting.getId(), reporting.getItemId());
+            return CommonResult.ok();
+        } else {
+            log.info("点击<有效>的操作,失败=========>>> 管理员【{}】【id:{}】点击<有效>的操作失败,将编号为【{}】的项目状态转换的操作失败", reporting.getName(), reporting.getId(), reporting.getItemId());
+            return CommonResult.fail();
+        }
+    }
+
+    /**
+     * @author Astrid Wang
+     *
+     * 失效
+     *
+     */
+    @AdminLoginCheck
+    @DeleteMapping("/invalid")
+    public CommonResult<String> invalid(@RequestHeader("admin_token") String adminToken,
+                                      @RequestBody ValidReporting reporting) {
+
+        /*//根据 项目id 查询 openid
+        QueryWrapper<SubscribeMessages> queryWrapper = new QueryWrapper<>();
+        queryWrapper.eq("id",reporting.getItemId());
+        SubscribeMessages messages = subscribeMessagesService.getOne(queryWrapper);
+        String openid = messages.getOpenid();
+        //System.out.println(openid);*/
+
+        //根据 项目id 查询 openid
+        InformationReporting in = informationReportingService.getById(reporting.getItemId());
+
+        //System.out.println(in);
+
+        String openid = in.getOpenid();
+
+        //System.out.println(openid);
+
+        //向方法传入openid、ps、title
+        String ps = reporting.getPs();
+        String a = send(openid,ps,"项目失效");
+
+        //System.out.println(ps);
+        //System.out.println(a);
+
+        //变status状态
+        InformationReporting reporting1 = new InformationReporting();
+        reporting1.setId(reporting.getItemId());
+        //点击‘失效’变为‘已失效’---3
+        reporting1.setStatus(3);
+
+        boolean flag = informationReportingService.updateById(reporting1);
+        if (flag) {
+            log.info("点击<失效>的操作,成功,状态变为已失效=========>>> 管理员【{}】【id:{}】点击<失效>的操作成功,将编号为【{}】的项目状态变为已失效", reporting.getName(), reporting.getId(), reporting.getItemId());
+            return CommonResult.ok();
+        } else {
+            log.info("点击<失效>的操作,失败=========>>> 管理员【{}】【id:{}】点击<失效>的操作失败,将编号为【{}】的项目状态转换的操作失败", reporting.getName(), reporting.getId(), reporting.getItemId());
+            return CommonResult.fail();
+        }
+    }
+
+    // 获取access_token
+    //@Scheduled(cron = "0 59 0/1 * * ?")   // 每1小时59分,执行一次刷新access_token
+    public void getAccessToken() {
+
+        String url = "https://api.weixin.qq.com/cgi-bin/token?" +
+                "grant_type=client_credential" +
+                "&appid=" + appID +
+                "&secret=" + secret;
+
+        RestTemplate restTemplate = new RestTemplate();
+
+        ResponseEntity<String> responseEntity = restTemplate.getForEntity(url, String.class);
+        JSONObject objParam = JSON.parseObject(responseEntity.getBody());
+
+        for (Map.Entry<String, Object> entry : objParam.entrySet()) {
+            Object o = entry.getValue();
+            if (o instanceof String) {
+                if (entry.getKey().equals("access_token")) {
+                    access_token = (String) entry.getValue();
+                }
+            }
+        }
+    }
+
+    /**
+     * 小程序订阅消息
+     */
+    public String send(String openid,String ps,String title){
+
+        // access_token是存在有效期的,过期就刷新
+        if (access_token.equals("")) {
+            getAccessToken();
+        }
+
+        JSONObject message = new JSONObject();
+        message.put("touser", openid);
+        message.put("template_id", template_id);
+        message.put("page", "index");
+        message.put("miniprogram_state", "formal");
+        message.put("lang", "zh_CN");
+
+        JSONObject data = new JSONObject();
+
+        // 审核结果
+        JSONObject thing1 = new JSONObject();
+        thing1.put("value", title);//变为title
+        // 备注
+        JSONObject thing5 = new JSONObject();
+        thing5.put("value", ps);
+
+        // 审核结果
+        data.put("thing1",thing1);
+        // 备注
+        data.put("thing5",thing5);
+
+        message.put("data", data);
+        System.out.println(message);
+        return HttpsClient.sendJson("https://api.weixin.qq.com/cgi-bin/message/subscribe/send?access_token="+access_token, message);
+    }
+
+    public String getOpenId(String code) throws IOException {
+
+        // access_token是存在有效期的,过期就刷新
+        if (access_token.equals("")) {
+            getAccessToken();
+        }
+        // 构造请求URL
+        //String requestUrl = OPENID_URL + "?appid=" + appID + "&secret=" + secret + "&code=" + code + "&grant_type=authorization_code";
+        String requestUrl = "https://api.weixin.qq.com/sns/jscode2session?appid=" + appID + "&secret=" + secret + "&code=" + code + "&grant_type=authorization_code";
+
+        // 发送请求并获取响应
+        URL url = new URL(requestUrl);
+        HttpURLConnection connection = (HttpURLConnection) url.openConnection();
+        connection.setRequestMethod("GET");
+        connection.setDoOutput(true);
+        connection.setDoInput(true);
+        connection.connect();
+        InputStream inputStream = connection.getInputStream();
+        BufferedReader reader = new BufferedReader(new InputStreamReader(inputStream));
+        StringBuilder stringBuilder = new StringBuilder();
+        String line;
+        while ((line = reader.readLine()) != null) {
+            stringBuilder.append(line);
+        }
+        reader.close();
+        connection.disconnect();
+
+        // 解析响应结果,提取openid
+        String response = stringBuilder.toString();
+        String openid = null;
+        if (response.contains("openid")) {
+            int beginIndex = response.indexOf("openid") + 9;
+            int endIndex = response.indexOf("\"", beginIndex);
+            openid = response.substring(beginIndex, endIndex);
+        }
+
+        //String openid="1234512345123451234512345123";
+
+        return openid;
+    }
+
+    public String getOpenidByCode(String code) {
+        //页面获取openId接口
+        String getopenid_url = "https://api.weixin.qq.com/sns/jscode2session";
+
+
+        String param = "appid=" + appID + "&secret=" + secret + "&js_code=" + code + "&grant_type=authorization_code";
+
+//            //向微信服务器发送get请求获取openIdStr
+        String openIdStr = this.sendGet(getopenid_url, param);
+
+        System.out.println("微信返回结果: " + openIdStr);
+
+        JSONObject json = JSONObject.parseObject(openIdStr);//转成Json格式
+
+        String openId = json.getString("openid");//获取openId
+
+        return openId;
+    }
+
+    /**
+     * 向指定URL发送GET方法的请求
+     *
+     * @param url   发送请求的URL
+     * @param param 请求参数,请求参数应该是 name1=value1&name2=value2 的形式。
+     * @return URL 所代表远程资源的响应结果
+     */
+
+    public String sendGet(String url, String param) {
+
+        String result = "";
+
+        BufferedReader in = null;
+
+        try {
+
+            String urlNameString = url + "?" + param;
+
+//            System.out.println(urlNameString);
+
+            URL realUrl = new URL(urlNameString);
+
+// 打开和URL之间的连接
+
+            URLConnection connection = realUrl.openConnection();
+
+// 设置通用的请求属性
+
+            connection.setRequestProperty("accept", "*/*");
+
+            connection.setRequestProperty("connection", "Keep-Alive");
+
+            connection.setRequestProperty("user-agent",
+
+                    "Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1;SV1)");
+
+// 建立实际的连接
+
+            connection.connect();
+
+// 获取所有响应头字段
+
+            Map<String, List<String>> map = connection.getHeaderFields();
+
+// 遍历所有的响应头字段
+
+            for (String key : map.keySet()) {
+
+                System.out.println(key + "--->" + map.get(key));
+
+            }
+
+// 定义 BufferedReader输入流来读取URL的响应
+
+            in = new BufferedReader(new InputStreamReader(
+
+                    connection.getInputStream()));
+
+            String line;
+
+            while ((line = in.readLine()) != null) {
+
+                result += line;
+
+            }
+
+        } catch (Exception e) {
+
+            System.out.println("发送GET请求出现异常!" + e);
+
+            e.printStackTrace();
+
+        }
+
+// 使用finally块来关闭输入流
+
+        finally {
+
+            try {
+
+                if (in != null) {
+
+                    in.close();
+
+                }
+
+            } catch (Exception e2) {
+
+                e2.printStackTrace();
+
+            }
+
+        }
+
+        return result;
+
+    }
+
+    /**
      * 项目列表
      */
     @AdminLoginCheck

+ 169 - 7
src/main/java/com/chuanghai/h3c_reporting/controller/WxController.java

@@ -2,9 +2,18 @@ package com.chuanghai.h3c_reporting.controller;
 
 import com.alibaba.fastjson.JSON;
 import com.alibaba.fastjson.JSONObject;
+import com.baomidou.mybatisplus.core.conditions.interfaces.Func;
 import com.chuanghai.h3c_reporting.common.exception.BizCodeEnume;
 import com.chuanghai.h3c_reporting.common.exception.RRException;
+import com.chuanghai.h3c_reporting.common.http.HttpsClient;
 import com.chuanghai.h3c_reporting.common.utils.CommonResult;
+import com.chuanghai.h3c_reporting.entity.InformationReporting;
+import com.chuanghai.h3c_reporting.entity.Message;
+import com.chuanghai.h3c_reporting.entity.SubscribeMessages;
+import com.chuanghai.h3c_reporting.entity.TemplateData;
+import com.chuanghai.h3c_reporting.service.SubscribeMessagesService;
+import org.springframework.beans.BeanUtils;
+import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.beans.factory.annotation.Value;
 import org.springframework.http.HttpEntity;
 import org.springframework.http.HttpHeaders;
@@ -16,19 +25,25 @@ import org.springframework.web.bind.annotation.RequestMapping;
 import org.springframework.web.bind.annotation.ResponseBody;
 import org.springframework.web.client.RestTemplate;
 
+import java.io.*;
+import java.net.HttpURLConnection;
+import java.net.URL;
+import java.net.URLEncoder;
+import java.time.LocalDateTime;
 import java.util.HashMap;
 import java.util.Map;
+import java.util.Objects;
+import java.util.Set;
+import java.util.stream.Collectors;
+
+import com.google.gson.Gson;
+import com.google.gson.reflect.TypeToken;
+import lombok.extern.slf4j.Slf4j;
 
 /**
  * 获取微信绑定手机号
- *
- * @Author 浮生
- * @Date 2023/3/12 14:46
- * @PackageName:com.chuanghai.h3c_reporting.controller
- * @ClassName: WxController
- * @Description: TODO
- * @Version 1.0
  */
+@Slf4j
 @Controller
 @RequestMapping("/wx")
 public class WxController {
@@ -39,8 +54,19 @@ public class WxController {
     @Value("${wx.secret}")
     private String secret;
 
+    @Value("${wx.template_id}")
+    private String template_id;
+
     private String access_token = "";
 
+    InformationReporting reporting = new InformationReporting();
+
+    @Autowired
+    private SubscribeMessagesService subscribeMessagesService;
+
+    // 微信开放平台获取openid的接口
+//    private static final String OPENID_URL = "https://api.weixin.qq.com/sns/jscode2session";
+
     /**
      * 通过code换取用户手机号
      */
@@ -106,4 +132,140 @@ public class WxController {
 //        return access_token;
     }
 
+
+    /**
+     * 获取用户在微信中的openid
+     *
+     * @param code 用户授权后得到的code
+     * @return 用户的openid
+     */
+    @GetMapping("/getOpenId")
+    @ResponseBody
+    public String getOpenId(String code) throws IOException {
+
+        // access_token是存在有效期的,过期就刷新
+        if (access_token.equals("")) {
+            getAccessToken();
+        }
+        // 构造请求URL
+        //String requestUrl = OPENID_URL + "?appid=" + appID + "&secret=" + secret + "&code=" + code + "&grant_type=authorization_code";
+        String requestUrl = "https://api.weixin.qq.com/sns/jscode2session?appid=" + appID + "&secret=" + secret + "&code=" + code + "&grant_type=authorization_code";
+
+        // 发送请求并获取响应
+        URL url = new URL(requestUrl);
+        HttpURLConnection connection = (HttpURLConnection) url.openConnection();
+        connection.setRequestMethod("GET");
+        connection.setDoOutput(true);
+        connection.setDoInput(true);
+        connection.connect();
+        InputStream inputStream = connection.getInputStream();
+        BufferedReader reader = new BufferedReader(new InputStreamReader(inputStream));
+        StringBuilder stringBuilder = new StringBuilder();
+        String line;
+        while ((line = reader.readLine()) != null) {
+            stringBuilder.append(line);
+        }
+        reader.close();
+        connection.disconnect();
+
+        // 解析响应结果,提取openid
+        String response = stringBuilder.toString();
+        String openid = null;
+        if (response.contains("openid")) {
+            int beginIndex = response.indexOf("openid") + 9;
+            int endIndex = response.indexOf("\"", beginIndex);
+            openid = response.substring(beginIndex, endIndex);
+        }
+
+        //模拟数据
+        //System.out.println(code);
+        //String openid = "1234512345123451234512345123";
+
+        System.out.println(openid);
+        return openid;
+/*        SubscribeMessages subscribeMessages = new SubscribeMessages();
+
+        subscribeMessages.setId(id);
+        subscribeMessages.setOpenid(openid);*/
+
+/*        boolean flag = subscribeMessagesService.save(subscribeMessages);
+        if (flag) {
+            log.info("保存openid成功");
+            return CommonResult.ok();
+        } else {
+            log.info("保存openid失败");
+            return CommonResult.fail();
+        }*/
+
+    }
+    /*
+    * 小程序订阅消息
+    *
+    * 前端传 openid,审核结果result,备注ps
+    * */
+   /* @GetMapping("/send")
+    public String send(String openid,String ps) throws Exception {
+
+        // access_token是存在有效期的,过期就刷新
+        if (access_token.equals("")) {
+            getAccessToken();
+        }
+
+        //拿到审核结果
+        InformationReporting reporting1 = new InformationReporting();
+        //String title = reporting1.getTitle();
+
+        JSONObject message = new JSONObject();
+        message.put("touser", openid);
+        message.put("template_id", template_id);
+        message.put("page", "index");
+        message.put("miniprogram_state", "formal");
+        message.put("lang", "zh_CN");
+
+        JSONObject data = new JSONObject();
+
+        // 审核结果
+        JSONObject thing1 = new JSONObject();
+        thing1.put("value", title);//变为title
+
+        // 备注
+        JSONObject thing5 = new JSONObject();
+        thing5.put("value", ps);
+
+        // 审核结果
+        data.put("thing1",thing1);
+        // 备注
+        data.put("thing5",thing5);
+
+        message.put("data", data);
+        System.out.println(message);
+        return HttpsClient.sendJson("https://api.weixin.qq.com/cgi-bin/message/subscribe/send?access_token="+access_token, message);
+    }*/
+
+    //发送订阅消息
+    /*private String push(String openid) throws Exception{
+        RestTemplate restTemplate = new RestTemplate();
+
+        // access_token是存在有效期的,过期就刷新
+        if (access_token.equals("")) {
+            getAccessToken();
+        }
+        //getAccessToken
+        // 没有加redis,每次获取最新的sendURL
+        String url = "https://api.weixin.qq.com/cgi-bin/message/subscribe/send?access_token=" + access_token;
+        //拼接推送的模版
+        Message message = new Message();
+        message.setTouser(openid);//用户的openid
+        message.setTemplate_id(template_id);//订阅消息模板id
+        //message.setPage("pages/index/index");
+
+        Map<String, TemplateData> m = new HashMap<>();
+        m.put("thing1", new TemplateData("审核结果"));
+        m.put("thing5", new TemplateData("备注"));
+
+        message.setData(m);
+        ResponseEntity<String> responseEntity =
+                restTemplate.postForEntity(url, message, String.class);
+        return responseEntity.getBody();
+    }*/
 }

+ 2 - 2
src/main/java/com/chuanghai/h3c_reporting/conver/StatusConverter.java

@@ -27,11 +27,11 @@ public class StatusConverter implements Converter<Integer> {
 
     @Override
     public Integer convertToJavaData(CellData cellData, ExcelContentProperty contentProperty, GlobalConfiguration globalConfiguration) throws Exception {
-        return cellData.getStringValue().equals("进行中") ? 1 : 0;
+        return cellData.getStringValue().equals("已提交") ? 2 : 0;
     }
 
     @Override
     public CellData convertToExcelData(Integer value, ExcelContentProperty contentProperty, GlobalConfiguration globalConfiguration) throws Exception {
-        return new CellData(value == 1 ? "进行中" : "已关闭");
+        return new CellData(value == 1 ? "进行中" : (value == 2 ? "已提交" :(value == 3 ? "已失效" : "已关闭")));
     }
 }

+ 23 - 7
src/main/java/com/chuanghai/h3c_reporting/entity/InformationReporting.java

@@ -88,7 +88,7 @@ public class InformationReporting implements Serializable {
     /**
      * 项目基本情况
      */
-    @ExcelProperty(value = "项目基本情况", index = 10)
+    @ExcelProperty(value = "项目基本情况", index = 12)
     @ColumnWidth(35)
     private String content;
 
@@ -100,16 +100,30 @@ public class InformationReporting implements Serializable {
     private String trade;
 
     /**
+     * 是否授权-----新需求
+     */
+    @ExcelProperty(value = "是否授权", index = 8)
+    @ColumnWidth(15)
+    private String licensing;
+
+    /**
      * 产品类型
      */
-    @ExcelProperty(value = "产品类型", index = 8)
+    @ExcelProperty(value = "产品类型", index = 9)
     @ColumnWidth(20)
     private String product;
 
     /**
+     * 控标参数-----新需求
+     */
+    @ExcelProperty(value = "加入的控标参数", index = 10)
+    @ColumnWidth(35)
+    private String parameters;
+
+    /**
      * 附件材料
      */
-    @ExcelProperty(value = "附件材料", index = 11)
+    @ExcelProperty(value = "附件材料", index = 13)
     @ColumnWidth(20)
     private String file;
 
@@ -118,7 +132,7 @@ public class InformationReporting implements Serializable {
      * 提交时间
      */
     @ColumnWidth(20)
-    @ExcelProperty(value = "提交时间", converter = LocalDateTimeConverter.class, index = 12)
+    @ExcelProperty(value = "提交时间", converter = LocalDateTimeConverter.class, index = 14)
     @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
     private LocalDateTime reportingTime;
 
@@ -130,11 +144,13 @@ public class InformationReporting implements Serializable {
     private Integer delStatus;
 
     /**
-     * 项目状态:0已关闭 1进行中
+     * 项目状态:0已关闭 1进行中 2已提交 3已失效
      */
-    @ExcelProperty(value = "项目状态", converter = StatusConverter.class, index = 9)
+    @ExcelProperty(value = "项目状态", converter = StatusConverter.class, index = 11)
     @ColumnWidth(15)
-    @Pattern(regexp = "[0-1]", message = "项目状态只能为0或1")
+    @Pattern(regexp = "[0-3]", message = "项目状态为0、1、2、3中的一个")
     private Integer status;
 
+    private String openid;
+
 }

+ 17 - 3
src/main/java/com/chuanghai/h3c_reporting/vo/InformationReportingVO.java

@@ -1,5 +1,7 @@
 package com.chuanghai.h3c_reporting.vo;
 
+import com.alibaba.excel.annotation.ExcelProperty;
+import com.alibaba.excel.annotation.write.style.ColumnWidth;
 import com.baomidou.mybatisplus.annotation.TableField;
 import com.fasterxml.jackson.annotation.JsonProperty;
 import lombok.Data;
@@ -73,11 +75,21 @@ public class InformationReportingVO {
     private String content;
 
     /**
+     * 控标参数-----新需求
+     */
+    private String parameters;
+
+    /**
      * 所属行业
      */
     @NotNull(message = "所属行业不能为空")
     private String trade;
 
+    /**
+     * 是否授权-----新需求
+     */
+    @NotNull(message = "是否授权不能为空")
+    private String licensing;
 
     private String product;
 
@@ -89,11 +101,13 @@ public class InformationReportingVO {
     @JsonProperty(value ="bProduct")
     private String[] bProduct;
 
-    /**
-     * 附件材料
-     */
+
+    //附件材料
     @JsonProperty(value ="bFile")
     private String[] bFile;
 
     private String file;
+
+    //传入code换取openid
+    private String code;
 }

+ 12 - 2
src/main/resources/application.yml

@@ -9,10 +9,19 @@ spring:
   main:
     allow-circular-references: true
   datasource:
-    url: jdbc:mysql://localhost:3306/h3c_reporting?characterEncoding=utf-8&useSSL=FALSE&useAffectedRows=TRUE&allowMultiQueries=true&serverTimezone=GMT%2B8
+    url: jdbc:mysql://172.16.20.80:3306/h3c_reporting?characterEncoding=utf-8&useSSL=FALSE&useAffectedRows=TRUE&allowMultiQueries=true&serverTimezone=GMT%2B8
     driver-class-name: com.mysql.cj.jdbc.Driver
+    # 华三线上数据库
+#    userName: root
+#    password: h3creporting
+
+    # 创海测试服务器
     username: root
-    password: h3creporting
+    password: Chuanghai_test
+
+    # 开发
+#    username: root
+#    password: 123456
 
 mybatis-plus:
   mapper-locations: classpath:/mapper/ihotel/*.xml
@@ -35,6 +44,7 @@ my-security:
 wx:
   app_id: wxc0c7fcf01e0a3442
   secret: 5ef167b75add4e2d7a6a031b06946265
+  template_id: I3o8CRAiaaNbug3Ukkmv1t-pCIbzxU8OicqMWvdR9lc
 
 file:
   # 存

File diff suppressed because it is too large
+ 109 - 86
src/main/resources/static/doc/index.html


+ 13 - 1
src/main/resources/static/doc/search.js

@@ -31,10 +31,18 @@ api[1].list.push({
 });
 api[1].list.push({
     order: '4',
-    desc: '项目列表',
+    desc: '',
 });
 api[1].list.push({
     order: '5',
+    desc: '',
+});
+api[1].list.push({
+    order: '6',
+    desc: '项目列表',
+});
+api[1].list.push({
+    order: '7',
     desc: '信息导出',
 });
 api.push({
@@ -79,6 +87,10 @@ api[3].list.push({
     order: '1',
     desc: '通过code换取用户手机号',
 });
+api[3].list.push({
+    order: '2',
+    desc: '获取用户在微信中的openid',
+});
 api.push({
     alias: 'dict',
     order: '5',