|
|
|
@ -19,6 +19,7 @@ package com.elink.esua.epdc.modules.groupbuy.service.impl; |
|
|
|
|
|
|
|
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; |
|
|
|
import com.baomidou.mybatisplus.core.metadata.IPage; |
|
|
|
import com.elink.esua.epdc.async.NewsTask; |
|
|
|
import com.elink.esua.epdc.commons.mybatis.service.impl.BaseServiceImpl; |
|
|
|
import com.elink.esua.epdc.commons.tools.constant.FieldConstant; |
|
|
|
import com.elink.esua.epdc.commons.tools.constant.NumConstant; |
|
|
|
@ -31,9 +32,12 @@ import com.elink.esua.epdc.commons.tools.security.content.dto.result.CheckResult |
|
|
|
import com.elink.esua.epdc.commons.tools.security.content.dto.result.CheckResultMessageDTO; |
|
|
|
import com.elink.esua.epdc.commons.tools.utils.ConvertUtils; |
|
|
|
import com.elink.esua.epdc.commons.tools.utils.Result; |
|
|
|
import com.elink.esua.epdc.constant.SdsPtgNoticeConstant; |
|
|
|
import com.elink.esua.epdc.dto.GroupBuyInfoDTO; |
|
|
|
import com.elink.esua.epdc.dto.epdc.form.EpdcInformationFormDTO; |
|
|
|
import com.elink.esua.epdc.dto.form.EpdcAddGroupBuyInfoFormDTO; |
|
|
|
import com.elink.esua.epdc.dto.form.EpdcSelectGroupBuyInfoListFormDTO; |
|
|
|
import com.elink.esua.epdc.dto.form.SdsPtgShieldFormDTO; |
|
|
|
import com.elink.esua.epdc.dto.result.EpdcSelectGroupBuyDetailResultDTO; |
|
|
|
import com.elink.esua.epdc.dto.result.EpdcSelectGroupBuyInfoListResultDTO; |
|
|
|
import com.elink.esua.epdc.modules.feign.AdminFeignClient; |
|
|
|
@ -63,6 +67,8 @@ public class GroupBuyInfoServiceImpl extends BaseServiceImpl<GroupBuyInfoDao, Gr |
|
|
|
@Autowired |
|
|
|
private GroupBuyInfoRedis groupBuyInfoRedis; |
|
|
|
|
|
|
|
@Autowired |
|
|
|
private NewsTask newsTask; |
|
|
|
|
|
|
|
@Autowired |
|
|
|
private AdminFeignClient adminFeignClient; |
|
|
|
@ -89,9 +95,17 @@ public class GroupBuyInfoServiceImpl extends BaseServiceImpl<GroupBuyInfoDao, Gr |
|
|
|
|
|
|
|
private QueryWrapper<GroupBuyInfoEntity> getWrapper(Map<String, Object> params){ |
|
|
|
String id = (String)params.get(FieldConstant.ID_HUMP); |
|
|
|
String groupBuyTitle = (String)params.get("groupBuyTitle"); |
|
|
|
String startTime = (String)params.get("startTime"); |
|
|
|
String endTime = (String)params.get("endTime"); |
|
|
|
|
|
|
|
QueryWrapper<GroupBuyInfoEntity> wrapper = new QueryWrapper<>(); |
|
|
|
wrapper.eq(StringUtils.isNotBlank(id), FieldConstant.ID, id); |
|
|
|
wrapper.like(StringUtils.isNotBlank(groupBuyTitle), "GROUP_BUY_TITLE", groupBuyTitle.trim()); |
|
|
|
wrapper.ge(StringUtils.isNotBlank(startTime), "DATE_FORMAT(CREATED_TIME, '%Y-%m-%d' )", startTime); |
|
|
|
wrapper.le(StringUtils.isNotBlank(endTime), "DATE_FORMAT(CREATED_TIME, '%Y-%m-%d' )", endTime); |
|
|
|
wrapper.orderByAsc("SORT"); |
|
|
|
wrapper.orderByDesc("CREATED_TIME"); |
|
|
|
|
|
|
|
return wrapper; |
|
|
|
} |
|
|
|
@ -114,6 +128,16 @@ public class GroupBuyInfoServiceImpl extends BaseServiceImpl<GroupBuyInfoDao, Gr |
|
|
|
public void update(GroupBuyInfoDTO dto) { |
|
|
|
GroupBuyInfoEntity entity = ConvertUtils.sourceToTarget(dto, GroupBuyInfoEntity.class); |
|
|
|
updateById(entity); |
|
|
|
//更新结束后发消息通知到用户
|
|
|
|
EpdcInformationFormDTO informationFormDTO = new EpdcInformationFormDTO(); |
|
|
|
informationFormDTO.setType(SdsPtgNoticeConstant.NOTICE_TYPE_INTERACTIVE_NOTICE); |
|
|
|
informationFormDTO.setUserId(dto.getUserId()); |
|
|
|
informationFormDTO.setContent("您的拼团购内容被修改,请注意查看。"); |
|
|
|
informationFormDTO.setTitle(SdsPtgNoticeConstant.NOTICE_PTG_UPDATE); |
|
|
|
informationFormDTO.setBusinessType(SdsPtgNoticeConstant.NOTICE_BUSINESS_TYPE_SDS_PTG); |
|
|
|
informationFormDTO.setBusinessId(entity.getId()); |
|
|
|
// 发送消息
|
|
|
|
newsTask.insertUserInformation(informationFormDTO); |
|
|
|
} |
|
|
|
|
|
|
|
@Override |
|
|
|
@ -142,6 +166,7 @@ public class GroupBuyInfoServiceImpl extends BaseServiceImpl<GroupBuyInfoDao, Gr |
|
|
|
} |
|
|
|
|
|
|
|
@Override |
|
|
|
@Transactional(rollbackFor = Exception.class) |
|
|
|
public Result publishOrUpdate(EpdcAddGroupBuyInfoFormDTO formDTO) { |
|
|
|
//内容审核 - start
|
|
|
|
Boolean isConReview = formDTO.getIsConReview(); |
|
|
|
@ -201,12 +226,14 @@ public class GroupBuyInfoServiceImpl extends BaseServiceImpl<GroupBuyInfoDao, Gr |
|
|
|
} |
|
|
|
|
|
|
|
@Override |
|
|
|
@Transactional(rollbackFor = Exception.class) |
|
|
|
public Result deleteGroupBuy(String id) { |
|
|
|
this.deleteById(id); |
|
|
|
return new Result(); |
|
|
|
} |
|
|
|
|
|
|
|
@Override |
|
|
|
@Transactional(rollbackFor = Exception.class) |
|
|
|
public Result callMobile(String id) { |
|
|
|
GroupBuyInfoEntity groupBuyInfoEntity = selectById(id); |
|
|
|
if(groupBuyInfoEntity==null){ |
|
|
|
@ -218,6 +245,7 @@ public class GroupBuyInfoServiceImpl extends BaseServiceImpl<GroupBuyInfoDao, Gr |
|
|
|
} |
|
|
|
|
|
|
|
@Override |
|
|
|
@Transactional(rollbackFor = Exception.class) |
|
|
|
public void modifyOrganizationInfo(OrganizationModifyDTO dto) { |
|
|
|
// 查询需要修改组织机构信息事件
|
|
|
|
List<GroupBuyInfoDTO> eventsList = baseDao.selectListOfOrganizationInfo(dto.getDeptId().toString()); |
|
|
|
@ -232,6 +260,27 @@ public class GroupBuyInfoServiceImpl extends BaseServiceImpl<GroupBuyInfoDao, Gr |
|
|
|
baseDao.updateGridByDeptId(dto.getNewDeptName(), dto.getDeptId()); |
|
|
|
} |
|
|
|
|
|
|
|
@Override |
|
|
|
@Transactional(rollbackFor = Exception.class) |
|
|
|
public Result modifyGroupBuyShieldFlag(SdsPtgShieldFormDTO formDto) { |
|
|
|
GroupBuyInfoEntity entity = new GroupBuyInfoEntity(); |
|
|
|
entity.setId(formDto.getId()); |
|
|
|
entity.setShieldReason(formDto.getShieldReason()); |
|
|
|
entity.setShieldFlag(NumConstant.ONE_STR); |
|
|
|
updateById(entity); |
|
|
|
//更新结束后发消息通知到用户
|
|
|
|
EpdcInformationFormDTO informationFormDTO = new EpdcInformationFormDTO(); |
|
|
|
informationFormDTO.setType(SdsPtgNoticeConstant.NOTICE_TYPE_INTERACTIVE_NOTICE); |
|
|
|
informationFormDTO.setUserId(entity.getUserId()); |
|
|
|
informationFormDTO.setContent("您的拼团购内容被屏蔽,屏蔽原因:"+formDto.getShieldReason()); |
|
|
|
informationFormDTO.setTitle(SdsPtgNoticeConstant.NOTICE_PTG_DELETE); |
|
|
|
informationFormDTO.setBusinessType(SdsPtgNoticeConstant.NOTICE_BUSINESS_TYPE_SDS_PTG); |
|
|
|
informationFormDTO.setBusinessId(entity.getId()); |
|
|
|
// 发送消息
|
|
|
|
newsTask.insertUserInformation(informationFormDTO); |
|
|
|
return new Result(); |
|
|
|
} |
|
|
|
|
|
|
|
@Override |
|
|
|
public void rejectActInfo(RejectRecordDTO dto) { |
|
|
|
baseDao.deleteById(dto.getRelationId()); |
|
|
|
|