add 批复文件表 下载会员批复文件pdf
This commit is contained in:
@@ -67,5 +67,16 @@
|
||||
<artifactId>sdk</artifactId>
|
||||
<version>1.0.11</version>
|
||||
</dependency>
|
||||
<!--使用itext生成pdf-->
|
||||
<dependency>
|
||||
<groupId>com.itextpdf</groupId>
|
||||
<artifactId>itextpdf</artifactId>
|
||||
<version>5.5.13</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>com.itextpdf</groupId>
|
||||
<artifactId>itext-asian</artifactId>
|
||||
<version>5.2.0</version>
|
||||
</dependency>
|
||||
</dependencies>
|
||||
</project>
|
||||
+291
@@ -0,0 +1,291 @@
|
||||
package com.jero.approvalDocumentNumber.controller;
|
||||
|
||||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import com.itextpdf.text.pdf.PdfStamper;
|
||||
import com.jero.approvalDocumentNumber.entity.ApprovalDocumentNumber;
|
||||
import com.jero.approvalDocumentNumber.service.ApprovalDocumentNumberService;
|
||||
import com.jero.common.api.vo.Result;
|
||||
import com.jero.common.aspect.annotation.AutoLog;
|
||||
import com.jero.common.exception.JeroBootException;
|
||||
import com.jero.common.system.base.controller.JeroController;
|
||||
import com.jero.common.system.query.QueryGenerator;
|
||||
import com.jero.system.service.SystemSendMessageService;
|
||||
import io.swagger.annotations.Api;
|
||||
import io.swagger.annotations.ApiOperation;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.apache.commons.lang3.StringUtils;
|
||||
import org.apache.shiro.authz.annotation.RequiresPermissions;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
import javax.servlet.ServletOutputStream;
|
||||
import javax.servlet.http.HttpServletRequest;
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
import java.io.ByteArrayOutputStream;
|
||||
import java.io.IOException;
|
||||
import java.text.SimpleDateFormat;
|
||||
import java.util.Arrays;
|
||||
import java.util.Date;
|
||||
import java.util.Objects;
|
||||
|
||||
/**
|
||||
* @Description: 批复文号
|
||||
* @Author: jeecg-boot
|
||||
* @Date: 2021-05-12
|
||||
* @Version: V1.0
|
||||
*/
|
||||
@Api(tags="批复文号")
|
||||
@RestController
|
||||
@RequestMapping("/approvalDocumentNumber/approvalDocumentNumber")
|
||||
@Slf4j
|
||||
public class approvalDocumentNumberController extends JeroController<ApprovalDocumentNumber, ApprovalDocumentNumberService> {
|
||||
@Autowired
|
||||
private ApprovalDocumentNumberService tbApprovalDocumentNumberService;
|
||||
@Resource
|
||||
private SystemSendMessageService systemSendMessageService;
|
||||
/**
|
||||
* 分页列表查询
|
||||
*
|
||||
* @param approvalDocumentNumber
|
||||
* @param pageNo
|
||||
* @param pageSize
|
||||
* @param req
|
||||
* @return
|
||||
*/
|
||||
@ApiOperation(value="批复文号-分页列表查询", notes="批复文号-分页列表查询")
|
||||
@GetMapping(value = "/list")
|
||||
@RequiresPermissions("approvalDocumentNumber:search")
|
||||
public Result<?> queryPageList(ApprovalDocumentNumber approvalDocumentNumber,
|
||||
@RequestParam(name="pageNo", defaultValue="1") Integer pageNo,
|
||||
@RequestParam(name="pageSize", defaultValue="10") Integer pageSize,
|
||||
HttpServletRequest req) {
|
||||
IPage<ApprovalDocumentNumber> pageList;
|
||||
try {
|
||||
QueryWrapper<ApprovalDocumentNumber> queryWrapper = QueryGenerator.initQueryWrapper(approvalDocumentNumber, req.getParameterMap());
|
||||
Page<ApprovalDocumentNumber> page = new Page<ApprovalDocumentNumber>(pageNo, pageSize);
|
||||
pageList = tbApprovalDocumentNumberService.page(page, queryWrapper);
|
||||
} catch (JeroBootException e) {
|
||||
e.printStackTrace();
|
||||
return Result.error(500, e.getMessage());
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
return Result.error(500, Result.SYSTEM_IS_BUSY);
|
||||
}
|
||||
return Result.OK(Result.SELECT_SUCCESS, pageList);
|
||||
}
|
||||
|
||||
/**
|
||||
* 分页列表查询
|
||||
*
|
||||
* @param approvalDocumentNumber
|
||||
* @param pageNo
|
||||
* @param pageSize
|
||||
* @param req
|
||||
* @return
|
||||
*/
|
||||
@ApiOperation(value="批复文号-分页列表查询", notes="批复文号-分页列表查询")
|
||||
@GetMapping(value = "/listByCompany")
|
||||
public Result<?> listByCompany(ApprovalDocumentNumber approvalDocumentNumber,
|
||||
@RequestParam(name="pageNo", defaultValue="1") Integer pageNo,
|
||||
@RequestParam(name="pageSize", defaultValue="10") Integer pageSize,
|
||||
HttpServletRequest req) {
|
||||
IPage<ApprovalDocumentNumber> pageList;
|
||||
try {
|
||||
QueryWrapper<ApprovalDocumentNumber> queryWrapper = QueryGenerator.initQueryWrapper(approvalDocumentNumber, req.getParameterMap());
|
||||
Page<ApprovalDocumentNumber> page = new Page<ApprovalDocumentNumber>(pageNo, pageSize);
|
||||
pageList = tbApprovalDocumentNumberService.page(page, queryWrapper);
|
||||
} catch (JeroBootException e) {
|
||||
e.printStackTrace();
|
||||
return Result.error(500, e.getMessage());
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
return Result.error(500, Result.SYSTEM_IS_BUSY);
|
||||
}
|
||||
return Result.OK(Result.SELECT_SUCCESS, pageList);
|
||||
}
|
||||
|
||||
/**
|
||||
* 添加
|
||||
* @param approvalDocumentNumber
|
||||
* @return
|
||||
*/
|
||||
@AutoLog(value = "批复文号-添加")
|
||||
@ApiOperation(value="批复文号-添加", notes="批复文号-添加")
|
||||
@PostMapping(value = "/add")
|
||||
@RequiresPermissions("approvalDocumentNumber:add")
|
||||
public Result<?> add(@RequestBody ApprovalDocumentNumber approvalDocumentNumber) {
|
||||
try {
|
||||
if (StringUtils.isBlank(approvalDocumentNumber.getApprovalDocumentNumber())){
|
||||
return Result.error("请输入批复文号");
|
||||
}else if (approvalDocumentNumber.getApprovalDocumentNumber().length()>50){
|
||||
return Result.error("批复文号最大输入长度为50");
|
||||
}
|
||||
String year = approvalDocumentNumber.getDateYear();
|
||||
if (StringUtils.isBlank(year)){
|
||||
return Result.error("请输入时间");
|
||||
}
|
||||
|
||||
Boolean res = tbApprovalDocumentNumberService.checkOnlyDateYear(year);
|
||||
if(res){
|
||||
return Result.error("一年只有一个批复文号");
|
||||
}
|
||||
|
||||
tbApprovalDocumentNumberService.save(approvalDocumentNumber);
|
||||
} catch (JeroBootException e) {
|
||||
e.printStackTrace();
|
||||
return Result.error(500, e.getMessage());
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
return Result.error(500, Result.SYSTEM_IS_BUSY);
|
||||
}
|
||||
return Result.OK(Result.ADD_SUCCESS);
|
||||
}
|
||||
|
||||
/**
|
||||
* 编辑
|
||||
*
|
||||
* @param approvalDocumentNumber
|
||||
* @return
|
||||
*/
|
||||
@AutoLog(value = "批复文号表-编辑")
|
||||
@ApiOperation(value="批复文号表-编辑", notes="批复文号表-编辑")
|
||||
@PutMapping(value = "/edit")
|
||||
@RequiresPermissions("approvalDocumentNumber:edit")
|
||||
public Result<?> edit(@RequestBody ApprovalDocumentNumber approvalDocumentNumber) {
|
||||
try {
|
||||
ApprovalDocumentNumber newO = tbApprovalDocumentNumberService.getById(approvalDocumentNumber.getId());
|
||||
if (!Objects.equals(newO.getChargeNoticeFileId(),approvalDocumentNumber.getChargeNoticeFileId())) {
|
||||
systemSendMessageService.standardsSend(newO.getDateYear());
|
||||
}
|
||||
tbApprovalDocumentNumberService.updateById(approvalDocumentNumber);
|
||||
} catch (JeroBootException e) {
|
||||
e.printStackTrace();
|
||||
return Result.error(500, e.getMessage());
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
return Result.error(500, Result.SYSTEM_IS_BUSY);
|
||||
}
|
||||
return Result.OK(Result.EDIT_SUCCESS);
|
||||
}
|
||||
|
||||
/**
|
||||
* 通过id删除
|
||||
*
|
||||
* @param id
|
||||
* @return
|
||||
*/
|
||||
@AutoLog(value = "批复文号表-通过id删除")
|
||||
@ApiOperation(value="批复文号表-通过id删除", notes="批复文号表-通过id删除")
|
||||
@DeleteMapping(value = "/delete")
|
||||
@RequiresPermissions("approvalDocumentNumber:delete")
|
||||
public Result<?> delete(@RequestParam(name="id",required=true) String id) {
|
||||
|
||||
try {
|
||||
tbApprovalDocumentNumberService.removeById(id);
|
||||
} catch (JeroBootException e) {
|
||||
e.printStackTrace();
|
||||
return Result.error(500, e.getMessage());
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
return Result.error(500, Result.SYSTEM_IS_BUSY);
|
||||
}
|
||||
return Result.OK(Result.DELETE_SUCCESS);
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 批量删除
|
||||
*
|
||||
* @param ids
|
||||
* @return
|
||||
*/
|
||||
@AutoLog(value = "批复文号表-批量删除")
|
||||
@ApiOperation(value="批复文号表-批量删除", notes="批复文号表-批量删除")
|
||||
@DeleteMapping(value = "/deleteBatch")
|
||||
@RequiresPermissions("approvalDocumentNumber:deleteBatch")
|
||||
public Result<?> deleteBatch(@RequestParam(name="ids",required=true) String ids) {
|
||||
this.tbApprovalDocumentNumberService.removeByIds(Arrays.asList(ids.split(",")));
|
||||
return Result.ok("批量删除成功!");
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询最新的批复文号
|
||||
*
|
||||
* @param
|
||||
* @return
|
||||
*/
|
||||
@ApiOperation(value="批复文号表-查询当前年的批复文号", notes="批复文号表-查询当前年的批复文号")
|
||||
@GetMapping(value = "/queryLatest")
|
||||
public Result<?> queryLatest() {
|
||||
|
||||
ApprovalDocumentNumber approval;
|
||||
try {
|
||||
LambdaQueryWrapper<ApprovalDocumentNumber> wrapperDet = new LambdaQueryWrapper<>();
|
||||
SimpleDateFormat sdf = new SimpleDateFormat("yyyy");
|
||||
Date date = new Date();
|
||||
|
||||
wrapperDet.eq(ApprovalDocumentNumber::getDateYear,sdf.format(date));
|
||||
approval = tbApprovalDocumentNumberService.getOne(wrapperDet);
|
||||
|
||||
if (approval == null) {
|
||||
return Result.error("未找到对应数据");
|
||||
}
|
||||
} catch (JeroBootException e) {
|
||||
e.printStackTrace();
|
||||
return Result.error(500, e.getMessage());
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
return Result.error(500, Result.SYSTEM_IS_BUSY);
|
||||
}
|
||||
return Result.OK(Result.SELECT_SUCCESS, approval);
|
||||
}
|
||||
|
||||
/**
|
||||
* 会员信息表-下载会员批复文件pdf
|
||||
* @param companyName
|
||||
* @param response
|
||||
* @return
|
||||
*/
|
||||
@ApiOperation(value = "会员信息表-下载会员批复文件pdf")
|
||||
@GetMapping(value = "/downloadApprovalPdf")
|
||||
public void downloadApprovalPdf(@RequestParam(name = "companyName", required = true) String companyName,
|
||||
@RequestParam(name = "year", required = true) String year,
|
||||
@RequestParam(name = "EffectiveDate", required = true) String EffectiveDate,
|
||||
HttpServletResponse response) {
|
||||
|
||||
PdfStamper pdfStamper=null;
|
||||
ByteArrayOutputStream bos=null;
|
||||
ServletOutputStream outputStream=null;
|
||||
try {
|
||||
bos = new ByteArrayOutputStream();
|
||||
tbApprovalDocumentNumberService.downloadApprovalPdf(companyName,year,EffectiveDate,pdfStamper,bos);
|
||||
response.setContentType("application/force-download");
|
||||
response.addHeader("Content-Disposition", "attachment;fileName=" + new String("会员批复文件.pdf".getBytes("UTF-8"), "ISO_8859_1"));
|
||||
|
||||
outputStream = response.getOutputStream();
|
||||
outputStream.write(bos.toByteArray());
|
||||
} catch (Exception e) {
|
||||
log.error("报错:",e);
|
||||
} finally {
|
||||
if (bos != null) {
|
||||
try {
|
||||
bos.close();
|
||||
} catch (IOException e) {
|
||||
log.error("报错:",e);
|
||||
}
|
||||
}
|
||||
if (outputStream != null) {
|
||||
try {
|
||||
outputStream.close();
|
||||
} catch (IOException e) {
|
||||
log.error("报错:",e);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
+68
@@ -0,0 +1,68 @@
|
||||
package com.jero.approvalDocumentNumber.entity;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.IdType;
|
||||
import com.baomidou.mybatisplus.annotation.TableId;
|
||||
import com.baomidou.mybatisplus.annotation.TableName;
|
||||
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||
import io.swagger.annotations.ApiModel;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
import lombok.experimental.Accessors;
|
||||
import org.jeecgframework.poi.excel.annotation.Excel;
|
||||
import org.springframework.format.annotation.DateTimeFormat;
|
||||
|
||||
import java.io.Serializable;
|
||||
import java.util.Date;
|
||||
|
||||
/**
|
||||
* @Description: 批复文号表
|
||||
* @Author: jeecg-boot
|
||||
* @Date: 2021-05-12
|
||||
* @Version: V1.0
|
||||
*/
|
||||
@Data
|
||||
@TableName("tb_approval_document_number")
|
||||
@Accessors(chain = true)
|
||||
@EqualsAndHashCode(callSuper = false)
|
||||
@ApiModel(value="tb_approval_document_number对象", description="批复文号表")
|
||||
public class ApprovalDocumentNumber implements Serializable {
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
/**主键*/
|
||||
@TableId(type = IdType.ID_WORKER_STR)
|
||||
@ApiModelProperty(value = "主键")
|
||||
private String id;
|
||||
/**批复文号 */
|
||||
@Excel(name = "批复文号", width = 15)
|
||||
@ApiModelProperty(value = "批复文号")
|
||||
private String approvalDocumentNumber;
|
||||
/**时间(年)*/
|
||||
@Excel(name = "时间(年)", width = 15)
|
||||
@ApiModelProperty(value = "时间(年)")
|
||||
private String dateYear;
|
||||
/**收费通知单id*/
|
||||
@Excel(name = "收费通知单id", width = 15)
|
||||
@ApiModelProperty(value = "收费通知单id")
|
||||
private String chargeNoticeFileId;
|
||||
/**收费通知单名称*/
|
||||
@Excel(name = "收费通知单名称", width = 15)
|
||||
@ApiModelProperty(value = "收费通知单名称")
|
||||
private String chargeNoticeName;
|
||||
/**创建人*/
|
||||
@ApiModelProperty(value = "创建人")
|
||||
private String createBy;
|
||||
/**更新日期*/
|
||||
@JsonFormat(timezone = "GMT+8",pattern = "yyyy-MM-dd HH:mm:ss")
|
||||
@DateTimeFormat(pattern="yyyy-MM-dd HH:mm:ss")
|
||||
@ApiModelProperty(value = "更新日期")
|
||||
private Date updateTime;
|
||||
/**创建日期*/
|
||||
@JsonFormat(timezone = "GMT+8",pattern = "yyyy-MM-dd HH:mm:ss")
|
||||
@DateTimeFormat(pattern="yyyy-MM-dd HH:mm:ss")
|
||||
@ApiModelProperty(value = "创建日期")
|
||||
private Date createTime;
|
||||
/**更新人*/
|
||||
@ApiModelProperty(value = "更新人")
|
||||
private String updateBy;
|
||||
}
|
||||
+15
@@ -0,0 +1,15 @@
|
||||
package com.jero.approvalDocumentNumber.mapper;
|
||||
|
||||
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
import com.jero.approvalDocumentNumber.entity.ApprovalDocumentNumber;
|
||||
|
||||
/**
|
||||
* @Description: 批复文号
|
||||
* @Author: jeecg-boot
|
||||
* @Date: 2021-05-12
|
||||
* @Version: V1.0
|
||||
*/
|
||||
public interface ApprovalDocumentNumberMapper extends BaseMapper<ApprovalDocumentNumber> {
|
||||
|
||||
}
|
||||
+5
@@ -0,0 +1,5 @@
|
||||
<?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.jero.approvalDocumentNumber.mapper.ApprovalDocumentNumberMapper">
|
||||
|
||||
</mapper>
|
||||
+94
@@ -0,0 +1,94 @@
|
||||
package com.jero.approvalDocumentNumber.service;
|
||||
|
||||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||
import com.itextpdf.text.pdf.AcroFields;
|
||||
import com.itextpdf.text.pdf.BaseFont;
|
||||
import com.itextpdf.text.pdf.PdfReader;
|
||||
import com.itextpdf.text.pdf.PdfStamper;
|
||||
import com.jero.approvalDocumentNumber.entity.ApprovalDocumentNumber;
|
||||
import com.jero.approvalDocumentNumber.mapper.ApprovalDocumentNumberMapper;
|
||||
import com.jero.standards.memberinfo.entity.MemberInfo;
|
||||
import com.jero.standards.memberinfo.mapper.MemberInfoMapper;
|
||||
import org.springframework.beans.factory.annotation.Value;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
import java.io.ByteArrayOutputStream;
|
||||
import java.net.URL;
|
||||
import java.text.SimpleDateFormat;
|
||||
|
||||
/**
|
||||
* @Description: 批复文号
|
||||
* @Author: jeecg-boot
|
||||
* @Date: 2021-05-12
|
||||
* @Version: V1.0
|
||||
*/
|
||||
@Service
|
||||
public class ApprovalDocumentNumberService extends ServiceImpl<ApprovalDocumentNumberMapper, ApprovalDocumentNumber> {
|
||||
|
||||
@Resource
|
||||
ApprovalDocumentNumberMapper approvalMapper;
|
||||
@Resource
|
||||
private MemberInfoMapper memberInfoMapper;
|
||||
////pdf模板文件路径
|
||||
//@Value("${template.path.pdf}")
|
||||
//private String templatePath;
|
||||
//@Value("${template.path.font}")
|
||||
//private String fontPath;
|
||||
|
||||
/**
|
||||
* 这一年是否已经存在批准文号
|
||||
* @param dateYear
|
||||
* @return
|
||||
*/
|
||||
public Boolean checkOnlyDateYear(String dateYear){
|
||||
LambdaQueryWrapper<ApprovalDocumentNumber> wrapper = new LambdaQueryWrapper<>();
|
||||
wrapper.eq(ApprovalDocumentNumber::getDateYear, dateYear);
|
||||
Integer count = approvalMapper.selectCount(wrapper);
|
||||
if (count > 0) {
|
||||
return true;
|
||||
}else{
|
||||
return false;
|
||||
}
|
||||
}
|
||||
public void downloadApprovalPdf(String companyName, String year,
|
||||
String effectiveDate, PdfStamper pdfStamper, ByteArrayOutputStream bos) throws Exception {
|
||||
ClassLoader classLoader = ApprovalDocumentNumberService.class.getClassLoader();
|
||||
String fontPath = classLoader.getResource("template/simfang.ttf").getPath();
|
||||
if (fontPath.startsWith("/")){
|
||||
fontPath = fontPath.substring(1);
|
||||
}
|
||||
String templatePath = classLoader.getResource("template/approvalTemplate.pdf").getPath();
|
||||
if (templatePath.startsWith("/")){
|
||||
templatePath = templatePath.substring(1);
|
||||
}
|
||||
/* 使用中文字体 */
|
||||
BaseFont baseFont = BaseFont.createFont(fontPath, BaseFont.IDENTITY_H, BaseFont.NOT_EMBEDDED);
|
||||
|
||||
//模板路径
|
||||
if (templatePath == null) {
|
||||
log.error("会员批复文件pdf模板为空");
|
||||
return;
|
||||
}
|
||||
PdfReader pdfReader = new PdfReader(templatePath);
|
||||
|
||||
pdfStamper = new PdfStamper(pdfReader, bos);
|
||||
|
||||
AcroFields form = pdfStamper.getAcroFields();
|
||||
form.addSubstitutionFont(baseFont);
|
||||
LambdaQueryWrapper<ApprovalDocumentNumber> wrapper = new LambdaQueryWrapper<>();
|
||||
wrapper.eq(ApprovalDocumentNumber::getDateYear,year);
|
||||
ApprovalDocumentNumber approval = approvalMapper.selectOne(wrapper);
|
||||
form.setField("companyName", companyName + ":");
|
||||
form.setField("dateYear", year);
|
||||
form.setField("approvalDocumentNumber", approval.getApprovalDocumentNumber());
|
||||
SimpleDateFormat sdf = new SimpleDateFormat("yyyy年MM月dd日");
|
||||
form.setField("createTime", effectiveDate);
|
||||
//设置不可编辑
|
||||
pdfStamper.setFormFlattening(true);
|
||||
pdfStamper.close();
|
||||
pdfReader.close();
|
||||
}
|
||||
|
||||
}
|
||||
+1
-1
@@ -51,7 +51,7 @@
|
||||
</where>
|
||||
<!-- 标协会员项目-->
|
||||
UNION ALL
|
||||
select tmsub.id,tmember.project_name,tmsub.charge_use,tmember.director_id,su.realname,tmsub.liaison_man_id,tmsub.liaison_man,tmsub.company_name,tmsub.amount_receivable,tmsub.paid_amount,tmsub.invoice_requirements,tmsub.pack,tmsub.in_account,tmsub.make_invoice,tmsub.mail,tmsub.create_time,5,tmsub.mobile,tmsub.email,'',pic.contract_num,tmsub.company_id,tmsub.payment_method,'','','',tmember.year,'',''
|
||||
select tmsub.id,tmember.project_name,tmsub.charge_use,tmember.director_id,su.realname,tmsub.liaison_man_id,tmsub.liaison_man,tmsub.company_name,tmsub.amount_receivable,tmsub.paid_amount,tmsub.invoice_requirements,tmsub.pack,tmsub.in_account,tmsub.make_invoice,tmsub.mail,tmsub.create_time,5,tmsub.mobile,tmsub.email,tmsub.remark,pic.contract_num,tmsub.company_id,tmsub.payment_method,'',tmsub.charge_notice_no,tmsub.charge_notice_id,tmember.year,'',''
|
||||
,tmsub.tax_rate,tmsub.tax,tmsub.no_tax_amount,affirm_income
|
||||
from tb_member_project tmember
|
||||
left join sys_user su on tmember.director_id = su.id
|
||||
|
||||
+17
-8
@@ -208,7 +208,9 @@ public class ITbMemberProjectSubitemService extends ServiceImpl<TbMemberProjectS
|
||||
* 通过id查询
|
||||
*/
|
||||
public TbMemberProjectSubitem queryById(String id) {
|
||||
return getById(id);
|
||||
TbMemberProjectSubitem projectSubitem = getById(id);
|
||||
processData(projectSubitem);
|
||||
return projectSubitem;
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -473,14 +475,21 @@ public class ITbMemberProjectSubitemService extends ServiceImpl<TbMemberProjectS
|
||||
public IPage<TbMemberProjectSubitem> queryPageListCompany(Page<TbMemberProjectSubitem> page, QueryWrapper<TbMemberProjectSubitem> queryWrapper) {
|
||||
IPage<TbMemberProjectSubitem> iPage = baseMapper.queryPageListCompany(page, queryWrapper);
|
||||
for (TbMemberProjectSubitem record : iPage.getRecords()) {
|
||||
Date invalidationDate = record.getInvalidationDate();
|
||||
//如果当前日期大于失效日期,返回失效
|
||||
if (DateUtil.compare(DateUtil.date(),invalidationDate) > 0){
|
||||
record.setEquityStatus(TAKE_EFFECT);
|
||||
}else {
|
||||
record.setEquityStatus(INVALID);
|
||||
}
|
||||
processData(record);
|
||||
}
|
||||
return iPage;
|
||||
}
|
||||
|
||||
/**
|
||||
* 处理数据
|
||||
*/
|
||||
private void processData(TbMemberProjectSubitem record){
|
||||
Date invalidationDate = record.getInvalidationDate();
|
||||
//如果当前日期大于失效日期,返回失效
|
||||
if (DateUtil.compare(DateUtil.date(),invalidationDate) > 0){
|
||||
record.setEquityStatus(TAKE_EFFECT);
|
||||
}else {
|
||||
record.setEquityStatus(INVALID);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
+19
@@ -31,7 +31,11 @@ import com.jero.mail.entity.PayMailBill;
|
||||
import com.jero.mail.entity.PayMailBillProject;
|
||||
import com.jero.mail.service.IPayMailBillProjectService;
|
||||
import com.jero.mail.service.IPayMailBillService;
|
||||
import com.jero.member.entity.TbMemberProject;
|
||||
import com.jero.member.entity.TbMemberProjectFile;
|
||||
import com.jero.member.entity.TbMemberProjectSubitem;
|
||||
import com.jero.member.service.ITbMemberProjectService;
|
||||
import com.jero.member.service.ITbMemberProjectSubitemService;
|
||||
import com.jero.member.service.TbMemberProjectFileService;
|
||||
import com.jero.modules.system.entity.SysUser;
|
||||
import com.jero.modules.system.service.ISysUserService;
|
||||
@@ -110,6 +114,10 @@ public class PayCommonProjectController extends JeroController<PayCommonProject,
|
||||
private IPayDraftingGroupSubItemContactsService payDraftingGroupSubItemContactsService;
|
||||
@Resource
|
||||
private TbMemberProjectFileService tbMemberProjectFileService;
|
||||
@Resource
|
||||
private ITbMemberProjectService tbMemberProjectService;
|
||||
@Resource
|
||||
private ITbMemberProjectSubitemService tbMemberProjectSubitemService;
|
||||
/**
|
||||
* 分页列表查询
|
||||
*
|
||||
@@ -539,6 +547,17 @@ public class PayCommonProjectController extends JeroController<PayCommonProject,
|
||||
List<TbMemberProjectFile> fileList = tbMemberProjectFileService.list(queryPayWorkingGroupDistributionRecord);
|
||||
String fileIds = fileList.stream().map(TbMemberProjectFile::getFileId).collect(Collectors.joining(","));
|
||||
payCommonProject.setFiles(fileIds);
|
||||
//payCommonProject.setChargeStandard(memberProject.getChargeStandard());
|
||||
//payCommonProject.setChargeNoticeFileId(memberProject.getChargeNoticeFileId());
|
||||
//payCommonProject.setCouncilChargeStandard(memberProject.getCouncilChargeStandard());
|
||||
//payCommonProject.setCouncilChargeNoticeNo(memberProject.getCouncilChargeNoticeNo());
|
||||
//payCommonProject.setCouncilChargeNoticeFileId(memberProject.getCouncilChargeNoticeFileId());
|
||||
TbMemberProjectSubitem tbMemberProjectSubitem = tbMemberProjectSubitemService.queryById(id);
|
||||
payCommonProject.setMemberNo(tbMemberProjectSubitem.getMemberNo());
|
||||
payCommonProject.setMemberNature(tbMemberProjectSubitem.getMemberNature());
|
||||
payCommonProject.setEffectiveDate(tbMemberProjectSubitem.getEffectiveDate());
|
||||
payCommonProject.setInvalidationDate(tbMemberProjectSubitem.getInvalidationDate());
|
||||
payCommonProject.setEquityStatus(tbMemberProjectSubitem.getEquityStatus());
|
||||
|
||||
}
|
||||
|
||||
|
||||
+42
@@ -343,4 +343,46 @@ public class PayCommonProject implements Serializable {
|
||||
|
||||
@TableField(exist = false)
|
||||
private Integer adminAddFlag;
|
||||
|
||||
/**
|
||||
* 收费标准
|
||||
*/
|
||||
@TableField(exist = false)
|
||||
@ApiModelProperty(value = "收费标准")
|
||||
private BigDecimal chargeStandard;
|
||||
|
||||
/**
|
||||
* 收费通知文件id
|
||||
*/
|
||||
@TableField(exist = false)
|
||||
@ApiModelProperty(value = "收费通知文件id")
|
||||
private String chargeNoticeFileId;
|
||||
|
||||
/**会员编号*/
|
||||
@TableField(exist = false)
|
||||
@ApiModelProperty(value = "会员编号")
|
||||
private String memberNo;
|
||||
/**会员性质*/
|
||||
@TableField(exist = false)
|
||||
@Dict(dicCode = "member_nature")
|
||||
@ApiModelProperty(value = "会员性质(1-副理事单位,2-理事单位,3-会员单位)")
|
||||
private Integer memberNature;
|
||||
/** 生效日期 */
|
||||
@TableField(exist = false)
|
||||
@ApiModelProperty(value = "生效日期")
|
||||
@JsonFormat(timezone = "GMT+8",pattern = "yyyy-MM-dd")
|
||||
@DateTimeFormat(pattern="yyyy-MM-dd")
|
||||
private Date effectiveDate;
|
||||
/**
|
||||
* 失效日期
|
||||
*/
|
||||
@TableField(exist = false)
|
||||
@ApiModelProperty(value = "失效日期")
|
||||
@JsonFormat(timezone = "GMT+8",pattern = "yyyy-MM-dd")
|
||||
@DateTimeFormat(pattern="yyyy-MM-dd")
|
||||
private Date invalidationDate;
|
||||
|
||||
@ApiModelProperty(value = "权益状态")
|
||||
@TableField(exist = false)
|
||||
private String equityStatus;
|
||||
}
|
||||
|
||||
+3
-21
@@ -23,6 +23,7 @@ import com.jero.modules.system.entity.SysUser;
|
||||
import com.jero.modules.system.service.ISysAnnouncementSendService;
|
||||
import com.jero.modules.system.service.ISysAnnouncementService;
|
||||
import com.jero.modules.system.service.ISysUserService;
|
||||
import com.jero.system.service.SystemSendMessageService;
|
||||
import io.swagger.annotations.Api;
|
||||
import io.swagger.annotations.ApiOperation;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
@@ -70,7 +71,7 @@ public class SystemSendMessageController {
|
||||
@Resource
|
||||
private ISysAnnouncementService sysAnnouncementService;
|
||||
@Resource
|
||||
private SendMessageService sendMessageService;
|
||||
private SystemSendMessageService systemSendMessageService;
|
||||
|
||||
/**
|
||||
* 发送站内消息
|
||||
@@ -144,26 +145,7 @@ public class SystemSendMessageController {
|
||||
@ApiOperation(value = "会员系统更新收费通知单发送消息", notes = "会员系统更新收费通知单发送消息")
|
||||
@GetMapping(value = "/standardsSend")
|
||||
public Result<?> add(String year) {
|
||||
List<PayContactsManagement> listPayContactsManagement = payContactsManagementService.list();
|
||||
if (listPayContactsManagement.isEmpty()) {
|
||||
return Result.OK();
|
||||
}
|
||||
String toUser = listPayContactsManagement.stream().map(item -> PasswordUtil.decrypt(item.getPhone())).collect(Collectors.joining(","));
|
||||
// 发送消息
|
||||
SendMessageDTO sendMessageDTO = new SendMessageDTO();
|
||||
|
||||
HashMap<String, String> map = new HashMap<>();
|
||||
map.put("year", year);
|
||||
sendMessageDTO.setFromUser("BXGLZ");
|
||||
sendMessageDTO.setToUser(toUser);
|
||||
sendMessageDTO.setTemplateCode(CompanyMessageEnums.MSG23.getCode());
|
||||
sendMessageDTO.setTemplateParam(map);
|
||||
sendMessageDTO.setBusType("C_OPEN_TYPE23");
|
||||
JSONObject jsonObject = new JSONObject();
|
||||
//jsonObject.put("id", id);
|
||||
sendMessageDTO.setBusId(jsonObject.toJSONString());
|
||||
sendMessageService.SendMessageService(sendMessageDTO);
|
||||
|
||||
systemSendMessageService.standardsSend(year);
|
||||
return Result.OK();
|
||||
}
|
||||
}
|
||||
|
||||
+49
@@ -0,0 +1,49 @@
|
||||
package com.jero.system.service;
|
||||
|
||||
import com.alibaba.fastjson.JSONObject;
|
||||
import com.jero.common.dto.SendMessageDTO;
|
||||
import com.jero.common.enums.CompanyMessageEnums;
|
||||
import com.jero.common.service.SendMessageService;
|
||||
import com.jero.common.util.PasswordUtil;
|
||||
import com.jero.company.entity.PayContactsManagement;
|
||||
import com.jero.company.service.IPayContactsManagementService;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
import java.util.HashMap;
|
||||
import java.util.List;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
/**
|
||||
* @author liJiaRao
|
||||
* @date 2024-03-21 17:38
|
||||
*/
|
||||
@Service
|
||||
public class SystemSendMessageService {
|
||||
@Resource
|
||||
private IPayContactsManagementService payContactsManagementService;
|
||||
@Resource
|
||||
private SendMessageService sendMessageService;
|
||||
|
||||
public void standardsSend(String year) {
|
||||
List<PayContactsManagement> listPayContactsManagement = payContactsManagementService.list();
|
||||
if (listPayContactsManagement.isEmpty()) {
|
||||
return ;
|
||||
}
|
||||
String toUser = listPayContactsManagement.stream().map(item -> PasswordUtil.decrypt(item.getPhone())).collect(Collectors.joining(","));
|
||||
// 发送消息
|
||||
SendMessageDTO sendMessageDTO = new SendMessageDTO();
|
||||
|
||||
HashMap<String, String> map = new HashMap<>();
|
||||
map.put("year", year);
|
||||
sendMessageDTO.setFromUser("BXGLZ");
|
||||
sendMessageDTO.setToUser(toUser);
|
||||
sendMessageDTO.setTemplateCode(CompanyMessageEnums.MSG23.getCode());
|
||||
sendMessageDTO.setTemplateParam(map);
|
||||
sendMessageDTO.setBusType("C_OPEN_TYPE23");
|
||||
JSONObject jsonObject = new JSONObject();
|
||||
sendMessageDTO.setBusId(jsonObject.toJSONString());
|
||||
sendMessageService.SendMessageService(sendMessageDTO);
|
||||
|
||||
}
|
||||
}
|
||||
+6
@@ -1,9 +1,15 @@
|
||||
package com.jero.modules.system.service.impl;
|
||||
|
||||
import java.util.HashMap;
|
||||
import java.util.List;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
|
||||
import com.alibaba.fastjson.JSONObject;
|
||||
import com.jero.common.api.vo.Result;
|
||||
import com.jero.common.util.PasswordUtil;
|
||||
import com.jero.modules.pay.company.entity.PayContactsManagement;
|
||||
import com.jero.modules.system.entity.SysAnnouncementSend;
|
||||
import com.jero.modules.system.mapper.SysAnnouncementSendMapper;
|
||||
import com.jero.modules.system.model.AnnouncementSendModel;
|
||||
|
||||
Binary file not shown.
Binary file not shown.
@@ -308,6 +308,7 @@
|
||||
<nonFilteredFileExtension>eot</nonFilteredFileExtension>
|
||||
<nonFilteredFileExtension>ttf</nonFilteredFileExtension>
|
||||
<nonFilteredFileExtension>svg</nonFilteredFileExtension>
|
||||
<nonFilteredFileExtension>pdf</nonFilteredFileExtension>
|
||||
</nonFilteredFileExtensions>
|
||||
</configuration>
|
||||
</plugin>
|
||||
|
||||
Reference in New Issue
Block a user