123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174 |
- package com.steerinfo.dil.service.impl;
- import com.steerinfo.dil.mapper.DilNoticeMapper;
- import com.steerinfo.dil.model.DilNotice;
- import com.steerinfo.dil.service.IDilNoticeService;
- import org.springframework.beans.factory.annotation.Autowired;
- import org.springframework.stereotype.Service;
- import java.util.ArrayList;
- import java.util.Date;
- import java.math.BigDecimal;
- import java.util.List;
- import java.util.Map;
- /**
- * DilNotice服务实现:
- * @author generator
- * @version 1.0-SNAPSHORT 2021-12-08 02:21
- * 类描述
- * 修订历史:
- * 日期:2021-12-08
- * 作者:generator
- * 参考:
- * 描述:DilNotice服务实现
- * @see null
- * @Copyright 湖南视拓信息技术股份有限公司. All rights reserved.
- */
- @Service(value = "dilNoticeService")
- public class DilNoticeServiceImpl implements IDilNoticeService {
- @Autowired
- private DilNoticeMapper dilNoticeMapper;
- /**
- * 获取通知信息
- * */
- @Override
- public List<Map<String, Object>> getNoticeList(Map<String, Object> mapVal) {
- return dilNoticeMapper.getNoticeList(mapVal);
- }
- /**
- * 承运商获取通知信息
- * */
- @Override
- public List<Map<String, Object>> getCarrierNoticeList(Map<String, Object> mapVal) {
- return dilNoticeMapper.getCarrierNoticeList(mapVal);
- }
- /**
- * 销售公司获取通知信息
- * */
- @Override
- public List<Map<String, Object>> getMarketingNoticeList(Map<String, Object> mapVal) {
- return dilNoticeMapper.getMarketingNoticeList(mapVal);
- }
- /**
- * 收货用户获取通知信息
- * */
- @Override
- public List<Map<String, Object>> getClientNoticeList(Map<String, Object> mapVal) {
- return dilNoticeMapper.getClientNoticeList(mapVal);
- }
- @Override
- public List<Map<String, Object>> getNewNoticeByPermission(BigDecimal permission) {
- return dilNoticeMapper.getNewNoticeByPermission(permission);
- }
- /**
- * 增加通知信息
- * */
- @Override
- /*这里是解决前端毛病所妥协的结果,前端拿不到value值,只能拿到name也就是key值,这里在后端强行将key转为value值QAQ*/
- public int insertNotice(DilNotice dilNotice) {
- dilNotice.setDeleted(new BigDecimal(0));
- dilNotice.setInsertTime(new Date());
- if(dilNotice.getPermissions()!=null){
- if(dilNotice.getPermissions().equals("承运商")){
- dilNotice.setPermission(BigDecimal.valueOf(1));
- }
- else if(dilNotice.getPermissions().equals("销售商")){
- dilNotice.setPermission(BigDecimal.valueOf(2));
- }
- else if(dilNotice.getPermissions().equals("收货客户")){
- dilNotice.setPermission(BigDecimal.valueOf(3));
- }
- }
- {
- }
- //需要手动设置发布人
- /*dilNotice.setInsertUsername("admin");*/
- dilNotice.setNoticeId(dilNoticeMapper.selectNoticeId());
- return dilNoticeMapper.insertSelective(dilNotice);
- }
- /**
- * 修改通知信息
- * */
- @Override
- public int updateNotice(DilNotice dilNotice) {
- /*dilNotice.setUpdateTime(new Date());*/
- /*dilNotice.setUpdateUsername("admin");*/
- return dilNoticeMapper.updateByPrimaryKeySelective(dilNotice);
- }
- /**
- * 删除通知信息
- * */
- @Override
- public int deleteNotice(BigDecimal id) {
- DilNotice dilNotice = dilNoticeMapper.selectByPrimaryKey(id);
- dilNotice.setDeleted(new BigDecimal(1));
- return dilNoticeMapper.updateByPrimaryKeySelective(dilNotice);
- }
- /**
- * 根据id获取运力信息
- * @param id
- * @return
- */
- @Override
- public List<Map<String, Object>> getNoticeById(BigDecimal id) {
- return dilNoticeMapper.getNoticeById(id);
- }
- /**
- * @author:zyf
- * @version:1.0
- * @Date:
- * @Description: 获取通知信息数据
- */
- public List<Map<String,Object>> getNoticeData(String orgcode){
- List<Map<String, Object>> noticeData=new ArrayList<>();
- if ("chengyunshang".equals(orgcode)){
- BigDecimal permission=BigDecimal.valueOf(1);
- noticeData = dilNoticeMapper.getNoticeData(permission);
- }else if ("xiaoshougongsi".equals(orgcode)){
- BigDecimal permission=BigDecimal.valueOf(2);
- noticeData = dilNoticeMapper.getNoticeData(permission);
- }else if ("shouhuokehu".equals(orgcode)){
- BigDecimal permission=BigDecimal.valueOf(3);
- noticeData = dilNoticeMapper.getNoticeData(permission);
- }else {
- noticeData = dilNoticeMapper.getNoticeData1();
- }
- return noticeData;
- }
- /*
- * 获取下拉框
- * */
- /*
- @Override
- public List<Map<String,Object>> getCapacityTypeId() {
- return rmsCapacityMapper.getCapacityTypeId();
- }
- @Override
- public List<Map<String, Object>> getCarrierId() {
- return rmsCapacityMapper.getCarrierId();
- }
- */
- }
|