From 6da59e82e50d6cf6a0bba8dc45ef8531fbef73c9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=85=95=E4=B8=8B?= <484014559@qq.com> Date: Mon, 12 Aug 2024 20:40:24 +0800 Subject: [PATCH 1/6] =?UTF-8?q?=E7=94=B5=E5=AD=90=E9=9D=A2=E5=8D=95?= =?UTF-8?q?=E6=8E=A5=E5=8F=A3=E5=AF=B9=E6=8E=A5?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../delivery/AppDeliverExpressController.java | 12 +++++++- .../vo/express/ElectronicFaceSheet.java | 12 ++++++++ .../vo/express/ElectronicFaceSheetParam.java | 30 +++++++++++++++++++ .../app/delivery/vo/express/RecManVo.java | 12 ++++++++ .../app/delivery/vo/express/SendManVo.java | 12 ++++++++ .../delivery/DeliveryExpressService.java | 2 ++ .../delivery/DeliveryExpressServiceImpl.java | 21 +++++++++++++ 7 files changed, 100 insertions(+), 1 deletion(-) create mode 100644 yudao-module-mall/yudao-module-trade-biz/src/main/java/cn/iocoder/yudao/module/trade/controller/app/delivery/vo/express/ElectronicFaceSheet.java create mode 100644 yudao-module-mall/yudao-module-trade-biz/src/main/java/cn/iocoder/yudao/module/trade/controller/app/delivery/vo/express/ElectronicFaceSheetParam.java create mode 100644 yudao-module-mall/yudao-module-trade-biz/src/main/java/cn/iocoder/yudao/module/trade/controller/app/delivery/vo/express/RecManVo.java create mode 100644 yudao-module-mall/yudao-module-trade-biz/src/main/java/cn/iocoder/yudao/module/trade/controller/app/delivery/vo/express/SendManVo.java diff --git a/yudao-module-mall/yudao-module-trade-biz/src/main/java/cn/iocoder/yudao/module/trade/controller/app/delivery/AppDeliverExpressController.java b/yudao-module-mall/yudao-module-trade-biz/src/main/java/cn/iocoder/yudao/module/trade/controller/app/delivery/AppDeliverExpressController.java index 540f5b6..fc88fe5 100644 --- a/yudao-module-mall/yudao-module-trade-biz/src/main/java/cn/iocoder/yudao/module/trade/controller/app/delivery/AppDeliverExpressController.java +++ b/yudao-module-mall/yudao-module-trade-biz/src/main/java/cn/iocoder/yudao/module/trade/controller/app/delivery/AppDeliverExpressController.java @@ -14,12 +14,15 @@ import io.swagger.v3.oas.annotations.Operation; import io.swagger.v3.oas.annotations.tags.Tag; import org.springframework.validation.annotation.Validated; import org.springframework.web.bind.annotation.GetMapping; +import org.springframework.web.bind.annotation.PostMapping; import org.springframework.web.bind.annotation.RequestMapping; import org.springframework.web.bind.annotation.RestController; import javax.annotation.Resource; +import javax.annotation.security.PermitAll; import java.util.Comparator; import java.util.List; +import java.util.Map; import static cn.iocoder.yudao.framework.common.pojo.CommonResult.success; @@ -40,11 +43,18 @@ public class AppDeliverExpressController { return success(DeliveryExpressConvert.INSTANCE.convertList03(list)); } - @GetMapping("/realTimeExpressDeliveryQuery") + @PostMapping("/realTimeExpressDeliveryQuery") @Operation(summary = "实时物流查询") public CommonResult realTimeExpressDeliveryQuery(){ String deliveryQuery = deliveryExpressService.deliveryQuery(); return success(deliveryQuery); } + @PostMapping("/electronicFaceSheet") + @Operation(summary = "电子面单下单") + public CommonResult electronicFaceSheetOrder(){ + String sheetOrder = deliveryExpressService.doElectronicFaceSheetOrder(); + return success(sheetOrder); + } + } diff --git a/yudao-module-mall/yudao-module-trade-biz/src/main/java/cn/iocoder/yudao/module/trade/controller/app/delivery/vo/express/ElectronicFaceSheet.java b/yudao-module-mall/yudao-module-trade-biz/src/main/java/cn/iocoder/yudao/module/trade/controller/app/delivery/vo/express/ElectronicFaceSheet.java new file mode 100644 index 0000000..4391be5 --- /dev/null +++ b/yudao-module-mall/yudao-module-trade-biz/src/main/java/cn/iocoder/yudao/module/trade/controller/app/delivery/vo/express/ElectronicFaceSheet.java @@ -0,0 +1,12 @@ +package cn.iocoder.yudao.module.trade.controller.app.delivery.vo.express; + +import lombok.Data; + +@Data +public class ElectronicFaceSheet { + private String method;//业务类型(默认:order) + private String key;//授权码,请到快递100页面申请企业版接口获取 + private String sign;//32位大写,签名,用于验证身份,按MD5 (param +t+key+ secret)的顺序进行MD5加密,不需要加上“+”号,secret在企业管理后台获取 + private String t;//时间戳如:1576123932000 + private ElectronicFaceSheetParam param;// 由其他字段拼接 +} diff --git a/yudao-module-mall/yudao-module-trade-biz/src/main/java/cn/iocoder/yudao/module/trade/controller/app/delivery/vo/express/ElectronicFaceSheetParam.java b/yudao-module-mall/yudao-module-trade-biz/src/main/java/cn/iocoder/yudao/module/trade/controller/app/delivery/vo/express/ElectronicFaceSheetParam.java new file mode 100644 index 0000000..622e304 --- /dev/null +++ b/yudao-module-mall/yudao-module-trade-biz/src/main/java/cn/iocoder/yudao/module/trade/controller/app/delivery/vo/express/ElectronicFaceSheetParam.java @@ -0,0 +1,30 @@ +package cn.iocoder.yudao.module.trade.controller.app.delivery.vo.express; + +import lombok.Data; + +@Data +public class ElectronicFaceSheetParam { + private String printType;//打印类型,NON:只下单不打印(默认); IMAGE:生成图片短链;HTML:生成html短链; CLOUD:使用快递100云打印机打印,使用CLOUD时siid必填 + private String partnerId;// 电子面单客户账户或月结账号,需贵司向当地快递公司网点申请(参考电子面单申请指南); 是否必填该属性,请查看参数字典 + private String partnerKey;//电子面单密码,需贵司向当地快递公司网点申请; 是否必填该属性,请查看参数字典 + private String partnerSecret;//电子面单密钥,需贵司向当地快递公司网点申请; 是否必填该属性,请查看参数字典 + private String partnerName;// 电子面单客户账户名称,需贵司向当地快递公司网点申请; 是否必填该属性,请查看参数字典 + private String net;//收件网点名称,由快递公司当地网点分配, 若使用淘宝授权填入(taobao),使用菜鸟授权填入(cainiao), 使用京东授权填入(jdalpha),使用拼多多授权填入(pinduoduoWx),使用抖音授权填入(douyin),使用快手授权填入(kuaishou),使用唯品会授权填入(weipinhui),使用视频号授权填入(wechatChannels),使用小红书授权填入(xiaohongshu)。 是否必填该属性,请查看参数字典 (若通过第三方授权方式获取单号partnerId,partnerKey参数为必填,参数值可通过第三方授权接口获取) + private String code;//电子面单承载编号,需贵司向当地快递公司网点申请; 是否必填该属性,请查看参数字典 + private String checkMan;//电子面单承载快递员名,需贵司向当地快递公司网点申请; 是否必填该属性,请查看参数字典 + private String tbNet;// 在使用菜鸟/淘宝/拼多多授权电子面单时,若月结账号下存在多个网点,则tbNet="网点名称,网点编号" ,注意此处为英文逗号 + private String kuaidicom;//快递公司的编码,一律用小写字母,请查看参数字典 + private RecManVo recMan;//收件人信息 + private SendManVo sendMan;//寄件人信息 + private String cargo;//物品名称,例:文件 + private Integer count;//包裹总数量。该属性与子单有关,如果需要子单(指同一个订单打印出多张电子面单,即同一个订单返回多个面单号),needChild = 1、count 需要大于1,如count = 2 则一个主单 一个子单,count = 3则一个主单 二个子单;返回的子单号码见返回结果的childNum字段 + private Double weight;//物品总重量KG,例:1.5,单位kg。极兔速递必填,其他快递公司非必填 + private String payType;//支付方式: SHIPPER:寄方付(默认) CONSIGNEE:到付 MONTHLY:月结 THIRDPARTY:第三方支付 (详细请查看参数字典 ) + private String expType;//产品类型: 如标准快递(默认) 顺丰标快(陆运) EMS经济 (详细请请查看参数字典 ) + private String remark;//备注 + private String siid;//打印设备,通过打印机输出的设备码进行获取,printType为CLOUD时必填 + private String direction;//打印方向, 0:正方向(默认); 1:反方向;只有printType为CLOUD时该参数生效 + private String tempId;//主单模板,通过管理后台的快递公司模板V2信息获取 + private String childTempId;//子单模板,部分快递公司需指定。通过管理后台的快递公司模板V2信息获取 + private String backTempId;//回单模板,部分快递公司需指定。通过管理后台的快递公司模板V2信息获取 +} diff --git a/yudao-module-mall/yudao-module-trade-biz/src/main/java/cn/iocoder/yudao/module/trade/controller/app/delivery/vo/express/RecManVo.java b/yudao-module-mall/yudao-module-trade-biz/src/main/java/cn/iocoder/yudao/module/trade/controller/app/delivery/vo/express/RecManVo.java new file mode 100644 index 0000000..0cc1011 --- /dev/null +++ b/yudao-module-mall/yudao-module-trade-biz/src/main/java/cn/iocoder/yudao/module/trade/controller/app/delivery/vo/express/RecManVo.java @@ -0,0 +1,12 @@ +package cn.iocoder.yudao.module.trade.controller.app.delivery.vo.express; + +import lombok.Data; + +@Data +public class RecManVo { + private String name; + private String mobile; + private String tel; + private String printAddr; + private String company; +} diff --git a/yudao-module-mall/yudao-module-trade-biz/src/main/java/cn/iocoder/yudao/module/trade/controller/app/delivery/vo/express/SendManVo.java b/yudao-module-mall/yudao-module-trade-biz/src/main/java/cn/iocoder/yudao/module/trade/controller/app/delivery/vo/express/SendManVo.java new file mode 100644 index 0000000..521b25f --- /dev/null +++ b/yudao-module-mall/yudao-module-trade-biz/src/main/java/cn/iocoder/yudao/module/trade/controller/app/delivery/vo/express/SendManVo.java @@ -0,0 +1,12 @@ +package cn.iocoder.yudao.module.trade.controller.app.delivery.vo.express; + +import lombok.Data; + +@Data +public class SendManVo { + private String name; + private String mobile; + private String tel; + private String printAddr; + private String company; +} diff --git a/yudao-module-mall/yudao-module-trade-biz/src/main/java/cn/iocoder/yudao/module/trade/service/delivery/DeliveryExpressService.java b/yudao-module-mall/yudao-module-trade-biz/src/main/java/cn/iocoder/yudao/module/trade/service/delivery/DeliveryExpressService.java index f8722fc..910f392 100644 --- a/yudao-module-mall/yudao-module-trade-biz/src/main/java/cn/iocoder/yudao/module/trade/service/delivery/DeliveryExpressService.java +++ b/yudao-module-mall/yudao-module-trade-biz/src/main/java/cn/iocoder/yudao/module/trade/service/delivery/DeliveryExpressService.java @@ -82,4 +82,6 @@ public interface DeliveryExpressService { String deliveryQuery(); + String doElectronicFaceSheetOrder(); + } diff --git a/yudao-module-mall/yudao-module-trade-biz/src/main/java/cn/iocoder/yudao/module/trade/service/delivery/DeliveryExpressServiceImpl.java b/yudao-module-mall/yudao-module-trade-biz/src/main/java/cn/iocoder/yudao/module/trade/service/delivery/DeliveryExpressServiceImpl.java index b768357..2e4775d 100644 --- a/yudao-module-mall/yudao-module-trade-biz/src/main/java/cn/iocoder/yudao/module/trade/service/delivery/DeliveryExpressServiceImpl.java +++ b/yudao-module-mall/yudao-module-trade-biz/src/main/java/cn/iocoder/yudao/module/trade/service/delivery/DeliveryExpressServiceImpl.java @@ -9,6 +9,8 @@ import cn.iocoder.yudao.module.trade.controller.admin.delivery.vo.express.Delive import cn.iocoder.yudao.module.trade.controller.admin.delivery.vo.express.DeliveryExpressExportReqVO; import cn.iocoder.yudao.module.trade.controller.admin.delivery.vo.express.DeliveryExpressPageReqVO; import cn.iocoder.yudao.module.trade.controller.admin.delivery.vo.express.DeliveryExpressUpdateReqVO; +import cn.iocoder.yudao.module.trade.controller.app.delivery.vo.express.ElectronicFaceSheet; +import cn.iocoder.yudao.module.trade.controller.app.delivery.vo.express.ElectronicFaceSheetParam; import cn.iocoder.yudao.module.trade.convert.delivery.DeliveryExpressConvert; import cn.iocoder.yudao.module.trade.dal.dataobject.delivery.DeliveryExpressDO; import cn.iocoder.yudao.module.trade.dal.mysql.delivery.DeliveryExpressMapper; @@ -170,4 +172,23 @@ public class DeliveryExpressServiceImpl implements DeliveryExpressService { return postSec.body(); } + @Override + public String doElectronicFaceSheetOrder() { + //快递100 电子面单下单api接口地址 + String url = "https://api.kuaidi100.com/label/order"; + ElectronicFaceSheet faceSheet = new ElectronicFaceSheet(); + faceSheet.setKey(""); + faceSheet.setMethod("order"); + faceSheet.setSign(""); + ElectronicFaceSheetParam sheetParam = new ElectronicFaceSheetParam(); + sheetParam.setPrintType("NON"); + sheetParam.setPartnerId(""); + faceSheet.setParam(sheetParam); + HttpResponse postSec = HttpUtil.createPost(url) + .header("Content-Type","application/x-www-form-urlencoded") + .body(faceSheet.toString()) + .execute(); + return postSec.body(); + } + } From 3b7cb6da7a28c5470197d0b4bfbb6070a1fce5fe Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=85=95=E4=B8=8B?= <484014559@qq.com> Date: Wed, 14 Aug 2024 13:44:15 +0800 Subject: [PATCH 2/6] =?UTF-8?q?=E7=BD=91=E9=A1=B5=E5=9B=BE=E6=A0=87?= =?UTF-8?q?=E4=BF=AE=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- yudao-admin-vue3/public/favicon.ico | Bin 4401 -> 4752 bytes 1 file changed, 0 insertions(+), 0 deletions(-) diff --git a/yudao-admin-vue3/public/favicon.ico b/yudao-admin-vue3/public/favicon.ico index cb16081ee8d8f9cdd15d83884b5027180473e693..31ff724a25d40bff64b0eefd0126068fbb76ebcb 100644 GIT binary patch literal 4752 zcmc&&XEz)S6BPu}d!mGBQ67Eu5+&;Dy_XC}EqW)q#S+0{ z^|E?-J-_1paA(eZo4Mznb7v+-S6h{Yke(0=3yVZuO-cVTXa5HRyvOMKZYSo=r;;w$D)vggS5xdu;CSNBR0S2bu9N z*P8drlBna>s9+EQ6(yzenx(6cP;#U!OOAST>n(2XB}+3NNFCbCnWB;zT`!U1rz_dH zeG%liSgfA%0yqU&bx*qgpD=a7)c9eDTPPHZD{$u6$=%9hsLPn0nVXI9_Y~L{^r?Qv zEm+FFjR!jESE>+*mgPBwNKq*6KfO+EC&=fkP~GopKU3me%!AkDvGA0=j?gWPm)47w z4(Ai?p-nO zetkego#v}c;LqZcM1xf@xgx$H{$AIlt%jDtbqcMa+qXeyCs;Y@%5vQAmQsYR!cOPA z?7Sa(#bmT4)K4`+xSTeQ@O7P2d9=TT&G)l?@xNM5YjrYs4Q)t48{*5EmW}VpTu;_0 zd?|6-LL;a>{1_u%8x-Vxys|^V`uYn+BmewGq>898M{A~xb){!fnd8^5q3H_V9zo4W zEnbHHELH)~i|->+i9@j>($jKe3{`aBo79gRX~k#_W#-;|E&`ksYabh`94|D>g*5OM z2O6>*zB8m)B&xvqOeY_Ton?Sz*8KdLzl-9$NP~Iw(;iY2g@)J zj8S6{QFPfCyK0Xlm}9nuy-)t5>@|57w}@;8CABjX^jQ?DD5|eylylFLyb+sZ_*pBX z^nBc%%I>eIC_R&=U{o%7=1S7v<4Sf2qn73b@uvXHeyG8sfLJ?_dziR<@49j3wttpy zi)(fLGRSxPjOLEt#!xm(&L6Ldt}^+BrJYhB5w{4ddflbrM{j>V)5`A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cmJdZo6HDA6JF3RcuqP8aNEd8A+i9enrl#Y;HDZYuQ}(Zcl9VRmtN$L--99HLYCt%gvCcM<#5qoythcEjU{pxgCv;o~zXAds6Dp!U3Gl5tUrZuTsICj2C^YE8ia zEhPhiO%m!j^I0o!)3hcT>BpKRO;TIwN~%jxCEvG9Dy5;h22eoDT!te3INscoo#nAC zMbQS^|JAlxVvotdE^T%IK}ICzauU7Pi(tI_Chv8;l)}WBZJKOnr^aN#Xxp6K(6%`n zr#Uv@-FyYo1zHe&7?l8OH-GNx6<(2)g=Uw5hzgU1!f@hhK6fLu$ZYFeCCjCQfa6UK z5KPuJfnp}Z82I8_Z~v7qgHuBrn6tYy`Scfv7L$d-RkFO!Rk9pc3YGu}D*%L!8JNK{x4#*|e-+AXZE!1g=9gpWB*R?F_fUS)3(#qYcMx764&sq)Z0bltzcU zx4tnIGbuX1S91|%Fyf|Up)gjr=5c#(W(Mtvo}-eALf|2gqNT(jz;N7_jGtow5P#;# rlnldt`lB=BZ*Tc^gr7aW008_S>IVe#4}ZHb00000NkvXXu0mjf;DtOI From 96e50b44624b2930ea8f30922b94109e48ceafd9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=85=95=E4=B8=8B?= <484014559@qq.com> Date: Wed, 14 Aug 2024 16:28:37 +0800 Subject: [PATCH 3/6] =?UTF-8?q?=E5=91=8A=E8=AD=A6=E8=AE=B0=E5=BD=95?= =?UTF-8?q?=E4=BC=98=E5=8C=96?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../yudao/module/trade/doTest/DoKDTest.java | 26 +++++++++++++++++++ .../yudao/module/system/job/WarningJob.java | 2 +- 2 files changed, 27 insertions(+), 1 deletion(-) create mode 100644 yudao-module-mall/yudao-module-trade-biz/src/test/java/cn/iocoder/yudao/module/trade/doTest/DoKDTest.java diff --git a/yudao-module-mall/yudao-module-trade-biz/src/test/java/cn/iocoder/yudao/module/trade/doTest/DoKDTest.java b/yudao-module-mall/yudao-module-trade-biz/src/test/java/cn/iocoder/yudao/module/trade/doTest/DoKDTest.java new file mode 100644 index 0000000..2248189 --- /dev/null +++ b/yudao-module-mall/yudao-module-trade-biz/src/test/java/cn/iocoder/yudao/module/trade/doTest/DoKDTest.java @@ -0,0 +1,26 @@ +package cn.iocoder.yudao.module.trade.doTest; + +import cn.hutool.http.HttpResponse; +import cn.hutool.http.HttpUtil; +import cn.iocoder.yudao.module.trade.dal.dataobject.delivery.DeliveryExpressDO; +import lombok.extern.slf4j.Slf4j; +import org.junit.jupiter.api.Test; + +@Slf4j +public class DoKDTest { + + @Test + public void test(){ + String url = "http://127.0.0.1:6127/admin-api/trade/delivery/express-template/doTest"; + DeliveryExpressDO expressDO = new DeliveryExpressDO(); + expressDO.setCode("134435"); + expressDO.setLogo("scsdc"); + expressDO.setName("jjjj"); + HttpResponse postSec = HttpUtil.createPost(url) + .header("Content-Type","application/x-www-form-urlencoded") + .header("tenant-id","1") + .body(expressDO.toString()) + .execute(); + System.out.println(postSec.body()); + } +} diff --git a/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/job/WarningJob.java b/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/job/WarningJob.java index 2ea06ca..dcce679 100644 --- a/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/job/WarningJob.java +++ b/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/job/WarningJob.java @@ -82,7 +82,7 @@ public class WarningJob implements JobHandler { OperateWarningDO spaceWarningDO = new OperateWarningDO(); spaceWarningDO.setAlarmPolicy("磁盘告警策略"); spaceWarningDO.setMonitoringObject("磁盘"); - spaceWarningDO.setTriggeringCondition("当磁盘占用率达到"+Double.parseDouble(configCountProcessCPUDo.getLabel())*100+"%"); + spaceWarningDO.setTriggeringCondition("当磁盘占用率达到"+Double.parseDouble(configCountDo.getLabel())*100+"%"); operateWarningMapper.insert(spaceWarningDO); } } catch (Exception e) { From b3850a58c577bdac90283ed0d9de2d0dcfcd760e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=85=95=E4=B8=8B?= <484014559@qq.com> Date: Fri, 16 Aug 2024 09:55:26 +0800 Subject: [PATCH 4/6] =?UTF-8?q?=E6=99=BA=E8=83=BD=E8=A1=A8=E5=8D=95?= =?UTF-8?q?=EF=BC=8C=E7=A0=8D=E4=BB=B7?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../api/mall/promotion/intelligent/index.ts | 40 +++ .../mall/promotion/intelligent/index.vue | 280 ++++++++++++++++++ .../yudao-module-promotion-biz/pom.xml | 6 + .../admin/dynamic/DynamicDataController.java | 62 ++++ .../dal/dataobject/dynamic/DynamicData.java | 27 ++ .../dal/dataobject/dynamic/DynamicForm.java | 16 + .../repository/DynamicDataRepository.java | 18 ++ .../repository/DynamicFormRepository.java | 15 + .../service/dynamic/DynamicDataService.java | 74 +++++ .../service/dynamic/DynamicFormService.java | 36 +++ .../src/main/resources/application-local.yaml | 9 + 11 files changed, 583 insertions(+) create mode 100644 yudao-admin-vue3/src/api/mall/promotion/intelligent/index.ts create mode 100644 yudao-admin-vue3/src/views/mall/promotion/intelligent/index.vue create mode 100644 yudao-module-mall/yudao-module-promotion-biz/src/main/java/cn/iocoder/yudao/module/promotion/controller/admin/dynamic/DynamicDataController.java create mode 100644 yudao-module-mall/yudao-module-promotion-biz/src/main/java/cn/iocoder/yudao/module/promotion/dal/dataobject/dynamic/DynamicData.java create mode 100644 yudao-module-mall/yudao-module-promotion-biz/src/main/java/cn/iocoder/yudao/module/promotion/dal/dataobject/dynamic/DynamicForm.java create mode 100644 yudao-module-mall/yudao-module-promotion-biz/src/main/java/cn/iocoder/yudao/module/promotion/dal/mysql/repository/DynamicDataRepository.java create mode 100644 yudao-module-mall/yudao-module-promotion-biz/src/main/java/cn/iocoder/yudao/module/promotion/dal/mysql/repository/DynamicFormRepository.java create mode 100644 yudao-module-mall/yudao-module-promotion-biz/src/main/java/cn/iocoder/yudao/module/promotion/service/dynamic/DynamicDataService.java create mode 100644 yudao-module-mall/yudao-module-promotion-biz/src/main/java/cn/iocoder/yudao/module/promotion/service/dynamic/DynamicFormService.java diff --git a/yudao-admin-vue3/src/api/mall/promotion/intelligent/index.ts b/yudao-admin-vue3/src/api/mall/promotion/intelligent/index.ts new file mode 100644 index 0000000..4287328 --- /dev/null +++ b/yudao-admin-vue3/src/api/mall/promotion/intelligent/index.ts @@ -0,0 +1,40 @@ +import request from '@/config/axios' + +export interface ArticleVO { + id: number + title: string + collectionQuantity: string + pageView: string + introduction: string + inputarr: string[] +} + +// 查询文章管理列表 +export const selectDynamicData = async () => { + return await request.get({ url: `/intelligentForm/selectDynamicData` }) +} + +// // 查询文章管理详情 +// export const saveDynamicData = async (id: number) => { +// return await request.get({ url: `/promotion/article/get?id=` + id }) +// } + +// 新增文章管理 +export const saveDynamicData = async (data: ArticleVO) => { + return await request.post({ url: `/intelligentForm/saveDynamicData`, data }) +} + +// 查询文章管理列表 +export const collectDataList = async (query: any) => { + return await request.get({ url: `/intelligentForm/collectDataList`, query }) +} + +// // 修改文章管理 +// export const updateArticle = async (data: ArticleVO) => { +// return await request.put({ url: `/promotion/article/update`, data }) +// } + +// // 删除文章管理 +// export const deleteArticle = async (id: number) => { +// return await request.delete({ url: `/promotion/article/delete?id=` + id }) +// } diff --git a/yudao-admin-vue3/src/views/mall/promotion/intelligent/index.vue b/yudao-admin-vue3/src/views/mall/promotion/intelligent/index.vue new file mode 100644 index 0000000..8e3ed48 --- /dev/null +++ b/yudao-admin-vue3/src/views/mall/promotion/intelligent/index.vue @@ -0,0 +1,280 @@ + + + + diff --git a/yudao-module-mall/yudao-module-promotion-biz/pom.xml b/yudao-module-mall/yudao-module-promotion-biz/pom.xml index a3bf649..b27e387 100644 --- a/yudao-module-mall/yudao-module-promotion-biz/pom.xml +++ b/yudao-module-mall/yudao-module-promotion-biz/pom.xml @@ -73,6 +73,12 @@ cn.iocoder.boot yudao-spring-boot-starter-excel + + + + org.springframework.boot + spring-boot-starter-data-mongodb + diff --git a/yudao-module-mall/yudao-module-promotion-biz/src/main/java/cn/iocoder/yudao/module/promotion/controller/admin/dynamic/DynamicDataController.java b/yudao-module-mall/yudao-module-promotion-biz/src/main/java/cn/iocoder/yudao/module/promotion/controller/admin/dynamic/DynamicDataController.java new file mode 100644 index 0000000..d48cb09 --- /dev/null +++ b/yudao-module-mall/yudao-module-promotion-biz/src/main/java/cn/iocoder/yudao/module/promotion/controller/admin/dynamic/DynamicDataController.java @@ -0,0 +1,62 @@ +package cn.iocoder.yudao.module.promotion.controller.admin.dynamic; + +import cn.iocoder.yudao.framework.common.pojo.CommonResult; +import cn.iocoder.yudao.module.promotion.dal.dataobject.dynamic.DynamicData; +import cn.iocoder.yudao.module.promotion.dal.dataobject.dynamic.DynamicForm; +import cn.iocoder.yudao.module.promotion.service.dynamic.DynamicDataService; +import cn.iocoder.yudao.module.promotion.service.dynamic.DynamicFormService; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.data.mongodb.core.MongoTemplate; +import org.springframework.web.bind.annotation.*; + +import javax.servlet.http.HttpServletRequest; +import java.util.ArrayList; +import java.util.List; +import java.util.Map; +import static cn.iocoder.yudao.framework.common.pojo.CommonResult.success; + +/** + * 智能表单模块 + */ + +@RestController +@RequestMapping("/intelligentForm") +public class DynamicDataController { + @Autowired + private MongoTemplate mongoTemplate; + @Autowired + private DynamicDataService dynamicDataService; + @Autowired + private DynamicFormService dynamicFormService; + + //保存数据 + @PostMapping("/saveDynamicData") + public CommonResult saveDynamicData(@RequestBody Map requestData, HttpServletRequest httpServletRequest) { + dynamicDataService.doSaveDynamicData(requestData,httpServletRequest); + return success("保存成功"); + } + + //查询全部数据 + @GetMapping("/selectDynamicData") + public CommonResult> selectDynamicData(HttpServletRequest httpServletRequest) { + return success(dynamicDataService.doSelectDynamicData(httpServletRequest)); + } + //根据id查询数据 + @GetMapping("/selectDynamicDataById") + public CommonResult selectDynamicDataById(String id){ + return success(dynamicDataService.doSelectDynamicDataById(id)); + } + + //采集数据 + @PostMapping("/collectData") + public CommonResult collectData(@RequestBody DynamicForm dynamicForm){ + dynamicFormService.doCollectData(dynamicForm); + return success("保存成功"); + } + //根据卡片id查询对应采集数据的列表 + @GetMapping("/collectDataList") + public CommonResult> collectDataList(String id){ + return success(dynamicFormService.doCollectDataList(id)); + } + +} diff --git a/yudao-module-mall/yudao-module-promotion-biz/src/main/java/cn/iocoder/yudao/module/promotion/dal/dataobject/dynamic/DynamicData.java b/yudao-module-mall/yudao-module-promotion-biz/src/main/java/cn/iocoder/yudao/module/promotion/dal/dataobject/dynamic/DynamicData.java new file mode 100644 index 0000000..0fe7025 --- /dev/null +++ b/yudao-module-mall/yudao-module-promotion-biz/src/main/java/cn/iocoder/yudao/module/promotion/dal/dataobject/dynamic/DynamicData.java @@ -0,0 +1,27 @@ +package cn.iocoder.yudao.module.promotion.dal.dataobject.dynamic; + +import lombok.Data; +import org.springframework.data.annotation.Id; +import org.springframework.data.mongodb.core.mapping.Document; + +import java.util.Map; + +@Document(collection = "dynamicData") +@Data +public class DynamicData { + @Id + private String id; + private String title; + //总浏览量 + private String pageView; + //采集数量 + private String collectionQuantity; + //创建者 + private String createPeople; + //创建时间 + private String createTime; + //租户名称 + private String tenantName; + //用户字段数据 + private Map data; +} diff --git a/yudao-module-mall/yudao-module-promotion-biz/src/main/java/cn/iocoder/yudao/module/promotion/dal/dataobject/dynamic/DynamicForm.java b/yudao-module-mall/yudao-module-promotion-biz/src/main/java/cn/iocoder/yudao/module/promotion/dal/dataobject/dynamic/DynamicForm.java new file mode 100644 index 0000000..148e572 --- /dev/null +++ b/yudao-module-mall/yudao-module-promotion-biz/src/main/java/cn/iocoder/yudao/module/promotion/dal/dataobject/dynamic/DynamicForm.java @@ -0,0 +1,16 @@ +package cn.iocoder.yudao.module.promotion.dal.dataobject.dynamic; + +import lombok.Data; +import org.springframework.data.annotation.Id; + +import java.util.Map; + +@Data +public class DynamicForm { + @Id + private String id; + //关联后台智能表单id + private String dynamicDataId; + //采集数据 + private Map map; +} diff --git a/yudao-module-mall/yudao-module-promotion-biz/src/main/java/cn/iocoder/yudao/module/promotion/dal/mysql/repository/DynamicDataRepository.java b/yudao-module-mall/yudao-module-promotion-biz/src/main/java/cn/iocoder/yudao/module/promotion/dal/mysql/repository/DynamicDataRepository.java new file mode 100644 index 0000000..f92dbfc --- /dev/null +++ b/yudao-module-mall/yudao-module-promotion-biz/src/main/java/cn/iocoder/yudao/module/promotion/dal/mysql/repository/DynamicDataRepository.java @@ -0,0 +1,18 @@ +package cn.iocoder.yudao.module.promotion.dal.mysql.repository; + +import cn.iocoder.yudao.module.promotion.dal.dataobject.dynamic.DynamicData; +import org.apache.ibatis.annotations.Mapper; +import org.bson.types.ObjectId; +import org.springframework.data.mongodb.repository.MongoRepository; +import org.springframework.data.mongodb.repository.Query; +import org.springframework.stereotype.Repository; + +import java.util.List; + +//@Repository +@Mapper +public interface DynamicDataRepository extends MongoRepository { + List findByTenantName(String tenantName); + @Query("{'_id': {'$eq': ?0}}") + DynamicData doFindById(ObjectId id); +} diff --git a/yudao-module-mall/yudao-module-promotion-biz/src/main/java/cn/iocoder/yudao/module/promotion/dal/mysql/repository/DynamicFormRepository.java b/yudao-module-mall/yudao-module-promotion-biz/src/main/java/cn/iocoder/yudao/module/promotion/dal/mysql/repository/DynamicFormRepository.java new file mode 100644 index 0000000..7aa22af --- /dev/null +++ b/yudao-module-mall/yudao-module-promotion-biz/src/main/java/cn/iocoder/yudao/module/promotion/dal/mysql/repository/DynamicFormRepository.java @@ -0,0 +1,15 @@ +package cn.iocoder.yudao.module.promotion.dal.mysql.repository; + +import cn.iocoder.yudao.module.promotion.dal.dataobject.dynamic.DynamicForm; +import org.apache.ibatis.annotations.Mapper; +import org.springframework.data.mongodb.repository.MongoRepository; +import org.springframework.stereotype.Repository; + +import java.util.List; + +//@Repository +@Mapper +public interface DynamicFormRepository extends MongoRepository { + Long countAllByDynamicDataId(String dynamicDataId); + List findByDynamicDataId(String id); +} diff --git a/yudao-module-mall/yudao-module-promotion-biz/src/main/java/cn/iocoder/yudao/module/promotion/service/dynamic/DynamicDataService.java b/yudao-module-mall/yudao-module-promotion-biz/src/main/java/cn/iocoder/yudao/module/promotion/service/dynamic/DynamicDataService.java new file mode 100644 index 0000000..08503cf --- /dev/null +++ b/yudao-module-mall/yudao-module-promotion-biz/src/main/java/cn/iocoder/yudao/module/promotion/service/dynamic/DynamicDataService.java @@ -0,0 +1,74 @@ +package cn.iocoder.yudao.module.promotion.service.dynamic; + +import cn.iocoder.yudao.module.promotion.dal.dataobject.dynamic.DynamicData; +import cn.iocoder.yudao.module.promotion.dal.mysql.repository.DynamicDataRepository; +import cn.iocoder.yudao.module.promotion.dal.mysql.repository.DynamicFormRepository; +import org.bson.types.ObjectId; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; + +import javax.servlet.http.HttpServletRequest; +import java.time.LocalDate; +import java.time.format.DateTimeFormatter; +import java.util.ArrayList; +import java.util.List; +import java.util.Map; +import static cn.iocoder.yudao.framework.web.core.util.WebFrameworkUtils.getLoginUserId; + + +@Service +public class DynamicDataService { + @Autowired + private DynamicDataRepository dynamicDataRepository; + @Autowired + private DynamicFormRepository dynamicFormRepository; + + //保存数据 + public DynamicData doSaveDynamicData(Map requestData, HttpServletRequest httpServletRequest){ + DynamicData dynamicData = new DynamicData(); + //构造数据结构 + String title = (String)requestData.get("title"); + String pageView = (String)requestData.get("pageView"); + String collectionQuantity = (String)requestData.get("collectionQuantity"); + dynamicData.setTitle(title); + requestData.remove("title"); + dynamicData.setPageView(pageView); + requestData.remove("pageView"); + dynamicData.setCollectionQuantity(collectionQuantity); + requestData.remove("collectionQuantity"); + ArrayList inputarr = (ArrayList)requestData.get("inputarr"); + for (String s : inputarr) { + requestData.put(s,null); + } + requestData.remove("inputarr"); + dynamicData.setCreatePeople(getLoginUserId(httpServletRequest).toString()); + LocalDate currentDate = LocalDate.now(); + DateTimeFormatter formatter = DateTimeFormatter.ofPattern("yyyy-MM-dd"); + String formattedDate = currentDate.format(formatter); + dynamicData.setCreateTime(formattedDate); + dynamicData.setData(requestData); + dynamicData.setTenantName(httpServletRequest.getHeader("Tenant")); + return dynamicDataRepository.save(dynamicData);//插入dynamicData数据 + } + + //查询全部数据 + public List doSelectDynamicData(HttpServletRequest httpServletRequest){ + //查询对应租户下的卡片列表数据 + List dynamicData = dynamicDataRepository.findByTenantName(httpServletRequest.getHeader("Tenant")); + for (DynamicData dynamicDatum : dynamicData) { + //查询对应卡片链接采集到数据的数量 + Long count = dynamicFormRepository.countAllByDynamicDataId(dynamicDatum.getId()); + dynamicDatum.setCollectionQuantity(count+""); + } + return dynamicData; + } + + //根据id查询数据 + public DynamicData doSelectDynamicDataById(String id){ + ObjectId objectId = new ObjectId(id); + DynamicData dynamicData = dynamicDataRepository.doFindById(objectId); + dynamicData.setPageView(Long.parseLong(dynamicData.getPageView())+1+""); + return dynamicDataRepository.save(dynamicData); + } + +} diff --git a/yudao-module-mall/yudao-module-promotion-biz/src/main/java/cn/iocoder/yudao/module/promotion/service/dynamic/DynamicFormService.java b/yudao-module-mall/yudao-module-promotion-biz/src/main/java/cn/iocoder/yudao/module/promotion/service/dynamic/DynamicFormService.java new file mode 100644 index 0000000..aacd879 --- /dev/null +++ b/yudao-module-mall/yudao-module-promotion-biz/src/main/java/cn/iocoder/yudao/module/promotion/service/dynamic/DynamicFormService.java @@ -0,0 +1,36 @@ +package cn.iocoder.yudao.module.promotion.service.dynamic; + +import cn.iocoder.yudao.module.promotion.dal.dataobject.dynamic.DynamicForm; +import cn.iocoder.yudao.module.promotion.dal.mysql.repository.DynamicFormRepository; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; + +import java.util.ArrayList; +import java.util.List; + +@Service +public class DynamicFormService { + @Autowired + private DynamicFormRepository dynamicFormRepository; + + //查询对应卡片采集数据的数量 + public Long findDynamicFormToCount(String id){ + return dynamicFormRepository.countAllByDynamicDataId(id); + } + + //采集数据 + public void doCollectData(DynamicForm dynamicForm){ + dynamicFormRepository.save(dynamicForm); + } + + //根据卡片id查询对应采集数据的列表 + public ArrayList doCollectDataList(String id){ + List dynamicForms = dynamicFormRepository.findByDynamicDataId(id); + ArrayList list = new ArrayList<>(); + for (DynamicForm dynamicForm : dynamicForms) { + list.add(dynamicForm.getMap()); + } + return list; + } + +} diff --git a/yudao-server/src/main/resources/application-local.yaml b/yudao-server/src/main/resources/application-local.yaml index 46fdb48..2539ab8 100644 --- a/yudao-server/src/main/resources/application-local.yaml +++ b/yudao-server/src/main/resources/application-local.yaml @@ -256,3 +256,12 @@ justauth: prefix: 'social_auth_state:' # 缓存前缀,目前只对 Redis 缓存生效,默认 JUSTAUTH::STATE:: timeout: 24h # 超时时长,目前只对 Redis 缓存生效,默认 3 分钟 +spring: + data: + mongodb: + uri: mongodb://root:123456@120.46.37.243:27017/admin?authMechanism=SCRAM-SHA-256 + # uri: mongodb://root:123456@101.43.112.107:27017/admin?authMechanism=SCRAM-SHA-256 + database: zy-crm + + + From e3c546bdb23cefaf0c3fdb6ae0077bed8be90b29 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=85=95=E4=B8=8B?= <484014559@qq.com> Date: Mon, 19 Aug 2024 18:03:39 +0800 Subject: [PATCH 5/6] =?UTF-8?q?=E5=85=85=E5=80=BC=E6=A8=A1=E5=9D=97?= =?UTF-8?q?=E8=B0=83=E6=95=B4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../yudao/module/pay/dal/dataobject/order/PayOrderDO.java | 2 ++ .../pay/service/wallet/PayWalletRechargeServiceImpl.java | 4 ++-- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/yudao-module-pay/yudao-module-pay-biz/src/main/java/cn/iocoder/yudao/module/pay/dal/dataobject/order/PayOrderDO.java b/yudao-module-pay/yudao-module-pay-biz/src/main/java/cn/iocoder/yudao/module/pay/dal/dataobject/order/PayOrderDO.java index a51b875..79262d0 100644 --- a/yudao-module-pay/yudao-module-pay-biz/src/main/java/cn/iocoder/yudao/module/pay/dal/dataobject/order/PayOrderDO.java +++ b/yudao-module-pay/yudao-module-pay-biz/src/main/java/cn/iocoder/yudao/module/pay/dal/dataobject/order/PayOrderDO.java @@ -6,6 +6,7 @@ import cn.iocoder.yudao.module.pay.dal.dataobject.app.PayAppDO; import cn.iocoder.yudao.module.pay.dal.dataobject.channel.PayChannelDO; import cn.iocoder.yudao.module.pay.enums.order.PayOrderStatusEnum; import com.baomidou.mybatisplus.annotation.KeySequence; +import com.baomidou.mybatisplus.annotation.TableId; import com.baomidou.mybatisplus.annotation.TableName; import lombok.*; @@ -29,6 +30,7 @@ public class PayOrderDO extends BaseDO { /** * 订单编号,数据库自增 */ + @TableId private Long id; /** * 应用编号 diff --git a/yudao-module-pay/yudao-module-pay-biz/src/main/java/cn/iocoder/yudao/module/pay/service/wallet/PayWalletRechargeServiceImpl.java b/yudao-module-pay/yudao-module-pay-biz/src/main/java/cn/iocoder/yudao/module/pay/service/wallet/PayWalletRechargeServiceImpl.java index 2de531c..ba479b2 100644 --- a/yudao-module-pay/yudao-module-pay-biz/src/main/java/cn/iocoder/yudao/module/pay/service/wallet/PayWalletRechargeServiceImpl.java +++ b/yudao-module-pay/yudao-module-pay-biz/src/main/java/cn/iocoder/yudao/module/pay/service/wallet/PayWalletRechargeServiceImpl.java @@ -47,7 +47,7 @@ public class PayWalletRechargeServiceImpl implements PayWalletRechargeService { /** * TODO 芋艿:放到 payconfig */ - private static final Long WALLET_PAY_APP_ID = 8L; + private static final Long WALLET_PAY_APP_ID = 1L; private static final String WALLET_RECHARGE_ORDER_SUBJECT = "钱包余额充值"; @@ -84,7 +84,7 @@ public class PayWalletRechargeServiceImpl implements PayWalletRechargeService { // 2.1 创建支付单 Long payOrderId = payOrderService.createOrder(new PayOrderCreateReqDTO() .setAppId(WALLET_PAY_APP_ID).setUserIp(userIp) - .setMerchantOrderId(recharge.getId().toString()) // 业务的订单编号 + .setMerchantOrderId(""+recharge.getId()) // 业务的订单编号 .setSubject(WALLET_RECHARGE_ORDER_SUBJECT).setBody("") .setPrice(recharge.getPayPrice()) .setExpireTime(addTime(Duration.ofHours(2L)))); // TODO @芋艿:支付超时时间 From 56db1a43a635d6572284fbaef9be542442d15aaf Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=85=95=E4=B8=8B?= <484014559@qq.com> Date: Tue, 20 Aug 2024 10:20:27 +0800 Subject: [PATCH 6/6] =?UTF-8?q?=E7=BA=BF=E4=B8=8A=E6=95=B0=E6=8D=AE?= =?UTF-8?q?=E5=BA=93=E8=B0=83=E6=95=B4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- yudao-server/src/main/resources/application-local.yaml | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/yudao-server/src/main/resources/application-local.yaml b/yudao-server/src/main/resources/application-local.yaml index 2539ab8..d90e6e6 100644 --- a/yudao-server/src/main/resources/application-local.yaml +++ b/yudao-server/src/main/resources/application-local.yaml @@ -47,7 +47,7 @@ spring: datasource: master: name: ruoyi-vue-pro - url: jdbc:mysql://120.46.37.243:3306/${spring.datasource.dynamic.datasource.master.name}?useSSL=false&serverTimezone=Asia/Shanghai&allowPublicKeyRetrieval=true&nullCatalogMeansCurrent=true # MySQL Connector/J 8.X 连接的示例 + url: jdbc:mysql://1.14.205.126:3306/${spring.datasource.dynamic.datasource.master.name}?useSSL=false&serverTimezone=Asia/Shanghai&allowPublicKeyRetrieval=true&nullCatalogMeansCurrent=true # MySQL Connector/J 8.X 连接的示例 # url: jdbc:mysql://127.0.0.1:3306/${spring.datasource.dynamic.datasource.master.name}?useSSL=false&serverTimezone=Asia/Shanghai&allowPublicKeyRetrieval=true&nullCatalogMeansCurrent=true # MySQL Connector/J 8.X 连接的示例 # url: jdbc:mysql://127.0.0.1:3306/ruoyi-vue-pro?useSSL=true&allowPublicKeyRetrieval=true&useUnicode=true&characterEncoding=UTF-8&serverTimezone=Asia/Shanghai # MySQL Connector/J 5.X 连接的示例 # url: jdbc:postgresql://127.0.0.1:5432/ruoyi-vue-pro # PostgreSQL 连接的示例 @@ -73,7 +73,8 @@ spring: # Redis 配置。Redisson 默认的配置足够使用,一般不需要进行调优 redis: - host: 120.46.37.243 # 地址 + host: 1.14.205.126 # 地址 +# host: 120.46.37.243 # 地址 # host: 124.70.1.134 # 地址 # host: 127.0.0.1 # 地址 port: 6379 # 端口