From bc0e6504f935fe54a3a68160db313f6d4f089b17 Mon Sep 17 00:00:00 2001
From: shichongfu <shi_chongfu@163.com>
Date: 星期五, 02 六月 2023 21:22:44 +0800
Subject: [PATCH] Merge branch 'master' of http://nonxin.cn:8090/r/product/product-server-administration/V2.0.0

---
 src/main/java/com/product/administration/service/CooperatesService.java |   25 ++++++++++++++++---------
 1 files changed, 16 insertions(+), 9 deletions(-)

diff --git a/src/main/java/com/product/administration/service/CooperatesService.java b/src/main/java/com/product/administration/service/CooperatesService.java
index 91f339d..ce0262d 100644
--- a/src/main/java/com/product/administration/service/CooperatesService.java
+++ b/src/main/java/com/product/administration/service/CooperatesService.java
@@ -1,5 +1,6 @@
 package com.product.administration.service;
 
+import cn.hutool.core.collection.CollectionUtil;
 import com.alibaba.fastjson.JSONArray;
 import com.product.admin.service.UserService;
 import com.product.administration.config.CmnConst;
@@ -8,6 +9,7 @@
 import com.product.core.config.CoreConst;
 import com.product.core.dao.BaseDao;
 import com.product.core.entity.DataTableEntity;
+import com.product.core.entity.FieldMetaEntity;
 import com.product.core.entity.FieldSetEntity;
 import com.product.core.exception.BaseException;
 import com.product.core.permission.PermissionService;
@@ -117,9 +119,9 @@
 			fse.addSubDataTable(dd);
 			json = BaseUtil.dataTableToTreeData(dt, "code", "tricode", null, false);
 		}
-		String sql = " select count(*) sum from product_oa_cooperate_flow_node where cooperate_uuid =?  and status =? ";
-		String sql1 = " select count(*) sum from product_oa_cooperate_flow_node where cooperate_uuid =? ";
-		String sql0 = " select count(*) sum from product_oa_cooperate_flow_node where cooperate_uuid =?  and (status =? or status is null) ";
+		String sql = " select count(*) sum from product_oa_cooperate_flow_node where cooperate_uuid =?  and status =? and tricode is not null";
+		String sql1 = " select count(*) sum from product_oa_cooperate_flow_node where cooperate_uuid =? and tricode is not null";
+		String sql0 = " select count(*) sum from product_oa_cooperate_flow_node where cooperate_uuid =?  and (status =? or status is null) and tricode is not null";
 		FieldSetEntity fss = baseDao.getFieldSetEntityBySQL(sql1, new Object[]{fs.getString(CmnConst.UUID)}, true);
 		FieldSetEntity fs0 = baseDao.getFieldSetEntityBySQL(sql0, new Object[]{fs.getString(CmnConst.UUID), 0}, true);
 		FieldSetEntity fs1 = baseDao.getFieldSetEntityBySQL(sql, new Object[]{fs.getString(CmnConst.UUID), 1}, true);
@@ -127,7 +129,7 @@
 		if (fss.getInteger("sum") == null) {
 			fse.setValue("totals", 0);//娴佺▼鍏辨湁浜烘暟
 		} else {
-			fse.setValue("totals", fss.getInteger("sum") - 1);
+			fse.setValue("totals", fss.getInteger("sum"));
 		}
 		if (fs0.getInteger("sum") == null) {
 			fse.setValue("uncollectd", 0);//鏈敹鏈姙浜烘暟
@@ -142,7 +144,7 @@
 		if (fs2.getInteger("sum") == null) {
 			fse.setValue("done", 0);//宸叉敹宸插姙浜烘暟
 		} else {
-			fse.setValue("done", fs2.getInteger("sum") - 1);
+			fse.setValue("done", fs2.getInteger("sum"));
 		}
 		int a = fse.getInteger("totals") - fse.getInteger("uncollectd") - fse.getInteger("received") - fse.getInteger("done");
 		fse.setValue("not_yet", a);//鏈埌鐜妭浜烘暟
@@ -266,6 +268,11 @@
 		return baseDao.add(fs);
 	}
 
+	@Override
+	public boolean delSupplyText(FieldSetEntity fs) {
+		return baseDao.delete(fs.getTableName(),new String[]{fs.getUUID()});
+	}
+
 	/**
 	 * @description: 鍗忓悓鍔炲叕鍌姙
 	 * @author: ZhouJie
@@ -305,14 +312,14 @@
 	 */
 	public DataTableEntity getNowUserList(FieldSetEntity fs) {
 		int user_id = SpringMVCContextHolder.getCurrentUser().getUser_id();
-		fs.getMeta().addAliasTable("product_oa_cooperates", "lc");
-		fs.getMeta().addAliasTable("product_oa_cooperate_flow_node", "lcn");
 		String queryFilter = queryFilterService.getQueryFilter(fs);
 		StringBuffer str = new StringBuffer();
-		str.append(" select lc.*,lcn.uuid flow_node_uuid from product_oa_cooperate_flow_node lcn LEFT JOIN product_oa_cooperates lc ");
+		str.append("SELECT * FROM ( ");
+		str.append(" select lc.*,lcn.uuid flow_node_uuid from product_oa_cooperate_flow_node as lcn LEFT JOIN product_oa_cooperates as lc ");
 		str.append(" on lc.uuid=lcn.cooperate_uuid where lcn.receiver=? and lcn.status=? and sender_name is not null ");
+		str.append(" ) a");
 		if (!StringUtils.isEmpty(queryFilter)) {
-			str.append(" and ").append(queryFilter);
+			str.append(" where  ").append(queryFilter);
 		}
 		DataTableEntity dt = baseDao.listTable(str.toString(), new Object[]{user_id, 2}, fs.getInteger(CmnConst.PAGESIZE), fs.getInteger(CmnConst.CPAGE));
 		dt.getMeta().addAliasTable("product_oa_cooperates", "lc");

--
Gitblit v1.9.2