Browse Source

修改

dev_shibei_match
zxc 4 years ago
parent
commit
1a80dc2dbf
  1. 2
      epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/exception/EpmetErrorCode.java
  2. 7
      epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/form/EditPartyServiceCenterFormDTO.java
  3. 28
      epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/result/AppointmentExistRecordResultDTO.java
  4. 9
      epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/dao/IcMatterAppointmentRecordDao.java
  5. 19
      epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/impl/IcPartyServiceCenterServiceImpl.java
  6. 16
      epmet-module/gov-org/gov-org-server/src/main/resources/mapper/IcMatterAppointmentRecordDao.xml

2
epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/exception/EpmetErrorCode.java

@ -153,6 +153,8 @@ public enum EpmetErrorCode {
// 预约某事项在某时间段存在记录时
APPOINTMENT_TIME_ERROR(8527, "该时间段已被预约,请选择其他时间段"),
APPOINTMENT_ERROR(8528, "%s尚有未履行的预约存在,请确认后操作"),
// 该错误不会提示给前端,只是后端传输错误信息用。
ACCESS_SQL_FILTER_MISSION_ARGS(8701, "缺少生成权限过滤SQL所需参数"),
OPER_ADD_CUSTOMER_ROOT_AGENCY_ERROR(8702, "添加客户根级组织失败"),

7
epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/form/EditPartyServiceCenterFormDTO.java

@ -80,7 +80,12 @@ public class EditPartyServiceCenterFormDTO implements Serializable {
private String partyServiceCenterId;
/**
* 可预约事项
* 新增的可预约事项
*/
private List<IcPartyServiceCenterMatterDTO> matterList;
/**
* 要删除的事项
*/
private List<String> delMatterList;
}

28
epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/result/AppointmentExistRecordResultDTO.java

@ -0,0 +1,28 @@
package com.epmet.dto.result;
import com.epmet.commons.tools.constant.NumConstant;
import com.fasterxml.jackson.annotation.JsonIgnore;
import lombok.Data;
import java.io.Serializable;
import java.util.ArrayList;
import java.util.List;
/**
* @Author zxc
* @DateTime 2021/11/23 10:45 上午
* @DESC
*/
@Data
public class AppointmentExistRecordResultDTO implements Serializable {
private static final long serialVersionUID = 6651436509788141940L;
/**
* 事项名
*/
private String matterName;
private String matterId;
}

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

@ -18,6 +18,7 @@
package com.epmet.dao;
import com.epmet.commons.mybatis.dao.BaseDao;
import com.epmet.dto.result.AppointmentExistRecordResultDTO;
import com.epmet.dto.result.AppointmentRecordResultDTO;
import com.epmet.entity.IcMatterAppointmentRecordEntity;
import org.apache.ibatis.annotations.Mapper;
@ -43,4 +44,12 @@ public interface IcMatterAppointmentRecordDao extends BaseDao<IcMatterAppointmen
*/
List<AppointmentRecordResultDTO> appointmentRecord(@Param("matterId")String matterId,@Param("date")String date);
/**
* @Description 查询事项是不是存在预约记录
* @param matterIds
* @author zxc
* @date 2021/11/23 3:48 下午
*/
List<AppointmentExistRecordResultDTO> appointmentExistRecord(@Param("matterIds")List<String> matterIds);
}

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

@ -39,6 +39,7 @@ import com.epmet.dao.IcPartyServiceCenterDao;
import com.epmet.dto.IcPartyServiceCenterDTO;
import com.epmet.dto.TimeDTO;
import com.epmet.dto.form.*;
import com.epmet.dto.result.AppointmentExistRecordResultDTO;
import com.epmet.dto.result.AppointmentRecordResultDTO;
import com.epmet.dto.result.AppointmentTimeResultDTO;
import com.epmet.dto.result.PartyServiceCenterListResultDTO;
@ -200,6 +201,22 @@ public class IcPartyServiceCenterServiceImpl extends BaseServiceImpl<IcPartyServ
});
matterService.insertBatch(matters);
}
// del matter
if (CollectionUtils.isNotEmpty(formDTO.getDelMatterList())){
List<String> delMatterList = formDTO.getDelMatterList();
List<AppointmentExistRecordResultDTO> existRecord = matterAppointmentRecordDao.appointmentExistRecord(delMatterList);
if (CollectionUtils.isNotEmpty(existRecord)){
StringBuffer sb = new StringBuffer();
existRecord.forEach(e -> {
sb.append(e.getMatterName()).append(",");
});
String copywriter = sb.toString().substring(NumConstant.ZERO, sb.length() - NumConstant.ONE);
EpmetErrorCode.APPOINTMENT_ERROR.setMsg(String.format(EpmetErrorCode.APPOINTMENT_ERROR.getMsg(),copywriter));
throw new RenException(EpmetErrorCode.APPOINTMENT_ERROR.getCode());
}else {
matterService.deleteBatchIds(delMatterList);
}
}
}
/**
@ -242,7 +259,7 @@ public class IcPartyServiceCenterServiceImpl extends BaseServiceImpl<IcPartyServ
records.forEach(r -> {
timeIds.addAll(Arrays.asList(r.getTimeId().split(",")));
});
if (timeIds.retainAll(Arrays.asList(formDTO.getTimeId().split(",")))){
if (timeIds.containsAll(Arrays.asList(formDTO.getTimeId().split(",")))){
throw new RenException(EpmetErrorCode.APPOINTMENT_TIME_ERROR.getCode());
}
}

16
epmet-module/gov-org/gov-org-server/src/main/resources/mapper/IcMatterAppointmentRecordDao.xml

@ -18,4 +18,20 @@
AND ar.APPOINTMENT_DATE = #{date}
AND ar.`STATUS` = 'appointing'
</select>
<!-- 查询事项是不是存在预约记录 -->
<select id="appointmentExistRecord" resultType="com.epmet.dto.result.AppointmentExistRecordResultDTO">
SELECT
cm.MATTER_NAME,
cm.id AS matterId
FROM ic_matter_appointment_record ar
LEFT JOIN ic_party_service_center_matter cm ON (cm.ID = ar.MATTER_ID AND cm.DEL_FLAG = 0)
WHERE ar.DEL_FLAG = 0
AND ar.`STATUS` = 'appointing'
AND ar.MATTER_ID IN
<foreach collection="matterIds" item="m" separator="," open="(" close=")">
#{m}
</foreach>
GROUP BY matterId
</select>
</mapper>
Loading…
Cancel
Save