|
|
@ -7,12 +7,15 @@ import com.epmet.commons.tools.constant.FieldConstant; |
|
|
|
import com.epmet.commons.tools.page.PageData; |
|
|
|
import com.epmet.commons.tools.utils.ConvertUtils; |
|
|
|
import com.epmet.dao.IcComplaintsReplyDao; |
|
|
|
import com.epmet.dto.IcComplaintsDTO; |
|
|
|
import com.epmet.dto.IcComplaintsReplyDTO; |
|
|
|
import com.epmet.dto.result.LoginUserDetailsResultDTO; |
|
|
|
import com.epmet.entity.IcComplaintsReplyEntity; |
|
|
|
import com.epmet.remote.EpmetUserRemoteService; |
|
|
|
import com.epmet.service.IcComplaintsReplyService; |
|
|
|
import com.epmet.service.IcComplaintsService; |
|
|
|
import org.apache.commons.lang3.StringUtils; |
|
|
|
import org.springframework.beans.factory.annotation.Autowired; |
|
|
|
import org.springframework.stereotype.Service; |
|
|
|
import org.springframework.transaction.annotation.Transactional; |
|
|
|
|
|
|
@ -33,6 +36,9 @@ public class IcComplaintsReplyServiceImpl extends BaseServiceImpl<IcComplaintsRe |
|
|
|
@Resource |
|
|
|
private EpmetUserRemoteService remoteService; |
|
|
|
|
|
|
|
@Autowired |
|
|
|
private IcComplaintsService icComplaintsService; |
|
|
|
|
|
|
|
@Override |
|
|
|
public PageData<IcComplaintsReplyDTO> page(Map<String, Object> params) { |
|
|
|
IPage<IcComplaintsReplyEntity> page = baseDao.selectPage( |
|
|
@ -51,10 +57,10 @@ public class IcComplaintsReplyServiceImpl extends BaseServiceImpl<IcComplaintsRe |
|
|
|
|
|
|
|
private QueryWrapper<IcComplaintsReplyEntity> getWrapper(Map<String, Object> params) { |
|
|
|
String id = (String) params.get(FieldConstant.ID_HUMP); |
|
|
|
|
|
|
|
String complantsId = (String) params.get("complantsId"); |
|
|
|
QueryWrapper<IcComplaintsReplyEntity> wrapper = new QueryWrapper<>(); |
|
|
|
wrapper.eq(StringUtils.isNotBlank(id), FieldConstant.ID, id); |
|
|
|
|
|
|
|
wrapper.eq(StringUtils.isNotBlank(complantsId), "COMPLANTS_ID", complantsId); |
|
|
|
return wrapper; |
|
|
|
} |
|
|
|
|
|
|
@ -71,6 +77,8 @@ public class IcComplaintsReplyServiceImpl extends BaseServiceImpl<IcComplaintsRe |
|
|
|
LoginUserDetailsResultDTO userDetails = remoteService.getLoginUserDetails(); |
|
|
|
entity.setCustomerId(userDetails.getCustomerId()); |
|
|
|
insert(entity); |
|
|
|
//同步主表的处理状态
|
|
|
|
updateComplaintsEntity(entity.getState(), entity.getComplantsId()); |
|
|
|
} |
|
|
|
|
|
|
|
@Override |
|
|
@ -78,6 +86,8 @@ public class IcComplaintsReplyServiceImpl extends BaseServiceImpl<IcComplaintsRe |
|
|
|
public void update(IcComplaintsReplyDTO dto) { |
|
|
|
IcComplaintsReplyEntity entity = ConvertUtils.sourceToTarget(dto, IcComplaintsReplyEntity.class); |
|
|
|
updateById(entity); |
|
|
|
//同步主表的处理状态
|
|
|
|
updateComplaintsEntity(entity.getState(), entity.getComplantsId()); |
|
|
|
} |
|
|
|
|
|
|
|
@Override |
|
|
@ -87,4 +97,17 @@ public class IcComplaintsReplyServiceImpl extends BaseServiceImpl<IcComplaintsRe |
|
|
|
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); |
|
|
|
} |
|
|
|
|
|
|
|
} |
|
|
|