|
|
@ -8,16 +8,13 @@ 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.common.utils.ResponseMsgUtil; |
|
|
|
import com.hai.config.EtcService; |
|
|
|
import com.hai.config.EtcService; |
|
|
|
import com.hai.entity.EtcCarMsg; |
|
|
|
import com.hai.entity.*; |
|
|
|
import com.hai.entity.EtcContractOrder; |
|
|
|
|
|
|
|
import com.hai.entity.EtcCustMsg; |
|
|
|
|
|
|
|
import com.hai.entity.SecDictionary; |
|
|
|
|
|
|
|
import com.hai.etc.EtcCarMsgService; |
|
|
|
import com.hai.etc.EtcCarMsgService; |
|
|
|
import com.hai.etc.EtcCustMsgService; |
|
|
|
import com.hai.etc.EtcCustMsgService; |
|
|
|
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.model.UserInfoModel; |
|
|
|
import com.hai.service.CommonService; |
|
|
|
import com.hai.service.*; |
|
|
|
import io.swagger.annotations.Api; |
|
|
|
import io.swagger.annotations.Api; |
|
|
|
import io.swagger.annotations.ApiOperation; |
|
|
|
import io.swagger.annotations.ApiOperation; |
|
|
|
import org.slf4j.Logger; |
|
|
|
import org.slf4j.Logger; |
|
|
@ -44,6 +41,15 @@ public class EtcCustomerController { |
|
|
|
@Resource |
|
|
|
@Resource |
|
|
|
private EtcCarMsgService etcCarMsgService; |
|
|
|
private EtcCarMsgService etcCarMsgService; |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@Resource |
|
|
|
|
|
|
|
private SecConfigService secConfigService; |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@Resource |
|
|
|
|
|
|
|
private HighDiscountPackageService highDiscountPackageService; |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@Resource |
|
|
|
|
|
|
|
private HighDiscountPackageDetailsService highDiscountPackageDetailsService; |
|
|
|
|
|
|
|
|
|
|
|
@RequestMapping(value = "/getEtcCarMsgList", method = RequestMethod.GET) |
|
|
|
@RequestMapping(value = "/getEtcCarMsgList", method = RequestMethod.GET) |
|
|
|
@ResponseBody |
|
|
|
@ResponseBody |
|
|
|
@ApiOperation(value = "查询车辆列表") |
|
|
|
@ApiOperation(value = "查询车辆列表") |
|
|
@ -241,12 +247,16 @@ public class EtcCustomerController { |
|
|
|
@RequestParam(value = "type", required = true) Integer type) { |
|
|
|
@RequestParam(value = "type", required = true) Integer type) { |
|
|
|
try { |
|
|
|
try { |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
EtcContractOrder contractOrder = etcCarMsgService.findContractOrderById(contractId); |
|
|
|
EtcContractOrder contractOrder = etcCarMsgService.findContractOrderById(contractId); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if (contractOrder == null) { |
|
|
|
|
|
|
|
throw ErrorHelp.genException(SysCode.System, ErrorCode.COMMON_ERROR, "订单不存在!"); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
if (type == 1) { |
|
|
|
if (type == 1) { |
|
|
|
JSONObject object = EtcService.checkNeedSignWechatWithhold( contractOrder.getProductId() , contractOrder.getCardVarietyId()); |
|
|
|
JSONObject object = EtcService.checkNeedSignWechatWithhold( contractOrder.getProductId() , contractOrder.getCardVarietyId() , contractOrder.getVehId()); |
|
|
|
if (object.getString("errCode").equals("0")) { |
|
|
|
if (object.getString("errCode").equals("0")) { |
|
|
|
|
|
|
|
|
|
|
|
return ResponseMsgUtil.success(object.getJSONObject("result")); |
|
|
|
return ResponseMsgUtil.success(object.getJSONObject("result")); |
|
|
|
} else { |
|
|
|
} else { |
|
|
|
throw ErrorHelp.genException(SysCode.System, ErrorCode.COMMON_ERROR, object.getString("errMsg")); |
|
|
|
throw ErrorHelp.genException(SysCode.System, ErrorCode.COMMON_ERROR, object.getString("errMsg")); |
|
|
@ -310,6 +320,8 @@ public class EtcCustomerController { |
|
|
|
public ResponseData signWithhold(@RequestBody JSONObject object, HttpServletRequest request) { |
|
|
|
public ResponseData signWithhold(@RequestBody JSONObject object, HttpServletRequest request) { |
|
|
|
try { |
|
|
|
try { |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
System.out.println(object); |
|
|
|
|
|
|
|
|
|
|
|
if (object.getString("custId") == null || |
|
|
|
if (object.getString("custId") == null || |
|
|
|
object.getString("cardNo") == null || |
|
|
|
object.getString("cardNo") == null || |
|
|
|
object.getInteger("bankCardType") == null || |
|
|
|
object.getInteger("bankCardType") == null || |
|
|
@ -339,7 +351,40 @@ public class EtcCustomerController { |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@RequestMapping(value = "/getEquity", method = RequestMethod.POST) |
|
|
|
|
|
|
|
@ResponseBody |
|
|
|
|
|
|
|
@ApiOperation(value = "获取权益") |
|
|
|
|
|
|
|
public ResponseData getEquity() { |
|
|
|
|
|
|
|
try { |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// 查询赠送优惠券
|
|
|
|
|
|
|
|
SecConfig secConfig = secConfigService.findByCodeType("GIVE_DISCOUNT_PACKAGE"); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// 获取卡券数量
|
|
|
|
|
|
|
|
String[] discountPackageId = secConfig.getCodeValue().split(","); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
List<JSONObject> list = new ArrayList<>(); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
for (String id : discountPackageId) { |
|
|
|
|
|
|
|
JSONObject jsonObject = new JSONObject(); |
|
|
|
|
|
|
|
HighDiscountPackage discountPackage = highDiscountPackageService.findDiscountPackageById(Integer.valueOf(id)); |
|
|
|
|
|
|
|
if (discountPackage != null) { |
|
|
|
|
|
|
|
jsonObject.put("packageDetail", discountPackage); |
|
|
|
|
|
|
|
// 查询包内的优惠券
|
|
|
|
|
|
|
|
List<HighDiscountPackageDetails> detailsList = highDiscountPackageDetailsService.getDetailByPackage(Integer.valueOf(id)); |
|
|
|
|
|
|
|
jsonObject.put("discountList", detailsList); |
|
|
|
|
|
|
|
list.add(jsonObject); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
return ResponseMsgUtil.success(list); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
} catch (Exception e) { |
|
|
|
|
|
|
|
log.error("HighUserController --> findByUserId() error!", e); |
|
|
|
|
|
|
|
return ResponseMsgUtil.exception(e); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
} |
|
|
|
} |
|
|
|