提交代码

dev-discount
胡锐 2 years ago
parent ea91185db8
commit 817797ee2e
  1. 2
      hai-bweb/src/main/java/com/bweb/controller/LoginController.java
  2. 24
      hai-order/src/main/java/com/web/controller/business/OrderOilController.java
  3. 19
      hai-service/src/main/java/com/hai/dao/HighUserLoginLogMapper.java
  4. 30
      hai-service/src/main/java/com/hai/dao/HighUserLoginLogSqlProvider.java
  5. 10
      hai-service/src/main/java/com/hai/dao/order/OrderMapperExt.java
  6. 34
      hai-service/src/main/java/com/hai/entity/HighUserLoginLog.java
  7. 126
      hai-service/src/main/java/com/hai/entity/HighUserLoginLogExample.java
  8. 2
      hai-service/src/main/java/com/hai/enum_type/LoginPlatform.java
  9. 14
      hai-service/src/main/java/com/hai/order/model/ExportGasOrderModel.java
  10. 12
      hai-service/src/main/java/com/hai/order/model/OrderCouponModel.java
  11. 12
      hai-service/src/main/java/com/hai/order/model/OrderIntegralRechargeModel.java
  12. 4
      hai-service/src/main/java/com/hai/order/service/impl/OrderCreateHandleServiceImpl.java
  13. 4
      hai-service/src/main/java/com/hai/service/HighUserService.java
  14. 11
      hai-service/src/main/java/com/hai/service/impl/HighUserServiceImpl.java
  15. 23
      hai-service/src/main/java/com/hai/user/service/UserLoginLogService.java
  16. 37
      hai-service/src/main/java/com/hai/user/service/impl/UserLoginLogServiceImpl.java
  17. 2
      hai-user/src/main/java/com/web/controller/LoginController.java
  18. 1
      hai-user/src/main/java/com/web/controller/LoginLogController.java
  19. 31
      hai-user/src/main/java/com/web/controller/UserController.java
  20. 26
      hai-user/src/main/resources/dev/config.properties

@ -239,7 +239,7 @@ public class LoginController {
String aesStr = AESEncodeUtil.aesEncrypt(secUser.getId().toString()); String aesStr = AESEncodeUtil.aesEncrypt(secUser.getId().toString());
userInfoModel.setToken(aesStr); userInfoModel.setToken(aesStr);
SessionObject so = new SessionObject(aesStr, secUser.getObjectType(), userInfoModel); SessionObject so = new SessionObject(aesStr, secUser.getObjectType(), userInfoModel);
userCenter.save(null,null,so); userCenter.save(request,response,so);
return ResponseMsgUtil.success(so); return ResponseMsgUtil.success(so);
} catch (Exception e) { } catch (Exception e) {
log.error("login error!",e); log.error("login error!",e);

@ -160,6 +160,20 @@ public class OrderOilController {
} }
@RequestMapping(value="/getOrderByOrderNo",method = RequestMethod.GET)
@ResponseBody
@ApiOperation(value = "根据订单号查询")
public ResponseData getOrderByOrderNo(@RequestParam(name = "orderNo", required = true) String orderNo) {
try {
return ResponseMsgUtil.success(gasOrderService.getDetailByOrderNo(orderNo));
} catch (Exception e) {
log.error("HighGasOrderController -> getOrderByOrderNo() error!",e);
return ResponseMsgUtil.exception(e);
}
}
@RequestMapping(value="/getOilOrderDetail",method = RequestMethod.GET) @RequestMapping(value="/getOilOrderDetail",method = RequestMethod.GET)
@ResponseBody @ResponseBody
@ApiOperation(value = "查询油站详情") @ApiOperation(value = "查询油站详情")
@ -293,9 +307,11 @@ public class OrderOilController {
model.setGasPricePlatform(gasOrder.getGasPricePlatform()); model.setGasPricePlatform(gasOrder.getGasPricePlatform());
model.setGasPriceGun(gasOrder.getGasPriceGun()); model.setGasPriceGun(gasOrder.getGasPriceGun());
model.setGasPriceOfficial(gasOrder.getGasPriceOfficial()); model.setGasPriceOfficial(gasOrder.getGasPriceOfficial());
model.setDeductionPrice(gasOrder.getTotalDeductionPrice()); model.setTotalDeductionPrice(gasOrder.getTotalDeductionPrice());
model.setDeductionCouponPrice(gasOrder.getDeductionCouponPrice());
model.setDeductionProductPrice(gasOrder.getDeductionProductPrice());
model.setPayablePrice(gasOrder.getPayablePrice()); model.setPayablePrice(gasOrder.getPayablePrice());
model.setPayGold(gasOrder.getPayGold()); model.setPayGold(gasOrder.getPayGold()/100);
model.setPayPrice(gasOrder.getPayPrice()!=null?gasOrder.getPayPrice().toString():"未支付"); model.setPayPrice(gasOrder.getPayPrice()!=null?gasOrder.getPayPrice().toString():"未支付");
model.setStatus(OrderOilStatus.getNameByType(gasOrder.getStatus())); model.setStatus(OrderOilStatus.getNameByType(gasOrder.getStatus()));
model.setCreateTime(gasOrder.getCreateTime()); model.setCreateTime(gasOrder.getCreateTime());
@ -329,7 +345,9 @@ public class OrderOilController {
includeColumnFiledNames.add("gasPricePlatform"); includeColumnFiledNames.add("gasPricePlatform");
includeColumnFiledNames.add("gasPriceGun"); includeColumnFiledNames.add("gasPriceGun");
includeColumnFiledNames.add("gasPriceOfficial"); includeColumnFiledNames.add("gasPriceOfficial");
includeColumnFiledNames.add("deductionPrice"); includeColumnFiledNames.add("totalDeductionPrice");
includeColumnFiledNames.add("deductionCouponPrice");
includeColumnFiledNames.add("deductionProductPrice");
includeColumnFiledNames.add("payablePrice"); includeColumnFiledNames.add("payablePrice");
includeColumnFiledNames.add("payGold"); includeColumnFiledNames.add("payGold");
includeColumnFiledNames.add("payPrice"); includeColumnFiledNames.add("payPrice");

@ -40,12 +40,14 @@ public interface HighUserLoginLogMapper extends HighUserLoginLogMapperExt {
@Insert({ @Insert({
"insert into high_user_login_log (user_id, user_phone, ", "insert into high_user_login_log (user_id, user_phone, ",
"platform, ip, province_name, ", "platform_code, platform_name, ",
"ip, province_name, ",
"city_code, city_name, ", "city_code, city_name, ",
"`status`, create_time, ", "`status`, create_time, ",
"ext_1, ext_2, ext_3)", "ext_1, ext_2, ext_3)",
"values (#{userId,jdbcType=BIGINT}, #{userPhone,jdbcType=VARCHAR}, ", "values (#{userId,jdbcType=BIGINT}, #{userPhone,jdbcType=VARCHAR}, ",
"#{platform,jdbcType=VARCHAR}, #{ip,jdbcType=VARCHAR}, #{provinceName,jdbcType=VARCHAR}, ", "#{platformCode,jdbcType=VARCHAR}, #{platformName,jdbcType=VARCHAR}, ",
"#{ip,jdbcType=VARCHAR}, #{provinceName,jdbcType=VARCHAR}, ",
"#{cityCode,jdbcType=VARCHAR}, #{cityName,jdbcType=VARCHAR}, ", "#{cityCode,jdbcType=VARCHAR}, #{cityName,jdbcType=VARCHAR}, ",
"#{status,jdbcType=INTEGER}, #{createTime,jdbcType=TIMESTAMP}, ", "#{status,jdbcType=INTEGER}, #{createTime,jdbcType=TIMESTAMP}, ",
"#{ext1,jdbcType=VARCHAR}, #{ext2,jdbcType=VARCHAR}, #{ext3,jdbcType=VARCHAR})" "#{ext1,jdbcType=VARCHAR}, #{ext2,jdbcType=VARCHAR}, #{ext3,jdbcType=VARCHAR})"
@ -62,7 +64,8 @@ public interface HighUserLoginLogMapper extends HighUserLoginLogMapperExt {
@Result(column="id", property="id", jdbcType=JdbcType.BIGINT, id=true), @Result(column="id", property="id", jdbcType=JdbcType.BIGINT, id=true),
@Result(column="user_id", property="userId", jdbcType=JdbcType.BIGINT), @Result(column="user_id", property="userId", jdbcType=JdbcType.BIGINT),
@Result(column="user_phone", property="userPhone", jdbcType=JdbcType.VARCHAR), @Result(column="user_phone", property="userPhone", jdbcType=JdbcType.VARCHAR),
@Result(column="platform", property="platform", jdbcType=JdbcType.VARCHAR), @Result(column="platform_code", property="platformCode", jdbcType=JdbcType.VARCHAR),
@Result(column="platform_name", property="platformName", jdbcType=JdbcType.VARCHAR),
@Result(column="ip", property="ip", jdbcType=JdbcType.VARCHAR), @Result(column="ip", property="ip", jdbcType=JdbcType.VARCHAR),
@Result(column="province_name", property="provinceName", jdbcType=JdbcType.VARCHAR), @Result(column="province_name", property="provinceName", jdbcType=JdbcType.VARCHAR),
@Result(column="city_code", property="cityCode", jdbcType=JdbcType.VARCHAR), @Result(column="city_code", property="cityCode", jdbcType=JdbcType.VARCHAR),
@ -77,8 +80,8 @@ public interface HighUserLoginLogMapper extends HighUserLoginLogMapperExt {
@Select({ @Select({
"select", "select",
"id, user_id, user_phone, platform, ip, province_name, city_code, city_name, ", "id, user_id, user_phone, platform_code, platform_name, ip, province_name, city_code, ",
"`status`, create_time, ext_1, ext_2, ext_3", "city_name, `status`, create_time, ext_1, ext_2, ext_3",
"from high_user_login_log", "from high_user_login_log",
"where id = #{id,jdbcType=BIGINT}" "where id = #{id,jdbcType=BIGINT}"
}) })
@ -86,7 +89,8 @@ public interface HighUserLoginLogMapper extends HighUserLoginLogMapperExt {
@Result(column="id", property="id", jdbcType=JdbcType.BIGINT, id=true), @Result(column="id", property="id", jdbcType=JdbcType.BIGINT, id=true),
@Result(column="user_id", property="userId", jdbcType=JdbcType.BIGINT), @Result(column="user_id", property="userId", jdbcType=JdbcType.BIGINT),
@Result(column="user_phone", property="userPhone", jdbcType=JdbcType.VARCHAR), @Result(column="user_phone", property="userPhone", jdbcType=JdbcType.VARCHAR),
@Result(column="platform", property="platform", jdbcType=JdbcType.VARCHAR), @Result(column="platform_code", property="platformCode", jdbcType=JdbcType.VARCHAR),
@Result(column="platform_name", property="platformName", jdbcType=JdbcType.VARCHAR),
@Result(column="ip", property="ip", jdbcType=JdbcType.VARCHAR), @Result(column="ip", property="ip", jdbcType=JdbcType.VARCHAR),
@Result(column="province_name", property="provinceName", jdbcType=JdbcType.VARCHAR), @Result(column="province_name", property="provinceName", jdbcType=JdbcType.VARCHAR),
@Result(column="city_code", property="cityCode", jdbcType=JdbcType.VARCHAR), @Result(column="city_code", property="cityCode", jdbcType=JdbcType.VARCHAR),
@ -112,7 +116,8 @@ public interface HighUserLoginLogMapper extends HighUserLoginLogMapperExt {
"update high_user_login_log", "update high_user_login_log",
"set user_id = #{userId,jdbcType=BIGINT},", "set user_id = #{userId,jdbcType=BIGINT},",
"user_phone = #{userPhone,jdbcType=VARCHAR},", "user_phone = #{userPhone,jdbcType=VARCHAR},",
"platform = #{platform,jdbcType=VARCHAR},", "platform_code = #{platformCode,jdbcType=VARCHAR},",
"platform_name = #{platformName,jdbcType=VARCHAR},",
"ip = #{ip,jdbcType=VARCHAR},", "ip = #{ip,jdbcType=VARCHAR},",
"province_name = #{provinceName,jdbcType=VARCHAR},", "province_name = #{provinceName,jdbcType=VARCHAR},",
"city_code = #{cityCode,jdbcType=VARCHAR},", "city_code = #{cityCode,jdbcType=VARCHAR},",

@ -36,8 +36,12 @@ public class HighUserLoginLogSqlProvider {
sql.VALUES("user_phone", "#{userPhone,jdbcType=VARCHAR}"); sql.VALUES("user_phone", "#{userPhone,jdbcType=VARCHAR}");
} }
if (record.getPlatform() != null) { if (record.getPlatformCode() != null) {
sql.VALUES("platform", "#{platform,jdbcType=VARCHAR}"); sql.VALUES("platform_code", "#{platformCode,jdbcType=VARCHAR}");
}
if (record.getPlatformName() != null) {
sql.VALUES("platform_name", "#{platformName,jdbcType=VARCHAR}");
} }
if (record.getIp() != null) { if (record.getIp() != null) {
@ -88,7 +92,8 @@ public class HighUserLoginLogSqlProvider {
} }
sql.SELECT("user_id"); sql.SELECT("user_id");
sql.SELECT("user_phone"); sql.SELECT("user_phone");
sql.SELECT("platform"); sql.SELECT("platform_code");
sql.SELECT("platform_name");
sql.SELECT("ip"); sql.SELECT("ip");
sql.SELECT("province_name"); sql.SELECT("province_name");
sql.SELECT("city_code"); sql.SELECT("city_code");
@ -127,8 +132,12 @@ public class HighUserLoginLogSqlProvider {
sql.SET("user_phone = #{record.userPhone,jdbcType=VARCHAR}"); sql.SET("user_phone = #{record.userPhone,jdbcType=VARCHAR}");
} }
if (record.getPlatform() != null) { if (record.getPlatformCode() != null) {
sql.SET("platform = #{record.platform,jdbcType=VARCHAR}"); sql.SET("platform_code = #{record.platformCode,jdbcType=VARCHAR}");
}
if (record.getPlatformName() != null) {
sql.SET("platform_name = #{record.platformName,jdbcType=VARCHAR}");
} }
if (record.getIp() != null) { if (record.getIp() != null) {
@ -178,7 +187,8 @@ public class HighUserLoginLogSqlProvider {
sql.SET("id = #{record.id,jdbcType=BIGINT}"); sql.SET("id = #{record.id,jdbcType=BIGINT}");
sql.SET("user_id = #{record.userId,jdbcType=BIGINT}"); sql.SET("user_id = #{record.userId,jdbcType=BIGINT}");
sql.SET("user_phone = #{record.userPhone,jdbcType=VARCHAR}"); sql.SET("user_phone = #{record.userPhone,jdbcType=VARCHAR}");
sql.SET("platform = #{record.platform,jdbcType=VARCHAR}"); sql.SET("platform_code = #{record.platformCode,jdbcType=VARCHAR}");
sql.SET("platform_name = #{record.platformName,jdbcType=VARCHAR}");
sql.SET("ip = #{record.ip,jdbcType=VARCHAR}"); sql.SET("ip = #{record.ip,jdbcType=VARCHAR}");
sql.SET("province_name = #{record.provinceName,jdbcType=VARCHAR}"); sql.SET("province_name = #{record.provinceName,jdbcType=VARCHAR}");
sql.SET("city_code = #{record.cityCode,jdbcType=VARCHAR}"); sql.SET("city_code = #{record.cityCode,jdbcType=VARCHAR}");
@ -206,8 +216,12 @@ public class HighUserLoginLogSqlProvider {
sql.SET("user_phone = #{userPhone,jdbcType=VARCHAR}"); sql.SET("user_phone = #{userPhone,jdbcType=VARCHAR}");
} }
if (record.getPlatform() != null) { if (record.getPlatformCode() != null) {
sql.SET("platform = #{platform,jdbcType=VARCHAR}"); sql.SET("platform_code = #{platformCode,jdbcType=VARCHAR}");
}
if (record.getPlatformName() != null) {
sql.SET("platform_name = #{platformName,jdbcType=VARCHAR}");
} }
if (record.getIp() != null) { if (record.getIp() != null) {

@ -31,9 +31,11 @@ public interface OrderMapperExt {
" a.goods_name couponName," + " a.goods_name couponName," +
" a.goods_price couponPrice," + " a.goods_price couponPrice," +
" b.total_price totalPrice," + " b.total_price totalPrice," +
" b.deduction_price deductionPrice," + " b.total_deduction_price totalDeductionPrice," +
" b.deduction_coupon_price deductionCouponPrice," +
" b.deduction_product_price deductionProductPrice," +
" b.payable_price payablePrice," + " b.payable_price payablePrice," +
" b.pay_gold payGold," + " b.pay_gold/100 payGold," +
" b.pay_price payPrice," + " b.pay_price payPrice," +
" CASE b.pay_type " + " CASE b.pay_type " +
" WHEN 1 THEN '支付宝' " + " WHEN 1 THEN '支付宝' " +
@ -81,7 +83,9 @@ public interface OrderMapperExt {
" b.mem_phone memPhone," + " b.mem_phone memPhone," +
" a.goods_price*100 goodsPrice," + " a.goods_price*100 goodsPrice," +
" b.total_price totalPrice," + " b.total_price totalPrice," +
" b.deduction_price deductionPrice," + " b.total_deduction_price totalDeductionPrice," +
" b.deduction_coupon_price deductionCouponPrice," +
" b.deduction_product_price deductionProductPrice," +
" b.payable_price payablePrice," + " b.payable_price payablePrice," +
" b.pay_gold payGold," + " b.pay_gold payGold," +
" b.pay_price payPrice," + " b.pay_price payPrice," +

@ -29,9 +29,14 @@ public class HighUserLoginLog implements Serializable {
private String userPhone; private String userPhone;
/** /**
* 登录平台 * 登录平台code
*/ */
private String platform; private String platformCode;
/**
* 登录平台名称
*/
private String platformName;
/** /**
* ip地址 * ip地址
@ -104,12 +109,20 @@ public class HighUserLoginLog implements Serializable {
this.userPhone = userPhone; this.userPhone = userPhone;
} }
public String getPlatform() { public String getPlatformCode() {
return platform; return platformCode;
}
public void setPlatformCode(String platformCode) {
this.platformCode = platformCode;
}
public String getPlatformName() {
return platformName;
} }
public void setPlatform(String platform) { public void setPlatformName(String platformName) {
this.platform = platform; this.platformName = platformName;
} }
public String getIp() { public String getIp() {
@ -199,7 +212,8 @@ public class HighUserLoginLog implements Serializable {
return (this.getId() == null ? other.getId() == null : this.getId().equals(other.getId())) return (this.getId() == null ? other.getId() == null : this.getId().equals(other.getId()))
&& (this.getUserId() == null ? other.getUserId() == null : this.getUserId().equals(other.getUserId())) && (this.getUserId() == null ? other.getUserId() == null : this.getUserId().equals(other.getUserId()))
&& (this.getUserPhone() == null ? other.getUserPhone() == null : this.getUserPhone().equals(other.getUserPhone())) && (this.getUserPhone() == null ? other.getUserPhone() == null : this.getUserPhone().equals(other.getUserPhone()))
&& (this.getPlatform() == null ? other.getPlatform() == null : this.getPlatform().equals(other.getPlatform())) && (this.getPlatformCode() == null ? other.getPlatformCode() == null : this.getPlatformCode().equals(other.getPlatformCode()))
&& (this.getPlatformName() == null ? other.getPlatformName() == null : this.getPlatformName().equals(other.getPlatformName()))
&& (this.getIp() == null ? other.getIp() == null : this.getIp().equals(other.getIp())) && (this.getIp() == null ? other.getIp() == null : this.getIp().equals(other.getIp()))
&& (this.getProvinceName() == null ? other.getProvinceName() == null : this.getProvinceName().equals(other.getProvinceName())) && (this.getProvinceName() == null ? other.getProvinceName() == null : this.getProvinceName().equals(other.getProvinceName()))
&& (this.getCityCode() == null ? other.getCityCode() == null : this.getCityCode().equals(other.getCityCode())) && (this.getCityCode() == null ? other.getCityCode() == null : this.getCityCode().equals(other.getCityCode()))
@ -218,7 +232,8 @@ public class HighUserLoginLog implements Serializable {
result = prime * result + ((getId() == null) ? 0 : getId().hashCode()); result = prime * result + ((getId() == null) ? 0 : getId().hashCode());
result = prime * result + ((getUserId() == null) ? 0 : getUserId().hashCode()); result = prime * result + ((getUserId() == null) ? 0 : getUserId().hashCode());
result = prime * result + ((getUserPhone() == null) ? 0 : getUserPhone().hashCode()); result = prime * result + ((getUserPhone() == null) ? 0 : getUserPhone().hashCode());
result = prime * result + ((getPlatform() == null) ? 0 : getPlatform().hashCode()); result = prime * result + ((getPlatformCode() == null) ? 0 : getPlatformCode().hashCode());
result = prime * result + ((getPlatformName() == null) ? 0 : getPlatformName().hashCode());
result = prime * result + ((getIp() == null) ? 0 : getIp().hashCode()); result = prime * result + ((getIp() == null) ? 0 : getIp().hashCode());
result = prime * result + ((getProvinceName() == null) ? 0 : getProvinceName().hashCode()); result = prime * result + ((getProvinceName() == null) ? 0 : getProvinceName().hashCode());
result = prime * result + ((getCityCode() == null) ? 0 : getCityCode().hashCode()); result = prime * result + ((getCityCode() == null) ? 0 : getCityCode().hashCode());
@ -240,7 +255,8 @@ public class HighUserLoginLog implements Serializable {
sb.append(", id=").append(id); sb.append(", id=").append(id);
sb.append(", userId=").append(userId); sb.append(", userId=").append(userId);
sb.append(", userPhone=").append(userPhone); sb.append(", userPhone=").append(userPhone);
sb.append(", platform=").append(platform); sb.append(", platformCode=").append(platformCode);
sb.append(", platformName=").append(platformName);
sb.append(", ip=").append(ip); sb.append(", ip=").append(ip);
sb.append(", provinceName=").append(provinceName); sb.append(", provinceName=").append(provinceName);
sb.append(", cityCode=").append(cityCode); sb.append(", cityCode=").append(cityCode);

@ -315,73 +315,143 @@ public class HighUserLoginLogExample {
return (Criteria) this; return (Criteria) this;
} }
public Criteria andPlatformIsNull() { public Criteria andPlatformCodeIsNull() {
addCriterion("platform is null"); addCriterion("platform_code is null");
return (Criteria) this; return (Criteria) this;
} }
public Criteria andPlatformIsNotNull() { public Criteria andPlatformCodeIsNotNull() {
addCriterion("platform is not null"); addCriterion("platform_code is not null");
return (Criteria) this; return (Criteria) this;
} }
public Criteria andPlatformEqualTo(String value) { public Criteria andPlatformCodeEqualTo(String value) {
addCriterion("platform =", value, "platform"); addCriterion("platform_code =", value, "platformCode");
return (Criteria) this; return (Criteria) this;
} }
public Criteria andPlatformNotEqualTo(String value) { public Criteria andPlatformCodeNotEqualTo(String value) {
addCriterion("platform <>", value, "platform"); addCriterion("platform_code <>", value, "platformCode");
return (Criteria) this; return (Criteria) this;
} }
public Criteria andPlatformGreaterThan(String value) { public Criteria andPlatformCodeGreaterThan(String value) {
addCriterion("platform >", value, "platform"); addCriterion("platform_code >", value, "platformCode");
return (Criteria) this; return (Criteria) this;
} }
public Criteria andPlatformGreaterThanOrEqualTo(String value) { public Criteria andPlatformCodeGreaterThanOrEqualTo(String value) {
addCriterion("platform >=", value, "platform"); addCriterion("platform_code >=", value, "platformCode");
return (Criteria) this; return (Criteria) this;
} }
public Criteria andPlatformLessThan(String value) { public Criteria andPlatformCodeLessThan(String value) {
addCriterion("platform <", value, "platform"); addCriterion("platform_code <", value, "platformCode");
return (Criteria) this; return (Criteria) this;
} }
public Criteria andPlatformLessThanOrEqualTo(String value) { public Criteria andPlatformCodeLessThanOrEqualTo(String value) {
addCriterion("platform <=", value, "platform"); addCriterion("platform_code <=", value, "platformCode");
return (Criteria) this; return (Criteria) this;
} }
public Criteria andPlatformLike(String value) { public Criteria andPlatformCodeLike(String value) {
addCriterion("platform like", value, "platform"); addCriterion("platform_code like", value, "platformCode");
return (Criteria) this; return (Criteria) this;
} }
public Criteria andPlatformNotLike(String value) { public Criteria andPlatformCodeNotLike(String value) {
addCriterion("platform not like", value, "platform"); addCriterion("platform_code not like", value, "platformCode");
return (Criteria) this; return (Criteria) this;
} }
public Criteria andPlatformIn(List<String> values) { public Criteria andPlatformCodeIn(List<String> values) {
addCriterion("platform in", values, "platform"); addCriterion("platform_code in", values, "platformCode");
return (Criteria) this; return (Criteria) this;
} }
public Criteria andPlatformNotIn(List<String> values) { public Criteria andPlatformCodeNotIn(List<String> values) {
addCriterion("platform not in", values, "platform"); addCriterion("platform_code not in", values, "platformCode");
return (Criteria) this; return (Criteria) this;
} }
public Criteria andPlatformBetween(String value1, String value2) { public Criteria andPlatformCodeBetween(String value1, String value2) {
addCriterion("platform between", value1, value2, "platform"); addCriterion("platform_code between", value1, value2, "platformCode");
return (Criteria) this; return (Criteria) this;
} }
public Criteria andPlatformNotBetween(String value1, String value2) { public Criteria andPlatformCodeNotBetween(String value1, String value2) {
addCriterion("platform not between", value1, value2, "platform"); addCriterion("platform_code not between", value1, value2, "platformCode");
return (Criteria) this;
}
public Criteria andPlatformNameIsNull() {
addCriterion("platform_name is null");
return (Criteria) this;
}
public Criteria andPlatformNameIsNotNull() {
addCriterion("platform_name is not null");
return (Criteria) this;
}
public Criteria andPlatformNameEqualTo(String value) {
addCriterion("platform_name =", value, "platformName");
return (Criteria) this;
}
public Criteria andPlatformNameNotEqualTo(String value) {
addCriterion("platform_name <>", value, "platformName");
return (Criteria) this;
}
public Criteria andPlatformNameGreaterThan(String value) {
addCriterion("platform_name >", value, "platformName");
return (Criteria) this;
}
public Criteria andPlatformNameGreaterThanOrEqualTo(String value) {
addCriterion("platform_name >=", value, "platformName");
return (Criteria) this;
}
public Criteria andPlatformNameLessThan(String value) {
addCriterion("platform_name <", value, "platformName");
return (Criteria) this;
}
public Criteria andPlatformNameLessThanOrEqualTo(String value) {
addCriterion("platform_name <=", value, "platformName");
return (Criteria) this;
}
public Criteria andPlatformNameLike(String value) {
addCriterion("platform_name like", value, "platformName");
return (Criteria) this;
}
public Criteria andPlatformNameNotLike(String value) {
addCriterion("platform_name not like", value, "platformName");
return (Criteria) this;
}
public Criteria andPlatformNameIn(List<String> values) {
addCriterion("platform_name in", values, "platformName");
return (Criteria) this;
}
public Criteria andPlatformNameNotIn(List<String> values) {
addCriterion("platform_name not in", values, "platformName");
return (Criteria) this;
}
public Criteria andPlatformNameBetween(String value1, String value2) {
addCriterion("platform_name between", value1, value2, "platformName");
return (Criteria) this;
}
public Criteria andPlatformNameNotBetween(String value1, String value2) {
addCriterion("platform_name not between", value1, value2, "platformName");
return (Criteria) this; return (Criteria) this;
} }

@ -9,7 +9,7 @@ import java.util.Objects;
* @date: 2022/10/20 * @date: 2022/10/20
**/ **/
public enum LoginPlatform { public enum LoginPlatform {
H5("WEB", "H5客户端"), H5("H5", "H5客户端"),
WXAPPLETS("WXAPPLETS", "微信小程序"), WXAPPLETS("WXAPPLETS", "微信小程序"),
UNIONPAY("UNIONPAY", "云闪付"), UNIONPAY("UNIONPAY", "云闪付"),
; ;

@ -48,11 +48,11 @@ public class ExportGasOrderModel {
@ExcelProperty({ "加油信息", "油枪号"}) @ExcelProperty({ "加油信息", "油枪号"})
private String gasGunNo; private String gasGunNo;
@ColumnWidth(10) @ColumnWidth(15)
@ExcelProperty({ "加油信息", "平台折扣"}) @ExcelProperty({ "加油信息", "平台折扣"})
private String gasDiscount; private String gasDiscount;
@ColumnWidth(10) @ColumnWidth(15)
@ExcelProperty({ "加油信息", "平台补贴"}) @ExcelProperty({ "加油信息", "平台补贴"})
private BigDecimal gasOilSubsidy; private BigDecimal gasOilSubsidy;
@ -68,9 +68,17 @@ public class ExportGasOrderModel {
@ExcelProperty({ "加油信息", "国标价"}) @ExcelProperty({ "加油信息", "国标价"})
private BigDecimal gasPriceOfficial; private BigDecimal gasPriceOfficial;
@ColumnWidth(15)
@ExcelProperty({ "支付信息", "总优惠"})
private BigDecimal totalDeductionPrice;
@ColumnWidth(15)
@ExcelProperty({ "支付信息", "优惠券优惠"})
private BigDecimal deductionCouponPrice;
@ColumnWidth(15) @ColumnWidth(15)
@ExcelProperty({ "支付信息", "加油优惠"}) @ExcelProperty({ "支付信息", "加油优惠"})
private BigDecimal deductionPrice; private BigDecimal deductionProductPrice;
@ColumnWidth(15) @ColumnWidth(15)
@ExcelProperty({ "支付信息", "应付金额"}) @ExcelProperty({ "支付信息", "应付金额"})

@ -37,8 +37,16 @@ public class OrderCouponModel {
private BigDecimal totalPrice; private BigDecimal totalPrice;
@ColumnWidth(13) @ColumnWidth(13)
@ExcelProperty(value = "优惠价格") @ExcelProperty(value = "总优惠")
private BigDecimal deductionPrice; private BigDecimal totalDeductionPrice;
@ColumnWidth(15)
@ExcelProperty(value = "优惠券优惠")
private BigDecimal deductionCouponPrice;
@ColumnWidth(13)
@ExcelProperty(value = "产品优惠")
private BigDecimal deductionProductPrice;
@ColumnWidth(13) @ColumnWidth(13)
@ExcelProperty(value = "应付金额") @ExcelProperty(value = "应付金额")

@ -33,8 +33,16 @@ public class OrderIntegralRechargeModel {
private BigDecimal totalPrice; private BigDecimal totalPrice;
@ColumnWidth(13) @ColumnWidth(13)
@ExcelProperty(value = "优惠价格") @ExcelProperty(value = "总优惠金额")
private BigDecimal deductionPrice; private BigDecimal totalDeductionPrice;
@ColumnWidth(13)
@ExcelProperty(value = "优惠券优惠金额")
private BigDecimal deductionCouponPrice;
@ColumnWidth(13)
@ExcelProperty(value = "产品优惠金额")
private BigDecimal deductionProductPrice;
@ColumnWidth(13) @ColumnWidth(13)
@ExcelProperty(value = "应付金额") @ExcelProperty(value = "应付金额")

@ -391,7 +391,6 @@ public class OrderCreateHandleServiceImpl implements OrderCreateHandleService {
.setScale(2, BigDecimal.ROUND_HALF_DOWN); .setScale(2, BigDecimal.ROUND_HALF_DOWN);
gasOrder.setDeductionCouponPrice(gasOrder.getGasRefuelPrice().subtract(deductionPrice)); gasOrder.setDeductionCouponPrice(gasOrder.getGasRefuelPrice().subtract(deductionPrice));
} }
gasOrder.setPayablePrice(gasOrder.getGasRefuelPrice().subtract(gasOrder.getTotalDeductionPrice())); gasOrder.setPayablePrice(gasOrder.getGasRefuelPrice().subtract(gasOrder.getTotalDeductionPrice()));
if (gasOrder.getPayablePrice().compareTo(new BigDecimal("0")) < 0) { if (gasOrder.getPayablePrice().compareTo(new BigDecimal("0")) < 0) {
gasOrder.setPayablePrice(new BigDecimal("0")); gasOrder.setPayablePrice(new BigDecimal("0"));
@ -410,7 +409,7 @@ public class OrderCreateHandleServiceImpl implements OrderCreateHandleService {
} else { } else {
// 支付价格 // 支付价格
childOrder.setGoodsActualPrice(priceModel.getPayPrice()); childOrder.setGoodsActualPrice(priceModel.getPayPrice());
gasOrder.setDeductionCouponPrice(priceModel.getTotalPreferences()); gasOrder.setDeductionProductPrice(priceModel.getTotalPreferences());
gasOrder.setPayablePrice(priceModel.getPayPrice()); gasOrder.setPayablePrice(priceModel.getPayPrice());
// 油价信息 // 油价信息
@ -425,6 +424,7 @@ public class OrderCreateHandleServiceImpl implements OrderCreateHandleService {
gasOrder.setGasPricePreferences(priceModel.getPricePreferences()); gasOrder.setGasPricePreferences(priceModel.getPricePreferences());
} }
childOrder.setTotalDeductionPrice(childOrder.getTotalPrice().subtract(childOrder.getTotalActualPrice())); childOrder.setTotalDeductionPrice(childOrder.getTotalPrice().subtract(childOrder.getTotalActualPrice()));
gasOrder.setTotalDeductionPrice(gasOrder.getDeductionProductPrice().add(gasOrder.getDeductionCouponPrice()));
gasOrder.setPayGold(createOrderModel.getPayGold()!=null?createOrderModel.getPayGold():0); gasOrder.setPayGold(createOrderModel.getPayGold()!=null?createOrderModel.getPayGold():0);
if (store.getSourceType().equals(MerchantStoreSourceType.type4.getNumber())) { if (store.getSourceType().equals(MerchantStoreSourceType.type4.getNumber())) {

@ -1,11 +1,13 @@
package com.hai.service; package com.hai.service;
import com.alibaba.fastjson.JSONObject; import com.alibaba.fastjson.JSONObject;
import com.hai.common.security.SessionObject;
import com.hai.entity.HighUser; import com.hai.entity.HighUser;
import com.hai.enum_type.LoginPlatform; import com.hai.enum_type.LoginPlatform;
import com.hai.model.HighUserModel; import com.hai.model.HighUserModel;
import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import java.util.List; import java.util.List;
import java.util.Map; import java.util.Map;
@ -26,7 +28,7 @@ public interface HighUserService {
* @return * @return
* @throws Exception * @throws Exception
*/ */
HighUserModel loginAndRegister(LoginPlatform platForm, String phone, Long popularizeUserId, Map<String, Object> other) throws Exception; SessionObject loginAndRegister(LoginPlatform platForm, String phone, Long popularizeUserId, Map<String, Object> other, HttpServletRequest request, HttpServletResponse response) throws Exception;
/** /**
* *

@ -28,6 +28,7 @@ import org.springframework.transaction.annotation.Transactional;
import javax.annotation.Resource; import javax.annotation.Resource;
import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import java.util.Date; import java.util.Date;
import java.util.HashMap; import java.util.HashMap;
import java.util.List; import java.util.List;
@ -80,12 +81,13 @@ public class HighUserServiceImpl implements HighUserService {
@Override @Override
@Transactional(propagation = Propagation.REQUIRES_NEW, timeout = 30, rollbackFor = Exception.class) @Transactional(propagation = Propagation.REQUIRES_NEW, timeout = 30, rollbackFor = Exception.class)
public HighUserModel loginAndRegister(LoginPlatform platform,String phone, Long popularizeUserId, Map<String, Object> other) throws Exception { public SessionObject loginAndRegister(LoginPlatform platform,String phone, Long popularizeUserId, Map<String, Object> other,HttpServletRequest request, HttpServletResponse response) throws Exception {
// 记录登录信息 // 记录登录信息
String requestIp = RequestUtils.getRequestIp(); String requestIp = RequestUtils.getRequestIp();
HighUserLoginLog loginLog = new HighUserLoginLog(); HighUserLoginLog loginLog = new HighUserLoginLog();
loginLog.setUserPhone(phone); loginLog.setUserPhone(phone);
loginLog.setPlatform(platform.getName()); loginLog.setPlatformCode(platform.getCode());
loginLog.setPlatformName(platform.getName());
loginLog.setIp(requestIp); loginLog.setIp(requestIp);
loginLog.setProvinceName("未知"); loginLog.setProvinceName("未知");
loginLog.setCityName("未知"); loginLog.setCityName("未知");
@ -124,7 +126,6 @@ public class HighUserServiceImpl implements HighUserService {
distributionUserRelService.insertDistributionRebate(user.getId(), popularizeUserId, region.getRegionId().toString()); distributionUserRelService.insertDistributionRebate(user.getId(), popularizeUserId, region.getRegionId().toString());
} }
} }
loginLog.setUserId(user.getId()); loginLog.setUserId(user.getId());
userLoginLogMapper.insert(loginLog); userLoginLogMapper.insert(loginLog);
@ -132,9 +133,9 @@ public class HighUserServiceImpl implements HighUserService {
HighUserModel highUserModel = new HighUserModel(); HighUserModel highUserModel = new HighUserModel();
highUserModel.setHighUser(getDetailDataByUser(user.getId())); highUserModel.setHighUser(getDetailDataByUser(user.getId()));
SessionObject so = new SessionObject(AESEncodeUtil.base64Encode(AESEncodeUtil.aesEncryptToBytes(user.getPhone(), "123")), 1 , highUserModel); SessionObject so = new SessionObject(AESEncodeUtil.base64Encode(AESEncodeUtil.aesEncryptToBytes(user.getPhone(), "123")), 1 , highUserModel);
userCenter.save(null,null,so); userCenter.save(request,response,so);
return highUserModel; return so;
} }
@Override @Override

@ -0,0 +1,23 @@
package com.hai.user.service;
import com.hai.entity.HighUserLoginLog;
import java.util.List;
import java.util.Map;
/**
* 用户登录日志
* @className: UserLoginService
* @author: HuRui
* @date: 2022/10/25
**/
public interface UserLoginLogService {
/**
* 查询用户登录日志列表
* @param param
* @return
*/
List<HighUserLoginLog> getUserLoginLogList(Map<String, Object> param);
}

@ -0,0 +1,37 @@
package com.hai.user.service.impl;
import com.hai.dao.HighUserLoginLogMapper;
import com.hai.entity.HighUserLoginLog;
import com.hai.entity.HighUserLoginLogExample;
import com.hai.user.service.UserLoginLogService;
import org.apache.commons.collections4.MapUtils;
import org.springframework.stereotype.Service;
import javax.annotation.Resource;
import java.util.List;
import java.util.Map;
/**
* @className: UserLoginLogServiceImpl
* @author: HuRui
* @date: 2022/10/25
**/
@Service("userLoginLogService")
public class UserLoginLogServiceImpl implements UserLoginLogService {
@Resource
private HighUserLoginLogMapper userLoginLogMapper;
@Override
public List<HighUserLoginLog> getUserLoginLogList(Map<String, Object> param) {
HighUserLoginLogExample example = new HighUserLoginLogExample();
HighUserLoginLogExample.Criteria criteria = example.createCriteria().andStatusNotEqualTo(0);
if (MapUtils.getLong(param, "userId") != null) {
criteria.andUserIdEqualTo(MapUtils.getLong(param, "userId"));
}
example.setOrderByClause("create_time desc");
return userLoginLogMapper.selectByExample(example);
}
}

File diff suppressed because one or more lines are too long

@ -0,0 +1 @@
package com.web.controller; import com.github.pagehelper.PageHelper; import com.github.pagehelper.PageInfo; import com.hai.common.exception.ErrorCode; import com.hai.common.exception.ErrorHelp; import com.hai.common.exception.SysCode; import com.hai.common.security.UserCenter; import com.hai.common.utils.ResponseMsgUtil; import com.hai.model.HighUserModel; import com.hai.model.ResponseData; import com.hai.user.service.UserLoginLogService; import io.swagger.annotations.Api; import io.swagger.annotations.ApiOperation; import org.slf4j.Logger; import org.slf4j.LoggerFactory; import org.springframework.stereotype.Controller; import org.springframework.web.bind.annotation.*; import javax.annotation.Resource; import java.util.HashMap; import java.util.Map; /** * @Auther: 胡锐 * @Description: * @Date: 2021/3/26 23:08 */ @Controller @RequestMapping(value = "/loginLog") @Api(value = "登录日志") public class LoginLogController { private static Logger log = LoggerFactory.getLogger(LoginLogController.class); @Resource private UserCenter userCenter; @Resource private UserLoginLogService userLoginLogService; @RequestMapping(value = "/getUserLoginLogList", method = RequestMethod.GET) @ResponseBody @ApiOperation(value = "获取用户登录日志列表") public ResponseData getUserLoginLogList(@RequestParam(value = "pageNum", required = true) Integer pageNum, @RequestParam(value = "pageSize", required = true) Integer pageSize) { try { HighUserModel userInfoModel = userCenter.getSessionModel(HighUserModel.class); if (userInfoModel == null) { log.error("CoresController --> outLogin() error!", "用户身份错误或已过期"); throw ErrorHelp.genException(SysCode.System, ErrorCode.SEC_USER_EXPIRED, ""); } Map<String, Object> param = new HashMap<>(); param.put("userId", userInfoModel.getHighUser().getId()); PageHelper.startPage(pageNum, pageSize); return ResponseMsgUtil.success(new PageInfo<>(userLoginLogService.getUserLoginLogList(param))); } catch (Exception e) { log.error("loginLog --> getUserLoginLogList() error!", e); return ResponseMsgUtil.exception(e); } } }

@ -5,29 +5,23 @@ import com.hai.common.exception.ErrorCode;
import com.hai.common.exception.ErrorHelp; import com.hai.common.exception.ErrorHelp;
import com.hai.common.exception.SysCode; import com.hai.common.exception.SysCode;
import com.hai.common.security.UserCenter; import com.hai.common.security.UserCenter;
import com.hai.common.utils.MemberValidateUtil;
import com.hai.common.utils.RedisUtil; import com.hai.common.utils.RedisUtil;
import com.hai.common.utils.ResponseMsgUtil; import com.hai.common.utils.ResponseMsgUtil;
import com.hai.config.HuiLianTongUnionCardConfig; import com.hai.config.HuiLianTongUnionCardConfig;
import com.hai.entity.HighOilCard; import com.hai.entity.HighOilCard;
import com.hai.entity.HighUserCard; import com.hai.entity.HighUserCard;
import com.hai.enum_type.LoginPlatform;
import com.hai.enum_type.RedisFileFolder;
import com.hai.enum_type.UserCardType; import com.hai.enum_type.UserCardType;
import com.hai.model.HighUserModel; import com.hai.model.HighUserModel;
import com.hai.model.ResponseData; import com.hai.model.ResponseData;
import com.hai.model.UserInfoModel;
import com.hai.service.HighOilCardService; import com.hai.service.HighOilCardService;
import com.hai.service.HighUserCardService; import com.hai.service.HighUserCardService;
import com.hai.service.HighUserService; import com.hai.service.HighUserService;
import com.web.type.LoginType;
import io.swagger.annotations.Api; import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation; import io.swagger.annotations.ApiOperation;
import org.apache.commons.lang3.StringUtils; import org.apache.commons.lang3.StringUtils;
import org.slf4j.Logger; import org.slf4j.Logger;
import org.slf4j.LoggerFactory; import org.slf4j.LoggerFactory;
import org.springframework.stereotype.Controller; import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping; import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod; import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.ResponseBody; import org.springframework.web.bind.annotation.ResponseBody;
@ -46,11 +40,11 @@ import java.util.Map;
**/ **/
@Controller @Controller
@RequestMapping(value = "/cores") @RequestMapping(value = "/")
@Api(value = "用户核心业务") @Api(value = "用户核心业务")
public class CoresController { public class UserController {
private static Logger log = LoggerFactory.getLogger(CoresController.class); private static Logger log = LoggerFactory.getLogger(UserController.class);
@Resource @Resource
private RedisUtil redisUtil; private RedisUtil redisUtil;
@ -128,23 +122,4 @@ public class CoresController {
} }
} }
@RequestMapping(value = "/outLogin", method = RequestMethod.POST)
@ResponseBody
@ApiOperation(value = "退出登录")
public ResponseData outLogin(HttpServletRequest request, HttpServletResponse response) {
try {
HighUserModel userInfoModel = userCenter.getSessionModel(HighUserModel.class);
if (userInfoModel == null) {
log.error("CoresController --> outLogin() error!", "用户身份错误或已过期");
throw ErrorHelp.genException(SysCode.System, ErrorCode.SEC_USER_EXPIRED, "");
}
userCenter.remove(request, response);
return ResponseMsgUtil.success("退出登录成功");
} catch (Exception e) {
log.error("CoresController --> outLogin() error!", e);
return ResponseMsgUtil.exception(e);
}
}
} }

@ -1,27 +1,5 @@
# \u03A2\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD
wxAppId=wx8d49e2f83025229d
wxAppSecret=d8d6dcaef77d3b659258a01b5ddba5df
wxH5AppId=wxa075e8509802f826 wxMiniAppId=wx8d49e2f83025229d
wxH5AppSecret=0e606fc1378d35e359fcf3f15570b2c5 wxMiniAppSecret=d8d6dcaef77d3b659258a01b5ddba5df
wxApiKey=Skufk5oi85wDFGl888i6wsRSTkdd5df5
wxMchAppId=wx637bd6f7314daa46
wxMchId=1289663601
wxSubAppId=wx8d49e2f83025229d
wxSubMchId=1609882817
wxUnifiedOrderUrl=https://api.mch.weixin.qq.com/pay/unifiedorder
wxGzSubAppId=wxa075e8509802f826
wxGzSubMchId=1619676214
# ????????????
HDAppId = 1614670195
notifyUrl=https://hsgcs.dctpay.com/crest/wechatpay/notify
imgUrl=https://hsgcs.dctpay.com/filesystem/
fileUrl=/home/project/hsg/filesystem fileUrl=/home/project/hsg/filesystem
cmsPath=/home/project/hsg/filesystem/cmsPath
couponCodePath=/home/project/hsg/filesystem/couponCode
qrCodeUrl=https://hsgcs.dctpay.com/hsgH5?accountId=0000010&key=&code=

Loading…
Cancel
Save