|  |  | 
 |  |  | package com.matrix.system.score.service;
 | 
 |  |  | 
 | 
 |  |  | import cn.hutool.core.collection.CollUtil;
 | 
 |  |  | import cn.hutool.core.util.StrUtil;
 | 
 |  |  | 
 | 
 |  |  | import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
 | 
 |  |  | import com.matrix.core.constance.MatrixConstance;
 | 
 |  |  | import com.matrix.core.pojo.AjaxResult;
 | 
 |  |  | import com.matrix.core.pojo.PaginationVO;
 | 
 |  |  | import com.matrix.core.tools.StringUtils;
 | 
 |  |  | import com.matrix.core.tools.WebUtil;
 | 
 |  |  | import com.matrix.system.common.bean.BusParameterSettings;
 | 
 |  |  | import com.matrix.system.common.bean.SysUsers;
 | 
 |  |  | import com.matrix.system.common.dao.BusParameterSettingsDao;
 | 
 |  |  | import com.matrix.system.hive.bean.ParameterSettings;
 | 
 |  |  | import com.matrix.system.hive.dao.SysVipInfoDao;
 | 
 |  |  | import com.matrix.system.score.constant.ScoreSettingConstant;
 | 
 |  |  | import com.matrix.system.score.dao.ScoreOrderDao;
 | 
 |  |  | import com.matrix.system.score.entity.ScoreOrderEntity;
 | 
 |  |  | 
 | 
 |  |  | import org.springframework.beans.factory.annotation.Autowired;
 | 
 |  |  | import org.springframework.stereotype.Service;
 | 
 |  |  | 
 | 
 |  |  | import java.util.ArrayList;
 | 
 |  |  | import java.util.List;
 | 
 |  |  | 
 | 
 |  |  | /**
 | 
 |  |  |  * @author wzy
 | 
 |  |  |  * @date 2021-02-22
 | 
 |  |  |  **/
 | 
 |  |  | @Service
 | 
 |  |  | public class ScoreOrderService extends ServiceImpl<ScoreOrderDao, ScoreOrderEntity> {
 | 
 |  |  | 
 | 
 |  |  |     @Autowired
 | 
 |  |  |     private ScoreOrderDao scoreOrderDao;
 | 
 |  |  |     @Autowired
 | 
 |  |  |     private BusParameterSettingsDao busParameterSettingsDao;
 | 
 |  |  |     @Autowired
 | 
 |  |  |     private SysVipInfoDao sysVipInfoDao;
 | 
 |  |  | 
 | 
 |  |  |     public void testMethod() {
 | 
 |  |  |         scoreOrderDao.selectById(1L);
 | 
 |  |  |     }
 | 
 |  |  | 
 | 
 |  |  |     public AjaxResult updateScoreRuleByCompanyId(List<BusParameterSettings> busParameterSettings) {
 | 
 |  |  |         //获取当前登录人员信息
 | 
 |  |  |         SysUsers user = WebUtil.getSessionAttribute(MatrixConstance.LOGIN_KEY);
 | 
 |  |  |         for (BusParameterSettings busParameterSetting:busParameterSettings ) {
 | 
 |  |  |             String paramCode = busParameterSetting.getParamCode();
 | 
 |  |  |             if(StringUtils.isNotBlank(paramCode)){
 | 
 |  |  |                 //删除原有code
 | 
 |  |  |                 BusParameterSettings delParanm=new BusParameterSettings();
 | 
 |  |  |                 delParanm.setCompanyId(user.getCompanyId());
 | 
 |  |  |                 delParanm.setParamCode(paramCode);
 | 
 |  |  |                 busParameterSettingsDao.deleteByModel(delParanm);
 | 
 |  |  |                 //添加新的code
 | 
 |  |  |                 BusParameterSettings newParam=new BusParameterSettings();
 | 
 |  |  |                 newParam.setParamCode(paramCode);
 | 
 |  |  |                 newParam.setCompanyId(user.getCompanyId());
 | 
 |  |  |                 newParam.setParamValue(busParameterSetting.getParamValue());
 | 
 |  |  |                 newParam.setParamValue1(busParameterSetting.getParamValue1());
 | 
 |  |  |                 newParam.setParamValue2(busParameterSetting.getParamValue2());
 | 
 |  |  |                 busParameterSettingsDao.insert(newParam);
 | 
 |  |  |             }else{
 | 
 |  |  |                 return AjaxResult.buildFailInstance("code不能为空");
 | 
 |  |  |             }
 | 
 |  |  |         }
 | 
 |  |  |         AjaxResult result = new AjaxResult(AjaxResult.STATUS_SUCCESS, "更新成功");
 | 
 |  |  |         return result;
 | 
 |  |  |     }
 | 
 |  |  | 
 | 
 |  |  | }
 | 
 |  |  | package com.matrix.system.score.service; | 
 |  |  |  | 
 |  |  | import com.matrix.system.score.dao.ScoreOrderDao; | 
 |  |  | import com.matrix.system.score.entity.ScoreOrder; | 
 |  |  | import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; | 
 |  |  | import org.springframework.stereotype.Service; | 
 |  |  |  | 
 |  |  | /** | 
 |  |  |  * @description 订单表 | 
 |  |  |  * @author yourName | 
 |  |  |  * @date 2021-02-26 15:26 | 
 |  |  |  */ | 
 |  |  | @Service | 
 |  |  | public class ScoreOrderService  extends ServiceImpl<ScoreOrderDao, ScoreOrder>{ | 
 |  |  |  | 
 |  |  |  | 
 |  |  |  | 
 |  |  |  | 
 |  |  |    | 
 |  |  | } |