Ver Fonte

Merge remote-tracking branch 'origin/master'

yuhongqi há 2 semanas atrás
pai
commit
2dfb3a275f

+ 37 - 4
fs-admin/src/main/java/com/fs/company/controller/CompanyConfigController.java

@@ -3,14 +3,17 @@ package com.fs.company.controller;
 
 import com.fs.common.core.controller.BaseController;
 import com.fs.common.core.domain.AjaxResult;
+import com.fs.common.core.domain.R;
+import com.fs.common.core.domain.model.LoginUser;
+import com.fs.common.utils.ServletUtils;
+import com.fs.company.domain.CompanyConfig;
 import com.fs.company.service.ICompanyConfigService;
 import com.fs.system.domain.SysConfig;
 import com.fs.system.service.ISysConfigService;
 import org.springframework.beans.factory.annotation.Autowired;
-import org.springframework.web.bind.annotation.GetMapping;
-import org.springframework.web.bind.annotation.PathVariable;
-import org.springframework.web.bind.annotation.RequestMapping;
-import org.springframework.web.bind.annotation.RestController;
+import org.springframework.security.access.prepost.PreAuthorize;
+import org.springframework.validation.annotation.Validated;
+import org.springframework.web.bind.annotation.*;
 
 /**
  * 系统配置
@@ -44,5 +47,35 @@ public class CompanyConfigController extends BaseController
     }
 
 
+    /**
+    * 修改的是 销售端的配置
+    */
+    @PostMapping(value = "/editCompanyConfig")
+    public R edit(@Validated @RequestBody CompanyConfig companyConfig)
+    {
+        companyConfigService.updateCompanyConfig(companyConfig);
+        return R.ok("操作成功");
+    }
+
+
+    /**
+     * 根据参数键名查询参数值
+     */
+    @GetMapping(value = "/getCompanyConfigKey/{configKey}/{companyId}")
+    public R getConfigKey(@PathVariable String configKey,@PathVariable Long companyId)
+    {
+        CompanyConfig config=companyConfigService.selectCompanyConfigByKey(companyId,configKey);
+        if(config==null){
+            config=new CompanyConfig();
+            config.setCompanyId(companyId);
+            config.setConfigKey(configKey);
+            config.setConfigType("N");
+            companyConfigService.insertCompanyConfig(config);
+
+        }
+        return R.ok().put("data",config);
+
+    }
+
 
 }

+ 7 - 0
fs-admin/src/main/java/com/fs/his/controller/FsIntegralGoodsController.java

@@ -8,6 +8,7 @@ import com.fs.common.core.page.TableDataInfo;
 import com.fs.common.enums.BusinessType;
 import com.fs.common.utils.poi.ExcelUtil;
 import com.fs.his.domain.FsIntegralGoods;
+import com.fs.his.param.FsIntegralGoodsParam;
 import com.fs.his.service.IFsIntegralGoodsService;
 import com.fs.his.utils.RedisCacheUtil;
 import com.fs.his.vo.FsIntegralGoodsChooseVO;
@@ -148,4 +149,10 @@ public class FsIntegralGoodsController extends BaseController
         List<FsIntegralGoodsChooseVO> list = fsIntegralGoodsService.getChooseIntegralGoodsListByMap(params);
         return R.ok().put("data", new PageInfo<>(list));
     }
+
+    @PostMapping("/batchUpdateIntegralGoods")
+    public R batchUpdateIntegralGoods(@RequestBody FsIntegralGoodsParam integralGoodsParam) {
+        fsIntegralGoodsService.batchUpdateIntegralGoods(integralGoodsParam);
+        return R.ok();
+    }
 }

+ 12 - 0
fs-admin/src/main/java/com/fs/web/controller/system/SysConfigController.java

@@ -3,9 +3,11 @@ package com.fs.web.controller.system;
 import java.util.List;
 
 import cn.hutool.core.util.ObjectUtil;
+import cn.hutool.json.JSONUtil;
 import com.fs.common.core.domain.R;
 import com.fs.common.core.redis.RedisCache;
 import com.fs.common.utils.SecurityUtils;
+import com.fs.course.config.CourseConfig;
 import com.fs.sop.service.impl.QwSopServiceImpl;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.security.access.prepost.PreAuthorize;
@@ -136,6 +138,16 @@ public class SysConfigController extends BaseController {
         return AjaxResult.success(config);
     }
 
+    /**
+    * 获取奖励类型配置
+    */
+    @GetMapping(value = "/getCourseConfigByRewardType")
+    public R getCourseConfigByRewardType() {
+        String json = configService.selectConfigByKey("course.config");
+        CourseConfig config = JSONUtil.toBean(json, CourseConfig.class);
+        return R.ok().put("rewardType",config.getRewardType());
+    }
+
     @PostMapping(value = "/updateConfigByKey")
     @Log(title = "更改参数", businessType = BusinessType.UPDATE)
     @RepeatSubmit

+ 12 - 0
fs-service/src/main/java/com/fs/his/mapper/FsIntegralGoodsMapper.java

@@ -121,4 +121,16 @@ public interface FsIntegralGoodsMapper
     List<FsGoodsVO> getFsGoodsVOListByIds(@Param("goodsIds") List<Long> goodsIds);
 
     List<FsIntegralGoodsVo> selectAllByGoodsIds(@Param("goodsIds") Set<Long> goodsIds);
+
+    /**
+     * 批量更新积分商品信息
+     *
+     * @param goodsIds 商品ID数组
+     * @param integral 所需积分
+     * @param cash 支付金额
+     * @return 结果
+     */
+    int batchUpdateIntegralGoods(@Param("goodsIds") Long[] goodsIds,
+                                 @Param("integral") Long integral,
+                                 @Param("cash") java.math.BigDecimal cash);
 }

+ 22 - 0
fs-service/src/main/java/com/fs/his/param/FsIntegralGoodsParam.java

@@ -0,0 +1,22 @@
+package com.fs.his.param;
+
+import com.fs.common.annotation.Excel;
+import lombok.Data;
+
+import java.math.BigDecimal;
+
+@Data
+public class FsIntegralGoodsParam {
+
+     /**
+     * 商品id
+     */
+     private Long[] goodsIds;
+
+     /** 所需积分 */
+     private Long integral;
+
+     /** 支付金额 */
+     private BigDecimal cash;
+
+}

+ 9 - 0
fs-service/src/main/java/com/fs/his/service/IFsIntegralGoodsService.java

@@ -3,6 +3,7 @@ package com.fs.his.service;
 import com.fs.common.core.domain.R;
 import com.fs.his.domain.FsIntegralGoods;
 import com.fs.his.param.FsIntegralGoodsListUParam;
+import com.fs.his.param.FsIntegralGoodsParam;
 import com.fs.his.vo.FsIntegralGoodsChooseVO;
 import com.fs.his.vo.FsIntegralGoodsListUVO;
 import com.fs.his.vo.FsIntegralGoodsListVO;
@@ -78,4 +79,12 @@ public interface IFsIntegralGoodsService
      * 获取选择积分商品列表
      */
     List<FsIntegralGoodsChooseVO> getChooseIntegralGoodsListByMap(Map<String, Object> params);
+
+    /**
+     * 批量更新积分商品信息
+     *
+     * @param param 批量更新参数
+     */
+    void batchUpdateIntegralGoods(FsIntegralGoodsParam param);
+
 }

+ 22 - 0
fs-service/src/main/java/com/fs/his/service/impl/FsIntegralGoodsServiceImpl.java

@@ -282,4 +282,26 @@ public class FsIntegralGoodsServiceImpl implements IFsIntegralGoodsService
     public List<FsIntegralGoodsChooseVO> getChooseIntegralGoodsListByMap(Map<String, Object> params) {
         return fsIntegralGoodsMapper.getChooseIntegralGoodsListByMap(params);
     }
+
+    /**
+     * 批量更新积分商品信息
+     *
+     * @param param 批量更新参数
+     */
+    @Override
+    public void batchUpdateIntegralGoods(com.fs.his.param.FsIntegralGoodsParam param) {
+        if (param.getGoodsIds() == null || param.getGoodsIds().length == 0) {
+            throw new ServiceException("请选择要更新的商品");
+        }
+
+        int result = fsIntegralGoodsMapper.batchUpdateIntegralGoods(
+                param.getGoodsIds(),
+                param.getIntegral(),
+                param.getCash()
+        );
+
+        if (result <= 0) {
+            throw new ServiceException("批量更新失败");
+        }
+    }
 }

+ 1 - 0
fs-service/src/main/resources/mapper/his/FsIntegralCountMapper.xml

@@ -27,6 +27,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
             <if test="beginDate != null  and beginDate != ''"> and consumption_date >= #{beginDate}</if>
             <if test="endDate != null  and endDate != ''"> and consumption_date &lt;= #{endDate}</if>
         </where>
+        order by create_time desc
     </select>
 
     <select id="selectFsIntegralCountById" parameterType="Long" resultMap="FsIntegralCountResult">

+ 13 - 0
fs-service/src/main/resources/mapper/his/FsIntegralGoodsMapper.xml

@@ -181,4 +181,17 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
             #{goodsIds}
         </foreach>
     </select>
+
+    <update id="batchUpdateIntegralGoods">
+        update fs_integral_goods
+        <set>
+            <if test="integral != null">integral = #{integral},</if>
+            <if test="cash != null">cash = #{cash},</if>
+        </set>
+        where goods_id in
+        <foreach item="goodsId" collection="goodsIds" open="(" separator="," close=")">
+            #{goodsId}
+        </foreach>
+    </update>
+
 </mapper>