Browse Source

Merge branch 'test' of jishutao/kede-server into prod

anderx 2 years ago
parent
commit
691d3293e5

+ 13 - 15
src/main/java/com/goafanti/admin/controller/AdminSuperviserApiController.java

@@ -1,18 +1,5 @@
 package com.goafanti.admin.controller;
 
-import java.util.*;
-import javax.annotation.Resource;
-import javax.servlet.http.HttpServletRequest;
-
-import com.goafanti.common.utils.RedisUtil;
-import org.apache.shiro.SecurityUtils;
-import org.springframework.beans.BeanUtils;
-import org.springframework.data.redis.core.RedisTemplate;
-import org.springframework.data.redis.core.types.RedisClientInfo;
-import org.springframework.stereotype.Controller;
-import org.springframework.web.bind.annotation.RequestMapping;
-import org.springframework.web.bind.annotation.RequestMethod;
-import org.springframework.web.bind.annotation.RequestParam;
 import com.alibaba.fastjson.JSON;
 import com.alibaba.fastjson.JSONArray;
 import com.alibaba.fastjson.JSONObject;
@@ -27,9 +14,21 @@ import com.goafanti.common.controller.CertifyApiController;
 import com.goafanti.common.model.Admin;
 import com.goafanti.common.model.AdminLocation;
 import com.goafanti.common.utils.PasswordUtil;
+import com.goafanti.common.utils.RedisUtil;
 import com.goafanti.common.utils.StringUtils;
 import com.goafanti.core.shiro.token.TokenManager;
-import com.goafanti.user.service.UserService;
+import org.springframework.beans.BeanUtils;
+import org.springframework.stereotype.Controller;
+import org.springframework.web.bind.annotation.RequestMapping;
+import org.springframework.web.bind.annotation.RequestMethod;
+import org.springframework.web.bind.annotation.RequestParam;
+
+import javax.annotation.Resource;
+import javax.servlet.http.HttpServletRequest;
+import java.util.ArrayList;
+import java.util.Calendar;
+import java.util.List;
+import java.util.UUID;
 
 @Controller
 @RequestMapping(value = "/api/admin/superviser")
@@ -101,7 +100,6 @@ public class AdminSuperviserApiController extends CertifyApiController {
 			}
 			Admin ad = new Admin();
 			BeanUtils.copyProperties(admin, ad);
-			/*ad.setId(UUID.randomUUID().toString());*/
 			Calendar now = Calendar.getInstance();
 			now.set(Calendar.MILLISECOND, 0);
 			ad.setCreateTime(now.getTime());

+ 28 - 22
src/main/java/com/goafanti/common/mapper/AdminMapper.xml

@@ -48,31 +48,34 @@
     delete from admin
     where id = #{id,jdbcType=VARCHAR}
   </delete>
-  <insert id="insert" keyColumn="id" keyProperty="id" parameterType="com.goafanti.common.model.Admin" useGeneratedKeys="true">
-    insert into admin (mobile, `name`, `password`,
-      email, create_time, `number`,
-      province, `position`, superior_id,
-      city, department_id, `status`,
-      user_no, duty, district,
-      head_portrait_url, contact_mobile, last_login_time,
-      open_id, `type`, reviewer,
-      amb_id, amb_role, amb_manage,
-      manager_id, senior_staff, public_purview,
-      expense_open_id)
-    values (#{mobile,jdbcType=VARCHAR}, #{name,jdbcType=VARCHAR}, #{password,jdbcType=VARCHAR},
-      #{email,jdbcType=VARCHAR}, #{createTime,jdbcType=TIMESTAMP}, #{number,jdbcType=INTEGER},
-      #{province,jdbcType=VARCHAR}, #{position,jdbcType=VARCHAR}, #{superiorId,jdbcType=VARCHAR},
-      #{city,jdbcType=VARCHAR}, #{departmentId,jdbcType=VARCHAR}, #{status,jdbcType=VARCHAR},
-      #{userNo,jdbcType=VARCHAR}, #{duty,jdbcType=VARCHAR}, #{district,jdbcType=VARCHAR},
-      #{headPortraitUrl,jdbcType=VARCHAR}, #{contactMobile,jdbcType=VARCHAR}, #{lastLoginTime,jdbcType=TIMESTAMP},
-      #{openId,jdbcType=VARCHAR}, #{type,jdbcType=INTEGER}, #{reviewer,jdbcType=VARCHAR},
-      #{ambId,jdbcType=VARCHAR}, #{ambRole,jdbcType=VARCHAR}, #{ambManage,jdbcType=INTEGER},
-      #{managerId,jdbcType=VARCHAR}, #{seniorStaff,jdbcType=INTEGER}, #{publicPurview,jdbcType=INTEGER},
-      #{expenseOpenId,jdbcType=VARCHAR})
+  <insert id="insert" parameterType="com.goafanti.common.model.Admin">
+    insert into admin (id, mobile, `name`,
+      `password`, email, create_time,
+      `number`, province, `position`,
+      superior_id, city, department_id,
+      `status`, user_no, duty,
+      district, head_portrait_url, contact_mobile,
+      last_login_time, open_id, `type`,
+      reviewer, amb_id, amb_role,
+      amb_manage, manager_id, senior_staff,
+      public_purview, expense_open_id)
+    values (#{id,jdbcType=VARCHAR}, #{mobile,jdbcType=VARCHAR}, #{name,jdbcType=VARCHAR},
+      #{password,jdbcType=VARCHAR}, #{email,jdbcType=VARCHAR}, #{createTime,jdbcType=TIMESTAMP},
+      #{number,jdbcType=INTEGER}, #{province,jdbcType=VARCHAR}, #{position,jdbcType=VARCHAR},
+      #{superiorId,jdbcType=VARCHAR}, #{city,jdbcType=VARCHAR}, #{departmentId,jdbcType=VARCHAR},
+      #{status,jdbcType=VARCHAR}, #{userNo,jdbcType=VARCHAR}, #{duty,jdbcType=VARCHAR},
+      #{district,jdbcType=VARCHAR}, #{headPortraitUrl,jdbcType=VARCHAR}, #{contactMobile,jdbcType=VARCHAR},
+      #{lastLoginTime,jdbcType=TIMESTAMP}, #{openId,jdbcType=VARCHAR}, #{type,jdbcType=INTEGER},
+      #{reviewer,jdbcType=VARCHAR}, #{ambId,jdbcType=VARCHAR}, #{ambRole,jdbcType=VARCHAR},
+      #{ambManage,jdbcType=INTEGER}, #{managerId,jdbcType=VARCHAR}, #{seniorStaff,jdbcType=INTEGER},
+      #{publicPurview,jdbcType=INTEGER}, #{expenseOpenId,jdbcType=VARCHAR})
   </insert>
-  <insert id="insertSelective" keyColumn="id" keyProperty="id" parameterType="com.goafanti.common.model.Admin" useGeneratedKeys="true">
+  <insert id="insertSelective" parameterType="com.goafanti.common.model.Admin">
     insert into admin
     <trim prefix="(" suffix=")" suffixOverrides=",">
+      <if test="id != null">
+        id,
+      </if>
       <if test="mobile != null">
         mobile,
       </if>
@@ -159,6 +162,9 @@
       </if>
     </trim>
     <trim prefix="values (" suffix=")" suffixOverrides=",">
+      <if test="id != null">
+        #{id,jdbcType=VARCHAR},
+      </if>
       <if test="mobile != null">
         #{mobile,jdbcType=VARCHAR},
       </if>

+ 7 - 0
src/main/java/com/goafanti/common/mapper/TOrderTaskMapper.xml

@@ -1527,6 +1527,9 @@
     <if test="screen ==0">
       and a.project_status in(0,1,2,3)
     </if>
+    <if test="screen ==1">
+      and ttm.complete_count > 0
+    </if>
     <if test="screen ==2">
       and a.project_status &gt; 3
     </if>
@@ -1629,6 +1632,7 @@
   <select id="selectProjectStatisticsCount" resultType="java.lang.Integer">
     select  count(*)
     from t_order_task a left join t_order_new b on a.order_no =b.order_no
+    left join t_task_mid ttm on a.id=ttm.tid
     <if test="province !=null">
       left join department c on b.order_dep =c.id
     </if>
@@ -1669,6 +1673,9 @@
     <if test="screen ==0">
       and a.project_status in(0,1,2,3)
     </if>
+    <if test="screen ==1">
+      and ttm.complete_count > 0
+    </if>
     <if test="screen ==2">
       and a.project_status &gt; 3
     </if>