Browse Source

日程列表

dev
sunyuchao 3 years ago
parent
commit
b6e18528c4
  1. 38
      epmet-module/resi-partymember/resi-partymember-client/src/main/java/com/epmet/resi/partymember/dto/partyOrg/form/IcScheduleFormDTO.java
  2. 11
      epmet-module/resi-partymember/resi-partymember-server/src/main/java/com/epmet/modules/partyOrg/controller/IcScheduleController.java
  3. 3
      epmet-module/resi-partymember/resi-partymember-server/src/main/java/com/epmet/modules/partyOrg/dao/IcScheduleDao.java
  4. 17
      epmet-module/resi-partymember/resi-partymember-server/src/main/java/com/epmet/modules/partyOrg/service/IcScheduleService.java
  5. 27
      epmet-module/resi-partymember/resi-partymember-server/src/main/java/com/epmet/modules/partyOrg/service/impl/IcScheduleServiceImpl.java
  6. 40
      epmet-module/resi-partymember/resi-partymember-server/src/main/resources/mapper/partyOrg/IcScheduleDao.xml

38
epmet-module/resi-partymember/resi-partymember-client/src/main/java/com/epmet/resi/partymember/dto/partyOrg/form/IcScheduleFormDTO.java

@ -0,0 +1,38 @@
package com.epmet.resi.partymember.dto.partyOrg.form;
import com.epmet.commons.tools.validator.group.AddGroup;
import com.epmet.commons.tools.validator.group.UpdateGroup;
import lombok.Data;
import javax.validation.constraints.NotBlank;
import java.io.Serializable;
@Data
public class IcScheduleFormDTO implements Serializable {
/**
* 日程标题
*/
private String title;
/**
* 是否公开0仅自己可见1组织内其他人可见
*/
private String isPublic;
/**
* 提醒开始时间
*/
private String startTime;
/**
* 提醒结束时间
*/
private String endTime;
private Integer pageNo = 1;
private Integer pageSize = 20;
private Boolean isPage = true;
private String agencyId;
//token中信息
private String customerId;
private String staffId;
}

11
epmet-module/resi-partymember/resi-partymember-server/src/main/java/com/epmet/modules/partyOrg/controller/IcScheduleController.java

@ -13,6 +13,8 @@ import com.epmet.commons.tools.validator.group.UpdateGroup;
import com.epmet.modules.partyOrg.service.IcScheduleService;
import com.epmet.resi.partymember.dto.IcScheduleDTO;
import com.epmet.resi.partymember.dto.partyOrg.form.AddOrEditScheduleFormDTO;
import com.epmet.resi.partymember.dto.partyOrg.form.IcScheduleFormDTO;
import org.apache.poi.ss.formula.functions.T;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;
@ -33,10 +35,11 @@ public class IcScheduleController {
@Autowired
private IcScheduleService icScheduleService;
@RequestMapping("page")
public Result<PageData<IcScheduleDTO>> page(@RequestParam Map<String, Object> params){
PageData<IcScheduleDTO> page = icScheduleService.page(params);
return new Result<PageData<IcScheduleDTO>>().ok(page);
@RequestMapping("list")
public Result<PageData<IcScheduleDTO>> list(@LoginUser TokenDto tokenDto, @RequestParam IcScheduleFormDTO formDTO){
formDTO.setCustomerId(tokenDto.getCustomerId());
formDTO.setStaffId(tokenDto.getUserId());
return new Result<PageData<IcScheduleDTO>>().ok(icScheduleService.list(formDTO));
}
@RequestMapping(value = "{id}",method = {RequestMethod.POST,RequestMethod.GET})

3
epmet-module/resi-partymember/resi-partymember-server/src/main/java/com/epmet/modules/partyOrg/dao/IcScheduleDao.java

@ -2,9 +2,11 @@ package com.epmet.modules.partyOrg.dao;
import com.epmet.commons.mybatis.dao.BaseDao;
import com.epmet.modules.partyOrg.entity.IcScheduleEntity;
import com.epmet.resi.partymember.dto.IcScheduleDTO;
import com.epmet.resi.partymember.dto.partyOrg.form.ActAndScheduleListFormDTO;
import com.epmet.resi.partymember.dto.partyOrg.form.AddOrEditScheduleFormDTO;
import com.epmet.resi.partymember.dto.partyOrg.form.HomeMonthTotalFormDTO;
import com.epmet.resi.partymember.dto.partyOrg.form.IcScheduleFormDTO;
import com.epmet.resi.partymember.dto.partyOrg.result.ActAndScheduleListResultDTO;
import com.epmet.resi.partymember.dto.partyOrg.result.HomeMonthTotalResultDTO;
import org.apache.ibatis.annotations.Mapper;
@ -26,4 +28,5 @@ public interface IcScheduleDao extends BaseDao<IcScheduleEntity> {
List<ActAndScheduleListResultDTO.ScheduleListDTO> getScheduleList(ActAndScheduleListFormDTO formDTO);
List<IcScheduleDTO> selectScheduleList(IcScheduleFormDTO formDTO);
}

17
epmet-module/resi-partymember/resi-partymember-server/src/main/java/com/epmet/modules/partyOrg/service/IcScheduleService.java

@ -3,8 +3,11 @@ package com.epmet.modules.partyOrg.service;
import com.epmet.commons.mybatis.service.BaseService;
import com.epmet.commons.tools.page.PageData;
import com.epmet.modules.partyOrg.entity.IcScheduleEntity;
import com.epmet.resi.partymember.dto.IcPartyActSignInRecordDTO;
import com.epmet.resi.partymember.dto.IcScheduleDTO;
import com.epmet.resi.partymember.dto.partyOrg.form.AddOrEditScheduleFormDTO;
import com.epmet.resi.partymember.dto.partyOrg.form.IcScheduleFormDTO;
import com.epmet.resi.partymember.dto.partyOrg.form.PartyActSignFormDTO;
import java.util.List;
import java.util.Map;
@ -17,25 +20,15 @@ import java.util.Map;
*/
public interface IcScheduleService extends BaseService<IcScheduleEntity> {
/**
* 默认分页
*
* @param params
* @return PageData<IcScheduleDTO>
* @author generator
* @date 2022-08-18
*/
PageData<IcScheduleDTO> page(Map<String, Object> params);
/**
* 默认查询
*
* @param params
* @param formDTO
* @return java.util.List<IcScheduleDTO>
* @author generator
* @date 2022-08-18
*/
List<IcScheduleDTO> list(Map<String, Object> params);
PageData<IcScheduleDTO> list(IcScheduleFormDTO formDTO);
/**
* 单条查询

27
epmet-module/resi-partymember/resi-partymember-server/src/main/java/com/epmet/modules/partyOrg/service/impl/IcScheduleServiceImpl.java

@ -18,9 +18,14 @@ import com.epmet.feign.EpmetMessageOpenFeignClient;
import com.epmet.modules.partyOrg.dao.IcScheduleDao;
import com.epmet.modules.partyOrg.entity.IcScheduleEntity;
import com.epmet.modules.partyOrg.service.IcScheduleService;
import com.epmet.resi.partymember.dto.IcPartyActSignInRecordDTO;
import com.epmet.resi.partymember.dto.IcScheduleDTO;
import com.epmet.resi.partymember.dto.partyOrg.form.AddOrEditScheduleFormDTO;
import com.epmet.resi.partymember.dto.partyOrg.form.IcScheduleFormDTO;
import com.epmet.resi.partymember.dto.partyOrg.form.PartyActSignFormDTO;
import com.epmet.send.SendMqMsgUtil;
import com.github.pagehelper.PageHelper;
import com.github.pagehelper.PageInfo;
import org.apache.commons.collections4.CollectionUtils;
import org.apache.commons.lang3.StringUtils;
import org.springframework.stereotype.Service;
@ -39,20 +44,20 @@ import java.util.Map;
@Service
public class IcScheduleServiceImpl extends BaseServiceImpl<IcScheduleDao, IcScheduleEntity> implements IcScheduleService {
@Override
public PageData<IcScheduleDTO> page(Map<String, Object> params) {
IPage<IcScheduleEntity> page = baseDao.selectPage(
getPage(params, FieldConstant.CREATED_TIME, false),
getWrapper(params)
);
return getPageData(page, IcScheduleDTO.class);
}
@Override
public List<IcScheduleDTO> list(Map<String, Object> params) {
List<IcScheduleEntity> entityList = baseDao.selectList(getWrapper(params));
public PageData<IcScheduleDTO> list(IcScheduleFormDTO formDTO) {
PageHelper.startPage(formDTO.getPageNo(), formDTO.getPageSize(), formDTO.getIsPage());
//获取工作人员所属组织信息
CustomerStaffInfoCacheResult staffInfo = CustomerStaffRedis.getStaffInfo(formDTO.getCustomerId(), formDTO.getStaffId());
if (null == staffInfo) {
throw new EpmetException(String.format("查询工作人员%s缓存信息失败...", formDTO.getStaffId()));
}
formDTO.setAgencyId(staffInfo.getAgencyId());
return ConvertUtils.sourceToTarget(entityList, IcScheduleDTO.class);
List<IcScheduleDTO> list = baseDao.selectScheduleList(formDTO);
PageInfo<IcScheduleDTO> pageInfo = new PageInfo<>(list);
return new PageData<>(list, pageInfo.getTotal());
}
private QueryWrapper<IcScheduleEntity> getWrapper(Map<String, Object> params){

40
epmet-module/resi-partymember/resi-partymember-server/src/main/resources/mapper/partyOrg/IcScheduleDao.xml

@ -68,4 +68,44 @@
AND (IS_PUBLIC = '1' OR (STAFF_ID = #{staffId} AND IS_PUBLIC = '0'))
order by REMIND_TIME desc
</select>
<select id="selectScheduleList" resultType="com.epmet.resi.partymember.dto.IcScheduleDTO">
SELECT
id,
customer_id,
staff_id,
title,
remind_time,
is_public,
remark,
created_time
FROM
ic_schedule
WHERE
del_flag = '0'
AND customer_id = #{customerId}
AND org_id_path LIKE CONCAT('%',#{agencyId},'%')
<if test="title != null and title.trim() != ''">
AND title like concat('%', #{title}, '%')
</if>
<if test='null != startTime and startTime != ""'>
AND DATE_FORMAT(remind_time,'%Y%m%d') >= #{startTime}
</if>
<if test='null != endTime and endTime != ""'>
AND DATE_FORMAT(remind_time,'%Y%m%d') <![CDATA[ <= ]]> #{endTime}
</if>
<choose>
<when test='isPublic == "0"'>
AND staff_id = #{staffId} AND is_public = #{isPublic}
</when>
<when test='isPublic == "1"'>
AND is_public = #{isPublic}
</when>
<otherwise>
AND (is_public = '1' OR (staff_id = #{staffId} AND is_public = '0'))
</otherwise>
</choose>
order by remind_time desc
</select>
</mapper>
Loading…
Cancel
Save