|
@@ -1901,8 +1901,7 @@ public class TOrderController {
|
|
|
@ApiOperation(value = "购物车 微信支付")
|
|
|
@PostMapping("/carsPayXCX")
|
|
|
public Object carsPayXCX(String clientId,String id, @RequestBody Map<String,String> productNameMap) {
|
|
|
-// IPage<?> iPage = R.getDataIfSuccess(szwlFeign.testPay("1"));
|
|
|
-// productName = "玫瑰精灵";
|
|
|
+
|
|
|
if(productNameMap==null){
|
|
|
return JsonMessage.error("数据出错");
|
|
|
}
|
|
@@ -1915,15 +1914,11 @@ public class TOrderController {
|
|
|
}
|
|
|
List<TPromoCode> promoCodeAll = new ArrayList<>();
|
|
|
BigDecimal price = new BigDecimal("0.00");
|
|
|
-// JSONObject mapList = JSON.parseObject(productNameMap);
|
|
|
TEquipmentDesc equipmentDesc = R.getDataIfSuccess(szwlFeign.findEquipmentById(equipment.getId()));
|
|
|
if(equipmentDesc==null||equipmentDesc.getEquipmentId()==null||equipmentDesc.getPayType()==null||equipmentDesc.getPayType().equals("0")){
|
|
|
//1,type=0,原始设定,没有第二件半价
|
|
|
for (String key : productNameMap.keySet()) {
|
|
|
-// System.out.println("key= "+ key + " and value= " + productNameMap.get(key));
|
|
|
String entryValue = String.valueOf(productNameMap.get(key));
|
|
|
-// String key = String.valueOf(entry.getKey());
|
|
|
-// String entryValue = String.valueOf(entry.getValue());
|
|
|
List<String> value = JSON.parseArray(entryValue, String.class);
|
|
|
List<TPromoCode> promoCodeList = new ArrayList<>();
|
|
|
//1,校验优惠码
|
|
@@ -1937,24 +1932,7 @@ public class TOrderController {
|
|
|
//不存在
|
|
|
return JsonMessage.success("1");
|
|
|
}
|
|
|
-// IPage<TPromoCode> pagePromoCode = R.getDataIfSuccess(szwlFeign.getTPromoCode(code));
|
|
|
-// List<TPromoCode> codeList = pagePromoCode.getRecords();
|
|
|
//
|
|
|
-// if (codeList.size() == 0) {
|
|
|
-// //不存在
|
|
|
-// return JsonMessage.success("1");
|
|
|
-// }
|
|
|
-// for (TPromoCode cod : codeList) {
|
|
|
-// if(!cod.getAdminId().equals("1")){
|
|
|
-// String adminId = cod.getAdminId();
|
|
|
-// String adminId1 = String.valueOf(equipment.getAdminId());
|
|
|
-// if (adminId.equals(adminId1)) {
|
|
|
-// promoCode = cod;
|
|
|
-// }
|
|
|
-// }else{
|
|
|
-// promoCode = cod;
|
|
|
-// }
|
|
|
-// }
|
|
|
Date lastUseDate = null;
|
|
|
if (promoCode != null) {
|
|
|
lastUseDate = promoCode.getLastUseDate();
|
|
@@ -2319,7 +2297,8 @@ public class TOrderController {
|
|
|
order.setModifyDate(new Date());
|
|
|
order.setAdminId(admin.getId());
|
|
|
order.setSn(sn1);
|
|
|
- order.setProductDesc(String.valueOf(productNameMap));
|
|
|
+// order.setProductDesc(String.valueOf(productNameMap));
|
|
|
+ order.setProductDesc(JSONArray.toJSONString(productNameMap));
|
|
|
// order.setProductId(product.getId());
|
|
|
// order.setProductNo(product.getNo());
|
|
|
order.setProductName(productName.toString());
|
|
@@ -2491,12 +2470,16 @@ public class TOrderController {
|
|
|
TEquipment byClientId = R.getDataIfSuccess(szwlFeign.findEquipmentByClientId(order.getClientId()));
|
|
|
// String gtClientId = byClientId.getGtClientId();
|
|
|
if(order.getFrpCode().equals("WEIXIN_XCX")){
|
|
|
+ equipmentService.sentMessage(byClientId.getClientId(), PushUtils.buildJson("cardPayXCX", order.getProductDesc()).toString());
|
|
|
TSzsmWx szsmWx = szsmWxService.getById(order.getWxId());
|
|
|
BigDecimal integral = szsmWx.getIntegral();
|
|
|
- integral = order.getPrice().add(integral);
|
|
|
+ if(integral!=null){
|
|
|
+ integral = order.getPrice().add(integral);
|
|
|
+ }else {
|
|
|
+ integral = order.getPrice();
|
|
|
+ }
|
|
|
+ szsmWx.setIntegral(integral);
|
|
|
szsmWxService.updateById(szsmWx);
|
|
|
- equipmentService.sentMessage(byClientId.getClientId(), PushUtils.buildJson("cardPayXCX", order.getProportionDesc()).toString());
|
|
|
-
|
|
|
}else {
|
|
|
equipmentService.sentMessage(byClientId.getClientId(), PushUtils.buildJson("pay_success", kindData.toString()).toString());
|
|
|
}
|