master
袁野 5 months ago
parent 4d641615a8
commit ca50a33199
  1. 21
      bweb/src/main/java/com/bweb/controller/recharge/PriceController.java
  2. 62
      cweb/src/main/java/com/cweb/controller/CommonController.java
  3. 67
      cweb/src/main/java/com/cweb/controller/qianZhu/CinemaController.java
  4. 17
      service/src/main/java/com/hfkj/dao/RechargePriceMapper.java
  5. 14
      service/src/main/java/com/hfkj/dao/RechargePriceSqlProvider.java
  6. 16
      service/src/main/java/com/hfkj/entity/RechargePrice.java
  7. 60
      service/src/main/java/com/hfkj/entity/RechargePriceExample.java
  8. 41
      service/src/main/java/com/hfkj/qianzhu/channel/CinemaService.java
  9. 3
      service/src/main/java/com/hfkj/qianzhu/channel/QianZhuService.java
  10. 63
      service/src/main/java/com/hfkj/service/recharge/RechargeCodeService.java
  11. 43
      service/src/main/java/com/hfkj/service/recharge/impl/RechargeCodeServiceImpl.java

@ -1,31 +1,23 @@
package com.bweb.controller.recharge;
import com.alibaba.fastjson.JSONObject;
import com.github.pagehelper.PageHelper;
import com.github.pagehelper.PageInfo;
import com.hfkj.common.exception.ErrorCode;
import com.hfkj.common.exception.ErrorHelp;
import com.hfkj.common.exception.SysCode;
import com.hfkj.common.security.SessionObject;
import com.hfkj.common.utils.ResponseMsgUtil;
import com.hfkj.entity.GoodsBrand;
import com.hfkj.entity.GoodsType;
import com.hfkj.entity.RechargePrice;
import com.hfkj.model.ResponseData;
import com.hfkj.model.SecUserSessionObject;
import com.hfkj.service.recharge.PriceService;
import com.hfkj.sysenum.SecUserObjectTypeEnum;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.apache.commons.lang3.StringUtils;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.*;
import javax.annotation.Resource;
import javax.servlet.http.HttpServletRequest;
import java.math.BigDecimal;
import java.util.Date;
import java.util.HashMap;
import java.util.Map;
@ -40,10 +32,10 @@ public class PriceController {
@Resource
private PriceService priceService;
@RequestMapping(value="/getListGoods",method = RequestMethod.GET)
@RequestMapping(value="/getListPrice",method = RequestMethod.GET)
@ResponseBody
@ApiOperation(value = "查询列表")
public ResponseData getListGoods(
public ResponseData getListPrice(
@RequestParam(value = "type" , required = false) Integer type,
@RequestParam(value = "pageNum" , required = true) Integer pageNum,
@RequestParam(value = "pageSize" , required = true) Integer pageSize) {
@ -67,10 +59,9 @@ public class PriceController {
public ResponseData editPrice(@RequestBody RechargePrice body) {
try {
if (body == null
|| body.getPrice() == null
|| body.getDiscount() == null
|| body.getPayPrice() == null
|| body.getSort() == null
|| body.getType() == null
) {
@ -91,9 +82,8 @@ public class PriceController {
}
rechargePrice.setUpdateTime(new Date());
rechargePrice.setPayPrice(body.getPrice().multiply(body.getDiscount()).divide(new BigDecimal(100)).setScale(2 , BigDecimal.ROUND_HALF_UP));
rechargePrice.setPayPrice(body.getPayPrice());
rechargePrice.setPrice(body.getPrice());
rechargePrice.setDiscount(body.getDiscount());
rechargePrice.setType(body.getType());
rechargePrice.setSort(body.getSort());
rechargePrice.setStatus(1);
@ -110,6 +100,7 @@ public class PriceController {
log.error("OutRechargePriceController --> insertPrice() error!", e);
return ResponseMsgUtil.exception(e);
}
}
@RequestMapping(value="/delete",method = RequestMethod.GET)

@ -21,9 +21,8 @@ import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;
import javax.annotation.Resource;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import java.util.*;
import java.util.stream.Collectors;
@RestController
@RequestMapping(value="/common")
@ -37,6 +36,7 @@ public class CommonController {
@Autowired
private RedisUtil redisUtil;
@Resource
private BsOrderGoodsService bsOrderGoodsService;
@ -86,10 +86,10 @@ public class CommonController {
}
}
@RequestMapping(value = "/getAllCities", method = RequestMethod.GET)
@RequestMapping(value = "/getAllQzCities", method = RequestMethod.GET)
@ResponseBody
@ApiOperation(value = "查询中国大陆所有城市")
public ResponseData getAllCities() {
@ApiOperation(value = "查询千猪中国大陆所有城市")
public ResponseData getAllQzCities() {
try {
Object data = redisUtil.get("qianZhuCity");
@ -97,9 +97,21 @@ public class CommonController {
if (data == null) {
JSONObject jsonObjects = QianZhuService.getAllCities();
redisUtil.set("qianZhuCity", jsonObjects);
return ResponseMsgUtil.success(jsonObjects);
JSONArray array = jsonObjects.getJSONArray("data");
List<JSONObject> list = new ArrayList<>();
for (Object obj : array) {
list.add((JSONObject) obj);
}
List<JSONObject> objectList = list.stream()
.filter(n -> n.getInteger("cityId") != null)
.collect(Collectors.toList());
redisUtil.set("qianZhuCity", objectList , 60*60*6);
return ResponseMsgUtil.success(objectList);
} else {
return ResponseMsgUtil.success(data);
@ -111,6 +123,40 @@ public class CommonController {
}
}
@RequestMapping(value = "/locateByLngAndLat", method = RequestMethod.GET)
@ResponseBody
@ApiOperation(value = "根据经纬度定位城市")
public ResponseData locateByLngAndLat(@RequestParam(name = "lng", required = true) String lng, @RequestParam(name = "lat", required = true) String lat) {
try {
String cityName = "重庆市";
ResponseData data = getAllQzCities();
if (Objects.equals(data.getReturn_code(), "000000")) {
List<JSONObject> array = (List<JSONObject>) data.getReturn_data();
for (JSONObject s : array) {
if (Objects.equals(s.getString("cityName"), cityName)) {
return ResponseMsgUtil.success(s);
}
}
return ResponseMsgUtil.success("未查询到任何内容!");
} else {
return ResponseMsgUtil.success(data.getReturn_msg());
}
} catch (Exception e) {
log.error("HighUserCardController --> oilCardRefund() error!", e);
return ResponseMsgUtil.exception(e);
}
}
@RequestMapping(value = "/listByCityId", method = RequestMethod.GET)
@ResponseBody
@ApiOperation(value = "查询城市区域")

@ -182,4 +182,71 @@ public class CinemaController {
return ResponseMsgUtil.exception(e);
}
}
@RequestMapping(value="/pagedQuery",method = RequestMethod.GET)
@ResponseBody
@ApiOperation(value = "分页查询场次")
public ResponseData pagedQuery(
@RequestParam(name = "cityId", required = false) Integer cityId,
@RequestParam(name = "cityCode", required = false) String cityCode,
@RequestParam(name = "cinemaId", required = false) Integer cinemaId,
@RequestParam(name = "filmId", required = false) Integer filmId,
@RequestParam(value = "showTimeBeginTime" , required = false) Long showTimeBeginTime,
@RequestParam(value = "showTimeEndTime" , required = false) Long showTimeEndTime,
@RequestParam(name = "pageNum", required = true) Integer pageNum,
@RequestParam(name = "pageSize", required = true) Integer pageSize
) {
try {
Map<String, Object> params = new HashMap<>();
if (cityId != null) {
params.put("cityId", cityId);
}
if (cityCode != null) {
params.put("cityCode", cityCode);
}
if (cinemaId != null) {
params.put("cinemaId", cinemaId);
}
if (filmId != null) {
params.put("filmId", filmId);
}
if (showTimeBeginTime != null) {
params.put("showTimeBeginTime", showTimeBeginTime);
}
if (showTimeEndTime != null) {
params.put("showTimeEndTime", showTimeEndTime);
}
params.put("pageIndex", pageNum);
params.put("pageSize", pageSize);
return ResponseMsgUtil.success(CinemaService.pagedQuery(params));
} catch (Exception e) {
log.error("error!",e);
return ResponseMsgUtil.exception(e);
}
}
@RequestMapping(value="/getRealTimeSeatByShowId",method = RequestMethod.GET)
@ResponseBody
@ApiOperation(value = "查询场次实时座位")
public ResponseData getRealTimeSeatByShowId(
@RequestParam(name = "showId", required = true) Long showId
) {
try {
Map<String, Object> params = new HashMap<>();
params.put("showId", showId);
return ResponseMsgUtil.success(CinemaService.getRealTimeSeatByShowId(params));
} catch (Exception e) {
log.error("error!",e);
return ResponseMsgUtil.exception(e);
}
}
}

@ -39,13 +39,13 @@ public interface RechargePriceMapper extends RechargePriceMapperExt {
int deleteByPrimaryKey(Long id);
@Insert({
"insert into recharge_price (discount, `type`, ",
"sort, price, pay_price, ",
"insert into recharge_price (`type`, sort, ",
"price, pay_price, ",
"create_time, update_time, ",
"`status`, ext_1, ext_2, ",
"ext_3)",
"values (#{discount,jdbcType=DECIMAL}, #{type,jdbcType=INTEGER}, ",
"#{sort,jdbcType=INTEGER}, #{price,jdbcType=DECIMAL}, #{payPrice,jdbcType=DECIMAL}, ",
"values (#{type,jdbcType=INTEGER}, #{sort,jdbcType=INTEGER}, ",
"#{price,jdbcType=DECIMAL}, #{payPrice,jdbcType=DECIMAL}, ",
"#{createTime,jdbcType=TIMESTAMP}, #{updateTime,jdbcType=TIMESTAMP}, ",
"#{status,jdbcType=INTEGER}, #{ext1,jdbcType=VARCHAR}, #{ext2,jdbcType=VARCHAR}, ",
"#{ext3,jdbcType=VARCHAR})"
@ -60,7 +60,6 @@ public interface RechargePriceMapper extends RechargePriceMapperExt {
@SelectProvider(type=RechargePriceSqlProvider.class, method="selectByExample")
@Results({
@Result(column="id", property="id", jdbcType=JdbcType.BIGINT, id=true),
@Result(column="discount", property="discount", jdbcType=JdbcType.DECIMAL),
@Result(column="type", property="type", jdbcType=JdbcType.INTEGER),
@Result(column="sort", property="sort", jdbcType=JdbcType.INTEGER),
@Result(column="price", property="price", jdbcType=JdbcType.DECIMAL),
@ -76,14 +75,13 @@ public interface RechargePriceMapper extends RechargePriceMapperExt {
@Select({
"select",
"id, discount, `type`, sort, price, pay_price, create_time, update_time, `status`, ",
"ext_1, ext_2, ext_3",
"id, `type`, sort, price, pay_price, create_time, update_time, `status`, ext_1, ",
"ext_2, ext_3",
"from recharge_price",
"where id = #{id,jdbcType=BIGINT}"
})
@Results({
@Result(column="id", property="id", jdbcType=JdbcType.BIGINT, id=true),
@Result(column="discount", property="discount", jdbcType=JdbcType.DECIMAL),
@Result(column="type", property="type", jdbcType=JdbcType.INTEGER),
@Result(column="sort", property="sort", jdbcType=JdbcType.INTEGER),
@Result(column="price", property="price", jdbcType=JdbcType.DECIMAL),
@ -108,8 +106,7 @@ public interface RechargePriceMapper extends RechargePriceMapperExt {
@Update({
"update recharge_price",
"set discount = #{discount,jdbcType=DECIMAL},",
"`type` = #{type,jdbcType=INTEGER},",
"set `type` = #{type,jdbcType=INTEGER},",
"sort = #{sort,jdbcType=INTEGER},",
"price = #{price,jdbcType=DECIMAL},",
"pay_price = #{payPrice,jdbcType=DECIMAL},",

@ -28,10 +28,6 @@ public class RechargePriceSqlProvider {
SQL sql = new SQL();
sql.INSERT_INTO("recharge_price");
if (record.getDiscount() != null) {
sql.VALUES("discount", "#{discount,jdbcType=DECIMAL}");
}
if (record.getType() != null) {
sql.VALUES("`type`", "#{type,jdbcType=INTEGER}");
}
@ -82,7 +78,6 @@ public class RechargePriceSqlProvider {
} else {
sql.SELECT("id");
}
sql.SELECT("discount");
sql.SELECT("`type`");
sql.SELECT("sort");
sql.SELECT("price");
@ -114,10 +109,6 @@ public class RechargePriceSqlProvider {
sql.SET("id = #{record.id,jdbcType=BIGINT}");
}
if (record.getDiscount() != null) {
sql.SET("discount = #{record.discount,jdbcType=DECIMAL}");
}
if (record.getType() != null) {
sql.SET("`type` = #{record.type,jdbcType=INTEGER}");
}
@ -167,7 +158,6 @@ public class RechargePriceSqlProvider {
sql.UPDATE("recharge_price");
sql.SET("id = #{record.id,jdbcType=BIGINT}");
sql.SET("discount = #{record.discount,jdbcType=DECIMAL}");
sql.SET("`type` = #{record.type,jdbcType=INTEGER}");
sql.SET("sort = #{record.sort,jdbcType=INTEGER}");
sql.SET("price = #{record.price,jdbcType=DECIMAL}");
@ -188,10 +178,6 @@ public class RechargePriceSqlProvider {
SQL sql = new SQL();
sql.UPDATE("recharge_price");
if (record.getDiscount() != null) {
sql.SET("discount = #{discount,jdbcType=DECIMAL}");
}
if (record.getType() != null) {
sql.SET("`type` = #{type,jdbcType=INTEGER}");
}

@ -19,11 +19,6 @@ public class RechargePrice implements Serializable {
*/
private Long id;
/**
* 折扣比例
*/
private BigDecimal discount;
/**
* 1 电信 2.移动 3.联通
*/
@ -75,14 +70,6 @@ public class RechargePrice implements Serializable {
this.id = id;
}
public BigDecimal getDiscount() {
return discount;
}
public void setDiscount(BigDecimal discount) {
this.discount = discount;
}
public Integer getType() {
return type;
}
@ -176,7 +163,6 @@ public class RechargePrice implements Serializable {
}
RechargePrice other = (RechargePrice) that;
return (this.getId() == null ? other.getId() == null : this.getId().equals(other.getId()))
&& (this.getDiscount() == null ? other.getDiscount() == null : this.getDiscount().equals(other.getDiscount()))
&& (this.getType() == null ? other.getType() == null : this.getType().equals(other.getType()))
&& (this.getSort() == null ? other.getSort() == null : this.getSort().equals(other.getSort()))
&& (this.getPrice() == null ? other.getPrice() == null : this.getPrice().equals(other.getPrice()))
@ -194,7 +180,6 @@ public class RechargePrice implements Serializable {
final int prime = 31;
int result = 1;
result = prime * result + ((getId() == null) ? 0 : getId().hashCode());
result = prime * result + ((getDiscount() == null) ? 0 : getDiscount().hashCode());
result = prime * result + ((getType() == null) ? 0 : getType().hashCode());
result = prime * result + ((getSort() == null) ? 0 : getSort().hashCode());
result = prime * result + ((getPrice() == null) ? 0 : getPrice().hashCode());
@ -215,7 +200,6 @@ public class RechargePrice implements Serializable {
sb.append(" [");
sb.append("Hash = ").append(hashCode());
sb.append(", id=").append(id);
sb.append(", discount=").append(discount);
sb.append(", type=").append(type);
sb.append(", sort=").append(sort);
sb.append(", price=").append(price);

@ -186,66 +186,6 @@ public class RechargePriceExample {
return (Criteria) this;
}
public Criteria andDiscountIsNull() {
addCriterion("discount is null");
return (Criteria) this;
}
public Criteria andDiscountIsNotNull() {
addCriterion("discount is not null");
return (Criteria) this;
}
public Criteria andDiscountEqualTo(BigDecimal value) {
addCriterion("discount =", value, "discount");
return (Criteria) this;
}
public Criteria andDiscountNotEqualTo(BigDecimal value) {
addCriterion("discount <>", value, "discount");
return (Criteria) this;
}
public Criteria andDiscountGreaterThan(BigDecimal value) {
addCriterion("discount >", value, "discount");
return (Criteria) this;
}
public Criteria andDiscountGreaterThanOrEqualTo(BigDecimal value) {
addCriterion("discount >=", value, "discount");
return (Criteria) this;
}
public Criteria andDiscountLessThan(BigDecimal value) {
addCriterion("discount <", value, "discount");
return (Criteria) this;
}
public Criteria andDiscountLessThanOrEqualTo(BigDecimal value) {
addCriterion("discount <=", value, "discount");
return (Criteria) this;
}
public Criteria andDiscountIn(List<BigDecimal> values) {
addCriterion("discount in", values, "discount");
return (Criteria) this;
}
public Criteria andDiscountNotIn(List<BigDecimal> values) {
addCriterion("discount not in", values, "discount");
return (Criteria) this;
}
public Criteria andDiscountBetween(BigDecimal value1, BigDecimal value2) {
addCriterion("discount between", value1, value2, "discount");
return (Criteria) this;
}
public Criteria andDiscountNotBetween(BigDecimal value1, BigDecimal value2) {
addCriterion("discount not between", value1, value2, "discount");
return (Criteria) this;
}
public Criteria andTypeIsNull() {
addCriterion("`type` is null");
return (Criteria) this;

@ -26,7 +26,7 @@ public class CinemaService {
*/
public static JSONObject filmsPagedQuery(Map<String , Object> map) throws Exception {
JSONObject object = QianZhuService.request("/openApi/v1/films/pagedQuery" , map);
JSONObject object = QianZhuService.request("/openApi/v1/films/filmsPagedQuery" , map);
if (object.getBoolean("success") && object.getInteger("code") == 10000) {
return object;
@ -135,6 +135,45 @@ public class CinemaService {
}
/**
* @MethodName pagedQuery
* @Description: 分页查询场次
* @param map
* @return: com.alibaba.fastjson.JSONObject
* @Author: Sum1Dream
* @Date: 2024/6/25 上午9:58
*/
public static JSONObject pagedQuery(Map<String , Object> map) throws Exception {
JSONObject object = QianZhuService.request("/openApi/v2/shows/pagedQuery" , map);
if (object.getBoolean("success") && object.getInteger("code") == 10000) {
return object;
} else {
throw ErrorHelp.genException(SysCode.System, ErrorCode.COMMON_ERROR, "查询失败!");
}
}
/**
* @MethodName getRealTimeSeatByShowId
* @Description:查询场次实时座位
* @param map
* @return: com.alibaba.fastjson.JSONObject
* @Author: Sum1Dream
* @Date: 2024/6/25 上午10:23
*/
public static JSONObject getRealTimeSeatByShowId(Map<String , Object> map) throws Exception {
JSONObject object = QianZhuService.request("/openApi/v1/shows/getRealTimeSeatByShowId" , map);
if (object.getBoolean("success") && object.getInteger("code") == 10000) {
return object;
} else {
throw ErrorHelp.genException(SysCode.System, ErrorCode.COMMON_ERROR, "查询失败!");
}
}

@ -5,13 +5,11 @@ import com.alibaba.fastjson.JSONObject;
import com.hfkj.common.exception.ErrorCode;
import com.hfkj.common.exception.ErrorHelp;
import com.hfkj.common.exception.SysCode;
import com.hfkj.common.pay.util.sdk.WXPayConstants;
import com.hfkj.common.utils.HttpsUtils;
import com.hfkj.common.utils.MD5Util;
import com.hfkj.common.utils.WxUtils;
import com.hfkj.config.CommonSysConst;
import com.hfkj.config.GenerateSign;
import org.apache.commons.lang3.StringUtils;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
@ -86,6 +84,7 @@ public class QianZhuService {
*/
public static JSONObject getAllCities() throws Exception {
JSONObject object = QianZhuService.request("/openApi/v2/cities/listAll" , new HashMap<>());
if (object.getBoolean("success") && object.getInteger("code") == 10000) {

@ -0,0 +1,63 @@
package com.hfkj.service.recharge;
import com.hfkj.entity.RechargeCode;
import java.util.List;
import java.util.Map;
/**
* @ClassName RechargeCodeService
* @Author Sum1Dream
* @Description
* @Date 2024/6/24 下午3:07
**/
public interface RechargeCodeService {
/**
* @MethodName create
* @Description: 创建
* @param rechargeCode
* @Author: Sum1Dream
* @Date: 2024/6/24 下午3:10
*/
void create(RechargeCode rechargeCode);
/**
* @MethodName update
* @Description: 更新
* @param rechargeCode
* @Author: Sum1Dream
* @Date: 2024/6/24 下午3:11
*/
void update(RechargeCode rechargeCode);
/**
* @MethodName delete
* @Description: 删除
* @param id
* @param fullDelete
* @Author: Sum1Dream
* @Date: 2024/6/24 下午3:11
*/
void delete(Long id , Boolean fullDelete);
/**
* @MethodName queryDetail
* @Description: 查询详情
* @param id
* @return: com.hfkj.entity.RechargeCode
* @Author: Sum1Dream
* @Date: 2024/6/24 下午3:11
*/
RechargeCode queryDetail(Long id);
/**
* @MethodName getList
* @Description: 查询列表
* @param map
* @return: java.util.List<com.hfkj.entity.RechargeCode>
* @Author: Sum1Dream
* @Date: 2024/6/24 下午3:11
*/
List<RechargeCode> getList(Map<String , Object> map);
}

@ -0,0 +1,43 @@
package com.hfkj.service.recharge.impl;
import com.hfkj.dao.RechargeCodeMapper;
import com.hfkj.entity.RechargeCode;
import com.hfkj.service.recharge.RechargeCodeService;
import org.springframework.stereotype.Service;
import javax.annotation.Resource;
import java.util.Collections;
import java.util.List;
import java.util.Map;
@Service("rechargeCodeService")
public class RechargeCodeServiceImpl implements RechargeCodeService {
@Resource
private RechargeCodeMapper rechargeCodeMapper;
@Override
public void create(RechargeCode rechargeCode) {
rechargeCodeMapper.insert(rechargeCode);
}
@Override
public void update(RechargeCode rechargeCode) {
rechargeCodeMapper.updateByPrimaryKeySelective(rechargeCode);
}
@Override
public void delete(Long id, Boolean fullDelete) {
rechargeCodeMapper.deleteByPrimaryKey(id);
}
@Override
public RechargeCode queryDetail(Long id) {
return rechargeCodeMapper.selectByPrimaryKey(id);
}
@Override
public List<RechargeCode> getList(Map<String, Object> map) {
return Collections.emptyList();
}
}
Loading…
Cancel
Save