DilNoticeServiceImpl.java 4.1 KB

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