许鹏程
2023-06-29 cb4df5a1c9cda76e828fa202990df33be0735105
src/main/java/com/product/server/report/service/ReportConfigService.java
@@ -8,7 +8,6 @@
import com.product.admin.service.UpdateLoginUserInfoService;
import com.product.common.lang.StringUtils;
import com.product.core.cache.DataPoolCacheImpl;
import com.product.core.config.CoreConst;
import com.product.core.dao.BaseDao;
import com.product.core.entity.DataTableEntity;
import com.product.core.entity.FieldSetEntity;
@@ -24,8 +23,9 @@
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;
import javax.xml.crypto.Data;
import java.util.*;
import java.util.Date;
import java.util.List;
import java.util.Map;
@Component
public class ReportConfigService extends AbstractBaseService implements IReportConfigService {
@@ -51,16 +51,10 @@
      List<Object> paramList = Lists.newArrayList();
      StringBuilder sql = new StringBuilder(512);
      String queryFilter = " ";
      if(!BaseUtil.dataTableIsEmpty(fse.getSubDataTable("systemSeniorQueryString"))){
         queryFilter ="AND"+ queryFilterService.getQueryFilter(fse);
      }
      sql.append("\nSELECT a.uuid,a.type_uuid,a.is_valid,a.org_level_uuid,a.report_name,b.type_name,b.type_group")
            .append("\nFROM product_sys_report_config a")
            .append("\nLEFT JOIN product_sys_report_type_config b ON a.type_uuid = b.uuid")
            .append("\nwhere (function_uuid is null or function_uuid='') ")
              .append(queryFilter);
                .append("\nwhere (function_uuid is null or function_uuid='') ");
      if (!StringUtils.isEmpty(fse.getString(CmnConst.TYPE_UUID))) {
         sql.append("\nand b.type_group=? ");
         paramList.add(fse.getString(CmnConst.TYPE_UUID));
@@ -141,9 +135,8 @@
      if (StringUtils.isEmpty(fse.getString(CmnConst.PAGE_SIZE))) {
         fse.setValue(CmnConst.PAGE_SIZE, null);
      }
      System.out.println(System.currentTimeMillis());
      String uuid = baseDao.add(fse);
      System.out.println(System.currentTimeMillis());
      if ("1".equals(fse.getString(CmnConst.RELATE_FLAG))) {
         // 重新设置缓存
@@ -213,11 +206,10 @@
            String tempUUID;
            for (int i = 0; i < reportAttrDte.getRows(); i++) {
               tempFse = reportAttrDte.getFieldSetEntity(i);
               tempFse.setValue("report_type_attr_show_name", tempFse.getString(CmnConst.REPORT_TYPE_ATTR));
               tempFse.setValue(CmnConst.REPORT_TYPE_ATTR, reportTypeAttrMap.get(tempFse.getString(CmnConst.REPORT_TYPE_ATTR)));
               tempFse.setValue(CmnConst.CELL_POSITION_X, tempFse.getString(CmnConst.ATTR_X));
               tempFse.setValue(CmnConst.CELL_POSITION_Y, tempFse.getString(CmnConst.ATTR_Y));
               String x = tempFse.getString(CmnConst.ATTR_X);
               tempObj = new JSONObject();
               tempObj.put(CmnConst.ATTR_REPORT_AREA, tempFse.getString(CmnConst.ATTR_REPORT_AREA));
               tempObj.put(CmnConst.CELL_POSITION_X, tempFse.getString(CmnConst.CELL_POSITION_X));
@@ -227,18 +219,6 @@
               tempUUID = preReportAttrMap.get(tempObj);
               if (!StringUtils.isEmpty(tempUUID)) {
                  tempFse.setValue(CmnConst.UUID, tempUUID);
               }
               if (StringUtils.isEmpty(tempFse.getString(CmnConst.REPORT_TYPE_ATTR_VALUE))) {
                  //属性值是否为空
                  if (StringUtils.isEmpty(tempFse.getUUID())) {
                     //没有保存过的属性
                     reportAttrDte.removeFieldSetEntity(i);
                     i--;
                  } else {
                     //标记为删除
                     tempFse.setValue(CoreConst.SYSTEM_DATA_OPERATE_TYPE, "del");
                  }
                  continue;
               }
            }
         }