1021934019@qq.com 4 lat temu
rodzic
commit
afd25da462

+ 12 - 0
blade-ops/blade-flow/pom.xml

@@ -68,6 +68,18 @@
             <artifactId>flowable-json-converter</artifactId>
             <version>${flowable.version}</version>
         </dependency>
+        <dependency>
+            <groupId>org.springblade</groupId>
+            <artifactId>blade-project-api</artifactId>
+            <version>2.8.2.RELEASE</version>
+            <scope>compile</scope>
+        </dependency>
+        <dependency>
+            <groupId>org.springblade</groupId>
+            <artifactId>blade-desk</artifactId>
+            <version>2.8.2.RELEASE</version>
+            <scope>compile</scope>
+        </dependency>
     </dependencies>
 
     <build>

+ 2 - 2
blade-ops/blade-flow/src/main/java/org/springblade/flow/business/controller/WorkController.java

@@ -152,8 +152,8 @@ public class WorkController {
 	@PostMapping("checkCompleteTask")
 	@ApiOperationSupport(order = 7)
 	@ApiOperation(value = "完成任务", notes = "传入流程信息")
-	public R checkCompleteTask(@ApiParam("任务信息") @RequestBody BladeFlow flow,Long itemId) {
-		return R.status(flowBusinessService.checkCompleteTask(flow,itemId));
+	public R checkCompleteTask(@ApiParam("任务信息") @RequestBody BladeFlow flow) {
+		return R.status(flowBusinessService.checkCompleteTask(flow));
 	}
 
 }

+ 1 - 1
blade-ops/blade-flow/src/main/java/org/springblade/flow/business/service/FlowBusinessService.java

@@ -77,5 +77,5 @@ public interface FlowBusinessService {
 	 * @param leave 请假信息
 	 * @return boolean
 	 */
-	boolean checkCompleteTask(BladeFlow leave,Long itemId);
+	boolean checkCompleteTask(BladeFlow leave);
 }

+ 54 - 1
blade-ops/blade-flow/src/main/java/org/springblade/flow/business/service/impl/FlowBusinessServiceImpl.java

@@ -32,12 +32,15 @@ import org.springblade.core.tool.support.Kv;
 import org.springblade.core.tool.utils.Func;
 import org.springblade.core.tool.utils.StringPool;
 import org.springblade.core.tool.utils.StringUtil;
+import org.springblade.desk.entity.ProcessLeave;
+import org.springblade.desk.feign.IProcessLeaveClient;
 import org.springblade.flow.business.service.FlowBusinessService;
 import org.springblade.flow.core.constant.ProcessConstant;
 import org.springblade.flow.core.entity.BladeFlow;
 import org.springblade.flow.core.utils.TaskUtil;
 import org.springblade.flow.engine.constant.FlowEngineConstant;
 import org.springblade.flow.engine.utils.FlowCache;
+import org.springblade.project.feign.IProjectItemClient;
 import org.springframework.stereotype.Service;
 import org.springframework.transaction.annotation.Transactional;
 
@@ -56,6 +59,8 @@ public class FlowBusinessServiceImpl implements FlowBusinessService {
 
 	private final TaskService taskService;
 	private final HistoryService historyService;
+	private final IProjectItemClient projectItemClient;
+	private final IProcessLeaveClient processClient;
 
 	@Override
 	public IPage<BladeFlow> selectClaimPage(IPage<BladeFlow> page, BladeFlow bladeFlow) {
@@ -266,8 +271,56 @@ public class FlowBusinessServiceImpl implements FlowBusinessService {
 
 	@Override
 	@Transactional
-	public boolean checkCompleteTask(BladeFlow flow, Long itemId)
+	public boolean checkCompleteTask(BladeFlow flow)
 	{
+		ProcessLeave processLeave = processClient.findById(Long.valueOf(flow.getBusinessId()));
+		Long currentUserId = AuthUtil.getUserId();
+		//任务id
+		Long itemId = processLeave.getItemId();
+		//驳回调整人
+		String taskUser = processLeave.getTaskUser();
+		//第一审核人
+		String checkUser = processLeave.getCheckUser();
+		//第二审核人
+		String checkSecondsUser = processLeave.getCheckSecondsUser();
+
+		//是否为调整人?
+		if(String.valueOf(currentUserId).equals(taskUser))
+		{
+			//重新申请
+			if(flow.getFlag()!=null&&flow.getFlag().equals("ok"))
+			{
+				projectItemClient.check(itemId,1,null,null,null,null);
+			}
+			//驳回按钮
+			else
+			{
+				projectItemClient.check(itemId,0,null,null,null,null);
+			}
+		}
+
+		//是否为第一审核人?
+		if(String.valueOf(currentUserId).equals(checkUser))
+		{
+			//通过按钮
+			if(flow.getFlag()!=null&&flow.getFlag().equals("ok"))
+			{
+				projectItemClient.check(itemId,2,null,null,null,null);
+			}
+
+		}
+
+		//是否为第二审核人?
+		if(String.valueOf(currentUserId).equals(checkSecondsUser))
+		{
+			//通过按钮
+			if(flow.getFlag()!=null&&flow.getFlag().equals("ok"))
+			{
+				projectItemClient.check(itemId,3,null,null,null,null);
+			}
+
+		}
+
 		String taskId = flow.getTaskId();
 		String processInstanceId = flow.getProcessInstanceId();
 		String comment = Func.toStr(flow.getComment(), ProcessConstant.PASS_COMMENT);

+ 8 - 0
blade-service-api/blade-desk-api/pom.xml

@@ -12,6 +12,14 @@
     <artifactId>blade-desk-api</artifactId>
     <name>${project.artifactId}</name>
     <version>2.8.2.RELEASE</version>
+    <dependencies>
+        <dependency>
+            <groupId>org.springblade</groupId>
+            <artifactId>blade-flow-api</artifactId>
+            <version>2.8.2.RELEASE</version>
+            <scope>compile</scope>
+        </dependency>
+    </dependencies>
     <packaging>jar</packaging>
 
 </project>

+ 83 - 0
blade-service-api/blade-desk-api/src/main/java/org/springblade/desk/entity/ProcessLeave.java

@@ -0,0 +1,83 @@
+/*
+ *      Copyright (c) 2018-2028, Chill Zhuang All rights reserved.
+ *
+ *  Redistribution and use in source and binary forms, with or without
+ *  modification, are permitted provided that the following conditions are met:
+ *
+ *  Redistributions of source code must retain the above copyright notice,
+ *  this list of conditions and the following disclaimer.
+ *  Redistributions in binary form must reproduce the above copyright
+ *  notice, this list of conditions and the following disclaimer in the
+ *  documentation and/or other materials provided with the distribution.
+ *  Neither the name of the dreamlu.net developer nor the names of its
+ *  contributors may be used to endorse or promote products derived from
+ *  this software without specific prior written permission.
+ *  Author: Chill 庄骞 (smallchill@163.com)
+ */
+package org.springblade.desk.entity;
+
+import com.baomidou.mybatisplus.annotation.TableName;
+import lombok.Data;
+import lombok.EqualsAndHashCode;
+import org.springblade.flow.core.entity.FlowEntity;
+
+import java.util.Date;
+
+/**
+ * 请假流程实体类
+ *
+ * @author Chill
+ */
+@Data
+@TableName("blade_process_leave")
+@EqualsAndHashCode(callSuper = true)
+public class ProcessLeave extends FlowEntity {
+
+	private static final long serialVersionUID = 1L;
+
+	/**
+	 * 流程定义id
+	 */
+	private String processDefinitionId;
+	/**
+	 * 流程实例id
+	 */
+	private String processInstanceId;
+	/**
+	 * 请假开始时间
+	 */
+	private Date startTime;
+	/**
+	 * 请假结束时间
+	 */
+	private Date endTime;
+	/**
+	 * 请假理由
+	 */
+	private String reason;
+	/**
+	 * 第一级审批人
+	 */
+	private String checkUser;
+
+	/**
+	 * 第二级审批人
+	 */
+	private String checkSecondsUser;
+
+	/**
+	 * 审批人
+	 */
+	private String taskUser;
+
+	/**
+	 * 流程申请时间
+	 */
+	private Date applyTime;
+
+	/**
+	 * 关联表id
+	 */
+	private Long itemId;
+
+}

+ 51 - 0
blade-service-api/blade-desk-api/src/main/java/org/springblade/desk/feign/IProcessLeaveClient.java

@@ -0,0 +1,51 @@
+/*
+ *      Copyright (c) 2018-2028, Chill Zhuang All rights reserved.
+ *
+ *  Redistribution and use in source and binary forms, with or without
+ *  modification, are permitted provided that the following conditions are met:
+ *
+ *  Redistributions of source code must retain the above copyright notice,
+ *  this list of conditions and the following disclaimer.
+ *  Redistributions in binary form must reproduce the above copyright
+ *  notice, this list of conditions and the following disclaimer in the
+ *  documentation and/or other materials provided with the distribution.
+ *  Neither the name of the dreamlu.net developer nor the names of its
+ *  contributors may be used to endorse or promote products derived from
+ *  this software without specific prior written permission.
+ *  Author: Chill 庄骞 (smallchill@163.com)
+ */
+package org.springblade.desk.feign;
+
+import org.springblade.core.launch.constant.AppConstant;
+import org.springblade.core.mp.support.BladePage;
+import org.springblade.desk.entity.Notice;
+import org.springblade.desk.entity.ProcessLeave;
+import org.springframework.cloud.openfeign.FeignClient;
+import org.springframework.web.bind.annotation.GetMapping;
+import org.springframework.web.bind.annotation.RequestParam;
+
+/**
+ * ProcessLive Feign接口类
+ *
+ * @author Chill
+ */
+@FeignClient(
+	value = AppConstant.APPLICATION_DESK_NAME
+)
+public interface IProcessLeaveClient {
+
+	String API_PREFIX = "/client";
+	String FIND_BY_ID = API_PREFIX + "/findById";
+
+	/**
+	 * 获取审批流对象
+	 *
+	 * @param
+	 * @param
+	 * @return
+	 */
+	@GetMapping(FIND_BY_ID)
+	public ProcessLeave findById(@RequestParam(value = "id",required = true) Long id);
+
+
+}

+ 5 - 2
blade-service-api/blade-project-api/src/main/java/org/springblade/project/feign/IProjectItemClient.java

@@ -18,11 +18,14 @@ import java.util.List;
  * 商品信息对外访问API
  */
 public interface IProjectItemClient {
+	String API_PREFIX = "/client";
+	String UPDATE_ITEM_STATUS=API_PREFIX+"updateItemStatus";
+	String FIND_ITEM_BY_ID=API_PREFIX+"findItemById";
 
 	/**
 	 * 修改主营项目明细状态
 	 * */
-	@PostMapping("client/updateItemStatus")
+	@PostMapping(UPDATE_ITEM_STATUS)
 	public R  check(@RequestParam(name = "id", required = true) Long itemId
 		,@RequestParam(name = "status", required = true) int status
 		,@RequestParam(name = "accountName", required = false) String accountName
@@ -34,7 +37,7 @@ public interface IProjectItemClient {
 	/**
 	 * 通过id查询主营项目明细
 	 * */
-	@GetMapping("client/findItemById")
+	@GetMapping(FIND_ITEM_BY_ID)
 	public ServiceProjectItem findItemById(@RequestParam(name = "id", required = true) Long itemId);
 
 

+ 1 - 0
blade-service/blade-client/src/main/java/org/springblade/client/corps/service/impl/CorpsDescServiceImpl.java

@@ -197,6 +197,7 @@ public class CorpsDescServiceImpl extends ServiceImpl<CorpsDescMapper, CorpsDesc
 				//名称相等视为重复数据
 				LambdaQueryWrapper<CorpsDesc> queryWrapper = new LambdaQueryWrapper<>();
 				queryWrapper.eq(CorpsDesc::getCname,corpsDesc.getCname());
+				queryWrapper.eq(CorpsDesc::getIsDeleted,0);
 				CorpsDesc selectOne = baseMapper.selectOne(queryWrapper);
 				if(selectOne==null)
 				{

+ 1 - 0
blade-service/blade-client/src/main/java/org/springblade/client/goods/service/impl/GoodsDescServiceImpl.java

@@ -354,6 +354,7 @@ public class GoodsDescServiceImpl extends ServiceImpl<GoodsDescMapper, GoodsDesc
 				//如果名称相等 就认为重复
 				LambdaQueryWrapper<GoodsDesc> queryWrapper = new LambdaQueryWrapper<>();
 				queryWrapper.eq(GoodsDesc::getCname,goodsDesc.getCname());
+				queryWrapper.eq(GoodsDesc::getIsDeleted,0);
 				GoodsDesc one = goodsDescMapper.selectOne(queryWrapper);
 				if(one==null)
 				{

+ 54 - 0
blade-service/blade-desk/src/main/java/org/springblade/desk/feign/ProcessClient.java

@@ -0,0 +1,54 @@
+/*
+ *      Copyright (c) 2018-2028, Chill Zhuang All rights reserved.
+ *
+ *  Redistribution and use in source and binary forms, with or without
+ *  modification, are permitted provided that the following conditions are met:
+ *
+ *  Redistributions of source code must retain the above copyright notice,
+ *  this list of conditions and the following disclaimer.
+ *  Redistributions in binary form must reproduce the above copyright
+ *  notice, this list of conditions and the following disclaimer in the
+ *  documentation and/or other materials provided with the distribution.
+ *  Neither the name of the dreamlu.net developer nor the names of its
+ *  contributors may be used to endorse or promote products derived from
+ *  this software without specific prior written permission.
+ *  Author: Chill 庄骞 (smallchill@163.com)
+ */
+package org.springblade.desk.feign;
+
+import com.baomidou.mybatisplus.core.metadata.IPage;
+import lombok.AllArgsConstructor;
+import org.springblade.core.mp.support.BladePage;
+import org.springblade.core.mp.support.Condition;
+import org.springblade.core.mp.support.Query;
+import org.springblade.core.tenant.annotation.NonDS;
+import org.springblade.desk.entity.Notice;
+import org.springblade.desk.entity.ProcessLeave;
+import org.springblade.desk.service.ILeaveService;
+import org.springblade.desk.service.INoticeService;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.web.bind.annotation.GetMapping;
+import org.springframework.web.bind.annotation.RestController;
+import springfox.documentation.annotations.ApiIgnore;
+
+/**
+ * Notice Feign
+ *
+ * @author Chill
+ */
+@NonDS
+@ApiIgnore()
+@RestController
+@AllArgsConstructor
+public class ProcessClient implements IProcessLeaveClient {
+
+	@Autowired
+	private ILeaveService leaveService;
+
+	@Override
+	@GetMapping(FIND_BY_ID)
+	public ProcessLeave findById(Long id)
+	{
+		return leaveService.getById(id);
+	}
+}

+ 1 - 1
blade-service/blade-desk/src/main/java/org/springblade/desk/service/impl/LeaveServiceImpl.java

@@ -97,7 +97,7 @@ public class LeaveServiceImpl extends BaseServiceImpl<LeaveMapper, ProcessLeave>
 		{
 			throw new ServiceException("请求调用请核失败");
 		}
-
+		check.setTaskUser(String.valueOf(AuthUtil.getUserId()));
 		String businessTable = FlowUtil.getBusinessTable(ProcessConstant.LEAVE_KEY);
 		if (Func.isEmpty(check.getId())) {
 			// 保存leave

+ 4 - 5
blade-service/blade-project/src/main/java/org/springblade/project/feign/ProjectItemClient.java

@@ -24,10 +24,9 @@ import springfox.documentation.annotations.ApiIgnore;
 import java.util.Date;
 import java.util.List;
 
-@Slf4j
+
 @NonDS
-@ApiIgnore()
-@RestController()
+@RestController
 @AllArgsConstructor
 public class ProjectItemClient implements IProjectItemClient
 {
@@ -37,7 +36,7 @@ public class ProjectItemClient implements IProjectItemClient
 	private ServiceProjectItemService serviceProjectItemService;
 
 	@Override
-	@PostMapping("client/updateItemStatus")
+	@PostMapping(UPDATE_ITEM_STATUS)
 	public R check(Long itemId, int status, String accountName, String accountBank, Date payTime, String accountNo)
 	{
 		serviceProjectService.updateItemStatus(itemId,status,accountName,accountBank,accountNo,payTime);
@@ -45,7 +44,7 @@ public class ProjectItemClient implements IProjectItemClient
 	}
 
 	@Override
-	@GetMapping("client/findItemById")
+	@GetMapping(FIND_ITEM_BY_ID)
 	public ServiceProjectItem findItemById(Long itemId)
 	{
 		return	serviceProjectItemService.getById(itemId);