|
|
|
@ -7,12 +7,14 @@ import com.hfkj.common.exception.ErrorCode; |
|
|
|
|
import com.hfkj.common.exception.ErrorHelp; |
|
|
|
|
import com.hfkj.common.exception.SysCode; |
|
|
|
|
import com.hfkj.common.security.UserCenter; |
|
|
|
|
import com.hfkj.common.utils.RedisUtil; |
|
|
|
|
import com.hfkj.common.utils.ResponseMsgUtil; |
|
|
|
|
import com.hfkj.entity.*; |
|
|
|
|
import com.hfkj.model.ResponseData; |
|
|
|
|
import com.hfkj.model.UserSessionObject; |
|
|
|
|
import com.hfkj.service.gas.BsGasOrderService; |
|
|
|
|
import com.hfkj.service.gas.BsGasOrderSpreadService; |
|
|
|
|
import com.hfkj.service.sec.SecDictionaryService; |
|
|
|
|
import com.hfkj.service.spread.*; |
|
|
|
|
import io.swagger.annotations.Api; |
|
|
|
|
import io.swagger.annotations.ApiOperation; |
|
|
|
@ -24,6 +26,7 @@ import org.springframework.web.bind.annotation.*; |
|
|
|
|
import javax.annotation.Resource; |
|
|
|
|
import java.math.BigDecimal; |
|
|
|
|
import java.util.HashMap; |
|
|
|
|
import java.util.List; |
|
|
|
|
import java.util.Map; |
|
|
|
|
|
|
|
|
|
/** |
|
|
|
@ -48,6 +51,8 @@ public class BsUserSpreadController { |
|
|
|
|
private BsGasOrderService gasOrderService; |
|
|
|
|
@Resource |
|
|
|
|
private BsUserSpreadRelService userSpreadRelService; |
|
|
|
|
@Resource |
|
|
|
|
private SecDictionaryService secDictionaryService; |
|
|
|
|
|
|
|
|
|
@RequestMapping(value = "/editOilChannel", method = RequestMethod.POST) |
|
|
|
|
@ResponseBody |
|
|
|
@ -156,10 +161,49 @@ public class BsUserSpreadController { |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
@RequestMapping(value = "/countCommission", method = RequestMethod.GET) |
|
|
|
|
@ResponseBody |
|
|
|
|
@ApiOperation(value = "统计佣金情况") |
|
|
|
|
public ResponseData countCommission() { |
|
|
|
|
try { |
|
|
|
|
|
|
|
|
|
return ResponseMsgUtil.success(gasOrderSpreadService.countCommission()); |
|
|
|
|
|
|
|
|
|
} catch (Exception e) { |
|
|
|
|
return ResponseMsgUtil.exception(e); |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@RequestMapping(value = "/recharge", method = RequestMethod.POST) |
|
|
|
|
@ResponseBody |
|
|
|
|
@ApiOperation(value = "充值") |
|
|
|
|
public ResponseData recharge(@RequestBody JSONObject body) { |
|
|
|
|
try { |
|
|
|
|
if (body == null || body.getBigDecimal("amount") == null) { |
|
|
|
|
throw ErrorHelp.genException(SysCode.System, ErrorCode.REQ_PARAMS_ERROR, ""); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
List<SecDictionary> data = secDictionaryService.getDictionary("SYS_USER_SPREAD_ACCOUNT"); |
|
|
|
|
if (data != null && !data.isEmpty()) { |
|
|
|
|
SecDictionary account = data.get(0); |
|
|
|
|
account.setCodeName(new BigDecimal(account.getCodeName()).add(body.getBigDecimal("amount")).toString()); |
|
|
|
|
secDictionaryService.update(account); |
|
|
|
|
// 清除缓存
|
|
|
|
|
secDictionaryService.cleanCache(); |
|
|
|
|
} |
|
|
|
|
return ResponseMsgUtil.success("操作成功"); |
|
|
|
|
|
|
|
|
|
} catch (Exception e) { |
|
|
|
|
return ResponseMsgUtil.exception(e); |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@RequestMapping(value = "/countAccount", method = RequestMethod.GET) |
|
|
|
|
@ResponseBody |
|
|
|
|
@ApiOperation(value = "统计金额") |
|
|
|
|
public ResponseData countAccount(@RequestParam(value = "userId", required = true) Long userId, |
|
|
|
|
public ResponseData countAccount(@RequestParam(value = "userId", required = false) Long userId, |
|
|
|
|
@RequestParam(name = "orderStatus", required = false) Integer orderStatus, |
|
|
|
|
@RequestParam(name = "payTimeS", required = false) Long payTimeS, |
|
|
|
|
@RequestParam(name = "payTimeE", required = false) Long payTimeE) { |
|
|
|
@ -179,7 +223,7 @@ public class BsUserSpreadController { |
|
|
|
|
@RequestMapping(value="/queryOilOrderSpread",method = RequestMethod.GET) |
|
|
|
|
@ResponseBody |
|
|
|
|
@ApiOperation(value = "查询加油推广订单") |
|
|
|
|
public ResponseData queryOilOrderSpread(@RequestParam(value = "userId", required = true) Long userId, |
|
|
|
|
public ResponseData queryOilOrderSpread(@RequestParam(value = "userId", required = false) Long userId, |
|
|
|
|
@RequestParam(name = "orderNo", required = false) String orderNo, |
|
|
|
|
@RequestParam(name = "orderStatus", required = false) Integer orderStatus, |
|
|
|
|
@RequestParam(name = "payTimeS", required = false) Long payTimeS, |
|
|
|
|