Commit 3d176807 authored by unset's avatar unset

添加通知信息

parent c6964937
package com.upyuns.platform.rs.website.dto;
import com.github.wxiaoqi.security.common.vo.PageParam;
import lombok.Data;
/**
* @ClassName : NoticeInfoDto
* @Description : 通知信息
* @Author : jiaoruizhen
* @Date: 2020-12-29 09:14
*/
@Data
public class NoticeInfoDto extends PageParam {
Integer userId;
Integer read;
}
package com.upyuns.platform.rs.website.biz;
import com.github.wxiaoqi.security.common.msg.ObjectRestResponse;
import com.github.wxiaoqi.security.common.util.Query;
import com.github.wxiaoqi.security.common.vo.PageDataVO;
import com.upyuns.platform.rs.website.dto.NoticeInfoDto;
import org.springframework.stereotype.Service;
import com.upyuns.platform.rs.website.entity.NoticeInfo;
import com.upyuns.platform.rs.website.mapper.NoticeInfoMapper;
import com.github.wxiaoqi.security.common.biz.BaseBiz;
import tk.mybatis.mapper.entity.Example;
import java.util.Date;
import java.util.concurrent.ExecutorService;
......@@ -23,4 +28,23 @@ public class NoticeInfoBiz extends BaseBiz<NoticeInfoMapper,NoticeInfo> {
public void addObj(String message, Integer type, Integer userId, String relationId) {
insertSelectiveRe(new NoticeInfo(){{setMessage(message); setType(type); setUserId(userId); setRelationId(relationId); setCrtTime(new Date());setUpdTime(new Date());}});
}
/**
* 查询用户所有通知信息
* @param noticeInfoDto
* @return
*/
public ObjectRestResponse getByUserId(NoticeInfoDto noticeInfoDto) {
Example example = new Example(NoticeInfo.class);
Example.Criteria criteria = example.createCriteria();
if (noticeInfoDto.getRead() != null) {
criteria.andEqualTo("read", noticeInfoDto.getRead());
}
criteria.andEqualTo("userId", noticeInfoDto.getUserId());
example.orderBy("read");
Query query = new Query(noticeInfoDto);
PageDataVO<NoticeInfo> pageDataVO = PageDataVO.pageInfo(query, () -> mapper.selectByExample(example));
return ObjectRestResponse.succ(pageDataVO);
}
}
\ No newline at end of file
......@@ -383,14 +383,6 @@ public class OrderInfoBiz extends BaseBiz<OrderInfoMapper, OrderInfo> {
orderInfo.setRemark(orderInfoDto.getRemark());
orderInfo.setAmount(new BigDecimal(amount.get()));
orderInfo.setNumber(number.get());
Dictionary dictionary = thirdFeign.findDictionaryByTypeAndCode(DictionaryKey.APP_ORDER, DictionaryKey.SEND_FEE);
if (dictionary != null && StringUtils.isNotBlank(dictionary.getDetail())) {
orderInfo.setFee(new BigDecimal(dictionary.getDetail()));
}
if (orderInfo.getFee() != null) {
orderInfo.setTotalAmount(orderInfo.getAmount().add(orderInfo.getFee()));
}
//订单发票信息
if (orderInfoDto.getUserInvoiceId() != null) {
UserInvoice userInvoice = userInvoiceBiz.selectById(orderInfoDto.getUserInvoiceId());
......@@ -412,6 +404,14 @@ public class OrderInfoBiz extends BaseBiz<OrderInfoMapper, OrderInfo> {
orderEInvoiceBiz.addUpdate(orderEInvoice);
orderInfo.setInvoiceStatus(2);
orderInfo.setInvoiceId(orderEInvoice.getId());
Dictionary dictionary = thirdFeign.findDictionaryByTypeAndCode(DictionaryKey.APP_ORDER, DictionaryKey.SEND_FEE);
if (dictionary != null && StringUtils.isNotBlank(dictionary.getDetail())) {
orderInfo.setFee(new BigDecimal(dictionary.getDetail()));
}
if (orderInfo.getFee() != null) {
orderInfo.setTotalAmount(orderInfo.getAmount().add(orderInfo.getFee()));
}
}
}
......
package com.upyuns.platform.rs.website.controller.web;
import com.github.wxiaoqi.security.admin.feign.UserFeign;
import com.github.wxiaoqi.security.admin.feign.rest.UserRestInterface;
import com.github.wxiaoqi.security.common.msg.ObjectRestResponse;
import com.github.wxiaoqi.security.common.rest.BaseController;
import com.upyuns.platform.rs.website.biz.NoticeInfoBiz;
import com.upyuns.platform.rs.website.dto.NoticeInfoDto;
import com.upyuns.platform.rs.website.entity.NoticeInfo;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
@RestController
@RequestMapping("noticeInfo/web")
public class NoticeInfoWebController extends BaseController<NoticeInfoBiz,NoticeInfo> {
public class NoticeInfoWebController extends BaseController<NoticeInfoBiz,NoticeInfo> implements UserRestInterface {
@Autowired
UserFeign userFeign;
@Override
public UserFeign getUserFeign() {
return userFeign;
}
@GetMapping(value = "getAllByUser")
public ObjectRestResponse getUserList(NoticeInfoDto noticeInfoDto) {
noticeInfoDto.setUserId(getAppUser().getUserid());
return baseBiz.getByUserId(noticeInfoDto);
}
}
\ No newline at end of file
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment