|
|
|
@ -10,10 +10,12 @@ import com.hfkj.common.security.UserCenter; |
|
|
|
|
import com.hfkj.common.utils.ResponseMsgUtil; |
|
|
|
|
import com.hfkj.entity.BsUserSpreadOilChannel; |
|
|
|
|
import com.hfkj.entity.BsUserSpreadPower; |
|
|
|
|
import com.hfkj.entity.BsUserSpreadRel; |
|
|
|
|
import com.hfkj.model.ResponseData; |
|
|
|
|
import com.hfkj.model.UserSessionObject; |
|
|
|
|
import com.hfkj.service.spread.BsUserSpreadOilChannelService; |
|
|
|
|
import com.hfkj.service.spread.BsUserSpreadPowerService; |
|
|
|
|
import com.hfkj.service.spread.BsUserSpreadRelService; |
|
|
|
|
import io.swagger.annotations.Api; |
|
|
|
|
import io.swagger.annotations.ApiOperation; |
|
|
|
|
import org.slf4j.Logger; |
|
|
|
@ -22,6 +24,7 @@ import org.springframework.stereotype.Controller; |
|
|
|
|
import org.springframework.web.bind.annotation.*; |
|
|
|
|
|
|
|
|
|
import javax.annotation.Resource; |
|
|
|
|
import java.math.BigDecimal; |
|
|
|
|
import java.util.HashMap; |
|
|
|
|
import java.util.Map; |
|
|
|
|
|
|
|
|
@ -37,6 +40,8 @@ public class BsUserSpreadController { |
|
|
|
|
private static Logger log = LoggerFactory.getLogger(BsUserSpreadController.class); |
|
|
|
|
@Resource |
|
|
|
|
private BsUserSpreadOilChannelService userSpreadOilChannelService; |
|
|
|
|
@Resource |
|
|
|
|
private BsUserSpreadRelService userSpreadRelService; |
|
|
|
|
|
|
|
|
|
@RequestMapping(value = "/editOilChannel", method = RequestMethod.POST) |
|
|
|
|
@ResponseBody |
|
|
|
@ -47,7 +52,6 @@ public class BsUserSpreadController { |
|
|
|
|
|| body.getInteger("channel") == null |
|
|
|
|
|| body.getBigDecimal("rebate") == null |
|
|
|
|
|| body.getBigDecimal("rebateOne") == null |
|
|
|
|
|| body.getBigDecimal("rebateTwo") == null |
|
|
|
|
) { |
|
|
|
|
throw ErrorHelp.genException(SysCode.System, ErrorCode.REQ_PARAMS_ERROR, ""); |
|
|
|
|
} |
|
|
|
@ -59,7 +63,7 @@ public class BsUserSpreadController { |
|
|
|
|
} |
|
|
|
|
channel.setRebate(body.getBigDecimal("rebate")); |
|
|
|
|
channel.setRebateOne(body.getBigDecimal("rebateOne")); |
|
|
|
|
channel.setRebateTwo(body.getBigDecimal("rebateTwo")); |
|
|
|
|
channel.setRebateTwo(body.getBigDecimal("rebateTwo")!=null?body.getBigDecimal("rebateTwo"):new BigDecimal("0")); |
|
|
|
|
userSpreadOilChannelService.editData(channel); |
|
|
|
|
|
|
|
|
|
return ResponseMsgUtil.success("操作成功"); |
|
|
|
@ -82,6 +86,24 @@ public class BsUserSpreadController { |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
@RequestMapping(value = "/getUserSpreadList", method = RequestMethod.GET) |
|
|
|
|
@ResponseBody |
|
|
|
|
@ApiOperation(value = "查询推广用户列表") |
|
|
|
|
public ResponseData getUserSpreadList(@RequestParam(value = "phone", required = false) String phone, |
|
|
|
|
@RequestParam(value = "pageNum", required = true) Integer pageNum, |
|
|
|
|
@RequestParam(value = "pageSize", required = true) Integer pageSize) { |
|
|
|
|
try { |
|
|
|
|
Map<String,Object> param = new HashMap<>(); |
|
|
|
|
param.put("phone", phone); |
|
|
|
|
|
|
|
|
|
PageHelper.startPage(pageNum,pageSize); |
|
|
|
|
return ResponseMsgUtil.success(new PageInfo<>(userSpreadRelService.getUserSpreadList(param))); |
|
|
|
|
|
|
|
|
|
} catch (Exception e) { |
|
|
|
|
return ResponseMsgUtil.exception(e); |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
@RequestMapping(value = "/getOilChannelList", method = RequestMethod.GET) |
|
|
|
|
@ResponseBody |
|
|
|
|
@ApiOperation(value = "查询油站渠道列表") |
|
|
|
|