Browse Source

微信消息模版接口、贷款银行信息接口、添加sql脚本

master
wangpengfei 2 years ago
parent
commit
5250e60cec
  1. 53
      docs/databases/table_create.sql
  2. 35
      yxt_supervise/supervise-crm/supervise-crm-api/src/main/java/com/yxt/supervise/crm/api/loanbankinformation/LoanBankInformation.java
  3. 37
      yxt_supervise/supervise-crm/supervise-crm-api/src/main/java/com/yxt/supervise/crm/api/loanbankinformation/LoanBankInformationDetailsVo.java
  4. 37
      yxt_supervise/supervise-crm/supervise-crm-api/src/main/java/com/yxt/supervise/crm/api/loanbankinformation/LoanBankInformationDto.java
  5. 29
      yxt_supervise/supervise-crm/supervise-crm-api/src/main/java/com/yxt/supervise/crm/api/loanbankinformation/LoanBankInformationFeign.java
  6. 20
      yxt_supervise/supervise-crm/supervise-crm-api/src/main/java/com/yxt/supervise/crm/api/loanbankinformation/LoanBankInformationFeignFallback.java
  7. 37
      yxt_supervise/supervise-crm/supervise-crm-api/src/main/java/com/yxt/supervise/crm/api/loanbankinformation/LoanBankInformationQuery.java
  8. 37
      yxt_supervise/supervise-crm/supervise-crm-api/src/main/java/com/yxt/supervise/crm/api/loanbankinformation/LoanBankInformationVo.java
  9. 23
      yxt_supervise/supervise-crm/supervise-crm-biz/src/main/java/com/yxt/supervise/crm/biz/loanbankinformation/LoanBankInformationMapper.java
  10. 20
      yxt_supervise/supervise-crm/supervise-crm-biz/src/main/java/com/yxt/supervise/crm/biz/loanbankinformation/LoanBankInformationMapper.xml
  11. 54
      yxt_supervise/supervise-crm/supervise-crm-biz/src/main/java/com/yxt/supervise/crm/biz/loanbankinformation/LoanBankInformationRest.java
  12. 65
      yxt_supervise/supervise-crm/supervise-crm-biz/src/main/java/com/yxt/supervise/crm/biz/loanbankinformation/LoanBankInformationService.java
  13. 9
      yxt_supervise/supervise-portal/supervise-portal-api/src/main/java/com/yxt/supervise/portal/api/wechattemplate/WechatTemplateDto.java
  14. 2
      yxt_supervise/supervise-portal/supervise-portal-api/src/main/java/com/yxt/supervise/portal/api/wechattemplate/WechatTemplateQuery.java
  15. 5
      yxt_supervise/supervise-portal/supervise-portal-api/src/main/java/com/yxt/supervise/portal/api/wechattemplate/WechatTemplateVo.java
  16. 13
      yxt_supervise/supervise-portal/supervise-portal-api/src/main/java/com/yxt/supervise/portal/api/wechattemplate/content.java
  17. 38
      yxt_supervise/supervise-portal/supervise-portal-biz/pom.xml
  18. 1
      yxt_supervise/supervise-portal/supervise-portal-biz/src/main/java/com/yxt/supervise/portal/biz/wechattemplate/WechatTemplateMapper.java
  19. 4
      yxt_supervise/supervise-portal/supervise-portal-biz/src/main/java/com/yxt/supervise/portal/biz/wechattemplate/WechatTemplateMapper.xml
  20. 9
      yxt_supervise/supervise-portal/supervise-portal-biz/src/main/java/com/yxt/supervise/portal/biz/wechattemplate/WechatTemplateRest.java
  21. 71
      yxt_supervise/supervise-portal/supervise-portal-biz/src/main/java/com/yxt/supervise/portal/biz/wechattemplate/WechatTemplateService.java

53
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;
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;

35
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;
}

37
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;
}

37
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;
}

29
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<PagerVo<LoanBankInformationVo>> listPage(@RequestBody PagerQuery<LoanBankInformationQuery> pq);
}

20
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<PagerVo<LoanBankInformationVo>> listPage(PagerQuery<LoanBankInformationQuery> pq) {
return null;
}
}

37
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;
}

37
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;
}

23
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<LoanBankInformation> {
IPage<LoanBankInformationVo> selectPageVo(IPage<LoanBankInformation> page, @Param(Constants.WRAPPER) Wrapper<LoanBankInformation> qw);
LoanBankInformationVo getBankInformation( @Param("sid") String sid);
}

20
yxt_supervise/supervise-crm/supervise-crm-biz/src/main/java/com/yxt/supervise/crm/biz/loanbankinformation/LoanBankInformationMapper.xml

@ -0,0 +1,20 @@
<?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.yxt.supervise.crm.biz.loanbankinformation.LoanBankInformationMapper">
<!-- <where> ${ew.sqlSegment} </where>-->
<!-- ${ew.customSqlSegment} -->
<select id="selectPageVo" resultType="com.yxt.supervise.crm.api.loanbankinformation.LoanBankInformationVo">
SELECT *
FROM loan_bank_information
<where>
${ew.sqlSegment}
</where>
</select>
<!--根据客户的微信号以及当前登录者所在部门的sid和登录者所关联的员工sid查询-->
<select id="getBankInformation" resultType="com.yxt.supervise.crm.api.loanbankinformation.LoanBankInformationVo">
SELECT *
FROM loan_bank_information
WHERE sid=#{sid}
</select>
</mapper>

54
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<PagerVo<LoanBankInformationVo>> listPage(@RequestBody PagerQuery<LoanBankInformationQuery> pq) {
ResultBean rb = ResultBean.fireFail();
PagerVo<LoanBankInformationVo> 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);
}
}

65
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<LoanBankInformationMapper, LoanBankInformation> {
public PagerVo<LoanBankInformationVo> listPageVo(PagerQuery<LoanBankInformationQuery> pq) {
LoanBankInformationQuery query = pq.getParams();
QueryWrapper<LoanBankInformation> qw = new QueryWrapper<>();
if(StringUtils.isNotBlank(query.getBankName())){
qw.like("bankName",query.getBankName());
}
if(StringUtils.isNotBlank(query.getTelephone())){
qw.like("telephone",query.getTelephone());
}
IPage<LoanBankInformation> page = PagerUtil.queryToPage(pq);
IPage<LoanBankInformationVo> pagging = baseMapper.selectPageVo(page, qw);
PagerVo<LoanBankInformationVo> 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<LoanBankInformation>().eq("sid",sid));
return rb.success().setMsg("修改模板信息成功");
}
}

9
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<content> text;
//行业
@ApiModelProperty("行业")
private String trade;
//详细内容
@ApiModelProperty("json")
private String json;
private List<TemplateStaffConfig> templateStaffConfigs;
}

2
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;

5
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<content> text;
}

13
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;
}

38
yxt_supervise/supervise-portal/supervise-portal-biz/pom.xml

@ -140,6 +140,44 @@
<!-- <artifactId>xercesImpl</artifactId>-->
<!-- <version>2.12.2</version>-->
<!-- </dependency>-->
<dependency>
<groupId>commons-collections</groupId>
<artifactId>commons-collections</artifactId>
<version>3.2.1</version>
</dependency>
<dependency>
<groupId>commons-beanutils</groupId>
<artifactId>commons-beanutils</artifactId>
<version>1.9.2</version>
</dependency>
<dependency>
<groupId>commons-lang</groupId>
<artifactId>commons-lang</artifactId>
<version>2.6</version>
</dependency>
<dependency>
<groupId>commons-logging</groupId>
<artifactId>commons-logging</artifactId>
<version>1.1.1</version>
</dependency>
<dependency>
<groupId>net.sf.ezmorph</groupId>
<artifactId>ezmorph</artifactId>
<version>1.0.6</version>
</dependency>
<dependency>
<groupId>net.sf.json-lib</groupId>
<artifactId>json-lib</artifactId>
<version>2.4</version>
<classifier>jdk15</classifier>
</dependency>
<dependency>
<groupId>commons-codec</groupId>
<artifactId>commons-codec</artifactId>
<version>1.10</version>
</dependency>
</dependencies>
<build>

1
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<WechatTemplate> {
IPage<WechatTemplateVo> selectPageVo(IPage<WechatTemplate> page, @Param(Constants.WRAPPER) Wrapper<WechatTemplate> qw);
WechatTemplateVo getTemplateBySid(@Param("sid") String sid);
}

4
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 <where> ${ew.sqlSegment} </where>
</select>
<select id="selectListAllVo" resultType="com.yxt.supervise.portal.api.wechattemplate.WechatTemplateVo">
SELECT * FROM wechat_template <where> ${ew.sqlSegment} </where>
<select id="getTemplateBySid" resultType="com.yxt.supervise.portal.api.wechattemplate.WechatTemplateVo">
SELECT * FROM wechat_template <where> sid=#{sid} </where>
</select>
</mapper>

9
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<WechatTemplateVo> pv = wechatTemplateService.listPageVo(pq);
return rb.success().setData(pv);
}
@ApiOperation("初始化")
@GetMapping("/getTemplateBySid/{sid}")
public ResultBean<WechatTemplateVo> 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());
}
}

71
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<WechatTemplateMapp
public PagerVo<WechatTemplateVo> listPageVo(PagerQuery<WechatTemplateQuery> pq) {
WechatTemplateQuery query = pq.getParams();
QueryWrapper<WechatTemplate> qw = new QueryWrapper<>();
if (StringUtils.isNotBlank(query.getName())) {
qw.like("title", query.getName());
}
IPage<WechatTemplate> page = PagerUtil.queryToPage(pq);
IPage<WechatTemplateVo> pagging = baseMapper.selectPageVo(page, qw);
PagerVo<WechatTemplateVo> 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<TemplateStaffConfig> 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<TemplateStaffConfig> 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<WechatTemplateMapp
}
WechatTemplate entity = fetchBySid(dtoSid);
BeanUtil.copyProperties(dto, entity, "id", "sid");
JSONArray json = JSONArray.fromObject(dto.getText());
entity.setJson(json.toString());
baseMapper.updateById(entity);
List<TemplateStaffConfig> 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<TemplateStaffConfig> 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("删除模板信息成功");
}
}

Loading…
Cancel
Save