消息修改
This commit is contained in:
@@ -1,6 +1,10 @@
|
||||
package com.jero.common.common;
|
||||
|
||||
public class ProjectCommon {
|
||||
/**
|
||||
* 超级管理员
|
||||
*/
|
||||
public final static String ADMIN = "admin";
|
||||
/**
|
||||
* 打包(1:是,0:否)
|
||||
*/
|
||||
|
||||
+8
@@ -23,4 +23,12 @@ public interface ProjectDetailMapper {
|
||||
* @Exception
|
||||
*/
|
||||
List<PayCommonProject> queryProjectList(List<String> list);
|
||||
|
||||
/**
|
||||
* @Description 查询应收不等于实收的项目
|
||||
* @Author lqt
|
||||
* @Date 2021/9/27
|
||||
* @Exception
|
||||
*/
|
||||
List<PayCommonProject> queryProjectReceivableNotEqualsPaid();
|
||||
}
|
||||
|
||||
+48
@@ -117,4 +117,52 @@
|
||||
</if>
|
||||
</where>
|
||||
</select>
|
||||
|
||||
<select id="queryProjectReceivableNotEqualsPaid" resultType="com.jero.project.entity.PayCommonProject">
|
||||
<!-- 普通项目-->
|
||||
select c.id,c.charge_project,pcmt.phone as phone,pcmt.email as email
|
||||
from pay_common_project c
|
||||
left join pay_contacts_management_temporary pcmt on c.contacts_temporary_id = pcmt.id
|
||||
where if(receivable_amount is null or receivable_amount = '',0,receivable_amount) >
|
||||
if(paid_amount is null or paid_amount = '',0,paid_amount)
|
||||
<!--工作组项目-->
|
||||
UNION ALL
|
||||
select gsub.id,g.working_group_project,pcmt.phone as phone,pcmt.email as email
|
||||
from pay_working_group g
|
||||
inner join pay_working_group_subitem gsub on g.id = gsub.working_group_id
|
||||
left join pay_contacts_management_temporary pcmt on gsub.contacts_temporary_id_one = pcmt.id
|
||||
where if(receivable_amount is null or receivable_amount = '',0,receivable_amount) >
|
||||
if(paid_amount is null or paid_amount = '',0,paid_amount)
|
||||
<!-- 会议项目-->
|
||||
UNION ALL
|
||||
select sit.id,meeting.meeting_name,pcmt.phone as phone,pcmt.email as email
|
||||
from pay_meeting meeting
|
||||
inner join pay_meeting_situation sit on meeting.id = sit.meeting_id
|
||||
left join pay_contacts_management_temporary pcmt on sit.company_contact_temporary_id = pcmt.id
|
||||
where if(amount_receivable is null or amount_receivable = '',0,amount_receivable) >
|
||||
if(paid_amount is null or paid_amount = '',0,paid_amount)
|
||||
<where>
|
||||
<if test="list != null and list.size() > 0">
|
||||
AND sit.id in
|
||||
<foreach collection="list" index="index" item="item" open="(" close=")" separator=",">
|
||||
#{item}
|
||||
</foreach>
|
||||
</if>
|
||||
</where>
|
||||
<!-- 会员项目-->
|
||||
UNION ALL
|
||||
select msub.id,pmp.project_name,pcmt.phone as phone,pcmt.email as email
|
||||
from pay_member_project pmp
|
||||
inner join pay_member_project_subitem msub on pmp.id = msub.project_id
|
||||
left join pay_contacts_management_temporary pcmt on msub.company_contact_temporary_id = pcmt.id
|
||||
where if(amount_receivable is null or amount_receivable = '',0,amount_receivable) >
|
||||
if(paid_amount is null or paid_amount = '',0,paid_amount)
|
||||
<!-- 标协会员项目-->
|
||||
UNION ALL
|
||||
select tmsub.id,tmember.project_name,tmsub.mobile as phone,tmsub.email as email
|
||||
from tb_member_project tmember
|
||||
inner join tb_member_project_subitem tmsub on tmember.id = tmsub.project_id
|
||||
where if(amount_receivable is null or amount_receivable = '',0,amount_receivable) >
|
||||
if(paid_amount is null or paid_amount = '',0,paid_amount)
|
||||
</select>
|
||||
</mapper>
|
||||
+17
@@ -0,0 +1,17 @@
|
||||
package com.jero.common.service;
|
||||
|
||||
import com.jero.project.entity.PayCommonProject;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
public interface ProjectReceivableNotEqualsPaidService {
|
||||
|
||||
/**
|
||||
* @Description 查询应收不等于实收的项目
|
||||
* @Author lqt
|
||||
* @Date 2021/9/27
|
||||
* @Exception
|
||||
*/
|
||||
List<PayCommonProject> queryProjectReceivableNotEqualsPaid();
|
||||
|
||||
}
|
||||
+11
-1
@@ -1,5 +1,7 @@
|
||||
package com.jero.common.service.impl;
|
||||
|
||||
import com.alibaba.fastjson.JSON;
|
||||
import com.alibaba.fastjson.JSONArray;
|
||||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||
import com.jero.common.common.ProjectCommon;
|
||||
import com.jero.common.exception.JeroBootException;
|
||||
@@ -7,6 +9,7 @@ import com.jero.common.mapper.ProjectDetailMapper;
|
||||
import com.jero.common.service.ProjectDetailService;
|
||||
import com.jero.common.system.api.ISysBaseAPI;
|
||||
import com.jero.common.util.PasswordUtil;
|
||||
import com.jero.common.vo.PayMailBillVO;
|
||||
import com.jero.common.vo.ProjectDetailVO;
|
||||
import com.jero.common.vo.ProjectStatusVO;
|
||||
import com.jero.company.entity.PayCompanyManagement;
|
||||
@@ -190,7 +193,14 @@ public class ProjectDetailServiceImpl implements ProjectDetailService {
|
||||
// 开票邮寄记录
|
||||
List<PayMailBill> listMailBillVO = payMailBillService.selectMailBillVO(projectId);
|
||||
if(!CollectionUtils.isEmpty(listMailBillVO)){
|
||||
projectDetailVO.setMailBill(listMailBillVO);
|
||||
String str = JSON.toJSONString(listMailBillVO);
|
||||
List<PayMailBillVO> listPayMailBillVO = JSONArray.parseArray(str,PayMailBillVO.class);
|
||||
listPayMailBillVO.forEach(p->{
|
||||
if(!Objects.isNull(p.getPostStatus())){
|
||||
p.setPostStatus_dictText(sysBaseAPI.translateDict("mail_type",String.valueOf(p.getPostStatus())));
|
||||
}
|
||||
});
|
||||
projectDetailVO.setMailBill(listPayMailBillVO);
|
||||
}
|
||||
return projectDetailVO;
|
||||
}
|
||||
|
||||
+21
@@ -0,0 +1,21 @@
|
||||
package com.jero.common.service.impl;
|
||||
|
||||
import com.jero.common.mapper.ProjectDetailMapper;
|
||||
import com.jero.common.service.ProjectReceivableNotEqualsPaidService;
|
||||
import com.jero.project.entity.PayCommonProject;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
import java.util.List;
|
||||
|
||||
@Service
|
||||
public class ProjectReceivableNotEqualsPaidServiceImpl implements ProjectReceivableNotEqualsPaidService {
|
||||
|
||||
@Resource
|
||||
private ProjectDetailMapper projectDetailMapper;
|
||||
|
||||
@Override
|
||||
public List<PayCommonProject> queryProjectReceivableNotEqualsPaid() {
|
||||
return projectDetailMapper.queryProjectReceivableNotEqualsPaid();
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,41 @@
|
||||
package com.jero.common.vo;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.IdType;
|
||||
import com.baomidou.mybatisplus.annotation.TableField;
|
||||
import com.baomidou.mybatisplus.annotation.TableId;
|
||||
import com.baomidou.mybatisplus.annotation.TableName;
|
||||
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||
import com.fasterxml.jackson.annotation.JsonProperty;
|
||||
import com.jero.common.aspect.annotation.Dict;
|
||||
import com.jero.mail.entity.PayMailBill;
|
||||
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 javax.validation.constraints.DecimalMax;
|
||||
import javax.validation.constraints.NotNull;
|
||||
import java.io.Serializable;
|
||||
import java.math.BigDecimal;
|
||||
|
||||
/**
|
||||
* @Description: pay_mail_bill
|
||||
* @Author: jeecg-boot
|
||||
* @Date: 2021-09-02
|
||||
* @Version: V1.0
|
||||
*/
|
||||
@Data
|
||||
@TableName("pay_mail_bill")
|
||||
@Accessors(chain = true)
|
||||
@EqualsAndHashCode(callSuper = false)
|
||||
@ApiModel(value="pay_mail_bill对象", description="pay_mail_bill")
|
||||
public class PayMailBillVO extends PayMailBill implements Serializable {
|
||||
|
||||
/**邮寄状态(0:未邮寄,1::已邮寄)*/
|
||||
@Dict(dicCode = "mail_type")
|
||||
@ApiModelProperty(value = "邮寄状态")
|
||||
private String postStatus_dictText;
|
||||
}
|
||||
@@ -139,6 +139,6 @@ public class ProjectDetailVO implements Serializable {
|
||||
* 开票邮寄记录
|
||||
*/
|
||||
@ApiModelProperty(value = "开票邮寄记录")
|
||||
private List<PayMailBill> mailBill;
|
||||
private List<PayMailBillVO> mailBill;
|
||||
|
||||
}
|
||||
|
||||
-8
@@ -26,20 +26,12 @@ import com.jero.project.vo.PayWorkingGroupVO;
|
||||
import com.jero.project.service.IPayWorkingGroupService;
|
||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import com.jero.modules.system.entity.SysUser;
|
||||
import com.jero.modules.system.service.ISysUserService;
|
||||
import com.jero.project.service.IPayWorkingGroupSubItemService;
|
||||
import com.jero.util.AmountUtil;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.apache.commons.collections.CollectionUtils;
|
||||
import org.apache.commons.lang3.StringUtils;
|
||||
import org.apache.shiro.SecurityUtils;
|
||||
import org.apache.shiro.authz.annotation.RequiresPermissions;
|
||||
import org.jeecgframework.poi.excel.def.NormalExcelConstants;
|
||||
import org.jeecgframework.poi.excel.entity.ExportParams;
|
||||
import org.jeecgframework.poi.excel.view.JeecgEntityExcelView;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.beans.factory.annotation.Value;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
import org.springframework.web.servlet.ModelAndView;
|
||||
import io.swagger.annotations.Api;
|
||||
|
||||
@@ -0,0 +1,58 @@
|
||||
package com.jero.quartz.job;
|
||||
|
||||
import com.jero.common.common.ProjectCommon;
|
||||
import com.jero.common.dto.SendMessageDTO;
|
||||
import com.jero.common.enums.CompanyMessageEnums;
|
||||
import com.jero.common.service.ProjectReceivableNotEqualsPaidService;
|
||||
import com.jero.common.service.SendMessageService;
|
||||
import com.jero.common.util.PasswordUtil;
|
||||
import com.jero.project.entity.PayCommonProject;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.apache.commons.collections.CollectionUtils;
|
||||
import org.apache.commons.lang3.StringUtils;
|
||||
import org.quartz.Job;
|
||||
import org.quartz.JobExecutionContext;
|
||||
import org.quartz.JobExecutionException;
|
||||
import javax.annotation.Resource;
|
||||
import java.util.HashMap;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* @Description 系统催款
|
||||
* @Author lqt
|
||||
* @Date 2021/9/27
|
||||
*/
|
||||
@Slf4j
|
||||
public class RemindersAllJob implements Job {
|
||||
|
||||
@Resource
|
||||
private ProjectReceivableNotEqualsPaidService projectReceivableNotEqualsPaidService;
|
||||
@Resource
|
||||
private SendMessageService sendMessageService;
|
||||
|
||||
@Override
|
||||
public void execute(JobExecutionContext jobExecutionContext) throws JobExecutionException {
|
||||
// 调用催款
|
||||
List<PayCommonProject> list = projectReceivableNotEqualsPaidService.queryProjectReceivableNotEqualsPaid();
|
||||
if(!CollectionUtils.isEmpty(list)){
|
||||
list.forEach(p->{
|
||||
log.info(p.getChargeProject() + "=============发送消息");
|
||||
// 发送消息
|
||||
// SendMessageDTO sendMessageDTO = new SendMessageDTO();
|
||||
// if(!StringUtils.isBlank(p.getEmail())){
|
||||
// sendMessageDTO.setEmail(PasswordUtil.decrypt(p.getEmail()));
|
||||
// }
|
||||
// if(!StringUtils.isBlank(p.getPhone())){
|
||||
// sendMessageDTO.setPhone(PasswordUtil.decrypt(p.getPhone()));
|
||||
// sendMessageDTO.setToUser(PasswordUtil.decrypt(p.getPhone()));
|
||||
// }
|
||||
// HashMap<String,String> map = new HashMap<>();
|
||||
// map.put("projectName",p.getChargeProject());
|
||||
// sendMessageDTO.setFromUser(ProjectCommon.ADMIN);
|
||||
// sendMessageDTO.setTemplateCode(CompanyMessageEnums.MSG11.getCode());
|
||||
// sendMessageDTO.setTemplateParam(map);
|
||||
// sendMessageService.SendMessageService(sendMessageDTO);
|
||||
});
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,16 @@
|
||||
package com.jero.system;
|
||||
|
||||
public class SystemRemindersCommon {
|
||||
/**
|
||||
* 频率 (1:仅一此,2:每月一次,3:每年一次)
|
||||
*/
|
||||
public final static Integer FREQUENCY1 = 1;
|
||||
/**
|
||||
* 频率 (1:仅一此,2:每月一次,3:每年一次)
|
||||
*/
|
||||
public final static Integer FREQUENCY2 = 2;
|
||||
/**
|
||||
* 频率 (1:仅一此,2:每月一次,3:每年一次)
|
||||
*/
|
||||
public final static Integer FREQUENCY3 = 4;
|
||||
}
|
||||
+84
@@ -0,0 +1,84 @@
|
||||
package com.jero.system.controller;
|
||||
|
||||
import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper;
|
||||
import com.jero.common.api.vo.Result;
|
||||
import com.jero.common.aspect.annotation.AutoLog;
|
||||
import com.jero.mail.service.IPayMailBillService;
|
||||
import com.jero.modules.quartz.entity.QuartzJob;
|
||||
import com.jero.modules.quartz.service.IQuartzJobService;
|
||||
import com.jero.payment.service.IPayPaymentRecordService;
|
||||
import com.jero.system.SystemRemindersCommon;
|
||||
import com.jero.system.vo.SystemRemindersVO;
|
||||
import io.swagger.annotations.Api;
|
||||
import io.swagger.annotations.ApiOperation;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
import java.time.LocalDate;
|
||||
import java.util.Calendar;
|
||||
import java.util.Date;
|
||||
import java.util.Objects;
|
||||
|
||||
|
||||
/**
|
||||
* @Description: 系统催款
|
||||
* @Author: jeecg-boot
|
||||
* @Date: 2021-09-24
|
||||
* @Version: V1.0
|
||||
*/
|
||||
@Api(tags="系统催款")
|
||||
@RestController
|
||||
@RequestMapping("/reminders")
|
||||
@Slf4j
|
||||
public class SystemRemindersController {
|
||||
|
||||
@Resource
|
||||
private IPayPaymentRecordService payPaymentRecordService;
|
||||
|
||||
@Resource
|
||||
private IQuartzJobService quartzJobService;
|
||||
|
||||
private static final String id = "1442663790058471425";
|
||||
|
||||
/**
|
||||
* 系统催款
|
||||
*
|
||||
* @return
|
||||
*/
|
||||
@AutoLog(value = "系统催款-编辑")
|
||||
@ApiOperation(value="系统催款-编辑", notes="首页-编辑")
|
||||
@PostMapping(value = "/edit")
|
||||
public Result<?> edit(@RequestBody SystemRemindersVO systemRemindersVO) {
|
||||
// 每年
|
||||
String year = "0 0 0 ${day} ${month} ? *";
|
||||
// 每月
|
||||
String month = "0 0 0 ${day} * ?";
|
||||
// 指定日期执行一次
|
||||
String day = "0 0 0 ${day} ${month} ? ${year}";
|
||||
if(Objects.isNull(systemRemindersVO.getFrequency())){
|
||||
return Result.error("频率不能为空");
|
||||
}
|
||||
if(Objects.isNull(systemRemindersVO.getTime())){
|
||||
return Result.error("催款时间不能为空");
|
||||
}
|
||||
String cron = "";
|
||||
// 频率 (1:仅一此,2:每月一次,3:每年一次)
|
||||
if(Objects.equals(systemRemindersVO.getFrequency(),SystemRemindersCommon.FREQUENCY1)){
|
||||
String[] t = systemRemindersVO.getTime().split("-");
|
||||
Calendar now = Calendar.getInstance();
|
||||
cron = day.replace("${day}",t[1]).replace("${month}",t[0]).replace("${year}",String.valueOf(now.get(Calendar.YEAR)));
|
||||
}else if(Objects.equals(systemRemindersVO.getFrequency(),SystemRemindersCommon.FREQUENCY2)){
|
||||
cron = month.replace("${day}",systemRemindersVO.getTime());
|
||||
}else if(Objects.equals(systemRemindersVO.getFrequency(),SystemRemindersCommon.FREQUENCY3)){
|
||||
String[] t = systemRemindersVO.getTime().split("-");
|
||||
cron = year.replace("${day}",t[1]).replace("${month}",t[0]);
|
||||
}
|
||||
LambdaUpdateWrapper<QuartzJob> update = new LambdaUpdateWrapper<>();
|
||||
update.eq(QuartzJob::getId,id);
|
||||
update.set(QuartzJob::getCronExpression,cron);
|
||||
quartzJobService.update(update);
|
||||
return Result.OK("操作成功");
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,20 @@
|
||||
package com.jero.system.vo;
|
||||
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.Data;
|
||||
import java.io.Serializable;
|
||||
|
||||
@Data
|
||||
public class SystemRemindersVO implements Serializable {
|
||||
/**
|
||||
* 频率 (1:仅一此,2:每月一次,3:每年一次)
|
||||
*/
|
||||
@ApiModelProperty(value = "频率")
|
||||
private Integer frequency;
|
||||
/**
|
||||
* 催款时间
|
||||
*/
|
||||
@ApiModelProperty(value = "催款时间")
|
||||
private String time;
|
||||
|
||||
}
|
||||
@@ -15,25 +15,32 @@ import java.util.Date;
|
||||
public class CronUtil {
|
||||
|
||||
/**
|
||||
* 每年时间format格式
|
||||
* 每年执行
|
||||
*/
|
||||
private static final String DATEFORMAT_YEAR = "ss mm HH dd MM ? yyyy";
|
||||
|
||||
private static final String DATE_FORMAT_YEAR = "ss mm HH dd MM ? *";
|
||||
/**
|
||||
* 每月执行
|
||||
*/
|
||||
private static final String DATE_FORMAT_MONTH = "ss mm HH dd * ?";
|
||||
/**
|
||||
* 指定某一天执行
|
||||
*/
|
||||
private static final String DATE_FORMAT_DAY = "ss mm HH dd * ? ";
|
||||
/**
|
||||
* 每天时间format格式
|
||||
*/
|
||||
private static final String DATEFORMAT_EVERYDAY = "ss mm HH * * ?";
|
||||
private static final String DATE_FORMAT_EVERYDAY = "ss mm HH * * ?";
|
||||
|
||||
/**
|
||||
* 每周时间format格式
|
||||
*/
|
||||
private static final String DATEFORMAT_SUN = "ss mm HH ? * 1";
|
||||
private static final String DATEFORMAT_MON = "ss mm HH ? * 2";
|
||||
private static final String DATEFORMAT_TUE = "ss mm HH ? * 3";
|
||||
private static final String DATEFORMAT_WED = "ss mm HH ? * 4";
|
||||
private static final String DATEFORMAT_THU = "ss mm HH ? * 5";
|
||||
private static final String DATEFORMAT_FRI = "ss mm HH ? * 6";
|
||||
private static final String DATEFORMAT_SAT = "ss mm HH ? * 7";
|
||||
private static final String DATE_FORMAT_SUN = "ss mm HH ? * 1";
|
||||
private static final String DATE_FORMAT_MON = "ss mm HH ? * 2";
|
||||
private static final String DATE_FORMAT_TUE = "ss mm HH ? * 3";
|
||||
private static final String DATE_FORMAT_WED = "ss mm HH ? * 4";
|
||||
private static final String DATE_FORMAT_THU = "ss mm HH ? * 5";
|
||||
private static final String DATE_FORMAT_FRI = "ss mm HH ? * 6";
|
||||
private static final String DATE_FORMAT_SAT = "ss mm HH ? * 7";
|
||||
|
||||
|
||||
/***
|
||||
@@ -84,25 +91,25 @@ public class CronUtil {
|
||||
* @return
|
||||
*/
|
||||
public static String getCronByYear(String date, String dateFormat) {
|
||||
Date parse = DateUtil.parse(date, "yyyy-MM-dd HH:mm:ss");
|
||||
Date parse = DateUtil.parse(date, "MM-dd HH:mm:ss");
|
||||
return formatDateByPattern(parse, dateFormat);
|
||||
}
|
||||
|
||||
|
||||
public static void main(String[] args) {
|
||||
String cron = getCron(new Date(), DATEFORMAT_TUE);
|
||||
System.out.println(cron);
|
||||
// String cron = getCron(new Date(), DATE_FORMAT_YEAR);
|
||||
// System.out.println(cron);
|
||||
//
|
||||
// String cron1 = getCron(new Date(), DATEFORMAT_EVERYDAY);
|
||||
// System.out.println(cron1);
|
||||
//
|
||||
// String cron2 = getCron(new Date(), DATEFORMAT_YEAR);
|
||||
// System.out.println(cron2);
|
||||
//
|
||||
// String cron4 = getCron("12:12:12", DATEFORMAT_EVERYDAY);
|
||||
// System.out.println(cron4);
|
||||
|
||||
String cron1 = getCron(new Date(), DATEFORMAT_EVERYDAY);
|
||||
System.out.println(cron1);
|
||||
|
||||
String cron2 = getCron(new Date(), DATEFORMAT_YEAR);
|
||||
System.out.println(cron2);
|
||||
|
||||
String cron4 = getCron("12:12:12", DATEFORMAT_EVERYDAY);
|
||||
System.out.println(cron4);
|
||||
|
||||
String cron5 = getCronByYear("2020-9-11 12:12:12", DATEFORMAT_YEAR);
|
||||
String cron5 = getCronByYear("09-11 12:12:12", DATE_FORMAT_YEAR);
|
||||
System.out.println(cron5);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user