| | |
| | | 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; |
| | |
| | | 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 { |
| | |
| | | |
| | | 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)); |
| | |
| | | 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))) { |
| | | // 重新设置缓存 |
| | |
| | | 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)); |
| | |
| | | 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; |
| | | } |
| | | } |
| | | } |