Просмотр исходного кода

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

anderx лет назад: 3
Родитель
Сommit
3db2a18afc

+ 11 - 2
src/main/java/com/goafanti/common/dao/OrderExamineMapper.java

@@ -106,5 +106,14 @@ public interface OrderExamineMapper {
 
 
 	void updateByOrderNo(@Param("orderNo") String orderNo,@Param("status")Integer status);
 	void updateByOrderNo(@Param("orderNo") String orderNo,@Param("status")Integer status);
 
 
-	void updateDimissionTransfer(@Param("aid")String aid, @Param("transferId")String transferId);
-}
+	void updateDimissionTransfer(@Param("aid")String aid, @Param("transferId")String transferId, @Param("type")Integer type);
+
+    /**
+     * 删除变更更审核人
+     * @param aid
+     * @param type 0咨询师 1经理
+     */
+    void deleteByAidAndStatus(@Param("aid")String aid,  @Param("type")Integer type);
+
+
+}

+ 8 - 7
src/main/java/com/goafanti/common/dao/TChangeTaskMapper.java

@@ -78,25 +78,26 @@ public interface TChangeTaskMapper {
 	void insertSelectiveList(@Param("list")List<TChangeTask> list);
 	void insertSelectiveList(@Param("list")List<TChangeTask> list);
 
 
 	List<TChangeTaskOut> selectByCid(@Param("id")Integer id, @Param("splitStatus")Integer splitStatus);
 	List<TChangeTaskOut> selectByCid(@Param("id")Integer id, @Param("splitStatus")Integer splitStatus);
-	
+
 	/**
 	/**
-	 * 
+	 *
 	 * @param tid �更项目id
 	 * @param tid �更项目id
 	 * @param sid �更拆分父项目id
 	 * @param sid �更拆分父项目id
 	 * @param type 处�类型
 	 * @param type 处�类型
-	 * @param i 
 	 * @return
 	 * @return
 	 */
 	 */
 	int updateByTid(@Param("tid")Integer tid,@Param("sid")Integer sid,@Param("cid")Integer cid,@Param("type")Integer type);
 	int updateByTid(@Param("tid")Integer tid,@Param("sid")Integer sid,@Param("cid")Integer cid,@Param("type")Integer type);
-	
+
 	int deleteByTid(Integer tid);
 	int deleteByTid(Integer tid);
 
 
 	/**
 	/**
-	 *   获��更�项�??
+	 *   获��更�项�???
 	 * @param splitSuper
 	 * @param splitSuper
-	 * @param cid 
+	 * @param cid
 	 * @return
 	 * @return
 	 */
 	 */
 	List<TChangeTask> selectBySuper(@Param("splitSuper")Integer splitSuper, @Param("cid")Integer cid);
 	List<TChangeTask> selectBySuper(@Param("splitSuper")Integer splitSuper, @Param("cid")Integer cid);
 
 
-}
+
+	TChangeTask selectBytid(Integer id);
+}

+ 2 - 0
src/main/java/com/goafanti/common/dao/TOrderTaskMapper.java

@@ -2,6 +2,7 @@ package com.goafanti.common.dao;
 
 
 import com.goafanti.common.bo.OrderOperator;
 import com.goafanti.common.bo.OrderOperator;
 import com.goafanti.common.bo.UserOrderTask;
 import com.goafanti.common.bo.UserOrderTask;
+import com.goafanti.common.model.TChangeTask;
 import com.goafanti.common.model.TOrderTask;
 import com.goafanti.common.model.TOrderTask;
 import com.goafanti.order.bo.*;
 import com.goafanti.order.bo.*;
 import com.goafanti.organization.bo.ProjectTypePuls;
 import com.goafanti.organization.bo.ProjectTypePuls;
@@ -66,4 +67,5 @@ public interface TOrderTaskMapper {
                                                    @Param("sort") Integer sort, @Param("startDate") String startDate, @Param("endDate") String endDate);
                                                    @Param("sort") Integer sort, @Param("startDate") String startDate, @Param("endDate") String endDate);
 
 
 
 
+    List<TChangeTask> selectByAid(String aid);
 }
 }

+ 14 - 6
src/main/java/com/goafanti/common/mapper/OrderExamineMapper.xml

@@ -115,7 +115,7 @@
       This element is automatically generated by MyBatis Generator, do not modify.
       This element is automatically generated by MyBatis Generator, do not modify.
       This element was generated on Thu Sep 26 16:21:54 CST 2019.
       This element was generated on Thu Sep 26 16:21:54 CST 2019.
     -->
     -->
-    select 
+    select
     <include refid="Base_Column_List" />
     <include refid="Base_Column_List" />
     from order_examine
     from order_examine
     where id = #{id,jdbcType=INTEGER}
     where id = #{id,jdbcType=INTEGER}
@@ -140,16 +140,17 @@
       <include refid="Example_Where_Clause" />
       <include refid="Example_Where_Clause" />
     </if>
     </if>
   </delete>
   </delete>
+
   <insert id="insert" parameterType="com.goafanti.common.model.OrderExamine">
   <insert id="insert" parameterType="com.goafanti.common.model.OrderExamine">
     <!--
     <!--
       WARNING - @mbg.generated
       WARNING - @mbg.generated
       This element is automatically generated by MyBatis Generator, do not modify.
       This element is automatically generated by MyBatis Generator, do not modify.
       This element was generated on Thu Sep 26 16:21:54 CST 2019.
       This element was generated on Thu Sep 26 16:21:54 CST 2019.
     -->
     -->
-    insert into order_examine (id, order_no, type, 
+    insert into order_examine (id, order_no, type,
       aid, status, create_time
       aid, status, create_time
       )
       )
-    values (#{id,jdbcType=INTEGER}, #{orderNo,jdbcType=VARCHAR}, #{type,jdbcType=INTEGER}, 
+    values (#{id,jdbcType=INTEGER}, #{orderNo,jdbcType=VARCHAR}, #{type,jdbcType=INTEGER},
       #{aid,jdbcType=VARCHAR}, #{status,jdbcType=INTEGER}, #{createTime,jdbcType=TIMESTAMP}
       #{aid,jdbcType=VARCHAR}, #{status,jdbcType=INTEGER}, #{createTime,jdbcType=TIMESTAMP}
       )
       )
   </insert>
   </insert>
@@ -312,7 +313,7 @@
   and `type`= #{type}
   and `type`= #{type}
   </if>
   </if>
   </select>
   </select>
-  
+
   <select id="selectByOrderNo" resultType="com.goafanti.common.bo.OrderExamineBo">
   <select id="selectByOrderNo" resultType="com.goafanti.common.bo.OrderExamineBo">
     		select a.id,b.name,a.type,a.status
     		select a.id,b.name,a.type,a.status
     from order_examine a left join admin b on a.aid=b.id
     from order_examine a left join admin b on a.aid=b.id
@@ -324,7 +325,7 @@
   </select>
   </select>
   <update id="updateByOrderNo">
   <update id="updateByOrderNo">
   update order_examine set status=0
   update order_examine set status=0
-    where order_no=#{orderNo} 
+    where order_no=#{orderNo}
     <if test="status != null">
     <if test="status != null">
     and status=#{status}
     and status=#{status}
     </if>
     </if>
@@ -332,5 +333,12 @@
    <update id="updateDimissionTransfer">
    <update id="updateDimissionTransfer">
   update order_examine set aid= #{transferId}
   update order_examine set aid= #{transferId}
 	where status=0 and aid= #{aid}
 	where status=0 and aid= #{aid}
+    <if test="type!=null">
+      and type= #{type}
+    </if>
   </update>
   </update>
-</mapper>
+  <delete id="deleteByAidAndStatus">
+    delete  from order_examine
+    where status=0 and  aid=#{aid} and type=#{type}
+  </delete>
+</mapper>

+ 36 - 27
src/main/java/com/goafanti/common/mapper/TChangeTaskMapper.xml

@@ -99,8 +99,8 @@
       This element is automatically generated by MyBatis Generator, do not modify.
       This element is automatically generated by MyBatis Generator, do not modify.
       This element was generated on Fri Oct 16 15:54:00 CST 2020.
       This element was generated on Fri Oct 16 15:54:00 CST 2020.
     -->
     -->
-    id, tid, cid, order_no, main, commodity_id, commodity_name, commodity_quantity, commodity_price, 
-    task_comment, type, create_time, split_status, split_super, receiver_name, official_cost, 
+    id, tid, cid, order_no, main, commodity_id, commodity_name, commodity_quantity, commodity_price,
+    task_comment, type, create_time, split_status, split_super, receiver_name, official_cost,
     cost_reduction
     cost_reduction
   </sql>
   </sql>
   <select id="selectByExample" parameterType="com.goafanti.common.model.TChangeTaskExample" resultMap="BaseResultMap">
   <select id="selectByExample" parameterType="com.goafanti.common.model.TChangeTaskExample" resultMap="BaseResultMap">
@@ -128,7 +128,7 @@
       This element is automatically generated by MyBatis Generator, do not modify.
       This element is automatically generated by MyBatis Generator, do not modify.
       This element was generated on Fri Oct 16 15:54:00 CST 2020.
       This element was generated on Fri Oct 16 15:54:00 CST 2020.
     -->
     -->
-    select 
+    select
     <include refid="Base_Column_List" />
     <include refid="Base_Column_List" />
     from t_change_task
     from t_change_task
     where id = #{id,jdbcType=INTEGER}
     where id = #{id,jdbcType=INTEGER}
@@ -159,17 +159,17 @@
       This element is automatically generated by MyBatis Generator, do not modify.
       This element is automatically generated by MyBatis Generator, do not modify.
       This element was generated on Fri Oct 16 15:54:00 CST 2020.
       This element was generated on Fri Oct 16 15:54:00 CST 2020.
     -->
     -->
-    insert into t_change_task (id, tid, cid, 
-      order_no, main, commodity_id, 
-      commodity_name, commodity_quantity, commodity_price, 
-      task_comment, type, create_time, 
-      split_status, split_super, receiver_name, 
+    insert into t_change_task (id, tid, cid,
+      order_no, main, commodity_id,
+      commodity_name, commodity_quantity, commodity_price,
+      task_comment, type, create_time,
+      split_status, split_super, receiver_name,
       official_cost, cost_reduction)
       official_cost, cost_reduction)
-    values (#{id,jdbcType=INTEGER}, #{tid,jdbcType=INTEGER}, #{cid,jdbcType=INTEGER}, 
-      #{orderNo,jdbcType=VARCHAR}, #{main,jdbcType=INTEGER}, #{commodityId,jdbcType=VARCHAR}, 
-      #{commodityName,jdbcType=VARCHAR}, #{commodityQuantity,jdbcType=INTEGER}, #{commodityPrice,jdbcType=DECIMAL}, 
-      #{taskComment,jdbcType=VARCHAR}, #{type,jdbcType=INTEGER}, #{createTime,jdbcType=TIMESTAMP}, 
-      #{splitStatus,jdbcType=INTEGER}, #{splitSuper,jdbcType=INTEGER}, #{receiverName,jdbcType=VARCHAR}, 
+    values (#{id,jdbcType=INTEGER}, #{tid,jdbcType=INTEGER}, #{cid,jdbcType=INTEGER},
+      #{orderNo,jdbcType=VARCHAR}, #{main,jdbcType=INTEGER}, #{commodityId,jdbcType=VARCHAR},
+      #{commodityName,jdbcType=VARCHAR}, #{commodityQuantity,jdbcType=INTEGER}, #{commodityPrice,jdbcType=DECIMAL},
+      #{taskComment,jdbcType=VARCHAR}, #{type,jdbcType=INTEGER}, #{createTime,jdbcType=TIMESTAMP},
+      #{splitStatus,jdbcType=INTEGER}, #{splitSuper,jdbcType=INTEGER}, #{receiverName,jdbcType=VARCHAR},
       #{officialCost,jdbcType=INTEGER}, #{costReduction,jdbcType=INTEGER})
       #{officialCost,jdbcType=INTEGER}, #{costReduction,jdbcType=INTEGER})
   </insert>
   </insert>
   <insert id="insertSelective" parameterType="com.goafanti.common.model.TChangeTask">
   <insert id="insertSelective" parameterType="com.goafanti.common.model.TChangeTask">
@@ -473,17 +473,17 @@
       cost_reduction = #{costReduction,jdbcType=INTEGER}
       cost_reduction = #{costReduction,jdbcType=INTEGER}
     where id = #{id,jdbcType=INTEGER}
     where id = #{id,jdbcType=INTEGER}
   </update>
   </update>
-  
+
   <insert id="insertSelectiveList" parameterType="java.util.List">
   <insert id="insertSelectiveList" parameterType="java.util.List">
     insert into t_change_task ( tid, cid, split_status,
     insert into t_change_task ( tid, cid, split_status,
-      order_no, commodity_id, commodity_name, 
-      commodity_quantity, commodity_price, task_comment, 
+      order_no, commodity_id, commodity_name,
+      commodity_quantity, commodity_price, task_comment,
         split_super , receiver_name, create_time)
         split_super , receiver_name, create_time)
-    values 
+    values
     <foreach collection="list" index="index" item="item" separator=",">
     <foreach collection="list" index="index" item="item" separator=",">
       ( #{item.tid,jdbcType=INTEGER}, #{item.cid,jdbcType=INTEGER}, #{item.splitStatus,jdbcType=INTEGER},
       ( #{item.tid,jdbcType=INTEGER}, #{item.cid,jdbcType=INTEGER}, #{item.splitStatus,jdbcType=INTEGER},
-      #{item.orderNo,jdbcType=VARCHAR}, #{item.commodityId,jdbcType=VARCHAR}, #{item.commodityName,jdbcType=VARCHAR}, 
-      #{item.commodityQuantity,jdbcType=INTEGER}, #{item.commodityPrice,jdbcType=DECIMAL}, #{item.taskComment,jdbcType=VARCHAR}, 
+      #{item.orderNo,jdbcType=VARCHAR}, #{item.commodityId,jdbcType=VARCHAR}, #{item.commodityName,jdbcType=VARCHAR},
+      #{item.commodityQuantity,jdbcType=INTEGER}, #{item.commodityPrice,jdbcType=DECIMAL}, #{item.taskComment,jdbcType=VARCHAR},
        #{item.splitSuper,jdbcType=INTEGER}, #{item.receiverName,jdbcType=VARCHAR}, now())
        #{item.splitSuper,jdbcType=INTEGER}, #{item.receiverName,jdbcType=VARCHAR}, now())
     </foreach>
     </foreach>
   </insert>
   </insert>
@@ -493,7 +493,7 @@
 	a.receiver_name receiverName, a.task_comment as taskComment ,a.commodity_price as commodityPrice,a.split_status splitStatus,
 	a.receiver_name receiverName, a.task_comment as taskComment ,a.commodity_price as commodityPrice,a.split_status splitStatus,
 	a.split_super splitSuper
 	a.split_super splitSuper
     from t_change_task a left join business_project i on a.commodity_id=i.id
     from t_change_task a left join business_project i on a.commodity_id=i.id
-  	left join business_category c on i.cid=c.id 
+  	left join business_category c on i.cid=c.id
   	where 1=1
   	where 1=1
   	<if test="splitStatus !=null and splitStatus !=3">
   	<if test="splitStatus !=null and splitStatus !=3">
   	and a.split_status= #{splitStatus}
   	and a.split_status= #{splitStatus}
@@ -504,8 +504,8 @@
   	 and a.cid= #{id} order by a.id
   	 and a.cid= #{id} order by a.id
   </select>
   </select>
     <update id="updateByTid">
     <update id="updateByTid">
-  		update t_change_task set type= #{type} 
-  		where 1=1 
+  		update t_change_task set type= #{type}
+  		where 1=1
   		<if test="tid !=null">
   		<if test="tid !=null">
   		and tid= #{tid}
   		and tid= #{tid}
   		</if>
   		</if>
@@ -516,19 +516,28 @@
   		and split_super= #{sid}
   		and split_super= #{sid}
   		</if>
   		</if>
   </update>
   </update>
-  
+
    <update id="deleteByTid">
    <update id="deleteByTid">
   		delete from t_change_task where tid= #{tid};
   		delete from t_change_task where tid= #{tid};
   </update>
   </update>
-  
-  
+
+
 
 
     <select id="selectBySuper" resultType="com.goafanti.order.bo.TChangeTaskOut">
     <select id="selectBySuper" resultType="com.goafanti.order.bo.TChangeTaskOut">
 	select a.id,a.order_no as orderNo,a.main, c.cname,c.sort cSort,a.commodity_name as commodityName,
 	select a.id,a.order_no as orderNo,a.main, c.cname,c.sort cSort,a.commodity_name as commodityName,
   	a.commodity_quantity as commodityQuantity,i.price,a.commodity_id as commodityId,a.type,a.tid,a.receiver_name receiverName,
   	a.commodity_quantity as commodityQuantity,i.price,a.commodity_id as commodityId,a.type,a.tid,a.receiver_name receiverName,
 	a.task_comment as taskComment ,a.commodity_price as commodityPrice,a.split_status splitStatus,a.split_super splitSuper
 	a.task_comment as taskComment ,a.commodity_price as commodityPrice,a.split_status splitStatus,a.split_super splitSuper
     from t_change_task a left join business_project i on a.commodity_id=i.id
     from t_change_task a left join business_project i on a.commodity_id=i.id
-  	left join business_category c on i.cid=c.id 
+  	left join business_category c on i.cid=c.id
   	where a.split_status=2 and a.split_super= #{splitSuper} and a.cid= #{cid} order by a.id
   	where a.split_status=2 and a.split_super= #{splitSuper} and a.cid= #{cid} order by a.id
   </select>
   </select>
-</mapper>
+
+
+
+<select id="selectBytid" resultType="com.goafanti.common.model.TChangeTask">
+    select tct.id,tct.tid,tct.cid,tct.order_no orderNo
+    from t_change_task tct left join new_order_change noc on tct.cid =noc.id
+    where noc.process_state &lt; 4 and noc.status in (0,1,2)
+      and tct.tid= #{tid}
+  </select>
+</mapper>

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

@@ -1138,6 +1138,12 @@
     <if test="type==1">
     <if test="type==1">
       ,manager_id=#{transferId,jdbcType=VARCHAR}
       ,manager_id=#{transferId,jdbcType=VARCHAR}
     </if>
     </if>
+    <if test="type==3">
+      ,consultant_id= null
+    </if>
+    <if test="type==1">
+      ,manager_id= null
+    </if>
     where task_receiver=#{aid,jdbcType=VARCHAR}
     where task_receiver=#{aid,jdbcType=VARCHAR}
   </update>
   </update>
 
 
@@ -1870,6 +1876,13 @@
         and a.process_status = #{status}
         and a.process_status = #{status}
       </if>
       </if>
   </select>
   </select>
+  <select id="selectByAid" resultType="com.goafanti.common.model.TChangeTask">
+    select b.id,b.cid from t_order_task a
+    left join t_change_task b on a.id=b.tid
+    left join new_order_change noc on b.cid =noc.id
+    where b.id is not null and  noc.process_state &lt; 4 and noc.status in (0,1,2)
+    and a.task_receiver = #{aid}
+  </select>
 
 
 
 
 </mapper>
 </mapper>

+ 14 - 0
src/main/java/com/goafanti/common/utils/AsyncUtils.java

@@ -2,14 +2,20 @@ package com.goafanti.common.utils;
 
 
 import java.io.UnsupportedEncodingException;
 import java.io.UnsupportedEncodingException;
 import java.util.ArrayList;
 import java.util.ArrayList;
+import java.util.Date;
 import java.util.List;
 import java.util.List;
 
 
 import javax.mail.MessagingException;
 import javax.mail.MessagingException;
 
 
 import com.goafanti.admin.bo.AdminListBo;
 import com.goafanti.admin.bo.AdminListBo;
 import com.goafanti.common.dao.AdminMapper;
 import com.goafanti.common.dao.AdminMapper;
+import com.goafanti.common.dao.NewOrderChangeMapper;
+import com.goafanti.common.dao.TChangeTaskMapper;
 import com.goafanti.common.enums.NoticeStatus;
 import com.goafanti.common.enums.NoticeStatus;
+import com.goafanti.common.model.Admin;
+import com.goafanti.common.model.TChangeTask;
 import com.goafanti.core.shiro.token.TokenManager;
 import com.goafanti.core.shiro.token.TokenManager;
+import com.goafanti.order.bo.NewOrderChangeBo;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.scheduling.annotation.Async;
 import org.springframework.scheduling.annotation.Async;
 import org.springframework.stereotype.Component;
 import org.springframework.stereotype.Component;
@@ -26,6 +32,10 @@ public class AsyncUtils {
 	private NoticeMapper noticeMapper;
 	private NoticeMapper noticeMapper;
 	@Autowired
 	@Autowired
 	private AdminMapper adminMapper;
 	private AdminMapper adminMapper;
+	@Autowired
+	private TChangeTaskMapper tChangeTaskMapper;
+	@Autowired
+	private NewOrderChangeMapper newOrderChangeMapper;
 
 
 
 
 
 
@@ -89,4 +99,8 @@ public class AsyncUtils {
 		noticeMapper.batchUpdateUnreaded(dl);
 		noticeMapper.batchUpdateUnreaded(dl);
     }
     }
 
 
+
+
+
+
 }
 }

+ 2 - 3
src/main/java/com/goafanti/order/service/OrderProjectService.java

@@ -16,9 +16,8 @@ public interface OrderProjectService {
 
 
 	/**
 	/**
 	 *
 	 *
-	 * @param taskId
-	 * @param taskReceiverId
-	 * @param remarks
+	 * @param taskId 项目ID
+	 * @param taskReceiverId 受理人ID
 	 * @param type 0管理员派单 1经理转交 2经理派单 3咨询师转交 4回退
 	 * @param type 0管理员派单 1经理转交 2经理派单 3咨询师转交 4回退
 	 * @return
 	 * @return
 	 */
 	 */

+ 1 - 0
src/main/java/com/goafanti/order/service/impl/OrderProjectServiceImpl.java

@@ -147,6 +147,7 @@ public class OrderProjectServiceImpl extends BaseMybatisDao<TOrderTaskMapper> im
 			t.setConsultantId(taskReceiverId);
 			t.setConsultantId(taskReceiverId);
 		}else if(type==4) {
 		}else if(type==4) {
 			t.setConsultantId(null);
 			t.setConsultantId(null);
+			t.setManagerId(taskReceiverId);
 		}
 		}
 		t.setReceiverName(a.getName());
 		t.setReceiverName(a.getName());
 		tOrderTaskMapper.updateByPrimaryKey(t);
 		tOrderTaskMapper.updateByPrimaryKey(t);

+ 4 - 5
src/main/java/com/goafanti/permission/controller/NewRoleApiController.java

@@ -28,7 +28,7 @@ public class NewRoleApiController extends BaseApiController{
 	private NewRoleService newRoleService;
 	private NewRoleService newRoleService;
 	@Autowired
 	@Autowired
 	RoleMapper				roleMapper;
 	RoleMapper				roleMapper;
-	
+
 	@RequestMapping(value = "/roles", method = RequestMethod.POST)
 	@RequestMapping(value = "/roles", method = RequestMethod.POST)
 	public Result roles(RoleBo role, Integer pageNo,
 	public Result roles(RoleBo role, Integer pageNo,
 			Integer pageSize) {
 			Integer pageSize) {
@@ -36,7 +36,7 @@ public class NewRoleApiController extends BaseApiController{
 		res.setData(newRoleService.findRoles(role,pageNo,pageSize));
 		res.setData(newRoleService.findRoles(role,pageNo,pageSize));
 		return res;
 		return res;
 	}
 	}
-	
+
 	@RequestMapping(value = "/role/rolePermission", method = RequestMethod.POST)
 	@RequestMapping(value = "/role/rolePermission", method = RequestMethod.POST)
 	public Result rolePermission(String id){
 	public Result rolePermission(String id){
 		Result res = new Result();
 		Result res = new Result();
@@ -80,7 +80,7 @@ public class NewRoleApiController extends BaseApiController{
 	public Result deleteRole(String data) {
 	public Result deleteRole(String data) {
 		Result res = new Result();
 		Result res = new Result();
 		JSONArray ja = (JSONArray) JSON.parse(data);
 		JSONArray ja = (JSONArray) JSON.parse(data);
-		
+
 		if (ja != null && !ja.isEmpty()) {
 		if (ja != null && !ja.isEmpty()) {
 			List<String> records = new ArrayList<>();
 			List<String> records = new ArrayList<>();
 			for (int idx = 0; idx < ja.size(); idx++) {
 			for (int idx = 0; idx < ja.size(); idx++) {
@@ -145,14 +145,13 @@ public class NewRoleApiController extends BaseApiController{
 			res.getError().add(buildError("","角色资源不能为空"));
 			res.getError().add(buildError("","角色资源不能为空"));
 			return res;
 			return res;
 		}
 		}
-		
+
 		res.setData(newRoleService.addResources(rid, resources));
 		res.setData(newRoleService.addResources(rid, resources));
 		return res;
 		return res;
 	}
 	}
 	/**
 	/**
 	 * 角色资源详情
 	 * 角色资源详情
 	 * @param rid 角色ID
 	 * @param rid 角色ID
-	 * @param resources 资源
 	 * @return
 	 * @return
 	 */
 	 */
 	@RequestMapping(value = "/role/ResourcesDetail", method = RequestMethod.POST)
 	@RequestMapping(value = "/role/ResourcesDetail", method = RequestMethod.POST)

+ 94 - 37
src/main/java/com/goafanti/permission/service/impl/NewRoleServiceImpl.java

@@ -10,35 +10,18 @@ import java.util.Map;
 import java.util.Set;
 import java.util.Set;
 import java.util.UUID;
 import java.util.UUID;
 
 
+import com.goafanti.common.bo.OrderExamineBo;
+import com.goafanti.common.dao.*;
+import com.goafanti.common.model.*;
+import com.goafanti.order.bo.NewOrderChangeBo;
+import com.goafanti.order.bo.TOrderTaskBo;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.stereotype.Service;
 import org.springframework.stereotype.Service;
 
 
 import com.goafanti.common.bo.Error;
 import com.goafanti.common.bo.Error;
 import com.goafanti.common.constant.AFTConstants;
 import com.goafanti.common.constant.AFTConstants;
-import com.goafanti.common.dao.AdminMapper;
-import com.goafanti.common.dao.OrderExamineMapper;
-import com.goafanti.common.dao.OrganizationContactBookMapper;
-import com.goafanti.common.dao.PatentNewMapper;
-import com.goafanti.common.dao.RoleMapper;
-import com.goafanti.common.dao.RolePermissionMapper;
-import com.goafanti.common.dao.RoleResourcesMapper;
-import com.goafanti.common.dao.TOrderLogMapper;
-import com.goafanti.common.dao.TOrderMidMapper;
-import com.goafanti.common.dao.TOrderNewMapper;
-import com.goafanti.common.dao.TOrderTaskMapper;
-import com.goafanti.common.dao.TTaskLogMapper;
-import com.goafanti.common.dao.TaskAttributionLogMapper;
-import com.goafanti.common.dao.UserBusinessMapper;
-import com.goafanti.common.dao.UserMapper;
-import com.goafanti.common.dao.UserRoleMapper;
-import com.goafanti.common.dao.UserTransferLogMapper;
 import com.goafanti.common.enums.roleResources;
 import com.goafanti.common.enums.roleResources;
 import com.goafanti.common.error.BusinessException;
 import com.goafanti.common.error.BusinessException;
-import com.goafanti.common.model.Admin;
-import com.goafanti.common.model.Role;
-import com.goafanti.common.model.RolePermission;
-import com.goafanti.common.model.RoleResources;
-import com.goafanti.common.model.UserRole;
 import com.goafanti.common.utils.StringUtils;
 import com.goafanti.common.utils.StringUtils;
 import com.goafanti.core.mybatis.BaseMybatisDao;
 import com.goafanti.core.mybatis.BaseMybatisDao;
 import com.goafanti.core.mybatis.page.Pagination;
 import com.goafanti.core.mybatis.page.Pagination;
@@ -82,6 +65,13 @@ public class NewRoleServiceImpl extends BaseMybatisDao<RoleMapper> implements Ne
 	private TaskAttributionLogMapper	taskAttributionLogMapper;
 	private TaskAttributionLogMapper	taskAttributionLogMapper;
 	@Autowired
 	@Autowired
 	private TOrderLogMapper	tOrderLogMapper;
 	private TOrderLogMapper	tOrderLogMapper;
+	@Autowired
+	private TChangeTaskMapper tChangeTaskMapper;
+	@Autowired
+	private NewOrderChangeMapper newOrderChangeMapper;
+
+	@Autowired
+	private OrderChangeLogMapper	orderChangeLogMapper;
 
 
 
 
 	@Override
 	@Override
@@ -212,6 +202,8 @@ public class NewRoleServiceImpl extends BaseMybatisDao<RoleMapper> implements Ne
 			throw new BusinessException(new Error("","用户角色资源不存在"));
 			throw new BusinessException(new Error("","用户角色资源不存在"));
 		}
 		}
 		Date date=new Date();
 		Date date=new Date();
+		Admin admin=adminMapper.selectAllByid(aid);
+		Admin tadmin=adminMapper.selectAllByid(transferId);
 		for (Integer s : list) {
 		for (Integer s : list) {
 			if (s==roleResources.YXKH.getCode()) {
 			if (s==roleResources.YXKH.getCode()) {
 				userTransferLogMapper.insertUserLog(aid,transferId,date);
 				userTransferLogMapper.insertUserLog(aid,transferId,date);
@@ -227,28 +219,17 @@ public class NewRoleServiceImpl extends BaseMybatisDao<RoleMapper> implements Ne
 				roleResourcesMapper.updateLockRelease("1",aid,transferId);//将业务锁转给指定人
 				roleResourcesMapper.updateLockRelease("1",aid,transferId);//将业务锁转给指定人
 			}
 			}
 			if (s == roleResources.YQDD.getCode()) {
 			if (s == roleResources.YQDD.getCode()) {
-				Admin ad=adminMapper.selectAllByid(aid);
-				Admin ad2=adminMapper.selectAllByid(transferId);
+
 				StringBuffer str=new StringBuffer();
 				StringBuffer str=new StringBuffer();
-				str.append(ad.getName()).append("离职转交到").append(ad2.getName());
+				str.append(admin.getName()).append("离职转交到").append(tadmin.getName());
 				tOrderLogMapper.insertOrderLog(aid,TokenManager.getAdminId(),date,str.toString());
 				tOrderLogMapper.insertOrderLog(aid,TokenManager.getAdminId(),date,str.toString());
 				tOrderNewMapper.updateSalesmanId(aid, transferId);
 				tOrderNewMapper.updateSalesmanId(aid, transferId);
 				tOrderMidMapper.updateSalesmanId(aid, transferId);
 				tOrderMidMapper.updateSalesmanId(aid, transferId);
 			}
 			}
 			if (s == roleResources.XMRW.getCode()) {
 			if (s == roleResources.XMRW.getCode()) {
 				// 获取被转角色判断修改对应任务角色
 				// 获取被转角色判断修改对应任务角色
-				int type=0;
-				List<String>  l=adminMapper.getAdminRoleListByAid(transferId);
-				for (String str : l) {
-					if (str.equals(AFTConstants.TECH_MANAGER)) {
-						type=1;
-						break;
-					}
-				}
-				taskAttributionLogMapper.insertList(aid, transferId, date);
-				tOrderTaskMapper.updateDimissionTransfer(aid, transferId, type);
-				tTaskLogMapper.updateDimissionTransfer(aid, transferId);
-				orderExamineMapper.updateDimissionTransfer(aid, transferId);
+				pushTechTransfer(aid,transferId,date,admin,tadmin);
+
 			}
 			}
 			if (s!=roleResources.QDYW.getCode()) {
 			if (s!=roleResources.QDYW.getCode()) {
 				roleResourcesMapper.updateDimissionTransfer(s,aid,transferId);
 				roleResourcesMapper.updateDimissionTransfer(s,aid,transferId);
@@ -256,6 +237,82 @@ public class NewRoleServiceImpl extends BaseMybatisDao<RoleMapper> implements Ne
 		}
 		}
 		return 1;
 		return 1;
 	}
 	}
+
+	public  void pushTechTransfer(String aid, String transferId,Date date,Admin admin,Admin tadmin) {
+		//获取旧人员与新人员的角色
+		int useType=getTech(aid);
+		int newType=getTech(transferId);
+		//如果不是咨询或者经理不走项目转交
+		if(useType!=-1&&newType!=-1){
+			//获取所有需要修改角色的变更项目
+			List<TChangeTask> list = tOrderTaskMapper.selectByAid(aid);
+			if ((useType==0&&newType==0)||(useType==1&&newType==1)){
+				tOrderTaskMapper.updateDimissionTransfer(aid, transferId, useType);
+				orderExamineMapper.updateDimissionTransfer(aid, transferId,useType);
+			}else if (useType==0&&newType==1){//下转上 下清空
+				tOrderTaskMapper.updateDimissionTransfer(aid, transferId, 3);
+				orderExamineMapper.updateDimissionTransfer(aid, transferId,newType);
+				orderExamineMapper.deleteByAidAndStatus(aid,useType);
+			}else if (useType==1&&newType==0){//上转下  上清空
+				tOrderTaskMapper.updateDimissionTransfer(aid, transferId, 4);
+				orderExamineMapper.updateDimissionTransfer(aid, transferId,newType);
+				orderExamineMapper.deleteByAidAndStatus(aid,useType);
+			}
+			List<Integer> clist=new ArrayList<>();
+			for (TChangeTask tct : list) {
+				TChangeTask nt = new TChangeTask();
+				tct.setId(tct.getId());
+				tct.setReceiverName(tadmin.getName());
+				tChangeTaskMapper.updateByPrimaryKeySelective(tct);
+				if (!clist.contains(tct.getCid()))clist.add(tct.getCid());
+			}
+			for (Integer i : clist) {
+				NewOrderChangeBo changeBo = newOrderChangeMapper.selectById(i);
+				int x=1;
+				if (changeBo.getProcessState()==2){
+					x=orderExamineMapper.checkCountStatus(changeBo.getOrderNo(), 0,0);
+				}else if (changeBo.getProcessState()==3){
+					  x=orderExamineMapper.checkCountStatus(changeBo.getOrderNo(), 1,0);
+				}
+				if (x==0){
+					OrderChangeLog log=new OrderChangeLog();
+					log.setChangeId(i);
+					log.setCreateTime(date);
+					log.setOrderNo(changeBo.getOrderNo());
+					log.setStatus(2);
+					log.setRemarks("离职转交自动通过");
+					log.setAuditor("1");
+					orderChangeLogMapper.insertSelective(log);
+					changeBo.setProcessState(changeBo.getProcessState()+1);
+					newOrderChangeMapper.updateByPrimaryKeySelective(changeBo);
+				}
+			}
+			taskAttributionLogMapper.insertList(aid, transferId, date);
+			tTaskLogMapper.updateDimissionTransfer(aid, transferId);
+		}
+
+	}
+
+	/**
+	 * 判断角色
+	 * @param transferId
+	 * @return 0咨询师 1经理 -1非咨询角色
+	 */
+	private int getTech(String transferId) {
+		List<String>  l=adminMapper.getAdminRoleListByAid(transferId);
+		for (String str : l) {
+			if (str==null){
+				break;
+			}else if (str.equals(AFTConstants.TECH_MANAGER)) {
+				return 1;
+			}else if (str.equals(AFTConstants.TECH)){
+				return 0;
+			}
+		}
+
+		return -1;
+	}
+
 	@Override
 	@Override
 	public List<RoleResources> ResourcesDetail(String rid) {
 	public List<RoleResources> ResourcesDetail(String rid) {
 		return roleResourcesMapper.selectByRid(rid);
 		return roleResourcesMapper.selectByRid(rid);

+ 1 - 1
src/main/java/com/goafanti/weChat/service/impl/PublicReleaseServiceImpl.java

@@ -400,7 +400,7 @@ public class PublicReleaseServiceImpl extends BaseMybatisDao<PublicReleaseMapper
 					use.setType(3);
 					use.setType(3);
 					use.setMainId(useId);
 					use.setMainId(useId);
 					use.setId(null);
 					use.setId(null);
-					publicReleaseMapper.insert(use);
+					publicReleaseMapper.insertSelective(use);
 					PublicReleaseLog log = new PublicReleaseLog(use.getId(), TokenManager.getAdminId(), PublicReleaseLog.states.ty.getCode(), "同意协单信息", date);
 					PublicReleaseLog log = new PublicReleaseLog(use.getId(), TokenManager.getAdminId(), PublicReleaseLog.states.ty.getCode(), "同意协单信息", date);
 					publicReleaseLogMapper.insertSelective(log);
 					publicReleaseLogMapper.insertSelective(log);
 				}
 				}

+ 6 - 6
src/main/resources/props/config_local.properties

@@ -1,12 +1,12 @@
 dev.name=local
 dev.name=local
 jdbc.driverClassName=com.mysql.jdbc.Driver
 jdbc.driverClassName=com.mysql.jdbc.Driver
-jdbc.url=jdbc\:mysql://localhost:3306/aft?useUnicode=true&characterEncoding=UTF-8&autoReconnect=true&useSSL=false
+#jdbc.url=jdbc\:mysql://localhost:3306/aft?useUnicode=true&characterEncoding=UTF-8&autoReconnect=true&useSSL=false
 #jdbc.url=jdbc\:mysql://localhost:3306/aft20220318?useUnicode=true&characterEncoding=UTF-8&autoReconnect=true&useSSL=false
 #jdbc.url=jdbc\:mysql://localhost:3306/aft20220318?useUnicode=true&characterEncoding=UTF-8&autoReconnect=true&useSSL=false
-jdbc.username=root
-jdbc.password=123456
-#jdbc.url=jdbc:mysql://101.37.32.31:3306/aft?useUnicode=true&characterEncoding=UTF-8&autoReconnect=true&useSSL=false
 #jdbc.username=root
 #jdbc.username=root
-#jdbc.password=aftdev
+#jdbc.password=123456
+jdbc.url=jdbc:mysql://101.37.32.31:3306/aft?useUnicode=true&characterEncoding=UTF-8&autoReconnect=true&useSSL=false
+jdbc.username=root
+jdbc.password=aftdev
 jdbc.validationQuery=SELECT 'x'
 jdbc.validationQuery=SELECT 'x'
 jdbc.initialSize=3
 jdbc.initialSize=3
 jdbc.maxActive=20
 jdbc.maxActive=20
@@ -46,7 +46,7 @@ user_remind_days=15
 user_channel_days=90
 user_channel_days=90
 
 
 avatar.host=//static.jishutao.com
 avatar.host=//static.jishutao.com
-static.host=//static.jishutao.com/1.2.24
+static.host=//static.jishutao.com/1.2.25
 #avatar.host=//172.16.0.255:3000
 #avatar.host=//172.16.0.255:3000
 #static.host=//172.16.0.255:3000/1.2.05
 #static.host=//172.16.0.255:3000/1.2.05
 #static.host=http://172.16.1.187/prod/1.2.05
 #static.host=http://172.16.1.187/prod/1.2.05

+ 1 - 1
src/main/resources/props/config_test.properties

@@ -43,7 +43,7 @@ user_remind_days=15
 #\u63D0\u524D\u63D0\u9192\u5929\u6570
 #\u63D0\u524D\u63D0\u9192\u5929\u6570
 user_channel_days=90
 user_channel_days=90
 
 
-static.host=//static.jishutao.com/1.2.24
+static.host=//static.jishutao.com/1.2.25
 portal.host=//static.jishutao.com/portal/2.0.6
 portal.host=//static.jishutao.com/portal/2.0.6
 avatar.host=//static.jishutao.com
 avatar.host=//static.jishutao.com
 avatar.upload.host=//static.jishutao.com/upload
 avatar.upload.host=//static.jishutao.com/upload