Browse Source

客户档案更新时间BUG修复

anderx 1 year ago
parent
commit
28d15a9c32

+ 1 - 2
src/main/java/com/goafanti/common/dao/TOrderMidMapper.java

@@ -13,7 +13,7 @@ import java.util.List;
  * 订单中间表(TOrderMid)表数据库访问层
  *
  * @author makejava
- * @since 2024-09-06 14:24:11
+ * @since 2024-11-15 09:04:09
  */
 public interface TOrderMidMapper {
 
@@ -120,7 +120,6 @@ public interface TOrderMidMapper {
 
     void updateBidTypeByOrderNo(String orderNo);
 
-    void updateByPrimaryKeySelective(TOrderMid tm);
 
     void insertSelective(TOrderMid tm);
 

File diff suppressed because it is too large
+ 61 - 144
src/main/java/com/goafanti/common/mapper/TOrderMidMapper.xml


+ 1 - 1
src/main/java/com/goafanti/common/mapper/UserArchivesMapper.xml

@@ -299,7 +299,7 @@
     <select id="selectUserArchivesList" resultType="com.goafanti.customer.bo.OutSelectUserArchives">
         select a.id , a.nickname ,d1.name as  province ,d2.name as  city ,d3.name area ,a.sign_bills signBills,
         a.share_type as shareType ,d.channel_type as channelType ,e.enterprise_count as enterpriseCount,
-        c.name contactName,f.name adminName,e.channel_indicators as channelIndicators,a.update_time as updateTime,
+        c.name contactName,f.name adminName,e.channel_indicators as channelIndicators,e.update_time as updateTime,
         e.interview_ideas as interviewIdeas ,b.intended_project as intendedProject,
         e.interview_distribution as interviewDistribution, g.name depName,
         ic.name as  industry ,b.business_scope as businessScope ,e.financial_data as financialData,

+ 7 - 6
src/main/java/com/goafanti/common/mapper/UserServiceMapper.xml

@@ -408,8 +408,9 @@
 
     <select id="OrderUseServiceList" resultMap="userService">
         select a.order_no orderNo,a.contract_no contractNo,b.dep_name depName ,a.buyer_id uid,a.create_time ,b.buyer_name userName,c.new_time ,
-        date_format(a.create_time,'%Y-%m-%d %H:%i:%S') as orderTimes, date_format(c.new_time,'%Y-%m-%d %H:%i:%S') as newTimes,c.add_group_chat,
-        c.add_group_chat_time ,
+        date_format(a.create_time,'%Y-%m-%d %H:%i:%S') as orderTimes, date_format(c.new_time,'%Y-%m-%d %H:%i:%S') as newTimes
+               ,b.add_group_chat,
+        b.add_group_chat_time ,
         date_format(c.renewal_time,'%Y-%m-%d') as renewalTimes, date_format(a.sign_time,'%Y-%m-%d') as signTimes,a.delete_sign deleteSign ,
         d.name adminName,c.add_wechat addWechat,c.wechat ,c.renewal ,c.renewal_time ,c.sign_project signProject ,c.remarks,
         c.tech_satisfaction techSatisfaction, c.business_satisfaction businessSatisfaction
@@ -442,10 +443,10 @@
             and a.create_time BETWEEN #{startSignTimes} and #{endSignTimes}
         </if>
         <if test="addGroupChat != null">
-            and c.add_group_chat = #{addGroupChat}
+            and b.add_group_chat = #{addGroupChat}
         </if>
         <if test="addGroupChatTimeStart != null">
-            and c.add_group_chat_time BETWEEN #{addGroupChatTimeStart} and #{addGroupChatTimeEnd}
+            and b.add_group_chat_time BETWEEN #{addGroupChatTimeStart} and #{addGroupChatTimeEnd}
         </if>
         order by c.new_time,a.create_time
         <if test="page_sql != null">
@@ -484,10 +485,10 @@
             and a.create_time BETWEEN #{startSignTimes} and #{endSignTimes}
         </if>
         <if test="addGroupChat != null">
-            and c.add_group_chat = #{addGroupChat}
+            and b.add_group_chat = #{addGroupChat}
         </if>
         <if test="addGroupChatTimeStart != null">
-            and c.add_group_chat_time BETWEEN #{addGroupChatTimeStart} and #{addGroupChatTimeEnd}
+            and b.add_group_chat_time BETWEEN #{addGroupChatTimeStart} and #{addGroupChatTimeEnd}
         </if>
     </select>
 

+ 26 - 2
src/main/java/com/goafanti/common/model/TOrderMid.java

@@ -9,10 +9,10 @@ import java.util.Date;
  * 订单中间表(TOrderMid)实体类
  *
  * @author makejava
- * @since 2024-09-06 14:24:11
+ * @since 2024-11-15 09:04:09
  */
 public class TOrderMid implements Serializable {
-    private static final long serialVersionUID = -15370816738687916L;
+    private static final long serialVersionUID = 332726388217882919L;
     /**
      * id
      */
@@ -181,6 +181,14 @@ public class TOrderMid implements Serializable {
      * 报销金额
      */
     private BigDecimal expenseAmount;
+    /**
+     * 入群 0=否,1=是
+     */
+    private Integer addGroupChat;
+    /**
+     * 入群时间
+     */
+    private Date addGroupChatTime;
 
 
     public Integer getId() {
@@ -519,5 +527,21 @@ public class TOrderMid implements Serializable {
         this.expenseAmount = expenseAmount;
     }
 
+    public Integer getAddGroupChat() {
+        return addGroupChat;
+    }
+
+    public void setAddGroupChat(Integer addGroupChat) {
+        this.addGroupChat = addGroupChat;
+    }
+
+    public Date getAddGroupChatTime() {
+        return addGroupChatTime;
+    }
+
+    public void setAddGroupChatTime(Date addGroupChatTime) {
+        this.addGroupChatTime = addGroupChatTime;
+    }
+
 }
 

+ 24 - 0
src/main/java/com/goafanti/customer/bo/InputCallNumber.java

@@ -0,0 +1,24 @@
+package com.goafanti.customer.bo;
+
+public class InputCallNumber {
+
+    private String agent;
+    private String callee;
+
+
+    public String getAgent() {
+        return agent;
+    }
+
+    public void setAgent(String agent) {
+        this.agent = agent;
+    }
+
+    public String getCallee() {
+        return callee;
+    }
+
+    public void setCallee(String callee) {
+        this.callee = callee;
+    }
+}

+ 19 - 0
src/main/java/com/goafanti/customer/controller/UserOutboundApiController.java

@@ -1,7 +1,9 @@
 package com.goafanti.customer.controller;
 
+import com.goafanti.common.bo.Error;
 import com.goafanti.common.bo.Result;
 import com.goafanti.common.controller.BaseApiController;
+import com.goafanti.customer.bo.InputCallNumber;
 import com.goafanti.customer.service.UserOutboundService;
 import org.springframework.web.bind.annotation.PostMapping;
 import org.springframework.web.bind.annotation.RequestMapping;
@@ -24,4 +26,21 @@ public class UserOutboundApiController  extends BaseApiController {
     public Result checkUser(Integer type) {
         return new Result<>().data(this.userOutboundService.checkUser(type));
     }
+
+
+    /**
+     * 坐席点击呼叫
+     *
+     */
+    @PostMapping("/callNumber")
+    public Result callNumber(InputCallNumber in) {
+        Result res =new Result();
+        if (in.getAgent()==null){
+            return res.error(new Error("坐席号不能为空"));
+        }
+        if (in.getCallee()==null){
+            return res.error(new Error("客户号不能为空"));
+        }
+        return new Result<>().data(this.userOutboundService.callNumber(in));
+    }
 }

+ 4 - 0
src/main/java/com/goafanti/customer/service/UserOutboundService.java

@@ -1,5 +1,9 @@
 package com.goafanti.customer.service;
 
+import com.goafanti.customer.bo.InputCallNumber;
+
 public interface UserOutboundService {
     Object checkUser(Integer type);
+
+    Object callNumber(InputCallNumber in);
 }

+ 24 - 2
src/main/java/com/goafanti/customer/service/impl/UserOutboundServiceImpl.java

@@ -3,6 +3,7 @@ package com.goafanti.customer.service.impl;
 import com.goafanti.common.dao.UserArchivesMapper;
 import com.goafanti.common.utils.HttpUtils;
 import com.goafanti.core.mybatis.BaseMybatisDao;
+import com.goafanti.customer.bo.InputCallNumber;
 import com.goafanti.customer.service.UserOutboundService;
 import org.apache.shiro.crypto.hash.SimpleHash;
 import org.springframework.stereotype.Service;
@@ -22,6 +23,17 @@ public class UserOutboundServiceImpl extends BaseMybatisDao<UserArchivesMapper>
     public Object checkUser(Integer type) {
         String url= default_url +"/openapi/"+version+"/getClientInfo";
         Map<String,Object> param=new HashMap<>();
+        param.put("authentication",getAuthentication());
+        Map<String,Object> request=new HashMap<>();
+        request.put("type",type);
+        param.put("request",request);
+        HttpUtils httpUtils=new HttpUtils();
+        String s = httpUtils.sendHttpsRequest(url, "POST", param);
+        System.out.println(s);
+        return null;
+    }
+
+    private Map<String, Object> getAuthentication() {
         Map<String,Object> authentication=new HashMap<>();
         authentication.put("customer","C322");
         long timeMillis = System.currentTimeMillis();
@@ -32,12 +44,22 @@ public class UserOutboundServiceImpl extends BaseMybatisDao<UserArchivesMapper>
         String md5 = new SimpleHash("MD5", digestSource).toHex();
 //        System.out.println("md5="+md5);
         authentication.put("digest",md5);
-        param.put("authentication",authentication);
+        return authentication;
+    }
+
+    @Override
+    public Object callNumber(InputCallNumber in) {
+        String url= default_url +"/openapi/"+version+"/callNumber";
+        Map<String,Object> param=new HashMap<>();
+        param.put("authentication",getAuthentication());
         Map<String,Object> request=new HashMap<>();
-        request.put("type",type);
+        request.put("agent",in.getAgent());
+        request.put("callee",in.getCallee());
         param.put("request",request);
         HttpUtils httpUtils=new HttpUtils();
         String s = httpUtils.sendHttpsRequest(url, "POST", param);
+        System.out.println("url="+url);
+        System.out.println("param="+param);
         System.out.println(s);
         return null;
     }

+ 17 - 4
src/main/java/com/goafanti/order/controller/AdminNewOrderApiController.java

@@ -6,10 +6,7 @@ import com.goafanti.common.constant.AFTConstants;
 import com.goafanti.common.constant.ErrorConstants;
 import com.goafanti.common.controller.CertifyApiController;
 import com.goafanti.common.enums.AttachmentType;
-import com.goafanti.common.model.TOrderAssist;
-import com.goafanti.common.model.TOrderNew;
-import com.goafanti.common.model.TOrderNewWithBLOBs;
-import com.goafanti.common.model.TOrderRefundWithBLOBs;
+import com.goafanti.common.model.*;
 import com.goafanti.common.utils.DateUtils;
 import com.goafanti.common.utils.StringUtils;
 import com.goafanti.common.utils.excel.NewExcelUtil;
@@ -922,5 +919,21 @@ public class AdminNewOrderApiController extends CertifyApiController {
 	}
 
 
+	/**
+	 * 修改用户是否入群
+	 * @param us
+	 * @return
+	 */
+	@RequestMapping(value = "/updateAddGroupChat",method = RequestMethod.POST)
+	public Result updateAddGroupChat(TOrderMid us) {
+		Result res =new Result();
+		if(us.getOrderNo()==null) {
+			res.getError().add(buildError(ErrorConstants.PARAM_ERROR, "订单编号"));
+		}
+		res.data(orderNewService.updateAddGroupChat(us));
+		return res;
+	}
+
+
 
 }

+ 2 - 0
src/main/java/com/goafanti/order/service/OrderNewService.java

@@ -244,4 +244,6 @@ public interface OrderNewService {
 
 	void pushOrderMaxDuration();
 
+
+    Object updateAddGroupChat(TOrderMid us);
 }

+ 25 - 3
src/main/java/com/goafanti/order/service/impl/OrderNewServiceImpl.java

@@ -780,7 +780,6 @@ public class OrderNewServiceImpl extends BaseMybatisDao<TOrderNewMapper> impleme
 				orderYearMaxDurationMapper.insert(orderYearMaxDuration);
 			}
 		}else {
-			//会员的处理
 			for (TTaskMember e : tTaskMembers) {
 				if (e.getYearSum()!=null&&e.getYearSum()>yearSum){
 					yearSum=e.getYearSum();
@@ -946,6 +945,7 @@ public class OrderNewServiceImpl extends BaseMybatisDao<TOrderNewMapper> impleme
 	 */
 	private BigDecimal pushMaxDuration(BigDecimal totalAmount) {
 		BigDecimal res=BigDecimal.ZERO;
+		int status=1;
 		if (totalAmount.compareTo(BigDecimal.valueOf(1)) < 0) {
 			res=BigDecimal.ZERO;
 		} else if (totalAmount.compareTo(BigDecimal.valueOf(3))<0) {
@@ -1064,7 +1064,7 @@ public class OrderNewServiceImpl extends BaseMybatisDao<TOrderNewMapper> impleme
 		tm.setExpectProfit(t.getTotalAmount());
 		tm.setDepName(tOrderMidMapper.selectDepNameByDepid(t.getOrderDep()));
 		if (tm.getId()!=null) {
-			tOrderMidMapper.updateByPrimaryKeySelective(tm);
+			tOrderMidMapper.update(tm);
 		}else {
 			tOrderMidMapper.insertSelective(tm);
 		}
@@ -1595,7 +1595,7 @@ public class OrderNewServiceImpl extends BaseMybatisDao<TOrderNewMapper> impleme
 		if (tm.getDunStartTime()==null) {
 			tm.setDunStartTime(date);
 		}
-		tOrderMidMapper.updateByPrimaryKeySelective(tm);
+		tOrderMidMapper.update(tm);
 		return tm;
 	}
 	@Override
@@ -2662,4 +2662,26 @@ public class OrderNewServiceImpl extends BaseMybatisDao<TOrderNewMapper> impleme
 
 
 
+    @Override
+    public Object updateAddGroupChat(TOrderMid in) {
+		TOrderMid update =new TOrderMid();
+		TOrderMid tOrderMid = tOrderMidMapper.selectByOrderNo(in.getOrderNo());
+		Date date = new Date();
+		if (tOrderMid !=null){
+			update.setId(tOrderMid.getId());
+			update.setAddGroupChat(in.getAddGroupChat());
+			if (update.getAddGroupChat()==1){
+				update.setAddGroupChatTime(date);
+			}
+			tOrderMidMapper.update(update);
+		}else {
+			if (in.getAddGroupChat()==1){
+				in.setAddGroupChatTime(date);
+			}
+			tOrderMidMapper.insertSelective(in);
+
+		}
+		return 1;
+	}
+
 }

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

@@ -354,7 +354,6 @@ public class OrderProjectServiceImpl extends BaseMybatisDao<TOrderTaskMapper> im
 			ub.setCreateTime(date);
 			userBusinessMapper.insertSelective(ub);
 		}
-
 			//如果是渠道客户更新渠道表
 			UserChannel uc=new UserChannel();
 			uc.setUid(tn.getBuyerId());

+ 3 - 13
src/main/java/com/goafanti/user/bo/InputUserServiceFollow.java

@@ -5,24 +5,14 @@ import com.goafanti.common.model.UserServiceFollow;
 public class InputUserServiceFollow extends UserServiceFollow{
 
 	/**
-	 * 
+	 *
 	 */
 	private static final long serialVersionUID = 1L;
 
-	/**
-	 * 是否加群 0=否,1=是
-	 */
-	private Integer addGroupChat;
-	
-	private String renewalTimes;
 
-	public Integer getAddGroupChat() {
-		return addGroupChat;
-	}
 
-	public void setAddGroupChat(Integer addGroupChat) {
-		this.addGroupChat = addGroupChat;
-	}
+	private String renewalTimes;
+
 
 	public String getRenewalTimes() {
 		return renewalTimes;

+ 1 - 14
src/main/java/com/goafanti/user/controller/UserServiceApiController.java

@@ -38,20 +38,7 @@ public class UserServiceApiController extends BaseApiController {
 		return res;
 	}
 
-	/**
-	 * 修改用户是否入群
-	 * @param us
-	 * @return
-	 */
-	@RequestMapping(value = "/updateUseService",method = RequestMethod.POST)
-	public Result updateUseService(InputUserServiceFollow us) {
-		Result res =new Result();
-		if(us.getUid()==null) {
-			res.getError().add(buildError(ErrorConstants.PARAM_ERROR, "用户编号"));
-		}
-		res.data(userServiceService.updateUseService(us));
-		return res;
-	}
+
 
 
 	@RequestMapping(value = "/listUseServiceFollow",method = RequestMethod.GET)

+ 0 - 1
src/main/java/com/goafanti/user/service/UserServiceService.java

@@ -22,5 +22,4 @@ public interface UserServiceService {
 	List<OutOrderUserService> listOrderUseServiceGetList(InputListOrderUserService i);
 
 
-	int updateUseService(InputUserServiceFollow us);
 }

+ 4 - 20
src/main/java/com/goafanti/user/service/impl/UserServiceServiceImpl.java

@@ -2,6 +2,7 @@ package com.goafanti.user.service.impl;
 
 import com.goafanti.admin.service.DepartmentService;
 import com.goafanti.common.constant.AFTConstants;
+import com.goafanti.common.dao.TOrderMidMapper;
 import com.goafanti.common.dao.UserServiceFollowMapper;
 import com.goafanti.common.dao.UserServiceMapper;
 import com.goafanti.common.model.UserService;
@@ -30,6 +31,8 @@ public class  UserServiceServiceImpl extends BaseMybatisDao<UserServiceMapper> i
 	private UserServiceFollowMapper userServiceFollowMapper;
 	@Resource
 	private DepartmentService departmentService;
+	@Resource
+	private TOrderMidMapper tOrderMidMapper;
 
 	@Override
 	public int addUseService(InputUserServiceFollow us) {
@@ -94,26 +97,7 @@ public class  UserServiceServiceImpl extends BaseMybatisDao<UserServiceMapper> i
 		return list;
 	}
 
-	@Override
-	public int updateUseService(InputUserServiceFollow us) {
-		UserService update =new UserService();
-		Integer id=userServiceMapper.selectByUid(us.getUid());
-		update.setUid(us.getUid());
-		update.setAddGroupChat(us.getAddGroupChat());
-		Date date = new Date();
-		if (update.getAddGroupChat()==1){
-			update.setAddGroupChatTime(date);
-		}
-		if (id==null) {
-			update.setCreateTime(date);
-			update.setNewTime(date);
-			userServiceMapper.insertSelective(update);
-		}else {
-			update.setId(id);
-			userServiceMapper.update(update);
-		}
-		return 1;
-	}
+
 
 	private void setOrderUserService(List<OutOrderUserService> list) {
 		for (OutOrderUserService ou: list) {

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

@@ -1,8 +1,8 @@
 dev.name=local
 jdbc.driverClassName=com.mysql.jdbc.Driver
 
-#static.host=//static.jishutao.com/1.3.27
-static.host=//172.16.1.187/1.3.27
+#static.host=//static.jishutao.com/1.3.28
+static.host=//172.16.1.187/1.3.28
 
 #jdbc.url=jdbc\:mysql://localhost:3306/aft20240430?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

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

@@ -1,5 +1,5 @@
 dev.name=test
-static.host=//static.jishutao.com/1.3.27
+static.host=//static.jishutao.com/1.3.28
 #Driver
 jdbc.driverClassName=com.mysql.jdbc.Driver
 jdbc.url=jdbc:mysql://127.0.0.1:3306/aft?useUnicode=true&characterEncoding=UTF-8&autoReconnect=true&useSSL=false