|
@ -34,10 +34,13 @@ 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; |
|
|
import com.epmet.constant.PartyServiceCenterConstant; |
|
|
import com.epmet.constant.PartyServiceCenterConstant; |
|
|
|
|
|
import com.epmet.dao.IcMatterAppointmentRecordDao; |
|
|
import com.epmet.dao.IcPartyServiceCenterDao; |
|
|
import com.epmet.dao.IcPartyServiceCenterDao; |
|
|
import com.epmet.dto.IcPartyServiceCenterDTO; |
|
|
import com.epmet.dto.IcPartyServiceCenterDTO; |
|
|
import com.epmet.dto.form.AddPartyServiceCenterFormDTO; |
|
|
import com.epmet.dto.form.AddPartyServiceCenterFormDTO; |
|
|
|
|
|
import com.epmet.dto.form.DelMatterFormDTO; |
|
|
import com.epmet.dto.form.EditPartyServiceCenterFormDTO; |
|
|
import com.epmet.dto.form.EditPartyServiceCenterFormDTO; |
|
|
|
|
|
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; |
|
|
import com.epmet.service.IcPartyServiceCenterMatterService; |
|
|
import com.epmet.service.IcPartyServiceCenterMatterService; |
|
@ -48,6 +51,7 @@ import org.springframework.beans.factory.annotation.Autowired; |
|
|
import org.springframework.stereotype.Service; |
|
|
import org.springframework.stereotype.Service; |
|
|
import org.springframework.transaction.annotation.Transactional; |
|
|
import org.springframework.transaction.annotation.Transactional; |
|
|
|
|
|
|
|
|
|
|
|
import java.time.LocalDate; |
|
|
import java.util.Arrays; |
|
|
import java.util.Arrays; |
|
|
import java.util.List; |
|
|
import java.util.List; |
|
|
import java.util.Map; |
|
|
import java.util.Map; |
|
@ -63,6 +67,8 @@ public class IcPartyServiceCenterServiceImpl extends BaseServiceImpl<IcPartyServ |
|
|
|
|
|
|
|
|
@Autowired |
|
|
@Autowired |
|
|
private IcPartyServiceCenterMatterService matterService; |
|
|
private IcPartyServiceCenterMatterService matterService; |
|
|
|
|
|
@Autowired |
|
|
|
|
|
private IcMatterAppointmentRecordDao matterAppointmentRecordDao; |
|
|
|
|
|
|
|
|
@Override |
|
|
@Override |
|
|
public PageData<IcPartyServiceCenterDTO> page(Map<String, Object> params) { |
|
|
public PageData<IcPartyServiceCenterDTO> page(Map<String, Object> params) { |
|
@ -161,6 +167,7 @@ public class IcPartyServiceCenterServiceImpl extends BaseServiceImpl<IcPartyServ |
|
|
|
|
|
|
|
|
/** |
|
|
/** |
|
|
* @Description 修改党群服务中心 |
|
|
* @Description 修改党群服务中心 |
|
|
|
|
|
* 事项只准删除,不准修改 |
|
|
* @param formDTO |
|
|
* @param formDTO |
|
|
* @param tokenDto |
|
|
* @param tokenDto |
|
|
* @author zxc |
|
|
* @author zxc |
|
@ -180,7 +187,6 @@ public class IcPartyServiceCenterServiceImpl extends BaseServiceImpl<IcPartyServ |
|
|
IcPartyServiceCenterEntity centerEntity = ConvertUtils.sourceToTarget(formDTO, IcPartyServiceCenterEntity.class); |
|
|
IcPartyServiceCenterEntity centerEntity = ConvertUtils.sourceToTarget(formDTO, IcPartyServiceCenterEntity.class); |
|
|
centerEntity.setId(formDTO.getPartyServiceCenterId()); |
|
|
centerEntity.setId(formDTO.getPartyServiceCenterId()); |
|
|
baseDao.updateById(centerEntity); |
|
|
baseDao.updateById(centerEntity); |
|
|
matterService.deleteMattersByPartyServiceCenterId(formDTO.getPartyServiceCenterId()); |
|
|
|
|
|
if (CollectionUtils.isNotEmpty(formDTO.getMatterList())){ |
|
|
if (CollectionUtils.isNotEmpty(formDTO.getMatterList())){ |
|
|
List<IcPartyServiceCenterMatterEntity> matters = ConvertUtils.sourceToTarget(formDTO.getMatterList(), IcPartyServiceCenterMatterEntity.class); |
|
|
List<IcPartyServiceCenterMatterEntity> matters = ConvertUtils.sourceToTarget(formDTO.getMatterList(), IcPartyServiceCenterMatterEntity.class); |
|
|
matters.forEach(m -> { |
|
|
matters.forEach(m -> { |
|
@ -191,4 +197,23 @@ public class IcPartyServiceCenterServiceImpl extends BaseServiceImpl<IcPartyServ |
|
|
} |
|
|
} |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
/** |
|
|
|
|
|
* @Description 事项删除 |
|
|
|
|
|
* @param formDTO |
|
|
|
|
|
* @author zxc |
|
|
|
|
|
* @date 2021/11/22 1:25 下午 |
|
|
|
|
|
*/ |
|
|
|
|
|
@Override |
|
|
|
|
|
public void delMatter(DelMatterFormDTO formDTO) { |
|
|
|
|
|
LambdaQueryWrapper<IcMatterAppointmentRecordEntity> re = new LambdaQueryWrapper<>(); |
|
|
|
|
|
re.eq(BaseEpmetEntity::getDelFlag,NumConstant.ZERO). |
|
|
|
|
|
eq(IcMatterAppointmentRecordEntity::getMatterId,formDTO.getMatterId()). |
|
|
|
|
|
ge(IcMatterAppointmentRecordEntity::getAppointmentDate, LocalDate.now()); |
|
|
|
|
|
List<IcMatterAppointmentRecordEntity> appointmentRecords = matterAppointmentRecordDao.selectList(re); |
|
|
|
|
|
if (CollectionUtils.isNotEmpty(appointmentRecords)){ |
|
|
|
|
|
throw new RenException(EpmetErrorCode.MATTER_EXISTS_APPOINTMENT_ERROR.getCode()); |
|
|
|
|
|
} |
|
|
|
|
|
matterService.deleteById(formDTO.getMatterId()); |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
} |
|
|
} |