Commit 79cd0c2d by 东州 翁 Committed by chenzg

新增企业一个字段endtime

parent ca697b84
package cn.timer.api.controller;
import java.io.IOException;
import java.text.DateFormat;
import java.text.SimpleDateFormat;
import java.util.ArrayList;
import java.util.Calendar;
import java.util.Date;
import java.util.List;
import java.util.stream.Stream;
......@@ -18,6 +21,7 @@ import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import com.alibaba.druid.sql.visitor.functions.Now;
import com.alibaba.fastjson.JSONObject;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.extension.conditions.query.LambdaQueryChainWrapper;
......@@ -35,6 +39,7 @@ import cn.timer.api.bean.zzgl.ZzglAuth;
import cn.timer.api.bean.zzgl.ZzglBmgwM;
import cn.timer.api.config.annotation.CurrentUser;
import cn.timer.api.config.annotation.UserBean;
import cn.timer.api.config.enuminterface.YgEnumInterface;
import cn.timer.api.config.enums.CommonEnum;
import cn.timer.api.dao.qyzx.QyzxEmpEntAssoMapper;
import cn.timer.api.dao.qyzx.QyzxEmpLoginMapper;
......@@ -431,10 +436,14 @@ public class LoginController {
return ResultUtil.error("已注册过企业");
}
}
//增加一个月试用期
Calendar cal = Calendar.getInstance();
cal.setTime(new Date());
cal.add(Calendar.MONTH, 1);
cal.getTime();
// 企业信息
QyzxEntInfoM qyzxEntInfoM = QyzxEntInfoM.builder().name(name).registerTime(DateUtil.date())
.endTime(DateUtil.offsetDay(new Date(), offset)).level(CommonEnum.LEVEL_PROBATION.getType())
.endTime(DateUtil.offsetDay(new Date(), offset)).level(CommonEnum.LEVEL_PROBATION.getType()).endTime(cal.getTime())
.build();
boolean b1 = qyzxEntInfoM.insert();
if (!b1) {
......@@ -476,7 +485,7 @@ public class LoginController {
TransactionAspectSupport.currentTransactionStatus().setRollbackOnly();
return ResultUtil.error("注册企业失败4");
}
return ResultUtil.success("注册企业成功");
} catch (Exception e) {
TransactionAspectSupport.currentTransactionStatus().setRollbackOnly();
......@@ -530,10 +539,11 @@ public class LoginController {
QysDto ctrl = qys.get(0);
if (qyzxEmpLogin1.getOrgId() != null) {
Stream<QysDto> s = qys.stream()
.filter(item -> item.getStatus() == 1 && qyzxEmpLogin1.getOrgId().equals(item.getId()));
.filter(item -> "1".equals(item.getStatus().toString()) && qyzxEmpLogin1.getOrgId().equals(item.getId()));
if (s != null) {
ctrl = s.findFirst().get();
}
}
if (ctrl.getStatus() == null || ctrl.getStatus().equals(0)) {
return ResultUtil.error("帐号被禁用");
......
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