From 5a660ffa4ba2db7d808a59037834e076969e4082 Mon Sep 17 00:00:00 2001 From: liupopo Date: Tue, 11 Apr 2023 10:45:49 +0800 Subject: [PATCH 1/4] sql --- docs/databases/table_modify.sql | 1 + .../InTransitCheckVo.java | 12 ++- .../customer/biz/gdinstorage/GdInstorage.java | 75 ++++++++++++++++ .../biz/gdinstorage/GdInstorageMapper.java | 58 +++++++++++++ .../biz/gdinstorage/GdInstorageRest.java | 58 +++++++++++++ .../biz/gdinstorage/GdInstorageService.java | 85 +++++++++++++++++++ .../customer/biz/gdinstorage/GdRukuQuery.java | 47 ++++++++++ .../PurchaseRequisitionMapper.java | 6 +- .../SupplierBankInfoService.java | 14 ++- 9 files changed, 351 insertions(+), 5 deletions(-) create mode 100644 yxt_supervise/supervise-customer/supervise-customer-biz/src/main/java/com/yxt/supervise/customer/biz/gdinstorage/GdInstorage.java create mode 100644 yxt_supervise/supervise-customer/supervise-customer-biz/src/main/java/com/yxt/supervise/customer/biz/gdinstorage/GdInstorageMapper.java create mode 100644 yxt_supervise/supervise-customer/supervise-customer-biz/src/main/java/com/yxt/supervise/customer/biz/gdinstorage/GdInstorageRest.java create mode 100644 yxt_supervise/supervise-customer/supervise-customer-biz/src/main/java/com/yxt/supervise/customer/biz/gdinstorage/GdInstorageService.java create mode 100644 yxt_supervise/supervise-customer/supervise-customer-biz/src/main/java/com/yxt/supervise/customer/biz/gdinstorage/GdRukuQuery.java diff --git a/docs/databases/table_modify.sql b/docs/databases/table_modify.sql index 50a5f8d7..e8091fba 100644 --- a/docs/databases/table_modify.sql +++ b/docs/databases/table_modify.sql @@ -33,3 +33,4 @@ ALTER TABLE supervise_supplychain.purchase_requisition_pro ADD distributionAmoun ALTER TABLE supervise_supplychain.purchase_requisition_pro ADD preqCode varchar(100) DEFAULT NULL COMMENT '订单编号'; +ALTER TABLE supervise_supplychain.purchase_requisition_pro MODIFY COLUMN packageTotalPrice double(12,2) NULL COMMENT '包合计(元)(对应采购订单中的送货金额)'; diff --git a/yxt_supervise/supervise-customer/supervise-customer-api/src/main/java/com/yxt/supervise/customer/api/purchaserequisitionpro/InTransitCheckVo.java b/yxt_supervise/supervise-customer/supervise-customer-api/src/main/java/com/yxt/supervise/customer/api/purchaserequisitionpro/InTransitCheckVo.java index 38c52534..3d9f61ca 100644 --- a/yxt_supervise/supervise-customer/supervise-customer-api/src/main/java/com/yxt/supervise/customer/api/purchaserequisitionpro/InTransitCheckVo.java +++ b/yxt_supervise/supervise-customer/supervise-customer-api/src/main/java/com/yxt/supervise/customer/api/purchaserequisitionpro/InTransitCheckVo.java @@ -5,13 +5,13 @@ public class InTransitCheckVo { public InTransitCheckVo() { } - public InTransitCheckVo(String supplierOnlyCode ) { + public InTransitCheckVo(String supplierOnlyCode) { this.supplierOnlyCode = supplierOnlyCode; // this.supplierName = supplierName; } private String supplierOnlyCode; -// private String supplierName; + // private String supplierName; private double orderAmount = 0.0; private double instorageAmount = 0.0; @@ -46,4 +46,12 @@ public class InTransitCheckVo { public void setInstorageAmount(double instorageAmount) { this.instorageAmount = instorageAmount; } + + public boolean getHasInTransit() { + return this.getOrderAmount() > this.getInstorageAmount(); + } + + public double getAmountOfInTransit() { + return this.getOrderAmount() - this.getInstorageAmount(); + } } diff --git a/yxt_supervise/supervise-customer/supervise-customer-biz/src/main/java/com/yxt/supervise/customer/biz/gdinstorage/GdInstorage.java b/yxt_supervise/supervise-customer/supervise-customer-biz/src/main/java/com/yxt/supervise/customer/biz/gdinstorage/GdInstorage.java new file mode 100644 index 00000000..216ae474 --- /dev/null +++ b/yxt_supervise/supervise-customer/supervise-customer-biz/src/main/java/com/yxt/supervise/customer/biz/gdinstorage/GdInstorage.java @@ -0,0 +1,75 @@ +/********************************************************* + ********************************************************* + ******************** ******************* + ************* ************ + ******* _oo0oo_ ******* + *** o8888888o *** + * 88" . "88 * + * (| -_- |) * + * 0\ = /0 * + * ___/`---'\___ * + * .' \\| |// '. * + * / \\||| : |||// \ * + * / _||||| -:- |||||- \ * + * | | \\\ - /// | | * + * | \_| ''\---/'' |_/ | * + * \ .-\__ '-' ___/-. / * + * ___'. .' /--.--\ `. .'___ * + * ."" '< `.___\_<|>_/___.' >' "". * + * | | : `- \`.;`\ _ /`;.`/ - ` : | | * + * \ \ `_. \_ __\ /__ _/ .-` / / * + * =====`-.____`.___ \_____/___.-`___.-'===== * + * `=---=' * + * ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ * + *********__佛祖保佑__永无BUG__验收通过__钞票多多__********* + *********************************************************/ +package com.yxt.supervise.customer.biz.gdinstorage; + +import com.baomidou.mybatisplus.annotation.TableName; +import com.yxt.common.core.domain.EntityWithId; +import lombok.Data; + +/** + * Project: yxt_supervise
+ * File: GdInstorage.java
+ * Class: com.yxt.supervise.portal.biz.gdinstorage.GdInstorage
+ * Description: <描述类的功能>.
+ * Copyright: Copyright (c) 2011
+ * Company: https://gitee.com/liuzp315
+ * Makedate: 2022/12/3 0:57
+ * + * @author liupopo + * @version 1.0 + * @since 1.0 + */ +@Data +@TableName("gd_instorage") +public class GdInstorage extends EntityWithId { + + private String cola0; // 企业组织机构代码证 + private String colb1; // 仓库/门店编号 + private String colc2; // 仓库/门店名称 + private String cold3; // 入库时间 + private String colex; // 供应商编号 + private String cole4; // 供应商名称 + private String colf5; // 单据号 + private String colg6; // 单据类型 + private String colh7; // 货号 + private String coli8; // 商品名称 + private String colj9; // 商品生产日期 + private String colk10; // 商品保质期 + private String coll11; // 商品规格 + private String colm12; // 类别编号 + private String coln13; // 类别名称 + private String colo14; // 一级类别名称 + private String colp15; // 二级类别名称 + private String colq16; // 入库金额 + private String colr17; // 入库数量 + private String cols18; // 成本金额 + private String colt19; // 成本税额 + private String colu20; // 不含税成本 + private String colv21; // 进项税率 + private String orderDate; // 单据日期 + private String supplierCodeUnified; // 供货商编码统一 + private String inOrderNo; // 入库定单号 +} diff --git a/yxt_supervise/supervise-customer/supervise-customer-biz/src/main/java/com/yxt/supervise/customer/biz/gdinstorage/GdInstorageMapper.java b/yxt_supervise/supervise-customer/supervise-customer-biz/src/main/java/com/yxt/supervise/customer/biz/gdinstorage/GdInstorageMapper.java new file mode 100644 index 00000000..5a6823d1 --- /dev/null +++ b/yxt_supervise/supervise-customer/supervise-customer-biz/src/main/java/com/yxt/supervise/customer/biz/gdinstorage/GdInstorageMapper.java @@ -0,0 +1,58 @@ +/********************************************************* + ********************************************************* + ******************** ******************* + ************* ************ + ******* _oo0oo_ ******* + *** o8888888o *** + * 88" . "88 * + * (| -_- |) * + * 0\ = /0 * + * ___/`---'\___ * + * .' \\| |// '. * + * / \\||| : |||// \ * + * / _||||| -:- |||||- \ * + * | | \\\ - /// | | * + * | \_| ''\---/'' |_/ | * + * \ .-\__ '-' ___/-. / * + * ___'. .' /--.--\ `. .'___ * + * ."" '< `.___\_<|>_/___.' >' "". * + * | | : `- \`.;`\ _ /`;.`/ - ` : | | * + * \ \ `_. \_ __\ /__ _/ .-` / / * + * =====`-.____`.___ \_____/___.-`___.-'===== * + * `=---=' * + * ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ * + *********__佛祖保佑__永无BUG__验收通过__钞票多多__********* + *********************************************************/ +package com.yxt.supervise.customer.biz.gdinstorage; + +import com.baomidou.mybatisplus.core.mapper.BaseMapper; +import org.apache.ibatis.annotations.Delete; +import org.apache.ibatis.annotations.Mapper; +import org.apache.ibatis.annotations.Param; +import org.apache.ibatis.annotations.Select; + +/** + * Project: yxt_supervise
+ * File: GdInstorageMapper.java
+ * Class: com.yxt.supervise.portal.biz.gdinstorage.GdInstorageMapper
+ * Description: <描述类的功能>.
+ * Copyright: Copyright (c) 2011
+ * Company: https://gitee.com/liuzp315
+ * Makedate: 2022/12/3 1:02
+ * + * @author liupopo + * @version 1.0 + * @since 1.0 + */ +@Mapper +public interface GdInstorageMapper extends BaseMapper { + + @Delete("delete from gd_instorage where orderDate=#{orderDate} ") + void clearByOrderDate(@Param("orderDate") String orderDate); + + @Select("select CONVERT(IFNULL(sum(colq16),0),DECIMAL(12,2)) as amount from gd_instorage where orderDate=#{orderDate}") + double amountOfDay(@Param("orderDate") String orderDate); + + @Select("select CONVERT(IFNULL(sum(colq16),0),DECIMAL(12,2)) as amount from gd_instorage where supplierCodeUnified=#{supplierCodeUnified}") + double amountOfSupplier(@Param("supplierCodeUnified") String supplierOnlyCode); +} diff --git a/yxt_supervise/supervise-customer/supervise-customer-biz/src/main/java/com/yxt/supervise/customer/biz/gdinstorage/GdInstorageRest.java b/yxt_supervise/supervise-customer/supervise-customer-biz/src/main/java/com/yxt/supervise/customer/biz/gdinstorage/GdInstorageRest.java new file mode 100644 index 00000000..147f2f56 --- /dev/null +++ b/yxt_supervise/supervise-customer/supervise-customer-biz/src/main/java/com/yxt/supervise/customer/biz/gdinstorage/GdInstorageRest.java @@ -0,0 +1,58 @@ +/********************************************************* + ********************************************************* + ******************** ******************* + ************* ************ + ******* _oo0oo_ ******* + *** o8888888o *** + * 88" . "88 * + * (| -_- |) * + * 0/ = /0 * + * ___/`---'/___ * + * .' /| |// '. * + * / /||| : |||// / * + * / _||||| -:- |||||- / * + * | | // - /// | | * + * | /_| ''/---/'' |_/ | * + * / .-/__ '-' ___/-. / * + * ___'. .' /--.--/ `. .'___ * + * ."" '< `.___/_<|>_/___.' >' "". * + * | | : `- /`.;`/ _ /`;.`/ - ` : | | * + * / / `_. /_ __/ /__ _/ .-` / / * + * =====`-.____`.___ /_____/___.-`___.-'===== * + * `=---=' * + * ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ * + *********__佛祖保佑__永无BUG__验收通过__钞票多多__********* + *********************************************************/ +package com.yxt.supervise.customer.biz.gdinstorage; + +import cn.hutool.core.util.StrUtil; +import com.yxt.common.core.query.PagerQuery; +import com.yxt.common.core.result.ResultBean; +import com.yxt.common.core.vo.PagerVo; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.web.bind.annotation.*; +import org.springframework.web.multipart.MultipartFile; + +import java.util.List; + +/** + * Project: yxt_supervise
+ * File: GdInstorageRest.java
+ * Class: com.yxt.supervise.portal.biz.gdinstorage.GdInstorageRest
+ * Description: <描述类的功能>.
+ * Copyright: Copyright (c) 2011
+ * Company: https://gitee.com/liuzp315
+ * Makedate: 2022/12/3 1:08
+ * + * @author liupopo + * @version 1.0 + * @since 1.0 + */ +@RestController("com.yxt.supervise.portal.biz.gdinstorage.GdInstorageRest") +@RequestMapping("/ruku") +public class GdInstorageRest { + + @Autowired + private GdInstorageService gdInstorageService; + +} diff --git a/yxt_supervise/supervise-customer/supervise-customer-biz/src/main/java/com/yxt/supervise/customer/biz/gdinstorage/GdInstorageService.java b/yxt_supervise/supervise-customer/supervise-customer-biz/src/main/java/com/yxt/supervise/customer/biz/gdinstorage/GdInstorageService.java new file mode 100644 index 00000000..ac878957 --- /dev/null +++ b/yxt_supervise/supervise-customer/supervise-customer-biz/src/main/java/com/yxt/supervise/customer/biz/gdinstorage/GdInstorageService.java @@ -0,0 +1,85 @@ +/********************************************************* + ********************************************************* + ******************** ******************* + ************* ************ + ******* _oo0oo_ ******* + *** o8888888o *** + * 88" . "88 * + * (| -_- |) * + * 0\ = /0 * + * ___/`---'\___ * + * .' \\| |// '. * + * / \\||| : |||// \ * + * / _||||| -:- |||||- \ * + * | | \\\ - /// | | * + * | \_| ''\---/'' |_/ | * + * \ .-\__ '-' ___/-. / * + * ___'. .' /--.--\ `. .'___ * + * ."" '< `.___\_<|>_/___.' >' "". * + * | | : `- \`.;`\ _ /`;.`/ - ` : | | * + * \ \ `_. \_ __\ /__ _/ .-` / / * + * =====`-.____`.___ \_____/___.-`___.-'===== * + * `=---=' * + * ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ * + *********__佛祖保佑__永无BUG__验收通过__钞票多多__********* + *********************************************************/ +package com.yxt.supervise.customer.biz.gdinstorage; + +import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; +import com.baomidou.mybatisplus.core.metadata.IPage; +import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; +import com.yxt.common.base.config.component.FileUploadComponent; +import com.yxt.common.base.utils.PagerUtil; +import com.yxt.common.core.query.PagerQuery; +import com.yxt.common.core.vo.PagerVo; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; + +/** + * Project: yxt_supervise
+ * File: GdInstorageService.java
+ * Class: com.yxt.supervise.portal.biz.gdinstorage.GdInstorageService
+ * Description: <描述类的功能>.
+ * Copyright: Copyright (c) 2011
+ * Company: https://gitee.com/liuzp315
+ * Makedate: 2022/12/3 1:02
+ * + * @author liupopo + * @version 1.0 + * @since 1.0 + */ +@Service +public class GdInstorageService extends ServiceImpl { + + @Autowired + private FileUploadComponent fileUploadComponent; + + public PagerVo listPageVo(PagerQuery pq) { + + GdRukuQuery query = pq.getParams(); + QueryWrapper qw = new QueryWrapper<>(); + qw.orderByDesc("orderDate"); + IPage page = PagerUtil.queryToPage(pq); + IPage pagging = baseMapper.selectPage(page, qw); + PagerVo p = PagerUtil.pageToVo(pagging, null); + return p; + } + + public void clearByOrderDate(String orderDate) { + baseMapper.clearByOrderDate(orderDate); + } + + /** + * 112仓某一天的入库金额 + * + * @param orderDate + * @return + */ + public double amountOfDay(String orderDate) { + return baseMapper.amountOfDay(orderDate); + } + + public double amountOfSupplier(String supplierOnlyCode) { + return baseMapper.amountOfSupplier(supplierOnlyCode); + } +} diff --git a/yxt_supervise/supervise-customer/supervise-customer-biz/src/main/java/com/yxt/supervise/customer/biz/gdinstorage/GdRukuQuery.java b/yxt_supervise/supervise-customer/supervise-customer-biz/src/main/java/com/yxt/supervise/customer/biz/gdinstorage/GdRukuQuery.java new file mode 100644 index 00000000..915e0cf3 --- /dev/null +++ b/yxt_supervise/supervise-customer/supervise-customer-biz/src/main/java/com/yxt/supervise/customer/biz/gdinstorage/GdRukuQuery.java @@ -0,0 +1,47 @@ +/********************************************************* + ********************************************************* + ******************** ******************* + ************* ************ + ******* _oo0oo_ ******* + *** o8888888o *** + * 88" . "88 * + * (| -_- |) * + * 0\ = /0 * + * ___/`---'\___ * + * .' \\| |// '. * + * / \\||| : |||// \ * + * / _||||| -:- |||||- \ * + * | | \\\ - /// | | * + * | \_| ''\---/'' |_/ | * + * \ .-\__ '-' ___/-. / * + * ___'. .' /--.--\ `. .'___ * + * ."" '< `.___\_<|>_/___.' >' "". * + * | | : `- \`.;`\ _ /`;.`/ - ` : | | * + * \ \ `_. \_ __\ /__ _/ .-` / / * + * =====`-.____`.___ \_____/___.-`___.-'===== * + * `=---=' * + * ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ * + *********__佛祖保佑__永无BUG__验收通过__钞票多多__********* + *********************************************************/ +package com.yxt.supervise.customer.biz.gdinstorage; + +import com.yxt.common.core.query.Query; +import lombok.Data; + +/** + * Project: yxt_supervise
+ * File: GdRukuQuery.java
+ * Class: com.yxt.supervise.portal.biz.gdinstorage.GdRukuQuery
+ * Description: <描述类的功能>.
+ * Copyright: Copyright (c) 2011
+ * Company: https://gitee.com/liuzp315
+ * Makedate: 2022/12/10 21:15
+ * + * @author liupopo + * @version 1.0 + * @since 1.0 + */ +@Data +public class GdRukuQuery implements Query { + private String orderDate; +} diff --git a/yxt_supervise/supervise-customer/supervise-customer-biz/src/main/java/com/yxt/supervise/customer/biz/purchaserequisition/PurchaseRequisitionMapper.java b/yxt_supervise/supervise-customer/supervise-customer-biz/src/main/java/com/yxt/supervise/customer/biz/purchaserequisition/PurchaseRequisitionMapper.java index 3eaf5012..a0400b5a 100644 --- a/yxt_supervise/supervise-customer/supervise-customer-biz/src/main/java/com/yxt/supervise/customer/biz/purchaserequisition/PurchaseRequisitionMapper.java +++ b/yxt_supervise/supervise-customer/supervise-customer-biz/src/main/java/com/yxt/supervise/customer/biz/purchaserequisition/PurchaseRequisitionMapper.java @@ -28,6 +28,8 @@ public interface PurchaseRequisitionMapper extends BaseMapper selectPageVo(IPage page, @Param(Constants.WRAPPER) Wrapper qw); //查询导出的数据 List exportExcel(@Param(Constants.WRAPPER) Wrapper qw); - @Select("") - double amountBySupplierOnlyCode(@Param("") String supplierOnlyCode); + @Select("select sum(packageTotalPrice) amount from purchase_requisition_pro prp " + + "left join purchase_requisition pr on pr.sid =prp.mainSid " + + "where pr.purchaseState=1 and pr.bankState=1 and pr.supplierOnlyCode=#{supplierOnlyCode}") + double amountBySupplierOnlyCode(@Param("supplierOnlyCode") String supplierOnlyCode); } diff --git a/yxt_supervise/supervise-customer/supervise-customer-biz/src/main/java/com/yxt/supervise/customer/biz/supplierbankinfo/SupplierBankInfoService.java b/yxt_supervise/supervise-customer/supervise-customer-biz/src/main/java/com/yxt/supervise/customer/biz/supplierbankinfo/SupplierBankInfoService.java index fb171eac..1712fb51 100644 --- a/yxt_supervise/supervise-customer/supervise-customer-biz/src/main/java/com/yxt/supervise/customer/biz/supplierbankinfo/SupplierBankInfoService.java +++ b/yxt_supervise/supervise-customer/supervise-customer-biz/src/main/java/com/yxt/supervise/customer/biz/supplierbankinfo/SupplierBankInfoService.java @@ -38,6 +38,7 @@ import com.yxt.supervise.customer.api.purchaserequisitionpro.InTransitCheckVo; import com.yxt.supervise.customer.api.supplierbankinfo.*; import com.yxt.supervise.customer.api.suppliercontractinfo.SupplierContractInfoDto; import com.yxt.supervise.customer.api.supplierindex.SupplierIndex; +import com.yxt.supervise.customer.biz.gdinstorage.GdInstorageService; import com.yxt.supervise.customer.biz.purchaserequisition.PurchaseRequisitionService; import com.yxt.supervise.customer.biz.suppliercontractinfo.SupplierContractInfoService; import com.yxt.supervise.customer.biz.supplierindex.SupplierIndexService; @@ -70,6 +71,8 @@ public class SupplierBankInfoService extends MybatisBaseService createQueryWrapper(SupplierBankInfoQuery query) { // todo: 这里根据具体业务调整查询条件 @@ -260,7 +263,15 @@ public class SupplierBankInfoService extends MybatisBaseService Date: Tue, 11 Apr 2023 11:08:25 +0800 Subject: [PATCH 2/4] =?UTF-8?q?sql=E8=84=9A=E6=9C=AC=E6=B7=BB=E5=8A=A0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- docs/databases/table_create.sql | 46 ++++++++++++++++++++++++++++++++- docs/databases/table_modify.sql | 2 +- 2 files changed, 46 insertions(+), 2 deletions(-) diff --git a/docs/databases/table_create.sql b/docs/databases/table_create.sql index fb42596f..2ce72046 100644 --- a/docs/databases/table_create.sql +++ b/docs/databases/table_create.sql @@ -20,4 +20,48 @@ CREATE TABLE `purchase_requisition_checked` ( `billType` VARCHAR(100) NULL DEFAULT NULL COMMENT '单据类型', PRIMARY KEY (`id`) USING BTREE -) ENGINE=InnoDB COMMENT='采购订单检查结果'; \ No newline at end of file +) ENGINE=InnoDB COMMENT='采购订单检查结果'; + + +DROP TABLE IF EXISTS `wechat_template`; +CREATE TABLE `wechat_template` ( + `id` int(0) NOT NULL AUTO_INCREMENT COMMENT 'ID,唯一编号', + `sid` varchar(64) CHARACTER SET latin1 COLLATE latin1_swedish_ci NOT NULL, + `templateId` varchar(100) CHARACTER SET latin1 COLLATE latin1_swedish_ci NOT NULL COMMENT '模板ID', + `title` varchar(255) CHARACTER SET latin1 COLLATE latin1_swedish_ci NULL DEFAULT NULL COMMENT '标题', + `json` json NULL COMMENT 'json', + `trade` varchar(255) CHARACTER SET latin1 COLLATE latin1_swedish_ci NULL DEFAULT NULL COMMENT '行业', + `lockVersion` VARCHAR(2) NULL DEFAULT NULL COMMENT '记录版本,锁', + `createTime` timestamp NULL DEFAULT CURRENT_TIMESTAMP COMMENT '记录创建时间', + `modifyTime` TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP COMMENT '记录最后修改时间', + `state` INT(11) NOT NULL DEFAULT '1' COMMENT '记录状态值', + `isEnable` INT(32) NOT NULL DEFAULT '1' COMMENT '记录是否可用,1:可用,0:不可用', + `isDelete` INT(32) NOT NULL DEFAULT '0' COMMENT '记录是否被删除,0:未删除,1:已经删除', + `remarks` VARCHAR(255) NULL DEFAULT NULL COMMENT '备注信息', + `createBySid` VARCHAR(64) NULL DEFAULT NULL COMMENT '创建者', + `updateBySid` VARCHAR(64) NULL DEFAULT NULL COMMENT '更新者', + PRIMARY KEY (`id`) USING BTREE +) ENGINE = InnoDB AUTO_INCREMENT = 2 CHARACTER SET = latin1 COLLATE = latin1_swedish_ci COMMENT = '微信信息推送模版表' ROW_FORMAT = Dynamic; + +SET FOREIGN_KEY_CHECKS = 1; + + +DROP TABLE IF EXISTS `template_staff_config`; +CREATE TABLE `template_staff_config` ( + `id` int(0) NOT NULL AUTO_INCREMENT, + `sid` varchar(100) CHARACTER SET latin1 COLLATE latin1_swedish_ci NOT NULL, + `templateSid` varchar(100) CHARACTER SET latin1 COLLATE latin1_swedish_ci NULL DEFAULT NULL COMMENT '模板sid', + `staffSid` varchar(100) CHARACTER SET latin1 COLLATE latin1_swedish_ci NULL DEFAULT NULL COMMENT '员工sid', + `lockVersion` int(0) NOT NULL DEFAULT 0 COMMENT '记录版本,锁', + `createTime` timestamp(0) NOT NULL DEFAULT CURRENT_TIMESTAMP(0) COMMENT '记录创建时间', + `modifyTime` timestamp(0) NOT NULL DEFAULT CURRENT_TIMESTAMP(0) COMMENT '记录最后修改时间', + `isEnable` int(0) NOT NULL DEFAULT 1 COMMENT '记录是否可用,1:可用,0:不可用', + `state` int(0) NULL DEFAULT 1 COMMENT '隐藏本部门:隐藏本部门开启后,本部门将不会显示在公司通讯录中', + `isDelete` int(0) NULL DEFAULT NULL COMMENT '记录是否被删除,0:未删除,1:已经删除', + `remarks` varchar(255) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '备注信息', + `createBySid` varchar(64) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '创建者', + `updateBySid` varchar(64) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '更新者', + PRIMARY KEY (`id`) USING BTREE +) ENGINE = InnoDB AUTO_INCREMENT = 1 CHARACTER SET = latin1 COLLATE = latin1_swedish_ci ROW_FORMAT = Dynamic; + +SET FOREIGN_KEY_CHECKS = 1; \ No newline at end of file diff --git a/docs/databases/table_modify.sql b/docs/databases/table_modify.sql index e8091fba..20989fc1 100644 --- a/docs/databases/table_modify.sql +++ b/docs/databases/table_modify.sql @@ -31,6 +31,6 @@ ALTER TABLE supervise_supplychain.purchase_requisition_pro ADD remarks varchar(2 ALTER TABLE supervise_supplychain.purchase_requisition_pro ADD taxInclusiveAmount DOUBLE(12,2) DEFAULT NULL COMMENT '含税金额'; ALTER TABLE supervise_supplychain.purchase_requisition_pro ADD distributionAmount DOUBLE(12,2) DEFAULT NULL COMMENT '配货金额'; ALTER TABLE supervise_supplychain.purchase_requisition_pro ADD preqCode varchar(100) DEFAULT NULL COMMENT '订单编号'; - +ALTER TABLE yxt_portal.sys_staffinfo ADD openId varchar(100) DEFAULT NULL COMMENT '微信openId'; ALTER TABLE supervise_supplychain.purchase_requisition_pro MODIFY COLUMN packageTotalPrice double(12,2) NULL COMMENT '包合计(元)(对应采购订单中的送货金额)'; From 17dddd5c4590b1639f9a30acfb59b3f0adc9244c Mon Sep 17 00:00:00 2001 From: wangpengfei <1928057482@qq.com> Date: Tue, 11 Apr 2023 11:24:30 +0800 Subject: [PATCH 3/4] =?UTF-8?q?sql=E8=84=9A=E6=9C=AC=E4=BF=AE=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- docs/databases/table_create.sql | 48 ++++++++++++++++----------------- 1 file changed, 24 insertions(+), 24 deletions(-) diff --git a/docs/databases/table_create.sql b/docs/databases/table_create.sql index 2ce72046..a6a7c0d7 100644 --- a/docs/databases/table_create.sql +++ b/docs/databases/table_create.sql @@ -23,29 +23,6 @@ CREATE TABLE `purchase_requisition_checked` ( ) ENGINE=InnoDB COMMENT='采购订单检查结果'; -DROP TABLE IF EXISTS `wechat_template`; -CREATE TABLE `wechat_template` ( - `id` int(0) NOT NULL AUTO_INCREMENT COMMENT 'ID,唯一编号', - `sid` varchar(64) CHARACTER SET latin1 COLLATE latin1_swedish_ci NOT NULL, - `templateId` varchar(100) CHARACTER SET latin1 COLLATE latin1_swedish_ci NOT NULL COMMENT '模板ID', - `title` varchar(255) CHARACTER SET latin1 COLLATE latin1_swedish_ci NULL DEFAULT NULL COMMENT '标题', - `json` json NULL COMMENT 'json', - `trade` varchar(255) CHARACTER SET latin1 COLLATE latin1_swedish_ci NULL DEFAULT NULL COMMENT '行业', - `lockVersion` VARCHAR(2) NULL DEFAULT NULL COMMENT '记录版本,锁', - `createTime` timestamp NULL DEFAULT CURRENT_TIMESTAMP COMMENT '记录创建时间', - `modifyTime` TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP COMMENT '记录最后修改时间', - `state` INT(11) NOT NULL DEFAULT '1' COMMENT '记录状态值', - `isEnable` INT(32) NOT NULL DEFAULT '1' COMMENT '记录是否可用,1:可用,0:不可用', - `isDelete` INT(32) NOT NULL DEFAULT '0' COMMENT '记录是否被删除,0:未删除,1:已经删除', - `remarks` VARCHAR(255) NULL DEFAULT NULL COMMENT '备注信息', - `createBySid` VARCHAR(64) NULL DEFAULT NULL COMMENT '创建者', - `updateBySid` VARCHAR(64) NULL DEFAULT NULL COMMENT '更新者', - PRIMARY KEY (`id`) USING BTREE -) ENGINE = InnoDB AUTO_INCREMENT = 2 CHARACTER SET = latin1 COLLATE = latin1_swedish_ci COMMENT = '微信信息推送模版表' ROW_FORMAT = Dynamic; - -SET FOREIGN_KEY_CHECKS = 1; - - DROP TABLE IF EXISTS `template_staff_config`; CREATE TABLE `template_staff_config` ( `id` int(0) NOT NULL AUTO_INCREMENT, @@ -62,6 +39,29 @@ CREATE TABLE `template_staff_config` ( `createBySid` varchar(64) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '创建者', `updateBySid` varchar(64) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '更新者', PRIMARY KEY (`id`) USING BTREE -) ENGINE = InnoDB AUTO_INCREMENT = 1 CHARACTER SET = latin1 COLLATE = latin1_swedish_ci ROW_FORMAT = Dynamic; +) ENGINE = InnoDB AUTO_INCREMENT = 1 CHARACTER SET = utf8 COLLATE = utf8_croatian_ci ROW_FORMAT = Dynamic; + +SET FOREIGN_KEY_CHECKS = 1; + + +DROP TABLE IF EXISTS `wechat_template`; +CREATE TABLE `wechat_template` ( + `id` int(0) NOT NULL, + `sid` varchar(64) CHARACTER SET utf8 COLLATE utf8_croatian_ci NOT NULL, + `templateId` varchar(100) CHARACTER SET utf8 COLLATE utf8_croatian_ci NOT NULL COMMENT '模板ID', + `title` varchar(255) CHARACTER SET utf8 COLLATE utf8_croatian_ci NULL DEFAULT NULL COMMENT '标题', + `json` json NULL COMMENT 'json', + `trade` varchar(255) CHARACTER SET utf8 COLLATE utf8_croatian_ci NULL DEFAULT NULL COMMENT '行业', + `lockVersion` int(0) NOT NULL DEFAULT 0 COMMENT '记录版本,锁', + `createTime` timestamp(0) NOT NULL DEFAULT CURRENT_TIMESTAMP(0) COMMENT '记录创建时间', + `modifyTime` timestamp(0) NOT NULL DEFAULT CURRENT_TIMESTAMP(0) COMMENT '记录最后修改时间', + `isEnable` int(0) NOT NULL DEFAULT 1 COMMENT '记录是否可用,1:可用,0:不可用', + `state` int(0) NULL DEFAULT 1 COMMENT '隐藏本部门:隐藏本部门开启后,本部门将不会显示在公司通讯录中', + `isDelete` int(0) NULL DEFAULT NULL COMMENT '记录是否被删除,0:未删除,1:已经删除', + `remarks` varchar(255) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '备注信息', + `createBySid` varchar(64) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '创建者', + `updateBySid` varchar(64) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '更新者', + PRIMARY KEY (`id`) USING BTREE +) ENGINE = InnoDB AUTO_INCREMENT = 2 CHARACTER SET = utf8 COLLATE = utf8_croatian_ci COMMENT = '微信信息推送模版表' ROW_FORMAT = Dynamic; SET FOREIGN_KEY_CHECKS = 1; \ No newline at end of file From 5250e60ceccfd1e3396e8a1996c859dbef688089 Mon Sep 17 00:00:00 2001 From: wangpengfei <1928057482@qq.com> Date: Tue, 11 Apr 2023 18:22:48 +0800 Subject: [PATCH 4/4] =?UTF-8?q?=E5=BE=AE=E4=BF=A1=E6=B6=88=E6=81=AF?= =?UTF-8?q?=E6=A8=A1=E7=89=88=E6=8E=A5=E5=8F=A3=E3=80=81=E8=B4=B7=E6=AC=BE?= =?UTF-8?q?=E9=93=B6=E8=A1=8C=E4=BF=A1=E6=81=AF=E6=8E=A5=E5=8F=A3=E3=80=81?= =?UTF-8?q?=E6=B7=BB=E5=8A=A0sql=E8=84=9A=E6=9C=AC?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- docs/databases/table_create.sql | 53 +++++++++++++- .../LoanBankInformation.java | 35 +++++++++ .../LoanBankInformationDetailsVo.java | 37 ++++++++++ .../LoanBankInformationDto.java | 37 ++++++++++ .../LoanBankInformationFeign.java | 29 ++++++++ .../LoanBankInformationFeignFallback.java | 20 ++++++ .../LoanBankInformationQuery.java | 37 ++++++++++ .../LoanBankInformationVo.java | 37 ++++++++++ .../LoanBankInformationMapper.java | 23 ++++++ .../LoanBankInformationMapper.xml | 20 ++++++ .../LoanBankInformationRest.java | 54 ++++++++++++++ .../LoanBankInformationService.java | 65 +++++++++++++++++ .../api/wechattemplate/WechatTemplateDto.java | 9 ++- .../wechattemplate/WechatTemplateQuery.java | 2 +- .../api/wechattemplate/WechatTemplateVo.java | 5 ++ .../portal/api/wechattemplate/content.java | 13 ++++ .../supervise-portal-biz/pom.xml | 38 ++++++++++ .../wechattemplate/WechatTemplateMapper.java | 1 + .../wechattemplate/WechatTemplateMapper.xml | 4 +- .../wechattemplate/WechatTemplateRest.java | 9 ++- .../wechattemplate/WechatTemplateService.java | 71 ++++++++++++------- 21 files changed, 564 insertions(+), 35 deletions(-) create mode 100644 yxt_supervise/supervise-crm/supervise-crm-api/src/main/java/com/yxt/supervise/crm/api/loanbankinformation/LoanBankInformation.java create mode 100644 yxt_supervise/supervise-crm/supervise-crm-api/src/main/java/com/yxt/supervise/crm/api/loanbankinformation/LoanBankInformationDetailsVo.java create mode 100644 yxt_supervise/supervise-crm/supervise-crm-api/src/main/java/com/yxt/supervise/crm/api/loanbankinformation/LoanBankInformationDto.java create mode 100644 yxt_supervise/supervise-crm/supervise-crm-api/src/main/java/com/yxt/supervise/crm/api/loanbankinformation/LoanBankInformationFeign.java create mode 100644 yxt_supervise/supervise-crm/supervise-crm-api/src/main/java/com/yxt/supervise/crm/api/loanbankinformation/LoanBankInformationFeignFallback.java create mode 100644 yxt_supervise/supervise-crm/supervise-crm-api/src/main/java/com/yxt/supervise/crm/api/loanbankinformation/LoanBankInformationQuery.java create mode 100644 yxt_supervise/supervise-crm/supervise-crm-api/src/main/java/com/yxt/supervise/crm/api/loanbankinformation/LoanBankInformationVo.java create mode 100644 yxt_supervise/supervise-crm/supervise-crm-biz/src/main/java/com/yxt/supervise/crm/biz/loanbankinformation/LoanBankInformationMapper.java create mode 100644 yxt_supervise/supervise-crm/supervise-crm-biz/src/main/java/com/yxt/supervise/crm/biz/loanbankinformation/LoanBankInformationMapper.xml create mode 100644 yxt_supervise/supervise-crm/supervise-crm-biz/src/main/java/com/yxt/supervise/crm/biz/loanbankinformation/LoanBankInformationRest.java create mode 100644 yxt_supervise/supervise-crm/supervise-crm-biz/src/main/java/com/yxt/supervise/crm/biz/loanbankinformation/LoanBankInformationService.java create mode 100644 yxt_supervise/supervise-portal/supervise-portal-api/src/main/java/com/yxt/supervise/portal/api/wechattemplate/content.java diff --git a/docs/databases/table_create.sql b/docs/databases/table_create.sql index a6a7c0d7..af20ae9b 100644 --- a/docs/databases/table_create.sql +++ b/docs/databases/table_create.sql @@ -64,4 +64,55 @@ CREATE TABLE `wechat_template` ( PRIMARY KEY (`id`) USING BTREE ) ENGINE = InnoDB AUTO_INCREMENT = 2 CHARACTER SET = utf8 COLLATE = utf8_croatian_ci COMMENT = '微信信息推送模版表' ROW_FORMAT = Dynamic; -SET FOREIGN_KEY_CHECKS = 1; \ No newline at end of file +SET FOREIGN_KEY_CHECKS = 1; + + +DROP TABLE IF EXISTS `loan_bank_information`; +CREATE TABLE `loan_bank_information` ( + `id` int(0) NOT NULL AUTO_INCREMENT, + `sid` varchar(255) CHARACTER SET utf8 COLLATE utf8_croatian_ci NOT NULL COMMENT 'ids', + `bankName` varchar(100) CHARACTER SET utf8 COLLATE utf8_croatian_ci NULL DEFAULT NULL COMMENT '银行名称', + `bankAbbreviation` varchar(100) CHARACTER SET utf8 COLLATE utf8_croatian_ci NULL DEFAULT NULL COMMENT '银行简称', + `address` varchar(100) CHARACTER SET utf8 COLLATE utf8_croatian_ci NULL DEFAULT NULL COMMENT '地址', + `province` varchar(100) CHARACTER SET utf8 COLLATE utf8_croatian_ci NULL DEFAULT NULL COMMENT '省', + `city` varchar(100) CHARACTER SET utf8 COLLATE utf8_croatian_ci NULL DEFAULT NULL COMMENT '市', + `county` varchar(100) CHARACTER SET utf8 COLLATE utf8_croatian_ci NULL DEFAULT NULL COMMENT '区', + `contacts` varchar(100) CHARACTER SET utf8 COLLATE utf8_croatian_ci NULL DEFAULT NULL COMMENT '联系人', + `telephone` varchar(100) CHARACTER SET utf8 COLLATE utf8_croatian_ci NULL DEFAULT NULL COMMENT '电话', + `pSid` varchar(255) CHARACTER SET utf8 COLLATE utf8_croatian_ci NULL DEFAULT '0' COMMENT '上级sid', + `lockVersion` int(0) NULL DEFAULT 0 COMMENT '版本锁', + `createTime` timestamp(0) NULL DEFAULT CURRENT_TIMESTAMP(0) COMMENT '创建时间', + `modifyTime` timestamp(0) NULL DEFAULT CURRENT_TIMESTAMP(0) COMMENT '修改时间', + `isEnable` int(0) NULL DEFAULT 1 COMMENT '是否可用:1可用,0不可用', + `state` int(0) NULL DEFAULT 1 COMMENT '状态', + `isDelete` int(0) NULL DEFAULT 0 COMMENT '是否删除:0未删除,1已删除', + `remarks` varchar(255) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '备注', + `createBySid` varchar(64) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '创建人sid', + `updateBySid` varchar(64) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '修改人sid', + PRIMARY KEY (`id`) USING BTREE +) ENGINE = InnoDB CHARACTER SET = utf8 COLLATE = utf8_croatian_ci COMMENT = '贷款银行信息' ROW_FORMAT = Dynamic; + +SET FOREIGN_KEY_CHECKS = 1; + + +DROP TABLE IF EXISTS `bank_manager`; +CREATE TABLE `bank_manager` ( + `id` int(0) NOT NULL AUTO_INCREMENT, + `sid` varchar(255) CHARACTER SET utf8 COLLATE utf8_croatian_ci NULL DEFAULT NULL, + `name` varchar(100) CHARACTER SET utf8 COLLATE utf8_croatian_ci NULL DEFAULT NULL COMMENT '姓名', + `telephone` varchar(100) CHARACTER SET utf8 COLLATE utf8_croatian_ci NULL DEFAULT NULL COMMENT '电话', + `post` varchar(100) CHARACTER SET utf8 COLLATE utf8_croatian_ci NULL DEFAULT NULL COMMENT '职务', + `bankSid` varchar(255) CHARACTER SET utf8 COLLATE utf8_croatian_ci NULL DEFAULT NULL COMMENT '银行sid', + `lockVersion` int(0) NULL DEFAULT 0 COMMENT '版本锁', + `createTime` timestamp(0) NULL DEFAULT CURRENT_TIMESTAMP(0) COMMENT '创建时间', + `modifyTime` timestamp(0) NULL DEFAULT CURRENT_TIMESTAMP(0) COMMENT '修改时间', + `isEnable` int(0) NULL DEFAULT 1 COMMENT '是否可用:1可用,0不可用', + `state` int(0) NULL DEFAULT 1 COMMENT '状态', + `isDelete` int(0) NULL DEFAULT 0 COMMENT '是否删除:0未删除,1已删除', + `remarks` varchar(255) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '备注', + `createBySid` varchar(64) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '创建人sid', + `updateBySid` varchar(64) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '修改人sid', + PRIMARY KEY (`id`) USING BTREE +) ENGINE = InnoDB CHARACTER SET = utf8 COLLATE = utf8_croatian_ci COMMENT = '银行负责人信息' ROW_FORMAT = Dynamic; + +SET FOREIGN_KEY_CHECKS = 1; diff --git a/yxt_supervise/supervise-crm/supervise-crm-api/src/main/java/com/yxt/supervise/crm/api/loanbankinformation/LoanBankInformation.java b/yxt_supervise/supervise-crm/supervise-crm-api/src/main/java/com/yxt/supervise/crm/api/loanbankinformation/LoanBankInformation.java new file mode 100644 index 00000000..52ca27f2 --- /dev/null +++ b/yxt_supervise/supervise-crm/supervise-crm-api/src/main/java/com/yxt/supervise/crm/api/loanbankinformation/LoanBankInformation.java @@ -0,0 +1,35 @@ +package com.yxt.supervise.crm.api.loanbankinformation; + +import com.baomidou.mybatisplus.annotation.TableName; +import com.yxt.common.core.domain.BaseEntity; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import lombok.Data; + +/** + * @author wangpengfei + * @date 2023/4/11 16:04 + */ +@Data +@ApiModel(value = "贷款银行信息", description = "贷款银行信息") +@TableName("loan_bank_information") +public class LoanBankInformation extends BaseEntity { + @ApiModelProperty("银行名称") + private String bankName; + @ApiModelProperty("银行简称") + private String bankAbbreviation; + @ApiModelProperty("地址") + private String address; + @ApiModelProperty("省") + private String province; + @ApiModelProperty("市") + private String city; + @ApiModelProperty("区") + private String county; + @ApiModelProperty("联系人") + private String contacts; + @ApiModelProperty("电话") + private String telephone; + @ApiModelProperty("上级sid") + private String pSid; +} diff --git a/yxt_supervise/supervise-crm/supervise-crm-api/src/main/java/com/yxt/supervise/crm/api/loanbankinformation/LoanBankInformationDetailsVo.java b/yxt_supervise/supervise-crm/supervise-crm-api/src/main/java/com/yxt/supervise/crm/api/loanbankinformation/LoanBankInformationDetailsVo.java new file mode 100644 index 00000000..c6c0607e --- /dev/null +++ b/yxt_supervise/supervise-crm/supervise-crm-api/src/main/java/com/yxt/supervise/crm/api/loanbankinformation/LoanBankInformationDetailsVo.java @@ -0,0 +1,37 @@ +package com.yxt.supervise.crm.api.loanbankinformation; + +import com.yxt.common.core.vo.Vo; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import lombok.Data; + +/** + * @author wangpengfei + * @date 2023/4/11 16:07 + */ +@Data +@ApiModel(value = "贷款银行信息 视图数据详情", description = "贷款银行信息 视图数据详情") +public class LoanBankInformationDetailsVo implements Vo { + @ApiModelProperty("id") + private Integer id; + @ApiModelProperty("sid") + private String sid; + @ApiModelProperty("银行名称") + private String bankName; + @ApiModelProperty("银行简称") + private String bankAbbreviation; + @ApiModelProperty("地址") + private String address; + @ApiModelProperty("省") + private String province; + @ApiModelProperty("市") + private String city; + @ApiModelProperty("区") + private String county; + @ApiModelProperty("联系人") + private String contacts; + @ApiModelProperty("电话") + private String telephone; + @ApiModelProperty("上级sid") + private String pSid; +} diff --git a/yxt_supervise/supervise-crm/supervise-crm-api/src/main/java/com/yxt/supervise/crm/api/loanbankinformation/LoanBankInformationDto.java b/yxt_supervise/supervise-crm/supervise-crm-api/src/main/java/com/yxt/supervise/crm/api/loanbankinformation/LoanBankInformationDto.java new file mode 100644 index 00000000..a2b2f6b8 --- /dev/null +++ b/yxt_supervise/supervise-crm/supervise-crm-api/src/main/java/com/yxt/supervise/crm/api/loanbankinformation/LoanBankInformationDto.java @@ -0,0 +1,37 @@ +package com.yxt.supervise.crm.api.loanbankinformation; + +import com.yxt.common.core.dto.Dto; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import lombok.Data; + +/** + * @author wangpengfei + * @date 2023/4/11 16:07 + */ +@ApiModel(value = "贷款银行信息 数据传输对象", description = "贷款银行信息 数据传输对象") +@Data +public class LoanBankInformationDto implements Dto { + @ApiModelProperty("id") + private Integer id; + @ApiModelProperty("sid") + private String sid; + @ApiModelProperty("银行名称") + private String bankName; + @ApiModelProperty("银行简称") + private String bankAbbreviation; + @ApiModelProperty("地址") + private String address; + @ApiModelProperty("省") + private String province; + @ApiModelProperty("市") + private String city; + @ApiModelProperty("区") + private String county; + @ApiModelProperty("联系人") + private String contacts; + @ApiModelProperty("电话") + private String telephone; + @ApiModelProperty("上级sid") + private String pSid; +} diff --git a/yxt_supervise/supervise-crm/supervise-crm-api/src/main/java/com/yxt/supervise/crm/api/loanbankinformation/LoanBankInformationFeign.java b/yxt_supervise/supervise-crm/supervise-crm-api/src/main/java/com/yxt/supervise/crm/api/loanbankinformation/LoanBankInformationFeign.java new file mode 100644 index 00000000..c92ee1a2 --- /dev/null +++ b/yxt_supervise/supervise-crm/supervise-crm-api/src/main/java/com/yxt/supervise/crm/api/loanbankinformation/LoanBankInformationFeign.java @@ -0,0 +1,29 @@ +package com.yxt.supervise.crm.api.loanbankinformation; + +import com.yxt.common.core.query.PagerQuery; +import com.yxt.common.core.result.ResultBean; +import com.yxt.common.core.vo.PagerVo; +import com.yxt.supervise.crm.api.loanbankinformation.LoanBankInformationFeignFallback; +import com.yxt.supervise.crm.api.loanbankinformation.LoanBankInformationQuery; +import com.yxt.supervise.crm.api.loanbankinformation.LoanBankInformationVo; +import io.swagger.annotations.Api; +import io.swagger.annotations.ApiOperation; +import org.springframework.cloud.openfeign.FeignClient; +import org.springframework.web.bind.annotation.PostMapping; +import org.springframework.web.bind.annotation.RequestBody; + +/** + * @author wangpengfei + * @date 2023/4/11 16:08 + */ +@Api(tags = "贷款银行信息") +@FeignClient( + contextId = "supervise-crm-LoanBankInformation", + name = "supervise-crm", + path = "v1/loanbankinformation", + fallback = LoanBankInformationFeignFallback.class) +public interface LoanBankInformationFeign { + @ApiOperation("根据条件分页查询数据的列表") + @PostMapping("/listPage") + public ResultBean> listPage(@RequestBody PagerQuery pq); +} diff --git a/yxt_supervise/supervise-crm/supervise-crm-api/src/main/java/com/yxt/supervise/crm/api/loanbankinformation/LoanBankInformationFeignFallback.java b/yxt_supervise/supervise-crm/supervise-crm-api/src/main/java/com/yxt/supervise/crm/api/loanbankinformation/LoanBankInformationFeignFallback.java new file mode 100644 index 00000000..587fed1d --- /dev/null +++ b/yxt_supervise/supervise-crm/supervise-crm-api/src/main/java/com/yxt/supervise/crm/api/loanbankinformation/LoanBankInformationFeignFallback.java @@ -0,0 +1,20 @@ +package com.yxt.supervise.crm.api.loanbankinformation; + +import com.yxt.common.core.query.PagerQuery; +import com.yxt.common.core.result.ResultBean; +import com.yxt.common.core.vo.PagerVo; +import com.yxt.supervise.crm.api.loanbankinformation.LoanBankInformationQuery; +import com.yxt.supervise.crm.api.loanbankinformation.LoanBankInformationVo; +import org.springframework.stereotype.Component; + +/** + * @author wangpengfei + * @date 2023/4/11 16:08 + */ +@Component +public class LoanBankInformationFeignFallback implements LoanBankInformationFeign{ + @Override + public ResultBean> listPage(PagerQuery pq) { + return null; + } +} diff --git a/yxt_supervise/supervise-crm/supervise-crm-api/src/main/java/com/yxt/supervise/crm/api/loanbankinformation/LoanBankInformationQuery.java b/yxt_supervise/supervise-crm/supervise-crm-api/src/main/java/com/yxt/supervise/crm/api/loanbankinformation/LoanBankInformationQuery.java new file mode 100644 index 00000000..bd3ac693 --- /dev/null +++ b/yxt_supervise/supervise-crm/supervise-crm-api/src/main/java/com/yxt/supervise/crm/api/loanbankinformation/LoanBankInformationQuery.java @@ -0,0 +1,37 @@ +package com.yxt.supervise.crm.api.loanbankinformation; + +import com.yxt.common.core.query.Query; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import lombok.Data; + +/** + * @author wangpengfei + * @date 2023/4/11 16:08 + */ +@ApiModel(value = "贷款银行信息 查询条件", description = "贷款银行信息 查询条件") +@Data +public class LoanBankInformationQuery implements Query { + @ApiModelProperty("id") + private Integer id; + @ApiModelProperty("sid") + private String sid; + @ApiModelProperty("银行名称") + private String bankName; + @ApiModelProperty("银行简称") + private String bankAbbreviation; + @ApiModelProperty("地址") + private String address; + @ApiModelProperty("省") + private String province; + @ApiModelProperty("市") + private String city; + @ApiModelProperty("区") + private String county; + @ApiModelProperty("联系人") + private String contacts; + @ApiModelProperty("电话") + private String telephone; + @ApiModelProperty("上级sid") + private String pSid; +} diff --git a/yxt_supervise/supervise-crm/supervise-crm-api/src/main/java/com/yxt/supervise/crm/api/loanbankinformation/LoanBankInformationVo.java b/yxt_supervise/supervise-crm/supervise-crm-api/src/main/java/com/yxt/supervise/crm/api/loanbankinformation/LoanBankInformationVo.java new file mode 100644 index 00000000..184c62a1 --- /dev/null +++ b/yxt_supervise/supervise-crm/supervise-crm-api/src/main/java/com/yxt/supervise/crm/api/loanbankinformation/LoanBankInformationVo.java @@ -0,0 +1,37 @@ +package com.yxt.supervise.crm.api.loanbankinformation; + +import com.yxt.common.core.vo.Vo; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import lombok.Data; + +/** + * @author wangpengfei + * @date 2023/4/11 16:08 + */ +@ApiModel(value = "贷款银行信息 视图数据对象", description = "贷款银行信息 视图数据对象") +@Data +public class LoanBankInformationVo implements Vo { + @ApiModelProperty("id") + private Integer id; + @ApiModelProperty("sid") + private String sid; + @ApiModelProperty("银行名称") + private String bankName; + @ApiModelProperty("银行简称") + private String bankAbbreviation; + @ApiModelProperty("地址") + private String address; + @ApiModelProperty("省") + private String province; + @ApiModelProperty("市") + private String city; + @ApiModelProperty("区") + private String county; + @ApiModelProperty("联系人") + private String contacts; + @ApiModelProperty("电话") + private String telephone; + @ApiModelProperty("上级sid") + private String pSid; +} diff --git a/yxt_supervise/supervise-crm/supervise-crm-biz/src/main/java/com/yxt/supervise/crm/biz/loanbankinformation/LoanBankInformationMapper.java b/yxt_supervise/supervise-crm/supervise-crm-biz/src/main/java/com/yxt/supervise/crm/biz/loanbankinformation/LoanBankInformationMapper.java new file mode 100644 index 00000000..6b599887 --- /dev/null +++ b/yxt_supervise/supervise-crm/supervise-crm-biz/src/main/java/com/yxt/supervise/crm/biz/loanbankinformation/LoanBankInformationMapper.java @@ -0,0 +1,23 @@ +package com.yxt.supervise.crm.biz.loanbankinformation; + +import com.baomidou.mybatisplus.core.conditions.Wrapper; +import com.baomidou.mybatisplus.core.mapper.BaseMapper; +import com.baomidou.mybatisplus.core.metadata.IPage; +import com.baomidou.mybatisplus.core.toolkit.Constants; +import com.yxt.supervise.crm.api.crmcustomertemp.CrmCustomerTemp; +import com.yxt.supervise.crm.api.crmcustomertemp.CrmCustomerTempVo; +import com.yxt.supervise.crm.api.loanbankinformation.LoanBankInformation; +import com.yxt.supervise.crm.api.loanbankinformation.LoanBankInformationVo; +import org.apache.ibatis.annotations.Mapper; +import org.apache.ibatis.annotations.Param; + +/** + * @author wangpengfei + * @date 2023/4/11 16:14 + */ +@Mapper +public interface LoanBankInformationMapper extends BaseMapper { + IPage selectPageVo(IPage page, @Param(Constants.WRAPPER) Wrapper qw); + LoanBankInformationVo getBankInformation( @Param("sid") String sid); + +} diff --git a/yxt_supervise/supervise-crm/supervise-crm-biz/src/main/java/com/yxt/supervise/crm/biz/loanbankinformation/LoanBankInformationMapper.xml b/yxt_supervise/supervise-crm/supervise-crm-biz/src/main/java/com/yxt/supervise/crm/biz/loanbankinformation/LoanBankInformationMapper.xml new file mode 100644 index 00000000..f994f816 --- /dev/null +++ b/yxt_supervise/supervise-crm/supervise-crm-biz/src/main/java/com/yxt/supervise/crm/biz/loanbankinformation/LoanBankInformationMapper.xml @@ -0,0 +1,20 @@ + + + + + + + + + + \ No newline at end of file diff --git a/yxt_supervise/supervise-crm/supervise-crm-biz/src/main/java/com/yxt/supervise/crm/biz/loanbankinformation/LoanBankInformationRest.java b/yxt_supervise/supervise-crm/supervise-crm-biz/src/main/java/com/yxt/supervise/crm/biz/loanbankinformation/LoanBankInformationRest.java new file mode 100644 index 00000000..a7efc668 --- /dev/null +++ b/yxt_supervise/supervise-crm/supervise-crm-biz/src/main/java/com/yxt/supervise/crm/biz/loanbankinformation/LoanBankInformationRest.java @@ -0,0 +1,54 @@ +package com.yxt.supervise.crm.biz.loanbankinformation; + +import com.yxt.common.core.query.PagerQuery; +import com.yxt.common.core.result.ResultBean; +import com.yxt.common.core.vo.PagerVo; +import com.yxt.supervise.crm.api.loanbankinformation.*; +import io.swagger.annotations.Api; +import io.swagger.annotations.ApiOperation; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.web.bind.annotation.*; + +/** + * @author wangpengfei + * @date 2023/4/11 16:14 + */ +@Api(tags = "贷款银行信息") +@RestController +@RequestMapping("v1/loanbankinformation") +public class LoanBankInformationRest implements LoanBankInformationFeign { + + @Autowired + LoanBankInformationService loanBankInformationService; + + @Override + @ApiOperation("根据条件分页查询数据的列表") + @PostMapping("/listPage") + public ResultBean> listPage(@RequestBody PagerQuery pq) { + ResultBean rb = ResultBean.fireFail(); + PagerVo pv = loanBankInformationService.listPageVo(pq); + return rb.success().setData(pv); + } + @ApiOperation("根据条件分页查询数据的列表") + @PostMapping("/save") + public ResultBean save(@RequestBody LoanBankInformationDto dto) { + return loanBankInformationService.save(dto); + } + @ApiOperation("根据条件分页查询数据的列表") + @PostMapping("/update") + public ResultBean update(@RequestBody LoanBankInformationDto dto) { + return loanBankInformationService.update(dto); + } + @ApiOperation("根据条件分页查询数据的列表") + @GetMapping("/getBankInfBySid/{sid}") + public ResultBean getBankInformation(@PathVariable String sid){ + ResultBean rb = ResultBean.fireFail(); + LoanBankInformationVo loanBankInformationVo=loanBankInformationService.getBankInformation(sid); + return rb.success().setData(loanBankInformationVo); + } + @ApiOperation("根据条件分页查询数据的列表") + @DeleteMapping("/delete/{sid}") + public ResultBean delete(@PathVariable String sid) { + return loanBankInformationService.delete(sid); + } +} diff --git a/yxt_supervise/supervise-crm/supervise-crm-biz/src/main/java/com/yxt/supervise/crm/biz/loanbankinformation/LoanBankInformationService.java b/yxt_supervise/supervise-crm/supervise-crm-biz/src/main/java/com/yxt/supervise/crm/biz/loanbankinformation/LoanBankInformationService.java new file mode 100644 index 00000000..ec1366e0 --- /dev/null +++ b/yxt_supervise/supervise-crm/supervise-crm-biz/src/main/java/com/yxt/supervise/crm/biz/loanbankinformation/LoanBankInformationService.java @@ -0,0 +1,65 @@ +package com.yxt.supervise.crm.biz.loanbankinformation; + +import cn.hutool.core.bean.BeanUtil; +import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; +import com.baomidou.mybatisplus.core.metadata.IPage; +import com.yxt.common.base.service.MybatisBaseService; +import com.yxt.common.base.utils.PagerUtil; +import com.yxt.common.core.query.PagerQuery; +import com.yxt.common.core.result.ResultBean; +import com.yxt.common.core.vo.PagerVo; +import com.yxt.supervise.crm.api.loanbankinformation.LoanBankInformation; +import com.yxt.supervise.crm.api.loanbankinformation.LoanBankInformationDto; +import com.yxt.supervise.crm.api.loanbankinformation.LoanBankInformationQuery; +import com.yxt.supervise.crm.api.loanbankinformation.LoanBankInformationVo; +import org.apache.commons.lang3.StringUtils; +import org.springframework.stereotype.Service; + +/** + * @author wangpengfei + * @date 2023/4/11 16:14 + */ +@Service +public class LoanBankInformationService extends MybatisBaseService { + public PagerVo listPageVo(PagerQuery pq) { + LoanBankInformationQuery query = pq.getParams(); + QueryWrapper qw = new QueryWrapper<>(); + if(StringUtils.isNotBlank(query.getBankName())){ + qw.like("bankName",query.getBankName()); + } + if(StringUtils.isNotBlank(query.getTelephone())){ + qw.like("telephone",query.getTelephone()); + } + + IPage page = PagerUtil.queryToPage(pq); + IPage pagging = baseMapper.selectPageVo(page, qw); + PagerVo p = PagerUtil.pageToVo(pagging, null); + return p; + } + public ResultBean save(LoanBankInformationDto dto) { + ResultBean rb=new ResultBean(); + if(dto.getPSid().equals("")){ + dto.setSid("0"); + } + LoanBankInformation entity=new LoanBankInformation(); + BeanUtil.copyProperties(dto, entity, "id", "sid"); + baseMapper.insert(entity); + return rb.success().setMsg("修改模板信息成功"); + } + public ResultBean update(LoanBankInformationDto dto) { + ResultBean rb=new ResultBean(); + LoanBankInformation entity=new LoanBankInformation(); + BeanUtil.copyProperties(dto, entity, "id", "sid"); + baseMapper.updateById(entity); + return rb.success().setMsg("修改模板信息成功"); + } + public LoanBankInformationVo getBankInformation(String sid){ + + return baseMapper.getBankInformation(sid); + } + public ResultBean delete(String sid) { + ResultBean rb=new ResultBean(); + baseMapper.delete(new QueryWrapper().eq("sid",sid)); + return rb.success().setMsg("修改模板信息成功"); + } +} diff --git a/yxt_supervise/supervise-portal/supervise-portal-api/src/main/java/com/yxt/supervise/portal/api/wechattemplate/WechatTemplateDto.java b/yxt_supervise/supervise-portal/supervise-portal-api/src/main/java/com/yxt/supervise/portal/api/wechattemplate/WechatTemplateDto.java index 15dfa53e..7508a091 100644 --- a/yxt_supervise/supervise-portal/supervise-portal-api/src/main/java/com/yxt/supervise/portal/api/wechattemplate/WechatTemplateDto.java +++ b/yxt_supervise/supervise-portal/supervise-portal-api/src/main/java/com/yxt/supervise/portal/api/wechattemplate/WechatTemplateDto.java @@ -22,11 +22,14 @@ public class WechatTemplateDto implements Dto { //标题 @ApiModelProperty("标题") private String title; - //格式 - @ApiModelProperty("格式") - private String json; + //前端传的list格式 + @ApiModelProperty("前端传的list格式,后台转json") + private List text; //行业 @ApiModelProperty("行业") private String trade; + //详细内容 + @ApiModelProperty("json") + private String json; private List templateStaffConfigs; } diff --git a/yxt_supervise/supervise-portal/supervise-portal-api/src/main/java/com/yxt/supervise/portal/api/wechattemplate/WechatTemplateQuery.java b/yxt_supervise/supervise-portal/supervise-portal-api/src/main/java/com/yxt/supervise/portal/api/wechattemplate/WechatTemplateQuery.java index d891b613..42954877 100644 --- a/yxt_supervise/supervise-portal/supervise-portal-api/src/main/java/com/yxt/supervise/portal/api/wechattemplate/WechatTemplateQuery.java +++ b/yxt_supervise/supervise-portal/supervise-portal-api/src/main/java/com/yxt/supervise/portal/api/wechattemplate/WechatTemplateQuery.java @@ -17,7 +17,7 @@ public class WechatTemplateQuery implements Query { private String templateId; //标题 @ApiModelProperty("标题") - private String title; + private String name; //格式 @ApiModelProperty("格式") private String json; diff --git a/yxt_supervise/supervise-portal/supervise-portal-api/src/main/java/com/yxt/supervise/portal/api/wechattemplate/WechatTemplateVo.java b/yxt_supervise/supervise-portal/supervise-portal-api/src/main/java/com/yxt/supervise/portal/api/wechattemplate/WechatTemplateVo.java index 5643c9b8..54c76901 100644 --- a/yxt_supervise/supervise-portal/supervise-portal-api/src/main/java/com/yxt/supervise/portal/api/wechattemplate/WechatTemplateVo.java +++ b/yxt_supervise/supervise-portal/supervise-portal-api/src/main/java/com/yxt/supervise/portal/api/wechattemplate/WechatTemplateVo.java @@ -5,6 +5,8 @@ import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; import lombok.Data; +import java.util.List; + /** * @author wangpengfei * @date 2023/4/10 11:35 @@ -13,6 +15,7 @@ import lombok.Data; @ApiModel(value = "微信消息模版 视图数据对象", description = "微信消息模版 视图数据对象") public class WechatTemplateVo implements Vo { private String id; + private String sid; @ApiModelProperty("模版id") private String templateId; //标题 @@ -24,4 +27,6 @@ public class WechatTemplateVo implements Vo { //行业 @ApiModelProperty("行业") private String trade; + + private List text; } diff --git a/yxt_supervise/supervise-portal/supervise-portal-api/src/main/java/com/yxt/supervise/portal/api/wechattemplate/content.java b/yxt_supervise/supervise-portal/supervise-portal-api/src/main/java/com/yxt/supervise/portal/api/wechattemplate/content.java new file mode 100644 index 00000000..41ae85c6 --- /dev/null +++ b/yxt_supervise/supervise-portal/supervise-portal-api/src/main/java/com/yxt/supervise/portal/api/wechattemplate/content.java @@ -0,0 +1,13 @@ +package com.yxt.supervise.portal.api.wechattemplate; + +import lombok.Data; + +/** + * @author wangpengfei + * @date 2023/4/10 18:23 + */ +@Data +public class content { + private String key; + private String value; +} diff --git a/yxt_supervise/supervise-portal/supervise-portal-biz/pom.xml b/yxt_supervise/supervise-portal/supervise-portal-biz/pom.xml index 6073feb7..452ed59b 100644 --- a/yxt_supervise/supervise-portal/supervise-portal-biz/pom.xml +++ b/yxt_supervise/supervise-portal/supervise-portal-biz/pom.xml @@ -140,6 +140,44 @@ + + + commons-collections + commons-collections + 3.2.1 + + + commons-beanutils + commons-beanutils + 1.9.2 + + + commons-lang + commons-lang + 2.6 + + + commons-logging + commons-logging + 1.1.1 + + + net.sf.ezmorph + ezmorph + 1.0.6 + + + net.sf.json-lib + json-lib + 2.4 + jdk15 + + + commons-codec + commons-codec + 1.10 + + diff --git a/yxt_supervise/supervise-portal/supervise-portal-biz/src/main/java/com/yxt/supervise/portal/biz/wechattemplate/WechatTemplateMapper.java b/yxt_supervise/supervise-portal/supervise-portal-biz/src/main/java/com/yxt/supervise/portal/biz/wechattemplate/WechatTemplateMapper.java index 0fdb43b9..5fd1b9d4 100644 --- a/yxt_supervise/supervise-portal/supervise-portal-biz/src/main/java/com/yxt/supervise/portal/biz/wechattemplate/WechatTemplateMapper.java +++ b/yxt_supervise/supervise-portal/supervise-portal-biz/src/main/java/com/yxt/supervise/portal/biz/wechattemplate/WechatTemplateMapper.java @@ -16,4 +16,5 @@ import org.apache.ibatis.annotations.Param; @Mapper public interface WechatTemplateMapper extends BaseMapper { IPage selectPageVo(IPage page, @Param(Constants.WRAPPER) Wrapper qw); + WechatTemplateVo getTemplateBySid(@Param("sid") String sid); } diff --git a/yxt_supervise/supervise-portal/supervise-portal-biz/src/main/java/com/yxt/supervise/portal/biz/wechattemplate/WechatTemplateMapper.xml b/yxt_supervise/supervise-portal/supervise-portal-biz/src/main/java/com/yxt/supervise/portal/biz/wechattemplate/WechatTemplateMapper.xml index 626fa3b3..e2a0f737 100644 --- a/yxt_supervise/supervise-portal/supervise-portal-biz/src/main/java/com/yxt/supervise/portal/biz/wechattemplate/WechatTemplateMapper.xml +++ b/yxt_supervise/supervise-portal/supervise-portal-biz/src/main/java/com/yxt/supervise/portal/biz/wechattemplate/WechatTemplateMapper.xml @@ -7,7 +7,7 @@ SELECT * FROM wechat_template ${ew.sqlSegment} - + SELECT * FROM wechat_template sid=#{sid} \ No newline at end of file diff --git a/yxt_supervise/supervise-portal/supervise-portal-biz/src/main/java/com/yxt/supervise/portal/biz/wechattemplate/WechatTemplateRest.java b/yxt_supervise/supervise-portal/supervise-portal-biz/src/main/java/com/yxt/supervise/portal/biz/wechattemplate/WechatTemplateRest.java index b83c85c6..2248bbd5 100644 --- a/yxt_supervise/supervise-portal/supervise-portal-biz/src/main/java/com/yxt/supervise/portal/biz/wechattemplate/WechatTemplateRest.java +++ b/yxt_supervise/supervise-portal/supervise-portal-biz/src/main/java/com/yxt/supervise/portal/biz/wechattemplate/WechatTemplateRest.java @@ -29,6 +29,13 @@ public class WechatTemplateRest implements WechatTemplateFeign { PagerVo pv = wechatTemplateService.listPageVo(pq); return rb.success().setData(pv); } + @ApiOperation("初始化") + @GetMapping("/getTemplateBySid/{sid}") + public ResultBean getTemplateBySid(@PathVariable("sid") String sid){ + ResultBean rb = ResultBean.fireFail(); + WechatTemplateVo pv = wechatTemplateService.getTemplateBySid(sid); + return rb.success().setData(pv); + } @ApiOperation("新增") @PostMapping("/save") public ResultBean save(@RequestBody WechatTemplateDto dto){ @@ -48,7 +55,7 @@ public class WechatTemplateRest implements WechatTemplateFeign { @ResponseBody public ResultBean delete(@PathVariable String sid){ ResultBean rb = ResultBean.fireFail(); - wechatTemplateService.deleteById(sid); + wechatTemplateService.deleteBySid(sid); return rb.success().setMsg(rb.getMsg()); } } diff --git a/yxt_supervise/supervise-portal/supervise-portal-biz/src/main/java/com/yxt/supervise/portal/biz/wechattemplate/WechatTemplateService.java b/yxt_supervise/supervise-portal/supervise-portal-biz/src/main/java/com/yxt/supervise/portal/biz/wechattemplate/WechatTemplateService.java index 222e857f..b6e474cc 100644 --- a/yxt_supervise/supervise-portal/supervise-portal-biz/src/main/java/com/yxt/supervise/portal/biz/wechattemplate/WechatTemplateService.java +++ b/yxt_supervise/supervise-portal/supervise-portal-biz/src/main/java/com/yxt/supervise/portal/biz/wechattemplate/WechatTemplateService.java @@ -1,6 +1,8 @@ package com.yxt.supervise.portal.biz.wechattemplate; import cn.hutool.core.bean.BeanUtil; +import com.alibaba.fastjson.JSON; +import com.alibaba.fastjson.JSONObject; import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; import com.baomidou.mybatisplus.core.metadata.IPage; import com.yxt.common.base.service.MybatisBaseService; @@ -9,16 +11,15 @@ import com.yxt.common.core.query.PagerQuery; import com.yxt.common.core.result.ResultBean; import com.yxt.common.core.vo.PagerVo; import com.yxt.supervise.portal.api.templatestaffconfig.TemplateStaffConfig; -import com.yxt.supervise.portal.api.wechattemplate.WechatTemplate; -import com.yxt.supervise.portal.api.wechattemplate.WechatTemplateDto; -import com.yxt.supervise.portal.api.wechattemplate.WechatTemplateQuery; -import com.yxt.supervise.portal.api.wechattemplate.WechatTemplateVo; +import com.yxt.supervise.portal.api.wechattemplate.*; import com.yxt.supervise.portal.biz.templatestaffconfig.TemplateStaffConfigService; +import net.sf.json.JSONArray; import org.apache.commons.lang3.StringUtils; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Service; import java.util.ArrayList; +import java.util.Date; import java.util.List; /** @@ -35,29 +36,43 @@ public class WechatTemplateService extends MybatisBaseService listPageVo(PagerQuery pq) { WechatTemplateQuery query = pq.getParams(); QueryWrapper qw = new QueryWrapper<>(); + if (StringUtils.isNotBlank(query.getName())) { + qw.like("title", query.getName()); + } IPage page = PagerUtil.queryToPage(pq); IPage pagging = baseMapper.selectPageVo(page, qw); PagerVo p = PagerUtil.pageToVo(pagging, null); return p; } + public WechatTemplateVo getTemplateBySid(String sid) { + WechatTemplateVo wechatTemplateVo=baseMapper.getTemplateBySid(sid); + String json=wechatTemplateVo.getJson(); + System.out.println(json); + wechatTemplateVo.setText(JSONObject.parseArray(json,content.class)); + return wechatTemplateVo; + } + public ResultBean save(WechatTemplateDto dto) { ResultBean rb = ResultBean.fireFail(); WechatTemplate entity=new WechatTemplate(); BeanUtil.copyProperties(dto, entity, "id", "sid"); + JSONArray json = JSONArray.fromObject(dto.getText()); + entity.setJson(json.toString()); baseMapper.insert(entity); - List entitys=new ArrayList<>(); - if(dto.getTemplateStaffConfigs().size()>0){ - for(TemplateStaffConfig templateStaffConfig:dto.getTemplateStaffConfigs()){ - BeanUtil.copyProperties(dto, templateStaffConfig, "id", "sid"); - templateStaffConfig.setTemplateSid(entity.getSid()); - entitys.add(templateStaffConfig); - } - - templateStaffConfigService.saveBatch(entitys); - } +// List entitys=new ArrayList<>(); +// if(dto.getTemplateStaffConfigs().size()>0){ +// for(TemplateStaffConfig templateStaffConfig:dto.getTemplateStaffConfigs()){ +// BeanUtil.copyProperties(dto, templateStaffConfig, "id", "sid"); +// templateStaffConfig.setTemplateSid(entity.getSid()); +// entitys.add(templateStaffConfig); +// } +// +// templateStaffConfigService.saveBatch(entitys); +// } return rb.success().setMsg("添加模板信息成功"); } + public ResultBean update(WechatTemplateDto dto) { ResultBean rb = ResultBean.fireFail(); String dtoSid = dto.getSid(); @@ -66,23 +81,25 @@ public class WechatTemplateService extends MybatisBaseService entitys=new ArrayList<>(); - if(dto.getTemplateStaffConfigs().size()>0){ - templateStaffConfigService.deleteBySid(entity.getSid()); - for(TemplateStaffConfig templateStaffConfig:dto.getTemplateStaffConfigs()){ - BeanUtil.copyProperties(dto, templateStaffConfig, "id", "sid"); - templateStaffConfig.setTemplateSid(entity.getSid()); - entitys.add(templateStaffConfig); - } - templateStaffConfigService.saveBatch(entitys); - } - return rb.success().setMsg("添加模板信息成功"); +// List entitys=new ArrayList<>(); +// if(dto.getTemplateStaffConfigs().size()>0){ +// templateStaffConfigService.deleteBySid(entity.getSid()); +// for(TemplateStaffConfig templateStaffConfig:dto.getTemplateStaffConfigs()){ +// BeanUtil.copyProperties(dto, templateStaffConfig, "id", "sid"); +// templateStaffConfig.setTemplateSid(entity.getSid()); +// entitys.add(templateStaffConfig); +// } +// templateStaffConfigService.saveBatch(entitys); +// } + return rb.success().setMsg("修改模板信息成功"); } public ResultBean deleteById(String sid) { ResultBean rb = ResultBean.fireFail(); int i=baseMapper.deleteById(sid); - templateStaffConfigService.deleteBySid(sid); - return rb.success().setMsg("添加模板信息成功"); + //templateStaffConfigService.deleteBySid(sid); + return rb.success().setMsg("删除模板信息成功"); } }