From 7b7efa13697e0578517c1c992e75af38f3e7c7a1 Mon Sep 17 00:00:00 2001 From: DB <2502523450@qq.com> Date: Tue, 2 Apr 2024 11:18:55 +0800 Subject: [PATCH] =?UTF-8?q?=E8=B0=83=E6=95=B4=E7=BA=BF=E7=B4=A2;=E8=B0=83?= =?UTF-8?q?=E6=95=B4=E4=BB=BB=E5=8A=A1=E6=97=B6=E9=97=B4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../handler/CloudCustomerStudentHandler.java | 1 + .../impl/EasyLearnOrderServiceImpl.java | 31 +++++++++++++ .../mall/web/CpopMallWebApplicationTests.java | 4 +- .../com/cpop/mall/web/CpopWxPayTests.java | 4 +- .../java/com/cpop/oam/web/CpopClueTests.java | 14 ++++++ .../com/cpop/oam/web/CpopDataSyncTests.java | 39 ++++++++++++++++ .../oam/web/CpopEasyLearnDataAnalyseTest.java | 22 +++++++-- .../cpop/oam/business/bo/ClueFollowUpBo.java | 8 ++++ .../backstage/BackstageClueController.java | 5 +- .../com/cpop/oam/business/entity/Clue.java | 5 ++ .../oam/business/service/ClueService.java | 2 +- .../service/impl/BusinessServiceImpl.java | 2 +- .../service/impl/ClueServiceImpl.java | 17 ++++--- .../service/impl/TaskServiceImpl.java | 3 +- .../com/cpop/oam/business/vo/CluePageVo.java | 7 +++ .../handler/wxOpen/WxOpenService.java | 5 +- .../framework/tasks/OamScheduledTasks.java | 4 +- Cpop-Pay/pom.xml | 4 ++ .../pay/framewok/task/WxPayAsyncTask.java | 46 +++++++++++++++++-- 19 files changed, 193 insertions(+), 30 deletions(-) diff --git a/Cpop-Api/src/main/java/com/cpop/api/cloudDb/handler/CloudCustomerStudentHandler.java b/Cpop-Api/src/main/java/com/cpop/api/cloudDb/handler/CloudCustomerStudentHandler.java index 18a35f8..ef52e19 100644 --- a/Cpop-Api/src/main/java/com/cpop/api/cloudDb/handler/CloudCustomerStudentHandler.java +++ b/Cpop-Api/src/main/java/com/cpop/api/cloudDb/handler/CloudCustomerStudentHandler.java @@ -120,4 +120,5 @@ public class CloudCustomerStudentHandler { return page; } } + } diff --git a/Cpop-Jambox/src/main/java/com/cpop/jambox/business/service/impl/EasyLearnOrderServiceImpl.java b/Cpop-Jambox/src/main/java/com/cpop/jambox/business/service/impl/EasyLearnOrderServiceImpl.java index 34d4af6..f076506 100644 --- a/Cpop-Jambox/src/main/java/com/cpop/jambox/business/service/impl/EasyLearnOrderServiceImpl.java +++ b/Cpop-Jambox/src/main/java/com/cpop/jambox/business/service/impl/EasyLearnOrderServiceImpl.java @@ -4,6 +4,7 @@ import com.alibaba.fastjson.JSONArray; import com.alibaba.fastjson.JSONObject; import com.cpop.api.cloudDb.core.dto.CloudClassCardDto; import com.cpop.api.cloudDb.handler.CloudClassCardHandler; +import com.cpop.api.tencent.wxWork.handler.WebHookSendHandler; import com.cpop.common.utils.StringUtils; import com.cpop.common.utils.bean.BeanUtils; import com.cpop.common.utils.http.HttpUtils; @@ -1078,6 +1079,36 @@ public class EasyLearnOrderServiceImpl extends ServiceImpl phoneList = new ArrayList(); + // 获取审核管理员手机号 + RedisService redisService = SpringUtils.getBean(RedisService.class); + String auditStaffPhone = redisService.getCacheObject("sysConfig:oam:OamCancelAfterVerificationStaffPhone"); + phoneList.add(auditStaffPhone); + try { + //获取品牌和校区信息 + Row brandAndStore = Db.selectOneByQuery("cp_sys_store", QueryWrapper.create() + .select("css.store_name") + .select("csb.brand_name") + .from("cp_sys_store").as("css") + .leftJoin("cp_sys_brand").as("csb").on("csb.id = css.brand_id") + .where("css.id= ?", easyLearnOrder.getStoreId())); + SpringUtils.getBean(WebHookSendHandler.class).webHookSendText("a885058b-2478-4df8-bdb7-2bb94a08c1f5", phoneList, + "==========用户订单到账==========" + + "\n订单创建时间:" + easyLearnOrder.getCreateTime().format(DateTimeFormatter.ofPattern("yyyy-MM-dd HH:mm:ss")) + + "\n品牌:" + brandAndStore.getString("brandName") + + "\n校区:" + brandAndStore.getString("storeName") + + "\n订单类型:" + easyLearnOrder.getOrderType() + + "\n受益人:" + easyLearnOrder.getCustomerName() + + "\n电话:" + easyLearnOrder.getCustomerPhone() + + "\n订单金额:" + easyLearnOrder.getTotalAmount() + + "\n到账金额:" + easyLearnOrder.getTotalPayAmount() + + "\n微信订单号:" + map.get("transaction_id") + + "\n商户号:1618436087", + false); + } catch (IOException e) { + throw new ServiceException("发送任务通知失败!"); + } return wxPayNormalHandler.success(); } else { // 签名校验失败(可能不是微信服务器发出的数据) diff --git a/Cpop-Mall/Cpop-Mall-Web/src/test/java/com/cpop/mall/web/CpopMallWebApplicationTests.java b/Cpop-Mall/Cpop-Mall-Web/src/test/java/com/cpop/mall/web/CpopMallWebApplicationTests.java index 78c5e36..15d9dc6 100644 --- a/Cpop-Mall/Cpop-Mall-Web/src/test/java/com/cpop/mall/web/CpopMallWebApplicationTests.java +++ b/Cpop-Mall/Cpop-Mall-Web/src/test/java/com/cpop/mall/web/CpopMallWebApplicationTests.java @@ -26,8 +26,8 @@ class CpopMallWebApplicationTests { */ @Test public void initKeyPair() { - String publicFileUrl = "E:\\Cpop\\Cpop-Union\\Cpop-Mall\\Cpop-Mall-Web\\src\\main\\resources\\static\\keyPair\\publicKey"; - String privateFileUrl = "E:\\Cpop\\Cpop-Union\\Cpop-Mall\\Cpop-Mall-Web\\src\\main\\resources\\static\\keyPair\\privateKey"; + String publicFileUrl = "E:/Cpop/Jambox-Union/Jambox-Core/src/main/resources/static/keypair/publicKey"; + String privateFileUrl = "E:/Cpop/Jambox-Union/Jambox-Core/src/main/resources/static/keypair/privateKey"; Map keyPairMap = rsaUtils.initKeyPair(publicFileUrl,privateFileUrl); String publicKey = keyPairMap.get("publicKey"); String privateKey = keyPairMap.get("privateKey"); diff --git a/Cpop-Mall/Cpop-Mall-Web/src/test/java/com/cpop/mall/web/CpopWxPayTests.java b/Cpop-Mall/Cpop-Mall-Web/src/test/java/com/cpop/mall/web/CpopWxPayTests.java index 1d16536..330eded 100644 --- a/Cpop-Mall/Cpop-Mall-Web/src/test/java/com/cpop/mall/web/CpopWxPayTests.java +++ b/Cpop-Mall/Cpop-Mall-Web/src/test/java/com/cpop/mall/web/CpopWxPayTests.java @@ -137,7 +137,7 @@ public class CpopWxPayTests { public void getOrderInfo() throws WxPayException { WxPayConfig config = wxPayService.getConfig(); config.setSubMchId("1661323640"); - WxPayOrderQueryResult wxPayOrderQueryResult = wxPayService.queryOrder("4200002123202312279635916930", null); + WxPayOrderQueryResult wxPayOrderQueryResult = wxPayService.queryOrder("4200002096202401188599394121", null); System.out.println(JSONObject.toJSONString(wxPayOrderQueryResult)); } @@ -150,7 +150,7 @@ public class CpopWxPayTests { @Test public void getSharingInfo() throws WxPayException { ProfitSharingQueryRequest profitSharingQueryRequest = new ProfitSharingQueryRequest(); - profitSharingQueryRequest.setOutOrderNo("1736629608413073417").setTransactionId("4200002123202312279635916930"); + profitSharingQueryRequest.setOutOrderNo("1736629608413073412").setTransactionId("4200002096202401188599394121"); profitSharingQueryRequest.setSubMchId("1661323640"); ProfitSharingQueryResult result = wxPayService.getProfitSharingService().profitSharingQuery(profitSharingQueryRequest); System.out.println(result.getResultCode()); diff --git a/Cpop-Oam/Cpop-Oam-Web/src/test/java/com/cpop/oam/web/CpopClueTests.java b/Cpop-Oam/Cpop-Oam-Web/src/test/java/com/cpop/oam/web/CpopClueTests.java index 4516df7..f3d486b 100644 --- a/Cpop-Oam/Cpop-Oam-Web/src/test/java/com/cpop/oam/web/CpopClueTests.java +++ b/Cpop-Oam/Cpop-Oam-Web/src/test/java/com/cpop/oam/web/CpopClueTests.java @@ -5,6 +5,13 @@ import com.cpop.api.tencent.location.handler.TencentLocationHandler; import com.cpop.core.base.entity.LoginUser; import com.cpop.core.utils.SecurityUtils; import com.cpop.core.utils.SpringUtils; +import com.cpop.jambox.business.entity.StoreExtend; +import com.cpop.jambox.business.service.StoreExtendService; +import com.cpop.oam.business.entity.Clue; +import com.cpop.oam.business.service.ClueService; +import com.cpop.system.business.entity.Store; +import com.cpop.system.business.service.StoreService; +import com.mybatisflex.core.query.QueryWrapper; import com.mybatisflex.core.row.Db; import com.mybatisflex.core.row.Row; import com.mybatisflex.core.row.RowKey; @@ -12,6 +19,11 @@ import org.junit.jupiter.api.Test; import org.springframework.boot.test.context.SpringBootTest; import java.time.LocalDateTime; +import java.util.List; +import java.util.stream.Collectors; + +import static com.cpop.jambox.business.entity.table.StoreExtendTableDef.STORE_EXTEND; +import static com.cpop.system.business.entity.table.StoreTableDef.STORE; /** * @author DB @@ -51,4 +63,6 @@ public class CpopClueTests { clueRecord.set("update_user_id", loginUser == null ? "1" : loginUser.getUserId()); Db.insert("cp_oam_clue_record",clueRecord); } + + } diff --git a/Cpop-Oam/Cpop-Oam-Web/src/test/java/com/cpop/oam/web/CpopDataSyncTests.java b/Cpop-Oam/Cpop-Oam-Web/src/test/java/com/cpop/oam/web/CpopDataSyncTests.java index 98dc950..bcc7e22 100644 --- a/Cpop-Oam/Cpop-Oam-Web/src/test/java/com/cpop/oam/web/CpopDataSyncTests.java +++ b/Cpop-Oam/Cpop-Oam-Web/src/test/java/com/cpop/oam/web/CpopDataSyncTests.java @@ -11,9 +11,11 @@ import com.cpop.jambox.business.service.BrandExtendService; import com.cpop.jambox.business.service.CardTemplateExtendService; import com.cpop.jambox.business.service.CardTemplateService; import com.cpop.jambox.business.service.StoreExtendService; +import com.cpop.oam.business.entity.Clue; import com.cpop.oam.business.entity.Task; import com.cpop.oam.business.entity.TaskWorkOrder; import com.cpop.oam.business.mapper.TaskWorkOrderMapper; +import com.cpop.oam.business.service.ClueService; import com.cpop.oam.business.service.TaskService; import com.cpop.oam.business.service.TaskWorkOrderService; import com.cpop.system.business.entity.Store; @@ -351,4 +353,41 @@ public class CpopDataSyncTests { }); } + @Test + public void syncClueData(){ + //查询已有线索 + ClueService clueService = SpringUtils.getBean(ClueService.class); + List clueList = clueService.list(); + //查询校区 + List storeList = SpringUtils.getBean(StoreService.class).list(QueryWrapper.create() + .where(STORE.ID.notIn(clueList.stream().map(Clue::getStoreId).collect(Collectors.toList())))); + //设置校区信息 + List storeExtends = SpringUtils.getBean(StoreExtendService.class).list( + QueryWrapper.create().where(STORE_EXTEND.STORE_ID.in(storeList.stream().map(Store::getId).collect(Collectors.toList())))); + //查询旧库信息 + List rowList; + try { + DataSourceKey.use("jambox"); + rowList = DbChain.table("t_mechanism_info") + .select("city","store_id as storeCloudId") + .from("t_mechanism_info") + .in("store_id",storeExtends.stream().map(StoreExtend::getStoreCloudId).collect(Collectors.toSet())) + .list(); + } finally { + DataSourceKey.clear(); + } + Map collect = storeExtends.stream().collect(Collectors.toMap(StoreExtend::getStoreCloudId, StoreExtend::getStoreId)); + ArrayList clues = new ArrayList<>(); + rowList.forEach(item->{ + String storeId = collect.get(item.getString("storeCloudId")); + if (StringUtils.isNotBlank(storeId)) { + Clue clue = new Clue(); + clue.setCity(item.getString("city")) + .setStoreId(storeId); + clues.add(clue); + } + }); + SpringUtils.getBean(ClueService.class).saveBatch(clues); + } + } diff --git a/Cpop-Oam/Cpop-Oam-Web/src/test/java/com/cpop/oam/web/CpopEasyLearnDataAnalyseTest.java b/Cpop-Oam/Cpop-Oam-Web/src/test/java/com/cpop/oam/web/CpopEasyLearnDataAnalyseTest.java index 4b25abc..aefd162 100644 --- a/Cpop-Oam/Cpop-Oam-Web/src/test/java/com/cpop/oam/web/CpopEasyLearnDataAnalyseTest.java +++ b/Cpop-Oam/Cpop-Oam-Web/src/test/java/com/cpop/oam/web/CpopEasyLearnDataAnalyseTest.java @@ -2,19 +2,20 @@ package com.cpop.oam.web; import com.alibaba.fastjson.JSONArray; import com.alibaba.fastjson.JSONObject; +import com.cpop.api.cloudDb.core.constant.CloudDbUrl; +import com.cpop.core.utils.SpringUtils; import com.cpop.pay.framewok.handler.wxPay.WxPayHandler; import com.github.binarywang.wxpay.bean.result.WxPayOrderQueryResult; import com.github.binarywang.wxpay.exception.WxPayException; import com.github.binarywang.wxpay.service.WxPayService; import com.mybatisflex.core.datasource.DataSourceKey; -import com.mybatisflex.core.row.Db; -import com.mybatisflex.core.row.DbChain; -import com.mybatisflex.core.row.Row; -import com.mybatisflex.core.row.RowKey; +import com.mybatisflex.core.query.QueryWrapper; +import com.mybatisflex.core.row.*; import org.junit.jupiter.api.Test; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.boot.test.context.SpringBootTest; import org.springframework.test.context.ActiveProfiles; +import org.springframework.web.client.RestTemplate; import java.util.ArrayList; import java.util.List; @@ -50,7 +51,8 @@ public class CpopEasyLearnDataAnalyseTest{ .select("out_order_no") .select("create_time") .from("j_wx_pay_profit_sharing") - .where("create_time >= ?", "2024-01-01 00:00:00") + .where("create_time >= ?", "2024-03-24 00:00:00") + //.between("create_time", "2023-10-23 00:00:00","2023-11-13 22:00:00") .list(); List insertList = new ArrayList<>(); list.forEach(item->{ @@ -67,6 +69,16 @@ public class CpopEasyLearnDataAnalyseTest{ row.set("sharing_order_id",item.getString("outOrderNo")); row.set("transaction_id",item.getString("transactionId")); row.set("detail_order_id",split[2]); + JSONObject jsonBody = new JSONObject(); + jsonBody.put("_type", "merchantPayInfo"); + jsonBody.put("merchant_plan_detail_no", split[2]); + JSONObject result = SpringUtils.getBean(RestTemplate.class).postForObject(CloudDbUrl.COMMON_USE_URL, jsonBody, JSONObject.class); + if (result.getBoolean("success")) { + row.set("brand_name", result.getJSONObject("data").getString("brandName")); + row.set("store_name", result.getJSONObject("data").getString("storeName")); + row.set("customer_name", result.getJSONObject("data").getString("customerName")); + row.set("phone", result.getJSONObject("data").getString("customerPhone")); + } insertList.add(row); } } catch (WxPayException e) { diff --git a/Cpop-Oam/src/main/java/com/cpop/oam/business/bo/ClueFollowUpBo.java b/Cpop-Oam/src/main/java/com/cpop/oam/business/bo/ClueFollowUpBo.java index b7f359c..34619aa 100644 --- a/Cpop-Oam/src/main/java/com/cpop/oam/business/bo/ClueFollowUpBo.java +++ b/Cpop-Oam/src/main/java/com/cpop/oam/business/bo/ClueFollowUpBo.java @@ -6,6 +6,7 @@ import lombok.Data; import lombok.experimental.Accessors; import javax.validation.constraints.NotBlank; +import javax.validation.constraints.NotNull; /** * @author DB @@ -36,4 +37,11 @@ public class ClueFollowUpBo { */ @ApiModelProperty(value = "记录文件地址") private String recordFileUrl; + + /** + * 更进状态(0:待跟进、1:已歇业、2:无法联系、3:无意向、4:已拜访、5:跟进中、6:已成交 + */ + @NotNull(message = "跟进状态不能为空") + @ApiModelProperty(value = "更进状态(0:待跟进、1:已歇业、2:无法联系、3:无意向、4:已拜访、5:跟进中、6:已成交",required = true) + private Integer followStatus; } diff --git a/Cpop-Oam/src/main/java/com/cpop/oam/business/controller/backstage/BackstageClueController.java b/Cpop-Oam/src/main/java/com/cpop/oam/business/controller/backstage/BackstageClueController.java index f15d531..62b1cb7 100644 --- a/Cpop-Oam/src/main/java/com/cpop/oam/business/controller/backstage/BackstageClueController.java +++ b/Cpop-Oam/src/main/java/com/cpop/oam/business/controller/backstage/BackstageClueController.java @@ -66,8 +66,9 @@ public class BackstageClueController { @ApiParam(value = "校区") @RequestParam(value = "storeId", required = false) String storeId, @ApiParam(value = "负责人或手机号") @RequestParam(value = "chargeOrPhone", required = false) String chargeOrPhone, @ApiParam(value = "员工id") @RequestParam(value = "staffId", required = false) String staffId, - @ApiParam(value = "签约月份") @RequestParam(value = "signMonth", required = false) String signMonth) { - Page pageVo = clueService.getPersonCluePage(clueStatus, city, brandId, storeId, chargeOrPhone, staffId, signMonth); + @ApiParam(value = "签约月份") @RequestParam(value = "signMonth", required = false) String signMonth, + @ApiParam(value = "更进状态") @RequestParam(value = "followStatus", required = false) Integer followStatus) { + Page pageVo = clueService.getPersonCluePage(clueStatus, city, brandId, storeId, chargeOrPhone, staffId, signMonth,followStatus); return R.ok(pageVo); } diff --git a/Cpop-Oam/src/main/java/com/cpop/oam/business/entity/Clue.java b/Cpop-Oam/src/main/java/com/cpop/oam/business/entity/Clue.java index d94af86..dd47040 100644 --- a/Cpop-Oam/src/main/java/com/cpop/oam/business/entity/Clue.java +++ b/Cpop-Oam/src/main/java/com/cpop/oam/business/entity/Clue.java @@ -85,6 +85,11 @@ public class Clue extends BaseEntity implements Serializable { */ private String lastReceiptStaffId; + /** + * 更进状态(0:待跟进、1:已歇业、2:无法联系、3:无意向、4:已拜访、5:跟进中、6:已成交) + */ + private Integer followStatus; + /** * 是否删除(0否1是) */ diff --git a/Cpop-Oam/src/main/java/com/cpop/oam/business/service/ClueService.java b/Cpop-Oam/src/main/java/com/cpop/oam/business/service/ClueService.java index be7aa9b..ed2c512 100644 --- a/Cpop-Oam/src/main/java/com/cpop/oam/business/service/ClueService.java +++ b/Cpop-Oam/src/main/java/com/cpop/oam/business/service/ClueService.java @@ -24,7 +24,7 @@ public interface ClueService extends IService { * @since 2024/2/19 * @return R> */ - Page getPersonCluePage(Integer clueStatus, String city, String brandId, String storeId, String chargeOrPhone, String staffId, String signMonth); + Page getPersonCluePage(Integer clueStatus, String city, String brandId, String storeId, String chargeOrPhone, String staffId, String signMonth,Integer followStatus); /** * 个人签约目标 diff --git a/Cpop-Oam/src/main/java/com/cpop/oam/business/service/impl/BusinessServiceImpl.java b/Cpop-Oam/src/main/java/com/cpop/oam/business/service/impl/BusinessServiceImpl.java index d47d671..ac30a83 100644 --- a/Cpop-Oam/src/main/java/com/cpop/oam/business/service/impl/BusinessServiceImpl.java +++ b/Cpop-Oam/src/main/java/com/cpop/oam/business/service/impl/BusinessServiceImpl.java @@ -411,7 +411,7 @@ public class BusinessServiceImpl extends ServiceImpl i //线索归档 ClueService clueService = SpringUtils.getBean(ClueService.class); Clue clue = clueService.queryChain().where(CLUE.STORE_ID.eq(id)).one(); - clue.setClueStatus(1); + clue.setClueStatus(1).setFollowStatus(6); clueService.updateById(clue); //线索记录 ClueRecord clueRecord = new ClueRecord(); diff --git a/Cpop-Oam/src/main/java/com/cpop/oam/business/service/impl/ClueServiceImpl.java b/Cpop-Oam/src/main/java/com/cpop/oam/business/service/impl/ClueServiceImpl.java index d5df4b8..e31ffc8 100644 --- a/Cpop-Oam/src/main/java/com/cpop/oam/business/service/impl/ClueServiceImpl.java +++ b/Cpop-Oam/src/main/java/com/cpop/oam/business/service/impl/ClueServiceImpl.java @@ -65,7 +65,7 @@ public class ClueServiceImpl extends ServiceImpl implements Cl * @return R> */ @Override - public Page getPersonCluePage(Integer clueStatus, String city, String brandId, String storeId, String chargeOrPhone, String staffId, String signMonth) { + public Page getPersonCluePage(Integer clueStatus, String city, String brandId, String storeId, String chargeOrPhone, String staffId, String signMonth,Integer followStatus) { PageDomain pageDomain = SqlUtils.getInstance().getPageDomain(); QueryWrapper queryWrapper = QueryWrapper.create(); if (clueStatus != null){ @@ -100,7 +100,8 @@ public class ClueServiceImpl extends ServiceImpl implements Cl } return this.mapper.paginateAs(Page.of(pageDomain.getPageNum(),pageDomain.getPageSize()), queryWrapper - .select(CLUE.CITY,CLUE.ID,CLUE.CREATE_TIME,CLUE.DEV_STAFF_ID,CLUE.LAST_FOLLOW_UP_TIME,CLUE.LAST_FOLLOW_UP_CONTENT,CLUE.RECEIPT_TIME,CLUE.STORE_ID,CLUE.CLUE_STATUS) + .select(CLUE.CITY,CLUE.ID,CLUE.CREATE_TIME,CLUE.DEV_STAFF_ID,CLUE.LAST_FOLLOW_UP_TIME,CLUE.LAST_FOLLOW_UP_CONTENT,CLUE.RECEIPT_TIME,CLUE.STORE_ID,CLUE.CLUE_STATUS, + CLUE.FOLLOW_STATUS) .select(STORE.STORE_NAME,STORE.STORE_ADDR,STORE.PERSON_CHARGE,STORE.PHONE) .select(BRAND.BRAND_NAME) .select(STORE_SIGN.EXPIRE_DATE,STORE_SIGN.CREATE_TIME.as(CluePageVo::getStoreSignTime)) @@ -116,6 +117,7 @@ public class ClueServiceImpl extends ServiceImpl implements Cl .and(BRAND.ID.eq(brandId)) //校区 .and(CLUE.STORE_ID.eq(storeId)) + .and(CLUE.FOLLOW_STATUS.eq(followStatus)) .and(STORE.PERSON_CHARGE.likeLeft(chargeOrPhone).or(STORE.PHONE.eq(chargeOrPhone))) .and(STORE_SIGN.SIGN_MONTH.eq(signMonth)) .orderBy(changeOrderColumn(pageDomain)), @@ -266,6 +268,11 @@ public class ClueServiceImpl extends ServiceImpl implements Cl .set(CLUE.LAST_FOLLOW_UP_CONTENT,bo.getRecordContent()) .where(CLUE.ID.eq(bo.getClueId())) .update(); + //更新跟进状态 + this.updateChain() + .set(CLUE.FOLLOW_STATUS,bo.getFollowStatus()) + .where(CLUE.ID.eq(bo.getClueId())) + .update(); } /** @@ -454,8 +461,7 @@ public class ClueServiceImpl extends ServiceImpl implements Cl if (cityList == null || cityList.isEmpty()){ throw new ServiceException("您尚未被分配区域,无法查看线索"); } - return this.mapper.paginateAs(Page.of(pageDomain.getPageNum(),pageDomain.getPageSize()), - queryWrapper + return this.mapper.paginateAs(Page.of(pageDomain.getPageNum(),pageDomain.getPageSize()), queryWrapper .select(CLUE.CITY,CLUE.ID,CLUE.CREATE_TIME,CLUE.DEV_STAFF_ID,CLUE.LAST_FOLLOW_UP_TIME,CLUE.LAST_FOLLOW_UP_CONTENT,CLUE.RECEIPT_TIME,CLUE.STORE_ID,CLUE.LAST_RECEIPT_TIME,CLUE.LAST_RECEIPT_STAFF_ID) .select(STORE.STORE_NAME,STORE.STORE_ADDR,STORE.PERSON_CHARGE,STORE.PHONE) .select(BRAND.BRAND_NAME) @@ -533,8 +539,7 @@ public class ClueServiceImpl extends ServiceImpl implements Cl if (!StringUtils.equals("其他", city)) { queryWrapper.and(CLUE.CITY.eq(city)); } - return this.mapper.paginateAs(Page.of(pageDomain.getPageNum(),pageDomain.getPageSize()), - queryWrapper + return this.mapper.paginateAs(Page.of(pageDomain.getPageNum(),pageDomain.getPageSize()), queryWrapper .select(CLUE.CITY,CLUE.ID,CLUE.CREATE_TIME,CLUE.DEV_STAFF_ID,CLUE.LAST_FOLLOW_UP_TIME,CLUE.LAST_FOLLOW_UP_CONTENT,CLUE.RECEIPT_TIME,CLUE.STORE_ID,CLUE.LAST_RECEIPT_TIME,CLUE.LAST_RECEIPT_STAFF_ID) .select(STORE.STORE_NAME,STORE.STORE_ADDR,STORE.PERSON_CHARGE,STORE.PHONE) .select(BRAND.BRAND_NAME) diff --git a/Cpop-Oam/src/main/java/com/cpop/oam/business/service/impl/TaskServiceImpl.java b/Cpop-Oam/src/main/java/com/cpop/oam/business/service/impl/TaskServiceImpl.java index c2f1363..68bd6db 100644 --- a/Cpop-Oam/src/main/java/com/cpop/oam/business/service/impl/TaskServiceImpl.java +++ b/Cpop-Oam/src/main/java/com/cpop/oam/business/service/impl/TaskServiceImpl.java @@ -435,10 +435,9 @@ public class TaskServiceImpl extends ServiceImpl implements Ta LocalDate now = LocalDate.now(); LocalDate expectedCompletionDate = task.getExpectedCompletionDate(); //测试任务延期一天 - long day = expectedCompletionDate.until(now.plusDays(1), ChronoUnit.DAYS); + long day = now.compareTo(expectedCompletionDate.plusDays(1)); // 逾期完成 if (day > 0) { - task.setTaskItem(-1); //扣除绩点 deductGradePoint(day, bo.getId()); } diff --git a/Cpop-Oam/src/main/java/com/cpop/oam/business/vo/CluePageVo.java b/Cpop-Oam/src/main/java/com/cpop/oam/business/vo/CluePageVo.java index 92c3edd..c2c0f04 100644 --- a/Cpop-Oam/src/main/java/com/cpop/oam/business/vo/CluePageVo.java +++ b/Cpop-Oam/src/main/java/com/cpop/oam/business/vo/CluePageVo.java @@ -6,6 +6,7 @@ import io.swagger.annotations.ApiModelProperty; import lombok.Data; import lombok.experimental.Accessors; +import javax.validation.constraints.NotNull; import java.time.LocalDate; import java.time.LocalDateTime; @@ -173,4 +174,10 @@ public class CluePageVo { @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8") private LocalDateTime storeSignTime; + /** + * 更进状态(0:待跟进、1:已歇业、2:无法联系、3:无意向、4:已拜访、5:跟进中、6:已成交 + */ + @ApiModelProperty(value = "更进状态(0:待跟进、1:已歇业、2:无法联系、3:无意向、4:已拜访、5:跟进中、6:已成交") + private Integer followStatus; + } diff --git a/Cpop-Oam/src/main/java/com/cpop/oam/framework/handler/wxOpen/WxOpenService.java b/Cpop-Oam/src/main/java/com/cpop/oam/framework/handler/wxOpen/WxOpenService.java index fc11c1d..3cce779 100644 --- a/Cpop-Oam/src/main/java/com/cpop/oam/framework/handler/wxOpen/WxOpenService.java +++ b/Cpop-Oam/src/main/java/com/cpop/oam/framework/handler/wxOpen/WxOpenService.java @@ -1,6 +1,7 @@ package com.cpop.oam.framework.handler.wxOpen; import com.cpop.oam.framework.config.wxOpen.WxOpenProperties; +import lombok.Getter; import me.chanjar.weixin.open.api.impl.WxOpenInRedisTemplateConfigStorage; import me.chanjar.weixin.open.api.impl.WxOpenMessageRouter; import me.chanjar.weixin.open.api.impl.WxOpenServiceImpl; @@ -27,6 +28,7 @@ public class WxOpenService extends WxOpenServiceImpl { @Autowired private WxOpenProperties wxOpenProperties; + @Getter private WxOpenMessageRouter wxOpenMessageRouter; @Autowired @@ -47,8 +49,5 @@ public class WxOpenService extends WxOpenServiceImpl { }).next(); } - public WxOpenMessageRouter getWxOpenMessageRouter(){ - return wxOpenMessageRouter; - } } diff --git a/Cpop-Oam/src/main/java/com/cpop/oam/framework/tasks/OamScheduledTasks.java b/Cpop-Oam/src/main/java/com/cpop/oam/framework/tasks/OamScheduledTasks.java index b6e3c4c..5f5a2af 100644 --- a/Cpop-Oam/src/main/java/com/cpop/oam/framework/tasks/OamScheduledTasks.java +++ b/Cpop-Oam/src/main/java/com/cpop/oam/framework/tasks/OamScheduledTasks.java @@ -235,7 +235,7 @@ public class OamScheduledTasks { StaffInfoVo staffInfo = SpringUtils.getBean(StaffService.class).getStaffInfo(item.getResponsibleStaffId()); phoneList.add(staffInfo.getPhoneNumber()); try { - SpringUtils.getBean(WebHookSendHandler.class).webHookSendText(WebHookKeyConstant.ORDER_INFO_BOT, phoneList, + SpringUtils.getBean(WebHookSendHandler.class).webHookSendText(WebHookKeyConstant.PRODUCT_BOT, phoneList, "==========您有一个任务今天即将到期,请及时处理==========\n" + item.getTaskContent(), false); } catch (IOException e) { @@ -250,7 +250,7 @@ public class OamScheduledTasks { ArrayList phoneList = new ArrayList<>(); phoneList.add(testStaffPhones); try { - SpringUtils.getBean(WebHookSendHandler.class).webHookSendText(WebHookKeyConstant.ORDER_INFO_BOT, phoneList, + SpringUtils.getBean(WebHookSendHandler.class).webHookSendText(WebHookKeyConstant.PRODUCT_BOT, phoneList, "==========您有一个测试任务今天即将到期,请及时处理==========\n" + item.getTaskContent(), false); } catch (IOException e) { diff --git a/Cpop-Pay/pom.xml b/Cpop-Pay/pom.xml index 20788b3..76b099d 100644 --- a/Cpop-Pay/pom.xml +++ b/Cpop-Pay/pom.xml @@ -29,6 +29,10 @@ org.jdom jdom2 + + com.cpop + Cpop-Api + diff --git a/Cpop-Pay/src/main/java/com/cpop/pay/framewok/task/WxPayAsyncTask.java b/Cpop-Pay/src/main/java/com/cpop/pay/framewok/task/WxPayAsyncTask.java index e32dd1a..65a865c 100644 --- a/Cpop-Pay/src/main/java/com/cpop/pay/framewok/task/WxPayAsyncTask.java +++ b/Cpop-Pay/src/main/java/com/cpop/pay/framewok/task/WxPayAsyncTask.java @@ -1,15 +1,20 @@ package com.cpop.pay.framewok.task; +import com.alibaba.fastjson.JSONArray; import com.alibaba.fastjson.JSONObject; +import com.cpop.api.tencent.wxWork.handler.WebHookSendHandler; import com.cpop.common.utils.StringUtils; import com.cpop.core.base.enums.OrderSource; import com.cpop.core.base.exception.ServiceException; +import com.cpop.core.service.RedisService; +import com.cpop.core.utils.SpringUtils; import com.cpop.pay.framewok.config.wxPay.WxPayProperties; import com.github.binarywang.wxpay.bean.notify.WxPayOrderNotifyResult; import com.github.binarywang.wxpay.bean.profitsharing.request.ProfitSharingRequest; import com.github.binarywang.wxpay.bean.profitsharing.result.ProfitSharingResult; import com.github.binarywang.wxpay.exception.WxPayException; import com.github.binarywang.wxpay.service.WxPayService; +import com.mybatisflex.core.query.QueryWrapper; import com.mybatisflex.core.row.Db; import com.mybatisflex.core.row.DbChain; import com.mybatisflex.core.row.Row; @@ -18,11 +23,10 @@ import org.springframework.beans.factory.annotation.Autowired; import org.springframework.scheduling.annotation.Async; import org.springframework.stereotype.Component; +import java.io.IOException; import java.time.LocalDateTime; -import java.util.ArrayList; -import java.util.HashMap; -import java.util.List; -import java.util.Map; +import java.time.format.DateTimeFormatter; +import java.util.*; /** * @author DB @@ -138,6 +142,40 @@ public class WxPayAsyncTask { .set("profit_sharing_status", 1) .where("id = ?", profitSharingResult.getOutOrderNo()) .update(); + //发送通知到财务群 + List phoneList = new ArrayList(); + // 获取审核管理员手机号 + RedisService redisService = SpringUtils.getBean(RedisService.class); + String auditStaffPhone = redisService.getCacheObject("sysConfig:oam:OamCancelAfterVerificationStaffPhone"); + phoneList.add(auditStaffPhone); + try { + //获取订单信息 + Row order = Db.selectOneByQuery("cp_j_easy_learn_order", QueryWrapper.create() + .select("cjelo.id", "cjelo.order_content", "cjelo.out_order_no", "cjelo.order_type", "cjelo.customer_name", "cjelo.customer_phone", "cjelo.total_pay_amount","cjelo.create_time") + .select("csb.brand_name") + .select("css.store_name") + .from("cp_j_easy_learn_order").as("cjelo") + .leftJoin("cp_sys_brand").as("csb").on("csb.id= cjelo.brand_id") + .leftJoin("cp_sys_store").as("css").on("css.id= cjelo.store_id") + .where("cjelo.id = ?", profitSharingResult.getOutOrderNo())); + JSONObject receiver = JSONObject.parseArray(profitSharingRequest.getReceivers()).getJSONObject(0); + SpringUtils.getBean(WebHookSendHandler.class).webHookSendText("a885058b-2478-4df8-bdb7-2bb94a08c1f5", phoneList, + "==========用户订单分账到账==========" + + "\n订单创建时间:" + order.getLocalDateTime("createTime").format(DateTimeFormatter.ofPattern("yyyy-MM-dd HH:mm:ss")) + + "\n品牌:" + order.getString("brandName") + + "\n校区:" + order.getString("storeName") + + "\n订单类型:" + order.getInt("orderType") + + "\n受益人:" + order.getInt("customerName") + + "\n电话:" + order.getInt("customerPhone") + + "\n订单金额:" + order.getBigDecimal("totalPayAmount") + + "\n分账金额:" + receiver.get("amount") + + "\n微信订单号:" + profitSharingRequest.getTransactionId() + + "\n商户号:" + profitSharingRequest.getSubMchId() + + "\n到账商户号:" + wxPayProperties.getSharingAccount(), + false); + } catch (IOException e) { + throw new ServiceException("发送任务通知失败!"); + } } else { throw new ServiceException(profitSharingResult.getReturnMsg()); }