Browse Source

Merge branch 'dev'

master
luyan 2 years ago
parent
commit
550b145756
  1. 2
      epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/controller/IcComplaintsController.java
  2. 20
      epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/controller/IcComplaintsReplyController.java
  3. 39
      epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/impl/IcComplaintsReplyServiceImpl.java
  4. 18
      epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/impl/IcComplaintsServiceImpl.java

2
epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/controller/IcComplaintsController.java

@ -35,7 +35,7 @@ public class IcComplaintsController {
private IcComplaintsService icComplaintsService; private IcComplaintsService icComplaintsService;
@RequestMapping("page") @RequestMapping("page")
public Result<PageData<IcComplaintsDTO>> page(@RequestParam Map<String, Object> params) { public Result<PageData<IcComplaintsDTO>> page(@RequestBody Map<String, Object> params) {
PageData<IcComplaintsDTO> page = icComplaintsService.page(params); PageData<IcComplaintsDTO> page = icComplaintsService.page(params);
return new Result<PageData<IcComplaintsDTO>>().ok(page); return new Result<PageData<IcComplaintsDTO>>().ok(page);
} }

20
epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/controller/IcComplaintsReplyController.java

@ -13,6 +13,7 @@ import com.epmet.service.IcComplaintsReplyService;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*; import org.springframework.web.bind.annotation.*;
import java.util.List;
import java.util.Map; import java.util.Map;
@ -30,20 +31,26 @@ public class IcComplaintsReplyController {
private IcComplaintsReplyService icComplaintsReplyService; private IcComplaintsReplyService icComplaintsReplyService;
@RequestMapping("page") @RequestMapping("page")
public Result<PageData<IcComplaintsReplyDTO>> page(@RequestParam Map<String, Object> params){ public Result<PageData<IcComplaintsReplyDTO>> page(@RequestParam Map<String, Object> params) {
PageData<IcComplaintsReplyDTO> page = icComplaintsReplyService.page(params); PageData<IcComplaintsReplyDTO> page = icComplaintsReplyService.page(params);
return new Result<PageData<IcComplaintsReplyDTO>>().ok(page); return new Result<PageData<IcComplaintsReplyDTO>>().ok(page);
} }
@RequestMapping(value = "{id}",method = {RequestMethod.POST,RequestMethod.GET}) @RequestMapping(value = "{id}", method = {RequestMethod.POST, RequestMethod.GET})
public Result<IcComplaintsReplyDTO> get(@PathVariable("id") String id){ public Result<IcComplaintsReplyDTO> get(@PathVariable("id") String id) {
IcComplaintsReplyDTO data = icComplaintsReplyService.get(id); IcComplaintsReplyDTO data = icComplaintsReplyService.get(id);
return new Result<IcComplaintsReplyDTO>().ok(data); return new Result<IcComplaintsReplyDTO>().ok(data);
} }
@RequestMapping("list")
public Result<List<IcComplaintsReplyDTO>> list(@RequestParam Map<String, Object> params) {
List<IcComplaintsReplyDTO> data = icComplaintsReplyService.list(params);
return new Result<List<IcComplaintsReplyDTO>>().ok(data);
}
@NoRepeatSubmit @NoRepeatSubmit
@PostMapping("save") @PostMapping("save")
public Result save(@RequestBody IcComplaintsReplyDTO dto){ public Result save(@RequestBody IcComplaintsReplyDTO dto) {
//效验数据 //效验数据
ValidatorUtils.validateEntity(dto, AddGroup.class, DefaultGroup.class); ValidatorUtils.validateEntity(dto, AddGroup.class, DefaultGroup.class);
icComplaintsReplyService.save(dto); icComplaintsReplyService.save(dto);
@ -52,7 +59,7 @@ public class IcComplaintsReplyController {
@NoRepeatSubmit @NoRepeatSubmit
@PostMapping("update") @PostMapping("update")
public Result update(@RequestBody IcComplaintsReplyDTO dto){ public Result update(@RequestBody IcComplaintsReplyDTO dto) {
//效验数据 //效验数据
ValidatorUtils.validateEntity(dto, UpdateGroup.class, DefaultGroup.class); ValidatorUtils.validateEntity(dto, UpdateGroup.class, DefaultGroup.class);
icComplaintsReplyService.update(dto); icComplaintsReplyService.update(dto);
@ -60,7 +67,7 @@ public class IcComplaintsReplyController {
} }
@PostMapping("delete") @PostMapping("delete")
public Result delete(@RequestBody String[] ids){ public Result delete(@RequestBody String[] ids) {
//效验数据 //效验数据
AssertUtils.isArrayEmpty(ids, "id"); AssertUtils.isArrayEmpty(ids, "id");
icComplaintsReplyService.delete(ids); icComplaintsReplyService.delete(ids);
@ -68,5 +75,4 @@ public class IcComplaintsReplyController {
} }
} }

39
epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/impl/IcComplaintsReplyServiceImpl.java

@ -7,13 +7,19 @@ import com.epmet.commons.tools.constant.FieldConstant;
import com.epmet.commons.tools.page.PageData; import com.epmet.commons.tools.page.PageData;
import com.epmet.commons.tools.utils.ConvertUtils; import com.epmet.commons.tools.utils.ConvertUtils;
import com.epmet.dao.IcComplaintsReplyDao; import com.epmet.dao.IcComplaintsReplyDao;
import com.epmet.dto.IcComplaintsDTO;
import com.epmet.dto.IcComplaintsReplyDTO; import com.epmet.dto.IcComplaintsReplyDTO;
import com.epmet.dto.result.LoginUserDetailsResultDTO;
import com.epmet.entity.IcComplaintsReplyEntity; import com.epmet.entity.IcComplaintsReplyEntity;
import com.epmet.remote.EpmetUserRemoteService;
import com.epmet.service.IcComplaintsReplyService; import com.epmet.service.IcComplaintsReplyService;
import com.epmet.service.IcComplaintsService;
import org.apache.commons.lang3.StringUtils; import org.apache.commons.lang3.StringUtils;
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 javax.annotation.Resource;
import java.util.Arrays; import java.util.Arrays;
import java.util.List; import java.util.List;
import java.util.Map; import java.util.Map;
@ -27,6 +33,12 @@ import java.util.Map;
@Service @Service
public class IcComplaintsReplyServiceImpl extends BaseServiceImpl<IcComplaintsReplyDao, IcComplaintsReplyEntity> implements IcComplaintsReplyService { public class IcComplaintsReplyServiceImpl extends BaseServiceImpl<IcComplaintsReplyDao, IcComplaintsReplyEntity> implements IcComplaintsReplyService {
@Resource
private EpmetUserRemoteService remoteService;
@Autowired
private IcComplaintsService icComplaintsService;
@Override @Override
public PageData<IcComplaintsReplyDTO> page(Map<String, Object> params) { public PageData<IcComplaintsReplyDTO> page(Map<String, Object> params) {
IPage<IcComplaintsReplyEntity> page = baseDao.selectPage( IPage<IcComplaintsReplyEntity> page = baseDao.selectPage(
@ -43,12 +55,12 @@ public class IcComplaintsReplyServiceImpl extends BaseServiceImpl<IcComplaintsRe
return ConvertUtils.sourceToTarget(entityList, IcComplaintsReplyDTO.class); return ConvertUtils.sourceToTarget(entityList, IcComplaintsReplyDTO.class);
} }
private QueryWrapper<IcComplaintsReplyEntity> getWrapper(Map<String, Object> params){ private QueryWrapper<IcComplaintsReplyEntity> getWrapper(Map<String, Object> params) {
String id = (String)params.get(FieldConstant.ID_HUMP); String id = (String) params.get(FieldConstant.ID_HUMP);
String complantsId = (String) params.get("complantsId");
QueryWrapper<IcComplaintsReplyEntity> wrapper = new QueryWrapper<>(); QueryWrapper<IcComplaintsReplyEntity> wrapper = new QueryWrapper<>();
wrapper.eq(StringUtils.isNotBlank(id), FieldConstant.ID, id); wrapper.eq(StringUtils.isNotBlank(id), FieldConstant.ID, id);
wrapper.eq(StringUtils.isNotBlank(complantsId), "COMPLANTS_ID", complantsId);
return wrapper; return wrapper;
} }
@ -62,7 +74,11 @@ public class IcComplaintsReplyServiceImpl extends BaseServiceImpl<IcComplaintsRe
@Transactional(rollbackFor = Exception.class) @Transactional(rollbackFor = Exception.class)
public void save(IcComplaintsReplyDTO dto) { public void save(IcComplaintsReplyDTO dto) {
IcComplaintsReplyEntity entity = ConvertUtils.sourceToTarget(dto, IcComplaintsReplyEntity.class); IcComplaintsReplyEntity entity = ConvertUtils.sourceToTarget(dto, IcComplaintsReplyEntity.class);
LoginUserDetailsResultDTO userDetails = remoteService.getLoginUserDetails();
entity.setCustomerId(userDetails.getCustomerId());
insert(entity); insert(entity);
//同步主表的处理状态
updateComplaintsEntity(entity.getState(), entity.getComplantsId());
} }
@Override @Override
@ -70,6 +86,8 @@ public class IcComplaintsReplyServiceImpl extends BaseServiceImpl<IcComplaintsRe
public void update(IcComplaintsReplyDTO dto) { public void update(IcComplaintsReplyDTO dto) {
IcComplaintsReplyEntity entity = ConvertUtils.sourceToTarget(dto, IcComplaintsReplyEntity.class); IcComplaintsReplyEntity entity = ConvertUtils.sourceToTarget(dto, IcComplaintsReplyEntity.class);
updateById(entity); updateById(entity);
//同步主表的处理状态
updateComplaintsEntity(entity.getState(), entity.getComplantsId());
} }
@Override @Override
@ -79,4 +97,17 @@ public class IcComplaintsReplyServiceImpl extends BaseServiceImpl<IcComplaintsRe
baseDao.deleteBatchIds(Arrays.asList(ids)); baseDao.deleteBatchIds(Arrays.asList(ids));
} }
/**
* 同步主表状态以便列表展示当前投诉的实际处理状态
* @param state
* @param complantsId
*/
private void updateComplaintsEntity(Integer state, String complantsId) {
//同步主表的处理状态
IcComplaintsDTO complaintsDTO = new IcComplaintsDTO();
complaintsDTO.setState(state);
complaintsDTO.setId(complantsId);
icComplaintsService.update(complaintsDTO);
}
} }

18
epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/impl/IcComplaintsServiceImpl.java

@ -62,7 +62,17 @@ public class IcComplaintsServiceImpl extends BaseServiceImpl<IcComplaintsDao, Ic
getPage(params, FieldConstant.CREATED_TIME, false), getPage(params, FieldConstant.CREATED_TIME, false),
getWrapper(params) getWrapper(params)
); );
return getPageData(page, IcComplaintsDTO.class); PageData<IcComplaintsDTO> data = getPageData(page, IcComplaintsDTO.class);
if (!CollectionUtils.isEmpty(data.getList())) {
page.getRecords().forEach(entity -> {
data.getList().forEach(dto -> {
if (dto.getId().equals(entity.getId())) {
dto.setCreatedTime(DateUtil.formatDate(entity.getCreatedTime()));
}
});
});
}
return data;
} }
@Override @Override
@ -82,7 +92,7 @@ public class IcComplaintsServiceImpl extends BaseServiceImpl<IcComplaintsDao, Ic
QueryWrapper<IcComplaintsEntity> wrapper = new QueryWrapper<>(); QueryWrapper<IcComplaintsEntity> wrapper = new QueryWrapper<>();
wrapper.eq(StringUtils.isNotBlank(id), FieldConstant.ID, id); wrapper.eq(StringUtils.isNotBlank(id), FieldConstant.ID, id);
wrapper.like(StringUtils.isNotEmpty(userName), "USER_NAME", userName); wrapper.like(StringUtils.isNotEmpty(userName), "USER_NAME", userName);
wrapper.eq(StringUtils.isNotEmpty(state), FieldConstant.STATE_HUMP, state); wrapper.eq(StringUtils.isNotEmpty(state), FieldConstant.STATE, state);
wrapper.eq(StringUtils.isNotEmpty(type), "TYPE", type); wrapper.eq(StringUtils.isNotEmpty(type), "TYPE", type);
wrapper.like(StringUtils.isNotEmpty(content), "CONTENT", content); wrapper.like(StringUtils.isNotEmpty(content), "CONTENT", content);
wrapper.between(StringUtils.isNotEmpty(startTime), "CREATED_TIME", startTime, endTime); wrapper.between(StringUtils.isNotEmpty(startTime), "CREATED_TIME", startTime, endTime);
@ -151,14 +161,14 @@ public class IcComplaintsServiceImpl extends BaseServiceImpl<IcComplaintsDao, Ic
//审查用户提交内容 //审查用户提交内容
// scanContent(dto.getContent()); // scanContent(dto.getContent());
IcComplaintsEntity entity = ConvertUtils.sourceToTarget(dto, IcComplaintsEntity.class); IcComplaintsEntity entity = ConvertUtils.sourceToTarget(dto, IcComplaintsEntity.class);
if (StringUtils.isNotEmpty(dto.getResiUserId())) { entity.setState(0);
if (StringUtils.isEmpty(entity.getUserName()) && StringUtils.isNotEmpty(dto.getResiUserId())) {
CommonUserIdFormDTO param = new CommonUserIdFormDTO(); CommonUserIdFormDTO param = new CommonUserIdFormDTO();
param.setUserId(dto.getResiUserId()); param.setUserId(dto.getResiUserId());
ExtUserInfoResultDTO userInfo = openFeignClient.extUserInfo(param).getData(); ExtUserInfoResultDTO userInfo = openFeignClient.extUserInfo(param).getData();
if (null != userInfo) { if (null != userInfo) {
entity.setUserName(userInfo.getRealName()); entity.setUserName(userInfo.getRealName());
entity.setMobile(userInfo.getMobile()); entity.setMobile(userInfo.getMobile());
entity.setState(0);
} else { } else {
throw new EpmetException("查询用户信息失败" + dto.getResiUserId()); throw new EpmetException("查询用户信息失败" + dto.getResiUserId());
} }

Loading…
Cancel
Save