diff --git a/Cpop-Core/src/main/java/com/cpop/core/base/enums/OrderSource.java b/Cpop-Core/src/main/java/com/cpop/core/base/enums/OrderSource.java index 2d842ef..8b93cf7 100644 --- a/Cpop-Core/src/main/java/com/cpop/core/base/enums/OrderSource.java +++ b/Cpop-Core/src/main/java/com/cpop/core/base/enums/OrderSource.java @@ -16,7 +16,7 @@ public enum OrderSource { /** * 微信支付 */ - EASY_LEARN("easyLearn",0.002); + EASY_LEARN("EasyLearn",0.002); OrderSource(String name, Double rate) { this.rate = rate; diff --git a/Cpop-Core/src/main/java/com/cpop/core/config/RestTemplateConfig.java b/Cpop-Core/src/main/java/com/cpop/core/config/RestTemplateConfig.java index 3b264a1..7b9f144 100644 --- a/Cpop-Core/src/main/java/com/cpop/core/config/RestTemplateConfig.java +++ b/Cpop-Core/src/main/java/com/cpop/core/config/RestTemplateConfig.java @@ -2,8 +2,7 @@ package com.cpop.core.config; import org.springframework.context.annotation.Bean; import org.springframework.context.annotation.Configuration; -import org.springframework.http.client.ClientHttpRequestFactory; -import org.springframework.http.client.SimpleClientHttpRequestFactory; +import org.springframework.http.client.HttpComponentsClientHttpRequestFactory; import org.springframework.web.client.RestTemplate; /** @@ -15,18 +14,15 @@ import org.springframework.web.client.RestTemplate; public class RestTemplateConfig { @Bean - public RestTemplate restTemplate(ClientHttpRequestFactory factory) { - return new RestTemplate(factory); - } - - @Bean - public ClientHttpRequestFactory simpleClientHttpRequestFactory() { - SimpleClientHttpRequestFactory factory = new SimpleClientHttpRequestFactory(); - factory.setReadTimeout(5000); - factory.setConnectTimeout(15000); - // 设置代理 - //factory.setProxy(null); - return factory; + public RestTemplate restTemplate() { + // 创建一个 HttpComponentsClientHttpRequestFactory 客户端请求工厂实例 + HttpComponentsClientHttpRequestFactory requestFactory = new HttpComponentsClientHttpRequestFactory(); + // 设置连接超时时间为 5 秒 + requestFactory.setConnectTimeout(5000); + // 设置读取超时时间为 10 秒 + requestFactory.setReadTimeout(10000); + // 使用 HttpComponentsClientHttpRequestFactory 客户端请求工厂实例创建 RestTemplate 实例 + return new RestTemplate(requestFactory); } } diff --git a/Cpop-Jambox/src/main/java/com/cpop/jambox/business/bo/OncePlaceOrderBo.java b/Cpop-Jambox/src/main/java/com/cpop/jambox/business/bo/OncePlaceOrderBo.java index 1a334c9..8d62173 100644 --- a/Cpop-Jambox/src/main/java/com/cpop/jambox/business/bo/OncePlaceOrderBo.java +++ b/Cpop-Jambox/src/main/java/com/cpop/jambox/business/bo/OncePlaceOrderBo.java @@ -5,6 +5,8 @@ import io.swagger.annotations.ApiModelProperty; import lombok.Data; import lombok.experimental.Accessors; +import javax.validation.constraints.NotBlank; +import javax.validation.constraints.NotNull; import java.math.BigDecimal; /** @@ -20,49 +22,62 @@ public class OncePlaceOrderBo { /** * 品牌id */ - @ApiModelProperty("品牌id") + @NotBlank(message = "品牌id不能为空") + @ApiModelProperty(value = "品牌id",required = true) private String brandCloudId; /** * 校区id */ - @ApiModelProperty("校区id") + @NotBlank(message = "校区id不能为空") + @ApiModelProperty(value = "校区id",required = true) private String storeCloudId; /** * 客户名 */ - @ApiModelProperty("客户名") + @NotBlank(message = "客户名不能为空") + @ApiModelProperty(value = "客户名",required = true) private String customerName; /** * 客户电话 */ - @ApiModelProperty("客户电话") + @NotBlank(message = "客户电话不能为空") + @ApiModelProperty(value = "客户电话",required = true) private String customerPhone; /** - * 产品/课卡id + * 云id */ - @ApiModelProperty("产品/课卡id") - private String productId; + @NotBlank(message = "云订单id不能为空") + @ApiModelProperty(value = "云订单id",required = true) + private String orderCloudId; /** * 总金额 */ - @ApiModelProperty("总金额") + @NotNull(message = "总金额不能为空") + @ApiModelProperty(value = "总金额",required = true) private BigDecimal totalAmount; /** * 总支付金额 */ - @ApiModelProperty("总支付金额") + @NotNull(message = "总支付金额不能为空") + @ApiModelProperty(value = "总支付金额",required = true) private BigDecimal totalPayAmount; /** - * 员工id + * 校区/店铺员工云id */ - @ApiModelProperty("员工id") - private String staffId; + @ApiModelProperty("校区/店铺员工云id") + private String storeStaffCloudId; + + /** + * openId + */ + @ApiModelProperty("openId") + private String openId; } diff --git a/Cpop-Jambox/src/main/java/com/cpop/jambox/business/controller/backstage/EasyLearnController.java b/Cpop-Jambox/src/main/java/com/cpop/jambox/business/controller/backstage/EasyLearnController.java index d8c527c..be01110 100644 --- a/Cpop-Jambox/src/main/java/com/cpop/jambox/business/controller/backstage/EasyLearnController.java +++ b/Cpop-Jambox/src/main/java/com/cpop/jambox/business/controller/backstage/EasyLearnController.java @@ -93,9 +93,9 @@ public class EasyLearnController { * @param bo 下单请求对象 * @return com.cpop.core.base.R */ - @PostMapping("/oncePlaceOrderBo") + @PostMapping("/oncePlaceOrder") @ApiOperation("一次性支付下单") - public R oncePlaceOrderBo(@RequestBody @Validated @ApiParam("一次性支付") OncePlaceOrderBo bo) { - return R.ok(easyLearnOrderService.oncePlaceOrderBo(bo)); + public R oncePlaceOrder(@RequestBody @Validated @ApiParam("一次性支付") OncePlaceOrderBo bo) { + return R.ok(easyLearnOrderService.oncePlaceOrder(bo)); } } diff --git a/Cpop-Jambox/src/main/java/com/cpop/jambox/business/controller/callback/EasyLearnCallBackController.java b/Cpop-Jambox/src/main/java/com/cpop/jambox/business/controller/callback/EasyLearnCallBackController.java index d282c83..069cd56 100644 --- a/Cpop-Jambox/src/main/java/com/cpop/jambox/business/controller/callback/EasyLearnCallBackController.java +++ b/Cpop-Jambox/src/main/java/com/cpop/jambox/business/controller/callback/EasyLearnCallBackController.java @@ -16,7 +16,7 @@ import org.springframework.web.bind.annotation.RestController; */ @RestController @Api(tags = "果酱-放心学回调接口") -@RequestMapping("/easyLearn/callBack") +@RequestMapping("/easyLearn/callback") public class EasyLearnCallBackController { @Autowired @@ -29,9 +29,9 @@ public class EasyLearnCallBackController { * @param xmlData 数据 * @return java.lang.String */ - @PostMapping("/notify/order") - public String parseOrderNotifyResult(@RequestBody String xmlData){ - easyLearnOrderService.wxPayNotifyOrder(xmlData); + @PostMapping("/notify/oncePay") + public String oncePayResult(@RequestBody String xmlData){ + easyLearnOrderService.oncePayResult(xmlData); return WxPayNotifyResponse.success("成功"); } diff --git a/Cpop-Jambox/src/main/java/com/cpop/jambox/business/entity/EasyLearnOrder.java b/Cpop-Jambox/src/main/java/com/cpop/jambox/business/entity/EasyLearnOrder.java index af21127..a1ab76c 100644 --- a/Cpop-Jambox/src/main/java/com/cpop/jambox/business/entity/EasyLearnOrder.java +++ b/Cpop-Jambox/src/main/java/com/cpop/jambox/business/entity/EasyLearnOrder.java @@ -33,6 +33,21 @@ public class EasyLearnOrder extends BaseEntity implements Serializable { @Id private String id; + /** + * 支付状态(0:未支付;1已支付) + */ + private Integer orderStatus; + + /** + * 云id + */ + private String orderCloudId; + + /** + * 校区/店铺员工云id + */ + private String storeStaffCloudId; + /** * 外部订单号 */ diff --git a/Cpop-Jambox/src/main/java/com/cpop/jambox/business/service/EasyLearnOrderService.java b/Cpop-Jambox/src/main/java/com/cpop/jambox/business/service/EasyLearnOrderService.java index 4aa6a2b..e1a7d7f 100644 --- a/Cpop-Jambox/src/main/java/com/cpop/jambox/business/service/EasyLearnOrderService.java +++ b/Cpop-Jambox/src/main/java/com/cpop/jambox/business/service/EasyLearnOrderService.java @@ -42,7 +42,7 @@ public interface EasyLearnOrderService extends IService { * @since 2023/12/21 * @param xmlData 数据 */ - void wxPayNotifyOrder(String xmlData); + void oncePayResult(String xmlData); /** * 一次性支付下单 @@ -50,5 +50,5 @@ public interface EasyLearnOrderService extends IService { * @since 2023/10/23 12:15 * @param bo 下单请求对象 */ - Object oncePlaceOrderBo(OncePlaceOrderBo bo); + Object oncePlaceOrder(OncePlaceOrderBo bo); } 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 07576d2..1c754bf 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 @@ -22,7 +22,9 @@ import com.cpop.jambox.business.service.BrandExtendService; import com.cpop.jambox.business.service.EasyLearnOrderService; import com.cpop.jambox.business.service.StoreExtendService; import com.cpop.jambox.business.vo.EasyLearnPageVo; +import com.cpop.jambox.framework.constant.JamboxCloudUrl; import com.cpop.jambox.framework.constant.JamboxRedisConstant; +import com.cpop.pay.framewok.config.wxPay.WxPayConfiguration; import com.cpop.pay.framewok.handler.wxPay.WxPayHandler; import com.cpop.pay.framewok.task.WxPayAsyncTask; import com.github.binarywang.wxpay.bean.notify.WxPayOrderNotifyResult; @@ -40,6 +42,7 @@ import com.mybatisflex.core.row.Row; import com.mybatisflex.core.row.RowUtil; import com.mybatisflex.spring.service.impl.ServiceImpl; import com.zaxxer.hikari.HikariDataSource; +import lombok.extern.slf4j.Slf4j; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Service; import org.springframework.web.client.RestTemplate; @@ -59,6 +62,7 @@ import static com.cpop.jambox.business.entity.table.StoreExtendTableDef.STORE_EX * @since 2023-12-14 */ @Service("easyLearnOrderService") +@Slf4j public class EasyLearnOrderServiceImpl extends ServiceImpl implements EasyLearnOrderService { @Autowired @@ -68,9 +72,14 @@ public class EasyLearnOrderServiceImpl extends ServiceImpl= Math.ceil(1 / OrderSource.MALL.getRate())) { - //获取订单信息 - EasyLearnOrder easyLearnOrder = this.getById(orderId); + String subMchId = wxPayHandler.getSubMchId(easyLearnOrder.getBrandId(), easyLearnOrder.getStoreId()); + log.info("支付金额:{}", notifyResult.getTotalFee()); + if (notifyResult.getTotalFee() >= Math.ceil(1 / OrderSource.EASY_LEARN.getRate())) { //设置子商户 WxPayConfig config = wxPayService.getConfig(); - config.setSubMchId(wxPayHandler.getSubMchId(easyLearnOrder.getBrandId(), easyLearnOrder.getStoreId())); + config.setSubMchId(subMchId); wxPayAsyncTask.asyncWxPayProfitSharing(orderId, notifyResult, wxPayService, OrderSource.EASY_LEARN); } //更新订单 this.updateChain().set(EASY_LEARN_ORDER.OUT_ORDER_NO, notifyResult.getTransactionId()).where(EASY_LEARN_ORDER.ID.eq(orderId)).update(); - //TODO: 通知波哥办卡 - SpringUtils.getBean(RestTemplate.class); + //课卡信息 + JSONObject jsonBody = new JSONObject(); + jsonBody.put("_type", "addPeriod"); + //办卡实收金额 + jsonBody.put("money", easyLearnOrder.getTotalPayAmount()); + //获取云校区id + StoreExtend storeExtend = SpringUtils.getBean(StoreExtendService.class).getOne(QueryWrapper.create().where(STORE_EXTEND.STORE_ID.eq(easyLearnOrder.getStoreId()))); + //店铺/校区 + jsonBody.put("storeId", storeExtend.getStoreCloudId()); + //手机号 + jsonBody.put("phone", easyLearnOrder.getCustomerPhone()); + //客户名称 + jsonBody.put("customerName", easyLearnOrder.getCustomerName()); + //模板id + jsonBody.put("templateId", easyLearnOrder.getOrderCloudId()); + //订单来源 + jsonBody.put("orderSource", OrderSource.EASY_LEARN.toString()); + //订单来源 + jsonBody.put("subMchId", subMchId); + //获取课卡信息 + JSONObject result = SpringUtils.getBean(RestTemplate.class).postForObject(JamboxCloudUrl.COMMON_CARD_URL, jsonBody, JSONObject.class); + if (result == null){ + throw new ServiceException("放心学一次性支付办卡失败!"); + } + easyLearnOrder.setProductId(result.getString("data")).setOrderStatus(1); + this.updateById(easyLearnOrder); } catch (WxPayException e) { throw new ServiceException(e.getMessage()); } @@ -386,25 +421,46 @@ public class EasyLearnOrderServiceImpl extends ServiceImpl= Math.ceil(1 / OrderSource.EASY_LEARN.getRate())) { @@ -412,7 +468,7 @@ public class EasyLearnOrderServiceImpl extends ServiceImpl filterList = new ArrayList<>(); filterList.add("b00064a760d0c4f121b0835d09b909ca"); - filterList.add("ac1268b164d1d20700080aae1703ecf8"); + filterList.add("41ae62ef621ee0f909da5583399ff318"); filterList.add("0122a5876468513f0d42569d389e8264"); + filterList.add("0ab5303b62c68da00d302cc2079b7fbe"); + filterList.add("41ae62ef6228587e0b430c3a16483a9a"); + filterList.add("ac1268b164d1d20700080aae1703ecf8"); + filterList.add("def1da45654259bc090e5054208e9b9c"); List jsonBrands = JSONArray.parseArray(readJson(brandFileUrl), JsonBrand.class); //过滤已存在的品牌 List filterBrand = jsonBrands.stream().filter(item -> !filterList.contains(item.getBrandCloudId())).collect(Collectors.toList()); @@ -69,18 +78,32 @@ public class CpopImportTests { Map brandJsonBrandMap = new HashMap<>(); filterBrand.forEach(item -> { Brand brand = new Brand(); - brand.setSourceType(SourceType.JAMBOX.toString()) - .setBrandName(item.getBrandName()); + brand.setSourceType(SourceType.JAMBOX.toString()).setBrandName(item.getBrandName()); BrandExtend brandExtend = new BrandExtend(); brandExtend.setBrandCloudId(item.getBrandCloudId()); brandJsonBrandMap.put(brandExtend, brand); }); - SpringUtils.getBean(BrandService.class).saveBatch(brandJsonBrandMap.values()) ; + SpringUtils.getBean(BrandService.class).saveBatch(brandJsonBrandMap.values()); //批量插入拓展信息 brandJsonBrandMap.forEach((key, value) -> { key.setBrandId(value.getId()); }); - SpringUtils.getBean(BrandExtendService.class).saveBatch(brandJsonBrandMap.keySet()); + SpringUtils.getBean(BrandExtendService.class).saveBatch(brandJsonBrandMap.keySet());*/ + //更新商户号 + try { + //查询旧表 + DataSourceKey.use("jambox"); + List rowList = DbChain.table("j_merchant_info") + .select("jmi.wx_mch_id as wxMchId") + .select("tbi.brand_id as brandCloudId") + .from("j_merchant_info").as("jmi") + .leftJoin("t_brand_info").as("tbi").on("tbi.id = jmi.main_id") + .where("jmi.main_type = 1") + .list(); + log.info(JSONArray.toJSONString(rowList)); + } finally { + DataSourceKey.clear(); + } } /** @@ -92,10 +115,8 @@ public class CpopImportTests { @Test public void importStoreJson() throws IOException { String storeFileUrl = "C:\\Users\\Administrator\\Desktop\\store.json"; - List filterList = new ArrayList<>(); - filterList.add("b00064a760d0c4f121b0835d09b909ca"); - filterList.add("ac1268b164d1d20700080aae1703ecf8"); - filterList.add("0122a5876468513f0d42569d389e8264"); + List filterList = Db.selectListByQuery(STORE_EXTEND.getTableName(), QueryWrapper.create().select(STORE_EXTEND.STORE_CLOUD_ID)) + .stream().map(item -> item.getString("storeCloudId")).collect(Collectors.toList()); List jsonStores = JSONArray.parseArray(readJson(storeFileUrl), JsonStore.class); //过滤已存在的品牌 List filterStore = jsonStores.stream() @@ -257,8 +278,6 @@ public class CpopImportTests { "ness_license_id as licenseCode", "corp_name as licenseUserName", "reg_pic as licensePicUrl") .where("reg_addr is not null") .list(); - - } finally { DataSourceKey.clear(); } @@ -351,7 +370,16 @@ public class CpopImportTests { DataSourceKey.clear(); } - getTestDynamicDataSource(); + //获取校区 + Map storeMap = SpringUtils.getBean(StoreExtendService.class).list().stream().collect(Collectors.toMap(StoreExtend::getStoreCloudId, StoreExtend::getStoreId)); + rowList.forEach(item->{ + item.set("storeId",storeMap.get(item.getString("storeCloudId"))); + }); + List entityList = RowUtil.toEntityList(rowList, StoreRenew.class); + Set filterStoreList = entityList.stream().filter(item -> item.getStoreId() != null ).collect(Collectors.toSet()); + SpringUtils.getBean(StoreRenewService.class).saveBatch(filterStoreList); + + /*getTestDynamicDataSource(); try { DataSourceKey.use("dev"); //获取校区 @@ -364,7 +392,7 @@ public class CpopImportTests { SpringUtils.getBean(StoreRenewService.class).saveBatch(filterStoreList); } finally { DataSourceKey.clear(); - } + }*/ } /** @@ -391,8 +419,21 @@ public class CpopImportTests { } finally { DataSourceKey.clear(); } - getTestDynamicDataSource(); + //获取校区 + Map storeMap = SpringUtils.getBean(StoreExtendService.class).list().stream().collect(Collectors.toMap(StoreExtend::getStoreCloudId, StoreExtend::getStoreId)); + Map brandMap = SpringUtils.getBean(BrandExtendService.class).list().stream().collect(Collectors.toMap(BrandExtend::getBrandCloudId, BrandExtend::getBrandId)); + rowList.forEach(item->{ + item.set("orderType",3); + item.set("brandId",brandMap.get(item.getString("brandCloudId"))); + item.set("storeId",storeMap.get(item.getString("storeCloudId"))); + }); + + List entityList = RowUtil.toEntityList(rowList, EasyLearnOrder.class); + SpringUtils.getBean(EasyLearnOrderService.class).saveBatch(entityList); + + /*getTestDynamicDataSource(); try { + DataSourceKey.use("dev"); //获取校区 Map storeMap = SpringUtils.getBean(StoreExtendService.class).list().stream().collect(Collectors.toMap(StoreExtend::getStoreCloudId, StoreExtend::getStoreId)); Map brandMap = SpringUtils.getBean(BrandExtendService.class).list().stream().collect(Collectors.toMap(BrandExtend::getBrandCloudId, BrandExtend::getBrandId)); @@ -406,7 +447,7 @@ public class CpopImportTests { SpringUtils.getBean(EasyLearnOrderService.class).saveBatch(entityList); }finally { DataSourceKey.clear(); - } + }*/ } /** @@ -492,13 +533,11 @@ public class CpopImportTests { /** * 手机号 */ - @JSONField(name = "phone") - private String phoneNumber; + private String phone; /** * 姓名 */ - @JSONField(name = "name") private String name; /** diff --git a/Cpop-Oam/src/main/java/com/cpop/oam/business/bo/StaffBo.java b/Cpop-Oam/src/main/java/com/cpop/oam/business/bo/StaffBo.java index ee11261..6b9b29e 100644 --- a/Cpop-Oam/src/main/java/com/cpop/oam/business/bo/StaffBo.java +++ b/Cpop-Oam/src/main/java/com/cpop/oam/business/bo/StaffBo.java @@ -74,8 +74,7 @@ public class StaffBo implements Serializable { /** * 昵称 */ - @NotBlank(message = "昵称不能为空") - @ApiModelProperty(value = "昵称",required = true) + @ApiModelProperty(value = "昵称") private String nickName; /** diff --git a/Cpop-Oam/src/main/java/com/cpop/oam/business/controller/backstage/BrandManagerController.java b/Cpop-Oam/src/main/java/com/cpop/oam/business/controller/backstage/BrandManagerController.java index 84d8531..716efc5 100644 --- a/Cpop-Oam/src/main/java/com/cpop/oam/business/controller/backstage/BrandManagerController.java +++ b/Cpop-Oam/src/main/java/com/cpop/oam/business/controller/backstage/BrandManagerController.java @@ -14,6 +14,7 @@ import com.cpop.oam.business.vo.BrandManagePageVo; import com.cpop.system.business.vo.StoreListByBrandVo; import com.mybatisflex.core.paginate.Page; import com.mybatisflex.core.query.QueryWrapper; +import org.springframework.security.access.prepost.PreAuthorize; import org.springframework.validation.annotation.Validated; import org.springframework.web.bind.annotation.*; import org.springframework.beans.factory.annotation.Autowired; @@ -50,6 +51,7 @@ public class BrandManagerController { */ @ApiOperation("查询品牌管理员分页") @GetMapping("/getBrandManagePage") + @PreAuthorize("@aps.hasPermission('brandStore:brandStaff:list')") public R> getBrandManagePage(BrandManagerPageBo bo) { Page page = brandManageService.getBrandManagerPage(bo); return R.ok(page); diff --git a/Cpop-Oam/src/main/java/com/cpop/oam/business/dto/DataImportParamsDto.java b/Cpop-Oam/src/main/java/com/cpop/oam/business/dto/DataImportParamsDto.java index 20a7b55..db595bf 100644 --- a/Cpop-Oam/src/main/java/com/cpop/oam/business/dto/DataImportParamsDto.java +++ b/Cpop-Oam/src/main/java/com/cpop/oam/business/dto/DataImportParamsDto.java @@ -2,7 +2,6 @@ package com.cpop.oam.business.dto; import lombok.Data; import lombok.experimental.Accessors; -import org.checkerframework.checker.units.qual.C; /** * @author DB @@ -26,5 +25,5 @@ public class DataImportParamsDto { /** * 是否清空 */ - private String emptyTag; + private Integer emptyTag; } diff --git a/Cpop-Oam/src/main/java/com/cpop/oam/business/service/impl/DataImportServiceImpl.java b/Cpop-Oam/src/main/java/com/cpop/oam/business/service/impl/DataImportServiceImpl.java index 0d95a35..f59c62a 100644 --- a/Cpop-Oam/src/main/java/com/cpop/oam/business/service/impl/DataImportServiceImpl.java +++ b/Cpop-Oam/src/main/java/com/cpop/oam/business/service/impl/DataImportServiceImpl.java @@ -106,7 +106,7 @@ public class DataImportServiceImpl extends ServiceImpl implements Du LocalDate now = LocalDate.now(); //获取当天值班员工 Duty one = this.queryChain().where(DUTY.DUTY_DATE.eq(now)).one(); - //获取当天技术值班人员 - StaffDto staff = DbChain.table(SYS_USER).select(SYS_USER.PHONE_NUMBER, STAFF.NAME).from(SYS_USER) - .leftJoin(STAFF).on(STAFF.USER_ID.eq(SYS_USER.ID)) - .where(STAFF.ID.eq(one.getTechnologyStaffId())).oneAs(StaffDto.class); - //技术售后群提醒 - try { - webHookSendHandler.webHookSendText(WebHookKeyConstant.ORDER_INFO_BOT, Collections.singletonList(staff.getPhoneNumber()), - "===今日值班" + staff.getName() + "===" - , false); - } catch (IOException e) { - throw new ServiceException(e.getMessage()); + if (one != null){ + //获取当天技术值班人员 + StaffDto staff = DbChain.table(SYS_USER).select(SYS_USER.PHONE_NUMBER, STAFF.NAME).from(SYS_USER) + .leftJoin(STAFF).on(STAFF.USER_ID.eq(SYS_USER.ID)) + .where(STAFF.ID.eq(one.getTechnologyStaffId())).oneAs(StaffDto.class); + //技术售后群提醒 + try { + webHookSendHandler.webHookSendText(WebHookKeyConstant.ORDER_INFO_BOT, Collections.singletonList(staff.getPhoneNumber()), + "===今日值班" + staff.getName() + "===" + , false); + } catch (IOException e) { + throw new ServiceException(e.getMessage()); + } } } } diff --git a/Cpop-Oam/src/main/java/com/cpop/oam/business/service/impl/FinanceReimburseServiceImpl.java b/Cpop-Oam/src/main/java/com/cpop/oam/business/service/impl/FinanceReimburseServiceImpl.java index 0e5696a..d921dfb 100644 --- a/Cpop-Oam/src/main/java/com/cpop/oam/business/service/impl/FinanceReimburseServiceImpl.java +++ b/Cpop-Oam/src/main/java/com/cpop/oam/business/service/impl/FinanceReimburseServiceImpl.java @@ -78,7 +78,8 @@ public class FinanceReimburseServiceImpl extends ServiceImpl financeReimburseStages = new ArrayList<>(); //审批批量转下款 - if (list.get(0).getStatus() == 1) { + if (list.get(0).getStatus() == 0) { Map idToPrice = list.stream().collect(Collectors.toMap(FinanceReimburse::getId, item->item)); list.forEach(item -> { FinanceReimburseStage entity = new FinanceReimburseStage(); @@ -137,13 +138,15 @@ public class FinanceReimburseServiceImpl extends ServiceImpl> stageMap = SpringUtils.getBean(FinanceReimburseStageService.class).queryChain() .where(FINANCE_REIMBURSE_STAGE.FINANCE_REIMBURSE_ID.in(finishReimburseIds)).list() .stream().collect(Collectors.groupingBy(FinanceReimburseStage::getFinanceReimburseId)); - list.forEach(item->{ + list.forEach(item -> { + FinanceReimburseStage entity = new FinanceReimburseStage(); if (stageMap.get(item.getId()) != null) { //减去已下发的 - FinanceReimburseStage entity = new FinanceReimburseStage(); entity.setStageAmount(item.getPrice().subtract(stageMap.get(item.getId()).stream().map(FinanceReimburseStage::getStageAmount).reduce(BigDecimal.ZERO, BigDecimal::add))); - item.setStatus(2); + } else { + entity.setFinanceReimburseId(item.getId()).setPaymentTime(now).setStageAmount(item.getPrice()); } + item.setStatus(2); }); } //批量修改 @@ -193,11 +196,11 @@ public class FinanceReimburseServiceImpl extends ServiceImpl list = this.list(QueryWrapper.create() .where(FINANCE_REIMBURSE.STAFF_ID.eq(loginUserInfo.getString("id"))) - .and(FINANCE_REIMBURSE.STATUS.ne(4))); + .and(FINANCE_REIMBURSE.STATUS.ne(-1))); //统计 ReimbursePersonStatisticVo vo = new ReimbursePersonStatisticVo(); - vo.setUnPay(list.stream().filter(s -> s.getStatus() != 3).map(FinanceReimburse::getPrice).reduce(BigDecimal.ZERO, BigDecimal::add)); - vo.setHavePay(list.stream().filter(s -> s.getStatus() == 3).map(FinanceReimburse::getPrice).reduce(BigDecimal.ZERO, BigDecimal::add)); + vo.setUnPay(list.stream().filter(s -> s.getStatus() != 2).map(FinanceReimburse::getPrice).reduce(BigDecimal.ZERO, BigDecimal::add)); + vo.setHavePay(list.stream().filter(s -> s.getStatus() == 2).map(FinanceReimburse::getPrice).reduce(BigDecimal.ZERO, BigDecimal::add)); return vo; } 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 9651b12..f033d66 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 @@ -479,7 +479,7 @@ public class TaskServiceImpl extends ServiceImpl implements Ta TaskStaffGroupService taskStaffGroupService = SpringUtils.getBean(TaskStaffGroupService.class); List taskStaffGroups = taskStaffGroupService.queryChain().where(TASK_STAFF_GROUP.TASK_ID.eq(taskId)).list(); //逾期完成3天内只计算有效绩点的80% - if (day < 3) { + if (day <= 3) { //3天以上50% taskStaffGroups.forEach(item -> { //向下取整 diff --git a/Cpop-Oam/src/main/java/com/cpop/oam/business/service/impl/TaskWorkOrderServiceImpl.java b/Cpop-Oam/src/main/java/com/cpop/oam/business/service/impl/TaskWorkOrderServiceImpl.java index a8366c0..d3a8c16 100644 --- a/Cpop-Oam/src/main/java/com/cpop/oam/business/service/impl/TaskWorkOrderServiceImpl.java +++ b/Cpop-Oam/src/main/java/com/cpop/oam/business/service/impl/TaskWorkOrderServiceImpl.java @@ -192,7 +192,7 @@ public class TaskWorkOrderServiceImpl extends ServiceImpl> getStorePage(StorePageBo bo) { diff --git a/Cpop-System/src/main/java/com/cpop/system/business/controller/StoreSignController.java b/Cpop-System/src/main/java/com/cpop/system/business/controller/StoreSignController.java index 98643ea..3961e87 100644 --- a/Cpop-System/src/main/java/com/cpop/system/business/controller/StoreSignController.java +++ b/Cpop-System/src/main/java/com/cpop/system/business/controller/StoreSignController.java @@ -6,20 +6,19 @@ import com.cpop.system.business.bo.StoreRenewPageBo; import com.cpop.system.business.bo.StoreRenewXmlBo; import com.cpop.system.business.bo.StoreRunOffBo; import com.cpop.system.business.dto.StoreRenewDto; +import com.cpop.system.business.service.StoreSignService; import com.cpop.system.business.vo.StoreRenewPageVo; import com.mybatisflex.core.paginate.Page; -import org.springframework.validation.annotation.Validated; -import org.springframework.web.bind.annotation.*; -import org.springframework.beans.factory.annotation.Autowired; -import com.cpop.system.business.service.StoreSignService; import io.swagger.annotations.Api; import io.swagger.annotations.ApiOperation; import io.swagger.annotations.ApiParam; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.validation.annotation.Validated; +import org.springframework.web.bind.annotation.*; import javax.servlet.http.HttpServletResponse; import java.io.IOException; import java.net.URLEncoder; -import java.util.ArrayList; /** * 校区-签约表 控制层。 diff --git a/Cpop-System/src/main/java/com/cpop/system/business/service/impl/StoreSignServiceImpl.java b/Cpop-System/src/main/java/com/cpop/system/business/service/impl/StoreSignServiceImpl.java index 36d35c8..d4abb34 100644 --- a/Cpop-System/src/main/java/com/cpop/system/business/service/impl/StoreSignServiceImpl.java +++ b/Cpop-System/src/main/java/com/cpop/system/business/service/impl/StoreSignServiceImpl.java @@ -1,5 +1,6 @@ package com.cpop.system.business.service.impl; +import com.cpop.common.utils.StringUtils; import com.cpop.core.base.entity.PageDomain; import com.cpop.core.utils.SpringUtils; import com.cpop.core.utils.sql.SqlUtils; @@ -46,6 +47,12 @@ public class StoreSignServiceImpl extends ServiceImpl getStoreRenewPage(StoreRenewPageBo bo) { PageDomain pageDomain = SqlUtils.getInstance().getPageDomain(); QueryWrapper queryWrapper = QueryWrapper.create(); + if (StringUtils.isNotBlank(bo.getAddrOrName())){ + queryWrapper.and(STORE_LICENSE.LICENSE_ADDR.like(bo.getAddrOrName()).or(STORE_LICENSE.LICENSE_NAME.like(bo.getAddrOrName()))); + } + if (StringUtils.isNotBlank(bo.getBrandOrStore())){ + queryWrapper.and(BRAND.BRAND_NAME.like(bo.getBrandOrStore()).or(STORE.STORE_NAME.like(bo.getBrandOrStore()))); + } switch (bo.getRenewStatus()){ //待续费 case 0: @@ -69,9 +76,7 @@ public class StoreSignServiceImpl extends ServiceImpl item.field(StoreRenewPageVo::getLastUpdateUserId) + item -> item.field(StoreRenewPageVo::getLastUpdateStaffName) .queryWrapper(updateStaff -> queryChain() .select("name") .from("cp_oam_staff")