Browse Source

项目详情提交逻辑更改---添加所属类型

feature/dangjian
wanggongfeng 3 years ago
parent
commit
afaff6bd87
  1. 5
      esua-epdc/epdc-module/epdc-events/epdc-events-client/src/main/java/com/elink/esua/epdc/dto/item/form/ItemHandleSubmitFormDTO.java
  2. 56
      esua-epdc/epdc-module/epdc-events/epdc-events-server/src/main/java/com/elink/esua/epdc/modules/item/service/impl/ItemServiceImpl.java
  3. 14
      esua-epdc/epdc-module/epdc-events/epdc-events-server/src/main/resources/mapper/item/ItemDao.xml

5
esua-epdc/epdc-module/epdc-events/epdc-events-client/src/main/java/com/elink/esua/epdc/dto/item/form/ItemHandleSubmitFormDTO.java

@ -79,4 +79,9 @@ public class ItemHandleSubmitFormDTO implements Serializable {
*/
@NotBlank(message = "操作人部门不能为空")
private String handlerDept;
/**
* 所属类别
*/
private String categoryId;
}

56
esua-epdc/epdc-module/epdc-events/epdc-events-server/src/main/java/com/elink/esua/epdc/modules/item/service/impl/ItemServiceImpl.java

@ -42,8 +42,10 @@ import com.elink.esua.epdc.commons.tools.utils.*;
import com.elink.esua.epdc.constant.*;
import com.elink.esua.epdc.constants.MenuCodeConstant;
import com.elink.esua.epdc.dto.*;
import com.elink.esua.epdc.dto.category.CategoryDTO;
import com.elink.esua.epdc.dto.epdc.form.EpdcInformationFormDTO;
import com.elink.esua.epdc.dto.events.EpdcEventsCommentsDTO;
import com.elink.esua.epdc.dto.events.EventsCategoryDTO;
import com.elink.esua.epdc.dto.events.form.GroupFormDTO;
import com.elink.esua.epdc.dto.form.KpiMetaDataOfEventsFormDTO;
import com.elink.esua.epdc.dto.form.SmsNoticeFormDTO;
@ -69,6 +71,8 @@ import com.elink.esua.epdc.gird.shibei.dto.result.SendEventResultDto;
import com.elink.esua.epdc.gird.shibei.util.XstreamUtil;
import com.elink.esua.epdc.modules.async.IssueOverseeResultsTask;
import com.elink.esua.epdc.modules.async.NewsTask;
import com.elink.esua.epdc.modules.category.entity.CategoryEntity;
import com.elink.esua.epdc.modules.category.service.CategoryService;
import com.elink.esua.epdc.modules.events.dao.ImgDao;
import com.elink.esua.epdc.modules.events.entity.ImgEntity;
import com.elink.esua.epdc.modules.events.service.EpdcEventsService;
@ -185,6 +189,9 @@ public class ItemServiceImpl extends BaseServiceImpl<ItemDao, ItemEntity> implem
@Autowired
private ItemHandleProcessDao itemHandleProcessDao;
@Autowired
private CategoryService categoryService;
@Override
public PageData<ItemDTO> page(Map<String, Object> params) {
IPage<ItemEntity> page = baseDao.selectPage(
@ -1024,6 +1031,15 @@ public class ItemServiceImpl extends BaseServiceImpl<ItemDao, ItemEntity> implem
ItemEntity itemEntity = new ItemEntity();
itemEntity.setId(dto.getId());
itemEntity.setLastHandleTime(new Date());
// 初始化分类
if (StringUtils.isNotBlank(dto.getCategoryId())) {
EventsCategoryDTO categoryInfo = this.initCategoryInfo(dto.getCategoryId());
itemEntity.setCategoryCode(categoryInfo.getCategoryCode());
itemEntity.setFirstCategoryCode(categoryInfo.getFirstCategoryCode());
itemEntity.setCategoryFullName(categoryInfo.getCategoryFullName());
}
baseDao.updateById(itemEntity);
// 业务部门消息处理
@ -1169,6 +1185,46 @@ public class ItemServiceImpl extends BaseServiceImpl<ItemDao, ItemEntity> implem
return new Result();
}
/**
* 初始化分类信息
*
* @return com.elink.esua.epdc.dto.events.EventsCategoryDTO
* @params [categoryId]
* @author wgf
* @since 2022/09/06 19:51
*/
private EventsCategoryDTO initCategoryInfo(String categoryId) {
Long category = Long.parseLong(categoryId);
EventsCategoryDTO resultDto = new EventsCategoryDTO();
CategoryDTO cateDto = categoryService.get(category);
resultDto.setCategoryCode(cateDto.getCategoryCode());
//获取所有父类分类标签
List<CategoryEntity> cateList = categoryService.getPidListById(category);
//所选分类标签为多级
if (cateList != null && cateList.size() > 0) {
// list第一个为一级分类标签
resultDto.setFirstCategoryCode(cateList.get(0).getCategoryCode());
//分类标签全称拼接:-分割
String name = "";
for (int i = 0; i < cateList.size(); i++) {
if (i == cateList.size() - 1) {
name = name + cateList.get(i).getCategoryName();
} else {
name = name + cateList.get(i).getCategoryName() + "-";
}
}
name = name + "-" + cateDto.getCategoryName();
resultDto.setCategoryFullName(name);
// 所选分类标签为一级
} else {
//当前标签作为一级标签
resultDto.setFirstCategoryCode(cateDto.getCategoryCode());
resultDto.setCategoryFullName(cateDto.getCategoryName());
}
return resultDto;
}
/**
* @param id 项目表主键
* @return boolean

14
esua-epdc/epdc-module/epdc-events/epdc-events-server/src/main/resources/mapper/item/ItemDao.xml

@ -503,7 +503,7 @@
eve.COMMENT_NUM,
eve.BROWSE_NUM,
<if test="isRemind != null and isRemind != ''">
(case when (process.ID is null and HOUR( timediff( now(), item.CREATED_TIME) ) > 24) then '1' else '' end) as isRemind,
(case when (process.ID is null and HOUR( timediff( now(), item.CREATED_TIME) ) >= 24) then '1' else '' end) as isRemind,
</if>
( eve.APPROVE_NUM + eve.OPPOSE_NUM + eve.COMMENT_NUM + eve.BROWSE_NUM ) AS participantsNum,
(case when d.ID is not null then '1' else '0' end) as isDelay
@ -511,14 +511,10 @@
LEFT JOIN epdc_events eve ON item.EVENT_ID = eve.ID AND eve.DEL_FLAG = '0'
left join epdc_item_fusing_delay_record d on d.ITEM_ID = item.ID and d.DEL_FLAG = '0'
left join (
select a.ID,a.ITEM_ID,a.CREATED_TIME,a.state
from (
select ITEM_ID,max(CREATED_TIME) as CREATED_TIME
from epdc_item_handle_process
where DEL_FLAG = '0'
group by ITEM_ID
) b
left join epdc_item_handle_process a on a.ITEM_ID = b.ITEM_ID and a.CREATED_TIME = b.CREATED_TIME
select b.ID,b.ITEM_ID,b.CREATED_TIME,b.state
from epdc_item_handle_process b where b.STATE != 1001 and b.CREATED_TIME = (
SELECT max(CREATED_TIME) from epdc_item_handle_process where b.ITEM_ID = ITEM_ID
)
) process on process.ITEM_ID = item.ID
WHERE item.DEL_FLAG = '0'
and (item.IS_PEOPLE = '0' or (item.PEOPLE_FLAG = '0' and (process.state is null or process.state not in (11,15))))

Loading…
Cancel
Save