浏览代码

流程模块

caozj 2 年之前
父节点
当前提交
7de9d53472
共有 17 个文件被更改,包括 410 次插入40 次删除
  1. 9 1
      bladex-tool/blade-starter-auth/src/main/java/org/springblade/core/secure/utils/AuthUtil.java
  2. 2 1
      hx-saas-project/saas-entity/src/main/java/com/fjhx/flow/entity/FlowApplycheck.java
  3. 36 0
      hx-saas-project/saas-entity/src/main/java/com/fjhx/flow/entity/FlowParam.java
  4. 4 0
      hx-saas-project/saas-flow/src/main/java/com/fjhx/flow/controller/FlowApplycheckController.java
  5. 35 13
      hx-saas-project/saas-flow/src/main/java/com/fjhx/flow/controller/FlowController.java
  6. 4 9
      hx-saas-project/saas-flow/src/main/java/com/fjhx/flow/controller/FlowNodeController.java
  7. 4 0
      hx-saas-project/saas-flow/src/main/java/com/fjhx/flow/controller/FlowNodelineController.java
  8. 48 0
      hx-saas-project/saas-flow/src/main/java/com/fjhx/flow/service/IFlowEngineService.java
  9. 209 0
      hx-saas-project/saas-flow/src/main/java/com/fjhx/flow/service/impl/FlowEngineServiceImpl.java
  10. 0 5
      hx-saas-project/saas-storage/pom.xml
  11. 2 7
      hx-saas-project/saas-storage/src/main/java/com/fjhx/attachment/service/impl/StockAttachmentServiceImpl.java
  12. 11 1
      hx-service/storage/src/main/java/com/fjhx/supplier/controller/SupplierController.java
  13. 11 0
      hx-service/storage/src/main/java/com/fjhx/supplier/mapper/SupplierMapper.java
  14. 10 1
      hx-service/storage/src/main/java/com/fjhx/supplier/mapper/SupplierMapper.xml
  15. 8 0
      hx-service/storage/src/main/java/com/fjhx/supplier/service/SupplierService.java
  16. 7 2
      hx-service/storage/src/main/java/com/fjhx/supplier/service/impl/SupplierProblemServiceImpl.java
  17. 10 0
      hx-service/storage/src/main/java/com/fjhx/supplier/service/impl/SupplierServiceImpl.java

+ 9 - 1
bladex-tool/blade-starter-auth/src/main/java/org/springblade/core/secure/utils/AuthUtil.java

@@ -154,7 +154,15 @@ public class AuthUtil {
 		BladeUser user = getUser();
 		return (null == user) ? -1 : user.getUserId();
 	}
-
+	/**
+	 * 获取用户id
+	 *
+	 * @return
+	 */
+	public static String getUserIdStr() {
+		BladeUser user = getUser();
+		return (null == user || user.getUserId() == null) ? null : user.getUserId().toString();
+	}
 	/**
 	 * 获取用户id
 	 *

+ 2 - 1
hx-saas-project/saas-entity/src/main/java/com/fjhx/flow/entity/FlowApplycheck.java

@@ -21,6 +21,7 @@ import com.baomidou.mybatisplus.annotation.TableId;
 import java.time.LocalDateTime;
 import com.baomidou.mybatisplus.annotation.TableField;
 import java.io.Serializable;
+import java.util.Date;
 
 import com.fjhx.base.BasicEntity;
 import lombok.Data;
@@ -80,7 +81,7 @@ public class FlowApplycheck extends BasicEntity {
 	* 审核时间
 	*/
 	@ApiModelProperty(value = "审核时间")
-	private LocalDateTime checkTime;
+	private Date checkTime;
 	/**
 	* 意见
 	*/

+ 36 - 0
hx-saas-project/saas-entity/src/main/java/com/fjhx/flow/entity/FlowParam.java

@@ -0,0 +1,36 @@
+package com.fjhx.flow.entity;
+
+import lombok.Data;
+
+/**
+ * @Author:caozj
+ * @DATE:2022/7/20 11:39
+ */
+@Data
+public class FlowParam {
+
+    /**
+     * 消息标题
+     */
+    private String title;
+
+    /**
+     * 业务ID
+     */
+    private String businessId;
+
+    /**
+     * 流程标识
+     */
+    private String flowIdentifying;
+
+    /**
+     * 审批意见
+     */
+    private String common;
+
+    /**
+     * 流程ID
+     */
+    private String proInstantsId;
+}

+ 4 - 0
hx-saas-project/saas-flow/src/main/java/com/fjhx/flow/controller/FlowApplycheckController.java

@@ -29,6 +29,8 @@ import org.springblade.core.tool.utils.Func;
 import org.springframework.web.bind.annotation.*;
 import org.springblade.core.boot.ctrl.BladeController;
 
+import java.util.Date;
+
 /**
  * 流程审批 控制器
  *
@@ -57,6 +59,7 @@ public class FlowApplycheckController extends BladeController {
 	 */
 	@PostMapping("/save")
 	public R save(@Valid @RequestBody FlowApplycheck flowApplycheck) {
+		flowApplycheck.setCreatedTime(new Date());
 		return R.status(flowApplycheckService.save(flowApplycheck));
 	}
 
@@ -65,6 +68,7 @@ public class FlowApplycheckController extends BladeController {
 	 */
 	@PostMapping("/update")
 	public R update(@Valid @RequestBody FlowApplycheck flowApplycheck) {
+		flowApplycheck.setUpdatedTime(new Date());
 		return R.status(flowApplycheckService.updateById(flowApplycheck));
 	}
 

+ 35 - 13
hx-saas-project/saas-flow/src/main/java/com/fjhx/flow/controller/FlowController.java

@@ -17,6 +17,8 @@
 package com.fjhx.flow.controller;
 
 import com.fjhx.flow.entity.Flow;
+import com.fjhx.flow.entity.FlowParam;
+import com.fjhx.flow.service.IFlowEngineService;
 import com.fjhx.flow.service.IFlowService;
 import io.swagger.annotations.ApiParam;
 import lombok.AllArgsConstructor;
@@ -29,8 +31,10 @@ import org.springblade.core.tool.utils.Func;
 import org.springframework.web.bind.annotation.*;
 import org.springblade.core.boot.ctrl.BladeController;
 
+import java.util.Date;
+
 /**
- * 业务附件表 控制器
+ * 模型表 控制器
  *
  * @author BladeX
  * @since 2022-07-20
@@ -42,6 +46,7 @@ public class FlowController extends BladeController {
 
 	private final IFlowService flowService;
 
+	private final IFlowEngineService iFlowEngineService;
 	/**
 	 * 详情
 	 */
@@ -53,37 +58,54 @@ public class FlowController extends BladeController {
 
 
 	/**
-	 * 新增 业务附件
+	 * 新增 模型
 	 */
 	@PostMapping("/save")
 	public R save(@Valid @RequestBody Flow flow) {
+		flow.setCreatedTime(new Date());
 		return R.status(flowService.save(flow));
 	}
 
 	/**
-	 * 修改 业务附件
+	 * 修改 模型
 	 */
 	@PostMapping("/update")
 	public R update(@Valid @RequestBody Flow flow) {
+		flow.setUpdatedTime(new Date());
 		return R.status(flowService.updateById(flow));
 	}
 
-	/**
-	 * 新增或修改 业务附件表
-	 */
-	@PostMapping("/submit")
-	public R submit(@Valid @RequestBody Flow flow) {
-		return R.status(flowService.saveOrUpdate(flow));
-	}
-
 	
 	/**
-	 * 删除 业务附件
+	 * 删除 模型表
 	 */
 	@PostMapping("/remove")
 	public R remove(@ApiParam(value = "主键集合", required = true) @RequestParam String ids) {
 		return R.status(flowService.removeByIds(Func.toLongList(ids)));
 	}
 
-	
+	/**
+	 * 删除 模型表
+	 */
+	@PostMapping("/start")
+	public R start(@RequestBody FlowParam param) {
+		return R.status(iFlowEngineService.startFlow(param));
+	}
+
+	/**
+	 * 删除 模型表
+	 */
+	@PostMapping("/examineFlow")
+	public R examineFlow(@RequestBody FlowParam param) {
+		return R.status(iFlowEngineService.examineFlow(param));
+	}
+
+	/**
+	 * 删除 模型表
+	 */
+	@PostMapping("/rejectFlow")
+	public R rejectFlow(@RequestBody FlowParam param) {
+		return R.status(iFlowEngineService.rejectFlow(param));
+	}
+
 }

+ 4 - 9
hx-saas-project/saas-flow/src/main/java/com/fjhx/flow/controller/FlowNodeController.java

@@ -31,6 +31,8 @@ import org.springblade.core.tool.utils.Func;
 import org.springframework.web.bind.annotation.*;
 import org.springblade.core.boot.ctrl.BladeController;
 
+import java.util.Date;
+
 /**
  * 流程节点表 控制器
  *
@@ -60,6 +62,7 @@ public class FlowNodeController extends BladeController {
 	 */
 	@PostMapping("/save")
 	public R save(@Valid @RequestBody FlowNode flowNode) {
+		flowNode.setCreatedTime(new Date());
 		return R.status(flowNodeService.save(flowNode));
 	}
 
@@ -68,19 +71,11 @@ public class FlowNodeController extends BladeController {
 	 */
 	@PostMapping("/update")
 	public R update(@Valid @RequestBody FlowNode flowNode) {
+		flowNode.setUpdatedTime(new Date());
 		return R.status(flowNodeService.updateById(flowNode));
 	}
 
 	/**
-	 * 新增或修改 流程节点表
-	 */
-	@PostMapping("/submit")
-	public R submit(@Valid @RequestBody FlowNode flowNode) {
-		return R.status(flowNodeService.saveOrUpdate(flowNode));
-	}
-
-	
-	/**
 	 * 删除 流程节点表
 	 */
 	@PostMapping("/remove")

+ 4 - 0
hx-saas-project/saas-flow/src/main/java/com/fjhx/flow/controller/FlowNodelineController.java

@@ -30,6 +30,8 @@ import org.springblade.core.tool.utils.Func;
 import org.springframework.web.bind.annotation.*;
 import org.springblade.core.boot.ctrl.BladeController;
 
+import java.util.Date;
+
 /**
  * 流程节点连线 控制器
  *
@@ -59,6 +61,7 @@ public class FlowNodelineController extends BladeController {
 	 */
 	@PostMapping("/save")
 	public R save(@Valid @RequestBody FlowNodeline flowNodeline) {
+		flowNodeline.setCreatedTime(new Date());
 		return R.status(flowNodelineService.save(flowNodeline));
 	}
 
@@ -67,6 +70,7 @@ public class FlowNodelineController extends BladeController {
 	 */
 	@PostMapping("/update")
 	public R update(@Valid @RequestBody FlowNodeline flowNodeline) {
+		flowNodeline.setUpdatedTime(new Date());
 		return R.status(flowNodelineService.updateById(flowNodeline));
 	}
 

+ 48 - 0
hx-saas-project/saas-flow/src/main/java/com/fjhx/flow/service/IFlowEngineService.java

@@ -0,0 +1,48 @@
+/*
+ *      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 com.fjhx.flow.service;
+
+import com.baomidou.mybatisplus.extension.service.IService;
+import com.fjhx.flow.entity.Flow;
+import com.fjhx.flow.entity.FlowParam;
+
+/**
+ * 流程实现 服务类
+ *
+ * @author BladeX
+ * @since 2022-07-20
+ */
+public interface IFlowEngineService extends IService<Flow> {
+
+    /**
+     * 发起流程
+     * @return
+     */
+    Boolean startFlow(FlowParam param);
+
+    /**
+     * 审批流程
+     * @return
+     */
+    Boolean examineFlow(FlowParam param);
+
+    /**
+     * 驳回流程
+     * @return
+     */
+    Boolean rejectFlow(FlowParam param);
+}

+ 209 - 0
hx-saas-project/saas-flow/src/main/java/com/fjhx/flow/service/impl/FlowEngineServiceImpl.java

@@ -0,0 +1,209 @@
+/*
+ *      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 com.fjhx.flow.service.impl;
+
+import com.baomidou.mybatisplus.core.toolkit.Wrappers;
+import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
+import com.fjhx.flow.entity.*;
+import com.fjhx.flow.mapper.FlowMapper;
+import com.fjhx.flow.service.*;
+import org.springblade.core.log.exception.ServiceException;
+import org.springblade.core.secure.utils.AuthUtil;
+import org.springblade.core.tool.utils.ObjectUtil;
+import org.springblade.core.tool.utils.StringUtil;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.stereotype.Service;
+import org.springframework.transaction.annotation.Transactional;
+
+import java.util.ArrayList;
+import java.util.Date;
+import java.util.List;
+
+/**
+ * 业务附件表 服务实现类
+ *
+ * @author BladeX
+ * @since 2022-07-20
+ */
+@Service
+public class FlowEngineServiceImpl extends ServiceImpl<FlowMapper, Flow> implements IFlowEngineService {
+
+    @Autowired
+    private IFlowNodeService iFlowNodeService;
+
+    @Autowired
+    private IFlowNodelineService iFlowNodelineService;
+
+    @Autowired
+    private IFlowApplycheckService iFlowApplycheckService;
+    /**
+     * 发起流程
+     * @param param
+     * @return true 发起成功
+     */
+    @Override
+    @Transactional(rollbackFor = Exception.class)
+    public Boolean startFlow(FlowParam param) {
+        if(StringUtil.isEmpty(param.getFlowIdentifying())){
+            throw new ServiceException("流程标识不能为空");
+        }
+        //根据流程标识查询流程模型
+        Flow flow = this.getOne(Wrappers.<Flow>query().lambda().eq(Flow::getFlowIdentifying,param.getFlowIdentifying()));
+        if(ObjectUtil.isEmpty(flow)){
+            throw new ServiceException("模型不存在");
+        }
+        //查询出发起节点
+        FlowNodeline flowNodeline = iFlowNodelineService.getOne(Wrappers.<FlowNodeline>query().lambda().
+                eq(FlowNodeline::getFlowId,flow.getId()).eq(FlowNodeline::getFromNodeId,""));
+        //根据上一个节点查询出下一个节点
+        FlowNodeline flowNodelineNext = iFlowNodelineService.getOne(Wrappers.<FlowNodeline>query().lambda().
+                eq(FlowNodeline::getFromNodeId,flowNodeline.getToNodeId()));
+        //根据发起节点查询下一个节点
+        FlowNode flowNode = iFlowNodeService.getOne(Wrappers.<FlowNode>query().lambda().
+                eq(FlowNode::getId,flowNodeline.getToNodeId()));
+        //生成节点走向数据
+        List<FlowApplycheck> saveBatch = new ArrayList<>();
+        //生成发起节点走向
+        saveBatch.add(setFlowApplyCheck(flowNodeline.getFlowId(),"","",
+                flowNodeline.getToNodeId(), "",0,new Date(),"",
+                param.getBusinessId(),""));
+        //生成审批节点走向
+        saveBatch.add(setFlowApplyCheck(flowNode.getFlowId(),flowNode.getId(),flowNode.getBackNodeId(),
+                flowNodelineNext.getToNodeId(), "",1,null,null,
+                param.getBusinessId(),param.getTitle()));
+        iFlowApplycheckService.saveBatch(saveBatch);
+        //消息通知,根据角色查询用户,通知所有拥有这个角色的人
+        String roleId = flowNode.getRoleKey();
+        return true;
+    }
+
+    /**
+     * 审批
+     * @param param
+     * @return true流程已结束  false还有下一个节点
+     */
+    @Override
+    public Boolean examineFlow(FlowParam param) {
+        if(StringUtil.isEmpty(param.getProInstantsId())){
+            throw new ServiceException("流程ID不能为空");
+        }
+        //通过流程ID查询出走向数据
+        FlowApplycheck flowApplycheck = iFlowApplycheckService.getById(param.getProInstantsId());
+        updateApplyCheck(param,2);
+        //如果下一个节点是空的,流程已结束
+        if(StringUtil.isEmpty(flowApplycheck.getNextNodeId())){
+            return true;
+        }
+        //查询出当前节点连接
+        FlowNodeline flowNodelineNext = iFlowNodelineService.getOne(Wrappers.<FlowNodeline>query().lambda().
+                eq(FlowNodeline::getFromNodeId,flowApplycheck.getNextNodeId()));
+        //查询出下一个节点基础信息
+        FlowNode flowNode = iFlowNodeService.getOne(Wrappers.<FlowNode>query().lambda().
+                eq(FlowNode::getId,flowApplycheck.getNextNodeId()));
+        //生成审批节点走向
+        iFlowApplycheckService.save(setFlowApplyCheck(flowNodelineNext.getFlowId(),flowApplycheck.getNextNodeId(),flowApplycheck.getNodeId(),
+                flowNodelineNext.getToNodeId(), "",1,null,null,
+                param.getBusinessId(),param.getTitle()));
+        //消息通知,根据角色查询用户,通知所有拥有这个角色的人
+        String roleId = flowNode.getRoleKey();
+        return false;
+    }
+
+    /**
+     * 驳回流程
+     * @param param
+     * @return
+     */
+    @Override
+    public Boolean rejectFlow(FlowParam param) {
+        if(StringUtil.isEmpty(param.getProInstantsId())){
+            throw new ServiceException("流程ID不能为空");
+        }
+        //通过流程ID查询出走向数据
+        FlowApplycheck flowApplycheck = iFlowApplycheckService.getById(param.getProInstantsId());
+        updateApplyCheck(param,3);
+        //如果上一个节点是空的或者上一个节点是发起,流程也结束
+        FlowNode checkFlowNode = iFlowNodeService.getOne(Wrappers.<FlowNode>query().lambda().
+                eq(FlowNode::getId,flowApplycheck.getPreNodeId()));
+        if(StringUtil.isEmpty(flowApplycheck.getPreNodeId())||
+                StringUtil.isEmpty(checkFlowNode.getBackNodeId())){
+            return true;
+        }
+        //查询出当前节点连接
+        FlowNodeline flowNodeline = iFlowNodelineService.getOne(Wrappers.<FlowNodeline>query().lambda().
+                eq(FlowNodeline::getFromNodeId,flowApplycheck.getPreNodeId()));
+        //查询出上一个节点基础信息
+        FlowNode flowNode = iFlowNodeService.getOne(Wrappers.<FlowNode>query().lambda().
+                eq(FlowNode::getId,flowNodeline.getFromNodeId()));
+        //生成审批节点走向
+        iFlowApplycheckService.save(setFlowApplyCheck(flowNode.getFlowId(),flowNode.getId(),flowNode.getBackNodeId(),
+                flowNodeline.getToNodeId(), "",1,null,null,
+                param.getBusinessId(),param.getTitle()));
+        //消息通知,根据角色查询用户,通知所有拥有这个角色的人
+        String roleId = flowNode.getRoleKey();
+        return false;
+    }
+
+    /**
+     * 设置属性
+     * @param flowId
+     * @param nodeId
+     * @param preNodeId
+     * @param nextNodeId
+     * @param checkUserId
+     * @param checkState
+     * @param checkTime
+     * @param suggestions
+     * @param linkId
+     * @param approvalItem
+     * @return
+     */
+    public FlowApplycheck setFlowApplyCheck(String flowId, String nodeId, String preNodeId, String nextNodeId,
+                                            String checkUserId, int checkState, Date checkTime,String suggestions,String linkId,String approvalItem){
+        FlowApplycheck flowApplycheck = new FlowApplycheck();
+        flowApplycheck.setCreatedTime(new Date());
+        flowApplycheck.setFlowId(flowId);
+        flowApplycheck.setNodeId(nodeId);
+        flowApplycheck.setPreNodeId(preNodeId);
+        flowApplycheck.setNextNodeId(nextNodeId);
+        flowApplycheck.setCheckUserId(checkUserId);
+        flowApplycheck.setCheckTime(checkTime);
+        flowApplycheck.setCheckState(checkState);
+        flowApplycheck.setSuggestions(suggestions);
+        flowApplycheck.setLinkId(linkId);
+        flowApplycheck.setApprovalItem(approvalItem);
+        return flowApplycheck;
+    }
+
+    /**
+     * 修改
+     * @param param
+     * @param state
+     */
+    public void updateApplyCheck(FlowParam param,int state){
+        //修改流程标识为已审批
+        FlowApplycheck update = new FlowApplycheck();
+        update.setId(param.getProInstantsId());
+        update.setUpdatedTime(new Date());
+        update.setCheckUserId(AuthUtil.getUserIdStr());
+        update.setCheckState(state);
+        update.setCheckTime(new Date());
+        update.setSuggestions(param.getCommon());
+        update.setApprovalItem(param.getTitle());
+        iFlowApplycheckService.updateById(update);
+    }
+}

+ 0 - 5
hx-saas-project/saas-storage/pom.xml

@@ -27,11 +27,6 @@
             <artifactId>saas-rocketmq-api</artifactId>
             <version>${bladex.project.version}</version>
         </dependency>
-        <dependency>
-            <groupId>com.fjhx</groupId>
-            <artifactId>saas-rocketmq</artifactId>
-            <version>${bladex.project.version}</version>
-        </dependency>
     </dependencies>
 
     <build>

+ 2 - 7
hx-saas-project/saas-storage/src/main/java/com/fjhx/attachment/service/impl/StockAttachmentServiceImpl.java

@@ -6,12 +6,9 @@ import com.fjhx.attachment.StockAttachment;
 import com.fjhx.attachment.StockAttachmentVo;
 import com.fjhx.attachment.mapper.StockAttachmentMapper;
 import com.fjhx.attachment.service.StockAttachmentService;
-import com.fjhx.message.enums.MessageNoticeEnum;
-import com.fjhx.rocketmq.service.RocketMqService;
 import org.springblade.core.log.exception.ServiceException;
 import org.springblade.core.tenant.annotation.TenantIgnore;
 import org.springblade.core.tool.utils.StringUtil;
-import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.stereotype.Service;
 import org.springframework.transaction.annotation.Transactional;
 
@@ -28,8 +25,6 @@ import java.util.*;
 @Service
 public class StockAttachmentServiceImpl extends ServiceImpl<StockAttachmentMapper, StockAttachment> implements StockAttachmentService {
 
-    @Autowired
-    private RocketMqService rocketMqService;
     /**
      * 添加
      * @param stockAttachmentVo
@@ -85,8 +80,8 @@ public class StockAttachmentServiceImpl extends ServiceImpl<StockAttachmentMappe
         if(StringUtil.isEmpty(busi)){
             throw new ServiceException("参数异常");
         }
-        rocketMqService.send("topic-ws","tag-ws","",busi, Collections.singletonList("1123598821738675202")
-                ,"你有一条消息",MessageNoticeEnum.MESSAGE_NOTICE_TYPE_1.getKey());
+//        rocketMqService.send("topic-ws","tag-ws","",busi, Collections.singletonList("1123598821738675202")
+//                ,"你有一条消息",MessageNoticeEnum.MESSAGE_NOTICE_TYPE_1.getKey());
         return list(Wrappers.<StockAttachment>query().lambda().eq(StockAttachment::getBusiId,busi));
     }
 }

+ 11 - 1
hx-service/storage/src/main/java/com/fjhx/supplier/controller/SupplierController.java

@@ -201,7 +201,17 @@ public class SupplierController {
         List<Supplier> list = supplierService.getMonthSumPurMoney(id,date);
         return R.success(list);
     }
-
+    /**
+     * 下拉供应商
+     * @param condition
+     * @return
+     */
+    @GetMapping("/selectList")
+    public R selectList(@RequestBody Map<String, Object> condition){
+        ListPageMap.getListPageMap(condition);
+        List<Supplier> list = supplierService.selectList(condition);
+        return R.success(list);
+    }
 
 }
 

+ 11 - 0
hx-service/storage/src/main/java/com/fjhx/supplier/mapper/SupplierMapper.java

@@ -127,4 +127,15 @@ public interface SupplierMapper extends BaseMapper<Supplier> {
      */
     @TenantIgnore
     List<Supplier> getMonthSumPurMoney(@Param("id") String id,@Param("date")String date);
+
+
+    /**
+     * 下拉列表
+     *
+     * @param condition
+     * @return
+     */
+    @TenantIgnore
+    List<Supplier> selectList(Map<String, Object> condition);
+
 }

+ 10 - 1
hx-service/storage/src/main/java/com/fjhx/supplier/mapper/SupplierMapper.xml

@@ -34,7 +34,7 @@
     </select>
     <select id="getPurList" resultType="com.fjhx.entity.supplier.Supplier">
         SELECT
-            t1.*
+            t1.*,
             t3.CategoryCode,
             t3.TechnologyType AS TechnologyType,
             t3.Purpose AS purpose,
@@ -197,6 +197,15 @@
             DATE_FORMAT( t2.CreatedTime, '%Y-%m' )
     </select>
 
+    <select id="selectList" resultType="com.fjhx.entity.supplier.Supplier">
+        SELECT
+            *
+        FROM
+            supplier
+        <include refid="list_condition"/>
+        ORDER BY CreatedTime DESC
+        <include refid="sql_limit"/>
+    </select>
     <sql id="warningCount_filed">
         SELECT count( 1 ) FROM supplier_problem WHERE SupplierId = t1.id
     </sql>

+ 8 - 0
hx-service/storage/src/main/java/com/fjhx/supplier/service/SupplierService.java

@@ -132,4 +132,12 @@ public interface SupplierService extends BaseService<Supplier> {
      * @return
      */
     List<Supplier> getMonthSumPurMoney(String id,String date);
+
+    /**
+     * 下拉列表
+     *
+     * @param condition
+     * @return
+     */
+    List<Supplier> selectList(Map<String, Object> condition);
 }

+ 7 - 2
hx-service/storage/src/main/java/com/fjhx/supplier/service/impl/SupplierProblemServiceImpl.java

@@ -14,6 +14,7 @@ import com.fjhx.supplier.service.SupplierProblemService;
 import com.fjhx.utils.ListUtil;
 import com.fjhx.utils.WrapperUtil;
 import io.swagger.models.auth.In;
+import org.apache.commons.lang.StringUtils;
 import org.springblade.core.log.exception.ServiceException;
 import org.springblade.core.tool.utils.CollectionUtil;
 import org.springblade.core.tool.utils.ObjectUtil;
@@ -129,8 +130,12 @@ public class SupplierProblemServiceImpl extends ServiceImpl<SupplierProblemMappe
      */
     @Override
     public Map<String, Integer> statisticsProblem(String supplierId) {
-        List<String> list = Arrays.asList(baseMapper.getGroupConcatType(supplierId).split(","));
-        Map<String,Integer> map = ListUtil.duplicateCheckingCount(list);
+        String count = baseMapper.getGroupConcatType(supplierId);
+        Map<String,Integer> map = new HashMap<>();
+        if(StringUtils.isNotEmpty(count)){
+            List<String> list = Arrays.asList(count.split(","));
+            map = ListUtil.duplicateCheckingCount(list);
+        }
         return map;
     }
 

+ 10 - 0
hx-service/storage/src/main/java/com/fjhx/supplier/service/impl/SupplierServiceImpl.java

@@ -270,4 +270,14 @@ public class SupplierServiceImpl extends ServiceImpl<SupplierMapper, Supplier> i
         }
         return list;
     }
+
+    /**
+     * 下拉列表
+     * @param condition
+     * @return
+     */
+    @Override
+    public List<Supplier> selectList(Map<String, Object> condition) {
+        return baseMapper.selectList(condition);
+    }
 }