合并话费修改

袁野 2 years ago
parent 8310ec1af5
commit bff8c0bc7a
  1. 16
      hai-bweb/src/main/java/com/bweb/controller/ApiMerchantsController.java
  2. 91
      hai-bweb/src/main/java/com/bweb/controller/ApiProductController.java
  3. 42
      hai-service/src/main/java/com/hai/dao/ApiProductConfigMapperExt.java
  4. 60
      hai-service/src/main/java/com/hai/model/ApiProductConfigModel.java
  5. 15
      hai-service/src/main/java/com/hai/service/ApiMerchantsService.java
  6. 21
      hai-service/src/main/java/com/hai/service/ApiProductService.java
  7. 11
      hai-service/src/main/java/com/hai/service/impl/ApiMerchantsServiceImpl.java
  8. 13
      hai-service/src/main/java/com/hai/service/impl/ApiProductServiceImpl.java
  9. 8
      hai-service/src/main/resources/dev/commonConfig.properties

@ -11,6 +11,7 @@ import com.hai.common.security.UserCenter;
import com.hai.common.utils.*; import com.hai.common.utils.*;
import com.hai.entity.ApiMerchants; import com.hai.entity.ApiMerchants;
import com.hai.entity.ApiProduct; import com.hai.entity.ApiProduct;
import com.hai.entity.ApiProductConfig;
import com.hai.enum_type.ApiAmountRecordTypeEnum; import com.hai.enum_type.ApiAmountRecordTypeEnum;
import com.hai.enum_type.CompanyAmountSourceTypeEnum; import com.hai.enum_type.CompanyAmountSourceTypeEnum;
import com.hai.model.HighMerchantModel; import com.hai.model.HighMerchantModel;
@ -278,4 +279,19 @@ public class ApiMerchantsController {
} }
} }
@RequestMapping(value = "/getListMerchProduct", method = RequestMethod.GET)
@ResponseBody
@ApiOperation(value = "查询商户产品")
public ResponseData getListMerchProduct(@RequestParam(value = "merchantId", required = true) Long merchantId) {
try {
return ResponseMsgUtil.success(apiMerchantsService.getListMerchProduct(merchantId));
} catch (Exception e) {
log.error("ApiMerchantsController --> findById() error!", e);
return ResponseMsgUtil.exception(e);
}
}
} }

@ -10,10 +10,7 @@ import com.hai.common.security.SessionObject;
import com.hai.common.security.UserCenter; import com.hai.common.security.UserCenter;
import com.hai.common.utils.PageUtil; import com.hai.common.utils.PageUtil;
import com.hai.common.utils.ResponseMsgUtil; import com.hai.common.utils.ResponseMsgUtil;
import com.hai.entity.ApiProduct; import com.hai.entity.*;
import com.hai.entity.BsOperationLog;
import com.hai.entity.HighAgent;
import com.hai.entity.OutRechargePrice;
import com.hai.model.OutRechargePriceModel; import com.hai.model.OutRechargePriceModel;
import com.hai.model.ResponseData; import com.hai.model.ResponseData;
import com.hai.model.UserInfoModel; import com.hai.model.UserInfoModel;
@ -236,7 +233,7 @@ public class ApiProductController {
if (object == null || if (object == null ||
object.getJSONArray("productIds") == null || object.getJSONArray("productIds") == null ||
object.getInteger("discount") == null || object.getBigDecimal("discount") == null ||
object.getLong("merchantsId") == null object.getLong("merchantsId") == null
) { ) {
log.error("ApiProductController -> configApiProduct() error!"); log.error("ApiProductController -> configApiProduct() error!");
@ -253,4 +250,88 @@ public class ApiProductController {
} }
} }
@RequestMapping(value = "/editConfigApiProductByStatus", method = RequestMethod.POST)
@ResponseBody
@ApiOperation(value = "修改商户产品状态")
public ResponseData editConfigApiProductByStatus(@RequestBody JSONObject object, HttpServletRequest request) {
try {
if (object == null ||
object.getInteger("status") == null ||
object.getInteger("id") == null
) {
log.error("ApiProductController -> configApiProduct() error!");
throw ErrorHelp.genException(SysCode.System, ErrorCode.REQ_PARAMS_ERROR, "");
}
SessionObject sessionObject = userCenter.getSessionObject(request);
UserInfoModel userInfoModel = (UserInfoModel) sessionObject.getObject();
ApiProductConfig apiProductConfig = apiProductService.findProductConfigById(object.getLong("id"));
apiProductConfig.setStatus(object.getInteger("status"));
apiProductConfig.setOperatorName(userInfoModel.getSecUser().getUserName());
apiProductConfig.setOperatorId(userInfoModel.getSecUser().getId());
apiProductService.updateConfigApiProduct(apiProductConfig);
return ResponseMsgUtil.success("修改成功");
} catch (Exception e) {
log.error("ApiProductController --> editPriceStatus() error!", e);
return ResponseMsgUtil.exception(e);
}
}
@RequestMapping(value = "/updateConfigApiProduct", method = RequestMethod.POST)
@ResponseBody
@ApiOperation(value = "修改配置产品")
public ResponseData updateConfigApiProduct(@RequestBody JSONObject object) {
try {
if (object == null ||
object.getBigDecimal("discount") == null ||
object.getLong("id") == null
) {
log.error("ApiProductController -> configApiProduct() error!");
throw ErrorHelp.genException(SysCode.System, ErrorCode.REQ_PARAMS_ERROR, "");
}
ApiProductConfig apiProductConfig = apiProductService.findProductConfigById(object.getLong("id"));
ApiProduct apiProduct = apiProductService.findById(apiProductConfig.getProductId());
if (apiProductConfig.getStatus() == 101) {
log.error("ApiProductController -> configApiProduct() error!");
throw ErrorHelp.genException(SysCode.System, ErrorCode.COMMON_ERROR, "当前状态错误");
}
apiProductConfig.setDiscount(object.getBigDecimal("discount"));
apiProductConfig.setDiscountPrice(apiProduct.getRechargePrice().multiply(object.getBigDecimal("discount")).divide(new BigDecimal(100)));
apiProductService.updateConfigApiProduct(apiProductConfig);
return ResponseMsgUtil.success("修改成功");
} catch (Exception e) {
log.error("ApiProductController --> insertPrice() error!", e);
return ResponseMsgUtil.exception(e);
}
}
@RequestMapping(value = "/findConfigProduct", method = RequestMethod.GET)
@ResponseBody
@ApiOperation(value = "查询配置产品")
public ResponseData findConfigProduct(@RequestParam(value = "id", required = true) Long id) {
try {
return ResponseMsgUtil.success(apiProductService.findProductConfigById(id));
} catch (Exception e) {
log.error("ApiMerchantsController --> findById() error!", e);
return ResponseMsgUtil.exception(e);
}
}
} }

@ -1,7 +1,47 @@
package com.hai.dao; package com.hai.dao;
import com.hai.model.ApiProductConfigModel;
import com.hai.model.OutUserOrderModel;
import org.apache.ibatis.annotations.Result;
import org.apache.ibatis.annotations.Results;
import org.apache.ibatis.annotations.Select;
import org.apache.ibatis.type.JdbcType;
import java.util.List;
/** /**
* mapper扩展类 * mapper扩展类
*/ */
public interface ApiProductConfigMapperExt { public interface ApiProductConfigMapperExt {
}
@Select(value = {
"<script>",
" select ap.* , discount_price , apc.id as api_config_product_id , discount , apc.status as config_status from api_product ap join api_product_config apc on ap.id = apc.product_id where apc.status != 100",
" and merchants_id = #{merchantsId} " +
"</script>"
})
@Results({
@Result(column="id", property="id", jdbcType=JdbcType.BIGINT, id=true),
@Result(column="recharge_type", property="rechargeType", jdbcType=JdbcType.INTEGER),
@Result(column="recharge_platform", property="rechargePlatform", jdbcType=JdbcType.VARCHAR),
@Result(column="phone_recharge_type", property="phoneRechargeType", jdbcType=JdbcType.INTEGER),
@Result(column="operator_type", property="operatorType", jdbcType=JdbcType.INTEGER),
@Result(column="recharge_price", property="rechargePrice", jdbcType=JdbcType.DECIMAL),
@Result(column="product_id", property="productId", jdbcType=JdbcType.BIGINT),
@Result(column="api_config_product_id", property="apiConfigProductId", jdbcType=JdbcType.BIGINT),
@Result(column="sort", property="sort", jdbcType=JdbcType.INTEGER),
@Result(column="discount", property="discount", jdbcType=JdbcType.DECIMAL),
@Result(column="discount_price", property="discountPrice", jdbcType=JdbcType.DECIMAL),
@Result(column="operator_id", property="operatorId", jdbcType=JdbcType.BIGINT),
@Result(column="operator_name", property="operatorName", jdbcType=JdbcType.VARCHAR),
@Result(column="create_time", property="createTime", jdbcType=JdbcType.TIMESTAMP),
@Result(column="update_time", property="updateTime", jdbcType=JdbcType.TIMESTAMP),
@Result(column="status", property="status", jdbcType=JdbcType.INTEGER),
@Result(column="config_status", property="configStatus", 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)
})
List<ApiProductConfigModel> getListMerchProduct(Long merchantsId);
}

@ -0,0 +1,60 @@
package com.hai.model;
import com.hai.entity.ApiProduct;
import com.hai.entity.ApiProductConfig;
import java.math.BigDecimal;
public class ApiProductConfigModel extends ApiProduct {
/**
* 折扣比例
*/
private BigDecimal discount;
/**
* 折扣价格
*/
private BigDecimal discountPrice;
/**
* 主键
*/
private Long apiConfigProductId;
/**
* 101 正常 102 下架 100 删除
*/
private Integer configStatus;
public Integer getConfigStatus() {
return configStatus;
}
public void setConfigStatus(Integer configStatus) {
this.configStatus = configStatus;
}
public Long getApiConfigProductId() {
return apiConfigProductId;
}
public void setApiConfigProductId(Long apiConfigProductId) {
this.apiConfigProductId = apiConfigProductId;
}
public BigDecimal getDiscount() {
return discount;
}
public void setDiscount(BigDecimal discount) {
this.discount = discount;
}
public BigDecimal getDiscountPrice() {
return discountPrice;
}
public void setDiscountPrice(BigDecimal discountPrice) {
this.discountPrice = discountPrice;
}
}

@ -3,6 +3,8 @@ package com.hai.service;
import com.alibaba.fastjson.JSONObject; import com.alibaba.fastjson.JSONObject;
import com.hai.entity.ApiAmountRecord; import com.hai.entity.ApiAmountRecord;
import com.hai.entity.ApiMerchants; import com.hai.entity.ApiMerchants;
import com.hai.entity.ApiProductConfig;
import com.hai.model.ApiProductConfigModel;
import java.math.BigDecimal; import java.math.BigDecimal;
import java.util.List; import java.util.List;
@ -77,5 +79,18 @@ public interface ApiMerchantsService {
*/ */
List<ApiAmountRecord> getMerchRechargeData(Long merchantId); List<ApiAmountRecord> getMerchRechargeData(Long merchantId);
/**
* @Author Sum1Dream
* @name getListMerchProduct.java
* @Description // 查询商户配置产品
* @Date 10:10 2022/6/9
* @Param [java.lang.Long]
* @return java.util.List<com.hai.entity.ApiProductConfig>
*/
List<ApiProductConfigModel> getListMerchProduct(Long merchantId);
} }

@ -2,6 +2,7 @@ package com.hai.service;
import com.alibaba.fastjson.JSONObject; import com.alibaba.fastjson.JSONObject;
import com.hai.entity.ApiProduct; import com.hai.entity.ApiProduct;
import com.hai.entity.ApiProductConfig;
import io.swagger.annotations.Api; import io.swagger.annotations.Api;
import java.util.List; import java.util.List;
@ -65,4 +66,24 @@ public interface ApiProductService {
* @return void * @return void
*/ */
void configApiProduct(JSONObject object); void configApiProduct(JSONObject object);
/**
* @Author Sum1Dream
* @name updateConfigApiProduct.java
* @Description // 修改配置产品
* @Date 11:17 2022/6/9
* @Param [com.alibaba.fastjson.JSONObject]
* @return void
*/
void updateConfigApiProduct(ApiProductConfig apiProductConfig);
/**
* @Author Sum1Dream
* @name findProductConfigById.java
* @Description // 查询配置产品
* @Date 11:02 2022/6/9
* @Param [java.lang.Long]
* @return com.hai.entity.ApiProductConfig
*/
ApiProductConfig findProductConfigById(Long id);
} }

@ -7,7 +7,9 @@ import com.hai.common.security.UserCenter;
import com.hai.common.utils.RedisUtil; import com.hai.common.utils.RedisUtil;
import com.hai.dao.ApiAmountRecordMapper; import com.hai.dao.ApiAmountRecordMapper;
import com.hai.dao.ApiMerchantsMapper; import com.hai.dao.ApiMerchantsMapper;
import com.hai.dao.ApiProductConfigMapper;
import com.hai.entity.*; import com.hai.entity.*;
import com.hai.model.ApiProductConfigModel;
import com.hai.model.UserInfoModel; import com.hai.model.UserInfoModel;
import com.hai.service.ApiMerchantsService; import com.hai.service.ApiMerchantsService;
import org.apache.commons.collections4.MapUtils; import org.apache.commons.collections4.MapUtils;
@ -37,6 +39,9 @@ public class ApiMerchantsServiceImpl implements ApiMerchantsService {
@Resource @Resource
private ApiAmountRecordMapper apiAmountRecordMapper; private ApiAmountRecordMapper apiAmountRecordMapper;
@Resource
private ApiProductConfigMapper apiProductConfigMapper;
@Override @Override
public void insertApiMerchants(ApiMerchants apiMerchants) { public void insertApiMerchants(ApiMerchants apiMerchants) {
apiMerchantsMapper.insert(apiMerchants); apiMerchantsMapper.insert(apiMerchants);
@ -134,4 +139,10 @@ public class ApiMerchantsServiceImpl implements ApiMerchantsService {
example.createCriteria().andMchIdEqualTo(apiMerchants.getMchId()); example.createCriteria().andMchIdEqualTo(apiMerchants.getMchId());
return apiAmountRecordMapper.selectByExample(example); return apiAmountRecordMapper.selectByExample(example);
} }
@Override
public List<ApiProductConfigModel> getListMerchProduct(Long merchantId) {
return apiProductConfigMapper.getListMerchProduct(merchantId);
}
} }

@ -112,7 +112,9 @@ public class ApiProductServiceImpl implements ApiProductService {
// 转换产品数组 // 转换产品数组
JSONArray productsArray = object.getJSONArray("productIds"); JSONArray productsArray = object.getJSONArray("productIds");
ApiProductConfig apiProductConfig; ApiProductConfig apiProductConfig;
ApiProduct apiProduct;
for (Object productId : productsArray) { for (Object productId : productsArray) {
apiProduct = apiProductMapper.selectByPrimaryKey(Long.valueOf(productId.toString()));
apiProductConfig = new ApiProductConfig(); apiProductConfig = new ApiProductConfig();
apiProductConfig.setProductId(Long.valueOf(productId.toString())); apiProductConfig.setProductId(Long.valueOf(productId.toString()));
apiProductConfig.setCreateTime(new Date()); apiProductConfig.setCreateTime(new Date());
@ -120,9 +122,20 @@ public class ApiProductServiceImpl implements ApiProductService {
apiProductConfig.setOperatorName(sessionModel.getSecUser().getUserName()); apiProductConfig.setOperatorName(sessionModel.getSecUser().getUserName());
apiProductConfig.setStatus(101); apiProductConfig.setStatus(101);
apiProductConfig.setDiscount(object.getBigDecimal("discount")); apiProductConfig.setDiscount(object.getBigDecimal("discount"));
apiProductConfig.setDiscountPrice(apiProduct.getRechargePrice().multiply(object.getBigDecimal("discount")).divide(new BigDecimal(100)));
apiProductConfig.setMerchantsId(object.getLong("merchantsId")); apiProductConfig.setMerchantsId(object.getLong("merchantsId"));
apiProductConfig.setUpdateTime(new Date()); apiProductConfig.setUpdateTime(new Date());
apiProductConfigMapper.insert(apiProductConfig); apiProductConfigMapper.insert(apiProductConfig);
} }
} }
@Override
public ApiProductConfig findProductConfigById(Long id) {
return apiProductConfigMapper.selectByPrimaryKey(id);
}
@Override
public void updateConfigApiProduct(ApiProductConfig apiProductConfig) {
apiProductConfigMapper.updateByPrimaryKey(apiProductConfig);
}
} }

@ -14,10 +14,10 @@ qinzhuSecret=ktxb49sh2jfhgn8g
qianzhuOrderNotify=https://hsg.dctpay.com/crest/qianzhu/orderNotify qianzhuOrderNotify=https://hsg.dctpay.com/crest/qianzhu/orderNotify
# ??????? # ???????
huiliantongUrl=https://gzapi.deepermobile.com.cn huiliantongUrl=https://gzapitest.deepermobile.com.cn:441
huiliantongAppNo=guizhouhuilt huiliantongAppNo=guizhouhltcs
huiliantongAppkey=e0ja2Ex%2BmQ2hIPF6x%2BHA%3D huiliantongAppkey=g%2BNnjR54YSUWM2iKg%2Fd82A9x9hg2kYV7
huiliantongAppsecret=52662415DDCE55C7BA34223BCF53877A huiliantongAppsecret=FA28E95ACABFA4B2B8E25857437B07F1
# ???????? # ????????
HuiLianTongUnionCardUrl=http://hltgz.com:4010/api/v2/execute.json HuiLianTongUnionCardUrl=http://hltgz.com:4010/api/v2/execute.json

Loading…
Cancel
Save