elis il y a 2 ans
Parent
commit
9ec8354374
22 fichiers modifiés avec 51 ajouts et 26 suppressions
  1. 1 1
      naqwzsjtj/naqwzsjtj/src/utils/request.js
  2. 1 1
      naqwzsjtj/naqwzsjtj/src/views/canteen/CanteenManage.vue
  3. 1 1
      naqwzsjtj/naqwzsjtj/src/views/canteen/EvaluationManage.vue
  4. 1 1
      naqwzsjtj/naqwzsjtj/src/views/canteen/Food.vue
  5. 1 1
      naqwzsjtj/naqwzsjtj/src/views/canteen/Menu.vue
  6. 1 1
      naqwzsjtj/naqwzsjtj/src/views/impressionNanan/Administration.vue
  7. 1 1
      naqwzsjtj/naqwzsjtj/src/views/impressionNanan/ImpressionNanan.vue
  8. 1 1
      naqwzsjtj/naqwzsjtj/src/views/rectification/RectificationIndex.vue
  9. 1 1
      naqwzsjtj/naqwzsjtj/src/views/rectification/components/RectificationEdit.vue
  10. 1 1
      naqwzsjtj/naqwzsjtj/src/views/repair/RepairWorker.vue
  11. 3 1
      naqwzsjtj/naqwzsjtj/src/views/repair/WorkOrder.vue
  12. 6 7
      nngkxxdp/src/main/java/com/example/nngkxxdp/program/controller/WorkerMiniController.java
  13. 1 1
      nngkxxdp/src/main/java/com/example/nngkxxdp/program/dao/SDictDao.java
  14. 2 0
      nngkxxdp/src/main/java/com/example/nngkxxdp/program/dao/SWorkerDao.java
  15. 4 0
      nngkxxdp/src/main/java/com/example/nngkxxdp/program/service/Impl/MiniLoginServiceImpl.java
  16. 12 0
      nngkxxdp/src/main/java/com/example/nngkxxdp/program/service/Impl/SWorkerServiceImpl.java
  17. 2 0
      nngkxxdp/src/main/java/com/example/nngkxxdp/program/service/SWorkerService.java
  18. 3 3
      nngkxxdp/src/main/resources/mapper/SDictDao.xml
  19. 1 1
      nngkxxdp/src/main/resources/mapper/SRepairDao.xml
  20. 4 0
      nngkxxdp/src/main/resources/mapper/SWorkerDao.xml
  21. 2 2
      nnzwminiapp/pages/api/canteen-request.js
  22. 1 1
      nnzwminiapp/pagesPublic/pages/work-order/work-order.js

+ 1 - 1
naqwzsjtj/naqwzsjtj/src/utils/request.js

@@ -14,7 +14,7 @@ import router from '../router'
 
 //请求地址
 const instance = axios.create({
-    baseURL: process.env.VUE_APP_BASE_API
+    baseURL: "https://www.cqna.gov.cn/mnazw"
 })
 //请求拦截器
 instance.interceptors.request.use((r) => {

+ 1 - 1
naqwzsjtj/naqwzsjtj/src/views/canteen/CanteenManage.vue

@@ -138,7 +138,7 @@
     },
     data() {
       return {
-        imgUrl: process.env.VUE_APP_IMG_URL,
+        imgUrl: "https://www.cqna.gov.cn/mnazw/",
         tableStyle: {
           textAlign: "center",
         },

+ 1 - 1
naqwzsjtj/naqwzsjtj/src/views/canteen/EvaluationManage.vue

@@ -109,7 +109,7 @@
     },
     data() {
       return {
-        imgUrl: process.env.VUE_APP_IMG_URL,
+        imgUrl: "https://www.cqna.gov.cn/mnazw/",
         tableStyle: {
           textAlign: 'center',
         },

+ 1 - 1
naqwzsjtj/naqwzsjtj/src/views/canteen/Food.vue

@@ -137,7 +137,7 @@
         },
         data() {
             return {
-                imgUrl: process.env.VUE_APP_IMG_URL,
+                imgUrl: "https://www.cqna.gov.cn/mnazw/",
                 tableStyle: {
                     textAlign: 'center',
                 },

+ 1 - 1
naqwzsjtj/naqwzsjtj/src/views/canteen/Menu.vue

@@ -192,7 +192,7 @@
     },
     data() {
       return {
-        imgUrl: process.env.VUE_APP_IMG_URL,
+        imgUrl: "https://www.cqna.gov.cn/mnazw/",
         tableStyle: {
           textAlign: "center"
         },

+ 1 - 1
naqwzsjtj/naqwzsjtj/src/views/impressionNanan/Administration.vue

@@ -425,7 +425,7 @@ export default {
     },
     data() {
         return {
-            imgUrl: process.env.VUE_APP_IMG_URL,
+            imgUrl: "https://www.cqna.gov.cn/mnazw/",
             label: "印象南岸专辑管理",
             tableData: [],
             albumTableData: [],

+ 1 - 1
naqwzsjtj/naqwzsjtj/src/views/impressionNanan/ImpressionNanan.vue

@@ -597,7 +597,7 @@ export default {
     },
     data() {
         return {
-            imgUrl: process.env.VUE_APP_IMG_URL,
+            imgUrl: "https://www.cqna.gov.cn/mnazw/",
             orderBy: '',
             fileList: [],
             dialogImageUrl: '',

+ 1 - 1
naqwzsjtj/naqwzsjtj/src/views/rectification/RectificationIndex.vue

@@ -318,7 +318,7 @@
           visible: false
         },
         picList: [],
-        imgUrl: process.env.VUE_APP_IMG_URL,
+        imgUrl: "https://www.cqna.gov.cn/mnazw/",
         dialogImageUrl: '',
         dialogVisible: false,
         picShowList: []

+ 1 - 1
naqwzsjtj/naqwzsjtj/src/views/rectification/components/RectificationEdit.vue

@@ -161,7 +161,7 @@
         // 图片
         picList: [],
         replyPicList: [],
-        imgUrl: process.env.VUE_APP_IMG_URL,
+        imgUrl: "https://www.cqna.gov.cn/mnazw/",
         dialogImageUrl: '',
         dialogVisible: false,
         show: false

+ 1 - 1
naqwzsjtj/naqwzsjtj/src/views/repair/RepairWorker.vue

@@ -101,7 +101,7 @@
     },
     data() {
       return {
-        imgUrl: process.env.VUE_APP_IMG_URL,
+        imgUrl: "https://www.cqna.gov.cn/mnazw/",
         tableStyle: {
           textAlign: "center",
         },

+ 3 - 1
naqwzsjtj/naqwzsjtj/src/views/repair/WorkOrder.vue

@@ -150,7 +150,7 @@
       return {
         workDialog:false,
         assignDialog:false,
-        imgUrl: process.env.VUE_APP_IMG_URL,
+        imgUrl: "https://www.cqna.gov.cn/mnazw/",
         tableStyle: {
           textAlign: 'center',
         },
@@ -182,6 +182,8 @@
             return '待审核'
           case 1:
             return '待维修'
+          case 2:
+            return '待维修'
           case 3:
             return '已完成'
           case -1:

+ 6 - 7
nngkxxdp/src/main/java/com/example/nngkxxdp/program/controller/WorkerMiniController.java

@@ -34,6 +34,7 @@ import java.util.Map;
 public class WorkerMiniController {
     private final SRepairService service;
     private final SDictService dictService;
+    private final SWorkerService sWorkerService;
 
 
     @PostMapping("/addOrder")
@@ -92,7 +93,7 @@ public class WorkerMiniController {
             List<String> codeList =  new ArrayList<>();
             if(StrUtil.isNotEmpty(types)) {
                 String[] typeArray = types.split(",");
-                Collections.addAll(codeList, typeArray);
+                Collections.addAll(typeList, typeArray);
             }
             if(StrUtil.isNotEmpty(codes)) {
                 String[] codeArray = codes.split(",");
@@ -107,12 +108,10 @@ public class WorkerMiniController {
 
     @GetMapping("/getUserType")
     public Map<String, Object> getUserType(String userId) {
-        try {
-            //普通用户 1 维修人员 2
-            return SendUtil.send(true, ConstStr.RESULT_SUCCESS, 1);
-        } catch (Exception e) {
-            e.printStackTrace();
+        if (StrUtil.isEmpty(userId)){
+            return SendUtil.send(false, ConstStr.REQUEST_WRONGPARAMS);
         }
-        return SendUtil.send(false, ConstStr.ADD_FAILED);
+        return SendUtil.send(true,"",sWorkerService.getUserType(userId));
+
     }
 }

+ 1 - 1
nngkxxdp/src/main/java/com/example/nngkxxdp/program/dao/SDictDao.java

@@ -12,7 +12,7 @@ import java.util.List;
  * (SRepair)表数据库访问层
  *
  */
- @Mapper
+@Mapper
 public interface SDictDao {
 
     /**

+ 2 - 0
nngkxxdp/src/main/java/com/example/nngkxxdp/program/dao/SWorkerDao.java

@@ -85,5 +85,7 @@ public interface SWorkerDao {
     Integer findUser(String phoneNum);
 
     Integer checkUserRepeats(String phoneNum, Integer role);
+
+    Integer getUserType(String userId);
 }
 

+ 4 - 0
nngkxxdp/src/main/java/com/example/nngkxxdp/program/service/Impl/MiniLoginServiceImpl.java

@@ -6,6 +6,7 @@ import java.util.Map;
 import cn.hutool.json.JSONUtil;
 import com.example.nngkxxdp.program.entity.jsonobj.HlLoginDTO;
 import com.example.nngkxxdp.program.entity.vo.WxPhoneVo;
+import com.example.nngkxxdp.program.service.SWorkerService;
 import com.example.nngkxxdp.util.RedisUtil;
 import org.jetbrains.annotations.NotNull;
 import org.springframework.beans.factory.annotation.Value;
@@ -43,6 +44,8 @@ public class MiniLoginServiceImpl implements MiniLoginService {
 
     private final RedisUtil redisUtil;
 
+    private final SWorkerService sWorkerService;
+
     /**
      * 微信小程序登录接口
      *
@@ -96,6 +99,7 @@ public class MiniLoginServiceImpl implements MiniLoginService {
             returnedValue.put("token", token);
             returnedValue.put("phoneNum", info.getPhone());
             returnedValue.put("userId", info.getId());
+            returnedValue.put("role", sWorkerService.getUserType(info.getId()));
             returnedValue.put("hlToken", info.getToken());
             return SendUtil.send(true, "", returnedValue);
         } catch (Exception e) {

+ 12 - 0
nngkxxdp/src/main/java/com/example/nngkxxdp/program/service/Impl/SWorkerServiceImpl.java

@@ -8,12 +8,15 @@ import com.example.nngkxxdp.program.dao.AppletUserDao;
 import com.example.nngkxxdp.program.dao.SWorkerDao;
 import com.example.nngkxxdp.program.entity.SWorker;
 import com.example.nngkxxdp.program.service.SWorkerService;
+import com.example.nngkxxdp.util.SendUtil;
 import org.springframework.beans.factory.annotation.Value;
 import org.springframework.data.domain.Page;
 import org.springframework.data.domain.PageImpl;
 import org.springframework.data.domain.PageRequest;
 import org.springframework.stereotype.Service;
 
+import java.util.Map;
+
 /**
  * (SWorker)表服务实现类
  *
@@ -119,5 +122,14 @@ public class SWorkerServiceImpl implements SWorkerService {
         return integer > 0;
     }
 
+    @Override
+    public Integer getUserType(String userId) {
+        Integer userType = sWorkerDao.getUserType(userId);
+        if (ObjectUtil.isEmpty(userType)){
+            return -1;
+        }
+        return userType;
+    }
+
 
 }

+ 2 - 0
nngkxxdp/src/main/java/com/example/nngkxxdp/program/service/SWorkerService.java

@@ -65,4 +65,6 @@ public interface SWorkerService {
     boolean findUser(String phoneNum);
 
     boolean checkUserRepeats(String phoneNum, Integer role);
+
+    Integer getUserType(String userId);
 }

+ 3 - 3
nngkxxdp/src/main/resources/mapper/SDictDao.xml

@@ -1,6 +1,6 @@
 <?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.example.nngkxxdp.program.dao.SRepairDao">
+<mapper namespace="com.example.nngkxxdp.program.dao.SDictDao">
 
     <resultMap type="com.example.nngkxxdp.program.entity.SDict" id="SDictMap">
         <result property="id" column="id" jdbcType="INTEGER"/>
@@ -137,13 +137,13 @@
         from s_dict
         where status = 1
         <if test="types != null and types.size > 0">
-            AND type_name in
+            AND type in
             <foreach collection="types" item="s" index="index" open="(" close=")" separator=",">
                 #{s}
             </foreach>
         </if>
         <if test="codes != null and codes.size > 0">
-            AND type_name in
+            AND code in
             <foreach collection="codes" item="s" index="index" open="(" close=")" separator=",">
                 #{s}
             </foreach>

+ 1 - 1
nngkxxdp/src/main/resources/mapper/SRepairDao.xml

@@ -54,7 +54,7 @@
             sr.worker_id, sr.create_time, sr.update_time,sr.user_id,sr.appointment_time,
             sr.maintenance_address,sw.name
         from s_repair sr
-        left join s_worker sw on sr.worker_id = sw.id
+        left join s_worker sw on sr.worker_id = sw.wx_user_id
         <where>
             <if test="sRepair.repairType != null">
                 and sr.repair_type = #{sRepair.repairType}

+ 4 - 0
nngkxxdp/src/main/resources/mapper/SWorkerDao.xml

@@ -126,5 +126,9 @@
         select count(*) from s_worker where phone_num = #{phoneNum} and role = #{role}
     </select>
 
+    <select id="getUserType" resultType="int">
+        select role from s_worker where wx_user_id = #{userId} limit 1
+    </select>
+
 </mapper>
 

+ 2 - 2
nnzwminiapp/pages/api/canteen-request.js

@@ -1,5 +1,5 @@
-const baseUrl = "https://www.cqna.gov.cn/data"
-const imgUrl = "https://www.cqna.gov.cn/data/applet/"
+const baseUrl = "https://www.cqna.gov.cn/mnazw"
+const imgUrl = "https://www.cqna.gov.cn/mnazw/applet/"
 
 import {
 	cacheGet

+ 1 - 1
nnzwminiapp/pagesPublic/pages/work-order/work-order.js

@@ -63,7 +63,7 @@ Page({
           if (res.result) {
 
             let userType = res.data;
-            if ("1" == userType) {
+            if ("0" == userType|| "1" == userType) {
                 // 普通用户
                 this.setData({
                   isUser: true