| | |
| | | package com.product.administration.service; |
| | | |
| | | import com.product.administration.config.CmnConst; |
| | | import com.product.administration.config.SystemCode; |
| | | import com.product.common.lang.StringUtils; |
| | | import com.product.core.dao.BaseDao; |
| | | import com.product.core.entity.DataTableEntity; |
| | |
| | | if(!StringUtils.isEmpty(dataFilter)){ |
| | | filter += " and "+dataFilter; |
| | | } |
| | | DataTableEntity dt = baseDao.listTable(CmnConst.PRODUCT_SYS_WORK_OVERTIME,filter,param,null,null,fs.getInteger(CmnConst.PAGESIZE),fs.getInteger(CmnConst.CPAGE)); |
| | | DataTableEntity dt = baseDao.listTable(CmnConst.PRODUCT_OA_WORK_OVERTIME,filter,param,null,null,fs.getInteger(CmnConst.PAGESIZE),fs.getInteger(CmnConst.CPAGE)); |
| | | baseDao.loadPromptData(dt); |
| | | return dt; |
| | | } |
| | |
| | | * @Description: 加班申请详情 |
| | | */ |
| | | public FieldSetEntity getWorkOvertimeInfo(FieldSetEntity fs) throws BaseException { |
| | | return baseDao.listInternationDataTable(baseDao.getFieldSetEntity(CmnConst.PRODUCT_SYS_WORK_OVERTIME, fs.getString(CmnConst.UUID), true),null); |
| | | return baseDao.listInternationDataTable(baseDao.getFieldSetEntity(CmnConst.PRODUCT_OA_WORK_OVERTIME, fs.getString(CmnConst.UUID), true),null); |
| | | } |
| | | |
| | | /** |
| | |
| | | * @Author: ZhouJie |
| | | * @Description: 保存加班申请(新增、修改) |
| | | */ |
| | | public String saveWorkOvertime(FieldSetEntity fs) throws BaseException { |
| | | if(StringUtils.isEmpty(fs.getString(CmnConst.UUID))){ |
| | | fs.setValue("created_by",SpringMVCContextHolder.getCurrentUser().getUser_id()); |
| | | fs.setValue("created_utc_datetime",new Date()); |
| | | return baseDao.add(fs); |
| | | public boolean saveWorkOvertime(FieldSetEntity fse) throws BaseException { |
| | | BaseUtil.createCreatorAndCreationTime(fse); |
| | | FieldSetEntity fseRepeatData = null; |
| | | if(StringUtils.isEmpty(fse.getUUID())){ |
| | | fseRepeatData = baseDao.getFieldSetEntityByFilter(CmnConst.PRODUCT_OA_WORK_OVERTIME, "user_id = ? AND month = ?", new Object[] {fse.getString("user_id"), fse.getString("month")}, false); |
| | | }else { |
| | | fs.setValue("updated_by",SpringMVCContextHolder.getCurrentUser().getUser_id()); |
| | | fs.setValue("updated_utc_datetime",new Date()); |
| | | baseDao.update(fs); |
| | | return fs.getString(CmnConst.UUID); |
| | | fseRepeatData = baseDao.getFieldSetEntityByFilter(CmnConst.PRODUCT_OA_WORK_OVERTIME, "user_id = ? AND month = ? AND uuid != ?", new Object[] {fse.getString("user_id"), fse.getString("month"), fse.getUUID()}, false); |
| | | } |
| | | if (fseRepeatData != null) { |
| | | throw new BaseException(SystemCode.SYSTEM_SAVE_FAIL_DATA_READY_EXIST.getValue(), SystemCode.SYSTEM_SAVE_FAIL_DATA_READY_EXIST.getText()); |
| | | } |
| | | return baseDao.saveFieldSetEntity(fse); |
| | | } |
| | | |
| | | /** |
| | |
| | | public boolean deleteWorkOvertime(FieldSetEntity fs) throws BaseException { |
| | | String uuid = fs.getUUID(); |
| | | String[] uuids = uuid.split(","); |
| | | return baseDao.delete(CmnConst.PRODUCT_SYS_WORK_OVERTIME, BaseUtil.buildQuestionMarkFilter(CmnConst.UUID, uuids.length, true), uuids); |
| | | return baseDao.delete(CmnConst.PRODUCT_OA_WORK_OVERTIME, BaseUtil.buildQuestionMarkFilter(CmnConst.UUID, uuids.length, true), uuids); |
| | | } |
| | | } |