Commit aba92717 by 邓实川 Committed by chenzg

企业中心实体、controller

短信提醒优化更新,限制用户先充钱再使用
parent f5151aee
...@@ -80,7 +80,9 @@ public class QyzxInvoiceData extends Model<QyzxInvoiceData>{ ...@@ -80,7 +80,9 @@ public class QyzxInvoiceData extends Model<QyzxInvoiceData>{
private String consigneePhone; private String consigneePhone;
@ApiModelProperty(value="邮箱",example="13144400255@163.com") @ApiModelProperty(value="邮箱",example="13144400255@163.com")
private String email; private String email;
@ApiModelProperty(value="收货地址",example="白云东平伯曼酒店") @ApiModelProperty(value="收货地址省市区",example="广东省/广州市/白云区")
private String shippingArea;
@ApiModelProperty(value="收货详细地址",example="白云东平伯曼酒店")
private String shippingAddress; private String shippingAddress;
@ApiModelProperty(value="邮编",example="510080") @ApiModelProperty(value="邮编",example="510080")
private String zipCode; private String zipCode;
......
...@@ -75,15 +75,6 @@ public class QyzxOrderRecord extends Model<QyzxOrderRecord>{ ...@@ -75,15 +75,6 @@ public class QyzxOrderRecord extends Model<QyzxOrderRecord>{
@ApiModelProperty(value="公司",example="117") @ApiModelProperty(value="公司",example="117")
private Integer orgCode; private Integer orgCode;
@ApiModelProperty(value="排序",example="")
private Integer sort;
@ApiModelProperty(value="模块状态",example="默认0-开启,1-关闭")
private Integer status;
@ApiModelProperty(value="是否删除",example="默认0-未删除,1-删除")
private Integer isDelete;
@TableField(fill = FieldFill.INSERT) @TableField(fill = FieldFill.INSERT)
@ApiModelProperty(value="创建时间 ",example="") @ApiModelProperty(value="创建时间 ",example="")
private Date createTime; private Date createTime;
...@@ -91,11 +82,4 @@ public class QyzxOrderRecord extends Model<QyzxOrderRecord>{ ...@@ -91,11 +82,4 @@ public class QyzxOrderRecord extends Model<QyzxOrderRecord>{
@ApiModelProperty(value="创建人 ",example="") @ApiModelProperty(value="创建人 ",example="")
private Integer createUser; private Integer createUser;
@TableField(fill = FieldFill.INSERT_UPDATE)
@ApiModelProperty(value="修改时间 ",example="")
private Date modifyTime;
@ApiModelProperty(value="修改人 ",example="")
private Integer modifyUser;
} }
...@@ -55,8 +55,8 @@ public class QyzxRemainingQuantity extends Model<QyzxRemainingQuantity>{ ...@@ -55,8 +55,8 @@ public class QyzxRemainingQuantity extends Model<QyzxRemainingQuantity>{
@ApiModelProperty(value="付费模块id",example="1") @ApiModelProperty(value="付费模块id",example="1")
private Integer pmid; private Integer pmid;
@ApiModelProperty(value="付费内容id",example="1") // @ApiModelProperty(value="付费内容id",example="1")
private Integer pcid; // private Integer pcid;
@ApiModelProperty(value="订单号",example="1") @ApiModelProperty(value="订单号",example="1")
private String orderNo; private String orderNo;
...@@ -85,12 +85,6 @@ public class QyzxRemainingQuantity extends Model<QyzxRemainingQuantity>{ ...@@ -85,12 +85,6 @@ public class QyzxRemainingQuantity extends Model<QyzxRemainingQuantity>{
@ApiModelProperty(value="企业",example="117") @ApiModelProperty(value="企业",example="117")
private Integer orgCode; private Integer orgCode;
@ApiModelProperty(value="排序",example="")
private String sort;
@ApiModelProperty(value="模块状态",example="默认0-开启,1-关闭")
private Integer status;
@ApiModelProperty(value="是否删除",example="默认0-未删除,1-删除") @ApiModelProperty(value="是否删除",example="默认0-未删除,1-删除")
private Integer isDelete; private Integer isDelete;
...@@ -101,12 +95,4 @@ public class QyzxRemainingQuantity extends Model<QyzxRemainingQuantity>{ ...@@ -101,12 +95,4 @@ public class QyzxRemainingQuantity extends Model<QyzxRemainingQuantity>{
@ApiModelProperty(value="创建人 ",example="") @ApiModelProperty(value="创建人 ",example="")
private Integer createUser; private Integer createUser;
@TableField(fill = FieldFill.INSERT_UPDATE)
@ApiModelProperty(value="修改时间 ",example="")
private Date modifyTime;
@ApiModelProperty(value="修改人 ",example="")
private Integer modifyUser;
} }
...@@ -52,7 +52,7 @@ public class QyzxUseRecord extends Model<QyzxUseRecord>{ ...@@ -52,7 +52,7 @@ public class QyzxUseRecord extends Model<QyzxUseRecord>{
@ApiModelProperty(value="主键",example="1") @ApiModelProperty(value="主键",example="1")
private Integer id; private Integer id;
@ApiModelProperty(value="模块id",example="1") @ApiModelProperty(value="模块id 0-无 1-短信 2-电子合同 3-系统续费",example="1")
private Integer pmid; private Integer pmid;
@ApiModelProperty(value="订单号",example="1") @ApiModelProperty(value="订单号",example="1")
...@@ -61,18 +61,15 @@ public class QyzxUseRecord extends Model<QyzxUseRecord>{ ...@@ -61,18 +61,15 @@ public class QyzxUseRecord extends Model<QyzxUseRecord>{
@ApiModelProperty(value="使用场景",example="1") @ApiModelProperty(value="使用场景",example="1")
private Integer scene; private Integer scene;
@ApiModelProperty(value="使用数量",example="1")
private Integer useNum;
@ApiModelProperty(value="原始总量",example="500") @ApiModelProperty(value="原始总量",example="500")
private Integer originalTotalNum; private Integer originalTotalNum;
@ApiModelProperty(value="当前总量",example="499") @ApiModelProperty(value="当前总量",example="499")
private Integer nowTotalNum; private Integer nowTotalNum;
@ApiModelProperty(value="模块状态",example="默认0-开启,1-关闭")
private Integer status;
@ApiModelProperty(value="排序",example="")
private String sort;
@ApiModelProperty(value="是否删除",example="默认0-未删除,1-删除") @ApiModelProperty(value="是否删除",example="默认0-未删除,1-删除")
private Integer isDelete; private Integer isDelete;
...@@ -82,11 +79,4 @@ public class QyzxUseRecord extends Model<QyzxUseRecord>{ ...@@ -82,11 +79,4 @@ public class QyzxUseRecord extends Model<QyzxUseRecord>{
@ApiModelProperty(value="创建人 ",example="") @ApiModelProperty(value="创建人 ",example="")
private Integer createUser; private Integer createUser;
@TableField(fill = FieldFill.INSERT_UPDATE)
@ApiModelProperty(value="修改时间 ",example="")
private Date modifyTime;
@ApiModelProperty(value="修改人 ",example="")
private Integer modifyUser;
} }
...@@ -118,7 +118,7 @@ public class WxCallBackController { ...@@ -118,7 +118,7 @@ public class WxCallBackController {
quantity.setRemainder(totalNum); // 套餐剩余数(同上) quantity.setRemainder(totalNum); // 套餐剩余数(同上)
quantity.setCount(count); // 购买数量 quantity.setCount(count); // 购买数量
quantity.setPmid(pmid); // 付费模块id quantity.setPmid(pmid); // 付费模块id
quantity.setPcid(pcid); // 付费内容id // quantity.setPcid(pcid); // 付费内容id
quantity.setCreateUser(createdUser); quantity.setCreateUser(createdUser);
quantity.setOrgCode(orgCode); quantity.setOrgCode(orgCode);
quantity.insert(); quantity.insert();
......
...@@ -2,6 +2,7 @@ package cn.timer.api.controller; ...@@ -2,6 +2,7 @@ package cn.timer.api.controller;
import java.io.IOException; import java.io.IOException;
import java.util.ArrayList; import java.util.ArrayList;
import java.util.Date;
import java.util.List; import java.util.List;
import java.util.stream.Stream; import java.util.stream.Stream;
...@@ -28,7 +29,8 @@ import cn.hutool.core.util.StrUtil; ...@@ -28,7 +29,8 @@ import cn.hutool.core.util.StrUtil;
import cn.timer.api.bean.qyzx.QyzxEmpEntAsso; import cn.timer.api.bean.qyzx.QyzxEmpEntAsso;
import cn.timer.api.bean.qyzx.QyzxEmpLogin; import cn.timer.api.bean.qyzx.QyzxEmpLogin;
import cn.timer.api.bean.qyzx.QyzxEntInfoM; import cn.timer.api.bean.qyzx.QyzxEntInfoM;
import cn.timer.api.bean.qyzx.QyzxSms;
import cn.timer.api.bean.qyzx.businessService.QyzxRemainingQuantity;
import cn.timer.api.bean.yggl.YgglMainEmp; import cn.timer.api.bean.yggl.YgglMainEmp;
import cn.timer.api.bean.zzgl.ZzglAuth; import cn.timer.api.bean.zzgl.ZzglAuth;
import cn.timer.api.bean.zzgl.ZzglBmgwM; import cn.timer.api.bean.zzgl.ZzglBmgwM;
...@@ -85,36 +87,61 @@ public class LoginController { ...@@ -85,36 +87,61 @@ public class LoginController {
@ApiOperation(value = "1.发送验证码", httpMethod = "POST", notes = "接口发布说明") @ApiOperation(value = "1.发送验证码", httpMethod = "POST", notes = "接口发布说明")
@ApiOperationSupport(order = 1) @ApiOperationSupport(order = 1)
public Result<String> sendCode(@RequestBody EntRegisterDto entRegisterDto) { public Result<String> sendCode(@RequestBody EntRegisterDto entRegisterDto) {
String phone = entRegisterDto.getPhone();
Integer orgCode = QyzxEmpLogin.builder().build()
.selectOne(new LambdaQueryWrapper<QyzxEmpLogin>().eq(QyzxEmpLogin::getPhone, phone)).getOrgId();
QyzxRemainingQuantity quantity = QyzxRemainingQuantity.builder().build()
.selectOne(new LambdaQueryWrapper<QyzxRemainingQuantity>()
.eq(QyzxRemainingQuantity::getOrgCode, orgCode)
.orderByAsc(QyzxRemainingQuantity::getExpireDate));
if (quantity == null || quantity.getRemainder() == null || quantity.getRemainder() <= 0) { //判断充了钱没
return ResultUtil.error("请充值后使用短信功能");
}
// 6位随机数验证码 // 6位随机数验证码
try { try {
Integer code = (int) ((Math.random() * 9 + 1) * 100000); Integer code = (int) ((Math.random() * 9 + 1) * 100000);
AliyunSMS aliyunSMS = new AliyunSMS(); AliyunSMS aliyunSMS = new AliyunSMS();
String phone = entRegisterDto.getPhone();
if (phone == null || "".equals(phone)) { if (phone == null || "".equals(phone)) {
phone = entRegisterDto.getUsername(); phone = entRegisterDto.getUsername();
entRegisterDto.setPhone(phone); entRegisterDto.setPhone(phone);
} }
JSONObject j = aliyunSMS.authCode(entRegisterDto, entRegisterDto.getTc(), code); JSONObject j = aliyunSMS.authCode(entRegisterDto, entRegisterDto.getTc(), code);
// String bizId = (String) j.get("BizId");
// Integer type = entRegisterDto.getMessageType();
// 获取当前日期的字符串格式 // 获取当前日期的字符串格式
String today = DateUtil.today(); String today = DateUtil.today();
// yyyy-MM-dd // yyyy-MM-dd
today = today.replace("-", ""); today = today.replace("-", "");
// 插入 Thread.sleep(500);
// QyzxSms qyzxSms = JSONObject jsonObject = (JSONObject) JSONObject
// QyzxSms.builder().orgCode(b?qyzxEmpLogin.getOrgId():null).messageType(type).content(content) .parseObject(new AliyunSMS().QuerySendDetails(phone, today, j.getString("BizId")))
// .createTime(sendDate).phone(phone).build(); .getJSONObject("SmsSendDetailDTOs").getJSONArray("SmsSendDetailDTO").get(0);
// qyzxSmsMapper.insert(qyzxSms); String templateCode = jsonObject.getString("TemplateCode");
String message = (String) j.get("Message"); String phoneNum = jsonObject.getString("PhoneNum");
String content = jsonObject.getString("Content");
String sendStatus = jsonObject.getString("SendStatus");
String sendDate = jsonObject.getString("SendDate");
QyzxSms qyzxSms = new QyzxSms();
qyzxSms.setContent(content);
qyzxSms.setCreateTime(new Date());
qyzxSms.setMessageType(entRegisterDto.getTc());
qyzxSms.setPhone(phoneNum);
qyzxSms.setOrgCode(orgCode);
qyzxSms.insert();
String message = j.getString("Message");
if ("OK".equals(message)) { if ("OK".equals(message)) {
session.setAttribute(phone, code); session.setAttribute(phone, code);
// redisTemplate.set(phone, code); // redisTemplate.set(phone, code);
// redisTemplate.expire(phone, 60); // redisTemplate.expire(phone, 60);
return ResultUtil.success("发送验证码成功"); return ResultUtil.data("发送验证码成功");
} else { } else {
return ResultUtil.error("发送验证码失败"); return ResultUtil.error("发送验证码失败");
} }
......
...@@ -5,6 +5,7 @@ import java.util.Date; ...@@ -5,6 +5,7 @@ import java.util.Date;
import java.util.List; import java.util.List;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.transaction.annotation.Transactional;
import org.springframework.web.bind.annotation.DeleteMapping; import org.springframework.web.bind.annotation.DeleteMapping;
import org.springframework.web.bind.annotation.GetMapping; import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable; import org.springframework.web.bind.annotation.PathVariable;
...@@ -14,6 +15,7 @@ import org.springframework.web.bind.annotation.RequestMapping; ...@@ -14,6 +15,7 @@ import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam; import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController; import org.springframework.web.bind.annotation.RestController;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.conditions.update.UpdateWrapper; import com.baomidou.mybatisplus.core.conditions.update.UpdateWrapper;
import com.baomidou.mybatisplus.core.metadata.IPage; import com.baomidou.mybatisplus.core.metadata.IPage;
...@@ -24,6 +26,7 @@ import cn.hutool.cron.CronUtil; ...@@ -24,6 +26,7 @@ import cn.hutool.cron.CronUtil;
import cn.hutool.cron.task.Task; import cn.hutool.cron.task.Task;
import cn.timer.api.bean.htzz.HtzzAdminZzda; import cn.timer.api.bean.htzz.HtzzAdminZzda;
import cn.timer.api.bean.htzz.HtzzAssoHtgx; import cn.timer.api.bean.htzz.HtzzAssoHtgx;
import cn.timer.api.bean.qyzx.businessService.QyzxRemainingQuantity;
import cn.timer.api.bean.yggl.YgglMainEmp; import cn.timer.api.bean.yggl.YgglMainEmp;
import cn.timer.api.config.annotation.CurrentUser; import cn.timer.api.config.annotation.CurrentUser;
import cn.timer.api.config.annotation.UserBean; import cn.timer.api.config.annotation.UserBean;
...@@ -36,6 +39,7 @@ import io.swagger.annotations.ApiOperation; ...@@ -36,6 +39,7 @@ import io.swagger.annotations.ApiOperation;
@Api(tags = "7.0合同证照") @Api(tags = "7.0合同证照")
@RestController @RestController
@Transactional
@RequestMapping(value = "/htzz", produces = { "application/json" }) @RequestMapping(value = "/htzz", produces = { "application/json" })
public class HtzzController { public class HtzzController {
...@@ -66,6 +70,15 @@ public class HtzzController { ...@@ -66,6 +70,15 @@ public class HtzzController {
@PostMapping("/addzj") @PostMapping("/addzj")
@ApiOperation(value = "新增合同证件", httpMethod = "POST", notes = "接口发布说明") @ApiOperation(value = "新增合同证件", httpMethod = "POST", notes = "接口发布说明")
public Result<Object> addzj(@CurrentUser UserBean userBean, @RequestBody HtzzAdminZzda zzda) { public Result<Object> addzj(@CurrentUser UserBean userBean, @RequestBody HtzzAdminZzda zzda) {
QyzxRemainingQuantity quantity = QyzxRemainingQuantity.builder().build()
.selectOne(new LambdaQueryWrapper<QyzxRemainingQuantity>()
.eq(QyzxRemainingQuantity::getOrgCode, userBean.getOrgCode())
.orderByAsc(QyzxRemainingQuantity::getExpireDate));
if (quantity == null || quantity.getRemainder() == null || quantity.getRemainder() <= 0) {
return ResultUtil.data("请先充值购买短信套餐!");
}
zzda.setTxkgType(1);
zzda.setLrrid(userBean.getEmpNum()); zzda.setLrrid(userBean.getEmpNum());
zzda.setLrsjTime(new Date()); zzda.setLrsjTime(new Date());
zzda.setOrgCode(userBean.getOrgCode()); zzda.setOrgCode(userBean.getOrgCode());
...@@ -129,8 +142,8 @@ public class HtzzController { ...@@ -129,8 +142,8 @@ public class HtzzController {
htzzQueryDto.getTotalPage() == null ? 10 : htzzQueryDto.getTotalPage()); htzzQueryDto.getTotalPage() == null ? 10 : htzzQueryDto.getTotalPage());
QueryWrapper<HtzzAdminZzda> queryWrapper = new QueryWrapper<>(); QueryWrapper<HtzzAdminZzda> queryWrapper = new QueryWrapper<>();
queryWrapper.eq("lrrid", userBean.getEmpNum()).eq("org_code", userBean.getOrgCode()). queryWrapper.eq("lrrid", userBean.getEmpNum()).eq("org_code", userBean.getOrgCode())
select("id", "zjmc", "czry", "czrdh", "fzrq", "yxdqr", "txkg_type").eq("is_delete", 0) .select("id", "zjmc", "czry", "czrdh", "fzrq", "yxdqr", "txkg_type").eq("is_delete", 0)
.gt(!StrUtil.hasBlank(e), "yxdqr", !StrUtil.hasBlank(e) ? e : "9999-01-01 00:00:00") .gt(!StrUtil.hasBlank(e), "yxdqr", !StrUtil.hasBlank(e) ? e : "9999-01-01 00:00:00")
.and(!StrUtil.hasBlank(q), wq -> wq.like("zjmc", q).or().like("czry", q)).orderByDesc("lrsj_time"); .and(!StrUtil.hasBlank(q), wq -> wq.like("zjmc", q).or().like("czry", q)).orderByDesc("lrsj_time");
...@@ -223,7 +236,7 @@ public class HtzzController { ...@@ -223,7 +236,7 @@ public class HtzzController {
CronUtil.schedule("*/2 * * 24 * *", new Task() { CronUtil.schedule("*/2 * * 24 * *", new Task() {
@Override @Override
public void execute() { public void execute() {
System.out.println("start:"+new Date()); System.out.println("start:" + new Date());
} }
}); });
......
...@@ -11,7 +11,10 @@ import com.aliyuncs.exceptions.ClientException; ...@@ -11,7 +11,10 @@ import com.aliyuncs.exceptions.ClientException;
import com.aliyuncs.exceptions.ServerException; import com.aliyuncs.exceptions.ServerException;
import com.aliyuncs.http.MethodType; import com.aliyuncs.http.MethodType;
import com.aliyuncs.profile.DefaultProfile; import com.aliyuncs.profile.DefaultProfile;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import cn.timer.api.bean.qyzx.QyzxEmpLogin;
import cn.timer.api.bean.qyzx.businessService.QyzxRemainingQuantity;
import cn.timer.api.config.enums.PinType; import cn.timer.api.config.enums.PinType;
import cn.timer.api.dto.qyzx.EntRegisterDto; import cn.timer.api.dto.qyzx.EntRegisterDto;
...@@ -138,9 +141,23 @@ public class AliyunSMS { ...@@ -138,9 +141,23 @@ public class AliyunSMS {
* @param htname 要提醒的东西的名字 * @param htname 要提醒的东西的名字
* @param time 提醒的时间 * @param time 提醒的时间
* @param phone * @param phone
* @return
*/ */
@SuppressWarnings("deprecation") @SuppressWarnings("deprecation")
public static void remind(String name, String htname, String time, String phone) { public static String remind(String name, String htname, String time, String phone) {
Integer orgCode = QyzxEmpLogin.builder().build()
.selectOne(new LambdaQueryWrapper<QyzxEmpLogin>().eq(QyzxEmpLogin::getPhone, phone)).getOrgId();
System.err.println("orgCode"+orgCode);
QyzxRemainingQuantity quantity = QyzxRemainingQuantity.builder().build()
.selectOne(new LambdaQueryWrapper<QyzxRemainingQuantity>()
.eq(QyzxRemainingQuantity::getOrgCode, orgCode)
.orderByAsc(QyzxRemainingQuantity::getExpireDate));
if (quantity == null || quantity.getRemainder() == null || quantity.getRemainder() <= 0) {
System.err.println("请充钱");
return"请先充值购买短信套餐!";
}
DefaultProfile profile = DefaultProfile.getProfile(REGION_ID, ACCESSKEY_ID, SECRET); DefaultProfile profile = DefaultProfile.getProfile(REGION_ID, ACCESSKEY_ID, SECRET);
IAcsClient client = new DefaultAcsClient(profile); IAcsClient client = new DefaultAcsClient(profile);
...@@ -155,6 +172,7 @@ public class AliyunSMS { ...@@ -155,6 +172,7 @@ public class AliyunSMS {
request.putQueryParameter(CODE_NAME, PinType.REMIND.getCode()); request.putQueryParameter(CODE_NAME, PinType.REMIND.getCode());
request.putQueryParameter(TEMPLATE_PARAM, request.putQueryParameter(TEMPLATE_PARAM,
"{\"name\":\"" + name + "\", \"htname\":\"" + htname + "\",\"time\":\"" + time + "\"}"); "{\"name\":\"" + name + "\", \"htname\":\"" + htname + "\",\"time\":\"" + time + "\"}");
try { try {
CommonResponse response = client.getCommonResponse(request); CommonResponse response = client.getCommonResponse(request);
System.out.println(response.getData()); System.out.println(response.getData());
...@@ -163,6 +181,7 @@ public class AliyunSMS { ...@@ -163,6 +181,7 @@ public class AliyunSMS {
} catch (ClientException e) { } catch (ClientException e) {
e.printStackTrace(); e.printStackTrace();
} }
return "发送成功";
} }
} }
...@@ -11,12 +11,16 @@ import org.springframework.scheduling.config.ScheduledTaskRegistrar; ...@@ -11,12 +11,16 @@ import org.springframework.scheduling.config.ScheduledTaskRegistrar;
import org.springframework.scheduling.support.CronTrigger; import org.springframework.scheduling.support.CronTrigger;
import org.springframework.stereotype.Component; import org.springframework.stereotype.Component;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import cn.hutool.core.date.DateUnit; import cn.hutool.core.date.DateUnit;
import cn.hutool.core.date.DateUtil; import cn.hutool.core.date.DateUtil;
import cn.timer.api.bean.htzz.HtzzAdminZzda; import cn.timer.api.bean.htzz.HtzzAdminZzda;
import cn.timer.api.bean.htzz.HtzzAssoHtgx; import cn.timer.api.bean.htzz.HtzzAssoHtgx;
import cn.timer.api.bean.qyzx.QyzxEmpLogin;
import cn.timer.api.bean.qyzx.businessService.QyzxRemainingQuantity;
import cn.timer.api.utils.ResultUtil;
import cn.timer.api.utils.aliyun.AliyunSMS; import cn.timer.api.utils.aliyun.AliyunSMS;
/** /**
...@@ -64,15 +68,15 @@ public class RemindUtil implements SchedulingConfigurer { ...@@ -64,15 +68,15 @@ public class RemindUtil implements SchedulingConfigurer {
q.select("id", "zjmc", "txkg_type", "yxdqr").eq("id", htgx.getHtid()).eq("is_delete", 0).eq("txkg_type", 0); q.select("id", "zjmc", "txkg_type", "yxdqr").eq("id", htgx.getHtid()).eq("is_delete", 0).eq("txkg_type", 0);
HtzzAdminZzda zzda = HtzzAdminZzda.builder().build().selectOne(q); HtzzAdminZzda zzda = HtzzAdminZzda.builder().build().selectOne(q);
if (zzda != null) { if (zzda != null) {
String name = htgx.getName(); // 员工姓名
String phone = htgx.getPhone(); // 员工手机 String phone = htgx.getPhone(); // 员工手机
String name = htgx.getName(); // 员工姓名
String htname = zzda.getZjmc(); // 合同名称 String htname = zzda.getZjmc(); // 合同名称
Date now = new Date(); // 当前时间 Date now = new Date(); // 当前时间
Date dqsj = zzda.getYxdqr(); // 到期时间 Date dqsj = zzda.getYxdqr(); // 到期时间
String time = DateUtil.formatDate(dqsj); // 到期時間格式 String time = DateUtil.formatDate(dqsj); // 到期時間格式
Long betweenDay = DateUtil.between(dqsj, now, DateUnit.DAY); // 时间差天数 Long betweenDay = DateUtil.between(dqsj, now, DateUnit.DAY); // 时间差天数
Long sjc = dqsj.getTime() - now.getTime(); // 时间差数值 Long sjc = dqsj.getTime() - now.getTime(); // 时间差数值
System.err.println(betweenDay); System.err.println(name + " 的 " + htname + "还有: " + betweenDay + " 天到期");
if (sjc > 0) { if (sjc > 0) {
if (betweenDay <= 1) { if (betweenDay <= 1) {
AliyunSMS.remind(name, htname, time, phone); // 少于1天短信提醒 AliyunSMS.remind(name, htname, time, phone); // 少于1天短信提醒
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment