Browse Source

edit

master
zxc 4 years ago
parent
commit
51876107d4
  1. 1
      epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/impl/IcCommunitySelfOrganizationPersonnelServiceImpl.java
  2. 86
      epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/form/EditPartyServiceCenterFormDTO.java
  3. 15
      epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/controller/IcPartyServiceCenterController.java
  4. 9
      epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/dao/IcPartyServiceCenterMatterDao.java
  5. 8
      epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/IcPartyServiceCenterMatterService.java
  6. 11
      epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/IcPartyServiceCenterService.java
  7. 12
      epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/impl/IcPartyServiceCenterMatterServiceImpl.java
  8. 33
      epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/impl/IcPartyServiceCenterServiceImpl.java
  9. 7
      epmet-module/gov-org/gov-org-server/src/main/resources/mapper/IcPartyServiceCenterMatterDao.xml

1
epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/impl/IcCommunitySelfOrganizationPersonnelServiceImpl.java

@ -103,6 +103,7 @@ public class IcCommunitySelfOrganizationPersonnelServiceImpl extends BaseService
* @author zxc
* @date 2021/11/19 11:19 上午
*/
@Transactional(rollbackFor = Exception.class)
@Override
public void deleteByOrgId(String orgId) {
baseDao.deleteByOrgId(orgId);

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

@ -0,0 +1,86 @@
package com.epmet.dto.form;
import com.epmet.dto.IcPartyServiceCenterMatterDTO;
import lombok.Data;
import javax.validation.constraints.NotBlank;
import java.io.Serializable;
import java.util.List;
/**
* @Author zxc
* @DateTime 2021/11/22 9:05 上午
* @DESC
*/
@Data
public class EditPartyServiceCenterFormDTO implements Serializable {
private static final long serialVersionUID = -231856877756036529L;
public interface EditPartyServiceCenterForm{}
/**
* 中心名称
*/
@NotBlank(message = "centerName不能为空",groups = EditPartyServiceCenterForm.class)
private String centerName;
/**
* 社区地址
*/
@NotBlank(message = "address不能为空",groups = EditPartyServiceCenterForm.class)
private String address;
/**
* 办公电话
*/
@NotBlank(message = "workPhone不能为空",groups = EditPartyServiceCenterForm.class)
private String workPhone;
/**
* 上午开始时间
*/
@NotBlank(message = "amStartTime不能为空",groups = EditPartyServiceCenterForm.class)
private String amStartTime;
/**
* 上午结束时间
*/
@NotBlank(message = "amEndTime不能为空",groups = EditPartyServiceCenterForm.class)
private String amEndTime;
/**
* 下午开始时间
*/
@NotBlank(message = "pmStartTime不能为空",groups = EditPartyServiceCenterForm.class)
private String pmStartTime;
/**
* 下午结束时间
*/
@NotBlank(message = "pmEndTime不能为空",groups = EditPartyServiceCenterForm.class)
private String pmEndTime;
/**
* 经度
*/
@NotBlank(message = "longitude不能为空",groups = EditPartyServiceCenterForm.class)
private String longitude;
/**
* 纬度
*/
@NotBlank(message = "latitude不能为空",groups = EditPartyServiceCenterForm.class)
private String latitude;
/**
* 党群服务中心ID
*/
@NotBlank(message = "partyServiceCenterId不能为空",groups = EditPartyServiceCenterForm.class)
private String partyServiceCenterId;
/**
* 可预约事项
*/
private List<IcPartyServiceCenterMatterDTO> matterList;
}

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

@ -29,6 +29,7 @@ import com.epmet.commons.tools.validator.group.UpdateGroup;
import com.epmet.commons.tools.validator.group.DefaultGroup;
import com.epmet.dto.IcPartyServiceCenterDTO;
import com.epmet.dto.form.AddPartyServiceCenterFormDTO;
import com.epmet.dto.form.EditPartyServiceCenterFormDTO;
import com.epmet.excel.IcPartyServiceCenterExcel;
import com.epmet.service.IcPartyServiceCenterService;
import org.springframework.beans.factory.annotation.Autowired;
@ -108,4 +109,18 @@ public class IcPartyServiceCenterController {
return new Result();
}
/**
* @Description 修改党群服务中心
* @param formDTO
* @param tokenDto
* @author zxc
* @date 2021/11/22 10:21 上午
*/
@PostMapping("editpartyservicecenter")
public Result editPartyServiceCenter(@RequestBody EditPartyServiceCenterFormDTO formDTO,@LoginUser TokenDto tokenDto){
ValidatorUtils.validateEntity(formDTO, EditPartyServiceCenterFormDTO.EditPartyServiceCenterForm.class);
icPartyServiceCenterService.editPartyServiceCenter(formDTO,tokenDto);
return new Result();
}
}

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

@ -20,6 +20,7 @@ package com.epmet.dao;
import com.epmet.commons.mybatis.dao.BaseDao;
import com.epmet.entity.IcPartyServiceCenterMatterEntity;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
/**
* 党群服务中心可预约事项表
@ -29,5 +30,13 @@ import org.apache.ibatis.annotations.Mapper;
*/
@Mapper
public interface IcPartyServiceCenterMatterDao extends BaseDao<IcPartyServiceCenterMatterEntity> {
/**
* @Description 根据党群服务中心删除事项
* @param partyServiceCenterId
* @author zxc
* @date 2021/11/22 10:29 上午
*/
void deleteMattersByPartyServiceCenterId(@Param("partyServiceCenterId") String partyServiceCenterId);
}

8
epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/IcPartyServiceCenterMatterService.java

@ -92,4 +92,12 @@ public interface IcPartyServiceCenterMatterService extends BaseService<IcPartySe
* @date 2021-11-18
*/
void delete(String[] ids);
/**
* @Description 根据党群服务中心删除事项
* @param partyServiceCenterId
* @author zxc
* @date 2021/11/22 10:29 上午
*/
void deleteMattersByPartyServiceCenterId(String partyServiceCenterId);
}

11
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.dto.IcPartyServiceCenterDTO;
import com.epmet.dto.form.AddPartyServiceCenterFormDTO;
import com.epmet.dto.form.EditPartyServiceCenterFormDTO;
import com.epmet.entity.IcPartyServiceCenterEntity;
import java.util.List;
@ -103,4 +104,14 @@ public interface IcPartyServiceCenterService extends BaseService<IcPartyServiceC
* @date 2021/11/22 9:13 上午
*/
void addPartyServiceCenter(AddPartyServiceCenterFormDTO formDTO, TokenDto tokenDto);
/**
* @Description 修改党群服务中心
* @param formDTO
* @param tokenDto
* @author zxc
* @date 2021/11/22 10:21 上午
*/
void editPartyServiceCenter(EditPartyServiceCenterFormDTO formDTO,TokenDto tokenDto);
}

12
epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/impl/IcPartyServiceCenterMatterServiceImpl.java

@ -97,4 +97,16 @@ public class IcPartyServiceCenterMatterServiceImpl extends BaseServiceImpl<IcPar
baseDao.deleteBatchIds(Arrays.asList(ids));
}
/**
* @Description 根据党群服务中心删除事项
* @param partyServiceCenterId
* @author zxc
* @date 2021/11/22 10:29 上午
*/
@Transactional(rollbackFor = Exception.class)
@Override
public void deleteMattersByPartyServiceCenterId(String partyServiceCenterId) {
baseDao.deleteMattersByPartyServiceCenterId(partyServiceCenterId);
}
}

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

@ -37,6 +37,7 @@ import com.epmet.constant.PartyServiceCenterConstant;
import com.epmet.dao.IcPartyServiceCenterDao;
import com.epmet.dto.IcPartyServiceCenterDTO;
import com.epmet.dto.form.AddPartyServiceCenterFormDTO;
import com.epmet.dto.form.EditPartyServiceCenterFormDTO;
import com.epmet.entity.IcPartyServiceCenterEntity;
import com.epmet.entity.IcPartyServiceCenterMatterEntity;
import com.epmet.service.IcPartyServiceCenterMatterService;
@ -158,4 +159,36 @@ public class IcPartyServiceCenterServiceImpl extends BaseServiceImpl<IcPartyServ
}
}
/**
* @Description 修改党群服务中心
* @param formDTO
* @param tokenDto
* @author zxc
* @date 2021/11/22 10:21 上午
*/
@Override
public void editPartyServiceCenter(EditPartyServiceCenterFormDTO formDTO, TokenDto tokenDto) {
LambdaQueryWrapper<IcPartyServiceCenterEntity> l = new LambdaQueryWrapper<>();
l.eq(IcPartyServiceCenterEntity::getCenterName,formDTO.getCenterName())
.eq(IcPartyServiceCenterEntity::getCustomerId,tokenDto.getCustomerId())
.eq(BaseEpmetEntity::getDelFlag, NumConstant.ZERO)
.ne(BaseEpmetEntity::getId,formDTO.getPartyServiceCenterId());
IcPartyServiceCenterEntity record = baseDao.selectOne(l);
if (null != record){
throw new RenException(EpmetErrorCode.PARTY_SERVICE_CENTER_ERROR.getCode());
}
IcPartyServiceCenterEntity centerEntity = ConvertUtils.sourceToTarget(formDTO, IcPartyServiceCenterEntity.class);
centerEntity.setId(formDTO.getPartyServiceCenterId());
baseDao.updateById(centerEntity);
matterService.deleteMattersByPartyServiceCenterId(formDTO.getPartyServiceCenterId());
if (CollectionUtils.isNotEmpty(formDTO.getMatterList())){
List<IcPartyServiceCenterMatterEntity> matters = ConvertUtils.sourceToTarget(formDTO.getMatterList(), IcPartyServiceCenterMatterEntity.class);
matters.forEach(m -> {
m.setCustomerId(tokenDto.getCustomerId());
m.setPartyServiceCenterId(formDTO.getPartyServiceCenterId());
});
matterService.insertBatch(matters);
}
}
}

7
epmet-module/gov-org/gov-org-server/src/main/resources/mapper/IcPartyServiceCenterMatterDao.xml

@ -3,4 +3,11 @@
<mapper namespace="com.epmet.dao.IcPartyServiceCenterMatterDao">
<!-- 根据党群服务中心删除事项 -->
<delete id="deleteMattersByPartyServiceCenterId">
DELETE FROM ic_party_service_center_matter
WHERE DEL_FLAG = 0
AND PARTY_SERVICE_CENTER_ID = #{partyServiceCenterId}
</delete>
</mapper>
Loading…
Cancel
Save