From 789c5301ba9c69f779cb0b29f22857299760a960 Mon Sep 17 00:00:00 2001 From: Helius <wangdoubleone@gmail.com> Date: Mon, 15 Mar 2021 15:51:23 +0800 Subject: [PATCH] Merge branch 'score_shop' of http://120.27.238.55:7000/r/beauty-erp into score_shop --- zq-erp/src/main/java/com/matrix/system/fenxiao/action/FenXiaoUserAction.java | 84 ++++++++++++++++++++++++++++++++++++++++++ 1 files changed, 84 insertions(+), 0 deletions(-) diff --git a/zq-erp/src/main/java/com/matrix/system/fenxiao/action/FenXiaoUserAction.java b/zq-erp/src/main/java/com/matrix/system/fenxiao/action/FenXiaoUserAction.java index 169a429..f0fe454 100644 --- a/zq-erp/src/main/java/com/matrix/system/fenxiao/action/FenXiaoUserAction.java +++ b/zq-erp/src/main/java/com/matrix/system/fenxiao/action/FenXiaoUserAction.java @@ -10,7 +10,10 @@ import com.matrix.core.pojo.AjaxResult; 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.fenxiao.constant.FenxiaoSettingConstant; import com.matrix.system.fenxiao.dao.ShopSalesmanApplyDao; import com.matrix.system.fenxiao.dao.ShopSalesmanGradeDao; import com.matrix.system.fenxiao.dto.*; @@ -22,9 +25,12 @@ import io.swagger.annotations.ApiOperation; import io.swagger.annotations.ApiResponse; import io.swagger.annotations.ApiResponses; +import org.springframework.beans.BeanUtils; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.web.bind.annotation.*; +import java.util.ArrayList; +import java.util.Arrays; import java.util.List; @RestController @@ -39,6 +45,8 @@ private BizUserDao bizUserDao; @Autowired private ShopSalesmanGradeDao shopSalesmanGradeDao; + @Autowired + private BusParameterSettingsDao busParameterSettingsDao; /** * 分销员详情页面信息 @@ -102,6 +110,82 @@ } /** + *推广图片 + */ + @ApiOperation(value = "推广图片") + @PostMapping(value = "/updateTgtp") + public @ResponseBody + AjaxResult updateTgtp(@RequestBody UpdateTgtpDto updateTgtpDto) { + return shopSalesmanApplyService.updateTgtp(updateTgtpDto); + } + + /** + *推广图片 + */ + @RequestMapping(value = "/loadTgtpSetting") + public AjaxResult loadTgtpSetting() { + + AjaxResult result= AjaxResult.buildSuccessInstance("查询成功"); + SysUsers user = WebUtil.getSessionAttribute(MatrixConstance.LOGIN_KEY); + Long companyId = user.getCompanyId(); + + //推广文案 + String[] FXKGCode={FenxiaoSettingConstant.FX_TG_POSTER}; + String[] FXKGName={"推广图片"}; + List<FenXiaoSettingVo> fxkgRuleSettingsVo = getRuleSettingsVo(FXKGCode,FXKGName,companyId); + result.putInMap("tgtp", fxkgRuleSettingsVo.get(0)); + return result; + } + + /** + *推广计划更新 + */ + @ApiOperation(value = "推广计划更新") + @PostMapping(value = "/updateTgjh") + public @ResponseBody + AjaxResult updateTgjh(@RequestBody UpdateTgjhDto updateTgjhDto) { + return shopSalesmanApplyService.updateTgjh(updateTgjhDto); + } + /** + *查询推广计划 + */ + @RequestMapping(value = "/loadTgwaSetting") + public AjaxResult loadTgwaSetting() { + + AjaxResult result= AjaxResult.buildSuccessInstance("查询成功"); + SysUsers user = WebUtil.getSessionAttribute(MatrixConstance.LOGIN_KEY); + Long companyId = user.getCompanyId(); + + //推广文案 + String[] FXKGCode={FenxiaoSettingConstant.FX_TG_PLAN}; + String[] FXKGName={"推广文案"}; + List<FenXiaoSettingVo> fxkgRuleSettingsVo = getRuleSettingsVo(FXKGCode,FXKGName,companyId); + result.putInMap("tgwa", fxkgRuleSettingsVo.get(0)); + return result; + } + + /** + *获取对应的规则设置数据 + * @param ArrayCode + * @param ArrayName + * @param companyId + * @return + */ + private List<FenXiaoSettingVo> getRuleSettingsVo(String[] ArrayCode,String[] ArrayName,Long companyId){ + List<BusParameterSettings> dataList = busParameterSettingsDao.selectByCodesAndCompanyId(Arrays.asList(ArrayCode), companyId); + List<FenXiaoSettingVo> scoreRuleSettingsVos=new ArrayList<FenXiaoSettingVo>(); + int index=0; + for (BusParameterSettings item:dataList){ + FenXiaoSettingVo paramVo=new FenXiaoSettingVo(); + BeanUtils.copyProperties(item,paramVo); + paramVo.setParamName(ArrayName[index]); + scoreRuleSettingsVos.add(paramVo); + index++; + } + return scoreRuleSettingsVos; + } + + /** * 分佣方案 */ @ApiOperation(value = "查询分佣方案") -- Gitblit v1.9.1