| | |
| | | @Component
|
| | | public class SendDocumentService extends AbstractBaseService implements ISendDocumentService {
|
| | |
|
| | | @Autowired
|
| | | public BaseDao baseDao;
|
| | | @Autowired
|
| | | PermissionService permissionService;
|
| | | @Autowired
|
| | | QueryFilterService queryFilterService;
|
| | | @Autowired
|
| | | public BaseDao baseDao;
|
| | | @Autowired
|
| | | PermissionService permissionService;
|
| | | @Autowired
|
| | | QueryFilterService queryFilterService;
|
| | |
|
| | | public DataTableEntity getSendDocList(FieldSetEntity fs) throws BaseException {
|
| | | String filter=fs.getString("filter");
|
| | | String dataFilter = "" ;
|
| | | //创建人字段
|
| | | String created_by_field = fs.getString(CmnConst.CREATED_BY_FIELD);
|
| | | if(!BaseUtil.strIsNull(created_by_field)){
|
| | | dataFilter = permissionService.getDataFilter(fs.getTableName(),created_by_field);
|
| | | }
|
| | | if(!StringUtils.isEmpty(dataFilter)){
|
| | | if(!StringUtils.isEmpty(filter)){
|
| | | filter += " and "+dataFilter;
|
| | | }else {
|
| | | filter = dataFilter;
|
| | | }
|
| | | }
|
| | | if(!BaseUtil.dataTableIsEmpty(fs.getSubDataTable("systemSeniorQueryString"))){
|
| | | filter = filter + " and " + queryFilterService.getQueryFilter(fs);
|
| | | }
|
| | | DataTableEntity dt = baseDao.listTable(CmnConst.FWGZ,filter,null,null,"fw13 desc",fs.getInteger(CmnConst.PAGESIZE),fs.getInteger(CmnConst.CPAGE));
|
| | | baseDao.loadPromptData(dt);
|
| | | return dt;
|
| | | }
|
| | | public DataTableEntity getSendDocList(FieldSetEntity fs) throws BaseException {
|
| | | String filter = fs.getString("filter");
|
| | | String dataFilter = "";
|
| | | //创建人字段
|
| | | String created_by_field = fs.getString(CmnConst.CREATED_BY_FIELD);
|
| | | if (!BaseUtil.strIsNull(created_by_field)) {
|
| | | dataFilter = permissionService.getDataFilter(fs.getTableName(), created_by_field);
|
| | | }
|
| | | if (!StringUtils.isEmpty(dataFilter)) {
|
| | | if (!StringUtils.isEmpty(filter)) {
|
| | | filter += " and " + dataFilter;
|
| | | } else {
|
| | | filter = dataFilter;
|
| | | }
|
| | | }
|
| | | if (!BaseUtil.dataTableIsEmpty(fs.getSubDataTable("systemSeniorQueryString"))) {
|
| | | filter = filter + " and " + queryFilterService.getQueryFilter(fs);
|
| | | }
|
| | | DataTableEntity dt = baseDao.listTable(CmnConst.FWGZ, filter, null, null, "fw13 desc", fs.getInteger(CmnConst.PAGESIZE), fs.getInteger(CmnConst.CPAGE));
|
| | | baseDao.loadPromptData(dt);
|
| | | return dt;
|
| | | }
|
| | |
|
| | | /**
|
| | | * 批量归档
|
| | | * @param fs
|
| | | * @throws BaseException
|
| | | */
|
| | | @Override
|
| | | @Transactional
|
| | | public boolean batchFile(FieldSetEntity fs)throws BaseException{
|
| | | String uuids = fs.getString("uuid");
|
| | | String[] uuid = uuids.split(",");
|
| | | for (int i = 0; i < uuid.length; i++) {
|
| | | FieldSetEntity fieldSetEntity = new FieldSetEntity();
|
| | | fieldSetEntity.setTableName(fs.getTableName());
|
| | | fieldSetEntity.setValue("uuid", uuid[i]);
|
| | | fieldSetEntity.setValue("pigeonhole",1);
|
| | | baseDao.update(fieldSetEntity);
|
| | | }
|
| | | return true;
|
| | | }
|
| | | /**
|
| | | * 批量归档
|
| | | *
|
| | | * @param fs
|
| | | * @throws BaseException
|
| | | */
|
| | | @Override
|
| | | @Transactional
|
| | | public boolean batchFile(FieldSetEntity fs) throws BaseException {
|
| | | String uuids = fs.getString("uuid");
|
| | | String[] uuid = uuids.split(",");
|
| | | for (int i = 0; i < uuid.length; i++) {
|
| | | FieldSetEntity fieldSetEntity = new FieldSetEntity();
|
| | | fieldSetEntity.setTableName(fs.getTableName());
|
| | | fieldSetEntity.setValue("uuid", uuid[i]);
|
| | | fieldSetEntity.setValue("pigeonhole", 1);
|
| | | baseDao.update(fieldSetEntity);
|
| | | }
|
| | | return true;
|
| | | }
|
| | |
|
| | | /**
|
| | | * 人员高级参照解析并保存
|
| | | * @param fse
|
| | | * @throws BaseException
|
| | | */
|
| | | @Transactional
|
| | | @Override
|
| | | public String saveFieldSetEntity(FieldSetEntity fse) throws BaseException {
|
| | | String fw09 = fse.getString("fw09");
|
| | | String[] fw09s = fw09.split(",");
|
| | | DataTableEntity dataTableEntity = baseDao.listTable("product_sys_users", BaseUtil.buildQuestionMarkFilter("user_id",fw09s,true), new String[]{});
|
| | | String fw09_value = "";
|
| | | for (int i = 0; i < dataTableEntity.getRows(); i++) {
|
| | | String user_name = dataTableEntity.getString(i,"user_name");
|
| | | fw09_value = fw09_value + user_name + ",";
|
| | | }
|
| | | fw09_value = fw09_value.substring(0, fw09_value.length() - 1);
|
| | | fse.setValue("fw09_value", fw09_value);
|
| | | BaseUtil.createCreatorAndCreationTime(fse);
|
| | | baseDao.saveFieldSetEntity(fse);
|
| | | return fse.getUUID();
|
| | | }
|
| | | /**
|
| | | * 人员高级参照解析并保存
|
| | | *
|
| | | * @param fse
|
| | | * @throws BaseException
|
| | | */
|
| | | @Transactional
|
| | | @Override
|
| | | public String saveFieldSetEntity(FieldSetEntity fse) throws BaseException {
|
| | | try {
|
| | | BaseUtil.createCreatorAndCreationTime(fse);
|
| | | baseDao.saveFieldSetEntity(fse);
|
| | | return fse.getUUID();
|
| | | } catch (Exception e) {
|
| | | e.printStackTrace();
|
| | | throw e;
|
| | | }
|
| | | }
|
| | |
|
| | | }
|