Merge branch '2.0-master' of http://139.159.177.244:3000/hurui/hai-server into 2.0-master

dev-discount
胡锐 2 years ago
commit c17690c4a9
  1. 58
      hai-bweb/src/main/java/com/bweb/controller/ApiMchProduct/ApiMchProductController.java
  2. 2
      hai-bweb/src/main/java/com/bweb/controller/HighTestController.java
  3. 5
      hai-schedule/src/main/java/com/hai/schedule/HighRechargeOrderSchedule.java
  4. 3
      hai-service/src/main/java/com/hai/openApi/service/ApiMchProductService.java
  5. 5
      hai-service/src/main/java/com/hai/openApi/service/impl/ApiMchProductServiceImpl.java

@ -1,15 +1,30 @@
package com.bweb.controller.ApiMchProduct; package com.bweb.controller.ApiMchProduct;
import com.alibaba.fastjson.JSONObject;
import com.hai.common.exception.ErrorCode;
import com.hai.common.exception.ErrorHelp;
import com.hai.common.exception.SysCode;
import com.hai.common.security.SessionObject;
import com.hai.common.security.UserCenter; import com.hai.common.security.UserCenter;
import com.hai.common.utils.ResponseMsgUtil;
import com.hai.model.ResponseData;
import com.hai.model.UserInfoModel;
import com.hai.openApi.service.ApiMchProductService; import com.hai.openApi.service.ApiMchProductService;
import com.hai.order.type.OrderProductType;
import io.swagger.annotations.Api; import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.slf4j.Logger; import org.slf4j.Logger;
import org.slf4j.LoggerFactory; import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
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.ResponseBody;
import javax.annotation.Resource; import javax.annotation.Resource;
import javax.servlet.http.HttpServletRequest;
import java.util.Objects;
@Controller @Controller
@RequestMapping(value = "/apiMchProduct") @RequestMapping(value = "/apiMchProduct")
@ -24,4 +39,47 @@ public class ApiMchProductController {
@Autowired @Autowired
private UserCenter userCenter; private UserCenter userCenter;
@RequestMapping(value = "/insertMchProduct", method = RequestMethod.POST)
@ResponseBody
@ApiOperation(value = "新增产品")
public ResponseData insertMchProduct(@RequestBody JSONObject object, HttpServletRequest request) {
try {
SessionObject sessionObject = userCenter.getSessionObject(request);
UserInfoModel userInfoModel = (UserInfoModel) sessionObject.getObject();
if (object == null ||
object.getInteger("productType") == null ||
object.getString("mchId") == null ||
object.getBigDecimal("discount") == null
) {
log.error("ApiProductController -> insertProduct() error!");
throw ErrorHelp.genException(SysCode.System, ErrorCode.REQ_PARAMS_ERROR, "");
}
if (Objects.equals(object.getInteger("productType"), OrderProductType.PRODUCT_TYPE6.getNumber())) {
if (object.getLong("companyId") == null ||
object.getString("merchantId") == null
) {
log.error("ApiProductController -> insertProduct() error!");
throw ErrorHelp.genException(SysCode.System, ErrorCode.REQ_PARAMS_ERROR, "");
}
}
object.put("operatorId", userInfoModel.getSecUser().getId());
object.put("operatorName", userInfoModel.getSecUser().getLoginName());
apiMchProductService.insertMchProduct(object);
return ResponseMsgUtil.success("新增成功");
} catch (Exception e) {
log.error("ApiProductController --> insertPrice() error!", e);
return ResponseMsgUtil.exception(e);
}
}
} }

File diff suppressed because one or more lines are too long

@ -102,8 +102,11 @@ public class HighRechargeOrderSchedule {
OutRechargeOrder outRechargeOrder = outRechargeOrderService.findByOrderNo(order.getOrderNo()); OutRechargeOrder outRechargeOrder = outRechargeOrderService.findByOrderNo(order.getOrderNo());
OutRechargeChildOrder childOrder = outRechargeOrder.getOutRechargeChildOrders().get(0); OutRechargeChildOrder childOrder = new OutRechargeChildOrder();
if (outRechargeOrder.getOutRechargeChildOrders().size() > 0) {
childOrder = outRechargeOrder.getOutRechargeChildOrders().get(0);
}
outRechargeOrderService.rechargeOrderHandle(outRechargeOrder , childOrder); outRechargeOrderService.rechargeOrderHandle(outRechargeOrder , childOrder);

@ -1,5 +1,6 @@
package com.hai.openApi.service; package com.hai.openApi.service;
import com.alibaba.fastjson.JSONObject;
import com.hai.entity.ApiMchProduct; import com.hai.entity.ApiMchProduct;
import java.util.List; import java.util.List;
@ -22,7 +23,7 @@ public interface ApiMchProductService {
* @Param [apiMchProduct] * @Param [apiMchProduct]
* @Return void * @Return void
*/ */
void insertMchProduct(ApiMchProduct apiMchProduct); void insertMchProduct(JSONObject object);
/** /**
* @Author Sum1Dream * @Author Sum1Dream
* @Name updateMchProduct * @Name updateMchProduct

@ -1,5 +1,6 @@
package com.hai.openApi.service.impl; package com.hai.openApi.service.impl;
import com.alibaba.fastjson.JSONObject;
import com.hai.dao.ApiMchProductMapper; import com.hai.dao.ApiMchProductMapper;
import com.hai.entity.ApiMchProduct; import com.hai.entity.ApiMchProduct;
import com.hai.openApi.service.ApiMchProductService; import com.hai.openApi.service.ApiMchProductService;
@ -16,8 +17,8 @@ public class ApiMchProductServiceImpl implements ApiMchProductService {
private ApiMchProductMapper apiMchProductMapper; private ApiMchProductMapper apiMchProductMapper;
@Override @Override
public void insertMchProduct(ApiMchProduct apiMchProduct) { public void insertMchProduct(JSONObject object) {
apiMchProductMapper.insert(apiMchProduct); // apiMchProductMapper.insert(apiMchProduct);
} }
@Override @Override

Loading…
Cancel
Save