Browse Source

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

anderx 1 year ago
parent
commit
7fd8f7ce2d

+ 18 - 0
src/main/java/com/goafanti/common/mapper/TOrderNewMapper.xml

@@ -2663,6 +2663,24 @@
         where a.order_dep = #{depId}
           and a.process_status = #{processStatus}
     </select>
+    <select id="selectTechUserList" resultType="com.goafanti.order.bo.OutTechUserListBo">
+        select DISTINCT c.id ,c.nickname
+        from t_order_task a left join t_order_new b on a.order_no =b.order_no
+                            left join user c on b.buyer_id =c.id
+        where b.delete_sign in (0,2)
+          and a.task_receiver = #{aid}
+        <if test="page_sql!=null">
+            ${page_sql}
+        </if>
+    </select>
+
+    <select id="selectTechUserCount" resultType="integer">
+        select count(DISTINCT c.id)
+        from t_order_task a left join t_order_new b on a.order_no =b.order_no
+                            left join user c on b.buyer_id =c.id
+        where b.delete_sign in (0,2)
+          and a.task_receiver = #{aid}
+    </select>
 
 </mapper>
 

+ 28 - 0
src/main/java/com/goafanti/customer/bo/InputUserCallList.java

@@ -4,10 +4,38 @@ public class InputUserCallList {
 
     private String uid;
 
+    private String aid;
+    private String mobile;
+    private String callNo;
+
     private Integer pageNo;
 
     private Integer pageSize;
 
+    public String getAid() {
+        return aid;
+    }
+
+    public void setAid(String aid) {
+        this.aid = aid;
+    }
+
+    public String getMobile() {
+        return mobile;
+    }
+
+    public void setMobile(String mobile) {
+        this.mobile = mobile;
+    }
+
+    public String getCallNo() {
+        return callNo;
+    }
+
+    public void setCallNo(String callNo) {
+        this.callNo = callNo;
+    }
+
     public String getUid() {
         return uid;
     }

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

@@ -116,6 +116,15 @@ public class UserOutboundApiController  extends BaseApiController {
         return new Result<>().data(this.userOutboundService.userCallList(in));
     }
 
+    /**
+     * 所有通话记录查询
+     *
+     */
+    @GetMapping("/callAllList")
+    public Result callAllList(InputUserCallList in) {
+        return new Result<>().data(this.userOutboundService.callAllList(in));
+    }
+
 
     /**
      * 外呼明细

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

@@ -22,4 +22,6 @@ public interface UserOutboundService {
 
 
     Object pushAllCall();
+
+    Object callAllList(InputUserCallList in);
 }

+ 79 - 47
src/main/java/com/goafanti/customer/service/impl/UserClueServiceImpl.java

@@ -44,8 +44,6 @@ public class UserClueServiceImpl extends BaseMybatisDao<UserMapper> implements U
     private OrganizationIdentityMapper organizationIdentityMapper;
 
 
-
-
     @Resource(name = "passwordUtil")
     private PasswordUtil					passwordUtil;
 
@@ -79,10 +77,29 @@ public class UserClueServiceImpl extends BaseMybatisDao<UserMapper> implements U
     @Override
     public Object add(InputUserClueBo in) throws BusinessException{
         Admin admin = adminMapper.queryById(TokenManager.getAdminId());
-        return add(in,admin);
+        String mobile = "";
+        List<String> mobileList = new ArrayList<>();
+        if (in.getContactMobile().equals("-")){
+            if (in.getContactMobileMore().equals("-")){
+                throw new BusinessException("手机号不能为空");
+            }else {
+                String[] split = in.getContactMobileMore().split(";");
+                mobile=split[0];
+                mobileList.addAll(Arrays.asList(split));
+            }
+        }else {
+            String[] split = in.getContactMobile().split(";");
+            mobile=split[0];
+            mobileList.addAll(Arrays.asList(split));
+            if (!in.getContactMobileMore().equals("-")){
+                String[] split2 = in.getContactMobileMore().split(";");
+                mobileList.addAll(Arrays.asList(split2));
+            }
+        }
+        return add(in,admin,mobileList,mobile);
     }
 
-    public Object add(InputUserClueBo in,Admin admin) throws BusinessException{
+    public Object add(InputUserClueBo in,Admin admin,List<String> mobileList,String mobile) throws BusinessException{
         User user = new User();
         Date now = new Date();
         String aid= TokenManager.getAdminId();
@@ -105,7 +122,7 @@ public class UserClueServiceImpl extends BaseMybatisDao<UserMapper> implements U
         user.setUpdateTime(now);
         user.setSignBills(0);
         user.setNewChannel(0);
-        user.setMobile(in.getContactMobile());
+        user.setMobile(mobile);
         user.setPassword(AFTConstants.INITIALPASSWORD);
         user.setInformationMaintainer(TokenManager.getAdminId());
         double f = 0;
@@ -127,7 +144,7 @@ public class UserClueServiceImpl extends BaseMybatisDao<UserMapper> implements U
         oi.setId(identifyId);
         oi.setUid(uid);
         oi.setContacts(in.getContacts());
-        oi.setContactMobile(in.getContactMobile());
+        oi.setContactMobile(mobile);
         oi.setHighTechZone(AFTConstants.NO);
         oi.setInternational(AFTConstants.NO);
         oi.setListed(AFTConstants.NO);
@@ -140,61 +157,49 @@ public class UserClueServiceImpl extends BaseMybatisDao<UserMapper> implements U
         un.setName(user.getNickname());
         userNamesMapper.insertSelective(un);
         // 新增企业联系人
-        iterContactBook(in,admin.getName(),uid);
+        iterContactBook(in.getContacts(),mobileList,admin.getName(),uid,mobile);
         addUserTransferLog(user,22,null);
         return 1;
     }
 
-    private void iterContactBook(InputUserClueBo in, String aname, String uid) {
-        OrganizationContactBook cob = new OrganizationContactBook();
-        cob.setAid(TokenManager.getAdminId());
-        cob.setAname(aname);
-        cob.setId(UUID.randomUUID().toString());
-        cob.setUid(uid);
-        cob.setName(in.getContacts());
-        cob.setMobile(in.getContactMobile());
-        cob.setMajor(AFTConstants.YES);
+    private void iterContactBook(String name,List<String> mobileList, String aname, String uid,String mobile) {
         organizationContactBookMapper.updateSubContact(uid);
-        organizationContactBookMapper.insert(cob);
-        if (StringUtils.isNotBlank(in.getContactMobileMore())){
-            String[] split = null;
-            if (in.getContactMobileMore().contains(";")){
-                split = in.getContactMobileMore().split(";");
-            } else if (in.getContactMobileMore().contains(";")) {
-                split = in.getContactMobileMore().split(";");
-            }
-            for (String s : split) {
+            for (String s : mobileList) {
                 if (StringUtils.isNotBlank(s)) {
                     OrganizationContactBook cob2 = new OrganizationContactBook();
                     cob2.setAid(TokenManager.getAdminId());
                     cob2.setAname(aname);
                     cob2.setId(UUID.randomUUID().toString());
                     cob2.setUid(uid);
-                    cob2.setName(in.getContacts());
+                    cob2.setName(name);
                     cob2.setMobile(s);
-                    cob2.setMajor(AFTConstants.NO);
+                    if (s.equals(mobile)){
+                        cob2.setMajor(AFTConstants.YES);
+                    }else {
+                        cob2.setMajor(AFTConstants.NO);
+                    }
                     organizationContactBookMapper.insert(cob2);
                 }
             }
         }
-    }
 
     @Override
     public Map<String, Object> pushImportUserClue(List<OutUserClueExcel> list) {
         StringBuilder msg = new StringBuilder();
         int size=0;
         for (OutUserClueExcel e : list) {
+            User user = null;
             try {
                 checkMobile(e.getContactMobile());
+                checkMobile(e.getContactMobileMore());
                 checkContacts(e.getContacts());
-                
+                //判定客户名称
+                user = checkUserName(e.getNickname());
             }catch (BusinessException ex){
                 size++;
                 msg.append("<br/>客户[").append(e.getNickname()).append("]导入失败,原因:").append(ex.getMessage()).append(" ");
                 continue;
             }
-            //判定客户名称
-            User user = checkUserName(e.getNickname());
 
             InputUserClueBo inUserClueBo = new InputUserClueBo();
             inUserClueBo.setUserName(e.getNickname());
@@ -202,11 +207,10 @@ public class UserClueServiceImpl extends BaseMybatisDao<UserMapper> implements U
             inUserClueBo.setContacts(e.getContacts());
             inUserClueBo.setContactMobileMore(e.getContactMobileMore());
             try {
-                Admin admin = adminMapper.queryById(TokenManager.getAdminId());
                 if (user==null){
-                    add(inUserClueBo,admin);
+                    add(inUserClueBo);
                 }else {
-                    update(inUserClueBo,admin,user);
+                    update(inUserClueBo,user);
                 }
             }catch (Exception ex){
                 size++;
@@ -223,7 +227,27 @@ public class UserClueServiceImpl extends BaseMybatisDao<UserMapper> implements U
         return map;
     }
 
-    private void update(InputUserClueBo inUserClueBo,Admin admin,User user) {
+    private void update(InputUserClueBo in,User user) {
+        Admin admin = adminMapper.queryById(TokenManager.getAdminId());
+        String mobile = "";
+        List<String> mobileList = new ArrayList<>();
+        if (in.getContactMobile().equals("-")){
+            if (in.getContactMobileMore().equals("-")){
+                throw new BusinessException("手机号不能为空");
+            }else {
+                String[] split = in.getContactMobileMore().split(";");
+                mobile=split[0];
+                mobileList.addAll(Arrays.asList(split));
+            }
+        }else {
+            String[] split = in.getContactMobile().split(";");
+            mobile=split[0];
+            mobileList.addAll(Arrays.asList(split));
+            if (!in.getContactMobileMore().equals("-")){
+                String[] split2 = in.getContactMobile().split(";");
+                mobileList.addAll(Arrays.asList(split2));
+            }
+        }
         Date now = new Date();
         User newUser =new User();
         newUser.setId(user.getId());
@@ -237,7 +261,7 @@ public class UserClueServiceImpl extends BaseMybatisDao<UserMapper> implements U
         newUser.setClueTransferTime(now);
         userMapper.update(newUser);
         // 新增企业联系人
-        iterContactBook(inUserClueBo,admin.getName(),user.getId());
+        iterContactBook(in.getContacts(),mobileList,admin.getName(),user.getId(),mobile);
     }
 
     private void checkContacts(String contacts) throws BusinessException {
@@ -250,18 +274,24 @@ public class UserClueServiceImpl extends BaseMybatisDao<UserMapper> implements U
     }
 
     private void checkMobile(String contactMobile) throws BusinessException{
-        String mobileReg="[1-9]\\d{10}";
-        String mobileReg2="^0\\d{2,3}-?\\d{7,8}$";
-        Pattern  pattern =Pattern.compile(mobileReg);
-        Matcher matcher = pattern.matcher(contactMobile);
-        if (!matcher.matches()){
-            Pattern  pattern2 =Pattern.compile(mobileReg2);
-            Matcher matcher2 = pattern2.matcher(contactMobile);
-            if (!matcher2.matches()){
-                throw new BusinessException("手机号格式不正确");
+        if (!contactMobile.equals("-")){
+            String[] split = contactMobile.split(";");
+            for (String s : split) {
+                String mobileReg="[1-9]\\d{10}";
+                String mobileReg2="^0\\d{2,3}-?\\d{7,8}$";
+                Pattern  pattern =Pattern.compile(mobileReg);
+                Matcher matcher = pattern.matcher(s);
+                if (!matcher.matches()){
+                    Pattern  pattern2 =Pattern.compile(mobileReg2);
+                    Matcher matcher2 = pattern2.matcher(s);
+                    if (!matcher2.matches()){
+                        throw new BusinessException("手机号格式不正确");
+                    }
+                }
             }
         }
 
+
     }
 
 
@@ -354,9 +384,11 @@ public class UserClueServiceImpl extends BaseMybatisDao<UserMapper> implements U
         }
         if (user!=null){
             if (user.getShareType()==0){
-                throw new BusinessException("客户已经存在私有");
+                throw new BusinessException("客户已经存在私有客户");
             }else if (user.getShareType()==2){
-                throw new BusinessException("客户已经存在签单");
+                throw new BusinessException("客户已经存在签单客户");
+            }else if (user.getShareType()==5){
+                throw new BusinessException("客户已经存在线索客户");
             }
             return user;
         }

+ 7 - 6
src/main/java/com/goafanti/customer/service/impl/UserOutboundServiceImpl.java

@@ -216,7 +216,7 @@ public class UserOutboundServiceImpl extends BaseMybatisDao<CallLogMapper> imple
         try {
 //        res.sseEmitter.send(callResult);
             systemWebSocketHandler.sendMessageToUser(admin.getId(), new TextMessage(callResult));
-//            LoggerUtils.debug(getClass(),String.format("通信成功=》%s=%s",callResult,callResultMsg));
+            LoggerUtils.debug(getClass(),String.format("通信成功=》%s=%s",callResult,callResultMsg));
         }catch (Exception e ){
             LoggerUtils.error(getClass(),"通信失败");
         }
@@ -291,17 +291,18 @@ public class UserOutboundServiceImpl extends BaseMybatisDao<CallLogMapper> imple
             sumMap.put("name",user.getNickname());
         }
         Map<String,Object> res = new HashMap();
-        List<CallLog> list = (List<CallLog>) page.getList();
-        for (CallLog e : list) {
-            e.setCallNo(null);
-            e.setMobile(null);
-        }
         res.put("page",page);
         res.put("sum",sumMap);
         return res;
     }
 
     @Override
+    public Object callAllList(InputUserCallList in) {
+        Pagination<?> page = findPage("findCallLogList", "findCallLogCount", in);
+        return page;
+    }
+
+    @Override
     public Object pushAllCall() {
         List<CallDaysSumBo> callDaysSumBos = callLogMapper.selectAllCount();
         DateTimeFormatter formatter = DateTimeFormatter.ISO_DATE;

+ 31 - 0
src/main/java/com/goafanti/order/bo/InputTechUserListBo.java

@@ -0,0 +1,31 @@
+package com.goafanti.order.bo;
+
+public class InputTechUserListBo {
+    private Integer pageSize;
+    private Integer pageNo;
+    private String aid;
+
+    public String getAid() {
+        return aid;
+    }
+
+    public void setAid(String aid) {
+        this.aid = aid;
+    }
+
+    public Integer getPageSize() {
+        return pageSize;
+    }
+
+    public void setPageSize(Integer pageSize) {
+        this.pageSize = pageSize;
+    }
+
+    public Integer getPageNo() {
+        return pageNo;
+    }
+
+    public void setPageNo(Integer pageNo) {
+        this.pageNo = pageNo;
+    }
+}

+ 22 - 0
src/main/java/com/goafanti/order/bo/OutTechUserListBo.java

@@ -0,0 +1,22 @@
+package com.goafanti.order.bo;
+
+public class OutTechUserListBo {
+    private String id;
+    private String nickname;
+
+    public String getId() {
+        return id;
+    }
+
+    public void setId(String id) {
+        this.id = id;
+    }
+
+    public String getNickname() {
+        return nickname;
+    }
+
+    public void setNickname(String nickname) {
+        this.nickname = nickname;
+    }
+}

+ 35 - 0
src/main/java/com/goafanti/order/bo/TOrderTaskBo.java

@@ -287,4 +287,39 @@ public class TOrderTaskBo extends TOrderTask{
 	}
 
 
+	@Override
+	public String toString() {
+		return "TOrderTaskBo{" +
+				"contactsMobile='" + contactsMobile + '\'' +
+				", cname='" + cname + '\'' +
+				", cSort=" + cSort +
+				", contractNo='" + contractNo + '\'' +
+				", salesmanName='" + salesmanName + '\'' +
+				", contacts='" + contacts + '\'' +
+				", depName='" + depName + '\'' +
+				", userName='" + userName + '\'' +
+				", orderStatus=" + orderStatus +
+				", type=" + type +
+				", price=" + price +
+				", appropriationRatio=" + appropriationRatio +
+				", patentType=" + patentType +
+				", patentTypeName='" + patentTypeName + '\'' +
+				", patentTransfer=" + patentTransfer +
+				", email='" + email + '\'' +
+				", name='" + name + '\'' +
+				", projectStatusName='" + projectStatusName + '\'' +
+				", serviceLife='" + serviceLife + '\'' +
+				", serviceYear='" + serviceYear + '\'' +
+				", contractTerm='" + contractTerm + '\'' +
+				", yearSum=" + yearSum +
+				", stopStatus=" + stopStatus +
+				", stopType=" + stopType +
+				", projectStopStatus=" + projectStopStatus +
+				", change=" + change +
+				", lastYear='" + lastYear + '\'' +
+				", lastYearCapital=" + lastYearCapital +
+				", lastYearIncome=" + lastYearIncome +
+				", splitList=" + splitList +
+				'}';
+	}
 }

+ 47 - 0
src/main/java/com/goafanti/order/controller/OrderPlusApiController.java

@@ -0,0 +1,47 @@
+package com.goafanti.order.controller;
+
+
+import com.goafanti.common.bo.Result;
+import com.goafanti.common.controller.CertifyApiController;
+import com.goafanti.order.bo.InputTechUserListBo;
+import com.goafanti.order.service.OrderPlusService;
+import org.springframework.web.bind.annotation.GetMapping;
+import org.springframework.web.bind.annotation.RequestMapping;
+import org.springframework.web.bind.annotation.RestController;
+
+import javax.annotation.Resource;
+
+@RestController
+@RequestMapping(value = "/api/admin/orderPlus")
+public class OrderPlusApiController extends CertifyApiController {
+
+	@Resource
+	private OrderPlusService orderPlusService;
+
+	/**
+	 * 技术员客户列表
+	 * @param in
+	 * @return
+	 */
+	@GetMapping("/techUserList")
+	public Result techUserList(InputTechUserListBo in){
+		Result res =new Result();
+		res.data(orderPlusService.techUserList(in));
+		return  res;
+
+	}
+
+
+	/**
+	 * 技术员客户详情
+	 * @return
+	 */
+	@GetMapping("/techUserDetails")
+	public Result techUserDetails(String  uid){
+		Result res =new Result();
+		res.data(orderPlusService.techUserDetails(uid));
+		return  res;
+
+	}
+
+}

+ 10 - 0
src/main/java/com/goafanti/order/service/OrderPlusService.java

@@ -0,0 +1,10 @@
+package com.goafanti.order.service;
+
+import com.goafanti.order.bo.InputTechUserListBo;
+
+public interface OrderPlusService {
+
+    Object techUserList(InputTechUserListBo in);
+
+    Object techUserDetails(String uid);
+}

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

@@ -118,8 +118,8 @@ public class OrderInvoiceServiceImpl extends BaseMybatisDao<TOrderInvoiceMapper>
 		addInvoiceLog(o.getId(),5);
 		o.setStatus(1);
 		if (o.getApproval()==2)o.setApproval(1);
-		int i=tOrderInvoiceMapper.updateByPrimaryKeySelective(o);
 		pushOrderInvoiceExamine(o);
+		int i=tOrderInvoiceMapper.updateByPrimaryKeySelective(o);
 		if (o.getApproval()==0){
 			TOrderInvoice use = tOrderInvoiceMapper.selectByPrimaryKey(o.getId());
 			String startTime = DateUtils.formatDate(use.getCreateTime(),AFTConstants.YYYYMMDD);

+ 51 - 0
src/main/java/com/goafanti/order/service/impl/OrderPlusServiceImpl.java

@@ -0,0 +1,51 @@
+package com.goafanti.order.service.impl;
+
+import com.goafanti.common.dao.TOrderNewMapper;
+import com.goafanti.common.dao.TOrderTaskMapper;
+import com.goafanti.common.dao.TTaskMemberMapper;
+import com.goafanti.core.mybatis.BaseMybatisDao;
+import com.goafanti.core.shiro.token.TokenManager;
+import com.goafanti.order.bo.InputTechUserListBo;
+import com.goafanti.order.bo.TOrderTaskBo;
+import com.goafanti.order.service.OrderPlusService;
+import org.springframework.stereotype.Service;
+
+import javax.annotation.Resource;
+import java.util.List;
+import java.util.Map;
+
+@Service
+public class OrderPlusServiceImpl extends BaseMybatisDao<TOrderNewMapper> implements OrderPlusService {
+
+    @Resource
+    private TOrderNewMapper tOrderNewMapper;
+    @Resource
+    private TOrderTaskMapper tOrderTaskMapper;
+    @Resource
+    private TTaskMemberMapper tTaskMemberMapper;
+
+    @Override
+    public Object techUserList(InputTechUserListBo in) {
+        String aid = TokenManager.getAdminId();
+        in.setAid(aid);
+        return findPage("selectTechUserList","selectTechUserCount",in);
+    }
+
+    @Override
+    public Object techUserDetails(String uid) {
+        List<Map<String, Object>> maps = tOrderNewMapper.selectOrderByuid(uid);
+        for (Map<String, Object> map : maps) {
+            String contractNo = (String) map.getOrDefault("contractNo",String.class);
+            System.out.println("contractNo = " + contractNo);
+            String orderNo = (String) map.getOrDefault("orderNo", String.class);
+            List<TOrderTaskBo> tOrderTaskBos = tOrderTaskMapper.selectOrderTaskAll(orderNo, null);
+            for (TOrderTaskBo e : tOrderTaskBos) {
+                String commodityName = e.getCommodityName();
+
+
+            }
+
+        }
+        return null;
+    }
+}

+ 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.32
-#static.host=//172.16.1.187/1.3.32
+static.host=//static.jishutao.com/1.3.34
+#static.host=//172.16.1.187/1.3.34
 
 #jdbc.url=jdbc\:mysql://localhost:3306/aft20241122?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.32
+static.host=//static.jishutao.com/1.3.34
 #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