瀏覽代碼

修改管理员账号BUG修复

anderx 3 年之前
父節點
當前提交
e20bc674a9

+ 15 - 11
src/main/java/com/goafanti/common/mapper/UserMapperExt.xml

@@ -325,8 +325,8 @@
 	</select>
 
 	<select id="selectOrganizationCustomerList" resultType="com.goafanti.customer.bo.CustomerListOut">
-		select
-			a.id as uid,
+	 	select DISTINCT
+		a.id as uid,
 			a.nickname as name,
 			date_format(a.create_time,'%Y-%m-%d %H:%i:%S') as createTime,
 			dg1.name as province,
@@ -337,19 +337,19 @@
 			a.share_type as shareType,
 			a.channel ,
 			a.information_maintainer as mid
-		from `user` a
+		from  `user` a
 		left join user_names un on a.id=un.uid
 		left join organization_identity b on a.id = b.uid
 		left join district_glossory dg1 on b.location_province = dg1.id
 		left join district_glossory dg2 on b.location_city = dg2.id
 		left join district_glossory dg3 on b.location_area = dg3.id
 		left join admin d on a.aid = d.id
-		where a.type = 1 and a.status != 1
+		where a.type = 1 and a.status =0
 	<if test="role == 0">
 		and un.name = #{name}
 	</if>
-	<if test="role == 1">
-		and a.nickname like concat('%', #{name},'%')
+		<if test="role == 1 and name != null">
+		and un.name like concat('%', #{name},'%')
 	</if>
 		<if test="aid != null and aid !=''">
 			and a.aid = #{aid,jdbcType=VARCHAR}
@@ -376,23 +376,26 @@
     		${page_sql}
    		</if>
 	</select>
+	<!--因为查询到所有曾用名,所以在统计时需要用客户编号来归并-->
 	<select id="selectOrganizationCustomerCount" resultType="java.lang.Integer">
 		select
-			count(0)
-		from user a
+		count(0)
+		from(select a.id from `user` a
+		<if test="role == 1 and name != null">
 		left join user_names un on a.id=un.uid
+		</if>
 		left join organization_identity b on a.id = b.uid
 		<if test="departmentId != null and departmentId !=''">
 		INNER join (select id
 		from admin
 		where department_id=#{departmentId,jdbcType=VARCHAR}) d on a.aid = d.id
 		</if>
-		where a.type = 1 and a.status != 1
+		where a.type = 1 and a.status =0
 		<if test="role == 0">
 		and un.name = #{name}
 	</if>
-	<if test="role == 1">
-		and a.nickname like concat('%', #{name},'%')
+	<if test="role == 1 and name != null">
+		and un.name like concat('%', #{name},'%')
 	</if>
 		<if test="aid != null and aid !=''">
 			and a.aid = #{aid,jdbcType=VARCHAR}
@@ -412,6 +415,7 @@
 		<if test="area != null">
 			and b.location_area = #{area,jdbcType=INTEGER}
 		</if>
+		group by a.id)x
 	</select>
 
 

+ 3 - 23
src/main/java/com/goafanti/common/task/OrderDunTask.java

@@ -1,11 +1,9 @@
 package com.goafanti.common.task;
 
 
-import java.io.UnsupportedEncodingException;
 import java.math.BigDecimal;
 import java.util.*;
 
-import javax.mail.MessagingException;
 
 import com.goafanti.common.bo.ErrorDunListBo;
 import com.goafanti.order.bo.*;
@@ -16,11 +14,7 @@ import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.beans.factory.annotation.Value;
 import org.springframework.scheduling.annotation.Scheduled;
 import org.springframework.stereotype.Component;
-import org.springframework.stereotype.Controller;
 import org.springframework.transaction.annotation.Transactional;
-import org.springframework.web.bind.annotation.RequestMapping;
-import org.springframework.web.bind.annotation.RequestMethod;
-import org.springframework.web.bind.annotation.ResponseBody;
 
 import com.goafanti.common.bo.EmailBo;
 import com.goafanti.common.constant.AFTConstants;
@@ -32,7 +26,6 @@ import com.goafanti.common.enums.NoticeStatus;
 import com.goafanti.common.model.Notice;
 import com.goafanti.common.model.PaymentNode;
 import com.goafanti.common.model.TArrearsDun;
-import com.goafanti.common.model.TOrderDun;
 import com.goafanti.common.model.TOrderMid;
 import com.goafanti.common.model.TOrderNew;
 import com.goafanti.common.utils.AsyncUtils;
@@ -88,7 +81,7 @@ public class OrderDunTask {
 	/**
 	 * 法务订单催款处理
 	 */
-	@RequestMapping(value = "/open/pushLegalAffairs", method = RequestMethod.GET)
+//	@RequestMapping(value = "/open/pushLegalAffairs", method = RequestMethod.GET)
 	public void pushLegalAffairs() {
 		InputOrderListBo in = new InputOrderListBo();
 		in.setType(0);
@@ -118,7 +111,7 @@ public class OrderDunTask {
 	/**
 	 * 询处理需要新催款的信息
 	 */
-	@RequestMapping(value = "/open/updateNewOrderDun", method = RequestMethod.GET)
+//	@RequestMapping(value = "/open/updateNewOrderDun", method = RequestMethod.GET)
 	public void updateNewOrderDun(){
   		try {
   			LoggerUtils.debug(logger, "======================新催款任务轮询启动===================");
@@ -224,7 +217,7 @@ public class OrderDunTask {
 	*
 	*/
 	@Scheduled(cron = "0 0 4 1 * ?")
-	@RequestMapping(value = "/open/pushOrderArrearsDun", method = RequestMethod.GET)
+//	@RequestMapping(value = "/open/pushOrderArrearsDun", method = RequestMethod.GET)
 	public void pushOrderArrearsDun(){
 		try {
 			LoggerUtils.debug(logger, "======================欠款催款启动===================");
@@ -404,17 +397,4 @@ public class OrderDunTask {
 	}
 
 
-
-
-
-	private void updateOrderDun(OrderDunTaskBo t) throws UnsupportedEncodingException, MessagingException {
-		LoggerUtils.debug(logger, "======================修改催款任务===================");
-		TOrderDun tDun=new TOrderDun();
-		 tDun.setId(t.getId());
-		 tDun.setDunStatus(1);
-		 tDun.setStartTime(new Date());
-		 orderNewService.updateOrderDun(tDun);
-		orderNewService.addNoticAndSendEmail(t.getOrderNo(),t,NoticeStatus.ORDER_DUN.getCode());
-	}
-
 }