Shanks 7 years ago
parent
commit
c2052816aa
19 changed files with 752 additions and 25 deletions
  1. 44 16
      src/main/java/com/ygj/yuemum/controller/admin/ImageUploadController.java
  2. 57 0
      src/main/java/com/ygj/yuemum/controller/equipment/EquipmentInfoController.java
  3. 27 0
      src/main/java/com/ygj/yuemum/controller/global/WeChatInfoController.java
  4. 16 0
      src/main/java/com/ygj/yuemum/controller/maternitymatron/JlServiceUserController.java
  5. 24 0
      src/main/java/com/ygj/yuemum/dao/equipment/EquipmentInfoDao.java
  6. 11 0
      src/main/java/com/ygj/yuemum/dao/global/WeChatInfoDao.java
  7. 9 0
      src/main/java/com/ygj/yuemum/domain/admin/JlServiceUserLog.java
  8. 9 0
      src/main/java/com/ygj/yuemum/domain/admin/Resume.java
  9. 68 0
      src/main/java/com/ygj/yuemum/domain/equipment/EquipmentInfo.java
  10. 22 0
      src/main/java/com/ygj/yuemum/domain/global/WeChatInfo.java
  11. 9 0
      src/main/java/com/ygj/yuemum/domain/maternitymatron/QueryServiceUserStock.java
  12. 60 0
      src/main/java/com/ygj/yuemum/service/equipment/EquipmentInfoService.java
  13. 229 0
      src/main/java/com/ygj/yuemum/service/global/WeChatInfoService.java
  14. 0 1
      src/main/java/com/ygj/yuemum/service/maternitymatron/JlServiceUserService.java
  15. 10 3
      src/main/resources/mybatis/mapper/admin/JlServiceUserLog.xml
  16. 15 5
      src/main/resources/mybatis/mapper/admin/ResumeMapper.xml
  17. 113 0
      src/main/resources/mybatis/mapper/equipment/EquipmentInfo.xml
  18. 0 0
      src/main/resources/mybatis/mapper/global/PackagesMapper.xml
  19. 29 0
      src/main/resources/mybatis/mapper/global/WeChatInfoMapper.xml

+ 44 - 16
src/main/java/com/ygj/yuemum/controller/admin/ImageUploadController.java

@@ -19,6 +19,7 @@ import java.text.ParseException;
 import java.text.SimpleDateFormat;
 import java.util.Date;
 import java.util.List;
+import java.util.UUID;
 
 
 @RestController
@@ -30,17 +31,17 @@ public class ImageUploadController {
     @Autowired
     private ResumeService resumeService;
     private ResourceLoader resourceLoader;
-    public static final String ROOT = "/usr/local/tomcat/tomcat7/webapps/resume/img/";
-    public static final String ResumeFile = "/usr/local/tomcat/tomcat7/webapps/resume/";
-    public static final String httpRoot = "http://yuesuo.yueguanjia.com/resume/img/";
-    public static final String httphtmlRoot = "http://yuesuo.yueguanjia.com/resume/";
-    public static final String modulePath = "/usr/local/tomcat/tomcat7/webapps/resume/resume.html";
+//    public static final String ROOT = "/usr/local/tomcat/tomcat7/webapps/resume/img/";
+//    public static final String ResumeFile = "/usr/local/tomcat/tomcat7/webapps/resume/";
+//    public static final String httpRoot = "http://yuesuo.yueguanjia.com/resume/img/";
+//    public static final String httphtmlRoot = "http://yuesuo.yueguanjia.com/resume/";
+//    public static final String modulePath = "/usr/local/tomcat/tomcat7/webapps/resume/resume.html";
 
-//    public static final String ROOT = "D:/apache-tomcat-9.0.6/webapps/resume/img/";
-//    public static final String ResumeFile = "D:/apache-tomcat-9.0.6/webapps/resume/";
-//    public static final String httpRoot = "http://localhost:8080/resume/img/";
-//    public static final String httphtmlRoot = "http://localhost:8080/resume/";
-//    public static final String modulePath = "E:/Yuemum/ygj-yuemum/src/main/resources/resume/resume.html";
+    public static final String ROOT = "D:/apache-tomcat-9.0.6/webapps/resume/img/";
+    public static final String ResumeFile = "D:/apache-tomcat-9.0.6/webapps/resume/";
+    public static final String httpRoot = "http://localhost:8080/resume/img/";
+    public static final String httphtmlRoot = "http://localhost:8080/resume/";
+    public static final String modulePath = "D:/apache-tomcat-9.0.6/webapps/resume/resume.html";
 
     @RequestMapping(value = "/upload", method = RequestMethod.GET)
     public String upload() {
@@ -52,7 +53,7 @@ public class ImageUploadController {
     public int uploadImg(@RequestParam("file") MultipartFile file,
                          @RequestParam(value = "id") Integer id,
                          @RequestParam(value = "type") Integer type) {
-//       照片类型 1:display 2:certificate 3:comment 4:service
+//       照片类型 1:display 2:certificate 3:comment 4:service 5:meal
         String folder = "";
         int dot = file.getOriginalFilename().lastIndexOf('.');
         String newName = file.getOriginalFilename().substring(dot);
@@ -106,12 +107,13 @@ public class ImageUploadController {
     }
     @PostMapping("/createResume")
     public String createResume(@ModelAttribute Photo photo) {
+        String urlName = UUID.randomUUID().toString().replace("-", "");
         try {
             JlServiceUser jlServiceUser  = jlServiceUserService.getResume(photo.getServant_code());
             File file = ResourceUtils.getFile(modulePath);
             BufferedReader br = new BufferedReader(new FileReader(file));
             Resume resume =new Resume();
-            Resume resumeold =new Resume();
+            Resume resumeold = new Resume();
             StringBuilder stringHtml = new StringBuilder();
             String str = "";
             String photoDisplay ="";
@@ -119,6 +121,8 @@ public class ImageUploadController {
             String certificatehref ="";
             String service ="";
             String servicehref ="";
+            String meal = "";
+            String mealhref = "";
             String comment ="";
             String littcomm = "";
             if(photo.getComment() == null){
@@ -128,6 +132,7 @@ public class ImageUploadController {
             if(photos.size() > 0 ) {
                 int stepcertificate = 0;
                 int stepservice = 0;
+                int stepmeal = 0;
                 for(Photo onePhoto:photos){
                     if(onePhoto.getPhoto_type() == 1){
                         if(onePhoto.getPhoto_path() !=null){
@@ -160,6 +165,19 @@ public class ImageUploadController {
                             stepservice++;
                         }
                     }
+                    if(onePhoto.getPhoto_type() == 5){
+                        if(onePhoto.getPhoto_path() !=null) {
+                            meal = meal+"<li class=\"poster-item zturn-item\">"+"\r\n"
+                                    + "<image class=\"zturn-item-image\" src='"+onePhoto.getPhoto_path()+"'></image>"+"\r\n"
+                                    +"</li>"+"\r\n";
+                            if(stepmeal == 0) {
+                                mealhref = mealhref + " <a href=\"javascript:void(0);\" value='"+stepmeal+"' class=\"indicator-list-item-service selected\"></a>" + "\r\n";
+                            }else {
+                                mealhref = mealhref + " <a href=\"javascript:void(0);\" value='"+stepmeal+"' class=\"indicator-list-item-service\"></a>" + "\r\n";
+                            }
+                            stepmeal++;
+                        }
+                    }
                     if(onePhoto.getPhoto_type() == 3){
                         comment = comment +"<a href=\"\"><img src='"+onePhoto.getPhoto_path()+"'/></a>"+"\r\n";
                         littcomm = littcomm + "<image class=\"resume-comments-list\" src=\"" +onePhoto.getPhoto_path() + "\"/>";
@@ -224,20 +242,28 @@ public class ImageUploadController {
                 str = str.replace("$cfstyle",certificatehref);
                 str = str.replace("$service",service);
                 str = str.replace("$scstyle",servicehref);
+                str = str.replace("$meal",meal);
+                str = str.replace("$smstyle",mealhref);
                 str = str.replace("$comment",comment);
                 str = str.replace("$littcomm",littcomm);
-                str = str.replace("$yuesaohref",httphtmlRoot+photo.getServant_code() + ".html");
+                str = str.replace("$ystitle","悦所-月嫂简历:"+jlServiceUser.getTruename());
+                str = str.replace("$yuesaohref",httphtmlRoot+ urlName + ".html");
                 stringHtml.append(str+"\r\n");
             }
             resumeold = resumeService.getResume(photo.getServant_code());
             if(resumeold != null) {
                 resumeService.deleteResume(resumeold.getId());
+                File fileDel = new File(resumeold.getRqcode_path());
+                if (file.exists()) {
+                    fileDel.delete();
+                }
             }
             resume.setServant_code(photo.getServant_code());
             resume.setResume_comment(photo.getComment());
-            resume.setResume_path(httphtmlRoot+photo.getServant_code() + ".html");
+            resume.setResume_path(httphtmlRoot+ urlName + ".html");
+            resume.setRqcode_path(ResumeFile+urlName + ".html");
             resumeService.addResume(resume);
-            File newResume = new File(ResumeFile + photo.getServant_code() + ".html");
+            File newResume = new File(ResumeFile + urlName + ".html");
             FileWriter fileWriter = new FileWriter(newResume);
             fileWriter.write(stringHtml.toString());
             fileWriter.close();
@@ -245,7 +271,7 @@ public class ImageUploadController {
             ex.printStackTrace();
             return "error";
         }
-        return httphtmlRoot+photo.getServant_code() + ".html";
+        return httphtmlRoot+urlName+".html";
     }
     public String getpathtype(int type){
         switch (type) {
@@ -257,6 +283,8 @@ public class ImageUploadController {
                 return  "comment";
             case 4:
                 return "service";
+            case 5:
+                return "meal";
         }
         return "error";
     }

+ 57 - 0
src/main/java/com/ygj/yuemum/controller/equipment/EquipmentInfoController.java

@@ -0,0 +1,57 @@
+package com.ygj.yuemum.controller.equipment;
+
+
+import com.alibaba.fastjson.JSONObject;
+import com.ygj.yuemum.domain.equipment.EquipmentInfo;
+import com.ygj.yuemum.service.equipment.EquipmentInfoService;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.web.bind.annotation.*;
+
+import java.util.List;
+import java.util.Map;
+
+@RestController
+public class EquipmentInfoController {
+
+    @Autowired
+    private EquipmentInfoService equipmentInfoService;
+
+    @GetMapping("/getEquipmentInfos")
+    public String getEquipmentInfos(@RequestParam("page") Integer page,@RequestParam("limit") Integer limit) {
+        Map<String, Object> equipmentInfos= equipmentInfoService.getEquipmentInfos(page,limit);
+        String jso = JSONObject.toJSONString(equipmentInfos);
+        return jso;
+    }
+
+    @GetMapping("/getAllEquipmentInfos")
+    public List<EquipmentInfo> getAllCouponBatchs() {
+            return equipmentInfoService.getAll();
+    }
+
+    @PostMapping("/addEquipmentInfo")
+    public int add(@ModelAttribute EquipmentInfo equipmentInfo) {
+        return equipmentInfoService.addEquipmentInfo(equipmentInfo);
+    }
+
+    @GetMapping("/deleteEquipmentInfo")
+    public int delete(@RequestParam("id") Integer id) {
+        return equipmentInfoService.deleteEquipmentInfo(id);
+    }
+
+    @PostMapping("/updateEquipmentInfo")
+    public int update(@ModelAttribute EquipmentInfo equipmentInfo) {
+        return equipmentInfoService.updateEquipmentInfo(equipmentInfo);
+    }
+
+    @PostMapping("/queryEquipmentInfo")
+    public String queryEquipmentInfo(@ModelAttribute EquipmentInfo equipmentInfo) {
+        Map<String, Object> couponBatchs= equipmentInfoService.queryEquipmentInfo(equipmentInfo);
+        String jso = JSONObject.toJSONString(couponBatchs);
+        return jso;
+    }
+
+    @GetMapping("/getEquipmentInfo")
+    public EquipmentInfo getOne(@RequestParam("id") Integer id) {
+        return equipmentInfoService.getEquipmentInfo(id);
+    }
+}

+ 27 - 0
src/main/java/com/ygj/yuemum/controller/global/WeChatInfoController.java

@@ -0,0 +1,27 @@
+package com.ygj.yuemum.controller.global;
+
+
+import com.ygj.yuemum.service.global.WeChatInfoService;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.web.bind.annotation.GetMapping;
+import org.springframework.web.bind.annotation.RequestParam;
+import org.springframework.web.bind.annotation.RestController;
+
+import java.util.Map;
+
+@RestController
+public class WeChatInfoController {
+
+    @Autowired
+    private WeChatInfoService saveWeChatInfo;
+    @GetMapping("/SaveWeChatInfo")
+    public void SaveWeChatInfo() {
+        saveWeChatInfo.SaveWeChatInfo();
+    }
+
+    @GetMapping("/getWeChatInfo")
+    public Map<String,String> getWeChatInfo(@RequestParam("url") String url) {
+        return saveWeChatInfo.getWeChatInfo(url);
+    }
+
+}

+ 16 - 0
src/main/java/com/ygj/yuemum/controller/maternitymatron/JlServiceUserController.java

@@ -11,6 +11,8 @@ import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.web.bind.annotation.*;
 
 import java.text.ParseException;
+import java.text.SimpleDateFormat;
+import java.util.Calendar;
 import java.util.Date;
 import java.util.List;
 import java.util.Map;
@@ -43,6 +45,20 @@ public class JlServiceUserController {
     }
     @PostMapping("/queryServiceUserStockCondition")
     public String queryServiceUserStockCondition(@ModelAttribute QueryServiceUserStock queryServiceUserStock) throws ParseException {
+        //计算天数
+        if(queryServiceUserStock.getService_start() != null && queryServiceUserStock.getDays() != 0){
+            SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd");
+            Calendar calStart = Calendar.getInstance();
+            calStart.setTime(sdf.parse(queryServiceUserStock.getService_start()));
+            calStart.add(Calendar.DATE, -5);
+
+            Calendar calEnd = Calendar.getInstance();
+            calEnd.setTime(sdf.parse(queryServiceUserStock.getService_start()));
+            calEnd.add(Calendar.DATE, queryServiceUserStock.getDays()+5);
+
+            queryServiceUserStock.setService_start(sdf.format(calStart.getTime()));
+            queryServiceUserStock.setService_end(sdf.format(calEnd.getTime()));
+        }
         Map<String, Object> trains= jlServiceUserService.queryServiceUserStockCondition(queryServiceUserStock);
         String jso = JSONObject.toJSONString(trains);
         return jso;

+ 24 - 0
src/main/java/com/ygj/yuemum/dao/equipment/EquipmentInfoDao.java

@@ -0,0 +1,24 @@
+package com.ygj.yuemum.dao.equipment;
+
+import com.ygj.yuemum.domain.equipment.EquipmentInfo;
+import org.springframework.stereotype.Repository;
+
+import java.util.List;
+
+@Repository
+public interface EquipmentInfoDao {
+
+    List<EquipmentInfo> getAll();
+    List<EquipmentInfo> queryEquipmentInfo(EquipmentInfo equipmentInfo);
+
+    int deleteByPrimaryKey(Integer id);
+
+    int insertSelective(EquipmentInfo record);
+
+    EquipmentInfo selectByPrimaryKey(Integer id);
+
+    int updateByPrimaryKeySelective(EquipmentInfo record);
+
+    int getCount();
+
+}

+ 11 - 0
src/main/java/com/ygj/yuemum/dao/global/WeChatInfoDao.java

@@ -0,0 +1,11 @@
+package com.ygj.yuemum.dao.global;
+
+import com.ygj.yuemum.domain.global.WeChatInfo;
+import org.springframework.stereotype.Repository;
+
+@Repository
+public interface WeChatInfoDao {
+
+    WeChatInfo getWeChatInfo();
+    int updateWeChatInfo(WeChatInfo weChatInfo);
+}

+ 9 - 0
src/main/java/com/ygj/yuemum/domain/admin/JlServiceUserLog.java

@@ -6,6 +6,15 @@ public class JlServiceUserLog {
     private String jl_usercode;
     private String jl_date;
     private Integer jl_logtype;
+    private String jl_cmphone;
+
+    public String getJl_cmphone() {
+        return jl_cmphone;
+    }
+
+    public void setJl_cmphone(String jl_cmphone) {
+        this.jl_cmphone = jl_cmphone;
+    }
 
     public Integer getId() {
         return id;

+ 9 - 0
src/main/java/com/ygj/yuemum/domain/admin/Resume.java

@@ -7,6 +7,15 @@ public class Resume {
     private int module_code; // 简历名称
     private String resume_comment;// 简历路径
     private String resume_path;
+    private String rqcode_path;
+
+    public String getRqcode_path() {
+        return rqcode_path;
+    }
+
+    public void setRqcode_path(String rqcode_path) {
+        this.rqcode_path = rqcode_path;
+    }
 
     public Resume() {
         super();

+ 68 - 0
src/main/java/com/ygj/yuemum/domain/equipment/EquipmentInfo.java

@@ -0,0 +1,68 @@
+package com.ygj.yuemum.domain.equipment;
+
+public class EquipmentInfo {
+
+    private Integer id;
+    private Integer et_code;
+    private String ei_code;
+    private Integer ei_rent;
+    private Integer ei_status;
+    private Integer page;
+    private Integer limit;
+
+    public Integer getId() {
+        return id;
+    }
+
+    public void setId(Integer id) {
+        this.id = id;
+    }
+
+    public Integer getEt_code() {
+        return et_code;
+    }
+
+    public void setEt_code(Integer et_code) {
+        this.et_code = et_code;
+    }
+
+    public String getEi_code() {
+        return ei_code;
+    }
+
+    public void setEi_code(String ei_code) {
+        this.ei_code = ei_code;
+    }
+
+    public Integer getEi_rent() {
+        return ei_rent;
+    }
+
+    public void setEi_rent(Integer ei_rent) {
+        this.ei_rent = ei_rent;
+    }
+
+    public Integer getEi_status() {
+        return ei_status;
+    }
+
+    public void setEi_status(Integer ei_status) {
+        this.ei_status = ei_status;
+    }
+
+    public Integer getPage() {
+        return page;
+    }
+
+    public void setPage(Integer page) {
+        this.page = page;
+    }
+
+    public Integer getLimit() {
+        return limit;
+    }
+
+    public void setLimit(Integer limit) {
+        this.limit = limit;
+    }
+}

+ 22 - 0
src/main/java/com/ygj/yuemum/domain/global/WeChatInfo.java

@@ -0,0 +1,22 @@
+package com.ygj.yuemum.domain.global;
+
+public class WeChatInfo {
+    private String access_token;
+    private String jsapi_ticket;
+
+    public String getAccess_token() {
+        return access_token;
+    }
+
+    public void setAccess_token(String access_token) {
+        this.access_token = access_token;
+    }
+
+    public String getJsapi_ticket() {
+        return jsapi_ticket;
+    }
+
+    public void setJsapi_ticket(String jsapi_ticket) {
+        this.jsapi_ticket = jsapi_ticket;
+    }
+}

+ 9 - 0
src/main/java/com/ygj/yuemum/domain/maternitymatron/QueryServiceUserStock.java

@@ -24,9 +24,18 @@ public class QueryServiceUserStock {
     private String agestart;
     private String ageend;
     private String salt;
+    private Integer days;
     int page;
     int limit;
 
+    public Integer getDays() {
+        return days;
+    }
+
+    public void setDays(Integer days) {
+        this.days = days;
+    }
+
     public String getSalt() {
         return salt;
     }

+ 60 - 0
src/main/java/com/ygj/yuemum/service/equipment/EquipmentInfoService.java

@@ -0,0 +1,60 @@
+package com.ygj.yuemum.service.equipment;
+
+import com.github.pagehelper.PageHelper;
+import com.ygj.yuemum.dao.equipment.EquipmentInfoDao;
+import com.ygj.yuemum.domain.equipment.EquipmentInfo;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.stereotype.Service;
+
+import java.util.HashMap;
+import java.util.List;
+import java.util.Map;
+
+@Service
+public class EquipmentInfoService {
+
+    @Autowired
+    private EquipmentInfoDao equipmentInfoDao;
+
+    public Map<String, Object> getEquipmentInfos(int page, int limit) {
+        PageHelper.startPage(page, limit);
+        List<EquipmentInfo> equipmentInfos = equipmentInfoDao.getAll();
+        Map<String, Object> tableData = new HashMap<>();
+        Integer count  = equipmentInfos.size();
+        tableData.put("items", equipmentInfos);
+        tableData.put("total", count);
+        return tableData;
+    }
+
+    public Map<String, Object> queryEquipmentInfo(EquipmentInfo equipmentInfo) {
+        PageHelper.startPage(equipmentInfo.getPage(), equipmentInfo.getLimit());
+        List<EquipmentInfo> equipmentInfos = equipmentInfoDao.queryEquipmentInfo(equipmentInfo);
+        Map<String, Object> tableData = new HashMap<>();
+        Integer count = equipmentInfos.size();
+        tableData.put("items", equipmentInfos);
+        tableData.put("total", count);
+        return tableData;
+    }
+
+    public List<EquipmentInfo> getAll() {
+        List<EquipmentInfo> equipmentInfos = equipmentInfoDao.getAll();
+        return equipmentInfos;
+    }
+
+    public int addEquipmentInfo(EquipmentInfo equipmentInfo) {
+        return equipmentInfoDao.insertSelective(equipmentInfo);
+    }
+
+    public int deleteEquipmentInfo(Integer id) {
+        return equipmentInfoDao.deleteByPrimaryKey(id);
+    }
+
+    public int updateEquipmentInfo(EquipmentInfo equipmentInfo) {
+        return equipmentInfoDao.updateByPrimaryKeySelective(equipmentInfo);
+    }
+
+    public EquipmentInfo getEquipmentInfo(Integer id) {
+        return equipmentInfoDao.selectByPrimaryKey(id);
+    }
+
+}

+ 229 - 0
src/main/java/com/ygj/yuemum/service/global/WeChatInfoService.java

@@ -0,0 +1,229 @@
+package com.ygj.yuemum.service.global;
+
+import com.alibaba.fastjson.JSON;
+import com.ygj.yuemum.dao.global.WeChatInfoDao;
+import com.ygj.yuemum.domain.global.WeChatInfo;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.stereotype.Service;
+
+import java.io.BufferedReader;
+import java.io.IOException;
+import java.io.InputStreamReader;
+import java.io.PrintWriter;
+import java.net.URL;
+import java.net.URLConnection;
+import java.security.MessageDigest;
+import java.security.NoSuchAlgorithmException;
+import java.util.HashMap;
+import java.util.List;
+import java.util.Map;
+import java.util.UUID;
+
+@Service
+public class WeChatInfoService {
+    @Autowired
+
+    private WeChatInfoDao weChatInfoDao;
+    public static String APPID = "wx52852a3c47540fad";
+    public static String APPSECRET = "31e4eef58038830327eb88661e3a681f";
+    public static String GRANT_TYPE = "client_credential";
+    public static String JSAPI_TICKET_TYPE = "jsapi";
+    public static String ACCESS_TOKEN_URL = "https://api.weixin.qq.com/cgi-bin/token";
+    public static String JSAPI_TICKET_URL = "https://api.weixin.qq.com/cgi-bin/ticket/getticket";
+    private static final char[] HEX_DIGITS = {'0', '1', '2', '3', '4', '5','6', '7', '8', '9', 'a', 'b', 'c', 'd', 'e', 'f'};
+    String access_Token;
+    String expires_in;
+    String jsapi_Ticket;
+    String noncestr;
+    String timeStamp;
+    String signaTure;
+
+    public int SaveWeChatInfo() {
+        try {
+            //access_token
+            String resultToken = sendGet(ACCESS_TOKEN_URL + "?grant_type=" + GRANT_TYPE + "&appid=" + APPID + "&secret=" + APPSECRET);
+            Map mapToken = JSON.parseObject(resultToken);
+            access_Token = String.valueOf(mapToken.get("access_token"));
+            expires_in = String.valueOf(mapToken.get("expires_in"));
+            System.out.println("access_Token=="+access_Token);
+            System.out.println("expires_in=="+expires_in);
+            //get jsApi_ticket
+            String resultJsapi = sendGet(JSAPI_TICKET_URL + "?access_token=" + access_Token + "&type=" + JSAPI_TICKET_TYPE);
+            Map mapJsapi = JSON.parseObject(resultJsapi);
+            jsapi_Ticket = String.valueOf(mapJsapi.get("ticket"));
+            System.out.println("jsapi_Ticket==="+jsapi_Ticket);
+            //保存到数据库中
+            WeChatInfo weChatInfo = new WeChatInfo();
+            weChatInfo.setAccess_token(access_Token);
+            weChatInfo.setJsapi_ticket(jsapi_Ticket);
+            weChatInfoDao.updateWeChatInfo(weChatInfo);
+        }catch (Exception ex){
+            ex.printStackTrace();
+            return 0;
+        }
+        return 1;
+    }
+    public Map<String,String> getWeChatInfo(String url){
+        System.out.println(url);
+        WeChatInfo weChatInfo  = weChatInfoDao.getWeChatInfo();
+        Map<String, String> result = new HashMap<>();
+        String timestamp = getTimestamp();
+        String noncestr = getNoncestr();
+        String signature =SHA1(jointString(weChatInfo.getJsapi_ticket(),noncestr,timestamp,url));
+        result.put("timestamp",timestamp);
+        result.put("nonceStr",noncestr);
+        result.put("signature",signature);
+        result.put("appid",APPID);
+        result.put("jsapi_ticket",weChatInfo.getJsapi_ticket());
+        return result;
+    }
+
+    //-----------------------------------
+    public static String jointString(String jsapi_Ticket,String noncestr,String timestamp,String url){
+        String sb = new String ();
+        sb +="jsapi_ticket=" + jsapi_Ticket+"&";
+        sb +="noncestr=" + noncestr+"&";
+        sb +="timestamp=" + timestamp+"&";
+        sb +="url=" + url;
+        return sb;
+    }
+
+    public static String SHA1(String str) {
+        try {
+            MessageDigest digest = java.security.MessageDigest
+                    .getInstance("SHA-1"); //如果是SHA加密只需要将"SHA-1"改成"SHA"即可
+            digest.update(str.getBytes());
+            byte messageDigest[] = digest.digest();
+            // Create Hex String
+            StringBuffer hexStr = new StringBuffer();
+            // 字节数组转换为 十六进制 数
+            for (int i = 0; i < messageDigest.length; i++) {
+                String shaHex = Integer.toHexString(messageDigest[i] & 0xFF);
+                if (shaHex.length() < 2) {
+                    hexStr.append(0);
+                }
+                hexStr.append(shaHex);
+            }
+            return hexStr.toString();
+
+        } catch (NoSuchAlgorithmException e) {
+            e.printStackTrace();
+        }
+        return null;
+    }
+
+    public static String getTimestamp(){
+        return Long.toString(System.currentTimeMillis()/1000);
+    }
+    public static String getNoncestr(){
+        return UUID.randomUUID().toString();
+    }
+
+    public static String sendGet(String url) {
+        String result = "";
+        StringBuilder jsonStr = new StringBuilder();
+        BufferedReader in = null;
+        try {
+            String urlNameString = url;
+            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));
+            }
+
+            //ConstantUtil.UTF_CODE 编码格式
+            InputStreamReader reader = new InputStreamReader(connection.getInputStream());
+            char[] buff = new char[1024];
+            int length = 0;
+            while ((length = reader.read(buff)) != -1) {
+                result = new String(buff, 0, length);
+                jsonStr.append(result);
+            }
+        } catch (Exception e) {
+            System.out.println("发送GET请求出现异常!" + e);
+            e.printStackTrace();
+        }
+        // 使用finally块来关闭输入流
+        finally {
+            try {
+                if (in != null) {
+                    in.close();
+                }
+            } catch (Exception e2) {
+                e2.printStackTrace();
+            }
+        }
+        return jsonStr.toString();
+    }
+
+    /**
+     * 向指定 URL 发送POST方法的请求
+     *
+     * @param url   发送请求的 URL
+     * @param param 请求参数,请求参数应该是 name1=value1&name2=value2 的形式。
+     * @return 所代表远程资源的响应结果
+     */
+    public static String sendPost(String url, String param) {
+        PrintWriter out = null;
+        BufferedReader in = null;
+        URLConnection conn = null;
+        StringBuilder jsonStr = new StringBuilder();
+        try {
+            URL realUrl = new URL(url);
+            // 打开和URL之间的连接
+            conn = realUrl.openConnection();
+            conn.setConnectTimeout(20000);
+            // 设置通用的请求属性
+            conn.setRequestProperty("accept", "*/*");
+            conn.setRequestProperty("connection", "Keep-Alive");
+            conn.setRequestProperty("user-agent",
+                    "Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1;SV1)");
+            // 发送POST请求必须设置如下两行
+            conn.setDoOutput(true);
+            conn.setDoInput(true);
+            // 获取URLConnection对象对应的输出流
+            out = new PrintWriter(conn.getOutputStream());
+            // 发送请求参数
+            out.print(param);
+            // flush输出流的缓冲
+            out.flush();
+            // 定义BufferedReader输入流来读取URL的响应
+
+            InputStreamReader reader = new InputStreamReader(conn.getInputStream());
+            char[] buff = new char[1024];
+            int length = 0;
+            while ((length = reader.read(buff)) != -1) {
+                String result = new String(buff, 0, length);
+                jsonStr.append(result);
+            }
+        } catch (Exception e) {
+            System.out.println("发送 POST 请求出现异常!" + e);
+            e.printStackTrace();
+        }
+        //使用finally块来关闭输出流、输入流
+        finally {
+            try {
+                if (out != null) {
+                    out.close();
+                }
+                if (in != null) {
+                    in.close();
+                }
+            } catch (IOException ex) {
+                ex.printStackTrace();
+            }
+        }
+        return jsonStr.toString();
+    }
+}

+ 0 - 1
src/main/java/com/ygj/yuemum/service/maternitymatron/JlServiceUserService.java

@@ -109,7 +109,6 @@ public class JlServiceUserService {
         PageHelper.startPage(queryServiceUserStock.getPage(), queryServiceUserStock.getLimit());
         List<QueryServiceUserStock> stockLists = jlServiceUserDao.queryServiceUserStockCondition(queryServiceUserStock);
         Map<String, Object> tableData = new HashMap<>();
-        Integer count = jlServiceUserDao.getStock(queryServiceUserStock);
         tableData.put("items", stockLists);
         tableData.put("total", stockLists.size());
         return tableData;

+ 10 - 3
src/main/resources/mybatis/mapper/admin/JlServiceUserLog.xml

@@ -8,12 +8,13 @@
         <result column="jl_usercode" property="jl_usercode" jdbcType="INTEGER" />
         <result column="jl_date" property="jl_date" jdbcType="DATE" />
         <result column="jl_logtype" property="jl_logtype" jdbcType="INTEGER" />
+        <result column="jl_cmphone" property="jl_cmphone" jdbcType="INTEGER" />
     </resultMap>
 
     <!--获取所有数据-->
     <select id="getJlServiceUserLog" resultMap="BaseResultMap" parameterType="java.lang.Integer" >
         select
-        id,js_sucode,jl_usercode,jl_date,jl_logtype
+        id,js_sucode,jl_usercode,jl_date,jl_logtype,jl_cmphone
         from jl_service_user_log
         where
         jl_date &gt;=  DATE_SUB(CURDATE(), INTERVAL 1 YEAR)
@@ -34,7 +35,10 @@
                 jl_date,
             </if>
             <if test="jl_logtype != null" >
-                jl_logtype
+                jl_logtype,
+            </if>
+            <if test="jl_cmphone != null" >
+                jl_cmphone
             </if>
         </trim>
         <trim prefix="values (" suffix=")" suffixOverrides="," >
@@ -48,7 +52,10 @@
                 #{jl_date,jdbcType=DATE},
             </if>
             <if test="jl_logtype != null" >
-                #{jl_logtype,jdbcType=DATE}
+                #{jl_logtype,jdbcType=DATE},
+            </if>
+            <if test="jl_cmphone != null" >
+                #{jl_cmphone,jdbcType=DATE}
             </if>
         </trim>
     </insert>

+ 15 - 5
src/main/resources/mybatis/mapper/admin/ResumeMapper.xml

@@ -8,10 +8,11 @@
         <result column="module_code" property="module_code" jdbcType="INTEGER" />
         <result column="resume_comment" property="resume_comment" jdbcType="VARCHAR" />
         <result column="resume_path" property="resume_path" jdbcType="VARCHAR" />
+        <result column="rqcode_path" property="rqcode_path" jdbcType="VARCHAR" />
     </resultMap>
 
     <sql id="Base_Column_List" >
-        id,servant_code,module_code,resume_comment,resume_path
+        id,servant_code,module_code,resume_comment,resume_path,rqcode_path
     </sql>
 
     <!-- 得到所有的简历信息 -->
@@ -48,7 +49,10 @@
                 resume_comment,
             </if>
             <if test="resume_path != null" >
-                resume_path
+                resume_path,
+            </if>
+            <if test="rqcode_path != null" >
+                rqcode_path
             </if>
         </trim>
         <trim prefix="values (" suffix=")" suffixOverrides="," >
@@ -62,7 +66,10 @@
                 #{resume_comment,jdbcType=VARCHAR},
             </if>
             <if test="resume_path != null" >
-                #{resume_path,jdbcType=VARCHAR}
+                #{resume_path,jdbcType=VARCHAR},
+            </if>
+            <if test="rqcode_path != null" >
+                #{rqcode_path,jdbcType=VARCHAR}
             </if>
         </trim>
     </insert>
@@ -78,10 +85,13 @@
                 module_code = #{module_code,jdbcType=VARCHAR},
             </if>
             <if test="resume_comment != null" >
-                resume_comment = #{resume_comment,jdbcType=VARCHAR}
+                resume_comment = #{resume_comment,jdbcType=VARCHAR},
             </if>
             <if test="resume_path != null" >
-                resume_path = #{resume_path,jdbcType=VARCHAR}
+                resume_path = #{resume_path,jdbcType=VARCHAR},
+            </if>
+            <if test="rqcode_path != null" >
+                rqcode_path = #{rqcode_path,jdbcType=VARCHAR}
             </if>
         </set>
         where id = #{id,jdbcType=INTEGER}

+ 113 - 0
src/main/resources/mybatis/mapper/equipment/EquipmentInfo.xml

@@ -0,0 +1,113 @@
+<?xml version="1.0" encoding="UTF-8" ?>
+<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd" >
+<mapper namespace="com.ygj.yuemum.dao.equipment.EquipmentInfoDao" >
+
+    <resultMap id="BaseResultMap" type="com.ygj.yuemum.domain.equipment.EquipmentInfo" >
+        <id column="id" property="id" jdbcType="INTEGER" />
+        <result column="et_code" property="et_code" jdbcType="INTEGER" />
+        <result column="ei_code" property="ei_code" jdbcType="VARCHAR" />
+        <result column="ei_rent" property="ei_rent" jdbcType="INTEGER" />
+        <result column="ei_status" property="ei_status" jdbcType="INTEGER" />
+    </resultMap>
+
+    <sql id="Base_Column_List" >
+        id,et_code, ei_code,ei_rent,ei_status
+    </sql>
+
+    <!--获取所有数据-->
+    <select id="getCount" resultType="java.lang.Integer" >
+        select
+        count(1)
+        from equipment_info
+    </select>
+
+    <select id="getAll" resultMap="BaseResultMap" >
+        select
+        id,et_code, ei_code,ei_rent,ei_status
+        from equipment_info
+        order by id desc
+    </select>
+
+    <select id="queryEquipmentInfo" resultMap="BaseResultMap" parameterType="com.ygj.yuemum.domain.equipment.EquipmentInfo">
+        select
+        id,et_code, ei_code,ei_rent,ei_status
+        from equipment_info
+        where 1=1
+        <if test="et_code != null and ot_code != ''">
+            and et_code like "%"#{et_code,jdbcType=VARCHAR}"%"
+        </if>
+        <if test="ei_rent != null and cm_phone != ''">
+            and ei_rent = #{ei_rent,jdbcType=INTEGER}
+        </if>
+        <if test="ei_status != null and ot_startdate != ''">
+            and ei_status = #{ei_status,jdbcType=INTEGER}
+        </if>
+        order by id desc
+    </select>
+
+    <select id="selectByPrimaryKey" resultMap="BaseResultMap" parameterType="java.lang.Integer" >
+        select
+        <include refid="Base_Column_List" />
+        from equipment_info
+        where id = #{id,jdbcType=INTEGER}
+    </select>
+
+    <delete id="deleteByPrimaryKey" parameterType="java.lang.Integer" >
+        delete from equipment_info
+        where id = #{id,jdbcType=VARCHAR}
+    </delete>
+
+    <!-- 插入一条培训信息 -->
+    <insert id="insertSelective" parameterType="com.ygj.yuemum.domain.equipment.EquipmentInfo" >
+        insert into equipment_info
+        <trim prefix="(" suffix=")" suffixOverrides="," >
+            <if test="et_code != null" >
+                et_code,
+            </if>
+            <if test="ei_code != null" >
+                ei_code,
+            </if>
+            <if test="ei_rent != null" >
+                ei_rent,
+            </if>
+            <if test="ei_status != null" >
+                ei_status
+            </if>
+        </trim>
+        <trim prefix="values (" suffix=")" suffixOverrides="," >
+            <if test="et_code != null" >
+                #{et_code,jdbcType=INTEGER},
+            </if>
+            <if test="ei_code != null" >
+                #{ei_code,jdbcType=VARCHAR},
+            </if>
+            <if test="ei_rent != null" >
+                #{ei_rent,jdbcType=INTEGER},
+            </if>
+            <if test="ei_status != null" >
+                #{ei_status,jdbcType=INTEGER}
+            </if>
+        </trim>
+    </insert>
+
+    <!-- 根据id更新一条培训信息 -->
+    <update id="updateByPrimaryKeySelective" parameterType="com.ygj.yuemum.domain.equipment.EquipmentInfo" >
+        update equipment_info
+        <set >
+            <if test="et_code != null" >
+                et_code = #{et_code,jdbcType=INTEGER},
+            </if>
+            <if test="ei_code != null" >
+                ei_code = #{ei_code,jdbcType=VARCHAR},
+            </if>
+            <if test="ei_rent != null" >
+                ei_rent = #{ei_rent,jdbcType=INTEGER},
+            </if>
+            <if test="ei_status != null" >
+                ei_status = #{ei_status,jdbcType=INTEGER}
+            </if>
+        </set>
+        where id = #{id,jdbcType=INTEGER}
+    </update>
+
+</mapper>

src/main/resources/mybatis/mapper/global/packagesMapper.xml → src/main/resources/mybatis/mapper/global/PackagesMapper.xml


+ 29 - 0
src/main/resources/mybatis/mapper/global/WeChatInfoMapper.xml

@@ -0,0 +1,29 @@
+<?xml version="1.0" encoding="UTF-8" ?>
+<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd" >
+<mapper namespace="com.ygj.yuemum.dao.global.WeChatInfoDao" >
+
+    <resultMap id="BaseResultMap" type="com.ygj.yuemum.domain.global.WeChatInfo" >
+        <result column="access_token" property="access_token" jdbcType="VARCHAR" />
+        <result column="jsapi_ticket" property="jsapi_ticket" jdbcType="VARCHAR" />
+    </resultMap>
+
+    <!--获取所有数据-->
+    <select id="getWeChatInfo" resultType="com.ygj.yuemum.domain.global.WeChatInfo">
+        select
+        access_token,jsapi_ticket
+        from wechatinfo
+    </select>
+
+    <update id="updateWeChatInfo" parameterType="com.ygj.yuemum.domain.global.WeChatInfo" >
+        update wechatinfo
+        <set >
+            <if test="access_token != null" >
+                access_token = #{access_token,jdbcType=VARCHAR},
+            </if>
+            <if test="jsapi_ticket != null" >
+                jsapi_ticket = #{jsapi_ticket,jdbcType=VARCHAR},
+            </if>
+        </set>
+    </update>
+
+</mapper>