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;
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.HashMap;
import java.util.List;
import java.util.Map;
import java.util.Optional;
import java.util.stream.Stream;
import javax.annotation.PostConstruct;
......@@ -25,7 +23,6 @@ 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;
......@@ -43,7 +40,6 @@ 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;
......@@ -472,14 +468,10 @@ 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(cal.getTime())
.endTime(DateUtil.offsetDay(new Date(), offset)).level(CommonEnum.LEVEL_PROBATION.getType())
.build();
boolean b1 = qyzxEntInfoM.insert();
if (!b1) {
......@@ -505,7 +497,7 @@ public class LoginController {
}
}
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();
if (!b4) {
TransactionAspectSupport.currentTransactionStatus().setRollbackOnly();
......@@ -513,8 +505,8 @@ public class LoginController {
}
// 员工企业关联表
QyzxEmpEntAsso qyzxEmpEntAsso = QyzxEmpEntAsso.builder().empNum(login.getId()).orgCode(qyzxEntInfoM.getId()).status(1)
.userType(CommonEnum.U_TYPE_ADMIN.getType()).build();
QyzxEmpEntAsso qyzxEmpEntAsso = QyzxEmpEntAsso.builder().empNum(login.getId()).orgCode(qyzxEntInfoM.getId())
.status(1).userType(CommonEnum.U_TYPE_ADMIN.getType()).build();
boolean b3 = qyzxEmpEntAsso.insert();
if (!b3) {
TransactionAspectSupport.currentTransactionStatus().setRollbackOnly();
......@@ -567,18 +559,25 @@ public class LoginController {
} catch (Exception e) {
e.printStackTrace();
}
List<QysDto> qys = qyzxEmpLoginMapper.getQys(qyzxEmpLogin1.getId()
);
List<QysDto> qys = qyzxEmpLoginMapper.getQys(qyzxEmpLogin1.getId());
if (qys.size() == 0)
return ResultUtil.error("没有任何公司可以查看!");
qyzxEmpLogin1.setQys(qys);
QysDto ctrl = qys.get(0);
if (qyzxEmpLogin1.getOrgId() != null) {
Stream<QysDto> s = qys.stream()
.filter(item -> "1".equals(item.getStatus().toString()) && qyzxEmpLogin1.getOrgId().equals(item.getId()));
if (s != null) {
ctrl = s.findFirst().get();
for (QysDto qysDto : qys) {
if (qyzxEmpLogin1.getOrgId().equals(qysDto.getId()) && qysDto.getStatus() == 1) {
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)) {
......
......@@ -24,6 +24,7 @@ import cn.hutool.core.bean.BeanUtil;
import cn.hutool.core.collection.CollUtil;
import cn.hutool.core.lang.Console;
import cn.hutool.core.util.ObjectUtil;
import cn.hutool.core.util.StrUtil;
import cn.hutool.json.JSONObject;
import cn.timer.api.bean.spmk.SpmkApprovalG;
import cn.timer.api.bean.spmk.SpmkApprovalTemplate;
......@@ -380,7 +381,8 @@ public class SpmkServiceImpl {
listRouter.add(spmkApproveSummaryDto.getRouter());
JSONObject jSONObject = spmkApproveSummaryDto.getRequestData()
.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);
List<FlowChildren> listFlowChildren = new ArrayList<FlowChildren>();
RouterUtils.getIsFlowChildren(listRouter,listFlowChildren);
......
......@@ -65,7 +65,20 @@ public class RouterUtils {
Console.log("发起人逻辑");
router.setExecute(EXECUTED);
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);
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