This commit is contained in:
杜建超 2020-09-23 18:07:20 +08:00
commit b776c8418e
54 changed files with 1335 additions and 196 deletions

View File

@ -15,6 +15,7 @@ public enum WorkMsgTypeEnum {
//绩效通过人事老板审核的最终审核通知
PASS(3, "绩效通过", "去查看", "# 绩效通过\n ## 你的绩效已经通过"),
URGING(4, "绩效催办", "去审批", "# 绩效催办\n ## @提醒您审批"),
END(5, "绩效终止", "去查看", "# 绩效终止\n ## @,你的绩效终止"),
;
int type;
String title;

View File

@ -167,7 +167,12 @@ public class Constant {
public static final String SELF = "self";
public static final String TYPE = "type";
public static final String node = "node";
public static final String startNode = "startNode";
public static final String OSS_BUCCKET = "my-wallet";
public static final Integer TWO = 2;
public static final Integer ONE = 1;
public static final String WENHUAJIAZHIGUAN = "<p>做人:相信、包容、担当&nbsp;</p><p>做事:用户第一、求真、极致<br></p>";
public static final String WENHUAJIAZHIGUAN_TARGET = "<p>做人:相信、包容、担当&nbsp; 3.5分</p>1、尊重合作伙伴坚决维护公司形象<br>2、倾听不同意见积极参加各类公司项目活动通过正确渠道直属上级/部门负责人/HR反馈问题提出改进意见决策前充分讨论决策后无论个人是否有异议必须从言行上完全予以支持<br>3、严格遵守公司规章制度遇事不推诿、不甩锅勇于承担责任<br>4、实事求是诚实守信独立自主思考珍惜彼此时间无需他人监督催促客观反馈问题遇到bug/工作问题,以查到底<br>5、今日事今日毕按时汇报工作今天的表现是明天最低的要求不断追求更好的结果<br>6、以客户为中心提供专业服务做好公司内外部协作无实质投诉<br>3.75分<br>1、拥抱变化对公司不同层面的调整持乐见状态并予以高度支持配合<br>2、以团队目标为导向包容不同类型的伙伴不将个人喜好带入工作接受更优秀的人才与思想取长补短互相成就<br>3、勇于接受挑战承担责任为实现目标全力以赴主动分享业务知识与经验正面影响团队改善团队士气与氛围<br>4、深入理解公司业务与部门协作方式保持好奇心以结果倒推需求持续思考“为什么做”辩证思考执行保证大方向的正确与工作方式的持续迭代<br>5、对日常工作有极致要求多角度对问题进行辩证探究不钻牛角尖不随风摇摆以最佳结果为导向持续倒逼更优方案<br>6、辨证看待用户意见要以“用户为师”的心态坚持原则寻求解决最终达到用户和公司都受益的结果";
}

View File

@ -8,6 +8,8 @@ import com.dingtalk.api.DingTalkClient;
import com.dingtalk.api.request.*;
import com.dingtalk.api.response.*;
import com.lz.modules.app.entity.StaffEntity;
import com.lz.modules.app.entity.StaffOccupationEntity;
import com.lz.modules.app.service.StaffOccupationService;
import com.lz.modules.app.service.StaffService;
import com.lz.modules.job.model.responseBo.DepartmentInfosBo;
import com.lz.modules.job.model.responseBo.DepartmentStaffBo;
@ -55,6 +57,9 @@ public class DingTalkUtil {
@Autowired
private SysUserTokenService sysUserTokenService;
@Autowired
StaffOccupationService staffOccupationService;
CloseableHttpClient getHttpClient(){
@ -325,20 +330,26 @@ public class DingTalkUtil {
if(json.getIntValue("errcode") == 0){
String employeeId = json.getString("userid");
StaffEntity staffEntity = staffService.selectStaffByEmployeeId(employeeId);
if(staffEntity != null){
//登录操作
SysUserEntity user = new SysUserEntity();
user.setPassword(staffEntity.getPassword());
user.setMobile(staffEntity.getMobile());
user.setUserId(staffEntity.getId());
user.setEmail(staffEntity.getEmail());
user.setSalt(staffEntity.getSalt());
user.setStatus(1);
user.setType(1);
user.setRealName(staffEntity.getName());
user.setUsername(staffEntity.getMobile());
user.setUserNo(staffEntity.getMobile());
return sysUserTokenService.createTokenSetTokenCode(user, code);
StaffOccupationEntity staffOccupationEntity =
staffOccupationService.getStaffOccupationByStaffId(staffEntity.getId());
if(staffOccupationEntity != null && staffOccupationEntity.getStaffStatus() == 0){
//登录操作
SysUserEntity user = new SysUserEntity();
user.setPassword(staffEntity.getPassword());
user.setMobile(staffEntity.getMobile());
user.setUserId(staffEntity.getId());
user.setEmail(staffEntity.getEmail());
user.setSalt(staffEntity.getSalt());
user.setStatus(1);
user.setType(1);
user.setRealName(staffEntity.getName());
user.setUsername(staffEntity.getMobile());
user.setUserNo(staffEntity.getMobile());
return sysUserTokenService.createTokenSetTokenCode(user, code);
}
}
return R.error("用户不存在");
}

View File

@ -57,6 +57,9 @@ public class PageUtils<E> implements Serializable {
this.totalPage = (int) Math.ceil((double) totalCount / pageSize);
}
public PageUtils() {
}
public <E> PageUtils<E> doSelect(ISelect select) {
IPage page = new Page(this.currPage, this.pageSize);

View File

@ -64,8 +64,6 @@ public class ShiroConfig {
filterMap.put("/captcha.jpg", "anon");
filterMap.put("/aaa.txt", "anon");
filterMap.put("/dtlg/login", "anon");
filterMap.put("/oneCode/**", "anon");
filterMap.put("/modules/**", "anon");//临时添加后期去掉
filterMap.put("/dtlg/luck", "anon");
filterMap.put("/dtlg/look", "anon");
filterMap.put("/dtlg/jump", "anon");

View File

@ -0,0 +1,144 @@
package com.lz.modules.app.controller;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.List;
import java.util.Map;
import com.alibaba.fastjson.JSON;
import com.lz.common.utils.PageUtils;
import com.lz.common.utils.R;
import com.lz.modules.app.entity.StaffEntity;
import com.lz.modules.app.resp.Step;
import com.lz.modules.flow.entity.Flow;
import com.lz.modules.flow.entity.FlowDepartment;
import com.lz.modules.flow.entity.FlowManager;
import com.lz.modules.flow.entity.FlowRelation;
import com.lz.modules.flow.model.FlowDto;
import com.lz.modules.flow.model.StaffRoleDto;
import com.lz.modules.flow.service.FlowDepartmentService;
import com.lz.modules.flow.service.FlowManagerService;
import org.apache.shiro.authz.annotation.RequiresPermissions;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;
/**
* 流程管理表
*
* @author zgh
* @email zgh@ldxinyong.com
* @date 2020-09-22 17:25:35
*/
@RestController
@RequestMapping("user/lzflowmanager")
public class FlowManagerController {
@Autowired
private FlowManagerService flowManagerService;
@Autowired
private FlowDepartmentService flowDepartmentService;
/**
* 列表
*/
@RequestMapping("/list")
@RequiresPermissions("user:lzflowmanager:list")
public R list(@RequestParam Map<String, Object> params){
PageUtils page = flowManagerService.queryPage(params);
return R.ok().put("page", page);
}
@RequestMapping("/menu/list")
public List<FlowDto> menuList(){
List<FlowDto> flowDtoList = flowManagerService.getFowList();
return flowDtoList;
}
/**
* 信息
*/
@RequestMapping("/info/{id}")
@RequiresPermissions("user:lzflowmanager:info")
public R info(@PathVariable("id") Long id){
FlowManager lzFlowManager = flowManagerService.selectFlowManagerById(id);
return R.ok().put("lzFlowManager", lzFlowManager);
}
/**
* 信息
*/
@RequestMapping("/get/flowInfo/{staffId}")
public R flowInfo(@PathVariable("staffId") Long staffId){
return flowDepartmentService.selectFlowManager(staffId);
}
/**
* 信息
*/
@RequestMapping("/get/flow/{id}")
public R flow(@PathVariable("id") Long staffId){
return R.ok();
}
/**
* 信息
*/
@RequestMapping("/save/flow")
public R saveFlow(Long id ,String data){
return R.ok();
}
/**
* 保存
*/
@RequestMapping("/save")
@RequiresPermissions("user:lzflowmanager:save")
public R save(@RequestBody FlowManager lzFlowManager){
flowManagerService.insertFlowManager(lzFlowManager);
return R.ok();
}
/**
* 修改
*/
@RequestMapping("/update")
@RequiresPermissions("user:lzflowmanager:update")
public R update(@RequestBody FlowManager lzFlowManager){
flowManagerService.updateById(lzFlowManager);
return R.ok();
}
/**
* 删除
*/
@RequestMapping("/delete")
@RequiresPermissions("user:lzflowmanager:delete")
public R delete(@RequestBody Long[] ids){
flowManagerService.deleteBatchIds(Arrays.asList(ids));
return R.ok();
}
}

View File

@ -40,7 +40,6 @@ import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import java.io.PrintWriter;
import java.math.BigDecimal;
import java.text.SimpleDateFormat;
import java.util.*;
@ -133,7 +132,6 @@ public class ResultRecordController extends AbstractController {
}
}
}
R r = lzResultRecordService.queryPage(req, user);
r .put("departmentList1", departmentList1)
.put("departmentList2", departmentList2)
@ -156,7 +154,7 @@ public class ResultRecordController extends AbstractController {
@RequestMapping("/getStaffResultDetail")
public R getStaffResultDetail(ResultRecordReq req) {
int yeJiCheckNum = 0;
int wenHuaJiaZhiGuanNum = 0;
int wenHuaJiaZhiGuanNum = 1;
int lastResultNum = 2;
int commentNum = 0;
int recordType = req.getRecordType();
@ -230,18 +228,14 @@ public class ResultRecordController extends AbstractController {
list.add(resp);
}
if (tempType2 == 0) {
wenHuaJiaZhiGuanNum = 2;
list.add(resultDetailService.getYeJiKaoHe(BigDecimal.ZERO));
list.add(resultDetailService.getWenHuaJiaZhiGua1(auth));
list.add(resultDetailService.getWenHuaJiaZhiGua2(auth));
}
} else {
yeJiCheckNum = 1;
wenHuaJiaZhiGuanNum = 2;
list.add(resultDetailService.getYeJi());
list.add(resultDetailService.getYeJiKaoHe(BigDecimal.ZERO));
list.add(resultDetailService.getWenHuaJiaZhiGua1(auth));
list.add(resultDetailService.getWenHuaJiaZhiGua2(auth));
}
list.add(resultDetailService.getWenHuaJiaZhiGuaResult1(sumWenHuaJiaZhiGuan));
list.add(resultDetailService.getWenHuaJiaZhiGuaResult2());
@ -359,7 +353,7 @@ public class ResultRecordController extends AbstractController {
@RequestMapping("/recordIdsSubmit")
public R recordIdsSubmit(String recordIds,Integer batchOpt) {
if (StringUtil.isBlank(recordIds)) {
return R.error("选择提交");
return R.error("勾选需要批量操作业绩!");
}
List<Long> records = new ArrayList<>();
String ids[] = recordIds.split(",");
@ -370,29 +364,68 @@ public class ResultRecordController extends AbstractController {
}
}
}
if (records == null) {
return R.error("请选择状态为待提交的记录");
}
R r = null;
if(batchOpt == 1){
List<ResultRecord> resultRecords = resultRecordService.selectResultRecordByIds(records);
List<ResultRecord> resultRecords = resultRecordService.selectResultRecordByIds(records);
if(batchOpt == 1){ //提交审批
for (ResultRecord resultRecord : resultRecords) {
if (!resultRecord.getStatus().equals(3)) {
return R.error("您的提交记录中有状态不为侍提交的,请重新选择。");
if (!StringUtil.in(resultRecord.getStatus(),1,2,3,5)) {
return R.error("您的提交记录中有状态不正确,请重新选择");
}
}
for (ResultRecord resultRecord : resultRecords) {
r = resultRecordService.approval(resultRecord.getId(), getUserId(),null);
r = resultRecordService.approval(resultRecord.getId(), resultRecord.getCurrentApprovalStaffId(),null,false);
if (!r.isSuccess()) {
return r;
}
}
}else if(batchOpt ==2 ){
}else if (batchOpt == 3 ){
}else if (batchOpt == 4 ){
} else if (batchOpt == 2) { //终止流程
for (ResultRecord resultRecord : resultRecords) {
if (!StringUtil.in(resultRecord.getStatus(),1,2,3,5,6)) {
return R.error("您的提交记录中有状态不正确,请重新选择");
}
}
for (ResultRecord resultRecord : resultRecords) {
r = resultRecordService.approval(resultRecord.getId(), resultRecord.getCurrentApprovalStaffId(), 7, true);
if (!r.isSuccess()) {
return r;
}
}
} else if (batchOpt == 3 || batchOpt == 4 ) { // 3 申述无效,直接驳回 ,4 领导重新打分
for (ResultRecord resultRecord : resultRecords) {
if (!StringUtil.in(resultRecord.getStatus(),6)) {
return R.error("您的提交记录中有状态不正确,请重新选择");
}
}
if(batchOpt == 3 ){
for (ResultRecord resultRecord : resultRecords) {
r = resultRecordService.reject(resultRecord,1); //更新驳回状态
if (!r.isSuccess()) {
return r;
}
}
} else {
for (ResultRecord resultRecord : resultRecords) {
List<FlowRecord> list = flowRecordService.selectFlowRecordByResultRecordIdType(resultRecord.getId(), 2);
for (int i = list.size() - 1; i >= 0; i--) {
FlowRecord flowRecord = list.get(i);
Long roleId = recordAuthService.getRoleIdByStaffRoleInfo(flowRecord.getFlowStaffIdRole(), flowRecord.getApprovalStaffId());
List<RecordAuth> listAuth = recordAuthService.selectAuthInfo(roleId);
Auth auth = recordAuthService.getAuth(listAuth);
if (auth.getEditScore() > 0) {//表示是评分
resultRecord.setFlowStaffIdRole(flowRecord.getFlowStaffIdRole());
resultRecord.setCurrentApprovalStaffId(flowRecord.getApprovalStaffId());
resultRecord.setCurrentApprovalStaffName(flowRecord.getApprovalStaffName());
resultRecord.setStatus(1);
// 直接还原权限
resultRecordService.updateResultRecordById(resultRecord);
break;
} else {
flowRecord.setStatus(1);//如果不是领导打分的话直接删除掉
flowRecordService.updateFlowRecordById(flowRecord);
}
}
}
}
}
if (r != null && r.isSuccess()) {//批量提交
StaffEntity mySelf = (StaffEntity) r.get("from");
@ -492,12 +525,18 @@ public class ResultRecordController extends AbstractController {
ResultDetail old = resultDetailService.selectResultDetailById(req.getId());
if (old != null) {
com.lz.modules.app.utils.BeanUtils.copyProperty(old, req, false);
if(old.getType().equals(2)){
old.setTarget(Constant.WENHUAJIAZHIGUAN);
}
resultDetailService.updateResultDetailById(old);
} else {
ResultDetail resultDetail = new ResultDetail();
BeanUtils.copyProperties(req, resultDetail);
resultDetail.setRecordId(resultRecord.getId());
resultDetail.setStaffId(resultRecord.getStaffId());
if(req.getType().equals(2)){
resultDetail.setTarget(Constant.WENHUAJIAZHIGUAN);
}
resultDetailService.insertResultDetail(resultDetail);
}
List<ResultDetail> resultDetails = resultDetailService.selectByRecordId(resultRecord.getId());

View File

@ -80,8 +80,7 @@ public class StaffRoleController {
List<RecordRole> roles = recordRoleService.selectAll();
return R.ok().put("lzStaffRole", lzStaffRole)
.put("staffs", newList)
.put("targetRoles", roles)
;
.put("targetRoles", roles);
}
/**

View File

@ -1,18 +1,26 @@
package com.lz.modules.app.controller;
import com.alibaba.fastjson.JSON;
import com.lz.modules.app.dao.DepartmentsDao;
import com.lz.modules.app.entity.DepartmentsEntity;
import com.lz.modules.app.entity.DepartmentsStaffRelateEntity;
import com.lz.modules.app.entity.StaffEntity;
import com.lz.modules.app.resp.Step;
import com.lz.modules.app.service.DepartmentsService;
import com.lz.modules.app.service.DepartmentsStaffRelateService;
import com.lz.modules.app.service.StaffService;
import com.lz.modules.flow.model.FlowModel;
import com.lz.modules.sys.entity.app.ResultRecord;
import com.lz.modules.sys.service.app.ResultDetailService;
import com.lz.modules.sys.service.app.ResultRecordService;
import org.apache.commons.collections.CollectionUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import javax.swing.*;
import java.math.BigDecimal;
import java.util.ArrayList;
import java.util.Date;
import java.util.List;
@ -26,6 +34,12 @@ public class TestController {
private DepartmentsService departmentsService;
@Autowired
private ResultDetailService resultDetailService;
@Autowired
private StaffService staffService;
@Autowired
private DepartmentsStaffRelateService departmentsStaffRelateService;
@ -72,4 +86,63 @@ public class TestController {
departmentsStaffRelateService.updateById(l);
}
}
/**
* {
* "type": "node",
* "left": 818,
* "top": 510,
* "uuid": "id3",
* "prev": [
* "id1",
* "id2"
* ],
* "next": [
* "id4",
* "id5"
* ],
* "formData": {
* "stepName": "名称1",
* "ruleGroupList": [{
* "name": "名称2",
* "nextStep": "id5"
* },
* {
* "name": "名称6",
* "nextStep": "id7"
* }
* ]
* },
* "nextIfId": "id12",
* "nextElseId": "id11"
* }
*/
@RequestMapping("/test/step")
public void step(){
Long staffId = 294l;
ResultRecord resultRecord = new ResultRecord();
resultRecord.setType(2);
resultRecord.setStaffId(staffId);
DepartmentsStaffRelateEntity departmentsStaffRelateEntity = departmentsStaffRelateService.selectLastDepartmentByStaffId(resultRecord.getStaffId());
resultRecord.setDepartmentId(departmentsStaffRelateEntity.getDepartmentId());
List<Step> test = resultDetailService.getStepList(resultRecord);
List<String> list = new ArrayList<>();
if(CollectionUtils.isNotEmpty(test)){
Step step = test.get(0);
StaffEntity staffEntity = staffService.selectStaffById(staffId);
if(staffEntity !=null && !staffEntity.getName().equals(step.getName())){
list.add(staffEntity.getName());
}
for(Step s:test){
list.add(s.getName());
}
}
System.out.println(JSON.toJSONString(list));
List<FlowModel> flowModels = new ArrayList<>();
FlowModel flowModel = new FlowModel();
for(String s:list){
}
}
}

View File

@ -19,6 +19,15 @@ import lombok.Data;
public class StaffEntity implements Serializable {
private static final long serialVersionUID = 1L;
public StaffEntity() {
}
public StaffEntity(Long id,String name) {
this.id = id;
this.name = name;
}
/**
* 自增主键
*/

View File

@ -0,0 +1,39 @@
package com.lz.modules.app.enums;
public enum FlowNodeEnum {
startNode("开始", "startNode"),
endNode("结束", "endNode"),
tempNode("案例", "tempNode"),
ifNode("条件", "ifNode"),
expandNode("分组", "expandNode"),
nodeNode("节点", "nodeNode");
private String name;
private String desc ;
FlowNodeEnum(String name, String desc) {
this.name = name;
this.desc = desc;
}
public String getName() {
return name;
}
public void setName(String name) {
this.name = name;
}
public String getDesc() {
return desc;
}
public void setDesc(String desc) {
this.desc = desc;
}
public static void main(String[] args) {
System.out.println(FlowNodeEnum.endNode.desc);
}
}

View File

@ -13,6 +13,7 @@ import com.lz.modules.equipment.service.SpecialApplyInfoService;
import com.lz.modules.sys.controller.AbstractController;
import io.swagger.annotations.*;
import lombok.extern.slf4j.Slf4j;
import org.apache.shiro.authz.annotation.RequiresPermissions;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
@ -43,6 +44,7 @@ public class EmployeeController extends AbstractController {
private IEquipmentInfoService iEquipmentInfoService;
@PostMapping("findEmployeeByName")
@RequiresPermissions("user:device:pandian")
public R findEmployeeByName(@RequestBody @ApiParam FindByNameModel nameModel){
PageUtils pageUtils = PageUtils.startPage(nameModel.getCurrPage(), nameModel.getPageSize()).doSelect(
page -> staffService.selectBySearchName(page, nameModel)
@ -52,6 +54,7 @@ public class EmployeeController extends AbstractController {
}
@PostMapping("findSpecialApplyByName")
@RequiresPermissions("user:device:pandian")
public R findSpecialApplyByName(@RequestBody @ApiParam FindByNameModel nameModel){
List<FindEmployeeResModel> data = new ArrayList<>();
PageUtils pageUtils = PageUtils.startPage(nameModel.getCurrPage(), nameModel.getPageSize()).doSelect(
@ -64,6 +67,7 @@ public class EmployeeController extends AbstractController {
@PostMapping("findUsersEquipmentsByName")
@RequiresPermissions("user:device:pandian")
public R findUsersEquipmentsByName(@RequestBody @ApiParam FindEquipmentsByNameModel nameModel){
PageUtils pageUtils = PageUtils.startPage(nameModel.getCurrPage(), nameModel.getPageSize()).doSelect(

View File

@ -10,6 +10,7 @@ import com.lz.modules.equipment.entity.EquipmentType;
import com.lz.modules.equipment.entity.resp.EquipmentBrandResp;
import com.lz.modules.equipment.service.EquipmentBrandService;
import com.lz.modules.equipment.service.IEquipmentTypeService;
import org.apache.shiro.authz.annotation.RequiresPermissions;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
@ -56,6 +57,7 @@ public class EquipmentBrandController {
* @throws Exception 异常
*/
@RequestMapping("/modules/brand/equipmentBrandAdd")
@RequiresPermissions("user:device:brand:save")
public R equipmentBrandAdd(@RequestBody EquipmentBrandReq req) throws Exception {
EquipmentBrand equipmentBrand = new EquipmentBrand();
BeanUtils.copyProperty(equipmentBrand, req, true);
@ -84,6 +86,7 @@ public class EquipmentBrandController {
* @throws Exception 异常
*/
@RequestMapping(value = "/modules/brand/equipmentBrandEdit")
@RequiresPermissions("user:device:brand:update")
public R equipmentBrandEdit(@RequestBody EquipmentBrandReq req) throws Exception {
EquipmentBrand equipmentBrand = equipmentBrandService.selectEquipmentBrandById(req.getId());
BeanUtils.copyProperty(equipmentBrand, req, true);
@ -97,6 +100,7 @@ public class EquipmentBrandController {
* @throws Exception 异常
*/
@RequestMapping(value = "/modules/brand/equipmentBrandDelete")
@RequiresPermissions("user:device:brand:delete")
public R equipmentBrandDelete(@RequestBody EquipmentBrandReq req) throws Exception {
equipmentBrandService.deleteEquipmentBrandById(req.getId());
return R.ok("删除成功");
@ -120,6 +124,7 @@ public class EquipmentBrandController {
* @throws Exception 异常
*/
@RequestMapping(value = "/modules/brand/equipmentBrandList")
@RequiresPermissions("user:device:brand:list")
public R equipmentBrandList(@RequestBody EquipmentBrandReq req) throws Exception {
PageUtils page = equipmentBrandService.selectByCondition(req);

View File

@ -13,6 +13,7 @@ import com.lz.modules.sys.controller.AbstractController;
import com.lz.modules.sys.entity.SysUserEntity;
import io.swagger.annotations.*;
import lombok.extern.slf4j.Slf4j;
import org.apache.shiro.authz.annotation.RequiresPermissions;
import org.springframework.beans.BeanUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.http.MediaType;
@ -56,6 +57,7 @@ public class EquipmentController extends AbstractController {
private SpecialApplyInfoService specialApplyInfoService;
@GetMapping("findEquipmentById")
@RequiresPermissions("user:device:pandian")
public R findEquipmentById(@Valid @RequestParam @NotNull(message = "设备标识不能为空") String code){
EquipmentInfo equipmentInfo = iEquipmentInfoService.selectEquipmentInfoByCode(code);
if(equipmentInfo==null){
@ -79,7 +81,7 @@ public class EquipmentController extends AbstractController {
model.setSpecId(equipmentSpecs1.getId());
}
});
// addRecord(equipmentInfo);
addRecord(equipmentInfo);
return R.ok().put("data", model);
}
@ -103,6 +105,7 @@ public class EquipmentController extends AbstractController {
}*/
@PostMapping("changeEquipmentInfo")
@RequiresPermissions("user:device:pandian")
public R changeEquipmentState(@RequestBody @Valid ChangeEquipmentModel model){
EquipmentDto dto = new EquipmentDto();
BeanUtils.copyProperties(model,dto);
@ -118,6 +121,7 @@ public class EquipmentController extends AbstractController {
@GetMapping("findRrBySpec")
@RequiresPermissions("user:device:pandian")
public R getRrBySpec(@Valid @RequestParam @NotNull(message = "规格不能为空") Long specId){
List<EquipmentQr> rrBySpec = equipmentQrService.findRrBySpec(specId);
if(CollectionUtils.isEmpty(rrBySpec)){
@ -151,6 +155,7 @@ public class EquipmentController extends AbstractController {
@PostMapping("findEquipmentType")
@RequiresPermissions("user:device:pandian")
public R findEquipmentType(@RequestBody @ApiParam FindEquipmentTypeModel model){
String[] split = null;
int length = 0;

View File

@ -9,6 +9,7 @@ import com.lz.modules.equipment.service.EquipmentBrandService;
import com.lz.modules.equipment.service.IEquipmentInfoService;
import com.lz.modules.equipment.service.IEquipmentTypeService;
import com.lz.modules.equipment.service.TCountService;
import org.apache.shiro.authz.annotation.RequiresPermissions;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
@ -102,6 +103,7 @@ public class EquipmentInfoController {
* @throws Exception 异常
*/
@RequestMapping(value = "/modules/usereq/equipmentInfoEdit")
@RequiresPermissions("user:device:update")
public R equipmentInfoEdit(@RequestBody EquipmentInfoReq req) throws Exception {
EquipmentInfo equipmentInfo = equipmentInfoService.selectEquipmentInfoById(req.getId());
BeanUtils.copyProperty(equipmentInfo, req, true);
@ -122,6 +124,7 @@ public class EquipmentInfoController {
* @throws Exception 异常
*/
@RequestMapping(value = "/modules/usereq/equipmentInfoDelete")
@RequiresPermissions("user:device:delete")
public R equipmentInfoDelete(@RequestBody EquipmentInfoReq req) throws Exception {
equipmentInfoService.deleteEquipmentInfoById(req.getId());
return R.ok("删除成功");
@ -149,9 +152,10 @@ public class EquipmentInfoController {
* @throws Exception 异常
*/
@RequestMapping(value = "/modules/usereq/equipmentInfoList")
@RequiresPermissions("user:device:list")
public R equipmentInfoList(@RequestBody EquipmentInfoReq req) throws Exception {
List<EquipmentType> types = equipmentTypeService.selectAll();
List<TCount> tcounts = tCountService.selectListLimit(10);
List<TCount> tcounts = tCountService.selectListLimit(100);
EquipmentType type = new EquipmentType();
type.setId(null);
type.setType("全部");

View File

@ -11,6 +11,7 @@ import com.lz.modules.equipment.entity.resp.EquipmentSpecsResp;
import com.lz.modules.equipment.service.EquipmentBrandService;
import com.lz.modules.equipment.service.EquipmentSpecsService;
import com.lz.modules.equipment.service.IEquipmentTypeService;
import org.apache.shiro.authz.annotation.RequiresPermissions;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
@ -59,6 +60,7 @@ public class EquipmentSpecsController {
* @throws Exception 异常
*/
@RequestMapping("/modules/specs/equipmentSpecsAdd")
@RequiresPermissions("user:device:specs:save")
public R equipmentSpecsAdd(@RequestBody EquipmentSpecsReq req) throws Exception {
EquipmentSpecs equipmentSpecs = new EquipmentSpecs();
BeanUtils.copyProperty(equipmentSpecs, req, true);
@ -88,6 +90,7 @@ public class EquipmentSpecsController {
* @throws Exception 异常
*/
@RequestMapping(value = "/modules/specs/equipmentSpecsEdit")
@RequiresPermissions("user:device:specs:update")
public R equipmentSpecsEdit(@RequestBody EquipmentSpecsReq req) throws Exception {
EquipmentSpecs equipmentSpecs = equipmentSpecsService.selectEquipmentSpecsById(req.getId());
BeanUtils.copyProperty(equipmentSpecs, req, true);
@ -103,6 +106,7 @@ public class EquipmentSpecsController {
* @throws Exception 异常
*/
@RequestMapping(value = "/modules/specs/equipmentSpecsDelete")
@RequiresPermissions("user:device:specs:delete")
public R equipmentSpecsDelete(@RequestBody EquipmentSpecsReq req) throws Exception {
equipmentSpecsService.deleteEquipmentSpecsById(req.getId());
return R.ok("删除成功");
@ -144,6 +148,7 @@ public class EquipmentSpecsController {
* @throws Exception 异常
*/
@RequestMapping(value = "/modules/specs/equipmentSpecsList")
@RequiresPermissions("user:device:specs:list")
public R equipmentSpecsList(@RequestBody EquipmentSpecsReq req) throws Exception {
PageUtils page = equipmentSpecsService.selectByCondition(req);
List<EquipmentSpecs> specsList = page.getList();

View File

@ -7,6 +7,7 @@ import com.lz.modules.app.utils.BeanUtils;
import com.lz.modules.equipment.entity.EquipmentType;
import com.lz.modules.equipment.entity.EquipmentTypeReq;
import com.lz.modules.equipment.service.IEquipmentTypeService;
import org.apache.shiro.authz.annotation.RequiresPermissions;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
@ -47,6 +48,7 @@ public class EquipmentTypeController {
* @throws Exception 异常
*/
@RequestMapping("/modules/type/equipmentTypeAdd")
@RequiresPermissions("user:device:type:save")
public R equipmentTypeAdd(@RequestBody EquipmentTypeReq req) throws Exception {
EquipmentType equipmentType = new EquipmentType();
BeanUtils.copyProperty(equipmentType,req,true);
@ -72,6 +74,7 @@ public class EquipmentTypeController {
* @throws Exception 异常
*/
@RequestMapping(value = "/modules/type/equipmentTypeEdit")
@RequiresPermissions("user:device:type:update")
public R equipmentTypeEdit(@RequestBody EquipmentTypeReq req) throws Exception {
EquipmentType equipmentType = equipmentTypeService.selectEquipmentTypeById(req.getId());
BeanUtils.copyProperty(equipmentType,req,true);
@ -84,6 +87,7 @@ public class EquipmentTypeController {
* @throws Exception 异常
*/
@RequestMapping(value = "/modules/type/equipmentTypeDelete")
@RequiresPermissions("user:device:type:delete")
public R equipmentTypeDelete(@RequestBody EquipmentTypeReq req) throws Exception {
equipmentTypeService.deleteEquipmentTypeById(req.getId());
return R.ok("删除成功");
@ -104,6 +108,7 @@ public class EquipmentTypeController {
* @throws Exception 异常
*/
@RequestMapping(value = "/modules/type/equipmentTypeList")
@RequiresPermissions("user:device:type:list")
public R equipmentTypeList(@RequestBody EquipmentTypeReq req) throws Exception {
PageUtils page = equipmentTypeService.selectByCondition(req);
return R.ok().put("total", page.getTotalCount())

View File

@ -7,6 +7,7 @@ import com.lz.common.utils.StringUtil;
import com.lz.modules.equipment.entity.OneCode;
import com.lz.modules.equipment.entity.OneCodeReq;
import com.lz.modules.equipment.service.OneCodeService;
import org.apache.shiro.authz.annotation.RequiresPermissions;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
@ -30,6 +31,7 @@ public class OneCodeController {
* 获取code编码
* */
@RequestMapping("/get/getPrints")
@RequiresPermissions("user:device:code:list")
public R getPrints(@RequestBody OneCodeReq req) {
PageUtils pageUtils = oneCodeService.selectByReq(req);
@ -41,6 +43,7 @@ public class OneCodeController {
* 批量生成指定数量编码
* */
@RequestMapping("/new/prints")
@RequiresPermissions("user:device:code:save")
public R prints(@RequestParam int counts) {
List<String> codes = new ArrayList<>();
@ -56,6 +59,7 @@ public class OneCodeController {
* 重打印一个编码该编码已经在数据库中存在
* */
@RequestMapping("/re/print")
@RequiresPermissions("user:device:code:update")
public R prints(@RequestParam String code) {
OneCode oneCode = oneCodeService.selectByCode(code);
if(oneCode != null){

View File

@ -1,10 +1,14 @@
package com.lz.modules.equipment.controller;
import com.lz.common.utils.PageUtils;
import com.lz.common.utils.R;
import com.lz.modules.app.utils.BeanUtils;
import com.lz.modules.equipment.entity.EquipmentInfo;
import com.lz.modules.equipment.entity.TCount;
import com.lz.modules.equipment.entity.TCountReq;
import com.lz.modules.equipment.service.IEquipmentInfoService;
import com.lz.modules.equipment.service.TCountService;
import org.apache.shiro.authz.annotation.RequiresPermissions;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
@ -26,6 +30,9 @@ public class TCountController {
@Resource
private TCountService tCountService;
@Resource
private IEquipmentInfoService equipmentInfoService;
/**
* 添加盘点页面
*
@ -83,9 +90,17 @@ public class TCountController {
* @throws Exception 异常
*/
@RequestMapping(value = "/modules/count/tCountDelete")
@RequiresPermissions("user:device:count:delete")
public R tCountDelete(@RequestBody TCountReq req) throws Exception {
tCountService.deleteTCountById(req.getId());
return R.ok("删除成功");
TCount tcount = tCountService.selectTCountById(req.getId());
EquipmentInfo equipmentInfo = equipmentInfoService.selectEquipmentInfoByCount(tcount.getNum());
if(equipmentInfo == null){
tCountService.deleteTCountById(req.getId());
return R.ok("删除成功");
}
return R.error("改次盘点下面有盘点设备,无法删除");
}
@ -96,6 +111,7 @@ public class TCountController {
* @throws Exception 异常
*/
@RequestMapping(value = "/modules/count/newStart")
@RequiresPermissions("user:device:count:save")
public R newStart() throws Exception {
TCount tCount = tCountService.selectMaxTCount();
int count = 1 ;
@ -127,8 +143,10 @@ public class TCountController {
* @throws Exception 异常
*/
@RequestMapping(value = "/modules/count/tCountList")
@RequiresPermissions("user:device:count:list")
public R tCountList(@RequestBody TCountReq req) throws Exception {
PageUtils page = tCountService.selectByReq(req);
return R.ok().put("total", 1)
.put("rows", new ArrayList<>());
.put("rows", page);
}
}

View File

@ -42,4 +42,6 @@ public interface EquipmentInfoMapper extends BaseMapper<EquipmentInfo> {
List<EquipmentInfo> selectByCondition(@Param("page") IPage page, @Param("req") EquipmentInfoReq req);
List<EquipmentInfo> selectByStaffIdOrDepId(@Param("page") IPage page, @Param("nameModel") FindEquipmentsByNameModel nameModel);
EquipmentInfo selectEquipmentInfoByCount(Integer count);
}

View File

@ -8,7 +8,9 @@ package com.lz.modules.equipment.dao;
* @since 2020-08-10
*/
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.lz.modules.equipment.entity.TCount;
import com.lz.modules.equipment.entity.TCountReq;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
@ -36,4 +38,6 @@ public interface TCountMapper extends BaseMapper<TCount> {
TCount selectMaxCount();
List<TCount> selectListLimit(@Param("limit") int limit);
List selectByReq(@Param("page") IPage page, @Param("req") TCountReq req);
}

View File

@ -49,4 +49,6 @@ public interface IEquipmentInfoService extends IService<EquipmentInfo> {
PageUtils selectByCondition(EquipmentInfoReq req);
List<EquipmentInfo> selectByStaffIdOrDepId(IPage page, FindEquipmentsByNameModel nameModel);
EquipmentInfo selectEquipmentInfoByCount(Integer count);
}

View File

@ -2,7 +2,9 @@ package com.lz.modules.equipment.service;
import com.baomidou.mybatisplus.extension.service.IService;
import com.lz.common.utils.PageUtils;
import com.lz.modules.equipment.entity.TCount;
import com.lz.modules.equipment.entity.TCountReq;
import java.util.List;
@ -36,4 +38,6 @@ public interface TCountService extends IService<TCount> {
TCount selectMaxTCount();
List<TCount> selectListLimit(int limit);
PageUtils selectByReq(TCountReq req);
}

View File

@ -267,4 +267,9 @@ public class EquipmentInfoServiceImpl extends ServiceImpl<EquipmentInfoMapper, E
public List<EquipmentInfo> selectByStaffIdOrDepId(IPage page, FindEquipmentsByNameModel nameModel){
return equipmentInfoMapper.selectByStaffIdOrDepId(page, nameModel);
}
@Override
public EquipmentInfo selectEquipmentInfoByCount(Integer count){
return equipmentInfoMapper.selectEquipmentInfoByCount(count);
}
}

View File

@ -1,9 +1,12 @@
package com.lz.modules.equipment.service.impl;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.lz.common.utils.PageUtils;
import com.lz.modules.equipment.dao.TCountMapper;
import com.lz.modules.equipment.entity.TCount;
import com.lz.modules.equipment.entity.TCountReq;
import com.lz.modules.equipment.service.TCountService;
import lombok.Builder;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
@ -70,5 +73,13 @@ public class TCountServiceImpl extends ServiceImpl<TCountMapper, TCount> impleme
return tCountMapper.selectListLimit(limit);
}
@Override
public PageUtils selectByReq(TCountReq req){
PageUtils page = PageUtils.startPage(req.getPage(), req.getRows()).doSelect(
page1 -> tCountMapper.selectByReq(page1, req)
);
return page;
}
}

View File

@ -0,0 +1,39 @@
package com.lz.modules.flow.dao;
/**
* <p>
* 流程管理表 服务类
* </p>
*
* @author quyixiao
* @since 2020-09-22
*/
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.lz.modules.flow.entity.FlowManager;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import java.util.List;
import java.util.Map;
@Mapper
public interface FlowManagerMapper extends BaseMapper<FlowManager> {
FlowManager selectFlowManagerById(@Param("id") Long id);
Long insertFlowManager(FlowManager flowManager);
int updateFlowManagerById(FlowManager flowManager);
int updateCoverFlowManagerById(FlowManager flowManager);
int deleteFlowManagerById(@Param("id") Long id);
List<FlowManager> selectByCondition(@Param("page") IPage page, @Param("params") Map<String, Object> params);
}

View File

@ -0,0 +1,127 @@
package com.lz.modules.flow.entity;
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 lombok.Data;
import java.util.Date;
/**
* <p>
* 菜单权限表
* </p>*流程管理表
* @author quyixiao
* @since 2020-09-22
*/
@Data
@TableName("lz_flow_manager")
public class FlowManager implements java.io.Serializable {
//
@TableId(value = "id", type = IdType.AUTO)
private Long id;
//是否删除状态1删除0有效
private Integer isDelete;
//创建时间
private Date gmtCreate;
//最后修改时间
private Date gmtModified;
//流程名称
private String name;
@TableField(exist=false)
private String type;
/**
*
* @return
*/
public Long getId() {
return id;
}
/**
*
* @param id
*/
public void setId(Long id) {
this.id = id;
}
/**
* 是否删除状态1删除0有效
* @return
*/
public Integer getIsDelete() {
return isDelete;
}
/**
* 是否删除状态1删除0有效
* @param isDelete
*/
public void setIsDelete(Integer isDelete) {
this.isDelete = isDelete;
}
/**
* 创建时间
* @return
*/
public Date getGmtCreate() {
return gmtCreate;
}
/**
* 创建时间
* @param gmtCreate
*/
public void setGmtCreate(Date gmtCreate) {
this.gmtCreate = gmtCreate;
}
/**
* 最后修改时间
* @return
*/
public Date getGmtModified() {
return gmtModified;
}
/**
* 最后修改时间
* @param gmtModified
*/
public void setGmtModified(Date gmtModified) {
this.gmtModified = gmtModified;
}
/**
* 流程名称
* @return
*/
public String getName() {
return name;
}
/**
* 流程名称
* @param name
*/
public void setName(String name) {
this.name = name;
}
public String getType() {
return type;
}
public void setType(String type) {
this.type = type;
}
@Override
public String toString() {
return "FlowManager{" +
",id=" + id +
",isDelete=" + isDelete +
",gmtCreate=" + gmtCreate +
",gmtModified=" + gmtModified +
",name=" + name +
"}";
}
}

View File

@ -0,0 +1,30 @@
package com.lz.modules.flow.model;
import lombok.Data;
import java.util.List;
@Data
public class FlowDto {
private static final long serialVersionUID = 1L;
/**
* 飞书部门id
*/
private String departmentId;
/**
* 飞书上级部门id
*/
private String departmentParentId;
/**
* 飞书显示部门人数
*/
private String realName;
/**
* 组织架构名称/部门名称
*/
private String departmentName;
private Long staffId;
private List list;
}

View File

@ -0,0 +1,14 @@
package com.lz.modules.flow.model;
import com.lz.modules.app.entity.DepartmentsStaffRelateEntity;
import lombok.Data;
import java.util.List;
@Data
public class FlowInfo {
private DepartmentsStaffRelateEntity parentDepartmentRelate;
private List<DepartmentsStaffRelateEntity> list;
}

View File

@ -0,0 +1,17 @@
package com.lz.modules.flow.model;
import lombok.Data;
import java.util.List;
@Data
public class FlowModel {
private String type;
private int left = 818;
private int top = 510;
private String uuid;
private List<String> prev;
private List<String> next;
private FormDataModel formData;
}

View File

@ -0,0 +1,11 @@
package com.lz.modules.flow.model;
import lombok.Data;
import java.util.List;
@Data
public class FormDataModel {
private String stepName;
private List<RuleGroupModel> ruleGroupList;
}

View File

@ -0,0 +1,10 @@
package com.lz.modules.flow.model;
import lombok.Data;
@Data
public class RuleGroupModel {
private String name;
private String nextStep;
}

View File

@ -1,7 +1,11 @@
package com.lz.modules.flow.service;
import com.baomidou.mybatisplus.extension.service.IService;
import com.lz.common.utils.R;
import com.lz.modules.flow.entity.FlowDepartment;
import com.lz.modules.flow.entity.FlowManager;
import java.util.List;
/**
* <p>
@ -33,4 +37,6 @@ public interface FlowDepartmentService extends IService<FlowDepartment> {
FlowDepartment selectByStaffId(Long staffId);
FlowDepartment selectByParentId(Long parentId);
R selectFlowManager(Long staffId);
}

View File

@ -0,0 +1,43 @@
package com.lz.modules.flow.service;
import com.baomidou.mybatisplus.extension.service.IService;
import com.lz.common.utils.PageUtils;
import com.lz.modules.flow.entity.FlowManager;
import com.lz.modules.flow.model.FlowDto;
import java.util.List;
import java.util.Map;
/**
* <p>
* 流程管理表 服务类
* </p>
*
* @author quyixiao
* @since 2020-09-22
*/
public interface FlowManagerService extends IService<FlowManager> {
FlowManager selectFlowManagerById(Long id);
Long insertFlowManager(FlowManager flowManager);
int updateFlowManagerById(FlowManager flowManager);
int updateCoverFlowManagerById(FlowManager flowManager);
int deleteFlowManagerById(Long id);
PageUtils queryPage(Map<String, Object> params);
void deleteBatchIds(List<Long> asList);
List<FlowDto> getFowList();
}

View File

@ -43,4 +43,6 @@ public interface RecordAuthService extends IService<RecordAuth> {
String selectByStaffId(Long staffId);
List<RecordAuth> selectAll();
Long getRoleIdByStaffRoleInfo(String flowStaffIdRole,Long approvalStaffId);
}

View File

@ -1,72 +1,123 @@
package com.lz.modules.flow.service.impl;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.lz.common.utils.Constant;
import com.lz.common.utils.PageUtils;
import com.lz.common.utils.R;
import com.lz.modules.app.entity.DepartmentsStaffRelateEntity;
import com.lz.modules.flow.dao.FlowDepartmentMapper;
import com.lz.modules.flow.dao.FlowManagerMapper;
import com.lz.modules.flow.entity.FlowDepartment;
import com.lz.modules.flow.entity.FlowManager;
import com.lz.modules.flow.model.TypeFlowDto;
import com.lz.modules.flow.service.FlowDepartmentService;
import com.lz.modules.sys.service.app.ResultRecordService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import java.util.ArrayList;
import java.util.List;
/**
* <p>
* 流转关系表 服务类
* </p>
*
* @author quyixiao
* @since 2020-08-18
*/
* <p>
* 流转关系表 服务类
* </p>
*
* @author quyixiao
* @since 2020-08-18
*/
@Service
public class FlowDepartmentServiceImpl extends ServiceImpl<FlowDepartmentMapper, FlowDepartment> implements FlowDepartmentService {
@Autowired
private FlowDepartmentMapper flowDepartmentMapper;
private FlowDepartmentMapper flowDepartmentMapper;
@Autowired
private FlowDepartmentService flowDepartmentService;
@Autowired
private ResultRecordService resultRecordService;
@Autowired
private FlowManagerMapper flowManagerMapper;
@Override
public FlowDepartment selectFlowDepartmentById(Long id){
return flowDepartmentMapper.selectFlowDepartmentById(id);
}
@Override
public FlowDepartment selectFlowDepartmentById(Long id) {
return flowDepartmentMapper.selectFlowDepartmentById(id);
}
@Override
public Long insertFlowDepartment(FlowDepartment flowDepartment){
return flowDepartmentMapper.insertFlowDepartment(flowDepartment);
}
@Override
public Long insertFlowDepartment(FlowDepartment flowDepartment) {
return flowDepartmentMapper.insertFlowDepartment(flowDepartment);
}
@Override
public int updateFlowDepartmentById(FlowDepartment flowDepartment){
return flowDepartmentMapper.updateFlowDepartmentById(flowDepartment);
}
@Override
public int updateFlowDepartmentById(FlowDepartment flowDepartment) {
return flowDepartmentMapper.updateFlowDepartmentById(flowDepartment);
}
@Override
public int updateCoverFlowDepartmentById(FlowDepartment flowDepartment){
return flowDepartmentMapper.updateCoverFlowDepartmentById(flowDepartment);
}
@Override
public int updateCoverFlowDepartmentById(FlowDepartment flowDepartment) {
return flowDepartmentMapper.updateCoverFlowDepartmentById(flowDepartment);
}
@Override
public int deleteFlowDepartmentById(Long id){
return flowDepartmentMapper.deleteFlowDepartmentById(id);
}
@Override
public int deleteFlowDepartmentById(Long id) {
return flowDepartmentMapper.deleteFlowDepartmentById(id);
}
@Override
public FlowDepartment selectByStaffId(Long staffId) {
return flowDepartmentMapper.selectByStaffId(staffId);
}
@Override
public FlowDepartment selectByParentId(Long parentId) {
return flowDepartmentMapper.selectByParentId(parentId);
}
@Override
public FlowDepartment selectByParentId(Long parentId) {
return flowDepartmentMapper.selectByParentId(parentId);
}
@Override
public R selectFlowManager(Long staffId) {
Long flowId1 = 0l;
Long flowId2 = 0l;
FlowDepartment flowDepartment = flowDepartmentService.selectByStaffId(staffId);
if (flowDepartment == null) {
DepartmentsStaffRelateEntity leader = resultRecordService.getLeaderDepartmentsStaffRelateEntity(staffId);
if(leader != null){
flowDepartment = flowDepartmentService.selectByStaffId(leader.getStaffId());
flowId1 = TypeFlowDto.getFlowId(flowDepartment.getFlowIds(), Constant.CHILD, 1); // 表示是子
flowId2 = TypeFlowDto.getFlowId(flowDepartment.getFlowIds(), Constant.CHILD, 2); // 表示是子
}
} else {
flowId1 = TypeFlowDto.getFlowId(flowDepartment.getFlowIds(), Constant.SELF, 1); // 表示是部门主管自己
flowId2 = TypeFlowDto.getFlowId(flowDepartment.getFlowIds(), Constant.SELF, 2); // 表示是部门主管自己
}
List<FlowManager> flowManagers = new ArrayList<>();
flowManagers.add(getFlowMnagers(flowId1,"type1"));
flowManagers.add(getFlowMnagers(flowId2,"type2"));
PageUtils pageUtils = new PageUtils();
pageUtils.setList(flowManagers);
return R.ok().put("page", pageUtils);
}
public FlowManager getFlowMnagers(Long flowId, String type) {
FlowManager flowManager = flowManagerMapper.selectFlowManagerById(flowId);
if (flowManager == null) {
flowManager = new FlowManager();
flowManager.setId(flowId);
flowManager.setName(flowId == 0 ? "" : flowId + "");
}
flowManager.setType(type);
return flowManager;
}
}

View File

@ -0,0 +1,217 @@
package com.lz.modules.flow.service.impl;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.lz.common.utils.NumberUtil;
import com.lz.common.utils.PageUtils;
import com.lz.modules.app.dao.DepartmentsDao;
import com.lz.modules.app.dao.StaffDao;
import com.lz.modules.app.entity.DepartmentsEntity;
import com.lz.modules.app.entity.DepartmentsStaffRelateEntity;
import com.lz.modules.app.entity.StaffEntity;
import com.lz.modules.app.service.DepartmentsStaffRelateService;
import com.lz.modules.flow.dao.FlowManagerMapper;
import com.lz.modules.flow.entity.FlowManager;
import com.lz.modules.flow.model.FlowDto;
import com.lz.modules.flow.model.FlowInfo;
import com.lz.modules.flow.service.FlowManagerService;
import com.lz.modules.flow.service.RecordRoleService;
import org.apache.commons.collections.CollectionUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import java.util.stream.Collectors;
/**
* <p>
* 流程管理表 服务类
* </p>
*
* @author quyixiao
* @since 2020-09-22
*/
@Service
public class FlowManagerServiceImpl extends ServiceImpl<FlowManagerMapper, FlowManager> implements FlowManagerService {
@Autowired
private FlowManagerMapper flowManagerMapper;
@Autowired
private DepartmentsDao departmentsDao;
@Autowired
private DepartmentsStaffRelateService departmentsStaffRelateService;
@Autowired
private StaffDao staffDao;
@Autowired
private RecordRoleService recordRoleService;
@Override
public FlowManager selectFlowManagerById(Long id){
return flowManagerMapper.selectFlowManagerById(id);
}
@Override
public Long insertFlowManager(FlowManager flowManager){
return flowManagerMapper.insertFlowManager(flowManager);
}
@Override
public int updateFlowManagerById(FlowManager flowManager){
return flowManagerMapper.updateFlowManagerById(flowManager);
}
@Override
public int updateCoverFlowManagerById(FlowManager flowManager){
return flowManagerMapper.updateCoverFlowManagerById(flowManager);
}
@Override
public int deleteFlowManagerById(Long id){
return flowManagerMapper.deleteFlowManagerById(id);
}
@Override
public PageUtils queryPage(Map<String, Object> params) {
PageUtils pageUtils = PageUtils.startPage(
NumberUtil.objToIntDefault(params.get("page"), 1),
NumberUtil.objToIntDefault(params.get("limit"), 10)).doSelect(
page -> flowManagerMapper.selectByCondition(page, params)
);
return pageUtils;
}
@Override
public void deleteBatchIds(List<Long> asList) {
}
@Override
public List<FlowDto> getFowList() {
List<DepartmentsEntity> tDepartments = departmentsDao.selectAll();
List<DepartmentsEntity> parentDepartments = tDepartments.stream()
//根据两个属性进行过滤
.filter(s -> s.getDepartmentParentId().equals("1"))
.collect(Collectors.toList());
List<DepartmentsStaffRelateEntity> departmentsStaffRelateEntities = departmentsStaffRelateService.selectAll();
Map<String, FlowInfo> departmentsStaffRelateEntityMap = new HashMap<>();
Map<String, DepartmentsStaffRelateEntity> singleRelateMap = new HashMap<>();
for(DepartmentsStaffRelateEntity d : departmentsStaffRelateEntities){
singleRelateMap.put(d.getDepartmentId(),d);
if(new Integer(1).equals(d.getIsLeader())){
FlowInfo flowInfo = new FlowInfo();
flowInfo.setParentDepartmentRelate(d);
List<DepartmentsStaffRelateEntity> list = new ArrayList<>();
for(DepartmentsStaffRelateEntity d2 : departmentsStaffRelateEntities){
if(d2.getDepartmentId().equals(d.getDepartmentId()) && new Integer(0).equals(d2.getIsLeader())){
list.add(d2);
}
}
flowInfo.setList(list);
departmentsStaffRelateEntityMap.put(d.getDepartmentId(),flowInfo);
}
}
List<StaffEntity> staffEntities = staffDao.selectAll();
Map<Long ,StaffEntity> staffMap = new HashMap<>();
for(StaffEntity staffEntity : staffEntities){
staffMap.put(staffEntity.getId(),staffEntity);
}
List<FlowDto> list = new ArrayList<>();
for (DepartmentsEntity d : parentDepartments) {
StaffEntity staff = getStaff(departmentsStaffRelateEntityMap,staffMap,d.getDepartmentId(),singleRelateMap);
FlowDto entity = buildMenuEntity(d.getDepartmentId(),d.getDepartmentName() , "1", staff.getName(),staff.getId());
List<FlowDto> childList = getMenuList(tDepartments, entity,departmentsStaffRelateEntityMap,staffMap,singleRelateMap);
entity.setList(childList);
list.add(entity);
}
return list;
}
public FlowDto buildMenuEntity(String departmentId, String departmentName, String parentId, String realName,Long staffId) {
FlowDto flowDto = new FlowDto();
flowDto.setDepartmentId(departmentId);
flowDto.setDepartmentName(departmentName);
flowDto.setDepartmentParentId(parentId);
flowDto.setRealName(realName);
flowDto.setStaffId(staffId);
return flowDto;
}
public StaffEntity getStaff(Map<String, FlowInfo> departmentsStaffRelateEntityMap, Map<Long, StaffEntity> staffMap, String departmentId
, Map<String, DepartmentsStaffRelateEntity> singleRelateMap) {
FlowInfo flowInfo = departmentsStaffRelateEntityMap.get(departmentId);
if (flowInfo != null) {
return doGetStaff(flowInfo.getParentDepartmentRelate(), staffMap);
} else {
return doGetStaff(singleRelateMap.get(departmentId), staffMap);
}
}
public StaffEntity doGetStaff(DepartmentsStaffRelateEntity departmentsStaffRelateEntity, Map<Long, StaffEntity> staffMap) {
if (departmentsStaffRelateEntity != null) {
StaffEntity staffEntity = staffMap.get(departmentsStaffRelateEntity.getStaffId());
if (staffEntity != null) {
return staffEntity;
}
}
return new StaffEntity(0l,"");
}
public List<FlowDto> getMenuList(List<DepartmentsEntity> tDepartments,FlowDto flowDto,
Map<String, FlowInfo> departmentsStaffRelateEntityMap, Map<Long, StaffEntity> staffMap
, Map<String, DepartmentsStaffRelateEntity> singleRelateMap) {
List<FlowDto> flowDtos = new ArrayList<>();
for (DepartmentsEntity child : tDepartments) {
if (child.getDepartmentParentId().equals(flowDto.getDepartmentId())) {
StaffEntity staff = getStaff(departmentsStaffRelateEntityMap, staffMap, child.getDepartmentId(), singleRelateMap);
FlowDto entity = buildMenuEntity(child.getDepartmentId(),
child.getDepartmentName(), flowDto.getDepartmentId(), staff.getName(),staff.getId());
List<FlowDto> list = getMenuList(tDepartments, entity, departmentsStaffRelateEntityMap, staffMap, singleRelateMap);
if (CollectionUtils.isEmpty(list) || list.size() == 0) {
FlowInfo flowInfo = departmentsStaffRelateEntityMap.get(child.getDepartmentId());
if (flowInfo != null && CollectionUtils.isNotEmpty(flowInfo.getList()) && flowInfo.getList().size() > 0) {
list = new ArrayList<>();
for (DepartmentsStaffRelateEntity dr : flowInfo.getList()) {
StaffEntity staffEntity = staffMap.get(dr.getStaffId());
FlowDto childEntiry = buildMenuEntity(dr.getDepartmentId() + "_" + dr.getStaffId(),
" ",
entity.getDepartmentId(),
staffEntity.getName(),staff.getId());
list.add(childEntiry);
}
}
}
entity.setList(list);
flowDtos.add(entity);
}
}
return flowDtos;
}
}

View File

@ -103,6 +103,21 @@ public class RecordAuthServiceImpl extends ServiceImpl<RecordAuthMapper, RecordA
return staffEntityMap;
}
@Override
public Long getRoleIdByStaffRoleInfo(String flowStaffIdRole,Long approvalStaffId) {
if (StringUtil.isNotBlank(flowStaffIdRole)) {
List<StaffRoleDto> list = JSONObject.parseArray(flowStaffIdRole, StaffRoleDto.class);
if (CollectionUtils.isNotEmpty(list)) {
for(StaffRoleDto staffRoleDto:list){
if(staffRoleDto.getStaffId().equals(approvalStaffId)){
return staffRoleDto.getRoleId();
}
}
}
}
return 0l;
}
public Auth getAuth(List<RecordAuth> auths) {
Map<String, Integer> map = new HashMap<>();

View File

@ -5,12 +5,13 @@ import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.google.common.collect.Maps;
import com.lz.common.utils.NumberUtil;
import com.lz.common.utils.PageUtils;
import com.lz.common.utils.StringUtil;
import com.lz.modules.app.dao.DepartmentsDao;
import com.lz.modules.app.dao.StaffDao;
import com.lz.modules.app.dto.StaffRoleResp;
import com.lz.modules.app.entity.DepartmentsEntity;
import com.lz.modules.app.entity.DepartmentsStaffRelateEntity;
import com.lz.modules.app.entity.StaffEntity;
import com.lz.modules.app.service.DepartmentsStaffRelateService;
import com.lz.modules.flow.dao.RecordRoleMapper;
import com.lz.modules.flow.dao.StaffRoleDepartmentMapper;
import com.lz.modules.flow.dao.StaffRoleMapper;
@ -18,13 +19,11 @@ import com.lz.modules.flow.entity.RecordRole;
import com.lz.modules.flow.entity.StaffRole;
import com.lz.modules.flow.entity.StaffRoleDepartment;
import com.lz.modules.flow.service.RecordRoleService;
import com.lz.modules.flow.service.StaffRoleDepartmentService;
import com.lz.modules.flow.service.StaffRoleService;
import com.lz.modules.sys.entity.SysMenuEntity;
import com.lz.modules.sys.entity.SysRoleEntity;
import com.lz.modules.sys.service.app.ResultRecordService;
import lombok.extern.slf4j.Slf4j;
import org.apache.commons.collections.CollectionUtils;
import org.springframework.beans.BeanUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
@ -70,6 +69,9 @@ public class StaffRoleServiceImpl extends ServiceImpl<StaffRoleMapper, StaffRole
@Autowired
private RecordRoleService recordRoleService;
@Autowired
private DepartmentsStaffRelateService departmentsStaffRelateService;
@Override
public StaffRole selectStaffRoleById(Long id) {
return staffRoleMapper.selectStaffRoleById(id);
@ -196,22 +198,48 @@ public class StaffRoleServiceImpl extends ServiceImpl<StaffRoleMapper, StaffRole
//根据两个属性进行过滤
.filter(s -> s.getDepartmentParentId().equals("1"))
.collect(Collectors.toList());
List<DepartmentsStaffRelateEntity> departmentsStaffRelateEntities = departmentsStaffRelateService.selectAll();
Map<String,DepartmentsStaffRelateEntity> departmentsStaffRelateEntityMap = new HashMap<>();
for(DepartmentsStaffRelateEntity d : departmentsStaffRelateEntities){
if(new Integer(1).equals(d.getIsLeader())){
departmentsStaffRelateEntityMap.put(d.getDepartmentId(),d);
}
}
List<StaffEntity> staffEntities = staffDao.selectAll();
Map<Long ,StaffEntity> staffMap = new HashMap<>();
for(StaffEntity staffEntity : staffEntities){
staffMap.put(staffEntity.getId(),staffEntity);
}
List<SysMenuEntity> list = new ArrayList<>();
for(DepartmentsEntity d:parentDepartments){
SysMenuEntity entity = recordRoleService.buildMenuEntity(NumberUtil.objToLongDefault(d.getDepartmentId(),0l),d.getDepartmentName(),0l,"");
getMenuList(tDepartments,entity,list);
for (DepartmentsEntity d : parentDepartments) {
String departmentName = d.getDepartmentName() + getSuffix(departmentsStaffRelateEntityMap,staffMap,d.getDepartmentId());
SysMenuEntity entity = recordRoleService.buildMenuEntity(NumberUtil.objToLongDefault(d.getDepartmentId(), 0l),departmentName , 0l, "");
getMenuList(tDepartments, entity, list,departmentsStaffRelateEntityMap,staffMap);
list.add(entity);
}
return list;
}
public void getMenuList(List<DepartmentsEntity> tDepartments,SysMenuEntity sysMenuEntity,List<SysMenuEntity> list) {
public String getSuffix(Map<String,DepartmentsStaffRelateEntity> departmentsStaffRelateEntityMap, Map<Long ,StaffEntity> staffMap,String departmentId){
String suffix = "";
DepartmentsStaffRelateEntity departmentsStaffRelateEntity = departmentsStaffRelateEntityMap.get(departmentId);
if(departmentsStaffRelateEntity !=null){
StaffEntity staffEntity = staffMap.get(departmentsStaffRelateEntity.getStaffId());
if(staffEntity !=null ){
suffix = " , "+staffEntity.getName();
}
}
return suffix;
}
public void getMenuList(List<DepartmentsEntity> tDepartments,SysMenuEntity sysMenuEntity,List<SysMenuEntity> list,
Map<String,DepartmentsStaffRelateEntity> departmentsStaffRelateEntityMap, Map<Long ,StaffEntity> staffMap) {
for(DepartmentsEntity child : tDepartments) {
if(NumberUtil.objToLongDefault(child.getDepartmentParentId(),0l).equals(sysMenuEntity.getMenuId())){
String departmentName = child.getDepartmentName() + getSuffix(departmentsStaffRelateEntityMap,staffMap,child.getDepartmentId());
SysMenuEntity entity = recordRoleService.buildMenuEntity(NumberUtil.objToLongDefault(child.getDepartmentId(),0l),
child.getDepartmentName(),sysMenuEntity.getMenuId(),sysMenuEntity.getName());
getMenuList(tDepartments,entity,list);
departmentName,sysMenuEntity.getMenuId(),sysMenuEntity.getName());
getMenuList(tDepartments,entity,list,departmentsStaffRelateEntityMap,staffMap);
list.add(entity);
}
}

View File

@ -49,7 +49,7 @@ public interface ResultRecordMapper extends BaseMapper<ResultRecord> {
List<ResultRecordDto> selectByConditionByLeader(@Param("page") IPage page, @Param("req") ResultRecordReq params);
void updateFlowStaffIdRoleToNull(@Param("id") Long id);
void updateFlowStaffIdRoleToNull(@Param("id") Long id, @Param("status") Integer status);
List<ResultRecord> selectResultRecordByIds(@Param("recordIds") List<Long> recordIds);

View File

@ -28,7 +28,7 @@ public class ResultRecord implements java.io.Serializable {
private Date gmtModified;
//月份
private Date monthTime;
//0.新建1 提交审批中2 拒绝, 3 侍提交 4 审批通过,5 驳回
//0.新建1 提交审批中2 拒绝, 3 侍提交 4 审批通过,5 驳回6申述7 流程终止
private Integer status;
//最后得分
private BigDecimal lastScore;

View File

@ -56,7 +56,7 @@ public interface ResultDetailService extends IService<ResultDetail> {
ResultDetailResp getLastResult(BigDecimal bigDecimal);
void insertWenHuaJiaZhiGua(String s, Long id, Long userId);
void insertWenHuaJiaZhiGua(String s, Long id, Long userId,BigDecimal checkWeight);
String initRole(Long staffId, Long l);

View File

@ -7,11 +7,13 @@ import com.lz.common.utils.R;
import com.lz.modules.app.dto.GraphicsStatisticalDto;
import com.lz.modules.app.dto.ReportProgressListDto;
import com.lz.modules.app.entity.DepartmentsEntity;
import com.lz.modules.app.entity.DepartmentsStaffRelateEntity;
import com.lz.modules.app.entity.StaffEntity;
import com.lz.modules.app.req.ResultRecordReq;
import com.lz.modules.app.resp.OwnResultResp;
import com.lz.modules.app.utils.t.TwoTuple;
import com.lz.modules.flow.entity.Flow;
import com.lz.modules.flow.model.StaffRoleDto;
import com.lz.modules.sys.entity.SysUserEntity;
import com.lz.modules.sys.entity.app.ResultRecord;
@ -51,9 +53,9 @@ public interface ResultRecordService extends IService<ResultRecord> {
ResultRecord selectResultRecordByStaffId(Long userId);
void updateFlowStaffIdRoleToNull(Long id);
void updateFlowStaffIdRoleToNull(Long id,Integer status);
R approval(Long resultRecordId, Long userId,Integer status);
R approval(Long resultRecordId, Long userId,Integer status,boolean flagEnd);
List<ResultRecord> selectResultRecordByIds(List<Long> recordIds);
@ -86,8 +88,8 @@ public interface ResultRecordService extends IService<ResultRecord> {
ResultRecord selectResultRecordByStaffIdStatus(Long staffId, int status);
R reject( ResultRecord resultRecord,ResultRecordReq req, Long userId);
// ReportProgressListDto targetReportList(String monthTime);
R reject( ResultRecord resultRecord,Integer status);
StaffEntity getApprovalStaff(ResultRecord resultRecord, String departmentLevel, List<StaffRoleDto> staffRoleDtos, Long roleId);
DepartmentsStaffRelateEntity getLeaderDepartmentsStaffRelateEntity(Long staffId);
}

View File

@ -3,6 +3,7 @@ package com.lz.modules.sys.service.app.impl;
import com.alibaba.fastjson.JSON;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.lz.common.utils.BigDecimalUtil;
import com.lz.common.utils.Constant;
import com.lz.common.utils.StringUtil;
import com.lz.modules.app.entity.StaffEntity;
import com.lz.modules.app.resp.ResultDetailResp;
@ -139,17 +140,17 @@ public class ResultDetailServiceImpl extends ServiceImpl<ResultDetailMapper, Res
public ResultDetailResp getWenHuaJiaZhiGua1(Auth auth) {
ResultDetailResp wenhua1 = new ResultDetailResp();
wenhua1.setCheckRange("文化价值观");
wenhua1.setTarget("做人:相信、包容、担当");
wenhua1.setTarget("做人:相信、包容、担当\n 做事:用户第一、求真、极致");
wenhua1.setType(2);
wenhua1.setIsEdit(auth.getWenHuaEdit());
wenhua1.setCheckWeight(new BigDecimal(0.15));
wenhua1.setCheckWeight(new BigDecimal(0.3));
return wenhua1;
}
public ResultDetailResp getWenHuaJiaZhiGua2(Auth auth) {
ResultDetailResp wenhua2 = new ResultDetailResp();
wenhua2.setCheckRange("文化价值观");
wenhua2.setTarget("做事:用户第一、求真、极致");
wenhua2.setTarget("");
wenhua2.setType(2);
wenhua2.setIsEdit(auth.getWenHuaEdit());
wenhua2.setCheckWeight(new BigDecimal(0.15));
@ -190,13 +191,14 @@ public class ResultDetailServiceImpl extends ServiceImpl<ResultDetailMapper, Res
public void insertWenHuaJiaZhiGua(String target, Long recordId, Long staffId) {
public void insertWenHuaJiaZhiGua(String target, Long recordId, Long staffId,BigDecimal checkWeight) {
ResultDetail wenhua1 = new ResultDetail();
wenhua1.setTarget(target);
wenhua1.setType(2);
wenhua1.setCheckWeight(new BigDecimal(0.15));
wenhua1.setCheckWeight(checkWeight);
wenhua1.setStaffId(staffId);
wenhua1.setRecordId(recordId);
wenhua1.setKeyResult(Constant.WENHUAJIAZHIGUAN_TARGET);
insertResultDetail(wenhua1);
}
@ -214,49 +216,8 @@ public class ResultDetailServiceImpl extends ServiceImpl<ResultDetailMapper, Res
public List<Step> getStepList(ResultRecord resultRecord) {
Long staffId = resultRecord.getStaffId();
int type = resultRecord.getType();
String departmentId = resultRecord.getDepartmentId();
List<Step> stepList = new ArrayList<>();
StaffEntity mySelf = staffService.selectStaffById(staffId);
TwoTuple<Long, List<FlowDepartment>> flowInfo = resultRecordService.getFlowInfo(staffId, type);
Long flowId = flowInfo.getFirst();
List<FlowDepartment> list = flowInfo.getSecond();
List<FlowRelation> flowRelations = flowRelationService.selectFlowRelationAll();
Map<String, FlowDepartment> staffEntityMap = list.stream().collect(Collectors.toMap(FlowDepartment::getDepartmentLevel, p -> p));
//approvalList = [ME,ONE_D,TWO_D,HR,BOSS]
List<String> approvalList = new ArrayList<>();
Map<String,String> roleNameMap = new HashMap<>();
approvalList.add("ME");
roleNameMap.put("ME",mySelf.getName());
for (FlowRelation flowRelation : flowRelations) {
FlowDepartment flowDepartment = staffEntityMap.get(flowRelation.getChild());
if (flowDepartment != null || flowRelation.getCanReplace() == 0) {
approvalList.add(flowRelation.getChild());
String departmentLevel = flowRelation.getChild();
if(flowDepartment != null ){
StaffEntity flowStaff = staffService.selectStaffById(flowDepartment.getStaffId());
roleNameMap.put(departmentLevel,flowStaff.getName());
}else{
List<StaffRole> staffRoles = staffRoleService.selectByRole(departmentLevel);
Long approvalStaffId = 0l;
for (StaffRole staffRole : staffRoles) {
List<StaffRoleDepartment> staffRoleDepartments = staffRoleDepartmentService.selectStaffRoleDepartmentByStaffRoleId(staffRole.getId());
Map<String, String> departmentIdMap = departmentsService.selectUserAllDepartmentIds(departmentId);
for (StaffRoleDepartment staffRoleDepartment : staffRoleDepartments) {
String value = departmentIdMap.get(staffRoleDepartment.getDepartmentId());
if (StringUtil.isNotBlank(value)) {
approvalStaffId =staffRole.getStaffId();
break;
}
}
}
StaffEntity flowStaff = staffService.selectStaffById(approvalStaffId);
roleNameMap.put(departmentLevel,flowStaff.getName());
}
}
}
log.info("approvalList approval : " + Arrays.toString(approvalList.toArray()) + " roleNameMap : " + JSON.toJSONString(roleNameMap));
List<Flow> flows = flowService.selectByFlowId(flowId);
List<FlowRecord> flowRecordList = flowRecordService.selectFlowRecordByResultRecordIdFlowId(resultRecord.getId());
SimpleDateFormat myFmt2 = new SimpleDateFormat("MM-dd HH:mm");
FlowRecord lastFlowRecord = null;
@ -270,8 +231,41 @@ public class ResultDetailServiceImpl extends ServiceImpl<ResultDetailMapper, Res
stepList.add(new Step(name, time, 1, ""));
}
}
//approvalList = [ME,ONE_D,TWO_D,HR,BOSS]
List<String> approvalList = new ArrayList<>();
Map<String,String> roleNameMap = new HashMap<>();
approvalList.add("ME");
roleNameMap.put("ME",mySelf.getName());
TwoTuple<Long, List<FlowDepartment>> flowInfo = resultRecordService.getFlowInfo(staffId, type);
List<FlowDepartment> list = flowInfo.getSecond();
List<FlowRelation> flowRelations = flowRelationService.selectFlowRelationAll();
Map<String, FlowDepartment> staffEntityMap = list.stream().collect(Collectors.toMap(FlowDepartment::getDepartmentLevel, p -> p));
Long flowId = flowInfo.getFirst();
List<Flow> flows = flowService.selectByFlowId(flowId);
int flowIndex = lastFlowRecord != null ? lastFlowRecord.getFlowIndex() + 1 : 1;
log.info("flowIndex = " + flowIndex);
for (FlowRelation flowRelation : flowRelations) {
FlowDepartment flowDepartment = staffEntityMap.get(flowRelation.getChild());
if (flowDepartment != null || flowRelation.getCanReplace() == 0) {
approvalList.add(flowRelation.getChild());
String departmentLevel = flowRelation.getChild();
if(flowDepartment != null ){
StaffEntity flowStaff = staffService.selectStaffById(flowDepartment.getStaffId());
roleNameMap.put(departmentLevel,flowStaff.getName());
}else{
Long roleId = flows.get(flowIndex - 1).getRoleId();
List<StaffRoleDto> staffRoleDtos = new ArrayList<>();
StaffEntity approvalStaff = resultRecordService.getApprovalStaff(resultRecord, departmentLevel, staffRoleDtos, roleId);
roleNameMap.put(departmentLevel,approvalStaff.getName());
}
}
}
log.info("approvalList approval : " + Arrays.toString(approvalList.toArray()) + " roleNameMap : " + JSON.toJSONString(roleNameMap));
for (int i = flowIndex; i < flowIndex + 10; i++) {
int index = resultRecordService.getDepartmentLevelIndex(flows, i);
if (index < 0 || index >= approvalList.size()) {
@ -280,6 +274,7 @@ public class ResultDetailServiceImpl extends ServiceImpl<ResultDetailMapper, Res
String departmentLevel = approvalList.get(index);
stepList.add(new Step(roleNameMap.get(departmentLevel), "", 0, ""));
}
return stepList;
}

View File

@ -186,9 +186,6 @@ public class ResultRecordServiceImpl extends ServiceImpl<ResultRecordMapper, Res
params.setStatusList(listx);
}
}
if("1,2,5".equals(params.getStatusStr()) || "3".equals(params.getStatusStr())){
params.setApprovalStaffId(user.getUserId());
}
params.setDepartmentIds(departmentIds);
String departmentLevel = Constant.ME;
@ -204,6 +201,13 @@ public class ResultRecordServiceImpl extends ServiceImpl<ResultRecordMapper, Res
}
}
params.setDepartmentLevel(departmentLevel);
if ("1,2,3,4,5,6,7".equals(params.getStatusStr()) && "HR".equals(departmentLevel)) { //如果是查看全部并且用户角色是HR 的话可以推动一切
params.setDepartmentLevel(null);
}
if ("1,2,5".equals(params.getStatusStr()) || "3".equals(params.getStatusStr())) {
params.setApprovalStaffId(user.getUserId());
}
PageUtils pageUtils = PageUtils.startPage(params.getPage(), params.getLimit()).doSelect(
page -> resultRecordMapper.selectByConditionByLeader(page, params)
);
@ -271,8 +275,8 @@ public class ResultRecordServiceImpl extends ServiceImpl<ResultRecordMapper, Res
}
@Override
public void updateFlowStaffIdRoleToNull(Long id) {
resultRecordMapper.updateFlowStaffIdRoleToNull(id);
public void updateFlowStaffIdRoleToNull(Long id,Integer status) {
resultRecordMapper.updateFlowStaffIdRoleToNull(id,status);
}
@Override
@ -281,17 +285,7 @@ public class ResultRecordServiceImpl extends ServiceImpl<ResultRecordMapper, Res
List<FlowDepartment> list = new ArrayList<>();
Long flowId = flowDepartment != null ? TypeFlowDto.getFlowId(flowDepartment.getFlowIds(), Constant.SELF, type) : 0l; // 表示是部门主管自己
if (flowDepartment == null) {
DepartmentsStaffRelateEntity departmentsStaffRelateEntity = departmentsStaffRelateService.selectLastDepartmentByStaffId(staffId);
DepartmentsStaffRelateEntity leader = departmentsStaffRelateService.selectLeaderByDepartmentId(departmentsStaffRelateEntity.getDepartmentId());
if(leader == null){
Map<String, String> map = departmentsService.selectUserAllDepartmentInFo(departmentsStaffRelateEntity.getDepartmentId());
if (StringUtil.isNotBlank(map.get("dd2"))) {
leader = departmentsStaffRelateService.selectLeaderByDepartmentId(map.get("dd2"));
if(leader ==null && StringUtil.isNotBlank(map.get("dd3"))){
leader = departmentsStaffRelateService.selectLeaderByDepartmentId(map.get("dd3"));
}
}
}
DepartmentsStaffRelateEntity leader = getLeaderDepartmentsStaffRelateEntity(staffId);
flowDepartment = flowDepartmentService.selectByStaffId(leader.getStaffId());
flowId = TypeFlowDto.getFlowId(flowDepartment.getFlowIds(), Constant.CHILD, type);//表示是部门下的普通员工
list.add(flowDepartment);
@ -307,6 +301,24 @@ public class ResultRecordServiceImpl extends ServiceImpl<ResultRecordMapper, Res
return new TwoTuple(flowId, list);
}
@Override
public DepartmentsStaffRelateEntity getLeaderDepartmentsStaffRelateEntity(Long staffId){
DepartmentsStaffRelateEntity departmentsStaffRelateEntity = departmentsStaffRelateService.selectLastDepartmentByStaffId(staffId);
DepartmentsStaffRelateEntity leader = departmentsStaffRelateService.selectLeaderByDepartmentId(departmentsStaffRelateEntity.getDepartmentId());
if(leader == null){
Map<String, String> map = departmentsService.selectUserAllDepartmentInFo(departmentsStaffRelateEntity.getDepartmentId());
if (StringUtil.isNotBlank(map.get("dd2"))) {
leader = departmentsStaffRelateService.selectLeaderByDepartmentId(map.get("dd2"));
if(leader ==null && StringUtil.isNotBlank(map.get("dd3"))){
leader = departmentsStaffRelateService.selectLeaderByDepartmentId(map.get("dd3"));
return leader;
}
}
}
return leader;
}
@Override
public ResultRecord createResultRecord(Long staffId, int type, Long roleId) {
@ -366,8 +378,7 @@ public class ResultRecordServiceImpl extends ServiceImpl<ResultRecordMapper, Res
resultRecordNew = resultRecordService.createResultRecord(staffId, recordType, roleId);
}
//保存文件价值观
resultDetailService.insertWenHuaJiaZhiGua("做人:相信、包容、担当", resultRecordNew.getId(), staffId);
resultDetailService.insertWenHuaJiaZhiGua("做事:用户第一、求真、极致", resultRecordNew.getId(), staffId);
resultDetailService.insertWenHuaJiaZhiGua(Constant.WENHUAJIAZHIGUAN, resultRecordNew.getId(), staffId,new BigDecimal(0.3));
return resultRecordNew;
}
@ -382,6 +393,7 @@ public class ResultRecordServiceImpl extends ServiceImpl<ResultRecordMapper, Res
if (sum < 0.7) {
return R.error("recordId为[" + recordId + "]绩效权重之和必需等于0.7。");
}
Map<Long, Long> staffRoleMap = recordAuthService.selectRoleIdByStaffRoleInfo(resultRecord.getFlowStaffIdRole());
List<RecordAuth> listAuth = recordAuthService.selectAuthInfo(staffRoleMap.get(userId));
Auth auth = recordAuthService.getAuth(listAuth);
@ -397,13 +409,12 @@ public class ResultRecordServiceImpl extends ServiceImpl<ResultRecordMapper, Res
}
@Override
public R approval(Long resultRecordId, Long userId,Integer status) {
public R approval(Long resultRecordId, Long userId,Integer status,boolean flagEnd) {
ResultRecord resultRecord = resultRecordService.selectResultRecordById(resultRecordId);
R r = resultRecordService.checkApproval(resultRecord,userId);
if (!r.isSuccess()) {
return r;
}
StaffEntity mySelf = staffService.selectStaffById(userId);
TwoTuple<Long, List<FlowDepartment>> flowInfo = getFlowInfo(resultRecord.getStaffId(), resultRecord.getType());
Long flowId = flowInfo.getFirst();
@ -428,17 +439,23 @@ public class ResultRecordServiceImpl extends ServiceImpl<ResultRecordMapper, Res
StaffEntity staff = staffService.selectStaffById(resultRecord.getStaffId());
int flowIndex = lastFlowRecord != null ? lastFlowRecord.getFlowIndex() + 1 : 1;
int index = getDepartmentLevelIndex(flows, flowIndex);
if (index < 0 || index >= approvalList.size()) { //表示流程己经结束
if (index < 0 || index >= approvalList.size() || flagEnd) { //表示流程己经结束
lastFlowRecord.setFlowName(mySelf.getName() + "-审批通过");
lastFlowRecord.setStatusName(FlowRecordEnum.END.getName());
flowRecordService.updateCoverFlowRecordById(lastFlowRecord);
resultRecordService.updateFlowStaffIdRoleToNull(resultRecord.getId());// 更新用户权限
return R.ok("流程审批结束")
.put("from", staff)
.put("to", staff)
.put("type", WorkMsgTypeEnum.PASS);
resultRecordService.updateFlowStaffIdRoleToNull(resultRecord.getId(), status != null ? status : 4);// 更新状态
if (flagEnd) {
return R.ok("流程终止")
.put("from", staff)
.put("to", staff)
.put("type", WorkMsgTypeEnum.END);
} else {
return R.ok("流程审批结束")
.put("from", staff)
.put("to", staff)
.put("type", WorkMsgTypeEnum.PASS);
}
}
FlowRecord flowRecord = new FlowRecord();
flowRecord.setRecordId(resultRecordId);
flowRecord.setRecordStaffId(resultRecord.getStaffId());
@ -455,7 +472,7 @@ public class ResultRecordServiceImpl extends ServiceImpl<ResultRecordMapper, Res
} else {
FlowDepartment flowD = staffEntityMap.get(departmentLevel);
if (flowD == null) {
approvalStaff = getApprovalStaff(resultRecord, departmentLevel, approvalStaff, staffRoleDtos, roleId);
approvalStaff = getApprovalStaff(resultRecord, departmentLevel, staffRoleDtos, roleId);
} else {
approvalStaff = staffService.selectStaffById(flowD.getStaffId());
StaffRoleDto staffRoleDto = new StaffRoleDto(approvalStaff.getId(), roleId);
@ -505,7 +522,9 @@ public class ResultRecordServiceImpl extends ServiceImpl<ResultRecordMapper, Res
}
private StaffEntity getApprovalStaff(ResultRecord resultRecord, String departmentLevel, StaffEntity approvalStaff, List<StaffRoleDto> staffRoleDtos, Long roleId) {
@Override
public StaffEntity getApprovalStaff(ResultRecord resultRecord, String departmentLevel,List<StaffRoleDto> staffRoleDtos, Long roleId) {
StaffEntity approvalStaff = null;
List<StaffRole> staffRoles = staffRoleService.selectByRole(departmentLevel);
for (StaffRole staffRole : staffRoles) {
List<StaffRoleDepartment> staffRoleDepartments = staffRoleDepartmentService.selectStaffRoleDepartmentByStaffRoleId(staffRole.getId());
@ -568,17 +587,17 @@ public class ResultRecordServiceImpl extends ServiceImpl<ResultRecordMapper, Res
int status = 1;
FlowRecord lastUsedFlowRecord = flowRecordService.selectLastFlowRecordByRecordId(req.getRecordResultId());
if (req.getStatus() == 2) {
r = resultRecordService.approval(req.getRecordResultId(), userId,null);
r = resultRecordService.approval(req.getRecordResultId(), userId,null,false);
} else if (req.getStatus() == 3) { //侍提交
resultRecord.setStatus(Constant.STATUS_3);
resultRecordService.updateResultRecordById(resultRecord);
} else if (req.getStatus() == 5) { // 驳回
status = 5;
r = reject(resultRecord,req,userId);
}else if (req.getStatus() == 7){
List<FlowRecord> flowRecords = flowRecordService.selectFlowRecordByResultRecordIdType(req.getRecordResultId(),resultRecord.getType());
if(flowRecords!=null && flowRecords.size() == 2){ // 表示可以撤回
r = reject(resultRecord, req, userId);
r = reject(resultRecord,status);
} else if (req.getStatus() == 7) {
List<FlowRecord> flowRecords = flowRecordService.selectFlowRecordByResultRecordIdType(req.getRecordResultId(), resultRecord.getType());
if (flowRecords != null && flowRecords.size() == 2) { // 表示可以撤回
r = reject(resultRecord,5);
} else if (flowRecords != null && flowRecords.size() > 2) {
return R.error("你的领导己经审批,不能撤回了");
}
@ -593,7 +612,7 @@ public class ResultRecordServiceImpl extends ServiceImpl<ResultRecordMapper, Res
.put("type", WorkMsgTypeEnum.URGING);
}else if (req.getStatus() == 6){
// 向上级申述
resultRecordService.approval(req.getRecordResultId(), userId,req.getStatus());
resultRecordService.approval(req.getRecordResultId(), userId,req.getStatus(),false);
}
resultCommentService.addOrUpdateComment(req, userId, status,lastUsedFlowRecord);
if(r != null){//下面推送消息
@ -610,14 +629,14 @@ public class ResultRecordServiceImpl extends ServiceImpl<ResultRecordMapper, Res
}
@Override
public R reject( ResultRecord resultRecord,ResultRecordReq req, Long userId){
List<FlowRecord> flowRecords = flowRecordService.selectFlowRecordByResultRecordIdFlowId(req.getRecordResultId());
public R reject( ResultRecord resultRecord,Integer status){
List<FlowRecord> flowRecords = flowRecordService.selectFlowRecordByResultRecordIdFlowId(resultRecord.getId());
StaffEntity mySelf = staffService.selectStaffById(resultRecord.getStaffId());
StaffEntity approvalStaff = mySelf;
if (flowRecords.size() >= 2) {
FlowRecord secondFlowRecord = flowRecords.get(flowRecords.size() - 2);
resultRecord.setFlowStaffIdRole(secondFlowRecord.getFlowStaffIdRole());
resultRecord.setStatus(req.getStatus());
resultRecord.setStatus(status); //更新驳回状态为5
List<StaffRoleDto> list = JSONObject.parseArray(resultRecord.getFlowStaffIdRole(), StaffRoleDto.class);
if (CollectionUtils.isNotEmpty(list)) {
StaffRoleDto staffRoleDto = list.get(0);
@ -626,17 +645,18 @@ public class ResultRecordServiceImpl extends ServiceImpl<ResultRecordMapper, Res
resultRecord.setCurrentApprovalStaffName(approvalStaff != null ? approvalStaff.getName() : null);
}
resultRecordService.updateResultRecordById(resultRecord);
FlowRecord lastFlowRecord = flowRecords.get(flowRecords.size() - 1);
lastFlowRecord.setStatus(1);
flowRecordService.updateFlowRecordById(lastFlowRecord);
FlowRecord lastFlowRecordNoStatus = flowRecordService.selectLastFlowNoStatusRecordByRecordId(req.getRecordResultId());
FlowRecord lastFlowRecordNoStatus = flowRecordService.selectLastFlowNoStatusRecordByRecordId(resultRecord.getId());
lastFlowRecordNoStatus.setStatusName(FlowRecordEnum.REJECT.getName());
lastFlowRecordNoStatus.setGmtCreate(new Date()); //更新驳回时间
flowRecordService.updateFlowRecordById(lastFlowRecordNoStatus);
// 可能会被删除
FlowRecord lastUsedFlowRecord = flowRecordService.selectLastFlowRecordByRecordId(req.getRecordResultId());
FlowRecord lastUsedFlowRecord = flowRecordService.selectLastFlowRecordByRecordId(resultRecord.getId());
lastUsedFlowRecord.setId(null);
lastUsedFlowRecord.setStatus(1);
lastUsedFlowRecord.setStatusName(FlowRecordEnum.CONFIRM.getName());

View File

@ -190,7 +190,11 @@
select * from (
select rd.*,department_level,approval_staff_id,approval_staff_name,flow_name,flow_id,flow_index
from lz_flow_record fr left join lz_result_record rd on fr.record_id= rd.id
where department_level = #{req.departmentLevel} and fr.status = 0 and rd.is_delete = 0 and fr.is_delete = 0
where fr.status = 0 and rd.is_delete = 0 and fr.is_delete = 0
<if test="req.departmentLevel != null and req.departmentLevel != '' ">
and department_level = #{req.departmentLevel}
</if>
<if test="req.monthBeginDate != null and req.monthBeginDate != '' ">
AND DATE_FORMAT(rd.month_time, '%Y-%m-%d %H:%i:%S') <![CDATA[ >= ]]> DATE_FORMAT(#{req.monthBeginDate},
'%Y-%m-%d %H:%i:%S')
@ -199,9 +203,11 @@
AND DATE_FORMAT(rd.month_time, '%Y-%m-%d %H:%i:%S') <![CDATA[ <= ]]> DATE_FORMAT(#{req.monthEndDate},
'%Y-%m-%d %H:%i:%S')
</if>
<if test="req.status != null">
and rd.status = #{req.status}
</if>
<if test="req.remark != null and req.remark !='' ">
AND rd.remark LIKE CONCAT('%',#{req.remark},'%')
</if>
@ -225,7 +231,7 @@
and rd.staff_id = #{req.staffId}
</if>
<if test="req.approvalStaffId !=null and req.approvalStaffId !=''" >
<if test="req.approvalStaffId !=null and req.approvalStaffId !='' " >
and rd.current_approval_staff_id = #{req.approvalStaffId}
</if>
order by fr.id desc )
@ -243,7 +249,7 @@
</select>
<update id="updateFlowStaffIdRoleToNull">
update lz_result_record set flow_staff_id_role = '[]',status = 4,current_approval_staff_id = null ,current_approval_staff_name = null where id = #{id}
update lz_result_record set flow_staff_id_role = '[]',status = #{status},current_approval_staff_id = null ,current_approval_staff_name = null where id = #{id}
</update>
<select id="selectResultRecordByIds" resultType="com.lz.modules.sys.entity.app.ResultRecord">

View File

@ -243,5 +243,11 @@
</if>
</select>
<select id="selectEquipmentInfoByCount" resultType="EquipmentInfo">
select * from equipment_info where is_delete = 0 and count=#{count} limit 1
</select>
</mapper>

View File

@ -66,14 +66,18 @@
<update id="deleteTCountById" parameterType="java.lang.Long">
update equipment_t_count set is_delete = 1 where id=#{id} limit 1
update equipment_t_count set is_delete = 1 where id=#{id} and is_delete = 0 limit 1
</update>
<select id="selectMaxCount" resultType="com.lz.modules.equipment.entity.TCount">
select * from equipment_t_count order by id desc limit 1
select * from equipment_t_count where is_delete = 0 order by id desc limit 1
</select>
<select id="selectListLimit" resultType="com.lz.modules.equipment.entity.TCount">
select * from equipment_t_count order by id desc limit #{limit}
select * from equipment_t_count where is_delete = 0 order by id desc limit #{limit}
</select>
<select id="selectByReq" resultType="com.lz.modules.equipment.entity.TCount">
select * from equipment_t_count where is_delete = 0 order by id desc
</select>

View File

@ -0,0 +1,79 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.lz.modules.flow.dao.FlowManagerMapper">
<!-- 通用查询映射结果 -->
<resultMap id="BaseResultMap" type="com.lz.modules.flow.entity.FlowManager">
<id column="id" property="id"/>
<result column="is_delete" property="isDelete"/>
<result column="gmt_create" property="gmtCreate"/>
<result column="gmt_modified" property="gmtModified"/>
<result column="name" property="name"/>
</resultMap>
<!-- 通用查询结果列 -->
<sql id="Base_Column_List">
id AS id, is_delete AS isDelete, gmt_create AS gmtCreate, gmt_modified AS gmtModified, name AS name
</sql>
<select id="selectFlowManagerById" resultType="FlowManager" >
select * from lz_flow_manager where id=#{id} and is_delete = 0 limit 1
</select>
<insert id="insertFlowManager" parameterType="FlowManager" useGeneratedKeys="true" keyProperty="id" >
insert into lz_flow_manager(
<if test="name != null">name, </if>
is_delete,
gmt_create,
gmt_modified
)values(
<if test="name != null">#{ name}, </if>
0,
now(),
now()
)
</insert>
<update id="updateFlowManagerById" parameterType="FlowManager" >
update
lz_flow_manager
<trim prefix="set" suffixOverrides=",">
<if test="isDelete != null">is_delete = #{isDelete},</if>
<if test="gmtCreate != null">gmt_create = #{gmtCreate},</if>
<if test="name != null">name = #{name}</if>
</trim>
,gmt_modified = now()
where id = #{id}
</update>
<update id="updateCoverFlowManagerById" parameterType="FlowManager" >
update
lz_flow_manager
set
is_delete = #{isDelete},
gmt_create = #{gmtCreate},
name = #{name}
,gmt_modified = now()
where id = #{id}
</update>
<update id="deleteFlowManagerById" parameterType="java.lang.Long">
update lz_flow_manager set is_delete = 1 where id=#{id} limit 1
</update>
<select id="selectByCondition" resultType="com.lz.modules.flow.entity.FlowManager">
select * from lz_flow_manager where is_delete = 0
</select>
</mapper>

View File

@ -58,7 +58,7 @@
group by staff_id
</select>
<select id="selectAll" resultType="com.lz.modules.app.entity.DepartmentsStaffRelateEntity">
select * from lz_departments_staff_relate
select * from lz_departments_staff_relate where is_delete = 0
</select>
<select id="selectLastDepartmentByStaffId"

View File

@ -18,7 +18,7 @@
</select>
<select id="queryByUserName" resultType="com.lz.modules.sys.entity.SysUserEntity">
select * from sys_user where username = #{username}
select * from sys_user where username = #{username} or mobile = #{username} limit 1
</select>
<select id="getUserInfos" resultType="com.lz.modules.app.dto.UserDto">

View File

@ -43,3 +43,21 @@ INSERT INTO `sys_menu` (`parent_id`, `name`, `url`, `perms`, `type`, `icon`, `or
-- 菜单SQL
INSERT INTO `sys_menu` (`parent_id`, `name`, `url`, `perms`, `type`, `icon`, `order_num`)
VALUES ('55', '流程管理表', 'user/lzflowmanager', NULL, '1', 'config', '6');
-- 按钮父菜单ID
set @parentId = @@identity;
-- 菜单对应按钮SQL
INSERT INTO `sys_menu` (`parent_id`, `name`, `url`, `perms`, `type`, `icon`, `order_num`)
SELECT @parentId, '查看', null, 'user:lzflowmanager:list,user:lzflowmanager:info', '2', null, '6';
INSERT INTO `sys_menu` (`parent_id`, `name`, `url`, `perms`, `type`, `icon`, `order_num`)
SELECT @parentId, '新增', null, 'user:lzflowmanager:save', '2', null, '6';
INSERT INTO `sys_menu` (`parent_id`, `name`, `url`, `perms`, `type`, `icon`, `order_num`)
SELECT @parentId, '修改', null, 'user:lzflowmanager:update', '2', null, '6';
INSERT INTO `sys_menu` (`parent_id`, `name`, `url`, `perms`, `type`, `icon`, `order_num`)
SELECT @parentId, '删除', null, 'user:lzflowmanager:delete', '2', null, '6';

View File

@ -51,7 +51,7 @@ public class Create {
}
public static void main(String[] args) {
Create ot=new Create();
String [] tableNames = {"lz_record_role"};
String [] tableNames = {"lz_flow_manager"};
try {
ot.generatorCode(tableNames);
} catch (Exception e) {

View File

@ -63,7 +63,7 @@ public class MysqlMain {
}
List<TablesBean> list = new ArrayList<TablesBean>();
list.add(new TablesBean("lz_flow_record"));
list.add(new TablesBean("lz_flow_manager"));
List<TablesBean> list2 = new ArrayList<TablesBean>();
Map<String, String> map = MysqlUtil2ShowCreateTable.getComments();