From 6363e152c352558d895380129502daac6781337a Mon Sep 17 00:00:00 2001 From: Sum1Dream <418471657@qq.com> Date: Tue, 30 Aug 2022 20:47:45 +0800 Subject: [PATCH] 1 --- .../com/cweb/controller/CommonController.java | 65 ++- .../controller/pay/CzOrderController.java | 46 -- .../com/hai/schedule/HighOrderSchedule.java | 37 +- .../com/hai/dao/OutRechargeOrderMapper.java | 37 +- .../hai/dao/OutRechargeOrderMapperExt.java | 50 +++ .../hai/dao/OutRechargeOrderSqlProvider.java | 84 ++++ .../java/com/hai/entity/OutRechargeOrder.java | 87 +++- .../hai/entity/OutRechargeOrderExample.java | 400 ++++++++++++++++++ .../hai/service/BsIntegralRebateService.java | 2 + .../java/com/hai/service/CommonService.java | 11 + .../com/hai/service/HighOrderService.java | 2 +- .../hai/service/OutRechargeOrderService.java | 9 + .../impl/BsIntegralRebateServiceImpl.java | 54 ++- .../hai/service/impl/CommonServiceImpl.java | 21 +- .../service/impl/HighOrderServiceImpl.java | 9 +- .../impl/OutRechargeOrderServiceImpl.java | 33 +- v1/hai-v1.iml | 220 ++++++++++ 17 files changed, 1075 insertions(+), 92 deletions(-) create mode 100644 v1/hai-v1.iml diff --git a/hai-cweb/src/main/java/com/cweb/controller/CommonController.java b/hai-cweb/src/main/java/com/cweb/controller/CommonController.java index bd7a8438..39fe40a2 100644 --- a/hai-cweb/src/main/java/com/cweb/controller/CommonController.java +++ b/hai-cweb/src/main/java/com/cweb/controller/CommonController.java @@ -8,6 +8,7 @@ import com.hai.common.exception.SysCode; import com.hai.common.utils.HttpsUtils; import com.hai.common.utils.ResponseMsgUtil; import com.hai.common.utils.WxUtils; +import com.hai.entity.ApiCity; import com.hai.entity.BsCompany; import com.hai.entity.SecConfig; import com.hai.entity.SecRegion; @@ -285,9 +286,31 @@ public class CommonController { ) { try { - JSONObject object = commonService.findByLatAndLng(lng , lat); + JSONObject object = commonService.findByLatAndLng(lng , lat).getJSONObject("result").getJSONObject("addressComponent"); - return ResponseMsgUtil.success(object); + ApiCity apiCity = commonService.findCityByName(object.getString("city")); + + if (apiCity == null) { + log.error("findByLatAndLng error!", "当前城市暂未开通任何服务" ); + throw ErrorHelp.genException(SysCode.System, ErrorCode.COMMON_ERROR, "当前城市暂未开通任何服务,请选择其他城市"); + } + + BsCompany company = bsCompanyService.selectCompanyByRegion(apiCity.getProvinceCode()); + + if (company == null) { + log.error("findByLatAndLng error!", "当前城市暂未开通任何服务" ); + throw ErrorHelp.genException(SysCode.System, ErrorCode.COMMON_ERROR, "当前城市暂未开通任何服务,请选择其他城市"); + } + + JSONObject jsonObject = new JSONObject(); + + jsonObject.put("cityName" , apiCity.getCityName()); + jsonObject.put("provinceName" , apiCity.getProvinceName()); + jsonObject.put("regionId" , company.getRegionId()); + jsonObject.put("companyName" , company.getName()); + jsonObject.put("companyId" , company.getId()); + + return ResponseMsgUtil.success(jsonObject); } catch (Exception e) { log.error("HighOrderController --> unionStagingPay() error!", e); @@ -295,4 +318,42 @@ public class CommonController { } } + @RequestMapping(value = "/findCompanyByCityName", method = RequestMethod.GET) + @ResponseBody + @ApiOperation(value = "获取定位信息") + public ResponseData findByLatAndLng( + @RequestParam(name = "cityName", required = true) String cityName + ) { + try { + + ApiCity apiCity = commonService.findCityByName(cityName); + + if (apiCity == null) { + log.error("findByLatAndLng error!", "当前城市暂未开通任何服务" ); + throw ErrorHelp.genException(SysCode.System, ErrorCode.COMMON_ERROR, "当前城市暂未开通任何服务,请选择其他城市"); + } + + BsCompany company = bsCompanyService.selectCompanyByRegion(apiCity.getProvinceCode()); + + if (company == null) { + log.error("findByLatAndLng error!", "当前城市暂未开通任何服务" ); + throw ErrorHelp.genException(SysCode.System, ErrorCode.COMMON_ERROR, "当前城市暂未开通任何服务,请选择其他城市"); + } + + JSONObject jsonObject = new JSONObject(); + + jsonObject.put("cityName" , apiCity.getCityName()); + jsonObject.put("provinceName" , apiCity.getProvinceName()); + jsonObject.put("regionId" , company.getRegionId()); + jsonObject.put("companyName" , company.getName()); + jsonObject.put("companyId" , company.getId()); + + return ResponseMsgUtil.success(jsonObject); + + } catch (Exception e) { + log.error("HighOrderController --> unionStagingPay() error!", e); + return ResponseMsgUtil.exception(e); + } + } + } diff --git a/hai-cweb/src/main/java/com/cweb/controller/pay/CzOrderController.java b/hai-cweb/src/main/java/com/cweb/controller/pay/CzOrderController.java index b038b424..d6838225 100644 --- a/hai-cweb/src/main/java/com/cweb/controller/pay/CzOrderController.java +++ b/hai-cweb/src/main/java/com/cweb/controller/pay/CzOrderController.java @@ -122,29 +122,6 @@ public class CzOrderController { // 判断是否充值成功 if (dataObject.getInteger("status") == 3) { new Thread(() -> { - - JSONObject object = new JSONObject(); - - object.put("type" , 3); - object.put("productId" , rechargeOrder.getOperatorType()); - object.put("companyId" , rechargeOrder.getCompanyId()); - object.put("price" , rechargeOrder.getPayRealPrice()); - object.put("userId" , rechargeOrder.getUserId()); - object.put("orderId" , rechargeOrder.getId()); - object.put("remark" , "话费订单" + rechargeOrder.getOrderNo() + "积分返利:"); - - Map map = new HashMap<>(); - map.put("goldType", 1); - map.put("resType", 4); - map.put("userId", rechargeOrder.getUserId()); - map.put("resId", rechargeOrder.getId()); - - List goldRecs = highGoldRecService.getGoldRec(map); - - if (goldRecs.size() == 0) { - bsIntegralRebateService.integralRebate(object); - } - HighUser highUser = highUserService.findByUserId(rechargeOrder.getUserId()); WxMsgConfig.rechargedSuccess( rechargeOrder.getRechargeContent() + "充值成功", @@ -212,29 +189,6 @@ public class CzOrderController { // 判断是否充值成功 if (state == 1) { new Thread(() -> { - - JSONObject object = new JSONObject(); - - object.put("type" , 3); - object.put("productId" , rechargeOrder.getOperatorType()); - object.put("companyId" , rechargeOrder.getCompanyId()); - object.put("price" , rechargeOrder.getPayRealPrice()); - object.put("userId" , rechargeOrder.getUserId()); - object.put("orderId" , rechargeOrder.getId()); - object.put("remark" , "话费订单" + rechargeOrder.getOrderNo() + "积分返利:"); - - Map map = new HashMap<>(); - map.put("goldType", 1); - map.put("resType", 4); - map.put("userId", rechargeOrder.getUserId()); - map.put("resId", rechargeOrder.getId()); - - List goldRecs = highGoldRecService.getGoldRec(map); - - if (goldRecs.size() == 0) { - bsIntegralRebateService.integralRebate(object); - } - HighUser highUser = highUserService.findByUserId(rechargeOrder.getUserId()); WxMsgConfig.rechargedSuccess( rechargeOrder.getRechargeContent() + "充值成功", diff --git a/hai-schedule/src/main/java/com/hai/schedule/HighOrderSchedule.java b/hai-schedule/src/main/java/com/hai/schedule/HighOrderSchedule.java index eb9e7af7..0a12ccd4 100644 --- a/hai-schedule/src/main/java/com/hai/schedule/HighOrderSchedule.java +++ b/hai-schedule/src/main/java/com/hai/schedule/HighOrderSchedule.java @@ -455,7 +455,7 @@ public class HighOrderSchedule { List childOrderList = highOrderService.getChildOrderByOrder(highOrder.getId()); // 查询订单来源 - JSONObject object = highOrderService.orderSource(childOrderList.get(0).getGoodsType() , childOrderList.get(0).getGoodsId(),highOrder.getOrderNo() , highOrder.getCompanyId()); + JSONObject object = highOrderService.orderSource(childOrderList.get(0).getGoodsType() , childOrderList.get(0).getGoodsId(),highOrder.getOrderNo() , highOrder.getCompanyId() , 0); object.put("price" , highOrder.getPayRealPrice()); object.put("userId" , highOrder.getMemId()); @@ -469,5 +469,40 @@ public class HighOrderSchedule { } } + /** + * @Author Sum1Dream + * @name integralRebateOrder.java + * @Description // 执行返利操作 + * @Date 15:13 2022/8/22 + * @Param [] + * @return void + */ + @Scheduled(cron="0 0/1 * * * ?") //每1分钟执行一次 + public void integralRebateRechargeOrder() { + List order = outRechargeOrderService.integralRebateRechargeOrder(); + for (OutRechargeOrder outRechargeOrder : order) { + Map map = new HashMap<>(); + map.put("goldType", 1); + map.put("resType", 4); + map.put("userId", outRechargeOrder.getUserId()); + map.put("resId", outRechargeOrder.getId()); + + List goldRecs = highGoldRecService.getGoldRec(map); + + if (goldRecs.size() == 0) { + // 查询订单来源 + JSONObject object = highOrderService.orderSource(20 , outRechargeOrder.getGoodsId(),outRechargeOrder.getOrderNo() , outRechargeOrder.getCompanyId() , outRechargeOrder.getOperatorType()); + + object.put("price" , outRechargeOrder.getPayRealPrice()); + object.put("userId" , outRechargeOrder.getUserId()); + object.put("orderId" , outRechargeOrder.getId()); + object.put("companyId" , outRechargeOrder.getCompanyId()); + object.put("createTime" , outRechargeOrder.getCreateTimed()); + + bsIntegralRebateService.integralRechargeRebate(object); + + } + } + } } diff --git a/hai-service/src/main/java/com/hai/dao/OutRechargeOrderMapper.java b/hai-service/src/main/java/com/hai/dao/OutRechargeOrderMapper.java index 31a9fb7d..2eeaf604 100644 --- a/hai-service/src/main/java/com/hai/dao/OutRechargeOrderMapper.java +++ b/hai-service/src/main/java/com/hai/dao/OutRechargeOrderMapper.java @@ -57,7 +57,10 @@ public interface OutRechargeOrderMapper extends OutRechargeOrderMapperExt { "refund_fee, company_id, ", "pay_status, merch_id, ", "recharge_status, ext_1, ", - "ext_2, ext_3)", + "ext_2, ext_3, recharge_name, ", + "remarks, agent_key, ", + "object_id, abnormal_msg, ", + "whether_rebate)", "values (#{rechargePrice,jdbcType=DECIMAL}, #{type,jdbcType=INTEGER}, ", "#{operatorName,jdbcType=VARCHAR}, #{operatorType,jdbcType=INTEGER}, ", "#{orderNo,jdbcType=VARCHAR}, #{rechargeType,jdbcType=INTEGER}, ", @@ -76,7 +79,10 @@ public interface OutRechargeOrderMapper extends OutRechargeOrderMapperExt { "#{refundFee,jdbcType=DECIMAL}, #{companyId,jdbcType=BIGINT}, ", "#{payStatus,jdbcType=INTEGER}, #{merchId,jdbcType=VARCHAR}, ", "#{rechargeStatus,jdbcType=INTEGER}, #{ext1,jdbcType=VARCHAR}, ", - "#{ext2,jdbcType=VARCHAR}, #{ext3,jdbcType=VARCHAR})" + "#{ext2,jdbcType=VARCHAR}, #{ext3,jdbcType=VARCHAR}, #{rechargeName,jdbcType=VARCHAR}, ", + "#{remarks,jdbcType=VARCHAR}, #{agentKey,jdbcType=VARCHAR}, ", + "#{objectId,jdbcType=BIGINT}, #{abnormalMsg,jdbcType=VARCHAR}, ", + "#{whetherRebate,jdbcType=BIT})" }) @Options(useGeneratedKeys=true,keyProperty="id") int insert(OutRechargeOrder record); @@ -125,7 +131,13 @@ public interface OutRechargeOrderMapper extends OutRechargeOrderMapperExt { @Result(column="recharge_status", property="rechargeStatus", jdbcType=JdbcType.INTEGER), @Result(column="ext_1", property="ext1", jdbcType=JdbcType.VARCHAR), @Result(column="ext_2", property="ext2", jdbcType=JdbcType.VARCHAR), - @Result(column="ext_3", property="ext3", jdbcType=JdbcType.VARCHAR) + @Result(column="ext_3", property="ext3", jdbcType=JdbcType.VARCHAR), + @Result(column="recharge_name", property="rechargeName", jdbcType=JdbcType.VARCHAR), + @Result(column="remarks", property="remarks", jdbcType=JdbcType.VARCHAR), + @Result(column="agent_key", property="agentKey", jdbcType=JdbcType.VARCHAR), + @Result(column="object_id", property="objectId", jdbcType=JdbcType.BIGINT), + @Result(column="abnormal_msg", property="abnormalMsg", jdbcType=JdbcType.VARCHAR), + @Result(column="whether_rebate", property="whetherRebate", jdbcType=JdbcType.BIT) }) List selectByExample(OutRechargeOrderExample example); @@ -137,7 +149,8 @@ public interface OutRechargeOrderMapper extends OutRechargeOrderMapperExt { "integral_deduction_price, pay_price, pay_real_price, pay_serial_no, create_timed, ", "pay_time, cancel_time, finish_time, out_refund_no, order_price, refund_time, ", "tp_refund_order_no, refund_id, refund_fee, company_id, pay_status, merch_id, ", - "recharge_status, ext_1, ext_2, ext_3", + "recharge_status, ext_1, ext_2, ext_3, recharge_name, remarks, agent_key, object_id, ", + "abnormal_msg, whether_rebate", "from out_recharge_order", "where id = #{id,jdbcType=BIGINT}" }) @@ -180,7 +193,13 @@ public interface OutRechargeOrderMapper extends OutRechargeOrderMapperExt { @Result(column="recharge_status", property="rechargeStatus", jdbcType=JdbcType.INTEGER), @Result(column="ext_1", property="ext1", jdbcType=JdbcType.VARCHAR), @Result(column="ext_2", property="ext2", jdbcType=JdbcType.VARCHAR), - @Result(column="ext_3", property="ext3", jdbcType=JdbcType.VARCHAR) + @Result(column="ext_3", property="ext3", jdbcType=JdbcType.VARCHAR), + @Result(column="recharge_name", property="rechargeName", jdbcType=JdbcType.VARCHAR), + @Result(column="remarks", property="remarks", jdbcType=JdbcType.VARCHAR), + @Result(column="agent_key", property="agentKey", jdbcType=JdbcType.VARCHAR), + @Result(column="object_id", property="objectId", jdbcType=JdbcType.BIGINT), + @Result(column="abnormal_msg", property="abnormalMsg", jdbcType=JdbcType.VARCHAR), + @Result(column="whether_rebate", property="whetherRebate", jdbcType=JdbcType.BIT) }) OutRechargeOrder selectByPrimaryKey(Long id); @@ -232,7 +251,13 @@ public interface OutRechargeOrderMapper extends OutRechargeOrderMapperExt { "recharge_status = #{rechargeStatus,jdbcType=INTEGER},", "ext_1 = #{ext1,jdbcType=VARCHAR},", "ext_2 = #{ext2,jdbcType=VARCHAR},", - "ext_3 = #{ext3,jdbcType=VARCHAR}", + "ext_3 = #{ext3,jdbcType=VARCHAR},", + "recharge_name = #{rechargeName,jdbcType=VARCHAR},", + "remarks = #{remarks,jdbcType=VARCHAR},", + "agent_key = #{agentKey,jdbcType=VARCHAR},", + "object_id = #{objectId,jdbcType=BIGINT},", + "abnormal_msg = #{abnormalMsg,jdbcType=VARCHAR},", + "whether_rebate = #{whetherRebate,jdbcType=BIT}", "where id = #{id,jdbcType=BIGINT}" }) int updateByPrimaryKey(OutRechargeOrder record); diff --git a/hai-service/src/main/java/com/hai/dao/OutRechargeOrderMapperExt.java b/hai-service/src/main/java/com/hai/dao/OutRechargeOrderMapperExt.java index 6c2a78dd..cc0f628a 100644 --- a/hai-service/src/main/java/com/hai/dao/OutRechargeOrderMapperExt.java +++ b/hai-service/src/main/java/com/hai/dao/OutRechargeOrderMapperExt.java @@ -146,4 +146,54 @@ public interface OutRechargeOrderMapperExt { @Result(column="count", property="count", jdbcType=JdbcType.BIGINT), }) OrderCountModel rechargeOrderByIndex(Integer code); + + @Select("select * from out_recharge_order where recharge_status = 202 and pay_status = 100 and pay_type != 3 and pay_real_price > 0 and whether_rebate = false ") + @Results({ + @Result(column="id", property="id", jdbcType=JdbcType.BIGINT, id=true), + @Result(column="recharge_price", property="rechargePrice", jdbcType=JdbcType.DECIMAL), + @Result(column="type", property="type", jdbcType=JdbcType.INTEGER), + @Result(column="operator_name", property="operatorName", jdbcType=JdbcType.VARCHAR), + @Result(column="operator_type", property="operatorType", jdbcType=JdbcType.INTEGER), + @Result(column="order_no", property="orderNo", jdbcType=JdbcType.VARCHAR), + @Result(column="recharge_type", property="rechargeType", jdbcType=JdbcType.INTEGER), + @Result(column="mem_discount_id", property="memDiscountId", jdbcType=JdbcType.BIGINT), + @Result(column="mem_discount_name", property="memDiscountName", jdbcType=JdbcType.VARCHAR), + @Result(column="user_id", property="userId", jdbcType=JdbcType.BIGINT), + @Result(column="user_name", property="userName", jdbcType=JdbcType.VARCHAR), + @Result(column="user_phone", property="userPhone", jdbcType=JdbcType.VARCHAR), + @Result(column="goods_id", property="goodsId", jdbcType=JdbcType.BIGINT), + @Result(column="recharge_content", property="rechargeContent", jdbcType=JdbcType.VARCHAR), + @Result(column="pay_type", property="payType", jdbcType=JdbcType.INTEGER), + @Result(column="labor_union_card", property="laborUnionCard", jdbcType=JdbcType.VARCHAR), + @Result(column="integral_num", property="integralNum", jdbcType=JdbcType.DECIMAL), + @Result(column="discount_deduction_price", property="discountDeductionPrice", jdbcType=JdbcType.DECIMAL), + @Result(column="integral_deduction_price", property="integralDeductionPrice", jdbcType=JdbcType.DECIMAL), + @Result(column="pay_price", property="payPrice", jdbcType=JdbcType.DECIMAL), + @Result(column="pay_real_price", property="payRealPrice", jdbcType=JdbcType.DECIMAL), + @Result(column="pay_serial_no", property="paySerialNo", jdbcType=JdbcType.VARCHAR), + @Result(column="create_timed", property="createTimed", jdbcType=JdbcType.TIMESTAMP), + @Result(column="pay_time", property="payTime", jdbcType=JdbcType.TIMESTAMP), + @Result(column="cancel_time", property="cancelTime", jdbcType=JdbcType.TIMESTAMP), + @Result(column="finish_time", property="finishTime", jdbcType=JdbcType.TIMESTAMP), + @Result(column="out_refund_no", property="outRefundNo", jdbcType=JdbcType.VARCHAR), + @Result(column="order_price", property="orderPrice", jdbcType=JdbcType.DECIMAL), + @Result(column="refund_time", property="refundTime", jdbcType=JdbcType.TIMESTAMP), + @Result(column="tp_refund_order_no", property="tpRefundOrderNo", jdbcType=JdbcType.VARCHAR), + @Result(column="refund_id", property="refundId", jdbcType=JdbcType.VARCHAR), + @Result(column="refund_fee", property="refundFee", jdbcType=JdbcType.DECIMAL), + @Result(column="company_id", property="companyId", jdbcType=JdbcType.BIGINT), + @Result(column="pay_status", property="payStatus", jdbcType=JdbcType.INTEGER), + @Result(column="merch_id", property="merchId", jdbcType=JdbcType.VARCHAR), + @Result(column="recharge_status", property="rechargeStatus", jdbcType=JdbcType.INTEGER), + @Result(column="ext_1", property="ext1", jdbcType=JdbcType.VARCHAR), + @Result(column="ext_2", property="ext2", jdbcType=JdbcType.VARCHAR), + @Result(column="ext_3", property="ext3", jdbcType=JdbcType.VARCHAR), + @Result(column="recharge_name", property="rechargeName", jdbcType=JdbcType.VARCHAR), + @Result(column="remarks", property="remarks", jdbcType=JdbcType.VARCHAR), + @Result(column="agent_key", property="agentKey", jdbcType=JdbcType.VARCHAR), + @Result(column="object_id", property="objectId", jdbcType=JdbcType.BIGINT), + @Result(column="abnormal_msg", property="abnormalMsg", jdbcType=JdbcType.VARCHAR), + @Result(column="whether_rebate", property="whetherRebate", jdbcType=JdbcType.BIT) + }) + List integralRebateRechargeOrder(); } diff --git a/hai-service/src/main/java/com/hai/dao/OutRechargeOrderSqlProvider.java b/hai-service/src/main/java/com/hai/dao/OutRechargeOrderSqlProvider.java index d359e26f..9322bcd7 100644 --- a/hai-service/src/main/java/com/hai/dao/OutRechargeOrderSqlProvider.java +++ b/hai-service/src/main/java/com/hai/dao/OutRechargeOrderSqlProvider.java @@ -180,6 +180,30 @@ public class OutRechargeOrderSqlProvider { sql.VALUES("ext_3", "#{ext3,jdbcType=VARCHAR}"); } + if (record.getRechargeName() != null) { + sql.VALUES("recharge_name", "#{rechargeName,jdbcType=VARCHAR}"); + } + + if (record.getRemarks() != null) { + sql.VALUES("remarks", "#{remarks,jdbcType=VARCHAR}"); + } + + if (record.getAgentKey() != null) { + sql.VALUES("agent_key", "#{agentKey,jdbcType=VARCHAR}"); + } + + if (record.getObjectId() != null) { + sql.VALUES("object_id", "#{objectId,jdbcType=BIGINT}"); + } + + if (record.getAbnormalMsg() != null) { + sql.VALUES("abnormal_msg", "#{abnormalMsg,jdbcType=VARCHAR}"); + } + + if (record.getWhetherRebate() != null) { + sql.VALUES("whether_rebate", "#{whetherRebate,jdbcType=BIT}"); + } + return sql.toString(); } @@ -228,6 +252,12 @@ public class OutRechargeOrderSqlProvider { sql.SELECT("ext_1"); sql.SELECT("ext_2"); sql.SELECT("ext_3"); + sql.SELECT("recharge_name"); + sql.SELECT("remarks"); + sql.SELECT("agent_key"); + sql.SELECT("object_id"); + sql.SELECT("abnormal_msg"); + sql.SELECT("whether_rebate"); sql.FROM("out_recharge_order"); applyWhere(sql, example, false); @@ -401,6 +431,30 @@ public class OutRechargeOrderSqlProvider { sql.SET("ext_3 = #{record.ext3,jdbcType=VARCHAR}"); } + if (record.getRechargeName() != null) { + sql.SET("recharge_name = #{record.rechargeName,jdbcType=VARCHAR}"); + } + + if (record.getRemarks() != null) { + sql.SET("remarks = #{record.remarks,jdbcType=VARCHAR}"); + } + + if (record.getAgentKey() != null) { + sql.SET("agent_key = #{record.agentKey,jdbcType=VARCHAR}"); + } + + if (record.getObjectId() != null) { + sql.SET("object_id = #{record.objectId,jdbcType=BIGINT}"); + } + + if (record.getAbnormalMsg() != null) { + sql.SET("abnormal_msg = #{record.abnormalMsg,jdbcType=VARCHAR}"); + } + + if (record.getWhetherRebate() != null) { + sql.SET("whether_rebate = #{record.whetherRebate,jdbcType=BIT}"); + } + applyWhere(sql, example, true); return sql.toString(); } @@ -448,6 +502,12 @@ public class OutRechargeOrderSqlProvider { sql.SET("ext_1 = #{record.ext1,jdbcType=VARCHAR}"); sql.SET("ext_2 = #{record.ext2,jdbcType=VARCHAR}"); sql.SET("ext_3 = #{record.ext3,jdbcType=VARCHAR}"); + sql.SET("recharge_name = #{record.rechargeName,jdbcType=VARCHAR}"); + sql.SET("remarks = #{record.remarks,jdbcType=VARCHAR}"); + sql.SET("agent_key = #{record.agentKey,jdbcType=VARCHAR}"); + sql.SET("object_id = #{record.objectId,jdbcType=BIGINT}"); + sql.SET("abnormal_msg = #{record.abnormalMsg,jdbcType=VARCHAR}"); + sql.SET("whether_rebate = #{record.whetherRebate,jdbcType=BIT}"); OutRechargeOrderExample example = (OutRechargeOrderExample) parameter.get("example"); applyWhere(sql, example, true); @@ -610,6 +670,30 @@ public class OutRechargeOrderSqlProvider { sql.SET("ext_3 = #{ext3,jdbcType=VARCHAR}"); } + if (record.getRechargeName() != null) { + sql.SET("recharge_name = #{rechargeName,jdbcType=VARCHAR}"); + } + + if (record.getRemarks() != null) { + sql.SET("remarks = #{remarks,jdbcType=VARCHAR}"); + } + + if (record.getAgentKey() != null) { + sql.SET("agent_key = #{agentKey,jdbcType=VARCHAR}"); + } + + if (record.getObjectId() != null) { + sql.SET("object_id = #{objectId,jdbcType=BIGINT}"); + } + + if (record.getAbnormalMsg() != null) { + sql.SET("abnormal_msg = #{abnormalMsg,jdbcType=VARCHAR}"); + } + + if (record.getWhetherRebate() != null) { + sql.SET("whether_rebate = #{whetherRebate,jdbcType=BIT}"); + } + sql.WHERE("id = #{id,jdbcType=BIGINT}"); return sql.toString(); diff --git a/hai-service/src/main/java/com/hai/entity/OutRechargeOrder.java b/hai-service/src/main/java/com/hai/entity/OutRechargeOrder.java index 60e332b4..6bc226e1 100644 --- a/hai-service/src/main/java/com/hai/entity/OutRechargeOrder.java +++ b/hai-service/src/main/java/com/hai/entity/OutRechargeOrder.java @@ -85,7 +85,7 @@ public class OutRechargeOrder implements Serializable { private String rechargeContent; /** - * 1:支付宝 2:微信 3:汇联通工会卡 4:银联 5:银联分期 6:商户预充值 + * 1:支付宝 2:微信 3:汇联通工会卡 4:银联 5:银联分期 */ private Integer payType; @@ -200,6 +200,21 @@ public class OutRechargeOrder implements Serializable { private String ext3; + private String rechargeName; + + private String remarks; + + private String agentKey; + + private Long objectId; + + private String abnormalMsg; + + /** + * 是否返利 + */ + private Boolean whetherRebate; + private static final long serialVersionUID = 1L; public Long getId() { @@ -514,6 +529,54 @@ public class OutRechargeOrder implements Serializable { this.ext3 = ext3; } + public String getRechargeName() { + return rechargeName; + } + + public void setRechargeName(String rechargeName) { + this.rechargeName = rechargeName; + } + + public String getRemarks() { + return remarks; + } + + public void setRemarks(String remarks) { + this.remarks = remarks; + } + + public String getAgentKey() { + return agentKey; + } + + public void setAgentKey(String agentKey) { + this.agentKey = agentKey; + } + + public Long getObjectId() { + return objectId; + } + + public void setObjectId(Long objectId) { + this.objectId = objectId; + } + + public String getAbnormalMsg() { + return abnormalMsg; + } + + public void setAbnormalMsg(String abnormalMsg) { + this.abnormalMsg = abnormalMsg; + } + + public Boolean getWhetherRebate() { + return whetherRebate; + } + + public void setWhetherRebate(Boolean whetherRebate) { + this.whetherRebate = whetherRebate; + } + @Override public boolean equals(Object that) { if (this == that) { @@ -564,7 +627,13 @@ public class OutRechargeOrder implements Serializable { && (this.getRechargeStatus() == null ? other.getRechargeStatus() == null : this.getRechargeStatus().equals(other.getRechargeStatus())) && (this.getExt1() == null ? other.getExt1() == null : this.getExt1().equals(other.getExt1())) && (this.getExt2() == null ? other.getExt2() == null : this.getExt2().equals(other.getExt2())) - && (this.getExt3() == null ? other.getExt3() == null : this.getExt3().equals(other.getExt3())); + && (this.getExt3() == null ? other.getExt3() == null : this.getExt3().equals(other.getExt3())) + && (this.getRechargeName() == null ? other.getRechargeName() == null : this.getRechargeName().equals(other.getRechargeName())) + && (this.getRemarks() == null ? other.getRemarks() == null : this.getRemarks().equals(other.getRemarks())) + && (this.getAgentKey() == null ? other.getAgentKey() == null : this.getAgentKey().equals(other.getAgentKey())) + && (this.getObjectId() == null ? other.getObjectId() == null : this.getObjectId().equals(other.getObjectId())) + && (this.getAbnormalMsg() == null ? other.getAbnormalMsg() == null : this.getAbnormalMsg().equals(other.getAbnormalMsg())) + && (this.getWhetherRebate() == null ? other.getWhetherRebate() == null : this.getWhetherRebate().equals(other.getWhetherRebate())); } @Override @@ -610,6 +679,12 @@ public class OutRechargeOrder implements Serializable { result = prime * result + ((getExt1() == null) ? 0 : getExt1().hashCode()); result = prime * result + ((getExt2() == null) ? 0 : getExt2().hashCode()); result = prime * result + ((getExt3() == null) ? 0 : getExt3().hashCode()); + result = prime * result + ((getRechargeName() == null) ? 0 : getRechargeName().hashCode()); + result = prime * result + ((getRemarks() == null) ? 0 : getRemarks().hashCode()); + result = prime * result + ((getAgentKey() == null) ? 0 : getAgentKey().hashCode()); + result = prime * result + ((getObjectId() == null) ? 0 : getObjectId().hashCode()); + result = prime * result + ((getAbnormalMsg() == null) ? 0 : getAbnormalMsg().hashCode()); + result = prime * result + ((getWhetherRebate() == null) ? 0 : getWhetherRebate().hashCode()); return result; } @@ -658,8 +733,14 @@ public class OutRechargeOrder implements Serializable { sb.append(", ext1=").append(ext1); sb.append(", ext2=").append(ext2); sb.append(", ext3=").append(ext3); + sb.append(", rechargeName=").append(rechargeName); + sb.append(", remarks=").append(remarks); + sb.append(", agentKey=").append(agentKey); + sb.append(", objectId=").append(objectId); + sb.append(", abnormalMsg=").append(abnormalMsg); + sb.append(", whetherRebate=").append(whetherRebate); sb.append(", serialVersionUID=").append(serialVersionUID); sb.append("]"); return sb.toString(); } -} +} \ No newline at end of file diff --git a/hai-service/src/main/java/com/hai/entity/OutRechargeOrderExample.java b/hai-service/src/main/java/com/hai/entity/OutRechargeOrderExample.java index 418b45b4..e7cba03f 100644 --- a/hai-service/src/main/java/com/hai/entity/OutRechargeOrderExample.java +++ b/hai-service/src/main/java/com/hai/entity/OutRechargeOrderExample.java @@ -2615,6 +2615,406 @@ public class OutRechargeOrderExample { addCriterion("ext_3 not between", value1, value2, "ext3"); return (Criteria) this; } + + public Criteria andRechargeNameIsNull() { + addCriterion("recharge_name is null"); + return (Criteria) this; + } + + public Criteria andRechargeNameIsNotNull() { + addCriterion("recharge_name is not null"); + return (Criteria) this; + } + + public Criteria andRechargeNameEqualTo(String value) { + addCriterion("recharge_name =", value, "rechargeName"); + return (Criteria) this; + } + + public Criteria andRechargeNameNotEqualTo(String value) { + addCriterion("recharge_name <>", value, "rechargeName"); + return (Criteria) this; + } + + public Criteria andRechargeNameGreaterThan(String value) { + addCriterion("recharge_name >", value, "rechargeName"); + return (Criteria) this; + } + + public Criteria andRechargeNameGreaterThanOrEqualTo(String value) { + addCriterion("recharge_name >=", value, "rechargeName"); + return (Criteria) this; + } + + public Criteria andRechargeNameLessThan(String value) { + addCriterion("recharge_name <", value, "rechargeName"); + return (Criteria) this; + } + + public Criteria andRechargeNameLessThanOrEqualTo(String value) { + addCriterion("recharge_name <=", value, "rechargeName"); + return (Criteria) this; + } + + public Criteria andRechargeNameLike(String value) { + addCriterion("recharge_name like", value, "rechargeName"); + return (Criteria) this; + } + + public Criteria andRechargeNameNotLike(String value) { + addCriterion("recharge_name not like", value, "rechargeName"); + return (Criteria) this; + } + + public Criteria andRechargeNameIn(List values) { + addCriterion("recharge_name in", values, "rechargeName"); + return (Criteria) this; + } + + public Criteria andRechargeNameNotIn(List values) { + addCriterion("recharge_name not in", values, "rechargeName"); + return (Criteria) this; + } + + public Criteria andRechargeNameBetween(String value1, String value2) { + addCriterion("recharge_name between", value1, value2, "rechargeName"); + return (Criteria) this; + } + + public Criteria andRechargeNameNotBetween(String value1, String value2) { + addCriterion("recharge_name not between", value1, value2, "rechargeName"); + return (Criteria) this; + } + + public Criteria andRemarksIsNull() { + addCriterion("remarks is null"); + return (Criteria) this; + } + + public Criteria andRemarksIsNotNull() { + addCriterion("remarks is not null"); + return (Criteria) this; + } + + public Criteria andRemarksEqualTo(String value) { + addCriterion("remarks =", value, "remarks"); + return (Criteria) this; + } + + public Criteria andRemarksNotEqualTo(String value) { + addCriterion("remarks <>", value, "remarks"); + return (Criteria) this; + } + + public Criteria andRemarksGreaterThan(String value) { + addCriterion("remarks >", value, "remarks"); + return (Criteria) this; + } + + public Criteria andRemarksGreaterThanOrEqualTo(String value) { + addCriterion("remarks >=", value, "remarks"); + return (Criteria) this; + } + + public Criteria andRemarksLessThan(String value) { + addCriterion("remarks <", value, "remarks"); + return (Criteria) this; + } + + public Criteria andRemarksLessThanOrEqualTo(String value) { + addCriterion("remarks <=", value, "remarks"); + return (Criteria) this; + } + + public Criteria andRemarksLike(String value) { + addCriterion("remarks like", value, "remarks"); + return (Criteria) this; + } + + public Criteria andRemarksNotLike(String value) { + addCriterion("remarks not like", value, "remarks"); + return (Criteria) this; + } + + public Criteria andRemarksIn(List values) { + addCriterion("remarks in", values, "remarks"); + return (Criteria) this; + } + + public Criteria andRemarksNotIn(List values) { + addCriterion("remarks not in", values, "remarks"); + return (Criteria) this; + } + + public Criteria andRemarksBetween(String value1, String value2) { + addCriterion("remarks between", value1, value2, "remarks"); + return (Criteria) this; + } + + public Criteria andRemarksNotBetween(String value1, String value2) { + addCriterion("remarks not between", value1, value2, "remarks"); + return (Criteria) this; + } + + public Criteria andAgentKeyIsNull() { + addCriterion("agent_key is null"); + return (Criteria) this; + } + + public Criteria andAgentKeyIsNotNull() { + addCriterion("agent_key is not null"); + return (Criteria) this; + } + + public Criteria andAgentKeyEqualTo(String value) { + addCriterion("agent_key =", value, "agentKey"); + return (Criteria) this; + } + + public Criteria andAgentKeyNotEqualTo(String value) { + addCriterion("agent_key <>", value, "agentKey"); + return (Criteria) this; + } + + public Criteria andAgentKeyGreaterThan(String value) { + addCriterion("agent_key >", value, "agentKey"); + return (Criteria) this; + } + + public Criteria andAgentKeyGreaterThanOrEqualTo(String value) { + addCriterion("agent_key >=", value, "agentKey"); + return (Criteria) this; + } + + public Criteria andAgentKeyLessThan(String value) { + addCriterion("agent_key <", value, "agentKey"); + return (Criteria) this; + } + + public Criteria andAgentKeyLessThanOrEqualTo(String value) { + addCriterion("agent_key <=", value, "agentKey"); + return (Criteria) this; + } + + public Criteria andAgentKeyLike(String value) { + addCriterion("agent_key like", value, "agentKey"); + return (Criteria) this; + } + + public Criteria andAgentKeyNotLike(String value) { + addCriterion("agent_key not like", value, "agentKey"); + return (Criteria) this; + } + + public Criteria andAgentKeyIn(List values) { + addCriterion("agent_key in", values, "agentKey"); + return (Criteria) this; + } + + public Criteria andAgentKeyNotIn(List values) { + addCriterion("agent_key not in", values, "agentKey"); + return (Criteria) this; + } + + public Criteria andAgentKeyBetween(String value1, String value2) { + addCriterion("agent_key between", value1, value2, "agentKey"); + return (Criteria) this; + } + + public Criteria andAgentKeyNotBetween(String value1, String value2) { + addCriterion("agent_key not between", value1, value2, "agentKey"); + return (Criteria) this; + } + + public Criteria andObjectIdIsNull() { + addCriterion("object_id is null"); + return (Criteria) this; + } + + public Criteria andObjectIdIsNotNull() { + addCriterion("object_id is not null"); + return (Criteria) this; + } + + public Criteria andObjectIdEqualTo(Long value) { + addCriterion("object_id =", value, "objectId"); + return (Criteria) this; + } + + public Criteria andObjectIdNotEqualTo(Long value) { + addCriterion("object_id <>", value, "objectId"); + return (Criteria) this; + } + + public Criteria andObjectIdGreaterThan(Long value) { + addCriterion("object_id >", value, "objectId"); + return (Criteria) this; + } + + public Criteria andObjectIdGreaterThanOrEqualTo(Long value) { + addCriterion("object_id >=", value, "objectId"); + return (Criteria) this; + } + + public Criteria andObjectIdLessThan(Long value) { + addCriterion("object_id <", value, "objectId"); + return (Criteria) this; + } + + public Criteria andObjectIdLessThanOrEqualTo(Long value) { + addCriterion("object_id <=", value, "objectId"); + return (Criteria) this; + } + + public Criteria andObjectIdIn(List values) { + addCriterion("object_id in", values, "objectId"); + return (Criteria) this; + } + + public Criteria andObjectIdNotIn(List values) { + addCriterion("object_id not in", values, "objectId"); + return (Criteria) this; + } + + public Criteria andObjectIdBetween(Long value1, Long value2) { + addCriterion("object_id between", value1, value2, "objectId"); + return (Criteria) this; + } + + public Criteria andObjectIdNotBetween(Long value1, Long value2) { + addCriterion("object_id not between", value1, value2, "objectId"); + return (Criteria) this; + } + + public Criteria andAbnormalMsgIsNull() { + addCriterion("abnormal_msg is null"); + return (Criteria) this; + } + + public Criteria andAbnormalMsgIsNotNull() { + addCriterion("abnormal_msg is not null"); + return (Criteria) this; + } + + public Criteria andAbnormalMsgEqualTo(String value) { + addCriterion("abnormal_msg =", value, "abnormalMsg"); + return (Criteria) this; + } + + public Criteria andAbnormalMsgNotEqualTo(String value) { + addCriterion("abnormal_msg <>", value, "abnormalMsg"); + return (Criteria) this; + } + + public Criteria andAbnormalMsgGreaterThan(String value) { + addCriterion("abnormal_msg >", value, "abnormalMsg"); + return (Criteria) this; + } + + public Criteria andAbnormalMsgGreaterThanOrEqualTo(String value) { + addCriterion("abnormal_msg >=", value, "abnormalMsg"); + return (Criteria) this; + } + + public Criteria andAbnormalMsgLessThan(String value) { + addCriterion("abnormal_msg <", value, "abnormalMsg"); + return (Criteria) this; + } + + public Criteria andAbnormalMsgLessThanOrEqualTo(String value) { + addCriterion("abnormal_msg <=", value, "abnormalMsg"); + return (Criteria) this; + } + + public Criteria andAbnormalMsgLike(String value) { + addCriterion("abnormal_msg like", value, "abnormalMsg"); + return (Criteria) this; + } + + public Criteria andAbnormalMsgNotLike(String value) { + addCriterion("abnormal_msg not like", value, "abnormalMsg"); + return (Criteria) this; + } + + public Criteria andAbnormalMsgIn(List values) { + addCriterion("abnormal_msg in", values, "abnormalMsg"); + return (Criteria) this; + } + + public Criteria andAbnormalMsgNotIn(List values) { + addCriterion("abnormal_msg not in", values, "abnormalMsg"); + return (Criteria) this; + } + + public Criteria andAbnormalMsgBetween(String value1, String value2) { + addCriterion("abnormal_msg between", value1, value2, "abnormalMsg"); + return (Criteria) this; + } + + public Criteria andAbnormalMsgNotBetween(String value1, String value2) { + addCriterion("abnormal_msg not between", value1, value2, "abnormalMsg"); + return (Criteria) this; + } + + public Criteria andWhetherRebateIsNull() { + addCriterion("whether_rebate is null"); + return (Criteria) this; + } + + public Criteria andWhetherRebateIsNotNull() { + addCriterion("whether_rebate is not null"); + return (Criteria) this; + } + + public Criteria andWhetherRebateEqualTo(Boolean value) { + addCriterion("whether_rebate =", value, "whetherRebate"); + return (Criteria) this; + } + + public Criteria andWhetherRebateNotEqualTo(Boolean value) { + addCriterion("whether_rebate <>", value, "whetherRebate"); + return (Criteria) this; + } + + public Criteria andWhetherRebateGreaterThan(Boolean value) { + addCriterion("whether_rebate >", value, "whetherRebate"); + return (Criteria) this; + } + + public Criteria andWhetherRebateGreaterThanOrEqualTo(Boolean value) { + addCriterion("whether_rebate >=", value, "whetherRebate"); + return (Criteria) this; + } + + public Criteria andWhetherRebateLessThan(Boolean value) { + addCriterion("whether_rebate <", value, "whetherRebate"); + return (Criteria) this; + } + + public Criteria andWhetherRebateLessThanOrEqualTo(Boolean value) { + addCriterion("whether_rebate <=", value, "whetherRebate"); + return (Criteria) this; + } + + public Criteria andWhetherRebateIn(List values) { + addCriterion("whether_rebate in", values, "whetherRebate"); + return (Criteria) this; + } + + public Criteria andWhetherRebateNotIn(List values) { + addCriterion("whether_rebate not in", values, "whetherRebate"); + return (Criteria) this; + } + + public Criteria andWhetherRebateBetween(Boolean value1, Boolean value2) { + addCriterion("whether_rebate between", value1, value2, "whetherRebate"); + return (Criteria) this; + } + + public Criteria andWhetherRebateNotBetween(Boolean value1, Boolean value2) { + addCriterion("whether_rebate not between", value1, value2, "whetherRebate"); + return (Criteria) this; + } } /** diff --git a/hai-service/src/main/java/com/hai/service/BsIntegralRebateService.java b/hai-service/src/main/java/com/hai/service/BsIntegralRebateService.java index fd73ed1c..6091be72 100644 --- a/hai-service/src/main/java/com/hai/service/BsIntegralRebateService.java +++ b/hai-service/src/main/java/com/hai/service/BsIntegralRebateService.java @@ -79,4 +79,6 @@ public interface BsIntegralRebateService { void integralRebate(JSONObject object); + void integralRechargeRebate(JSONObject object); + } diff --git a/hai-service/src/main/java/com/hai/service/CommonService.java b/hai-service/src/main/java/com/hai/service/CommonService.java index 21926282..e79dfd4a 100644 --- a/hai-service/src/main/java/com/hai/service/CommonService.java +++ b/hai-service/src/main/java/com/hai/service/CommonService.java @@ -8,6 +8,7 @@ package com.hai.service; */ import com.alibaba.fastjson.JSONObject; +import com.hai.entity.ApiCity; import com.hai.entity.SecDictionary; import com.hai.entity.SecRegion; import com.hai.model.IndexCountModel; @@ -282,4 +283,14 @@ public interface CommonService { */ void configPlatform(JSONObject object); + /** + * @Author Sum1Dream + * @name findCityByName.java + * @Description // 根据名称查询城市 + * @Date 15:00 2022/5/12 + * @Param [String name] + * @return void + */ + ApiCity findCityByName(String name); + } diff --git a/hai-service/src/main/java/com/hai/service/HighOrderService.java b/hai-service/src/main/java/com/hai/service/HighOrderService.java index 69b18dca..bcc36c5c 100644 --- a/hai-service/src/main/java/com/hai/service/HighOrderService.java +++ b/hai-service/src/main/java/com/hai/service/HighOrderService.java @@ -561,7 +561,7 @@ public interface HighOrderService { * @Param [java.lang.Integer, java.lang.Long] * @return com.alibaba.fastjson.JSONObject */ - JSONObject orderSource(Integer goodsType , Long goodsId , String orderNo , Long companyId); + JSONObject orderSource(Integer goodsType , Long goodsId , String orderNo , Long companyId , Integer productId); /** * @Author Sum1Dream diff --git a/hai-service/src/main/java/com/hai/service/OutRechargeOrderService.java b/hai-service/src/main/java/com/hai/service/OutRechargeOrderService.java index b47cddec..d0b735d6 100644 --- a/hai-service/src/main/java/com/hai/service/OutRechargeOrderService.java +++ b/hai-service/src/main/java/com/hai/service/OutRechargeOrderService.java @@ -176,5 +176,14 @@ public interface OutRechargeOrderService { */ Integer rechargeOrderNum(Long userId); + /** + * @Author Sum1Dream + * @name integralRebateRechargeOrder.java + * @Description // 查询话费未返利订单 + * @Date 17:49 2022/5/30 + * @Param [java.lang.Long] + * @return java.lang.Integer + */ + List integralRebateRechargeOrder(); } diff --git a/hai-service/src/main/java/com/hai/service/impl/BsIntegralRebateServiceImpl.java b/hai-service/src/main/java/com/hai/service/impl/BsIntegralRebateServiceImpl.java index a3eef794..6f64041d 100644 --- a/hai-service/src/main/java/com/hai/service/impl/BsIntegralRebateServiceImpl.java +++ b/hai-service/src/main/java/com/hai/service/impl/BsIntegralRebateServiceImpl.java @@ -6,10 +6,8 @@ import com.hai.dao.BsIntegralRebateMapper; import com.hai.entity.BsIntegralRebate; import com.hai.entity.BsIntegralRebateExample; import com.hai.entity.HighOrder; -import com.hai.service.BsDistributionUserRelService; -import com.hai.service.BsIntegralRebateService; -import com.hai.service.HighOrderService; -import com.hai.service.HighUserService; +import com.hai.entity.OutRechargeOrder; +import com.hai.service.*; import org.apache.commons.collections4.MapUtils; import org.springframework.stereotype.Service; @@ -31,6 +29,9 @@ public class BsIntegralRebateServiceImpl implements BsIntegralRebateService { @Resource private HighOrderService highOrderService; + @Resource + private OutRechargeOrderService outRechargeOrderService; + @Resource private BsDistributionUserRelService bsDistributionUserRelService; @@ -140,4 +141,49 @@ public class BsIntegralRebateServiceImpl implements BsIntegralRebateService { } } + + @Override + public void integralRechargeRebate(JSONObject object) { + + Map map = new HashMap<>(); + map.put("type" , object.getInteger("type")); + map.put("productId" , object.getLong("productId")); + map.put("companyId" , object.getLong("companyId")); + + if (object.getLong("companyId") != null) { + + BsIntegralRebate bsIntegralRebate = findIntegralRebateByMap(map); + + if (DateUtil.isEffectiveDate(object.getDate("createTime"), bsIntegralRebate.getStartTime() , bsIntegralRebate.getEndTime())) { + JSONObject jsonObject = new JSONObject(); + OutRechargeOrder order = outRechargeOrderService.findByOrderId(object.getLong("orderId")); + + order.setWhetherRebate(true); + + BigDecimal integralNum = object.getBigDecimal("price").multiply(bsIntegralRebate.getPercentage()).setScale( 0, BigDecimal.ROUND_HALF_UP ); + if (bsIntegralRebate.getFirstDistribution() !=null) { + BigDecimal integralNumFirst = object.getBigDecimal("price").multiply(bsIntegralRebate.getFirstDistribution()).setScale( 0, BigDecimal.ROUND_HALF_UP ); + jsonObject.put("integralNumFirst" , integralNumFirst); + } + if (bsIntegralRebate.getSecondDistribution() !=null) { + BigDecimal integralNumSecond = object.getBigDecimal("price").multiply(bsIntegralRebate.getSecondDistribution()).setScale( 0, BigDecimal.ROUND_HALF_UP ); + jsonObject.put("integralNumSecond" , integralNumSecond); + } + + order.setWhetherRebate(true); + + jsonObject.put("title" , object.getString("name")); + jsonObject.put("orderNo" , order.getOrderNo()); + jsonObject.put("userId" , object.getLong("userId")); + jsonObject.put("logoImg" , object.getString("logoImg")); + + bsDistributionUserRelService.distributionRebate(jsonObject); + outRechargeOrderService.updateOrder(order); + highUserService.goldHandle(object.getLong("userId"), integralNum.intValue(), 1, 4, object.getLong("orderId") , object.getString("remark") + integralNum); + + } + + } + + } } diff --git a/hai-service/src/main/java/com/hai/service/impl/CommonServiceImpl.java b/hai-service/src/main/java/com/hai/service/impl/CommonServiceImpl.java index 80ea1313..25e37784 100644 --- a/hai-service/src/main/java/com/hai/service/impl/CommonServiceImpl.java +++ b/hai-service/src/main/java/com/hai/service/impl/CommonServiceImpl.java @@ -65,6 +65,9 @@ public class CommonServiceImpl implements CommonService { @Resource private BsProductPayTypeMapper bsProductPayTypeMapper; + @Resource + private ApiCityMapper apiCityMapper; + private Map> dicCache = new HashMap>(); private List citiesCache = new ArrayList<>(); @@ -617,7 +620,21 @@ public class CommonServiceImpl implements CommonService { } } - // 清空支付方式配置 + @Override + public ApiCity findCityByName(String name) { + ApiCityExample example = new ApiCityExample(); + example.createCriteria().andCityNameEqualTo(name); + + List list = apiCityMapper.selectByExample(example); + + if (list.size()>0) { + return list.get(0); + } + + return null; + } + + // 清空支付方式配置 private void deletePayType(Long sourceId) { if (sourceId == null) { @@ -676,4 +693,6 @@ public class CommonServiceImpl implements CommonService { } } + + } diff --git a/hai-service/src/main/java/com/hai/service/impl/HighOrderServiceImpl.java b/hai-service/src/main/java/com/hai/service/impl/HighOrderServiceImpl.java index cb3d2e10..ad812c72 100644 --- a/hai-service/src/main/java/com/hai/service/impl/HighOrderServiceImpl.java +++ b/hai-service/src/main/java/com/hai/service/impl/HighOrderServiceImpl.java @@ -3010,7 +3010,7 @@ public class HighOrderServiceImpl implements HighOrderService { } @Override - public JSONObject orderSource(Integer goodsType, Long goodsId , String orderNo , Long companyId) { + public JSONObject orderSource(Integer goodsType, Long goodsId , String orderNo , Long companyId , Integer productId) { JSONObject object = new JSONObject(); @@ -3054,6 +3054,13 @@ public class HighOrderServiceImpl implements HighOrderService { object.put("remark" , "会员充值订单" + orderNo + "积分返利:"); object.put("name" , "购买会员充值产品"); } + if (goodsType == 20) { + object.put("type" , 3); + object.put("productId", productId); + object.put("companyId", companyId); + object.put("remark" , "话费充值订单" + orderNo + "积分返利:"); + object.put("name" , "购买话费充值产品"); + } object.put("logoImg" , OrderLogoEnum.getNameByImgUrl(goodsType)); return object; diff --git a/hai-service/src/main/java/com/hai/service/impl/OutRechargeOrderServiceImpl.java b/hai-service/src/main/java/com/hai/service/impl/OutRechargeOrderServiceImpl.java index d574e491..83403cf9 100644 --- a/hai-service/src/main/java/com/hai/service/impl/OutRechargeOrderServiceImpl.java +++ b/hai-service/src/main/java/com/hai/service/impl/OutRechargeOrderServiceImpl.java @@ -322,6 +322,7 @@ public class OutRechargeOrderServiceImpl implements OutRechargeOrderService { outRechargeOrder.setOrderNo("RCG" + DateUtil.date2String(new Date(), "yyyyMMddHHmmss") + IDGenerator.nextId(5)); outRechargeOrder.setCreateTimed(new Date()); outRechargeOrder.setGoodsId(goodsId); + outRechargeOrder.setWhetherRebate(false); outRechargeOrder.setMerchId(object.getString("mchId")); outRechargeOrder.setRechargePrice(outRechargePrice.getRechargePrice()); if (object.getLong("memDiscountId") != null) { @@ -435,33 +436,6 @@ public class OutRechargeOrderServiceImpl implements OutRechargeOrderService { public void finishOrder(Long orderId) { OutRechargeOrder order = findByOrderId(orderId); if (order != null) { - - new Thread(() -> { - JSONObject object = new JSONObject(); - - object.put("type" , 3); - object.put("productId" , order.getOperatorType()); - object.put("companyId" , order.getCompanyId()); - object.put("price" , order.getPayRealPrice()); - object.put("userId" , order.getUserId()); - object.put("orderId" , order.getId()); - object.put("remark" , "话费订单" + order.getOrderNo() + "积分返利:"); - - - Map map = new HashMap<>(); - map.put("goldType", 1); - map.put("resType", 4); - map.put("userId", order.getUserId()); - map.put("resId", order.getId()); - - List goldRecs = highGoldRecService.getGoldRec(map); - - if (goldRecs.size() == 0) { - bsIntegralRebateService.integralRebate(object); - } - - }).start(); - order.setRechargeStatus(202); // 订单状态:1 待支付 2 已支付 3.已完成 4. 已取消 5.已退款 order.setPayStatus(100); // 订单状态:1 待支付 2 已支付 3.已完成 4. 已取消 5.已退款 order.setFinishTime(new Date()); @@ -1004,4 +978,9 @@ public class OutRechargeOrderServiceImpl implements OutRechargeOrderService { return outRechargeOrderMapper.selectByExample(example).size(); } + @Override + public List integralRebateRechargeOrder() { + return outRechargeOrderMapper.integralRebateRechargeOrder(); + } + } diff --git a/v1/hai-v1.iml b/v1/hai-v1.iml new file mode 100644 index 00000000..9ecb2698 --- /dev/null +++ b/v1/hai-v1.iml @@ -0,0 +1,220 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file