DilNoticeServiceImpl.java 4.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174
  1. package com.steerinfo.dil.service.impl;
  2. import com.steerinfo.dil.mapper.DilNoticeMapper;
  3. import com.steerinfo.dil.model.DilNotice;
  4. import com.steerinfo.dil.service.IDilNoticeService;
  5. import org.springframework.beans.factory.annotation.Autowired;
  6. import org.springframework.stereotype.Service;
  7. import java.util.ArrayList;
  8. import java.util.Date;
  9. import java.math.BigDecimal;
  10. import java.util.List;
  11. import java.util.Map;
  12. /**
  13. * DilNotice服务实现:
  14. * @author generator
  15. * @version 1.0-SNAPSHORT 2021-12-08 02:21
  16. * 类描述
  17. * 修订历史:
  18. * 日期:2021-12-08
  19. * 作者:generator
  20. * 参考:
  21. * 描述:DilNotice服务实现
  22. * @see null
  23. * @Copyright 湖南视拓信息技术股份有限公司. All rights reserved.
  24. */
  25. @Service(value = "dilNoticeService")
  26. public class DilNoticeServiceImpl implements IDilNoticeService {
  27. @Autowired
  28. private DilNoticeMapper dilNoticeMapper;
  29. /**
  30. * 获取通知信息
  31. * */
  32. @Override
  33. public List<Map<String, Object>> getNoticeList(Map<String, Object> mapVal) {
  34. return dilNoticeMapper.getNoticeList(mapVal);
  35. }
  36. /**
  37. * 承运商获取通知信息
  38. * */
  39. @Override
  40. public List<Map<String, Object>> getCarrierNoticeList(Map<String, Object> mapVal) {
  41. return dilNoticeMapper.getCarrierNoticeList(mapVal);
  42. }
  43. /**
  44. * 销售公司获取通知信息
  45. * */
  46. @Override
  47. public List<Map<String, Object>> getMarketingNoticeList(Map<String, Object> mapVal) {
  48. return dilNoticeMapper.getMarketingNoticeList(mapVal);
  49. }
  50. /**
  51. * 收货用户获取通知信息
  52. * */
  53. @Override
  54. public List<Map<String, Object>> getClientNoticeList(Map<String, Object> mapVal) {
  55. return dilNoticeMapper.getClientNoticeList(mapVal);
  56. }
  57. @Override
  58. public List<Map<String, Object>> getNewNoticeByPermission(BigDecimal permission) {
  59. return dilNoticeMapper.getNewNoticeByPermission(permission);
  60. }
  61. /**
  62. * 增加通知信息
  63. * */
  64. @Override
  65. /*这里是解决前端毛病所妥协的结果,前端拿不到value值,只能拿到name也就是key值,这里在后端强行将key转为value值QAQ*/
  66. public int insertNotice(DilNotice dilNotice) {
  67. dilNotice.setDeleted(new BigDecimal(0));
  68. dilNotice.setInsertTime(new Date());
  69. if(dilNotice.getPermissions()!=null){
  70. if(dilNotice.getPermissions().equals("承运商")){
  71. dilNotice.setPermission(BigDecimal.valueOf(1));
  72. }
  73. else if(dilNotice.getPermissions().equals("销售商")){
  74. dilNotice.setPermission(BigDecimal.valueOf(2));
  75. }
  76. else if(dilNotice.getPermissions().equals("收货客户")){
  77. dilNotice.setPermission(BigDecimal.valueOf(3));
  78. }
  79. }
  80. {
  81. }
  82. //需要手动设置发布人
  83. /*dilNotice.setInsertUsername("admin");*/
  84. dilNotice.setNoticeId(dilNoticeMapper.selectNoticeId());
  85. return dilNoticeMapper.insertSelective(dilNotice);
  86. }
  87. /**
  88. * 修改通知信息
  89. * */
  90. @Override
  91. public int updateNotice(DilNotice dilNotice) {
  92. /*dilNotice.setUpdateTime(new Date());*/
  93. /*dilNotice.setUpdateUsername("admin");*/
  94. return dilNoticeMapper.updateByPrimaryKeySelective(dilNotice);
  95. }
  96. /**
  97. * 删除通知信息
  98. * */
  99. @Override
  100. public int deleteNotice(BigDecimal id) {
  101. DilNotice dilNotice = dilNoticeMapper.selectByPrimaryKey(id);
  102. dilNotice.setDeleted(new BigDecimal(1));
  103. return dilNoticeMapper.updateByPrimaryKeySelective(dilNotice);
  104. }
  105. /**
  106. * 根据id获取运力信息
  107. * @param id
  108. * @return
  109. */
  110. @Override
  111. public List<Map<String, Object>> getNoticeById(BigDecimal id) {
  112. return dilNoticeMapper.getNoticeById(id);
  113. }
  114. /**
  115. * @author:zyf
  116. * @version:1.0
  117. * @Date:
  118. * @Description: 获取通知信息数据
  119. */
  120. public List<Map<String,Object>> getNoticeData(String orgcode){
  121. List<Map<String, Object>> noticeData=new ArrayList<>();
  122. if ("chengyunshang".equals(orgcode)){
  123. BigDecimal permission=BigDecimal.valueOf(1);
  124. noticeData = dilNoticeMapper.getNoticeData(permission);
  125. }else if ("xiaoshougongsi".equals(orgcode)){
  126. BigDecimal permission=BigDecimal.valueOf(2);
  127. noticeData = dilNoticeMapper.getNoticeData(permission);
  128. }else if ("shouhuokehu".equals(orgcode)){
  129. BigDecimal permission=BigDecimal.valueOf(3);
  130. noticeData = dilNoticeMapper.getNoticeData(permission);
  131. }else {
  132. noticeData = dilNoticeMapper.getNoticeData1();
  133. }
  134. return noticeData;
  135. }
  136. /*
  137. * 获取下拉框
  138. * */
  139. /*
  140. @Override
  141. public List<Map<String,Object>> getCapacityTypeId() {
  142. return rmsCapacityMapper.getCapacityTypeId();
  143. }
  144. @Override
  145. public List<Map<String, Object>> getCarrierId() {
  146. return rmsCapacityMapper.getCarrierId();
  147. }
  148. */
  149. }