许鹏程
2023-08-22 84169fc928d887d606e12380cfa3c1409d04db2a
src/main/java/com/product/administration/service/CooperatesService.java
@@ -1,6 +1,5 @@
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;
@@ -9,7 +8,6 @@
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;
@@ -88,7 +86,7 @@
      StringBuilder stringBuilder = new StringBuilder();
      stringBuilder.append(" select ifnull(concat(tricode,'-',receiver) ,receiver) code,uuid,title,cooperate_uuid,grade,receiver as id,receiver,sender, ");
      stringBuilder.append(" receiver_name,(select user_name FROM product_sys_users where user_id=receiver) label,sender_name,status, ");
      stringBuilder.append(" tricode,opinion,handle_time,type,attachments from product_oa_cooperate_flow_node where cooperate_uuid=? ORDER BY tricode ");
      stringBuilder.append(" tricode,opinion,handle_time,type,attachments,is_hide_commentss from product_oa_cooperate_flow_node where cooperate_uuid=? ORDER BY tricode ");
      DataTableEntity dt = baseDao.listTable(stringBuilder.toString(), new Object[]{fs.getString("uuid")});
      JSONArray json = null;
      if (dt != null && dt.getRows() > 0) {
@@ -252,6 +250,7 @@
    */
   public void saveTodo(FieldSetEntity fs) throws BaseException {
      fs.setValue("status", 1);
      fs.setValue("handle_time", new Date());
      baseDao.update(fs);
   }
@@ -317,10 +316,10 @@
      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(" where  ").append(queryFilter);
         str.append(" and  ").append(queryFilter);
      }
      str.append(" order by start_time desc) a");
      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");
      dt.getMeta().addAliasTable("product_oa_cooperate_flow_node", "lcn");