Browse Source

党群服务中心修改

master
zxc 4 years ago
parent
commit
671d4c77c7
  1. 5
      epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/IcPartyServiceCenterMatterDTO.java
  2. 3
      epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/MatterListDTO.java
  3. 22
      epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/form/AllMattersFormDTO.java
  4. 43
      epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/result/AllMattersResultDTO.java
  5. 14
      epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/controller/IcPartyServiceCenterController.java
  6. 9
      epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/dao/IcPartyServiceCenterDao.java
  7. 5
      epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/entity/IcPartyServiceCenterMatterEntity.java
  8. 9
      epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/IcPartyServiceCenterService.java
  9. 32
      epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/impl/IcPartyServiceCenterServiceImpl.java
  10. 1
      epmet-module/gov-org/gov-org-server/src/main/resources/db/migration/V0.0.10__add_matter_img.sql
  11. 21
      epmet-module/gov-org/gov-org-server/src/main/resources/mapper/IcPartyServiceCenterDao.xml

5
epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/IcPartyServiceCenterMatterDTO.java

@ -98,4 +98,9 @@ public class IcPartyServiceCenterMatterDTO implements Serializable {
*/ */
private String customerId; private String customerId;
/**
* 封面图
*/
private String matterImg;
} }

3
epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/MatterListDTO.java

@ -38,10 +38,13 @@ public class MatterListDTO implements Serializable {
private String appointmentType; private String appointmentType;
private String matterImg;
public MatterListDTO() { public MatterListDTO() {
this.sort = NumConstant.ZERO; this.sort = NumConstant.ZERO;
this.matterName = ""; this.matterName = "";
this.matterId = ""; this.matterId = "";
this.allowTime = ""; this.allowTime = "";
this.matterImg = "";
} }
} }

22
epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/form/AllMattersFormDTO.java

@ -0,0 +1,22 @@
package com.epmet.dto.form;
import lombok.Data;
import javax.validation.constraints.NotBlank;
import java.io.Serializable;
/**
* @Author zxc
* @DateTime 2021/12/20 1:50 下午
* @DESC
*/
@Data
public class AllMattersFormDTO implements Serializable {
private static final long serialVersionUID = 5292223887794821327L;
public interface AllMattersForm{}
@NotBlank(message = "gridId不能为空",groups = AllMattersForm.class)
private String gridId;
}

43
epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/result/AllMattersResultDTO.java

@ -0,0 +1,43 @@
package com.epmet.dto.result;
import lombok.Data;
import java.io.Serializable;
/**
* @Author zxc
* @DateTime 2021/12/20 1:51 下午
* @DESC
*/
@Data
public class AllMattersResultDTO implements Serializable {
private static final long serialVersionUID = -2859875516671396422L;
/**
* 可预约事项名字
*/
private String matterName;
/**
* 可预约时间
*/
private String allowTime;
/**
* 可预约事项ID
*/
private String matterId;
/**
* 事项封面图
*/
private String matterImg;
public AllMattersResultDTO() {
this.matterName = "";
this.allowTime = "";
this.matterId = "";
this.matterImg = "";
}
}

14
epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/controller/IcPartyServiceCenterController.java

@ -30,6 +30,7 @@ import com.epmet.commons.tools.validator.group.UpdateGroup;
import com.epmet.commons.tools.validator.group.DefaultGroup; import com.epmet.commons.tools.validator.group.DefaultGroup;
import com.epmet.dto.IcPartyServiceCenterDTO; import com.epmet.dto.IcPartyServiceCenterDTO;
import com.epmet.dto.form.*; import com.epmet.dto.form.*;
import com.epmet.dto.result.AllMattersResultDTO;
import com.epmet.dto.result.AppointmentRecordResultDTO; import com.epmet.dto.result.AppointmentRecordResultDTO;
import com.epmet.dto.result.AppointmentTimeResultDTO; import com.epmet.dto.result.AppointmentTimeResultDTO;
import com.epmet.dto.result.PartyServiceCenterListResultDTO; import com.epmet.dto.result.PartyServiceCenterListResultDTO;
@ -204,4 +205,17 @@ public class IcPartyServiceCenterController {
return new Result(); return new Result();
} }
/**
* @Description 网格所属组织下所有可预约事项
* @param formDTO
* @author zxc
* @date 2021/12/20 3:17 下午
*/
@PostMapping("getallmatters")
public Result<List<AllMattersResultDTO>> getAllMatters(@RequestBody AllMattersFormDTO formDTO){
ValidatorUtils.validateEntity(formDTO, AllMattersFormDTO.AllMattersForm.class);
return new Result<List<AllMattersResultDTO>>().ok(icPartyServiceCenterService.getAllMatters(formDTO));
}
} }

9
epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/dao/IcPartyServiceCenterDao.java

@ -18,6 +18,7 @@
package com.epmet.dao; package com.epmet.dao;
import com.epmet.commons.mybatis.dao.BaseDao; import com.epmet.commons.mybatis.dao.BaseDao;
import com.epmet.dto.result.AllMattersResultDTO;
import com.epmet.dto.result.PartyServiceCenterListResultDTO; import com.epmet.dto.result.PartyServiceCenterListResultDTO;
import com.epmet.entity.IcPartyServiceCenterEntity; import com.epmet.entity.IcPartyServiceCenterEntity;
import org.apache.ibatis.annotations.Mapper; import org.apache.ibatis.annotations.Mapper;
@ -42,4 +43,12 @@ public interface IcPartyServiceCenterDao extends BaseDao<IcPartyServiceCenterEnt
*/ */
List<PartyServiceCenterListResultDTO> partyServiceCenterList(@Param("orgId")String orgId); List<PartyServiceCenterListResultDTO> partyServiceCenterList(@Param("orgId")String orgId);
/**
* @Description 获取网格所属组织下所有的可预约事项
* @param orgId
* @author zxc
* @date 2021/12/21 1:59 下午
*/
List<AllMattersResultDTO> getAllMatters(@Param("orgId")String orgId);
} }

5
epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/entity/IcPartyServiceCenterMatterEntity.java

@ -68,4 +68,9 @@ public class IcPartyServiceCenterMatterEntity extends BaseEpmetEntity {
*/ */
private String customerId; private String customerId;
/**
* 封面图
*/
private String matterImg;
} }

9
epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/IcPartyServiceCenterService.java

@ -22,6 +22,7 @@ import com.epmet.commons.tools.page.PageData;
import com.epmet.commons.tools.security.dto.TokenDto; import com.epmet.commons.tools.security.dto.TokenDto;
import com.epmet.dto.IcPartyServiceCenterDTO; import com.epmet.dto.IcPartyServiceCenterDTO;
import com.epmet.dto.form.*; import com.epmet.dto.form.*;
import com.epmet.dto.result.AllMattersResultDTO;
import com.epmet.dto.result.AppointmentRecordResultDTO; import com.epmet.dto.result.AppointmentRecordResultDTO;
import com.epmet.dto.result.AppointmentTimeResultDTO; import com.epmet.dto.result.AppointmentTimeResultDTO;
import com.epmet.dto.result.PartyServiceCenterListResultDTO; import com.epmet.dto.result.PartyServiceCenterListResultDTO;
@ -166,4 +167,12 @@ public interface IcPartyServiceCenterService extends BaseService<IcPartyServiceC
*/ */
void cancelAppointment(CancelAppointmentFormDTO formDTO); void cancelAppointment(CancelAppointmentFormDTO formDTO);
/**
* @Description 网格所属组织下所有可预约事项
* @param formDTO
* @author zxc
* @date 2021/12/20 3:17 下午
*/
List<AllMattersResultDTO> getAllMatters(AllMattersFormDTO formDTO);
} }

32
epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/impl/IcPartyServiceCenterServiceImpl.java

@ -31,6 +31,7 @@ import com.epmet.commons.tools.page.PageData;
import com.epmet.commons.tools.redis.common.CustomerOrgRedis; import com.epmet.commons.tools.redis.common.CustomerOrgRedis;
import com.epmet.commons.tools.redis.common.CustomerStaffRedis; import com.epmet.commons.tools.redis.common.CustomerStaffRedis;
import com.epmet.commons.tools.redis.common.bean.AgencyInfoCache; import com.epmet.commons.tools.redis.common.bean.AgencyInfoCache;
import com.epmet.commons.tools.redis.common.bean.GridInfoCache;
import com.epmet.commons.tools.security.dto.TokenDto; import com.epmet.commons.tools.security.dto.TokenDto;
import com.epmet.commons.tools.utils.ConvertUtils; import com.epmet.commons.tools.utils.ConvertUtils;
import com.epmet.commons.tools.constant.FieldConstant; import com.epmet.commons.tools.constant.FieldConstant;
@ -40,10 +41,7 @@ import com.epmet.dao.IcPartyServiceCenterDao;
import com.epmet.dto.IcPartyServiceCenterDTO; import com.epmet.dto.IcPartyServiceCenterDTO;
import com.epmet.dto.TimeDTO; import com.epmet.dto.TimeDTO;
import com.epmet.dto.form.*; import com.epmet.dto.form.*;
import com.epmet.dto.result.AppointmentExistRecordResultDTO; import com.epmet.dto.result.*;
import com.epmet.dto.result.AppointmentRecordResultDTO;
import com.epmet.dto.result.AppointmentTimeResultDTO;
import com.epmet.dto.result.PartyServiceCenterListResultDTO;
import com.epmet.entity.IcMatterAppointmentRecordEntity; import com.epmet.entity.IcMatterAppointmentRecordEntity;
import com.epmet.entity.IcPartyServiceCenterEntity; import com.epmet.entity.IcPartyServiceCenterEntity;
import com.epmet.entity.IcPartyServiceCenterMatterEntity; import com.epmet.entity.IcPartyServiceCenterMatterEntity;
@ -326,6 +324,13 @@ public class IcPartyServiceCenterServiceImpl extends BaseServiceImpl<IcPartyServ
} }
formDTO.setOrgId(staffInfo.getAgencyId()); formDTO.setOrgId(staffInfo.getAgencyId());
} }
if (StringUtils.isNotBlank(formDTO.getOrgType()) && formDTO.getOrgType().equals("grid")){
GridInfoCache gridInfo = CustomerOrgRedis.getGridInfo(formDTO.getOrgId());
if (null == gridInfo){
throw new EpmetException(String.format("未查询到网格{%s}信息",formDTO.getOrgId()));
}
formDTO.setOrgId(gridInfo.getPid());
}
List<PartyServiceCenterListResultDTO> result = baseDao.partyServiceCenterList(formDTO.getOrgId()); List<PartyServiceCenterListResultDTO> result = baseDao.partyServiceCenterList(formDTO.getOrgId());
if (CollectionUtils.isNotEmpty(result)){ if (CollectionUtils.isNotEmpty(result)){
result.forEach(r -> { result.forEach(r -> {
@ -435,6 +440,25 @@ public class IcPartyServiceCenterServiceImpl extends BaseServiceImpl<IcPartyServ
matterAppointmentRecordDao.cancelAppointment(formDTO.getRecordId(), formDTO.getUserId()); matterAppointmentRecordDao.cancelAppointment(formDTO.getRecordId(), formDTO.getUserId());
} }
/**
* @Description 网格所属组织下所有可预约事项
* @param formDTO
* @author zxc
* @date 2021/12/20 3:17 下午
*/
@Override
public List<AllMattersResultDTO> getAllMatters(AllMattersFormDTO formDTO) {
GridInfoCache gridInfo = CustomerOrgRedis.getGridInfo(formDTO.getGridId());
if (null == gridInfo){
throw new EpmetException(String.format("未查询到网格{%s}信息",formDTO.getGridId()));
}
List<AllMattersResultDTO> allMatters = baseDao.getAllMatters(gridInfo.getPid());
if (CollectionUtils.isNotEmpty(allMatters)){
return allMatters;
}
return new ArrayList<>();
}
public List<TimeDTO> getTimeList(String start,String end,Integer interval){ public List<TimeDTO> getTimeList(String start,String end,Integer interval){
List<TimeDTO> result = new ArrayList<>(); List<TimeDTO> result = new ArrayList<>();
List<String> intervalTimeList = getIntervalTimeList(start, end, interval); List<String> intervalTimeList = getIntervalTimeList(start, end, interval);

1
epmet-module/gov-org/gov-org-server/src/main/resources/db/migration/V0.0.10__add_matter_img.sql

@ -0,0 +1 @@
alter table ic_party_service_center_matter add COLUMN MATTER_IMG VARCHAR(256) NOT NULL comment '封面图' AFTER END_TIME;

21
epmet-module/gov-org/gov-org-server/src/main/resources/mapper/IcPartyServiceCenterDao.xml

@ -22,6 +22,7 @@
<result property="endTime" column="endTime"/> <result property="endTime" column="endTime"/>
<result property="appointmentType" column="appointmentType"/> <result property="appointmentType" column="appointmentType"/>
<result property="sort" column="sort"/> <result property="sort" column="sort"/>
<result property="matterImg" column="matterImg"/>
</collection> </collection>
</resultMap> </resultMap>
<select id="partyServiceCenterList" resultMap="partyServiceCenterListMap"> <select id="partyServiceCenterList" resultMap="partyServiceCenterListMap">
@ -44,11 +45,29 @@
case when cm.APPOINTMENT_TYPE = 'everyDay' THEN CONCAT('每天',' ', cm.START_TIME,'-',cm.END_TIME) case when cm.APPOINTMENT_TYPE = 'everyDay' THEN CONCAT('每天',' ', cm.START_TIME,'-',cm.END_TIME)
when cm.APPOINTMENT_TYPE = 'workDay' THEN CONCAT('工作日',' ', cm.START_TIME,'-',cm.END_TIME) when cm.APPOINTMENT_TYPE = 'workDay' THEN CONCAT('工作日',' ', cm.START_TIME,'-',cm.END_TIME)
when cm.APPOINTMENT_TYPE = 'weekend' THEN CONCAT('周末',' ', cm.START_TIME,'-',cm.END_TIME) when cm.APPOINTMENT_TYPE = 'weekend' THEN CONCAT('周末',' ', cm.START_TIME,'-',cm.END_TIME)
ELSE CONCAT(cm.START_TIME,'-',cm.END_TIME) END AS allowTime ELSE CONCAT(cm.START_TIME,'-',cm.END_TIME) END AS allowTime,
IFNULL(cm.MATTER_IMG,'') AS matterImg
FROM ic_party_service_center sc FROM ic_party_service_center sc
LEFT JOIN ic_party_service_center_matter cm ON (cm.PARTY_SERVICE_CENTER_ID = sc.ID AND cm.DEL_FLAG = 0) LEFT JOIN ic_party_service_center_matter cm ON (cm.PARTY_SERVICE_CENTER_ID = sc.ID AND cm.DEL_FLAG = 0)
WHERE sc.DEL_FLAG = 0 WHERE sc.DEL_FLAG = 0
AND ORG_ID = #{orgId} AND ORG_ID = #{orgId}
ORDER BY sc.CREATED_TIME DESC ORDER BY sc.CREATED_TIME DESC
</select> </select>
<!-- 获取网格所属组织下所有的可预约事项 -->
<select id="getAllMatters" resultType="com.epmet.dto.result.AllMattersResultDTO">
SELECT
cm.MATTER_NAME AS matterName,
cm.ID AS matterId,
cm.APPOINTMENT_TYPE AS appointmentType,
case when cm.APPOINTMENT_TYPE = 'everyDay' THEN CONCAT('每天',' ', cm.START_TIME,'-',cm.END_TIME)
when cm.APPOINTMENT_TYPE = 'workDay' THEN CONCAT('工作日',' ', cm.START_TIME,'-',cm.END_TIME)
when cm.APPOINTMENT_TYPE = 'weekend' THEN CONCAT('周末',' ', cm.START_TIME,'-',cm.END_TIME)
ELSE CONCAT(cm.START_TIME,'-',cm.END_TIME) END AS allowTime,
IFNULL(cm.MATTER_IMG,'') AS matterImg
FROM ic_party_service_center c
INNER JOIN ic_party_service_center_matter cm ON (cm.PARTY_SERVICE_CENTER_ID = c.ID AND cm.DEL_FLAG = 0)
AND c.DEL_FLAG = 0
AND c.ORG_ID = #{orgId}
</select>
</mapper> </mapper>
Loading…
Cancel
Save