Commit c39dd6be by 东州 翁

Merge branch 'develop' of 120.24.24.239:8timerv2/8timerapiv200 into wdz

# Conflicts:
#	src/main/java/cn/timer/api/controller/LoginController.java
parents 121cde05 79334da6
package cn.timer.api.controller; package cn.timer.api.controller;
import java.io.IOException; import java.io.IOException;
import java.text.DateFormat;
import java.text.SimpleDateFormat;
import java.util.ArrayList; import java.util.ArrayList;
import java.util.Calendar;
import java.util.Date; import java.util.Date;
import java.util.HashMap; import java.util.HashMap;
import java.util.List; import java.util.List;
import java.util.Map; import java.util.Map;
import java.util.Optional;
import java.util.stream.Stream; import java.util.stream.Stream;
import javax.annotation.PostConstruct; import javax.annotation.PostConstruct;
...@@ -25,7 +23,6 @@ import org.springframework.web.bind.annotation.RequestBody; ...@@ -25,7 +23,6 @@ import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping; import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController; import org.springframework.web.bind.annotation.RestController;
import com.alibaba.druid.sql.visitor.functions.Now;
import com.alibaba.fastjson.JSONObject; import com.alibaba.fastjson.JSONObject;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.extension.conditions.query.LambdaQueryChainWrapper; import com.baomidou.mybatisplus.extension.conditions.query.LambdaQueryChainWrapper;
...@@ -43,7 +40,6 @@ import cn.timer.api.bean.zzgl.ZzglAuth; ...@@ -43,7 +40,6 @@ import cn.timer.api.bean.zzgl.ZzglAuth;
import cn.timer.api.bean.zzgl.ZzglBmgwM; import cn.timer.api.bean.zzgl.ZzglBmgwM;
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;
import cn.timer.api.config.enuminterface.YgEnumInterface;
import cn.timer.api.config.enums.CommonEnum; import cn.timer.api.config.enums.CommonEnum;
import cn.timer.api.dao.qyzx.QyzxEmpEntAssoMapper; import cn.timer.api.dao.qyzx.QyzxEmpEntAssoMapper;
import cn.timer.api.dao.qyzx.QyzxEmpLoginMapper; import cn.timer.api.dao.qyzx.QyzxEmpLoginMapper;
...@@ -472,14 +468,10 @@ public class LoginController { ...@@ -472,14 +468,10 @@ public class LoginController {
return ResultUtil.error("已注册过企业"); 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()) QyzxEntInfoM qyzxEntInfoM = QyzxEntInfoM.builder().name(name).registerTime(DateUtil.date())
.endTime(DateUtil.offsetDay(new Date(), offset)).level(CommonEnum.LEVEL_PROBATION.getType()).endTime(cal.getTime()) .endTime(DateUtil.offsetDay(new Date(), offset)).level(CommonEnum.LEVEL_PROBATION.getType())
.build(); .build();
boolean b1 = qyzxEntInfoM.insert(); boolean b1 = qyzxEntInfoM.insert();
if (!b1) { if (!b1) {
...@@ -504,8 +496,8 @@ public class LoginController { ...@@ -504,8 +496,8 @@ public class LoginController {
return ResultUtil.error("注册企业失败2"); return ResultUtil.error("注册企业失败2");
} }
} }
boolean b4 = YgglMainEmp.builder().orgCode(qyzxEntInfoM.getId()).empNum(login.getId()) boolean b4 = YgglMainEmp.builder().orgCode(qyzxEntInfoM.getId()).empNum(login.getId()).rzTime(new Date())
.name(username).build().insert(); .name(username).build().insert();
if (!b4) { if (!b4) {
TransactionAspectSupport.currentTransactionStatus().setRollbackOnly(); TransactionAspectSupport.currentTransactionStatus().setRollbackOnly();
...@@ -513,14 +505,14 @@ public class LoginController { ...@@ -513,14 +505,14 @@ public class LoginController {
} }
// 员工企业关联表 // 员工企业关联表
QyzxEmpEntAsso qyzxEmpEntAsso = QyzxEmpEntAsso.builder().empNum(login.getId()).orgCode(qyzxEntInfoM.getId()).status(1) QyzxEmpEntAsso qyzxEmpEntAsso = QyzxEmpEntAsso.builder().empNum(login.getId()).orgCode(qyzxEntInfoM.getId())
.userType(CommonEnum.U_TYPE_ADMIN.getType()).build(); .status(1).userType(CommonEnum.U_TYPE_ADMIN.getType()).build();
boolean b3 = qyzxEmpEntAsso.insert(); boolean b3 = qyzxEmpEntAsso.insert();
if (!b3) { if (!b3) {
TransactionAspectSupport.currentTransactionStatus().setRollbackOnly(); TransactionAspectSupport.currentTransactionStatus().setRollbackOnly();
return ResultUtil.error("注册企业失败4"); return ResultUtil.error("注册企业失败4");
} }
return ResultUtil.success("注册企业成功"); return ResultUtil.success("注册企业成功");
} catch (Exception e) { } catch (Exception e) {
TransactionAspectSupport.currentTransactionStatus().setRollbackOnly(); TransactionAspectSupport.currentTransactionStatus().setRollbackOnly();
...@@ -567,19 +559,26 @@ public class LoginController { ...@@ -567,19 +559,26 @@ public class LoginController {
} catch (Exception e) { } catch (Exception e) {
e.printStackTrace(); e.printStackTrace();
} }
List<QysDto> qys = qyzxEmpLoginMapper.getQys(qyzxEmpLogin1.getId() List<QysDto> qys = qyzxEmpLoginMapper.getQys(qyzxEmpLogin1.getId());
);
if (qys.size() == 0) if (qys.size() == 0)
return ResultUtil.error("没有任何公司可以查看!"); return ResultUtil.error("没有任何公司可以查看!");
qyzxEmpLogin1.setQys(qys); qyzxEmpLogin1.setQys(qys);
QysDto ctrl = qys.get(0); QysDto ctrl = qys.get(0);
if (qyzxEmpLogin1.getOrgId() != null) { if (qyzxEmpLogin1.getOrgId() != null) {
Stream<QysDto> s = qys.stream()
.filter(item -> "1".equals(item.getStatus().toString()) && qyzxEmpLogin1.getOrgId().equals(item.getId())); for (QysDto qysDto : qys) {
if (s != null) { if (qyzxEmpLogin1.getOrgId().equals(qysDto.getId()) && qysDto.getStatus() == 1) {
ctrl = s.findFirst().get(); ctrl = qysDto;
}
} }
// Stream<QysDto> s = qys.stream()
// .filter(item -> item.getStatus() == 1 && qyzxEmpLogin1.getOrgId().equals(item.getId()));
//
// if (s != null) {
// ctrl = s.findFirst().get();
// }
} }
if (ctrl.getStatus() == null || ctrl.getStatus().equals(0)) { if (ctrl.getStatus() == null || ctrl.getStatus().equals(0)) {
return ResultUtil.error("帐号被禁用"); return ResultUtil.error("帐号被禁用");
......
...@@ -24,6 +24,7 @@ import cn.hutool.core.bean.BeanUtil; ...@@ -24,6 +24,7 @@ import cn.hutool.core.bean.BeanUtil;
import cn.hutool.core.collection.CollUtil; import cn.hutool.core.collection.CollUtil;
import cn.hutool.core.lang.Console; import cn.hutool.core.lang.Console;
import cn.hutool.core.util.ObjectUtil; import cn.hutool.core.util.ObjectUtil;
import cn.hutool.core.util.StrUtil;
import cn.hutool.json.JSONObject; import cn.hutool.json.JSONObject;
import cn.timer.api.bean.spmk.SpmkApprovalG; import cn.timer.api.bean.spmk.SpmkApprovalG;
import cn.timer.api.bean.spmk.SpmkApprovalTemplate; import cn.timer.api.bean.spmk.SpmkApprovalTemplate;
...@@ -380,7 +381,8 @@ public class SpmkServiceImpl { ...@@ -380,7 +381,8 @@ public class SpmkServiceImpl {
listRouter.add(spmkApproveSummaryDto.getRouter()); listRouter.add(spmkApproveSummaryDto.getRouter());
JSONObject jSONObject = spmkApproveSummaryDto.getRequestData() JSONObject jSONObject = spmkApproveSummaryDto.getRequestData()
.put("orgCode", FromData.builder().value(String.valueOf(userBean.getOrgCode())).build()) .put("orgCode", FromData.builder().value(String.valueOf(userBean.getOrgCode())).build())
.put("initiator", FromData.builder().value(spmkApproveSummaryDto.getInitiator()).build()); .put("initiator", FromData.builder().value(spmkApproveSummaryDto.getInitiator()).build())
.put("id", FromData.builder().value(StrUtil.toString(userBean.getEmpNum())).build());
RouterUtils.NextNode(listRouter, jSONObject, ISFIRST); RouterUtils.NextNode(listRouter, jSONObject, ISFIRST);
List<FlowChildren> listFlowChildren = new ArrayList<FlowChildren>(); List<FlowChildren> listFlowChildren = new ArrayList<FlowChildren>();
RouterUtils.getIsFlowChildren(listRouter,listFlowChildren); RouterUtils.getIsFlowChildren(listRouter,listFlowChildren);
......
...@@ -65,7 +65,20 @@ public class RouterUtils { ...@@ -65,7 +65,20 @@ public class RouterUtils {
Console.log("发起人逻辑"); Console.log("发起人逻辑");
router.setExecute(EXECUTED); router.setExecute(EXECUTED);
router.setFlow(true); router.setFlow(true);
router.getRelation().get(0).setName(obj.get("initiator",FromData.class).getValue());
List<User> users = new ArrayList<User>();
User userFirst = User.builder()
.name(obj.get("initiator",FromData.class).getValue())
.id(obj.get("id",FromData.class).getValue())
.execute("0")
.build();
users.add(userFirst);
List<Relation> relations = new ArrayList<Relation>();
Relation relation = Relation.builder().type("user").users(users).build();
relations.add(relation);
router.setRelation(relations);
// router.getRelation().get(0).setName(obj.get("initiator",FromData.class).getValue());
NextNode(router.getChildren(),obj, isFirse, isAuditNext); NextNode(router.getChildren(),obj, isFirse, isAuditNext);
break; break;
......
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