| @@ -7,7 +7,9 @@ import org.springframework.beans.factory.annotation.Value; | |||
| import org.springframework.boot.SpringApplication; | |||
| import org.springframework.boot.autoconfigure.SpringBootApplication; | |||
| import org.springframework.context.annotation.Bean; | |||
| import org.springframework.context.annotation.EnableAspectJAutoProxy; | |||
| import org.springframework.scheduling.annotation.EnableAsync; | |||
| import springfox.documentation.swagger2.annotations.EnableSwagger2; | |||
| /** | |||
| @@ -20,6 +22,7 @@ import springfox.documentation.swagger2.annotations.EnableSwagger2; | |||
| @EnableEncryptableProperties | |||
| @EnableAsync | |||
| @EnableRocketMQ | |||
| @EnableAspectJAutoProxy(exposeProxy = true) | |||
| public class UserApplication { | |||
| @Value("${fm.exception}") | |||
| @@ -10,6 +10,7 @@ import com.iformall.domain.po.WxMerchant; | |||
| import com.iformall.enums.EnumPayWay; | |||
| import com.iformall.exception.MallinkException; | |||
| import com.iformall.mapper.WxCouponChannelMapper; | |||
| import com.iformall.mapper.WxCouponMapper; | |||
| import com.iformall.mapper.WxMerchantMapper; | |||
| import com.iformall.service.QrCodeService; | |||
| import com.iformall.utils.Constant; | |||
| @@ -41,6 +42,9 @@ public class WxAppinfoController extends BaseController { | |||
| @Autowired | |||
| private WxCouponChannelMapper wxCouponChannelMapper; | |||
| @Autowired | |||
| WxCouponMapper wxCouponMapper; | |||
| ExecutorService fixedThreadPool = Executors.newFixedThreadPool(150); | |||
| @@ -135,8 +139,5 @@ public class WxAppinfoController extends BaseController { | |||
| } | |||
| } | |||
| } | |||
| @@ -62,7 +62,7 @@ public class WxCouponController extends BaseController { | |||
| @ApiImplicitParam(name = "pageNum", value = "页数", dataType = "int", paramType = "query", required = true), | |||
| @ApiImplicitParam(name = "pageSize", value = "每页条数", dataType = "int", paramType = "query", required = true)}) | |||
| @SystemControllerLog(description = "券投放-列表") | |||
| public ResultData list(@ModelAttribute WxCoupon wxCoupon, Integer pageNum, Integer pageSize,Integer dataType) { | |||
| public ResultData list(@ModelAttribute WxCoupon wxCoupon, Integer pageNum, Integer pageSize,Integer dataType,Boolean isList) { | |||
| logger.debug("[" + getIpAddr() + "] WxCouponController::list"); | |||
| if (wxCoupon == null) wxCoupon = new WxCoupon(); | |||
| if(null != dataType && dataType == 1){ | |||
| @@ -87,7 +87,16 @@ public class WxCouponController extends BaseController { | |||
| EnumCouponType.COUPON_MULTIMCH.getCode()}; | |||
| wxCoupon.setTypes(Arrays.asList(typeArray)); | |||
| } | |||
| if(!(isList == null?false:isList) && wxCoupon.getSendType() == null){ | |||
| Integer[] sendTypeArray = { | |||
| EnumCouponSendType.ACTIVE.getCode(), | |||
| EnumCouponSendType.PASSIVE.getCode(),}; | |||
| wxCoupon.setSendTypes(Arrays.asList(sendTypeArray)); | |||
| } | |||
| return wxCouponService.list(wxCoupon,wxCoupon, pageNum, pageSize); //全列表 | |||
| } | |||
| @@ -112,6 +121,13 @@ public class WxCouponController extends BaseController { | |||
| EnumCouponType.COUPON_PREORDER.getCode()}; | |||
| wxCoupon.setTypes(Arrays.asList(typeArray)); | |||
| Integer[] sendTypeArray = { | |||
| EnumCouponSendType.ACTIVE.getCode(), | |||
| EnumCouponSendType.PASSIVE.getCode(),}; | |||
| wxCoupon.setSendTypes(Arrays.asList(sendTypeArray)); | |||
| if(StringUtils.isNotBlank(wxCoupon.getSortColumn())){ | |||
| String coryColumn = "c."+wxCoupon.getSortColumns(); | |||
| wxCoupon.setSortColumns(coryColumn); | |||
| @@ -113,10 +113,10 @@ public class WxCouponOrderController extends BaseController { | |||
| wxRefundOrderService.createRefundOrder(appinfo, couponOrderId, EnumPayType.PAY_ADMIN_REFUND, null); | |||
| return new ResultData(); | |||
| } catch (MallinkException e) { | |||
| logger.error(e.getMessage()); | |||
| logger.error(e.getMessage(),e); | |||
| return new ResultData(e.getErrorCode(), e.getMessage()); | |||
| } catch (Exception e) { | |||
| logger.error(e.getMessage()); | |||
| logger.error(e.getMessage(),e); | |||
| return new ResultData(ErrorCode.REFUND_ORDER_ERROR); | |||
| } | |||
| } | |||
| @@ -15,16 +15,15 @@ import com.iformall.domain.po.WxOrder; | |||
| import com.iformall.domain.po.base.BaseEntity; | |||
| import com.iformall.domain.vo.WxMerchantSubsidyVo; | |||
| import com.iformall.domain.vo.WxOrderQueryVo; | |||
| import com.iformall.enums.EnumCouponChannelStatus; | |||
| import com.iformall.enums.EnumCouponChannelType; | |||
| import com.iformall.enums.EnumPayWay; | |||
| import com.iformall.enums.EnumUserType; | |||
| import com.iformall.enums.*; | |||
| import com.iformall.exception.MallinkException; | |||
| import com.iformall.service.WxCUserBasicInfoService; | |||
| import com.iformall.service.WxCUserService; | |||
| import com.iformall.service.WxCouponChannelService; | |||
| import com.iformall.service.WxCouponService; | |||
| import com.iformall.service.WxOrderService; | |||
| import com.iformall.service.order.OrderFactory; | |||
| import io.swagger.annotations.Api; | |||
| import io.swagger.annotations.ApiImplicitParam; | |||
| import io.swagger.annotations.ApiImplicitParams; | |||
| @@ -62,7 +61,7 @@ public class WxOrderController extends BaseController { | |||
| @Autowired | |||
| private WxCUserBasicInfoService wxCUserBasicInfoService; | |||
| @ApiOperation("分页列表接口") | |||
| @GetMapping("list") | |||
| @ApiImplicitParams({ | |||
| @@ -184,17 +183,19 @@ public class WxOrderController extends BaseController { | |||
| if (coupon == null) { | |||
| return new ResultData(ErrorCode.COUPON_IS_EMPTY); | |||
| } | |||
| if (!wxOrderService.checkCouponIsFree(coupon)) { | |||
| if (!wxOrderService.checkCouponIsFree(coupon,null)) { | |||
| return new ResultData(ErrorCode.COUPON_IS_NOT_FREE); | |||
| } | |||
| // 免费券 | |||
| order = wxOrderService.saveFreeOrderForCoupon(user, coupon, orderSaveDto.getCouponChannelId(), orderSaveDto.getFormId(), null,EnumPayWay.PAY_WAY_NOT_UNPAY_CREDIT); | |||
| order = wxOrderService.saveFreeOrderForCoupon(false,null,user, coupon, 1, | |||
| orderSaveDto.getCouponChannelId(), orderSaveDto.getFormId(), null,EnumPayWay.PAY_WAY_NOT_UNPAY_CREDIT, | |||
| EnumOrderShopingType.ONLINE_PURCHASE.getCode(),null); | |||
| return new ResultData(order); | |||
| } catch (MallinkException e) { | |||
| logger.error(e.getMessage()); | |||
| return new ResultData(e.getErrorCode(), e.getMessage()); | |||
| } catch (Exception e) { | |||
| logger.error(e.getMessage()); | |||
| logger.error(e.getMessage(),e); | |||
| return new ResultData(ErrorCode.ORDER_IS_FAIL, e.getMessage()); | |||
| } | |||
| } | |||
| @@ -0,0 +1,111 @@ | |||
| package com.iformall.controller.mem; | |||
| import com.github.pagehelper.PageInfo; | |||
| import com.iformall.annotation.SystemControllerLog; | |||
| import com.iformall.common.ErrorCode; | |||
| import com.iformall.common.Result; | |||
| import com.iformall.common.ResultData; | |||
| import com.iformall.controller.base.BaseController; | |||
| import com.iformall.domain.po.*; | |||
| import com.iformall.service.*; | |||
| import io.swagger.annotations.Api; | |||
| import io.swagger.annotations.ApiImplicitParam; | |||
| import io.swagger.annotations.ApiImplicitParams; | |||
| import io.swagger.annotations.ApiOperation; | |||
| import org.slf4j.Logger; | |||
| import org.slf4j.LoggerFactory; | |||
| import org.springframework.beans.factory.annotation.Autowired; | |||
| import org.springframework.web.bind.annotation.*; | |||
| @RestController | |||
| @RequestMapping("userBasicInfoAddress") | |||
| @Api(description = "会员地址相关接口") | |||
| public class UserBasicInfoAddressController extends BaseController { | |||
| private final Logger logger = LoggerFactory.getLogger(this.getClass()); | |||
| @Autowired | |||
| private UserBasicInfoAddressService userBasicInfoAddressService; | |||
| @ApiOperation("分页列表接口") | |||
| @GetMapping("list") | |||
| @ApiImplicitParams({ | |||
| @ApiImplicitParam(name = "pageNum", value = "页数", dataType = "int", paramType = "query", required = true), | |||
| @ApiImplicitParam(name = "pageSize", value = "每页条数", dataType = "int", paramType = "query", required = true)}) | |||
| @SystemControllerLog(description = "会员地址-列表") | |||
| public ResultData list(@ModelAttribute UserBasicInfoAddress userBasicInfoAddress, Integer pageNum, Integer pageSize) { | |||
| logger.debug("[" + getIpAddr() + "] UserBasicInfoAddressController::list"); | |||
| if (null == userBasicInfoAddress) { | |||
| userBasicInfoAddress = new UserBasicInfoAddress(); | |||
| } | |||
| if(userBasicInfoAddress.getUserId() == null){ | |||
| return new ResultData(ErrorCode.SYS_PARAMETER_NOT_NULL.getCode(), "用户ID为空"); | |||
| } | |||
| userBasicInfoAddress.undateFinalTenantId(ifParentUpdateTenantInfo()); | |||
| PageInfo<UserBasicInfoAddress> page = userBasicInfoAddressService.listAsPage(userBasicInfoAddress, pageNum, pageSize); | |||
| return new ResultData(page); | |||
| } | |||
| @PostMapping("saveOrUpdate") | |||
| @SystemControllerLog(description = "会员地址-保存更新") | |||
| public ResultData saveOrUpdate(@RequestBody UserBasicInfoAddress userBasicInfoAddress) { | |||
| logger.debug("[" + getIpAddr() + "] userBasicInfoAddress::saveOrUpdate"); | |||
| if(userBasicInfoAddress == null){ | |||
| return new ResultData(ErrorCode.SYS_PARAMETER_NOT_NULL); | |||
| } | |||
| if(userBasicInfoAddress.getUserId() == null){ | |||
| return new ResultData(ErrorCode.SYS_PARAMETER_ERROR); | |||
| } | |||
| userBasicInfoAddress.undateFinalTenantId(ifParentUpdateTenantInfo()); | |||
| userBasicInfoAddressService.saveOrUpdate(userBasicInfoAddress); | |||
| return new ResultData(); | |||
| } | |||
| @PostMapping("setUpDefault") | |||
| @SystemControllerLog(description = "会员地址-默认") | |||
| public ResultData setUpDefault(@RequestBody UserBasicInfoAddress userBasicInfoAddress) { | |||
| logger.debug("[" + getIpAddr() + "] userBasicInfoAddress::setUpDefault"); | |||
| if(userBasicInfoAddress == null){ | |||
| return new ResultData(ErrorCode.SYS_PARAMETER_NOT_NULL); | |||
| } | |||
| if(userBasicInfoAddress.getId() == null || userBasicInfoAddress.getUserId() == null){ | |||
| return new ResultData(ErrorCode.SYS_PARAMETER_NOT_NULL.getCode(), "用户ID或者Id为空"); | |||
| } | |||
| userBasicInfoAddress.undateFinalTenantId(ifParentUpdateTenantInfo()); | |||
| userBasicInfoAddressService.updateDefault(userBasicInfoAddress); | |||
| return new ResultData(); | |||
| } | |||
| @ApiOperation("消息模板-删除") | |||
| @GetMapping("/del") | |||
| @ApiImplicitParam(name = "id", value = "id", dataType = "String", paramType = "query", required = true) | |||
| @SystemControllerLog(description = "消息验证模板-删除") | |||
| public ResultData delete(Long id) { | |||
| logger.debug("[" + getIpAddr() + "] userBasicInfoAddress::delete"); | |||
| if(id == null){ | |||
| return new ResultData(ErrorCode.SYS_PARAMETER_NOT_NULL.getCode(), "Id为空"); | |||
| } | |||
| UserBasicInfoAddress userBasicInfoAddress = new UserBasicInfoAddress(); | |||
| userBasicInfoAddress.setId(id); | |||
| userBasicInfoAddress.undateFinalTenantId(ifParentUpdateTenantInfo()); | |||
| userBasicInfoAddressService.deleteById(userBasicInfoAddress); | |||
| return new ResultData(Result.SUCCESS, "删除成功", null); | |||
| } | |||
| @ApiOperation("消息模板-查询") | |||
| @GetMapping("/findById") | |||
| @ApiImplicitParam(name = "id", value = "id", dataType = "String", paramType = "query", required = true) | |||
| @SystemControllerLog(description = "消息验证模板-查询") | |||
| public ResultData findById(Long id) { | |||
| logger.debug("[" + getIpAddr() + "] userBasicInfoAddress::findById"); | |||
| if(id == null){ | |||
| return new ResultData(ErrorCode.SYS_PARAMETER_NOT_NULL.getCode(), "Id为空"); | |||
| } | |||
| UserBasicInfoAddress userBasicInfoAddress = new UserBasicInfoAddress(); | |||
| userBasicInfoAddress.setId(id); | |||
| userBasicInfoAddress.undateFinalTenantId(ifParentUpdateTenantInfo()); | |||
| userBasicInfoAddressService.findById(userBasicInfoAddress); | |||
| return new ResultData(Result.SUCCESS, "查询成功", null); | |||
| } | |||
| } | |||
| @@ -40,6 +40,7 @@ public class TenantInfoImpl implements TenantInfo { | |||
| "wx_score_rules", | |||
| "wx_level_config", | |||
| "wx_c_user_basic_info", | |||
| "user_basic_info_address", | |||
| "wx_c_user_basic_child", | |||
| "wx_c_user_basic_sign", | |||
| "wx_credit_history", | |||
| @@ -79,6 +80,7 @@ public class TenantInfoImpl implements TenantInfo { | |||
| "wx_weapp_code_status", | |||
| "wx_weapp_release_status", | |||
| "wx_c_user_basic_info", | |||
| "user_basic_info_address", | |||
| "wx_c_user_basic_child", | |||
| "wx_c_user_basic_sign", | |||
| "mem_coupon_from_dsp", | |||
| @@ -0,0 +1,124 @@ | |||
| CREATE TABLE `user_basic_info_address` ( | |||
| `id` bigint(20) NOT NULL COMMENT '主键ID', | |||
| `tenant_id` varchar(250) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL COMMENT '租户ID', | |||
| `parent_tenant_id` varchar(5) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL COMMENT '父租户ID', | |||
| `final_tenant_id` varchar(5) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL COMMENT '归属租户ID', | |||
| `user_id` bigint(20) DEFAULT NULL, | |||
| `consignee` varchar(100) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL COMMENT '收货人', | |||
| `country` varchar(20) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL COMMENT '国家', | |||
| `province` varchar(20) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL COMMENT '省', | |||
| `city` varchar(20) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL COMMENT '市', | |||
| `district` varchar(20) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL COMMENT '区', | |||
| `region` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL COMMENT '所属地区', | |||
| `address` varchar(500) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL COMMENT '详细地址', | |||
| `zipcode` varchar(20) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL COMMENT '邮政编码', | |||
| `mobile` varchar(20) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL COMMENT '手机号', | |||
| `is_default` tinyint(1) DEFAULT 0 COMMENT '是否默认,0否,1是。', | |||
| `mark` varchar(20) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL COMMENT '标识', | |||
| `is_del` tinyint(1) DEFAULT 0 COMMENT '0否,1是。', | |||
| `create_date` datetime(0) DEFAULT CURRENT_TIMESTAMP COMMENT '创建时间', | |||
| `update_date` datetime(0) DEFAULT CURRENT_TIMESTAMP COMMENT '更新时间', | |||
| PRIMARY KEY (`id`) USING BTREE, | |||
| UNIQUE INDEX `id_UNIQUE`(`id`) USING BTREE | |||
| ) ENGINE = InnoDB CHARACTER SET = utf8mb4 COLLATE = utf8mb4_unicode_ci COMMENT = '用户收获地址表' ROW_FORMAT = Dynamic; | |||
| CREATE TABLE user_basic_info_address_0 LIKE user_basic_info_address; | |||
| CREATE TABLE user_basic_info_address_1 LIKE user_basic_info_address; | |||
| CREATE TABLE user_basic_info_address_2 LIKE user_basic_info_address; | |||
| CREATE TABLE user_basic_info_address_3 LIKE user_basic_info_address; | |||
| CREATE TABLE user_basic_info_address_4 LIKE user_basic_info_address; | |||
| CREATE TABLE user_basic_info_address_5 LIKE user_basic_info_address; | |||
| CREATE TABLE user_basic_info_address_6 LIKE user_basic_info_address; | |||
| CREATE TABLE user_basic_info_address_7 LIKE user_basic_info_address; | |||
| CREATE TABLE user_basic_info_address_8 LIKE user_basic_info_address; | |||
| CREATE TABLE user_basic_info_address_9 LIKE user_basic_info_address; | |||
| CREATE TABLE user_basic_info_address_10 LIKE user_basic_info_address; | |||
| CREATE TABLE user_basic_info_address_11 LIKE user_basic_info_address; | |||
| CREATE TABLE user_basic_info_address_12 LIKE user_basic_info_address; | |||
| CREATE TABLE user_basic_info_address_13 LIKE user_basic_info_address; | |||
| CREATE TABLE user_basic_info_address_14 LIKE user_basic_info_address; | |||
| CREATE TABLE user_basic_info_address_15 LIKE user_basic_info_address; | |||
| CREATE TABLE user_basic_info_address_16 LIKE user_basic_info_address; | |||
| CREATE TABLE user_basic_info_address_17 LIKE user_basic_info_address; | |||
| CREATE TABLE user_basic_info_address_18 LIKE user_basic_info_address; | |||
| CREATE TABLE user_basic_info_address_19 LIKE user_basic_info_address; | |||
| CREATE TABLE user_basic_info_address_20 LIKE user_basic_info_address; | |||
| CREATE TABLE user_basic_info_address_21 LIKE user_basic_info_address; | |||
| CREATE TABLE user_basic_info_address_22 LIKE user_basic_info_address; | |||
| CREATE TABLE user_basic_info_address_23 LIKE user_basic_info_address; | |||
| CREATE TABLE user_basic_info_address_24 LIKE user_basic_info_address; | |||
| CREATE TABLE user_basic_info_address_25 LIKE user_basic_info_address; | |||
| CREATE TABLE user_basic_info_address_26 LIKE user_basic_info_address; | |||
| CREATE TABLE user_basic_info_address_27 LIKE user_basic_info_address; | |||
| CREATE TABLE user_basic_info_address_28 LIKE user_basic_info_address; | |||
| CREATE TABLE user_basic_info_address_29 LIKE user_basic_info_address; | |||
| CREATE TABLE user_basic_info_address_30 LIKE user_basic_info_address; | |||
| CREATE TABLE user_basic_info_address_31 LIKE user_basic_info_address; | |||
| CREATE TABLE user_basic_info_address_32 LIKE user_basic_info_address; | |||
| CREATE TABLE user_basic_info_address_33 LIKE user_basic_info_address; | |||
| CREATE TABLE user_basic_info_address_34 LIKE user_basic_info_address; | |||
| CREATE TABLE user_basic_info_address_35 LIKE user_basic_info_address; | |||
| CREATE TABLE user_basic_info_address_36 LIKE user_basic_info_address; | |||
| CREATE TABLE user_basic_info_address_37 LIKE user_basic_info_address; | |||
| CREATE TABLE user_basic_info_address_38 LIKE user_basic_info_address; | |||
| CREATE TABLE user_basic_info_address_39 LIKE user_basic_info_address; | |||
| CREATE TABLE user_basic_info_address_40 LIKE user_basic_info_address; | |||
| CREATE TABLE user_basic_info_address_41 LIKE user_basic_info_address; | |||
| CREATE TABLE user_basic_info_address_42 LIKE user_basic_info_address; | |||
| CREATE TABLE user_basic_info_address_43 LIKE user_basic_info_address; | |||
| CREATE TABLE user_basic_info_address_44 LIKE user_basic_info_address; | |||
| CREATE TABLE user_basic_info_address_45 LIKE user_basic_info_address; | |||
| CREATE TABLE user_basic_info_address_46 LIKE user_basic_info_address; | |||
| CREATE TABLE user_basic_info_address_47 LIKE user_basic_info_address; | |||
| CREATE TABLE user_basic_info_address_48 LIKE user_basic_info_address; | |||
| CREATE TABLE user_basic_info_address_49 LIKE user_basic_info_address; | |||
| CREATE TABLE user_basic_info_address_50 LIKE user_basic_info_address; | |||
| CREATE TABLE user_basic_info_address_51 LIKE user_basic_info_address; | |||
| CREATE TABLE user_basic_info_address_52 LIKE user_basic_info_address; | |||
| CREATE TABLE user_basic_info_address_53 LIKE user_basic_info_address; | |||
| CREATE TABLE user_basic_info_address_54 LIKE user_basic_info_address; | |||
| CREATE TABLE user_basic_info_address_55 LIKE user_basic_info_address; | |||
| CREATE TABLE user_basic_info_address_56 LIKE user_basic_info_address; | |||
| CREATE TABLE user_basic_info_address_57 LIKE user_basic_info_address; | |||
| CREATE TABLE user_basic_info_address_58 LIKE user_basic_info_address; | |||
| CREATE TABLE user_basic_info_address_59 LIKE user_basic_info_address; | |||
| CREATE TABLE user_basic_info_address_60 LIKE user_basic_info_address; | |||
| CREATE TABLE user_basic_info_address_61 LIKE user_basic_info_address; | |||
| CREATE TABLE user_basic_info_address_62 LIKE user_basic_info_address; | |||
| CREATE TABLE user_basic_info_address_63 LIKE user_basic_info_address; | |||
| CREATE TABLE user_basic_info_address_64 LIKE user_basic_info_address; | |||
| CREATE TABLE user_basic_info_address_65 LIKE user_basic_info_address; | |||
| CREATE TABLE user_basic_info_address_66 LIKE user_basic_info_address; | |||
| CREATE TABLE user_basic_info_address_67 LIKE user_basic_info_address; | |||
| CREATE TABLE user_basic_info_address_68 LIKE user_basic_info_address; | |||
| CREATE TABLE user_basic_info_address_69 LIKE user_basic_info_address; | |||
| CREATE TABLE user_basic_info_address_70 LIKE user_basic_info_address; | |||
| CREATE TABLE user_basic_info_address_71 LIKE user_basic_info_address; | |||
| CREATE TABLE user_basic_info_address_72 LIKE user_basic_info_address; | |||
| CREATE TABLE user_basic_info_address_73 LIKE user_basic_info_address; | |||
| CREATE TABLE user_basic_info_address_74 LIKE user_basic_info_address; | |||
| CREATE TABLE user_basic_info_address_75 LIKE user_basic_info_address; | |||
| CREATE TABLE user_basic_info_address_76 LIKE user_basic_info_address; | |||
| CREATE TABLE user_basic_info_address_77 LIKE user_basic_info_address; | |||
| CREATE TABLE user_basic_info_address_78 LIKE user_basic_info_address; | |||
| CREATE TABLE user_basic_info_address_79 LIKE user_basic_info_address; | |||
| CREATE TABLE user_basic_info_address_80 LIKE user_basic_info_address; | |||
| CREATE TABLE user_basic_info_address_81 LIKE user_basic_info_address; | |||
| CREATE TABLE user_basic_info_address_82 LIKE user_basic_info_address; | |||
| CREATE TABLE user_basic_info_address_83 LIKE user_basic_info_address; | |||
| CREATE TABLE user_basic_info_address_84 LIKE user_basic_info_address; | |||
| CREATE TABLE user_basic_info_address_85 LIKE user_basic_info_address; | |||
| CREATE TABLE user_basic_info_address_86 LIKE user_basic_info_address; | |||
| CREATE TABLE user_basic_info_address_87 LIKE user_basic_info_address; | |||
| CREATE TABLE user_basic_info_address_88 LIKE user_basic_info_address; | |||
| CREATE TABLE user_basic_info_address_89 LIKE user_basic_info_address; | |||
| CREATE TABLE user_basic_info_address_90 LIKE user_basic_info_address; | |||
| CREATE TABLE user_basic_info_address_91 LIKE user_basic_info_address; | |||
| CREATE TABLE user_basic_info_address_92 LIKE user_basic_info_address; | |||
| CREATE TABLE user_basic_info_address_93 LIKE user_basic_info_address; | |||
| CREATE TABLE user_basic_info_address_94 LIKE user_basic_info_address; | |||
| CREATE TABLE user_basic_info_address_95 LIKE user_basic_info_address; | |||
| CREATE TABLE user_basic_info_address_96 LIKE user_basic_info_address; | |||
| CREATE TABLE user_basic_info_address_97 LIKE user_basic_info_address; | |||
| CREATE TABLE user_basic_info_address_98 LIKE user_basic_info_address; | |||
| CREATE TABLE user_basic_info_address_99 LIKE user_basic_info_address; | |||
| @@ -0,0 +1,15 @@ | |||
| --加可配送商品 | |||
| INSERT INTO `mallink`.`mall_permission`(`id`, `name`, `parent_id`, `available`, `permission`, `resource_type`, `module_color`, `module_color_num`, `url`, `icon`, `version_type`, `sort`) VALUES (665, '可配送商品', 604, 'Y', NULL, 1, NULL, NULL, 'distributableCoupon', null, 0, 665); | |||
| INSERT INTO `mallink`.`mall_permission`(`id`, `name`, `parent_id`, `available`, `permission`, `resource_type`, `module_color`, `module_color_num`, `url`, `icon`, `version_type`, `sort`) VALUES (666, '券礼包', 604, 'Y', NULL, 1, NULL, NULL, 'couponGiftList', null, 0, 666); | |||
| --加商品订单 | |||
| INSERT INTO `mallink`.`mall_permission`(`id`, `name`, `parent_id`, `available`, `permission`, `resource_type`, `module_color`, `module_color_num`, `url`, `icon`, `version_type`, `sort`) VALUES (714, '商品订单', 610, 'Y', NULL, 1, NULL, NULL, 'distributableOrder', NULL, 0, 714); | |||
| --UPDATE `mallink`.`mall_sale_type` SET `menus` = '[1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 50, 101, 102, 103, 104, 105, 106, 107, 108, 109, 201, 202, 203, 204, 205, 206, 209, 211, 212, 221, 222, 251, 299, 300, 301, 302, 303, 304, 305, 306, 307, 308, 401, 402, 403, 404, 405, 406, 407, 408, 409, 410, 411, 412, 413, 414, 415, 416, 417, 418, 420, 421, 422, 501, 502, 503, 504, 505, 506, 507, 508, 509, 511, 512, 513, 514, 521, 522, 523, 531, 532, 533, 591, 592, 595, 601, 602, 603, 604, 605, 606, 607, 608, 609, 610, 611, 612, 613, 614, 621, 622, 623, 624, 625, 626, 627, 641, 642, 643, 644, 645, 646, 651, 661, 662, 663, 664, 665, 666, 671, 672, 673, 674, 675, 681, 682, 683, 684, 685, 686, 691, 692, 693, 694, 695, 701, 702, 703, 704, 711, 712, 713, 714, 901, 902, 903, 904, 905, 931, 932, 951, 952, 961, 962, 963, 965, 966, 967, 968, 1001, 1002, 1003, 1004, 60701, 60702]' WHERE `id` = 1; | |||
| UPDATE `mallink`.`mall_sale_type` SET `menus` = '[1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 50, 101, 102, 103, 104, 105, 106, 107, 108, 109, 201, 202, 203, 204, 205, 206, 209, 211, 212, 221, 222, 251, 299, 300, 301, 302, 303, 304, 305, 306, 401, 402, 403, 404, 405, 406, 407, 408, 409, 410, 411, 412, 413, 414, 415, 416, 417, 418, 420, 421, 422, 501, 502, 503, 504, 505, 506, 507, 508, 509, 511, 512, 513, 514, 521, 522, 523, 531, 532, 533, 591, 592, 595, 601, 602, 603, 604, 605, 606, 607, 608, 609, 610, 611, 612, 613, 614, 621, 622, 623, 624, 625, 626, 627, 641, 642, 643, 644, 645, 646, 651, 661, 662, 663, 664, 665, 666, 671, 672, 673, 674, 675, 681, 682, 683, 684, 685, 686, 691, 692, 693, 694, 695, 701, 702, 703, 704, 711, 712, 713, 714, 901, 902, 903, 904, 905, 931, 932, 951, 952, 961, 962, 963, 965, 966, 967, 968, 1001, 1002, 1003, 1004, 60701, 60702]' WHERE `id` = 1; | |||
| [1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 50, 101, 102, 103, 104, 105, 106, 107, 108, 109, 201, 202, 203, 204, 205, 206, 209, 211, 212, 221, 222, 251, 299, 300, 307, 308, 401, 402, 403, 404, 405, 406, 407, 408, 409, 410, 411, 412, 413, 414, 415, 416, 417, 418, 420, 421, 422, 501, 502, 503, 504, 505, 506, 507, 508, 509, 511, 512, 513, 514, 521, 522, 523, 531, 532, 533, 591, 592, 595, 601, 602, 603, 604, 605, 606, 607, 608, 609, 610, 611, 612, 613, 614, 621, 622, 623, 624, 625, 626, 627, 641, 642, 643, 644, 645, 646, 651, 661, 662, 663, 664, 665, 666, 671, 672, 673, 674, 675, 681, 682, 683, 684, 685, 686, 691, 692, 693, 694, 695, 701, 702, 703, 704, 711, 712, 713, 714, 901, 902, 903, 904, 905, 931, 932, 951, 952, 961, 962, 963, 965, 966, 967, 968, 1001, 1002, 1003, 1004, 60701, 60702] | |||
| @@ -0,0 +1,200 @@ | |||
| ALTER TABLE `mallink`.`wx_coupon_order_0` | |||
| ADD COLUMN `shipping_status` tinyint(2) NOT NULL DEFAULT 0 COMMENT '配送状态 0:默认(无) 1*:自提 2*:配送' AFTER `shipping_type`; | |||
| ALTER TABLE `mallink`.`wx_coupon_order_1` | |||
| ADD COLUMN `shipping_status` tinyint(2) NOT NULL DEFAULT 0 COMMENT '配送状态 0:默认(无) 1*:自提 2*:配送' AFTER `shipping_type`; | |||
| ALTER TABLE `mallink`.`wx_coupon_order_2` | |||
| ADD COLUMN `shipping_status` tinyint(2) NOT NULL DEFAULT 0 COMMENT '配送状态 0:默认(无) 1*:自提 2*:配送' AFTER `shipping_type`; | |||
| ALTER TABLE `mallink`.`wx_coupon_order_3` | |||
| ADD COLUMN `shipping_status` tinyint(2) NOT NULL DEFAULT 0 COMMENT '配送状态 0:默认(无) 1*:自提 2*:配送' AFTER `shipping_type`; | |||
| ALTER TABLE `mallink`.`wx_coupon_order_4` | |||
| ADD COLUMN `shipping_status` tinyint(2) NOT NULL DEFAULT 0 COMMENT '配送状态 0:默认(无) 1*:自提 2*:配送' AFTER `shipping_type`; | |||
| ALTER TABLE `mallink`.`wx_coupon_order_5` | |||
| ADD COLUMN `shipping_status` tinyint(2) NOT NULL DEFAULT 0 COMMENT '配送状态 0:默认(无) 1*:自提 2*:配送' AFTER `shipping_type`; | |||
| ALTER TABLE `mallink`.`wx_coupon_order_6` | |||
| ADD COLUMN `shipping_status` tinyint(2) NOT NULL DEFAULT 0 COMMENT '配送状态 0:默认(无) 1*:自提 2*:配送' AFTER `shipping_type`; | |||
| ALTER TABLE `mallink`.`wx_coupon_order_7` | |||
| ADD COLUMN `shipping_status` tinyint(2) NOT NULL DEFAULT 0 COMMENT '配送状态 0:默认(无) 1*:自提 2*:配送' AFTER `shipping_type`; | |||
| ALTER TABLE `mallink`.`wx_coupon_order_8` | |||
| ADD COLUMN `shipping_status` tinyint(2) NOT NULL DEFAULT 0 COMMENT '配送状态 0:默认(无) 1*:自提 2*:配送' AFTER `shipping_type`; | |||
| ALTER TABLE `mallink`.`wx_coupon_order_9` | |||
| ADD COLUMN `shipping_status` tinyint(2) NOT NULL DEFAULT 0 COMMENT '配送状态 0:默认(无) 1*:自提 2*:配送' AFTER `shipping_type`; | |||
| ALTER TABLE `mallink`.`wx_coupon_order_10` | |||
| ADD COLUMN `shipping_status` tinyint(2) NOT NULL DEFAULT 0 COMMENT '配送状态 0:默认(无) 1*:自提 2*:配送' AFTER `shipping_type`; | |||
| ALTER TABLE `mallink`.`wx_coupon_order_11` | |||
| ADD COLUMN `shipping_status` tinyint(2) NOT NULL DEFAULT 0 COMMENT '配送状态 0:默认(无) 1*:自提 2*:配送' AFTER `shipping_type`; | |||
| ALTER TABLE `mallink`.`wx_coupon_order_12` | |||
| ADD COLUMN `shipping_status` tinyint(2) NOT NULL DEFAULT 0 COMMENT '配送状态 0:默认(无) 1*:自提 2*:配送' AFTER `shipping_type`; | |||
| ALTER TABLE `mallink`.`wx_coupon_order_13` | |||
| ADD COLUMN `shipping_status` tinyint(2) NOT NULL DEFAULT 0 COMMENT '配送状态 0:默认(无) 1*:自提 2*:配送' AFTER `shipping_type`; | |||
| ALTER TABLE `mallink`.`wx_coupon_order_14` | |||
| ADD COLUMN `shipping_status` tinyint(2) NOT NULL DEFAULT 0 COMMENT '配送状态 0:默认(无) 1*:自提 2*:配送' AFTER `shipping_type`; | |||
| ALTER TABLE `mallink`.`wx_coupon_order_15` | |||
| ADD COLUMN `shipping_status` tinyint(2) NOT NULL DEFAULT 0 COMMENT '配送状态 0:默认(无) 1*:自提 2*:配送' AFTER `shipping_type`; | |||
| ALTER TABLE `mallink`.`wx_coupon_order_16` | |||
| ADD COLUMN `shipping_status` tinyint(2) NOT NULL DEFAULT 0 COMMENT '配送状态 0:默认(无) 1*:自提 2*:配送' AFTER `shipping_type`; | |||
| ALTER TABLE `mallink`.`wx_coupon_order_17` | |||
| ADD COLUMN `shipping_status` tinyint(2) NOT NULL DEFAULT 0 COMMENT '配送状态 0:默认(无) 1*:自提 2*:配送' AFTER `shipping_type`; | |||
| ALTER TABLE `mallink`.`wx_coupon_order_18` | |||
| ADD COLUMN `shipping_status` tinyint(2) NOT NULL DEFAULT 0 COMMENT '配送状态 0:默认(无) 1*:自提 2*:配送' AFTER `shipping_type`; | |||
| ALTER TABLE `mallink`.`wx_coupon_order_19` | |||
| ADD COLUMN `shipping_status` tinyint(2) NOT NULL DEFAULT 0 COMMENT '配送状态 0:默认(无) 1*:自提 2*:配送' AFTER `shipping_type`; | |||
| ALTER TABLE `mallink`.`wx_coupon_order_20` | |||
| ADD COLUMN `shipping_status` tinyint(2) NOT NULL DEFAULT 0 COMMENT '配送状态 0:默认(无) 1*:自提 2*:配送' AFTER `shipping_type`; | |||
| ALTER TABLE `mallink`.`wx_coupon_order_21` | |||
| ADD COLUMN `shipping_status` tinyint(2) NOT NULL DEFAULT 0 COMMENT '配送状态 0:默认(无) 1*:自提 2*:配送' AFTER `shipping_type`; | |||
| ALTER TABLE `mallink`.`wx_coupon_order_22` | |||
| ADD COLUMN `shipping_status` tinyint(2) NOT NULL DEFAULT 0 COMMENT '配送状态 0:默认(无) 1*:自提 2*:配送' AFTER `shipping_type`; | |||
| ALTER TABLE `mallink`.`wx_coupon_order_23` | |||
| ADD COLUMN `shipping_status` tinyint(2) NOT NULL DEFAULT 0 COMMENT '配送状态 0:默认(无) 1*:自提 2*:配送' AFTER `shipping_type`; | |||
| ALTER TABLE `mallink`.`wx_coupon_order_24` | |||
| ADD COLUMN `shipping_status` tinyint(2) NOT NULL DEFAULT 0 COMMENT '配送状态 0:默认(无) 1*:自提 2*:配送' AFTER `shipping_type`; | |||
| ALTER TABLE `mallink`.`wx_coupon_order_25` | |||
| ADD COLUMN `shipping_status` tinyint(2) NOT NULL DEFAULT 0 COMMENT '配送状态 0:默认(无) 1*:自提 2*:配送' AFTER `shipping_type`; | |||
| ALTER TABLE `mallink`.`wx_coupon_order_26` | |||
| ADD COLUMN `shipping_status` tinyint(2) NOT NULL DEFAULT 0 COMMENT '配送状态 0:默认(无) 1*:自提 2*:配送' AFTER `shipping_type`; | |||
| ALTER TABLE `mallink`.`wx_coupon_order_27` | |||
| ADD COLUMN `shipping_status` tinyint(2) NOT NULL DEFAULT 0 COMMENT '配送状态 0:默认(无) 1*:自提 2*:配送' AFTER `shipping_type`; | |||
| ALTER TABLE `mallink`.`wx_coupon_order_28` | |||
| ADD COLUMN `shipping_status` tinyint(2) NOT NULL DEFAULT 0 COMMENT '配送状态 0:默认(无) 1*:自提 2*:配送' AFTER `shipping_type`; | |||
| ALTER TABLE `mallink`.`wx_coupon_order_29` | |||
| ADD COLUMN `shipping_status` tinyint(2) NOT NULL DEFAULT 0 COMMENT '配送状态 0:默认(无) 1*:自提 2*:配送' AFTER `shipping_type`; | |||
| ALTER TABLE `mallink`.`wx_coupon_order_30` | |||
| ADD COLUMN `shipping_status` tinyint(2) NOT NULL DEFAULT 0 COMMENT '配送状态 0:默认(无) 1*:自提 2*:配送' AFTER `shipping_type`; | |||
| ALTER TABLE `mallink`.`wx_coupon_order_31` | |||
| ADD COLUMN `shipping_status` tinyint(2) NOT NULL DEFAULT 0 COMMENT '配送状态 0:默认(无) 1*:自提 2*:配送' AFTER `shipping_type`; | |||
| ALTER TABLE `mallink`.`wx_coupon_order_32` | |||
| ADD COLUMN `shipping_status` tinyint(2) NOT NULL DEFAULT 0 COMMENT '配送状态 0:默认(无) 1*:自提 2*:配送' AFTER `shipping_type`; | |||
| ALTER TABLE `mallink`.`wx_coupon_order_33` | |||
| ADD COLUMN `shipping_status` tinyint(2) NOT NULL DEFAULT 0 COMMENT '配送状态 0:默认(无) 1*:自提 2*:配送' AFTER `shipping_type`; | |||
| ALTER TABLE `mallink`.`wx_coupon_order_34` | |||
| ADD COLUMN `shipping_status` tinyint(2) NOT NULL DEFAULT 0 COMMENT '配送状态 0:默认(无) 1*:自提 2*:配送' AFTER `shipping_type`; | |||
| ALTER TABLE `mallink`.`wx_coupon_order_35` | |||
| ADD COLUMN `shipping_status` tinyint(2) NOT NULL DEFAULT 0 COMMENT '配送状态 0:默认(无) 1*:自提 2*:配送' AFTER `shipping_type`; | |||
| ALTER TABLE `mallink`.`wx_coupon_order_36` | |||
| ADD COLUMN `shipping_status` tinyint(2) NOT NULL DEFAULT 0 COMMENT '配送状态 0:默认(无) 1*:自提 2*:配送' AFTER `shipping_type`; | |||
| ALTER TABLE `mallink`.`wx_coupon_order_37` | |||
| ADD COLUMN `shipping_status` tinyint(2) NOT NULL DEFAULT 0 COMMENT '配送状态 0:默认(无) 1*:自提 2*:配送' AFTER `shipping_type`; | |||
| ALTER TABLE `mallink`.`wx_coupon_order_38` | |||
| ADD COLUMN `shipping_status` tinyint(2) NOT NULL DEFAULT 0 COMMENT '配送状态 0:默认(无) 1*:自提 2*:配送' AFTER `shipping_type`; | |||
| ALTER TABLE `mallink`.`wx_coupon_order_39` | |||
| ADD COLUMN `shipping_status` tinyint(2) NOT NULL DEFAULT 0 COMMENT '配送状态 0:默认(无) 1*:自提 2*:配送' AFTER `shipping_type`; | |||
| ALTER TABLE `mallink`.`wx_coupon_order_40` | |||
| ADD COLUMN `shipping_status` tinyint(2) NOT NULL DEFAULT 0 COMMENT '配送状态 0:默认(无) 1*:自提 2*:配送' AFTER `shipping_type`; | |||
| ALTER TABLE `mallink`.`wx_coupon_order_41` | |||
| ADD COLUMN `shipping_status` tinyint(2) NOT NULL DEFAULT 0 COMMENT '配送状态 0:默认(无) 1*:自提 2*:配送' AFTER `shipping_type`; | |||
| ALTER TABLE `mallink`.`wx_coupon_order_42` | |||
| ADD COLUMN `shipping_status` tinyint(2) NOT NULL DEFAULT 0 COMMENT '配送状态 0:默认(无) 1*:自提 2*:配送' AFTER `shipping_type`; | |||
| ALTER TABLE `mallink`.`wx_coupon_order_43` | |||
| ADD COLUMN `shipping_status` tinyint(2) NOT NULL DEFAULT 0 COMMENT '配送状态 0:默认(无) 1*:自提 2*:配送' AFTER `shipping_type`; | |||
| ALTER TABLE `mallink`.`wx_coupon_order_44` | |||
| ADD COLUMN `shipping_status` tinyint(2) NOT NULL DEFAULT 0 COMMENT '配送状态 0:默认(无) 1*:自提 2*:配送' AFTER `shipping_type`; | |||
| ALTER TABLE `mallink`.`wx_coupon_order_45` | |||
| ADD COLUMN `shipping_status` tinyint(2) NOT NULL DEFAULT 0 COMMENT '配送状态 0:默认(无) 1*:自提 2*:配送' AFTER `shipping_type`; | |||
| ALTER TABLE `mallink`.`wx_coupon_order_46` | |||
| ADD COLUMN `shipping_status` tinyint(2) NOT NULL DEFAULT 0 COMMENT '配送状态 0:默认(无) 1*:自提 2*:配送' AFTER `shipping_type`; | |||
| ALTER TABLE `mallink`.`wx_coupon_order_47` | |||
| ADD COLUMN `shipping_status` tinyint(2) NOT NULL DEFAULT 0 COMMENT '配送状态 0:默认(无) 1*:自提 2*:配送' AFTER `shipping_type`; | |||
| ALTER TABLE `mallink`.`wx_coupon_order_48` | |||
| ADD COLUMN `shipping_status` tinyint(2) NOT NULL DEFAULT 0 COMMENT '配送状态 0:默认(无) 1*:自提 2*:配送' AFTER `shipping_type`; | |||
| ALTER TABLE `mallink`.`wx_coupon_order_49` | |||
| ADD COLUMN `shipping_status` tinyint(2) NOT NULL DEFAULT 0 COMMENT '配送状态 0:默认(无) 1*:自提 2*:配送' AFTER `shipping_type`; | |||
| ALTER TABLE `mallink`.`wx_coupon_order_50` | |||
| ADD COLUMN `shipping_status` tinyint(2) NOT NULL DEFAULT 0 COMMENT '配送状态 0:默认(无) 1*:自提 2*:配送' AFTER `shipping_type`; | |||
| ALTER TABLE `mallink`.`wx_coupon_order_51` | |||
| ADD COLUMN `shipping_status` tinyint(2) NOT NULL DEFAULT 0 COMMENT '配送状态 0:默认(无) 1*:自提 2*:配送' AFTER `shipping_type`; | |||
| ALTER TABLE `mallink`.`wx_coupon_order_52` | |||
| ADD COLUMN `shipping_status` tinyint(2) NOT NULL DEFAULT 0 COMMENT '配送状态 0:默认(无) 1*:自提 2*:配送' AFTER `shipping_type`; | |||
| ALTER TABLE `mallink`.`wx_coupon_order_53` | |||
| ADD COLUMN `shipping_status` tinyint(2) NOT NULL DEFAULT 0 COMMENT '配送状态 0:默认(无) 1*:自提 2*:配送' AFTER `shipping_type`; | |||
| ALTER TABLE `mallink`.`wx_coupon_order_54` | |||
| ADD COLUMN `shipping_status` tinyint(2) NOT NULL DEFAULT 0 COMMENT '配送状态 0:默认(无) 1*:自提 2*:配送' AFTER `shipping_type`; | |||
| ALTER TABLE `mallink`.`wx_coupon_order_55` | |||
| ADD COLUMN `shipping_status` tinyint(2) NOT NULL DEFAULT 0 COMMENT '配送状态 0:默认(无) 1*:自提 2*:配送' AFTER `shipping_type`; | |||
| ALTER TABLE `mallink`.`wx_coupon_order_56` | |||
| ADD COLUMN `shipping_status` tinyint(2) NOT NULL DEFAULT 0 COMMENT '配送状态 0:默认(无) 1*:自提 2*:配送' AFTER `shipping_type`; | |||
| ALTER TABLE `mallink`.`wx_coupon_order_57` | |||
| ADD COLUMN `shipping_status` tinyint(2) NOT NULL DEFAULT 0 COMMENT '配送状态 0:默认(无) 1*:自提 2*:配送' AFTER `shipping_type`; | |||
| ALTER TABLE `mallink`.`wx_coupon_order_58` | |||
| ADD COLUMN `shipping_status` tinyint(2) NOT NULL DEFAULT 0 COMMENT '配送状态 0:默认(无) 1*:自提 2*:配送' AFTER `shipping_type`; | |||
| ALTER TABLE `mallink`.`wx_coupon_order_59` | |||
| ADD COLUMN `shipping_status` tinyint(2) NOT NULL DEFAULT 0 COMMENT '配送状态 0:默认(无) 1*:自提 2*:配送' AFTER `shipping_type`; | |||
| ALTER TABLE `mallink`.`wx_coupon_order_60` | |||
| ADD COLUMN `shipping_status` tinyint(2) NOT NULL DEFAULT 0 COMMENT '配送状态 0:默认(无) 1*:自提 2*:配送' AFTER `shipping_type`; | |||
| ALTER TABLE `mallink`.`wx_coupon_order_61` | |||
| ADD COLUMN `shipping_status` tinyint(2) NOT NULL DEFAULT 0 COMMENT '配送状态 0:默认(无) 1*:自提 2*:配送' AFTER `shipping_type`; | |||
| ALTER TABLE `mallink`.`wx_coupon_order_62` | |||
| ADD COLUMN `shipping_status` tinyint(2) NOT NULL DEFAULT 0 COMMENT '配送状态 0:默认(无) 1*:自提 2*:配送' AFTER `shipping_type`; | |||
| ALTER TABLE `mallink`.`wx_coupon_order_63` | |||
| ADD COLUMN `shipping_status` tinyint(2) NOT NULL DEFAULT 0 COMMENT '配送状态 0:默认(无) 1*:自提 2*:配送' AFTER `shipping_type`; | |||
| ALTER TABLE `mallink`.`wx_coupon_order_64` | |||
| ADD COLUMN `shipping_status` tinyint(2) NOT NULL DEFAULT 0 COMMENT '配送状态 0:默认(无) 1*:自提 2*:配送' AFTER `shipping_type`; | |||
| ALTER TABLE `mallink`.`wx_coupon_order_65` | |||
| ADD COLUMN `shipping_status` tinyint(2) NOT NULL DEFAULT 0 COMMENT '配送状态 0:默认(无) 1*:自提 2*:配送' AFTER `shipping_type`; | |||
| ALTER TABLE `mallink`.`wx_coupon_order_66` | |||
| ADD COLUMN `shipping_status` tinyint(2) NOT NULL DEFAULT 0 COMMENT '配送状态 0:默认(无) 1*:自提 2*:配送' AFTER `shipping_type`; | |||
| ALTER TABLE `mallink`.`wx_coupon_order_67` | |||
| ADD COLUMN `shipping_status` tinyint(2) NOT NULL DEFAULT 0 COMMENT '配送状态 0:默认(无) 1*:自提 2*:配送' AFTER `shipping_type`; | |||
| ALTER TABLE `mallink`.`wx_coupon_order_68` | |||
| ADD COLUMN `shipping_status` tinyint(2) NOT NULL DEFAULT 0 COMMENT '配送状态 0:默认(无) 1*:自提 2*:配送' AFTER `shipping_type`; | |||
| ALTER TABLE `mallink`.`wx_coupon_order_69` | |||
| ADD COLUMN `shipping_status` tinyint(2) NOT NULL DEFAULT 0 COMMENT '配送状态 0:默认(无) 1*:自提 2*:配送' AFTER `shipping_type`; | |||
| ALTER TABLE `mallink`.`wx_coupon_order_70` | |||
| ADD COLUMN `shipping_status` tinyint(2) NOT NULL DEFAULT 0 COMMENT '配送状态 0:默认(无) 1*:自提 2*:配送' AFTER `shipping_type`; | |||
| ALTER TABLE `mallink`.`wx_coupon_order_71` | |||
| ADD COLUMN `shipping_status` tinyint(2) NOT NULL DEFAULT 0 COMMENT '配送状态 0:默认(无) 1*:自提 2*:配送' AFTER `shipping_type`; | |||
| ALTER TABLE `mallink`.`wx_coupon_order_72` | |||
| ADD COLUMN `shipping_status` tinyint(2) NOT NULL DEFAULT 0 COMMENT '配送状态 0:默认(无) 1*:自提 2*:配送' AFTER `shipping_type`; | |||
| ALTER TABLE `mallink`.`wx_coupon_order_73` | |||
| ADD COLUMN `shipping_status` tinyint(2) NOT NULL DEFAULT 0 COMMENT '配送状态 0:默认(无) 1*:自提 2*:配送' AFTER `shipping_type`; | |||
| ALTER TABLE `mallink`.`wx_coupon_order_74` | |||
| ADD COLUMN `shipping_status` tinyint(2) NOT NULL DEFAULT 0 COMMENT '配送状态 0:默认(无) 1*:自提 2*:配送' AFTER `shipping_type`; | |||
| ALTER TABLE `mallink`.`wx_coupon_order_75` | |||
| ADD COLUMN `shipping_status` tinyint(2) NOT NULL DEFAULT 0 COMMENT '配送状态 0:默认(无) 1*:自提 2*:配送' AFTER `shipping_type`; | |||
| ALTER TABLE `mallink`.`wx_coupon_order_76` | |||
| ADD COLUMN `shipping_status` tinyint(2) NOT NULL DEFAULT 0 COMMENT '配送状态 0:默认(无) 1*:自提 2*:配送' AFTER `shipping_type`; | |||
| ALTER TABLE `mallink`.`wx_coupon_order_77` | |||
| ADD COLUMN `shipping_status` tinyint(2) NOT NULL DEFAULT 0 COMMENT '配送状态 0:默认(无) 1*:自提 2*:配送' AFTER `shipping_type`; | |||
| ALTER TABLE `mallink`.`wx_coupon_order_78` | |||
| ADD COLUMN `shipping_status` tinyint(2) NOT NULL DEFAULT 0 COMMENT '配送状态 0:默认(无) 1*:自提 2*:配送' AFTER `shipping_type`; | |||
| ALTER TABLE `mallink`.`wx_coupon_order_79` | |||
| ADD COLUMN `shipping_status` tinyint(2) NOT NULL DEFAULT 0 COMMENT '配送状态 0:默认(无) 1*:自提 2*:配送' AFTER `shipping_type`; | |||
| ALTER TABLE `mallink`.`wx_coupon_order_80` | |||
| ADD COLUMN `shipping_status` tinyint(2) NOT NULL DEFAULT 0 COMMENT '配送状态 0:默认(无) 1*:自提 2*:配送' AFTER `shipping_type`; | |||
| ALTER TABLE `mallink`.`wx_coupon_order_81` | |||
| ADD COLUMN `shipping_status` tinyint(2) NOT NULL DEFAULT 0 COMMENT '配送状态 0:默认(无) 1*:自提 2*:配送' AFTER `shipping_type`; | |||
| ALTER TABLE `mallink`.`wx_coupon_order_82` | |||
| ADD COLUMN `shipping_status` tinyint(2) NOT NULL DEFAULT 0 COMMENT '配送状态 0:默认(无) 1*:自提 2*:配送' AFTER `shipping_type`; | |||
| ALTER TABLE `mallink`.`wx_coupon_order_83` | |||
| ADD COLUMN `shipping_status` tinyint(2) NOT NULL DEFAULT 0 COMMENT '配送状态 0:默认(无) 1*:自提 2*:配送' AFTER `shipping_type`; | |||
| ALTER TABLE `mallink`.`wx_coupon_order_84` | |||
| ADD COLUMN `shipping_status` tinyint(2) NOT NULL DEFAULT 0 COMMENT '配送状态 0:默认(无) 1*:自提 2*:配送' AFTER `shipping_type`; | |||
| ALTER TABLE `mallink`.`wx_coupon_order_85` | |||
| ADD COLUMN `shipping_status` tinyint(2) NOT NULL DEFAULT 0 COMMENT '配送状态 0:默认(无) 1*:自提 2*:配送' AFTER `shipping_type`; | |||
| ALTER TABLE `mallink`.`wx_coupon_order_86` | |||
| ADD COLUMN `shipping_status` tinyint(2) NOT NULL DEFAULT 0 COMMENT '配送状态 0:默认(无) 1*:自提 2*:配送' AFTER `shipping_type`; | |||
| ALTER TABLE `mallink`.`wx_coupon_order_87` | |||
| ADD COLUMN `shipping_status` tinyint(2) NOT NULL DEFAULT 0 COMMENT '配送状态 0:默认(无) 1*:自提 2*:配送' AFTER `shipping_type`; | |||
| ALTER TABLE `mallink`.`wx_coupon_order_88` | |||
| ADD COLUMN `shipping_status` tinyint(2) NOT NULL DEFAULT 0 COMMENT '配送状态 0:默认(无) 1*:自提 2*:配送' AFTER `shipping_type`; | |||
| ALTER TABLE `mallink`.`wx_coupon_order_89` | |||
| ADD COLUMN `shipping_status` tinyint(2) NOT NULL DEFAULT 0 COMMENT '配送状态 0:默认(无) 1*:自提 2*:配送' AFTER `shipping_type`; | |||
| ALTER TABLE `mallink`.`wx_coupon_order_90` | |||
| ADD COLUMN `shipping_status` tinyint(2) NOT NULL DEFAULT 0 COMMENT '配送状态 0:默认(无) 1*:自提 2*:配送' AFTER `shipping_type`; | |||
| ALTER TABLE `mallink`.`wx_coupon_order_91` | |||
| ADD COLUMN `shipping_status` tinyint(2) NOT NULL DEFAULT 0 COMMENT '配送状态 0:默认(无) 1*:自提 2*:配送' AFTER `shipping_type`; | |||
| ALTER TABLE `mallink`.`wx_coupon_order_92` | |||
| ADD COLUMN `shipping_status` tinyint(2) NOT NULL DEFAULT 0 COMMENT '配送状态 0:默认(无) 1*:自提 2*:配送' AFTER `shipping_type`; | |||
| ALTER TABLE `mallink`.`wx_coupon_order_93` | |||
| ADD COLUMN `shipping_status` tinyint(2) NOT NULL DEFAULT 0 COMMENT '配送状态 0:默认(无) 1*:自提 2*:配送' AFTER `shipping_type`; | |||
| ALTER TABLE `mallink`.`wx_coupon_order_94` | |||
| ADD COLUMN `shipping_status` tinyint(2) NOT NULL DEFAULT 0 COMMENT '配送状态 0:默认(无) 1*:自提 2*:配送' AFTER `shipping_type`; | |||
| ALTER TABLE `mallink`.`wx_coupon_order_95` | |||
| ADD COLUMN `shipping_status` tinyint(2) NOT NULL DEFAULT 0 COMMENT '配送状态 0:默认(无) 1*:自提 2*:配送' AFTER `shipping_type`; | |||
| ALTER TABLE `mallink`.`wx_coupon_order_96` | |||
| ADD COLUMN `shipping_status` tinyint(2) NOT NULL DEFAULT 0 COMMENT '配送状态 0:默认(无) 1*:自提 2*:配送' AFTER `shipping_type`; | |||
| ALTER TABLE `mallink`.`wx_coupon_order_97` | |||
| ADD COLUMN `shipping_status` tinyint(2) NOT NULL DEFAULT 0 COMMENT '配送状态 0:默认(无) 1*:自提 2*:配送' AFTER `shipping_type`; | |||
| ALTER TABLE `mallink`.`wx_coupon_order_98` | |||
| ADD COLUMN `shipping_status` tinyint(2) NOT NULL DEFAULT 0 COMMENT '配送状态 0:默认(无) 1*:自提 2*:配送' AFTER `shipping_type`; | |||
| ALTER TABLE `mallink`.`wx_coupon_order_99` | |||
| ADD COLUMN `shipping_status` tinyint(2) NOT NULL DEFAULT 0 COMMENT '配送状态 0:默认(无) 1*:自提 2*:配送' AFTER `shipping_type`; | |||
| @@ -0,0 +1,201 @@ | |||
| ALTER TABLE wx_order_0 ADD COLUMN `parent_order_id` bigint(20) not null default 0 COMMENT '父订单编号'; | |||
| ALTER TABLE wx_order_1 ADD COLUMN `parent_order_id` bigint(20) not null default 0 COMMENT '父订单编号'; | |||
| ALTER TABLE wx_order_2 ADD COLUMN `parent_order_id` bigint(20) not null default 0 COMMENT '父订单编号'; | |||
| ALTER TABLE wx_order_3 ADD COLUMN `parent_order_id` bigint(20) not null default 0 COMMENT '父订单编号'; | |||
| ALTER TABLE wx_order_4 ADD COLUMN `parent_order_id` bigint(20) not null default 0 COMMENT '父订单编号'; | |||
| ALTER TABLE wx_order_5 ADD COLUMN `parent_order_id` bigint(20) not null default 0 COMMENT '父订单编号'; | |||
| ALTER TABLE wx_order_6 ADD COLUMN `parent_order_id` bigint(20) not null default 0 COMMENT '父订单编号'; | |||
| ALTER TABLE wx_order_7 ADD COLUMN `parent_order_id` bigint(20) not null default 0 COMMENT '父订单编号'; | |||
| ALTER TABLE wx_order_8 ADD COLUMN `parent_order_id` bigint(20) not null default 0 COMMENT '父订单编号'; | |||
| ALTER TABLE wx_order_9 ADD COLUMN `parent_order_id` bigint(20) not null default 0 COMMENT '父订单编号'; | |||
| ALTER TABLE wx_order_10 ADD COLUMN `parent_order_id` bigint(20) not null default 0 COMMENT '父订单编号'; | |||
| ALTER TABLE wx_order_11 ADD COLUMN `parent_order_id` bigint(20) not null default 0 COMMENT '父订单编号'; | |||
| ALTER TABLE wx_order_12 ADD COLUMN `parent_order_id` bigint(20) not null default 0 COMMENT '父订单编号'; | |||
| ALTER TABLE wx_order_13 ADD COLUMN `parent_order_id` bigint(20) not null default 0 COMMENT '父订单编号'; | |||
| ALTER TABLE wx_order_14 ADD COLUMN `parent_order_id` bigint(20) not null default 0 COMMENT '父订单编号'; | |||
| ALTER TABLE wx_order_15 ADD COLUMN `parent_order_id` bigint(20) not null default 0 COMMENT '父订单编号'; | |||
| ALTER TABLE wx_order_16 ADD COLUMN `parent_order_id` bigint(20) not null default 0 COMMENT '父订单编号'; | |||
| ALTER TABLE wx_order_17 ADD COLUMN `parent_order_id` bigint(20) not null default 0 COMMENT '父订单编号'; | |||
| ALTER TABLE wx_order_18 ADD COLUMN `parent_order_id` bigint(20) not null default 0 COMMENT '父订单编号'; | |||
| ALTER TABLE wx_order_19 ADD COLUMN `parent_order_id` bigint(20) not null default 0 COMMENT '父订单编号'; | |||
| ALTER TABLE wx_order_20 ADD COLUMN `parent_order_id` bigint(20) not null default 0 COMMENT '父订单编号'; | |||
| ALTER TABLE wx_order_21 ADD COLUMN `parent_order_id` bigint(20) not null default 0 COMMENT '父订单编号'; | |||
| ALTER TABLE wx_order_22 ADD COLUMN `parent_order_id` bigint(20) not null default 0 COMMENT '父订单编号'; | |||
| ALTER TABLE wx_order_23 ADD COLUMN `parent_order_id` bigint(20) not null default 0 COMMENT '父订单编号'; | |||
| ALTER TABLE wx_order_24 ADD COLUMN `parent_order_id` bigint(20) not null default 0 COMMENT '父订单编号'; | |||
| ALTER TABLE wx_order_25 ADD COLUMN `parent_order_id` bigint(20) not null default 0 COMMENT '父订单编号'; | |||
| ALTER TABLE wx_order_26 ADD COLUMN `parent_order_id` bigint(20) not null default 0 COMMENT '父订单编号'; | |||
| ALTER TABLE wx_order_27 ADD COLUMN `parent_order_id` bigint(20) not null default 0 COMMENT '父订单编号'; | |||
| ALTER TABLE wx_order_28 ADD COLUMN `parent_order_id` bigint(20) not null default 0 COMMENT '父订单编号'; | |||
| ALTER TABLE wx_order_29 ADD COLUMN `parent_order_id` bigint(20) not null default 0 COMMENT '父订单编号'; | |||
| ALTER TABLE wx_order_30 ADD COLUMN `parent_order_id` bigint(20) not null default 0 COMMENT '父订单编号'; | |||
| ALTER TABLE wx_order_31 ADD COLUMN `parent_order_id` bigint(20) not null default 0 COMMENT '父订单编号'; | |||
| ALTER TABLE wx_order_32 ADD COLUMN `parent_order_id` bigint(20) not null default 0 COMMENT '父订单编号'; | |||
| ALTER TABLE wx_order_33 ADD COLUMN `parent_order_id` bigint(20) not null default 0 COMMENT '父订单编号'; | |||
| ALTER TABLE wx_order_34 ADD COLUMN `parent_order_id` bigint(20) not null default 0 COMMENT '父订单编号'; | |||
| ALTER TABLE wx_order_35 ADD COLUMN `parent_order_id` bigint(20) not null default 0 COMMENT '父订单编号'; | |||
| ALTER TABLE wx_order_36 ADD COLUMN `parent_order_id` bigint(20) not null default 0 COMMENT '父订单编号'; | |||
| ALTER TABLE wx_order_37 ADD COLUMN `parent_order_id` bigint(20) not null default 0 COMMENT '父订单编号'; | |||
| ALTER TABLE wx_order_38 ADD COLUMN `parent_order_id` bigint(20) not null default 0 COMMENT '父订单编号'; | |||
| ALTER TABLE wx_order_39 ADD COLUMN `parent_order_id` bigint(20) not null default 0 COMMENT '父订单编号'; | |||
| ALTER TABLE wx_order_40 ADD COLUMN `parent_order_id` bigint(20) not null default 0 COMMENT '父订单编号'; | |||
| ALTER TABLE wx_order_41 ADD COLUMN `parent_order_id` bigint(20) not null default 0 COMMENT '父订单编号'; | |||
| ALTER TABLE wx_order_42 ADD COLUMN `parent_order_id` bigint(20) not null default 0 COMMENT '父订单编号'; | |||
| ALTER TABLE wx_order_43 ADD COLUMN `parent_order_id` bigint(20) not null default 0 COMMENT '父订单编号'; | |||
| ALTER TABLE wx_order_44 ADD COLUMN `parent_order_id` bigint(20) not null default 0 COMMENT '父订单编号'; | |||
| ALTER TABLE wx_order_45 ADD COLUMN `parent_order_id` bigint(20) not null default 0 COMMENT '父订单编号'; | |||
| ALTER TABLE wx_order_46 ADD COLUMN `parent_order_id` bigint(20) not null default 0 COMMENT '父订单编号'; | |||
| ALTER TABLE wx_order_47 ADD COLUMN `parent_order_id` bigint(20) not null default 0 COMMENT '父订单编号'; | |||
| ALTER TABLE wx_order_48 ADD COLUMN `parent_order_id` bigint(20) not null default 0 COMMENT '父订单编号'; | |||
| ALTER TABLE wx_order_49 ADD COLUMN `parent_order_id` bigint(20) not null default 0 COMMENT '父订单编号'; | |||
| ALTER TABLE wx_order_50 ADD COLUMN `parent_order_id` bigint(20) not null default 0 COMMENT '父订单编号'; | |||
| ALTER TABLE wx_order_51 ADD COLUMN `parent_order_id` bigint(20) not null default 0 COMMENT '父订单编号'; | |||
| ALTER TABLE wx_order_52 ADD COLUMN `parent_order_id` bigint(20) not null default 0 COMMENT '父订单编号'; | |||
| ALTER TABLE wx_order_53 ADD COLUMN `parent_order_id` bigint(20) not null default 0 COMMENT '父订单编号'; | |||
| ALTER TABLE wx_order_54 ADD COLUMN `parent_order_id` bigint(20) not null default 0 COMMENT '父订单编号'; | |||
| ALTER TABLE wx_order_55 ADD COLUMN `parent_order_id` bigint(20) not null default 0 COMMENT '父订单编号'; | |||
| ALTER TABLE wx_order_56 ADD COLUMN `parent_order_id` bigint(20) not null default 0 COMMENT '父订单编号'; | |||
| ALTER TABLE wx_order_57 ADD COLUMN `parent_order_id` bigint(20) not null default 0 COMMENT '父订单编号'; | |||
| ALTER TABLE wx_order_58 ADD COLUMN `parent_order_id` bigint(20) not null default 0 COMMENT '父订单编号'; | |||
| ALTER TABLE wx_order_59 ADD COLUMN `parent_order_id` bigint(20) not null default 0 COMMENT '父订单编号'; | |||
| ALTER TABLE wx_order_60 ADD COLUMN `parent_order_id` bigint(20) not null default 0 COMMENT '父订单编号'; | |||
| ALTER TABLE wx_order_61 ADD COLUMN `parent_order_id` bigint(20) not null default 0 COMMENT '父订单编号'; | |||
| ALTER TABLE wx_order_62 ADD COLUMN `parent_order_id` bigint(20) not null default 0 COMMENT '父订单编号'; | |||
| ALTER TABLE wx_order_63 ADD COLUMN `parent_order_id` bigint(20) not null default 0 COMMENT '父订单编号'; | |||
| ALTER TABLE wx_order_64 ADD COLUMN `parent_order_id` bigint(20) not null default 0 COMMENT '父订单编号'; | |||
| ALTER TABLE wx_order_65 ADD COLUMN `parent_order_id` bigint(20) not null default 0 COMMENT '父订单编号'; | |||
| ALTER TABLE wx_order_66 ADD COLUMN `parent_order_id` bigint(20) not null default 0 COMMENT '父订单编号'; | |||
| ALTER TABLE wx_order_67 ADD COLUMN `parent_order_id` bigint(20) not null default 0 COMMENT '父订单编号'; | |||
| ALTER TABLE wx_order_68 ADD COLUMN `parent_order_id` bigint(20) not null default 0 COMMENT '父订单编号'; | |||
| ALTER TABLE wx_order_69 ADD COLUMN `parent_order_id` bigint(20) not null default 0 COMMENT '父订单编号'; | |||
| ALTER TABLE wx_order_70 ADD COLUMN `parent_order_id` bigint(20) not null default 0 COMMENT '父订单编号'; | |||
| ALTER TABLE wx_order_71 ADD COLUMN `parent_order_id` bigint(20) not null default 0 COMMENT '父订单编号'; | |||
| ALTER TABLE wx_order_72 ADD COLUMN `parent_order_id` bigint(20) not null default 0 COMMENT '父订单编号'; | |||
| ALTER TABLE wx_order_73 ADD COLUMN `parent_order_id` bigint(20) not null default 0 COMMENT '父订单编号'; | |||
| ALTER TABLE wx_order_74 ADD COLUMN `parent_order_id` bigint(20) not null default 0 COMMENT '父订单编号'; | |||
| ALTER TABLE wx_order_75 ADD COLUMN `parent_order_id` bigint(20) not null default 0 COMMENT '父订单编号'; | |||
| ALTER TABLE wx_order_76 ADD COLUMN `parent_order_id` bigint(20) not null default 0 COMMENT '父订单编号'; | |||
| ALTER TABLE wx_order_77 ADD COLUMN `parent_order_id` bigint(20) not null default 0 COMMENT '父订单编号'; | |||
| ALTER TABLE wx_order_78 ADD COLUMN `parent_order_id` bigint(20) not null default 0 COMMENT '父订单编号'; | |||
| ALTER TABLE wx_order_79 ADD COLUMN `parent_order_id` bigint(20) not null default 0 COMMENT '父订单编号'; | |||
| ALTER TABLE wx_order_80 ADD COLUMN `parent_order_id` bigint(20) not null default 0 COMMENT '父订单编号'; | |||
| ALTER TABLE wx_order_81 ADD COLUMN `parent_order_id` bigint(20) not null default 0 COMMENT '父订单编号'; | |||
| ALTER TABLE wx_order_82 ADD COLUMN `parent_order_id` bigint(20) not null default 0 COMMENT '父订单编号'; | |||
| ALTER TABLE wx_order_83 ADD COLUMN `parent_order_id` bigint(20) not null default 0 COMMENT '父订单编号'; | |||
| ALTER TABLE wx_order_84 ADD COLUMN `parent_order_id` bigint(20) not null default 0 COMMENT '父订单编号'; | |||
| ALTER TABLE wx_order_85 ADD COLUMN `parent_order_id` bigint(20) not null default 0 COMMENT '父订单编号'; | |||
| ALTER TABLE wx_order_86 ADD COLUMN `parent_order_id` bigint(20) not null default 0 COMMENT '父订单编号'; | |||
| ALTER TABLE wx_order_87 ADD COLUMN `parent_order_id` bigint(20) not null default 0 COMMENT '父订单编号'; | |||
| ALTER TABLE wx_order_88 ADD COLUMN `parent_order_id` bigint(20) not null default 0 COMMENT '父订单编号'; | |||
| ALTER TABLE wx_order_89 ADD COLUMN `parent_order_id` bigint(20) not null default 0 COMMENT '父订单编号'; | |||
| ALTER TABLE wx_order_90 ADD COLUMN `parent_order_id` bigint(20) not null default 0 COMMENT '父订单编号'; | |||
| ALTER TABLE wx_order_91 ADD COLUMN `parent_order_id` bigint(20) not null default 0 COMMENT '父订单编号'; | |||
| ALTER TABLE wx_order_92 ADD COLUMN `parent_order_id` bigint(20) not null default 0 COMMENT '父订单编号'; | |||
| ALTER TABLE wx_order_93 ADD COLUMN `parent_order_id` bigint(20) not null default 0 COMMENT '父订单编号'; | |||
| ALTER TABLE wx_order_94 ADD COLUMN `parent_order_id` bigint(20) not null default 0 COMMENT '父订单编号'; | |||
| ALTER TABLE wx_order_95 ADD COLUMN `parent_order_id` bigint(20) not null default 0 COMMENT '父订单编号'; | |||
| ALTER TABLE wx_order_96 ADD COLUMN `parent_order_id` bigint(20) not null default 0 COMMENT '父订单编号'; | |||
| ALTER TABLE wx_order_97 ADD COLUMN `parent_order_id` bigint(20) not null default 0 COMMENT '父订单编号'; | |||
| ALTER TABLE wx_order_98 ADD COLUMN `parent_order_id` bigint(20) not null default 0 COMMENT '父订单编号'; | |||
| ALTER TABLE wx_order_99 ADD COLUMN `parent_order_id` bigint(20) not null default 0 COMMENT '父订单编号'; | |||
| ALTER TABLE wx_coupon_order_0 ADD COLUMN `parent_coupon_order_id` bigint(20) not null default 0 COMMENT '父订单编号'; | |||
| ALTER TABLE wx_coupon_order_1 ADD COLUMN `parent_coupon_order_id` bigint(20) not null default 0 COMMENT '父订单编号'; | |||
| ALTER TABLE wx_coupon_order_2 ADD COLUMN `parent_coupon_order_id` bigint(20) not null default 0 COMMENT '父订单编号'; | |||
| ALTER TABLE wx_coupon_order_3 ADD COLUMN `parent_coupon_order_id` bigint(20) not null default 0 COMMENT '父订单编号'; | |||
| ALTER TABLE wx_coupon_order_4 ADD COLUMN `parent_coupon_order_id` bigint(20) not null default 0 COMMENT '父订单编号'; | |||
| ALTER TABLE wx_coupon_order_5 ADD COLUMN `parent_coupon_order_id` bigint(20) not null default 0 COMMENT '父订单编号'; | |||
| ALTER TABLE wx_coupon_order_6 ADD COLUMN `parent_coupon_order_id` bigint(20) not null default 0 COMMENT '父订单编号'; | |||
| ALTER TABLE wx_coupon_order_7 ADD COLUMN `parent_coupon_order_id` bigint(20) not null default 0 COMMENT '父订单编号'; | |||
| ALTER TABLE wx_coupon_order_8 ADD COLUMN `parent_coupon_order_id` bigint(20) not null default 0 COMMENT '父订单编号'; | |||
| ALTER TABLE wx_coupon_order_9 ADD COLUMN `parent_coupon_order_id` bigint(20) not null default 0 COMMENT '父订单编号'; | |||
| ALTER TABLE wx_coupon_order_10 ADD COLUMN `parent_coupon_order_id` bigint(20) not null default 0 COMMENT '父订单编号'; | |||
| ALTER TABLE wx_coupon_order_11 ADD COLUMN `parent_coupon_order_id` bigint(20) not null default 0 COMMENT '父订单编号'; | |||
| ALTER TABLE wx_coupon_order_12 ADD COLUMN `parent_coupon_order_id` bigint(20) not null default 0 COMMENT '父订单编号'; | |||
| ALTER TABLE wx_coupon_order_13 ADD COLUMN `parent_coupon_order_id` bigint(20) not null default 0 COMMENT '父订单编号'; | |||
| ALTER TABLE wx_coupon_order_14 ADD COLUMN `parent_coupon_order_id` bigint(20) not null default 0 COMMENT '父订单编号'; | |||
| ALTER TABLE wx_coupon_order_15 ADD COLUMN `parent_coupon_order_id` bigint(20) not null default 0 COMMENT '父订单编号'; | |||
| ALTER TABLE wx_coupon_order_16 ADD COLUMN `parent_coupon_order_id` bigint(20) not null default 0 COMMENT '父订单编号'; | |||
| ALTER TABLE wx_coupon_order_17 ADD COLUMN `parent_coupon_order_id` bigint(20) not null default 0 COMMENT '父订单编号'; | |||
| ALTER TABLE wx_coupon_order_18 ADD COLUMN `parent_coupon_order_id` bigint(20) not null default 0 COMMENT '父订单编号'; | |||
| ALTER TABLE wx_coupon_order_19 ADD COLUMN `parent_coupon_order_id` bigint(20) not null default 0 COMMENT '父订单编号'; | |||
| ALTER TABLE wx_coupon_order_20 ADD COLUMN `parent_coupon_order_id` bigint(20) not null default 0 COMMENT '父订单编号'; | |||
| ALTER TABLE wx_coupon_order_21 ADD COLUMN `parent_coupon_order_id` bigint(20) not null default 0 COMMENT '父订单编号'; | |||
| ALTER TABLE wx_coupon_order_22 ADD COLUMN `parent_coupon_order_id` bigint(20) not null default 0 COMMENT '父订单编号'; | |||
| ALTER TABLE wx_coupon_order_23 ADD COLUMN `parent_coupon_order_id` bigint(20) not null default 0 COMMENT '父订单编号'; | |||
| ALTER TABLE wx_coupon_order_24 ADD COLUMN `parent_coupon_order_id` bigint(20) not null default 0 COMMENT '父订单编号'; | |||
| ALTER TABLE wx_coupon_order_25 ADD COLUMN `parent_coupon_order_id` bigint(20) not null default 0 COMMENT '父订单编号'; | |||
| ALTER TABLE wx_coupon_order_26 ADD COLUMN `parent_coupon_order_id` bigint(20) not null default 0 COMMENT '父订单编号'; | |||
| ALTER TABLE wx_coupon_order_27 ADD COLUMN `parent_coupon_order_id` bigint(20) not null default 0 COMMENT '父订单编号'; | |||
| ALTER TABLE wx_coupon_order_28 ADD COLUMN `parent_coupon_order_id` bigint(20) not null default 0 COMMENT '父订单编号'; | |||
| ALTER TABLE wx_coupon_order_29 ADD COLUMN `parent_coupon_order_id` bigint(20) not null default 0 COMMENT '父订单编号'; | |||
| ALTER TABLE wx_coupon_order_30 ADD COLUMN `parent_coupon_order_id` bigint(20) not null default 0 COMMENT '父订单编号'; | |||
| ALTER TABLE wx_coupon_order_31 ADD COLUMN `parent_coupon_order_id` bigint(20) not null default 0 COMMENT '父订单编号'; | |||
| ALTER TABLE wx_coupon_order_32 ADD COLUMN `parent_coupon_order_id` bigint(20) not null default 0 COMMENT '父订单编号'; | |||
| ALTER TABLE wx_coupon_order_33 ADD COLUMN `parent_coupon_order_id` bigint(20) not null default 0 COMMENT '父订单编号'; | |||
| ALTER TABLE wx_coupon_order_34 ADD COLUMN `parent_coupon_order_id` bigint(20) not null default 0 COMMENT '父订单编号'; | |||
| ALTER TABLE wx_coupon_order_35 ADD COLUMN `parent_coupon_order_id` bigint(20) not null default 0 COMMENT '父订单编号'; | |||
| ALTER TABLE wx_coupon_order_36 ADD COLUMN `parent_coupon_order_id` bigint(20) not null default 0 COMMENT '父订单编号'; | |||
| ALTER TABLE wx_coupon_order_37 ADD COLUMN `parent_coupon_order_id` bigint(20) not null default 0 COMMENT '父订单编号'; | |||
| ALTER TABLE wx_coupon_order_38 ADD COLUMN `parent_coupon_order_id` bigint(20) not null default 0 COMMENT '父订单编号'; | |||
| ALTER TABLE wx_coupon_order_39 ADD COLUMN `parent_coupon_order_id` bigint(20) not null default 0 COMMENT '父订单编号'; | |||
| ALTER TABLE wx_coupon_order_40 ADD COLUMN `parent_coupon_order_id` bigint(20) not null default 0 COMMENT '父订单编号'; | |||
| ALTER TABLE wx_coupon_order_41 ADD COLUMN `parent_coupon_order_id` bigint(20) not null default 0 COMMENT '父订单编号'; | |||
| ALTER TABLE wx_coupon_order_42 ADD COLUMN `parent_coupon_order_id` bigint(20) not null default 0 COMMENT '父订单编号'; | |||
| ALTER TABLE wx_coupon_order_43 ADD COLUMN `parent_coupon_order_id` bigint(20) not null default 0 COMMENT '父订单编号'; | |||
| ALTER TABLE wx_coupon_order_44 ADD COLUMN `parent_coupon_order_id` bigint(20) not null default 0 COMMENT '父订单编号'; | |||
| ALTER TABLE wx_coupon_order_45 ADD COLUMN `parent_coupon_order_id` bigint(20) not null default 0 COMMENT '父订单编号'; | |||
| ALTER TABLE wx_coupon_order_46 ADD COLUMN `parent_coupon_order_id` bigint(20) not null default 0 COMMENT '父订单编号'; | |||
| ALTER TABLE wx_coupon_order_47 ADD COLUMN `parent_coupon_order_id` bigint(20) not null default 0 COMMENT '父订单编号'; | |||
| ALTER TABLE wx_coupon_order_48 ADD COLUMN `parent_coupon_order_id` bigint(20) not null default 0 COMMENT '父订单编号'; | |||
| ALTER TABLE wx_coupon_order_49 ADD COLUMN `parent_coupon_order_id` bigint(20) not null default 0 COMMENT '父订单编号'; | |||
| ALTER TABLE wx_coupon_order_50 ADD COLUMN `parent_coupon_order_id` bigint(20) not null default 0 COMMENT '父订单编号'; | |||
| ALTER TABLE wx_coupon_order_51 ADD COLUMN `parent_coupon_order_id` bigint(20) not null default 0 COMMENT '父订单编号'; | |||
| ALTER TABLE wx_coupon_order_52 ADD COLUMN `parent_coupon_order_id` bigint(20) not null default 0 COMMENT '父订单编号'; | |||
| ALTER TABLE wx_coupon_order_53 ADD COLUMN `parent_coupon_order_id` bigint(20) not null default 0 COMMENT '父订单编号'; | |||
| ALTER TABLE wx_coupon_order_54 ADD COLUMN `parent_coupon_order_id` bigint(20) not null default 0 COMMENT '父订单编号'; | |||
| ALTER TABLE wx_coupon_order_55 ADD COLUMN `parent_coupon_order_id` bigint(20) not null default 0 COMMENT '父订单编号'; | |||
| ALTER TABLE wx_coupon_order_56 ADD COLUMN `parent_coupon_order_id` bigint(20) not null default 0 COMMENT '父订单编号'; | |||
| ALTER TABLE wx_coupon_order_57 ADD COLUMN `parent_coupon_order_id` bigint(20) not null default 0 COMMENT '父订单编号'; | |||
| ALTER TABLE wx_coupon_order_58 ADD COLUMN `parent_coupon_order_id` bigint(20) not null default 0 COMMENT '父订单编号'; | |||
| ALTER TABLE wx_coupon_order_59 ADD COLUMN `parent_coupon_order_id` bigint(20) not null default 0 COMMENT '父订单编号'; | |||
| ALTER TABLE wx_coupon_order_60 ADD COLUMN `parent_coupon_order_id` bigint(20) not null default 0 COMMENT '父订单编号'; | |||
| ALTER TABLE wx_coupon_order_61 ADD COLUMN `parent_coupon_order_id` bigint(20) not null default 0 COMMENT '父订单编号'; | |||
| ALTER TABLE wx_coupon_order_62 ADD COLUMN `parent_coupon_order_id` bigint(20) not null default 0 COMMENT '父订单编号'; | |||
| ALTER TABLE wx_coupon_order_63 ADD COLUMN `parent_coupon_order_id` bigint(20) not null default 0 COMMENT '父订单编号'; | |||
| ALTER TABLE wx_coupon_order_64 ADD COLUMN `parent_coupon_order_id` bigint(20) not null default 0 COMMENT '父订单编号'; | |||
| ALTER TABLE wx_coupon_order_65 ADD COLUMN `parent_coupon_order_id` bigint(20) not null default 0 COMMENT '父订单编号'; | |||
| ALTER TABLE wx_coupon_order_66 ADD COLUMN `parent_coupon_order_id` bigint(20) not null default 0 COMMENT '父订单编号'; | |||
| ALTER TABLE wx_coupon_order_67 ADD COLUMN `parent_coupon_order_id` bigint(20) not null default 0 COMMENT '父订单编号'; | |||
| ALTER TABLE wx_coupon_order_68 ADD COLUMN `parent_coupon_order_id` bigint(20) not null default 0 COMMENT '父订单编号'; | |||
| ALTER TABLE wx_coupon_order_69 ADD COLUMN `parent_coupon_order_id` bigint(20) not null default 0 COMMENT '父订单编号'; | |||
| ALTER TABLE wx_coupon_order_70 ADD COLUMN `parent_coupon_order_id` bigint(20) not null default 0 COMMENT '父订单编号'; | |||
| ALTER TABLE wx_coupon_order_71 ADD COLUMN `parent_coupon_order_id` bigint(20) not null default 0 COMMENT '父订单编号'; | |||
| ALTER TABLE wx_coupon_order_72 ADD COLUMN `parent_coupon_order_id` bigint(20) not null default 0 COMMENT '父订单编号'; | |||
| ALTER TABLE wx_coupon_order_73 ADD COLUMN `parent_coupon_order_id` bigint(20) not null default 0 COMMENT '父订单编号'; | |||
| ALTER TABLE wx_coupon_order_74 ADD COLUMN `parent_coupon_order_id` bigint(20) not null default 0 COMMENT '父订单编号'; | |||
| ALTER TABLE wx_coupon_order_75 ADD COLUMN `parent_coupon_order_id` bigint(20) not null default 0 COMMENT '父订单编号'; | |||
| ALTER TABLE wx_coupon_order_76 ADD COLUMN `parent_coupon_order_id` bigint(20) not null default 0 COMMENT '父订单编号'; | |||
| ALTER TABLE wx_coupon_order_77 ADD COLUMN `parent_coupon_order_id` bigint(20) not null default 0 COMMENT '父订单编号'; | |||
| ALTER TABLE wx_coupon_order_78 ADD COLUMN `parent_coupon_order_id` bigint(20) not null default 0 COMMENT '父订单编号'; | |||
| ALTER TABLE wx_coupon_order_79 ADD COLUMN `parent_coupon_order_id` bigint(20) not null default 0 COMMENT '父订单编号'; | |||
| ALTER TABLE wx_coupon_order_80 ADD COLUMN `parent_coupon_order_id` bigint(20) not null default 0 COMMENT '父订单编号'; | |||
| ALTER TABLE wx_coupon_order_81 ADD COLUMN `parent_coupon_order_id` bigint(20) not null default 0 COMMENT '父订单编号'; | |||
| ALTER TABLE wx_coupon_order_82 ADD COLUMN `parent_coupon_order_id` bigint(20) not null default 0 COMMENT '父订单编号'; | |||
| ALTER TABLE wx_coupon_order_83 ADD COLUMN `parent_coupon_order_id` bigint(20) not null default 0 COMMENT '父订单编号'; | |||
| ALTER TABLE wx_coupon_order_84 ADD COLUMN `parent_coupon_order_id` bigint(20) not null default 0 COMMENT '父订单编号'; | |||
| ALTER TABLE wx_coupon_order_85 ADD COLUMN `parent_coupon_order_id` bigint(20) not null default 0 COMMENT '父订单编号'; | |||
| ALTER TABLE wx_coupon_order_86 ADD COLUMN `parent_coupon_order_id` bigint(20) not null default 0 COMMENT '父订单编号'; | |||
| ALTER TABLE wx_coupon_order_87 ADD COLUMN `parent_coupon_order_id` bigint(20) not null default 0 COMMENT '父订单编号'; | |||
| ALTER TABLE wx_coupon_order_88 ADD COLUMN `parent_coupon_order_id` bigint(20) not null default 0 COMMENT '父订单编号'; | |||
| ALTER TABLE wx_coupon_order_89 ADD COLUMN `parent_coupon_order_id` bigint(20) not null default 0 COMMENT '父订单编号'; | |||
| ALTER TABLE wx_coupon_order_90 ADD COLUMN `parent_coupon_order_id` bigint(20) not null default 0 COMMENT '父订单编号'; | |||
| ALTER TABLE wx_coupon_order_91 ADD COLUMN `parent_coupon_order_id` bigint(20) not null default 0 COMMENT '父订单编号'; | |||
| ALTER TABLE wx_coupon_order_92 ADD COLUMN `parent_coupon_order_id` bigint(20) not null default 0 COMMENT '父订单编号'; | |||
| ALTER TABLE wx_coupon_order_93 ADD COLUMN `parent_coupon_order_id` bigint(20) not null default 0 COMMENT '父订单编号'; | |||
| ALTER TABLE wx_coupon_order_94 ADD COLUMN `parent_coupon_order_id` bigint(20) not null default 0 COMMENT '父订单编号'; | |||
| ALTER TABLE wx_coupon_order_95 ADD COLUMN `parent_coupon_order_id` bigint(20) not null default 0 COMMENT '父订单编号'; | |||
| ALTER TABLE wx_coupon_order_96 ADD COLUMN `parent_coupon_order_id` bigint(20) not null default 0 COMMENT '父订单编号'; | |||
| ALTER TABLE wx_coupon_order_97 ADD COLUMN `parent_coupon_order_id` bigint(20) not null default 0 COMMENT '父订单编号'; | |||
| ALTER TABLE wx_coupon_order_98 ADD COLUMN `parent_coupon_order_id` bigint(20) not null default 0 COMMENT '父订单编号'; | |||
| ALTER TABLE wx_coupon_order_99 ADD COLUMN `parent_coupon_order_id` bigint(20) not null default 0 COMMENT '父订单编号'; | |||
| @@ -1,5 +1,6 @@ | |||
| package com.iformall.controller; | |||
| import com.alibaba.fastjson.JSONObject; | |||
| import com.github.pagehelper.PageInfo; | |||
| import com.iformall.annotation.RedisCache; | |||
| import com.iformall.common.ErrorCode; | |||
| @@ -7,10 +8,9 @@ import com.iformall.common.Result; | |||
| import com.iformall.common.ResultData; | |||
| import com.iformall.domain.po.*; | |||
| import com.iformall.domain.vo.WxCouponCVo; | |||
| import com.iformall.domain.vo.WxCouponOrderBVo; | |||
| import com.iformall.domain.vo.WxCouponOrderCVo; | |||
| import com.iformall.enums.EnumCouponType; | |||
| import com.iformall.enums.EnumCouponValidType; | |||
| import com.iformall.enums.EnumCreditLockedStatus; | |||
| import com.iformall.enums.*; | |||
| import com.iformall.exception.MallinkException; | |||
| import com.iformall.service.*; | |||
| import io.swagger.annotations.Api; | |||
| @@ -26,7 +26,10 @@ import org.springframework.data.redis.core.RedisTemplate; | |||
| import org.springframework.data.redis.core.ValueOperations; | |||
| import org.springframework.web.bind.annotation.*; | |||
| import java.text.SimpleDateFormat; | |||
| import java.util.ArrayList; | |||
| import java.util.Date; | |||
| import java.util.List; | |||
| import java.util.Map; | |||
| import java.util.concurrent.TimeUnit; | |||
| @@ -70,6 +73,33 @@ public class WxCouponOrderController extends BaseController { | |||
| return new ResultData(page); | |||
| } | |||
| @ApiOperation("分页列表接口") | |||
| @GetMapping("goodsList") | |||
| @ApiImplicitParams({ | |||
| @ApiImplicitParam(name = "pageNum", value = "页数", dataType = "int", paramType = "query", required = true), | |||
| @ApiImplicitParam(name = "pageSize", value = "每页条数", dataType = "int", paramType = "query", required = true)}) | |||
| public ResultData goodsList(@ModelAttribute WxCouponOrderBVo wxCouponOrderBvo, Integer pageNum, Integer pageSize) { | |||
| if (null == wxCouponOrderBvo) wxCouponOrderBvo = new WxCouponOrderBVo(); | |||
| wxCouponOrderBvo.updateTenantInfo(getTenantInfo()); | |||
| wxCouponOrderBvo.setMerchantId(getLoginBUser().getMerchantId()); | |||
| wxCouponOrderBvo.setCouponType(EnumCouponType.COUPON_DISTRIBUTION.getCode()); | |||
| List<Integer> shippingStatuss = new ArrayList<>(); | |||
| if(EnumOrderShopingStatus.WAIT_SENG_GOODS.getCode().equals(wxCouponOrderBvo.getShippingStatus())){ | |||
| shippingStatuss.add(EnumOrderShopingStatus.READY_SELF_MENTION.getCode()); | |||
| shippingStatuss.add(EnumOrderShopingStatus.READY_DISTRIBUTION.getCode()); | |||
| }else if(EnumOrderShopingStatus.SENG_GOODS.getCode().equals(wxCouponOrderBvo.getShippingStatus())){ | |||
| shippingStatuss.add(EnumOrderShopingStatus.WAIT_SELF_MENTION.getCode()); | |||
| shippingStatuss.add(EnumOrderShopingStatus.WAIT_DISTRIBUTION.getCode()); | |||
| }else if(EnumOrderShopingStatus.FINISH_SENG_GOODS.getCode().equals(wxCouponOrderBvo.getShippingStatus())){ | |||
| wxCouponOrderBvo.setCouponOrderStatus(EnumCouponOrderStatus.COUPON_ORDER_USED.getCode()); | |||
| } | |||
| if(shippingStatuss.size() > 0){ | |||
| wxCouponOrderBvo.setShippingStatuss(shippingStatuss); | |||
| } | |||
| final PageInfo<WxCouponOrderBVo> page = wxCouponOrderService.goodsListAsPage(wxCouponOrderBvo, pageNum, pageSize); | |||
| return new ResultData(page); | |||
| } | |||
| @ApiOperation("根据id更新接口") | |||
| @PostMapping("update") | |||
| public ResultData update(@RequestBody WxCouponOrder wxCouponOrder) { | |||
| @@ -171,6 +201,7 @@ public class WxCouponOrderController extends BaseController { | |||
| wxCouponOrderCVo.setTitle(wxCouponCVo.getTitle()); | |||
| wxCouponOrderCVo.setSubTitle(wxCouponCVo.getSubTitle()); | |||
| wxCouponOrderCVo.setSalePrice(wxCouponCVo.getSalePrice()); | |||
| wxCouponOrderCVo.setFreightPrice(wxCouponCVo.getFreightPrice()); | |||
| wxCouponOrderCVo.setUsePrice(wxCouponCVo.getUsePrice()); | |||
| wxCouponOrderCVo.setPrice(wxCouponCVo.getPrice()); | |||
| wxCouponOrderCVo.setUnit(wxCouponCVo.getUnit()); | |||
| @@ -307,7 +338,7 @@ public class WxCouponOrderController extends BaseController { | |||
| WxCouponOrder couponOrder = null; | |||
| try { | |||
| wxCouponOrder.setVerifyRemark(verifyRemark); | |||
| couponOrder = wxCouponOrderService.verify(wxCouponOrder, wxMerchantBUser); | |||
| couponOrder = wxCouponOrderService.verify(wxCouponOrder, wxMerchantBUser, EnumCouponVerifyType.VERIFY_B); | |||
| } catch (MallinkException e) { | |||
| logger.error("核销异常: " + e.getMessage()); | |||
| return new ResultData(e.getErrorCode(), e.getMessage()); | |||
| @@ -316,13 +347,14 @@ public class WxCouponOrderController extends BaseController { | |||
| return new ResultData(ErrorCode.VERIFY_ERROR, e.getMessage()); | |||
| } | |||
| if (couponOrder != null) { | |||
| wxCouponOrderService.sendInsideCouponVerifyMsg(couponOrder, couponOrderId, wxMerchantBUser.getId()); | |||
| if (couponOrder != null && couponOrder.getMerchantId() != null) { | |||
| wxCouponOrderService.sendInsideCouponVerifyMsg(couponOrder, couponOrderId, couponOrder.getMerchantId()); | |||
| } | |||
| return new ResultData(couponOrder); | |||
| } | |||
| @ApiOperation(value = "根据couponOrderId查询接口", notes = "{\"couponOrderId\":\"string\"}") | |||
| @PostMapping("/findById") | |||
| public ResultData findById(@RequestBody Map<String, String> paramMap) { | |||
| @@ -353,4 +385,52 @@ public class WxCouponOrderController extends BaseController { | |||
| return new ResultData(); | |||
| } | |||
| @ApiOperation(value = "商品发货", notes = "{\"id\":\"string\", \"deliveryInfo\":\"jsonString\"}") | |||
| @PostMapping("/sendGoods") | |||
| public ResultData sendGoods(@RequestBody WxCouponOrder wxCouponOrder) { | |||
| logger.debug("[" + getIpAddr() + "] WxCouponPasswordController::postpone"); | |||
| if (wxCouponOrder == null || wxCouponOrder.getId() == null) { | |||
| logger.error("id不能为空: "); | |||
| return new ResultData(ErrorCode.SYS_PARAMETER_NOT_NULL); | |||
| } | |||
| try { | |||
| WxCouponOrder couponOrder = wxCouponOrderService.getById(wxCouponOrder.getId(), getTenantInfo().getTenantId()); | |||
| if(couponOrder==null){ | |||
| return new ResultData(ErrorCode.COUPON_ORDER_IS_NULL); | |||
| } | |||
| if(!EnumCouponOrderStatus.COUPON_ORDER_USE_WAIT.getCode().equals(couponOrder.getCouponOrderStatus())){ | |||
| return new ResultData(ErrorCode.COUPON_GOODS_STATUS_NOT_SUPPORTED); | |||
| } | |||
| WxCouponOrder updateCouponOrder = new WxCouponOrder(); | |||
| updateCouponOrder.setId(couponOrder.getId()); | |||
| if(EnumOrderShopingType.SELF_MENTION.getCode().equals(couponOrder.getShippingType())){ | |||
| updateCouponOrder.setShippingStatus(EnumOrderShopingStatus.READY_SELF_MENTION.getCode()); | |||
| }else if(EnumOrderShopingType.DISTRIBUTION.getCode().equals(couponOrder.getShippingType())){ | |||
| if(StringUtils.isBlank(wxCouponOrder.getDeliveryInfo())){ | |||
| return new ResultData(ErrorCode.COUPON_GOODS_DELIVERY_NULL); | |||
| } | |||
| try{ | |||
| JSONObject jsonObject = JSONObject.parseObject(wxCouponOrder.getDeliveryInfo()); | |||
| jsonObject.put("date",new SimpleDateFormat("yyyy-MM-dd HH:mm:ss").format(new Date())); | |||
| updateCouponOrder.setDeliveryInfo(JSONObject.toJSONString(jsonObject)); | |||
| }catch(Exception e){ | |||
| return new ResultData(ErrorCode.COUPON_GOODS_ADDRESS_ERROR); | |||
| } | |||
| updateCouponOrder.setShippingStatus(EnumOrderShopingStatus.WAIT_DISTRIBUTION.getCode()); | |||
| }else{ | |||
| return new ResultData(ErrorCode.COUPON_GOODS_TYPE_NOT_SUPPORTED); | |||
| } | |||
| updateCouponOrder.setUpdateDate(new Date()); | |||
| wxCouponOrderService.saveOrUpdate(updateCouponOrder); | |||
| } catch (Exception e) { | |||
| logger.error(e.getMessage()); | |||
| return new ResultData(ErrorCode.SYS_SERVER_ERROR); | |||
| } | |||
| return new ResultData(); | |||
| } | |||
| } | |||
| @@ -9,6 +9,8 @@ import com.iformall.domain.po.*; | |||
| import com.iformall.enums.*; | |||
| import com.iformall.exception.MallinkException; | |||
| import com.iformall.service.*; | |||
| import com.iformall.service.order.OrderFactory; | |||
| import com.iformall.service.order.entity.WxComposeOrder; | |||
| import com.iformall.utils.IPUtil; | |||
| import io.swagger.annotations.Api; | |||
| import io.swagger.annotations.ApiImplicitParam; | |||
| @@ -57,6 +59,9 @@ public class WxMicroPayController extends BaseController { | |||
| @Autowired | |||
| private WxCUserBasicInfoService wxCUserBasicInfoService; | |||
| @Autowired | |||
| OrderFactory orderFactory; | |||
| @ApiOperation(value = "付款码支付订单", notes = "params:{\"authCode\":\"String\",\"totalFee\":\"支付金额\"},\n" + | |||
| "注意:\n" + | |||
| @@ -103,7 +108,7 @@ public class WxMicroPayController extends BaseController { | |||
| WxPayOrder record = new WxPayOrder(); | |||
| record.updateTenantInfo(user); | |||
| record.setOrderId(order.getId()); | |||
| record.setOrderId(EnumComposeOrder.getPayOrderId(order)); | |||
| record.setAuthCode(authCode); | |||
| record.setPayAmount(order.getPayment()); | |||
| record.setIp(ipStr); | |||
| @@ -428,7 +433,8 @@ public class WxMicroPayController extends BaseController { | |||
| return new ResultData(ErrorCode.SYS_PARAMETER_NOT_NULL); | |||
| } | |||
| WxOrder microOrder = wxOrderService.getById(orderId,wxMerchantBUser.getTenantId()); | |||
| WxComposeOrder composeOrder = orderFactory.getOrderAdapterService(EnumComposeOrder.SINGLE.getCode()).getComposeOrder(orderId, wxMerchantBUser.getTenantId()); | |||
| WxOrder microOrder = composeOrder.getSingleOrder(); | |||
| if (microOrder == null) { | |||
| return new ResultData(ErrorCode.ORDER_IS_NOT_FIND); | |||
| } | |||
| @@ -449,7 +455,7 @@ public class WxMicroPayController extends BaseController { | |||
| Integer remainPrice = payPrice; | |||
| if (wxCouponOrder != null) { | |||
| try { | |||
| couponPayOrder = wxCouponOrderService.microPayPreVerify(microOrder, wxCouponOrder, wxMerchantBUser, payPrice,payWay,ipStr,authCode); | |||
| couponPayOrder = wxCouponOrderService.microPayPreVerify(composeOrder, wxCouponOrder, wxMerchantBUser, payPrice,payWay,ipStr,authCode); | |||
| //remainPrice = microOrder.getPayment() - couponPayOrder.getPayAmount(); | |||
| remainPrice = couponPayOrder.getPayAmount(); | |||
| // 更新实际支付金额 | |||
| @@ -35,6 +35,7 @@ public class TenantInfoImpl implements TenantInfo { | |||
| "wx_score_rules", | |||
| "wx_level_config", | |||
| "wx_c_user_basic_info", | |||
| "user_basic_info_address", | |||
| "wx_c_user_basic_child", | |||
| "wx_c_user_basic_sign", | |||
| "wx_credit_history", | |||
| @@ -50,6 +51,7 @@ public class TenantInfoImpl implements TenantInfo { | |||
| "wx_authorizer_info", | |||
| "wx_c_user", | |||
| "wx_c_user_basic_info", | |||
| "user_basic_info_address", | |||
| "wx_c_user_basic_child", | |||
| "wx_c_user_basic_sign", | |||
| "wx_c_user_car", | |||
| @@ -0,0 +1,119 @@ | |||
| package com.iformall.controller; | |||
| import com.github.pagehelper.PageInfo; | |||
| import com.iformall.common.ErrorCode; | |||
| import com.iformall.common.Result; | |||
| import com.iformall.common.ResultData; | |||
| import com.iformall.domain.po.UserBasicInfoAddress; | |||
| import com.iformall.service.UserBasicInfoAddressService; | |||
| import io.swagger.annotations.Api; | |||
| import io.swagger.annotations.ApiImplicitParam; | |||
| import io.swagger.annotations.ApiImplicitParams; | |||
| import io.swagger.annotations.ApiOperation; | |||
| import org.slf4j.Logger; | |||
| import org.slf4j.LoggerFactory; | |||
| import org.springframework.beans.factory.annotation.Autowired; | |||
| import org.springframework.web.bind.annotation.*; | |||
| @RestController | |||
| @RequestMapping("api/userBasicInfoAddress") | |||
| @Api(description = "会员地址相关接口") | |||
| public class UserBasicInfoAddressController extends BaseController { | |||
| private final Logger logger = LoggerFactory.getLogger(this.getClass()); | |||
| @Autowired | |||
| private UserBasicInfoAddressService userBasicInfoAddressService; | |||
| @ApiOperation("分页列表接口") | |||
| @GetMapping("list") | |||
| @ApiImplicitParams({ | |||
| @ApiImplicitParam(name = "pageNum", value = "页数", dataType = "int", paramType = "query", required = true), | |||
| @ApiImplicitParam(name = "pageSize", value = "每页条数", dataType = "int", paramType = "query", required = true)}) | |||
| public ResultData list(@ModelAttribute UserBasicInfoAddress userBasicInfoAddress, Integer pageNum, Integer pageSize) { | |||
| logger.debug("[" + getIpAddr() + "] UserBasicInfoAddressController::list"); | |||
| if (null == userBasicInfoAddress) { | |||
| userBasicInfoAddress = new UserBasicInfoAddress(); | |||
| } | |||
| Long memberId; | |||
| try { | |||
| memberId = getMemberId(); | |||
| } catch (Exception e) { | |||
| return new ResultData(Result.ERROR,e.getMessage()); | |||
| } | |||
| userBasicInfoAddress.setUserId(memberId); | |||
| userBasicInfoAddress.undateFinalTenantId(getTenantInfo()); | |||
| PageInfo<UserBasicInfoAddress> page = userBasicInfoAddressService.listAsPage(userBasicInfoAddress, pageNum, pageSize); | |||
| return new ResultData(page); | |||
| } | |||
| @PostMapping("saveOrUpdate") | |||
| public ResultData saveOrUpdate(@RequestBody UserBasicInfoAddress userBasicInfoAddress) { | |||
| logger.debug("[" + getIpAddr() + "] userBasicInfoAddress::saveOrUpdate"); | |||
| if(userBasicInfoAddress == null){ | |||
| return new ResultData(ErrorCode.SYS_PARAMETER_NOT_NULL); | |||
| } | |||
| Long memberId; | |||
| try { | |||
| memberId = getMemberId(); | |||
| } catch (Exception e) { | |||
| return new ResultData(Result.ERROR,e.getMessage()); | |||
| } | |||
| userBasicInfoAddress.setUserId(memberId); | |||
| userBasicInfoAddress.undateFinalTenantId(getTenantInfo()); | |||
| userBasicInfoAddressService.saveOrUpdate(userBasicInfoAddress); | |||
| return new ResultData(); | |||
| } | |||
| @PostMapping("setUpDefault") | |||
| public ResultData setUpDefault(@RequestBody UserBasicInfoAddress userBasicInfoAddress) { | |||
| logger.debug("[" + getIpAddr() + "] userBasicInfoAddress::setUpDefault"); | |||
| if(userBasicInfoAddress == null){ | |||
| return new ResultData(ErrorCode.SYS_PARAMETER_NOT_NULL); | |||
| } | |||
| if(userBasicInfoAddress.getId() == null){ | |||
| return new ResultData(ErrorCode.SYS_PARAMETER_NOT_NULL.getCode(), "Id为空"); | |||
| } | |||
| Long memberId; | |||
| try { | |||
| memberId = getMemberId(); | |||
| } catch (Exception e) { | |||
| return new ResultData(Result.ERROR,e.getMessage()); | |||
| } | |||
| userBasicInfoAddress.setUserId(memberId); | |||
| userBasicInfoAddress.undateFinalTenantId(getTenantInfo()); | |||
| userBasicInfoAddressService.updateDefault(userBasicInfoAddress); | |||
| return new ResultData(); | |||
| } | |||
| @ApiOperation("删除") | |||
| @GetMapping("/del") | |||
| @ApiImplicitParam(name = "id", value = "id", dataType = "String", paramType = "query", required = true) | |||
| public ResultData delete(Long id) { | |||
| logger.debug("[" + getIpAddr() + "] userBasicInfoAddress::delete"); | |||
| if(id == null){ | |||
| return new ResultData(ErrorCode.SYS_PARAMETER_NOT_NULL.getCode(), "Id为空"); | |||
| } | |||
| UserBasicInfoAddress userBasicInfoAddress = new UserBasicInfoAddress(); | |||
| userBasicInfoAddress.setId(id); | |||
| userBasicInfoAddress.undateFinalTenantId(getTenantInfo()); | |||
| userBasicInfoAddressService.deleteById(userBasicInfoAddress); | |||
| return new ResultData(); | |||
| } | |||
| @ApiOperation("查询") | |||
| @GetMapping("/findById") | |||
| @ApiImplicitParam(name = "id", value = "id", dataType = "String", paramType = "query", required = true) | |||
| public ResultData findById(Long id) { | |||
| logger.debug("[" + getIpAddr() + "] userBasicInfoAddress::findById"); | |||
| if(id == null){ | |||
| return new ResultData(ErrorCode.SYS_PARAMETER_NOT_NULL.getCode(), "Id为空"); | |||
| } | |||
| UserBasicInfoAddress userBasicInfoAddress = new UserBasicInfoAddress(); | |||
| userBasicInfoAddress.setId(id); | |||
| userBasicInfoAddress.undateFinalTenantId(getTenantInfo()); | |||
| UserBasicInfoAddress userAddress = userBasicInfoAddressService.findById(userBasicInfoAddress); | |||
| return new ResultData(userAddress); | |||
| } | |||
| } | |||
| @@ -62,12 +62,16 @@ public class WxCouponController extends BaseController { | |||
| @ApiImplicitParam(name = "couponChannelId", value = "couponChannelId", dataType = "String", paramType = "query", required = true), | |||
| @ApiImplicitParam(name = "couponId", value = "couponId", dataType = "String", paramType = "query", required = false)}) | |||
| public ResultData detailC(String couponChannelId, String couponId) { | |||
| if (StringUtils.isBlank(couponChannelId) || couponChannelId.equalsIgnoreCase(Constant.UNDEFINED)) { | |||
| if ((StringUtils.isBlank(couponChannelId) || couponChannelId.equalsIgnoreCase(Constant.UNDEFINED)) | |||
| && (StringUtils.isBlank(couponId) || couponId.equalsIgnoreCase(Constant.UNDEFINED))) { | |||
| return new ResultData(ErrorCode.SYS_PARAMETER_NOT_NULL.getCode(), "couponChannelId/couponId为空"); | |||
| } | |||
| Long couponChannelIdL = 0L, couponIdL = 0L; | |||
| try { | |||
| couponChannelIdL = Long.valueOf(couponChannelId); | |||
| if (StringUtils.isNotBlank(couponChannelId) && !couponChannelId.equalsIgnoreCase(Constant.UNDEFINED)) { | |||
| couponChannelIdL = Long.valueOf(couponChannelId); | |||
| } | |||
| if (StringUtils.isNotBlank(couponId) && !couponId.equalsIgnoreCase(Constant.UNDEFINED)) { | |||
| couponIdL = Long.valueOf(couponId); | |||
| } | |||
| @@ -76,7 +80,14 @@ public class WxCouponController extends BaseController { | |||
| return new ResultData(ErrorCode.SYS_PARAMETER_NOT_NULL.getCode(), "couponChannelId转换失败" + couponChannelId); | |||
| } | |||
| String key = "cc:" + couponChannelId; | |||
| String key = "cc:"; | |||
| if(couponChannelIdL > 0){ | |||
| key = key + couponChannelIdL; | |||
| }else if(couponIdL > 0){ | |||
| key = key + couponIdL; | |||
| }else{ | |||
| return new ResultData(ErrorCode.SYS_PARAMETER_NOT_NULL.getCode(), "couponChannelId/couponId为空"); | |||
| } | |||
| ValueOperations<String, WxCouponCVo> operations = cdRedisTemplate.opsForValue(); | |||
| // 缓存 | |||
| @@ -112,7 +123,7 @@ public class WxCouponController extends BaseController { | |||
| //WxCouponCVo wxCouponCVo = wxCouponChannelService.findDetailVo(couponChannelIdL); | |||
| WxCouponCVo wxCouponCVo = null; | |||
| try { | |||
| wxCouponCVo = generateWxCouponCVoex(couponChannelIdL,getTenantInfo().getTenantId()); | |||
| wxCouponCVo = generateWxCouponCVoex(couponChannelIdL,couponIdL,getTenantInfo().getTenantId()); | |||
| } catch (IllegalAccessException e) { | |||
| logger.error("coupon detail fail,copyproperties error" + couponChannelId,e); | |||
| return new ResultData(ErrorCode.SYS_PARAMETER_NOT_NULL.getCode(), "coupon detail fail,copyproperties error" + couponChannelId); | |||
| @@ -138,12 +149,16 @@ public class WxCouponController extends BaseController { | |||
| @ApiImplicitParam(name = "couponChannelId", value = "couponChannelId", dataType = "String", paramType = "query", required = true), | |||
| @ApiImplicitParam(name = "couponId", value = "couponId", dataType = "String", paramType = "query", required = false)}) | |||
| public ResultData getHtml(String couponChannelId, String couponId) { | |||
| if (StringUtils.isBlank(couponChannelId) || couponChannelId.equalsIgnoreCase(Constant.UNDEFINED)) { | |||
| if (StringUtils.isBlank(couponChannelId) || couponChannelId.equalsIgnoreCase(Constant.UNDEFINED) | |||
| && (StringUtils.isBlank(couponId) || couponId.equalsIgnoreCase(Constant.UNDEFINED))) { | |||
| return new ResultData(ErrorCode.SYS_PARAMETER_NOT_NULL.getCode(), "couponChannelId/couponId为空"); | |||
| } | |||
| Long couponChannelIdL = 0L, couponIdL = 0L; | |||
| try { | |||
| couponChannelIdL = Long.valueOf(couponChannelId); | |||
| if (StringUtils.isNotBlank(couponChannelId) && !couponChannelId.equalsIgnoreCase(Constant.UNDEFINED)) { | |||
| couponChannelIdL = Long.valueOf(couponChannelId); | |||
| } | |||
| if (StringUtils.isNotBlank(couponId) && !couponId.equalsIgnoreCase(Constant.UNDEFINED)) { | |||
| couponIdL = Long.valueOf(couponId); | |||
| } | |||
| @@ -152,7 +167,14 @@ public class WxCouponController extends BaseController { | |||
| return new ResultData(ErrorCode.SYS_PARAMETER_NOT_NULL.getCode(), "couponChannelId转换失败" + couponChannelId); | |||
| } | |||
| String key = "ch:" + couponChannelId; | |||
| String key = "ch:"; | |||
| if(couponChannelIdL > 0){ | |||
| key = key + couponChannelIdL; | |||
| }else if(couponIdL > 0){ | |||
| key = key + couponIdL; | |||
| }else{ | |||
| return new ResultData(ErrorCode.SYS_PARAMETER_NOT_NULL.getCode(), "couponChannelId/couponId为空"); | |||
| } | |||
| ValueOperations<String, WxCouponCVo> operations = cdRedisTemplate.opsForValue(); | |||
| // 缓存 | |||
| @@ -199,49 +221,57 @@ public class WxCouponController extends BaseController { | |||
| } | |||
| private WxCouponCVo generateWxCouponCVoForHtml(Long couponChannelIdL, Long couponIdL,String tenantId) { | |||
| WxCouponChannel cc = wxCouponChannelService.getById(couponChannelIdL,tenantId); | |||
| if (cc == null) { | |||
| return null; | |||
| } | |||
| WxCoupon c = couponService.getHtmlById(cc.getCouponId(),cc.getTenantId()); | |||
| if (c == null) { | |||
| return null; | |||
| if(couponChannelIdL > 0l){ | |||
| WxCouponChannel cc = wxCouponChannelService.getById(couponChannelIdL,tenantId); | |||
| if(cc == null){ | |||
| return null; | |||
| } | |||
| WxCoupon c = couponService.getHtmlById(cc.getCouponId(),cc.getTenantId()); | |||
| if (c == null) { | |||
| return null; | |||
| } | |||
| WxCouponCVo couponCVo = new WxCouponCVo(); | |||
| couponCVo.setId(cc.getId()); | |||
| couponCVo.setCouponId(cc.getCouponId()); | |||
| couponCVo.setHtml(c.getHtml()); | |||
| return couponCVo; | |||
| }else if(couponIdL > 0l){ | |||
| WxCoupon c = couponService.getHtmlById(couponIdL,tenantId); | |||
| if (c == null) { | |||
| return null; | |||
| } | |||
| WxCouponCVo couponCVo = new WxCouponCVo(); | |||
| couponCVo.setCouponId(c.getId()); | |||
| couponCVo.setHtml(c.getHtml()); | |||
| return couponCVo; | |||
| } | |||
| return null; | |||
| WxCouponCVo couponCVo = new WxCouponCVo(); | |||
| couponCVo.setId(cc.getId()); | |||
| couponCVo.setCouponId(cc.getCouponId()); | |||
| couponCVo.setHtml(c.getHtml()); | |||
| return couponCVo; | |||
| } | |||
| private WxCouponCVo generateWxCouponCVoex(Long couponChannelIdL,String tenantId) throws IllegalAccessException, InvocationTargetException { | |||
| WxCouponChannel cc = wxCouponChannelService.getById(couponChannelIdL,tenantId); | |||
| if (cc == null) { | |||
| return null; | |||
| } | |||
| WxCoupon c = couponService.getById(cc.getCouponId(),cc.getTenantId()); | |||
| if (c == null) { | |||
| c = new WxCoupon(); | |||
| } | |||
| WxCouponCVo wxcv = new WxCouponCVo(); | |||
| BeanUtils.copyProperties(wxcv, c); | |||
| wxcv.setId(cc.getId()); | |||
| wxcv.setCouponId(cc.getCouponId()); | |||
| wxcv.setTargetAd(cc.getTargetAd()); | |||
| wxcv.setBeginTime(cc.getBeginTime()); | |||
| wxcv.setEndTime(cc.getEndTime()); | |||
| wxcv.setQrCode(cc.getQrCode()); | |||
| List<WxMerchantVo> chantlist = merchantService.findMerchantVoList(cc.getCouponId(),cc.getTenantId()); | |||
| if (null != chantlist && chantlist.size()>0) { | |||
| wxcv.setMerchantVoList(chantlist); | |||
| private WxCouponCVo generateWxCouponCVoex(Long couponChannelIdL,Long couponIdL,String tenantId) throws IllegalAccessException, InvocationTargetException { | |||
| if(couponChannelIdL > 0l){ | |||
| WxCouponChannel cc = wxCouponChannelService.getById(couponChannelIdL,tenantId); | |||
| if(cc == null){ | |||
| return null; | |||
| } | |||
| WxCouponCVo wxcv = couponService.getVoById(cc.getCouponId(),tenantId); | |||
| if(wxcv == null){ | |||
| return null; | |||
| } | |||
| wxcv.setId(cc.getId()); | |||
| wxcv.setCouponId(cc.getCouponId()); | |||
| wxcv.setTargetAd(cc.getTargetAd()); | |||
| wxcv.setBeginTime(cc.getBeginTime()); | |||
| wxcv.setEndTime(cc.getEndTime()); | |||
| wxcv.setQrCode(cc.getQrCode()); | |||
| return wxcv; | |||
| }else if(couponIdL > 0l){ | |||
| WxCouponCVo wxcv = couponService.getVoById(couponIdL,tenantId); | |||
| return wxcv; | |||
| } | |||
| return wxcv; | |||
| return null; | |||
| } | |||
| private void updateActivityStatus(WxCouponCVo wxCouponCVo) { | |||
| @@ -5,19 +5,14 @@ import com.iformall.annotation.RedisCache; | |||
| import com.iformall.common.ErrorCode; | |||
| import com.iformall.common.Result; | |||
| import com.iformall.common.ResultData; | |||
| import com.iformall.domain.po.WxCUser; | |||
| import com.iformall.domain.po.WxCUserBasicInfo; | |||
| import com.iformall.domain.po.WxCoupon; | |||
| import com.iformall.domain.po.*; | |||
| import com.iformall.domain.po.base.BaseEntity; | |||
| import com.iformall.domain.po.WxCouponOrder; | |||
| import com.iformall.domain.po.base.TenantEntity; | |||
| import com.iformall.domain.vo.WxCardCVo; | |||
| import com.iformall.domain.vo.WxCouponCVo; | |||
| import com.iformall.domain.vo.WxCouponOrderCVo; | |||
| import com.iformall.enums.EnumCouponChannelActivityStatus; | |||
| import com.iformall.enums.EnumCouponOrderStatus; | |||
| import com.iformall.enums.EnumCouponOrderValidStatus; | |||
| import com.iformall.enums.EnumCouponType; | |||
| import com.iformall.enums.*; | |||
| import com.iformall.exception.MallinkException; | |||
| import com.iformall.service.MemCouponFromDspService; | |||
| import com.iformall.service.WxCouponOrderService; | |||
| import com.iformall.service.WxCouponService; | |||
| @@ -47,6 +42,7 @@ public class WxCouponOrderController extends BaseController { | |||
| @Autowired | |||
| private WxCouponService wxCouponService; | |||
| @Autowired | |||
| private WxCouponOrderService wxCouponOrderService; | |||
| @@ -154,6 +150,7 @@ public class WxCouponOrderController extends BaseController { | |||
| wxCouponOrderCVo.setTitle(wxCouponCVo.getTitle()); | |||
| wxCouponOrderCVo.setSubTitle(wxCouponCVo.getSubTitle()); | |||
| wxCouponOrderCVo.setSalePrice(wxCouponCVo.getSalePrice()); | |||
| wxCouponOrderCVo.setFreightPrice(wxCouponCVo.getFreightPrice()); | |||
| wxCouponOrderCVo.setUsePrice(wxCouponCVo.getUsePrice()); | |||
| wxCouponOrderCVo.setPrice(wxCouponCVo.getPrice()); | |||
| @@ -408,4 +405,91 @@ public class WxCouponOrderController extends BaseController { | |||
| return new ResultData(); | |||
| } | |||
| @ApiOperation(value = "核销接口", notes = "{\"couponOrderId\":\"string\"}") | |||
| @PostMapping("verify") | |||
| public ResultData verify(@RequestBody Map<String, String> paramMap) { | |||
| logger.info("couponOrderController.verify:" + paramMap.toString()); | |||
| String couponOrderIdStr = paramMap.get("couponOrderId"); | |||
| if (StringUtils.isBlank(couponOrderIdStr)) { | |||
| logger.error("couponOrderId不能为空: " + paramMap.toString()); | |||
| return new ResultData(ErrorCode.SYS_PARAMETER_NOT_NULL); | |||
| } | |||
| Long couponOrderId = 0L; | |||
| try { | |||
| couponOrderId = Long.valueOf(couponOrderIdStr); | |||
| } catch (NumberFormatException e) { | |||
| couponOrderId = 0L; | |||
| logger.error("couponOrderId参数不正确: " + paramMap.toString()); | |||
| return new ResultData(ErrorCode.SYS_PARAMETER_NOT_NULL); | |||
| } | |||
| WxCouponOrderCVo wxCouponOrderCVo = wxCouponOrderService.detailCUserVo(couponOrderIdStr,getTenantInfo()); | |||
| if (wxCouponOrderCVo == null) | |||
| return new ResultData(ErrorCode.COUPON_ORDER_IS_NULL); | |||
| WxCUserBasicInfo member; | |||
| try { | |||
| member = getCacheMember(); | |||
| } catch (Exception e) { | |||
| return new ResultData(Result.ERROR,e.getMessage()); | |||
| } | |||
| Date now = new Date(); | |||
| if (wxCouponOrderCVo.getValidType().equals(EnumCouponValidType.BETWEEN_TWO_TIME.getCode())){ | |||
| // && !wxCouponOrderCVo.getType().equals(EnumCouponType.COUPON_PREORDER.getCode())) { | |||
| if(wxCouponOrderCVo.getType().equals(EnumCouponType.COUPON_PREORDER.getCode())){ | |||
| if (wxCouponOrderCVo.getPickStartDate().after(now)) { | |||
| logger.error("此券有效期未开始:" + couponOrderIdStr); | |||
| return new ResultData(ErrorCode.COUPON_ORDER_IS_EARLIER_THAN_VALIDDATE); | |||
| } | |||
| if (wxCouponOrderCVo.getPickEndDate().before(now)) { | |||
| logger.error("此券有效期已结束:" + couponOrderIdStr); | |||
| return new ResultData(ErrorCode.COUPON_ORDER_IS_LATER_THAN_VALIDDATE); | |||
| } | |||
| }else{ | |||
| if (wxCouponOrderCVo.getValidStartDate().after(now)) { | |||
| logger.error("此券有效期未开始:" + couponOrderIdStr); | |||
| return new ResultData(ErrorCode.COUPON_ORDER_IS_EARLIER_THAN_VALIDDATE); | |||
| } | |||
| if (wxCouponOrderCVo.getValidEndDate().before(now)) { | |||
| logger.error("此券有效期已结束:" + couponOrderIdStr); | |||
| return new ResultData(ErrorCode.COUPON_ORDER_IS_LATER_THAN_VALIDDATE); | |||
| } | |||
| } | |||
| } else { | |||
| if (wxCouponOrderCVo.getExpiredTime().before(now)) { | |||
| logger.error("此券已过期:" + couponOrderIdStr); | |||
| return new ResultData(ErrorCode.COUPON_IS_EXPIRED); | |||
| } | |||
| } | |||
| WxCouponOrder wxCouponOrder = wxCouponOrderService.getById(couponOrderId,getTenantInfo().getTenantId()); | |||
| if (wxCouponOrder == null) { | |||
| logger.error("券ID不存在:" + couponOrderId); | |||
| return new ResultData(ErrorCode.COUPON_ORDER_IS_NULL); | |||
| } | |||
| if(!member.getId().equals(wxCouponOrder.getCUserId())){ | |||
| logger.error("此券不属于此人:" + member.getId()); | |||
| return new ResultData(ErrorCode.SYS_PARAMETER_ERROR); | |||
| } | |||
| WxCouponOrder couponOrder = null; | |||
| try { | |||
| couponOrder = wxCouponOrderService.verify(wxCouponOrder,null,EnumCouponVerifyType.VERIFY_C); | |||
| } catch (MallinkException e) { | |||
| logger.error("核销异常: " + e.getMessage()); | |||
| return new ResultData(e.getErrorCode(), e.getMessage()); | |||
| } catch (Exception e) { | |||
| logger.error("核销异常: " + e.getMessage()); | |||
| return new ResultData(ErrorCode.VERIFY_ERROR, e.getMessage()); | |||
| } | |||
| if (couponOrder != null && couponOrder.getMerchantId() != null) { | |||
| wxCouponOrderService.sendInsideCouponVerifyMsg(couponOrder, couponOrderId, couponOrder.getMerchantId()); | |||
| } | |||
| return new ResultData(couponOrder); | |||
| } | |||
| } | |||
| @@ -7,6 +7,7 @@ import com.iformall.domain.po.*; | |||
| import com.iformall.enums.*; | |||
| import com.iformall.exception.MallinkException; | |||
| import com.iformall.service.*; | |||
| import com.iformall.service.order.OrderFactory; | |||
| import com.iformall.utils.Constant; | |||
| import io.swagger.annotations.Api; | |||
| import io.swagger.annotations.ApiOperation; | |||
| @@ -36,7 +37,7 @@ public class WxCouponPasswordController extends BaseController { | |||
| @Autowired | |||
| private WxCUserBasicInfoService userService; | |||
| @ApiOperation(value = "根据卡密领卡", notes = "{\"password\":\"String\",\"formId\":\"String\"}") | |||
| @PostMapping("getCouponOrderByPassword") | |||
| public ResultData getCouponOrderByPassword(@RequestBody Map<String, String> params) { | |||
| @@ -96,14 +97,16 @@ public class WxCouponPasswordController extends BaseController { | |||
| // 3. 领取free coupon | |||
| try { | |||
| WxOrder order = orderService.saveFreeOrderForCoupon(member, coupon, null, formId, couponPassword.getId(),payWay); | |||
| WxOrder order = orderService.saveFreeOrderForCoupon(false,null,member, coupon, 1, | |||
| null, formId, couponPassword.getId(),payWay, | |||
| EnumOrderShopingType.ONLINE_PURCHASE.getCode(),null); | |||
| } catch (MallinkException e) { | |||
| setCouponPasswordStatus(couponPassword, EnumCouponPasswordStatus.getEnum(pwdStatus)); | |||
| logger.error(e.getMessage(),e); | |||
| return new ResultData(e.getErrorCode(), e.getMessage()); | |||
| } catch (Exception e) { | |||
| setCouponPasswordStatus(couponPassword, EnumCouponPasswordStatus.getEnum(pwdStatus)); | |||
| logger.error(e.getMessage()); | |||
| logger.error(e.getMessage(),e); | |||
| return new ResultData(500, e.getMessage()); | |||
| } | |||
| return new ResultData(); | |||
| @@ -4,6 +4,7 @@ import com.github.pagehelper.PageInfo; | |||
| import com.iformall.common.ErrorCode; | |||
| import com.iformall.common.Result; | |||
| import com.iformall.common.ResultData; | |||
| import com.iformall.domain.dto.OrderComposeSaveDto; | |||
| import com.iformall.domain.dto.OrderSaveDto; | |||
| import com.iformall.domain.po.*; | |||
| import com.iformall.domain.po.base.BaseEntity; | |||
| @@ -31,7 +32,9 @@ import org.springframework.beans.factory.annotation.Qualifier; | |||
| import org.springframework.data.redis.core.RedisTemplate; | |||
| import org.springframework.web.bind.annotation.*; | |||
| import java.util.ArrayList; | |||
| import java.util.Date; | |||
| import java.util.List; | |||
| import java.util.Map; | |||
| @RestController | |||
| @@ -58,172 +61,63 @@ public class WxOrderController extends BaseController { | |||
| @Autowired | |||
| RedisLock redisLock; | |||
| //券包下单的逻辑和组合下单的逻辑差不错,但是库存走的是券包的库存,子订单的分账需要调用多次分账 | |||
| @ApiOperation(value = "券包下单,", notes = "[{\"signleOrder\":{\"couponChannelId\":\"String\",\"couponId\":\"String\",\"press\":\"String\",\"orderGroupId\":\"String\",\"formId\":\"String\"},\"count\":8},]") | |||
| @PostMapping("couponPackageSave") | |||
| public ResultData couponPackageSave(@RequestBody List<OrderComposeSaveDto> orderSaveDto) { | |||
| Long memberId; | |||
| try { | |||
| memberId = getMemberId(); | |||
| } catch (Exception e) { | |||
| return new ResultData(Result.ERROR,e.getMessage()); | |||
| } | |||
| return wxOrderService.composeSaveOrder(false,EnumComposeOrder.PACKAGECOUPON,orderSaveDto,memberId,EnumPayWay.PAY_WAY_WECHAT,getTenantInfo()); | |||
| } | |||
| @ApiOperation(value = "商品购物车组合下单", notes = "[{\"signleOrder\":{\"couponChannelId\":\"String\",\"couponId\":\"String\",\"press\":\"String\",\"orderGroupId\":\"String\",\"formId\":\"String\"},\"count\":8},]") | |||
| @PostMapping("goodsShopCartSave") | |||
| public ResultData goodsShopCart(@RequestBody List<OrderComposeSaveDto> orderSaveDto) { | |||
| Long memberId; | |||
| try { | |||
| memberId = getMemberId(); | |||
| } catch (Exception e) { | |||
| return new ResultData(Result.ERROR,e.getMessage()); | |||
| } | |||
| return wxOrderService.composeSaveOrder(true,EnumComposeOrder.MULITY_NUMBER_ORDER_BATCH,orderSaveDto,memberId,EnumPayWay.PAY_WAY_WECHAT,getTenantInfo()); | |||
| } | |||
| @ApiOperation(value = "下订单", notes = "{\"couponChannelId\":\"String\",\"couponId\":\"String\",\"press\":\"String\",\"orderGroupId\":\"String\",\"formId\":\"String\"}") | |||
| @ApiOperation(value = "券购物车组合下单", notes = "[{\"signleOrder\":{\"couponChannelId\":\"String\",\"couponId\":\"String\",\"press\":\"String\",\"orderGroupId\":\"String\",\"formId\":\"String\"},\"count\":8},]") | |||
| @PostMapping("couponShopCartSave") | |||
| public ResultData couponShopCartSave(@RequestBody List<OrderComposeSaveDto> orderSaveDto) { | |||
| Long memberId; | |||
| try { | |||
| memberId = getMemberId(); | |||
| } catch (Exception e) { | |||
| return new ResultData(Result.ERROR,e.getMessage()); | |||
| } | |||
| return wxOrderService.composeSaveOrder(false,EnumComposeOrder.ONE_NUMBER_ORDER_BATCH,orderSaveDto,memberId,EnumPayWay.PAY_WAY_WECHAT,getTenantInfo()); | |||
| } | |||
| @ApiOperation(value = "单个券单个订单,卡(分账导致无法批量下单)、拼团,砍价用", notes = "{\"couponChannelId\":\"String\",\"couponId\":\"String\",\"press\":\"String\",\"orderGroupId\":\"String\",\"formId\":\"String\"}") | |||
| @PostMapping("save") | |||
| public ResultData saveOrder(@RequestBody OrderSaveDto orderSaveDto) { | |||
| logger.info("save orderSaveDto:"+orderSaveDto); | |||
| Long memberId; | |||
| try { | |||
| memberId = getMemberId(); | |||
| } catch (Exception e) { | |||
| return new ResultData(Result.ERROR,e.getMessage()); | |||
| } | |||
| return wxOrderService.saveOrder(orderSaveDto,memberId,EnumPayWay.PAY_WAY_WECHAT,getTenantInfo()); | |||
| List<OrderComposeSaveDto> list = new ArrayList<>(); | |||
| OrderComposeSaveDto dto = new OrderComposeSaveDto(); | |||
| dto.setSignleOrder(orderSaveDto); | |||
| dto.setCount(1); | |||
| list.add(dto); | |||
| return wxOrderService.composeSaveOrder(false,EnumComposeOrder.SINGLE,list,memberId,EnumPayWay.PAY_WAY_WECHAT,getTenantInfo()); | |||
| } | |||
| // private ResultData saveOrder(OrderSaveDto orderSaveDto,Long cUserId,EnumPayWay payWay) { | |||
| // logger.info("OrderSave: " + orderSaveDto); | |||
| // if (orderSaveDto.getCouponChannelId() == null) { | |||
| // return new ResultData(ErrorCode.SYS_PARAMETER_NOT_NULL.getCode(), "couponChannelId不能为空"); | |||
| // } | |||
| // WxCouponChannel wxCouponChannel = wxCouponChannelService.getById(orderSaveDto.getCouponChannelId(),getTenantInfo().getTenantId()); | |||
| // if (wxCouponChannel == null) { | |||
| // logger.error("couponChannelId find error, " + orderSaveDto.getCouponChannelId()); | |||
| // return new ResultData(ErrorCode.COUPON_CHANNEL_IS_TAKE_OFF); | |||
| // } | |||
| // ResultData resultData = couponChannelCheck(orderSaveDto, wxCouponChannel); | |||
| // if (resultData != null) return resultData; | |||
| // | |||
| // WxCUserBasicInfo wxCUserBasicInfo = wxCUserBasicInfoService.getById(cUserId,getFinalTenantId()); | |||
| // if (wxCUserBasicInfo != null && wxCUserBasicInfo.getStatus().equals(EnumCUserBasicInfoStatus.LOCKED.getCode())) { | |||
| // logger.info("会员权益被锁定:cUserId:" + cUserId); | |||
| // return new ResultData(ErrorCode.MEMBER_IS_LOCKED); | |||
| // } | |||
| // | |||
| // WxCoupon coupon = wxCouponService.getById(wxCouponChannel.getCouponId(),wxCouponChannel.getTenantId()); | |||
| // if (null == coupon) { | |||
| // return new ResultData(ErrorCode.COUPON_IS_EMPTY); | |||
| // } | |||
| // if (coupon.getStatus().equals(EnumCouponStatus.COUPON_STATUS_TAKE_OFFF.getCode())) { | |||
| // return new ResultData(ErrorCode.COUPON_IS_TAKE_OFF); | |||
| // } | |||
| // //判断是否是拼团订单,如果是拼团订单,判断现在进行中的,和已完成的数量是否超出券的限制 | |||
| // if (coupon.getType().equals(EnumCouponType.COUPON_GROUP.getCode())) { | |||
| // int ordercount = wxOrderService.countUserCouponGroupOrder(cUserId,coupon.getId(),coupon.getTenantId()); | |||
| // if (ordercount>=coupon.getUseLimitQuantity()) { | |||
| // return new ResultData(ErrorCode.COUPON_IS_TAKE_OFF.getCode(),"您当前此券的有效拼团数量达到券的限购次数。"); | |||
| // } | |||
| // } | |||
| // | |||
| // WxCouponCVo wxCouponCVo = null; | |||
| // | |||
| // String key = "cc:" + orderSaveDto.getCouponChannelId(); | |||
| // ValueOperations<String, WxCouponCVo> operations = cdRedisTemplate.opsForValue(); | |||
| // // 缓存 | |||
| // boolean hasKey = cdRedisTemplate.hasKey(key); | |||
| // if (hasKey) { | |||
| // // 从缓存获取用户信息 | |||
| // wxCouponCVo = operations.get(key); | |||
| // } else { | |||
| // // 游戏没有入缓存,需要从数据库中读取 | |||
| // wxCouponCVo = wxCouponChannelService.findDetailVo(orderSaveDto.getCouponChannelId(),wxCouponChannel.getTenantId()); | |||
| // if (wxCouponCVo != null) { | |||
| // // 游戏优化,进缓存 | |||
| // cdRedisTemplate.opsForValue().set(key, wxCouponCVo, 3600, TimeUnit.SECONDS); | |||
| // } | |||
| // } | |||
| // if (wxCouponCVo == null) { | |||
| // return new ResultData(ErrorCode.COUPON_IS_EMPTY); | |||
| // } | |||
| // | |||
| // //此处判断是否存在绝对保证库存不超卖的缓存,如果没有,则把当前的库存设置为最大值。如果有,则是后台设置的时候保存的,以那个为准。 | |||
| // boolean hascache = redisLock.hasCouponStockCache(wxCouponCVo.getCouponId()); | |||
| // if (!hascache) { | |||
| // long time = System.currentTimeMillis() + RedisLock.TIMEOUT; | |||
| // String timeStr = String.valueOf(time); | |||
| // boolean stocksetlock = redisLock.lock("couponLockStockSetByOrder_"+coupon.getId(), timeStr); | |||
| // if (stocksetlock) { | |||
| // try { | |||
| // if (!redisLock.hasCouponStockCache(wxCouponCVo.getCouponId())) { | |||
| // redisLock.setCouponStock(wxCouponCVo.getCouponId(), coupon.getRemainInventory()); | |||
| // } | |||
| // }catch(Exception e) { | |||
| // logger.error("save order stock cache error.",e); | |||
| // }finally { | |||
| // redisLock.unlock("couponLockStockSetByOrder_"+coupon.getId(), timeStr); | |||
| // } | |||
| // }else { | |||
| // redisLock.unlock("couponLockStockSetByOrder_"+coupon.getId(), timeStr); | |||
| // } | |||
| // } | |||
| // | |||
| // resultData = couponUserCheck(wxCUserBasicInfo, wxCouponCVo); | |||
| // if (resultData != null) return resultData; | |||
| // | |||
| // Long couponId = orderSaveDto.getCouponId() == null ? wxCouponChannel.getCouponId() : orderSaveDto.getCouponId(); | |||
| // if (couponId == null) { | |||
| // logger.error("couponChannelId或者couponId不能为空"); | |||
| // return new ResultData(ErrorCode.SYS_PARAMETER_NOT_NULL.getCode(), "couponChannelId或者couponId不能为空"); | |||
| // } | |||
| // // 是否砍价 | |||
| // boolean isPress = orderSaveDto.getPress() != null ? orderSaveDto.getPress() : false; | |||
| // | |||
| // try { | |||
| // WxOrder order = wxOrderService.saveOrderForCoupon(wxCUserBasicInfo, coupon, orderSaveDto, isPress,payWay); | |||
| // return new ResultData(order); | |||
| // } catch (MallinkException e) { | |||
| // logger.error(e.getMessage()); | |||
| // return new ResultData(e.getErrorCode(), e.getMessage()); | |||
| // } catch (Exception e) { | |||
| // logger.error(e.getMessage()); | |||
| // return new ResultData(ErrorCode.ORDER_IS_FAIL, e.getMessage()); | |||
| // } | |||
| // } | |||
| // private ResultData couponUserCheck(WxCUserBasicInfo user, WxCouponCVo coupon) { | |||
| // if (coupon.getConditions() == null) return null; | |||
| // JSONObject jo = null; | |||
| // try { | |||
| // jo = JSONObject.parseObject(coupon.getConditions()); | |||
| // } catch (Exception e) { | |||
| // logger.error("购买券条件判断错误:ID=" + coupon.getId() + e.getMessage()); | |||
| // } | |||
| // if (jo != null) { | |||
| // if (jo.getIntValue("type") == EnumCouponConditionType.NEW_MEMBER.getCode()){ | |||
| // | |||
| // if (user != null && user.getActRecord() > 0) | |||
| // return new ResultData(ErrorCode.COUPON_ONLY_FOR_NEW_MEMBER); | |||
| // if (wxOrderService.countCouponConditionType1(coupon.getTenantId(),user.getId()) > 0) | |||
| // return new ResultData(ErrorCode.COUPON_ALREADY_IN_NEW_MEMBER); | |||
| // }else if (jo.getIntValue("type") == EnumCouponConditionType.SCORE_SCOPE.getCode()){ | |||
| // int max = jo.getIntValue("max"); | |||
| // int min = jo.getIntValue("min"); | |||
| // | |||
| // if (max!=0 && min ==0 && user.getPoins() > max) { | |||
| // return new ResultData(ErrorCode.COUPON_SCORE_NOT_IN_RANGE); | |||
| // } | |||
| // if (max==0 && min !=0 && user.getPoins() < min) { | |||
| // return new ResultData(ErrorCode.COUPON_SCORE_NOT_IN_RANGE); | |||
| // } | |||
| // if (max!=0 && min !=0 && (user.getPoins() < min || user.getPoins() > max)) { | |||
| // return new ResultData(ErrorCode.COUPON_SCORE_NOT_IN_RANGE); | |||
| // } | |||
| // } | |||
| // } | |||
| // | |||
| // return null; | |||
| // } | |||
| // private ResultData couponChannelCheck(@RequestBody OrderSaveDto orderSaveDto, WxCouponChannel wxCouponChannel) { | |||
| // if (wxCouponChannel.getTargetAd().equals(EnumCouponChannelType.COUPON_CHANNEL_ID_TIMED.getCode())) { | |||
| // Date now = new Date(); | |||
| // if (wxCouponChannel.getBeginTime().getTime() > now.getTime()) { | |||
| // logger.error("此券活动未开始:" + orderSaveDto.getCouponChannelId()); | |||
| // return new ResultData(ErrorCode.COUPON_CHANNEL_IS_NOT_STARTED); | |||
| // } | |||
| // if (wxCouponChannel.getEndTime().getTime() < now.getTime()) { | |||
| // logger.error("此券活动已结束:" + orderSaveDto.getCouponChannelId()); | |||
| // return new ResultData(ErrorCode.COUPON_CHANNEL_IS_END); | |||
| // } | |||
| // } | |||
| // | |||
| // if (wxCouponChannel.getStatus() == EnumCouponChannelStatus.STATUS_TAKE_OFFF.getCode()) { | |||
| // logger.error("此券已下架:" + orderSaveDto.getCouponChannelId()); | |||
| // return new ResultData(ErrorCode.COUPON_CHANNEL_IS_TAKE_OFF); | |||
| // } | |||
| // return null; | |||
| // } | |||
| @ApiOperation(value = "取消订单", notes = "{\"orderId\":\"string\"}") | |||
| @PostMapping("cancel") | |||
| public ResultData cancelOrder(@RequestBody Map<String, String> paramMap) { | |||
| @@ -267,7 +161,7 @@ public class WxOrderController extends BaseController { | |||
| orderId = Long.valueOf(orderIdStr); | |||
| } catch (NumberFormatException e) { | |||
| logger.error(e.getMessage()); | |||
| return new ResultData(ErrorCode.SYS_PARAMETER_NOT_NULL.getCode(), "退款订单ID转换失败"); | |||
| return new ResultData(ErrorCode.SYS_PARAMETER_NOT_NULL.getCode(), "退款订单ID转换失败:"+orderIdStr); | |||
| } | |||
| try { | |||
| WxOrder order = wxOrderService.getById(orderId,getTenantInfo().getTenantId()); | |||
| @@ -335,7 +229,7 @@ public class WxOrderController extends BaseController { | |||
| id = Long.valueOf(orderId); | |||
| } catch (NumberFormatException e) { | |||
| logger.error("parse orderId failed"); | |||
| return new ResultData(ErrorCode.SYS_PARAMETER_NOT_NULL.getCode(), "订单ID转换异常"); | |||
| return new ResultData(ErrorCode.SYS_PARAMETER_NOT_NULL.getCode(), "订单ID转换异常:"+orderId); | |||
| } | |||
| wxOrder.setId(id); | |||
| Long memberId; | |||
| @@ -377,6 +271,83 @@ public class WxOrderController extends BaseController { | |||
| return new ResultData(wxOrderCVo); | |||
| } | |||
| @ApiOperation("订单详情接口") | |||
| @GetMapping("detail_v1") | |||
| @ApiImplicitParams({ | |||
| @ApiImplicitParam(name = "orderId", value = "订单id", dataType = "String", paramType = "query", required = true) | |||
| }) | |||
| public ResultData detail_v1(String orderId) { | |||
| if (StringUtils.isBlank(orderId) || orderId.equalsIgnoreCase(Constant.UNDEFINED)) { | |||
| return new ResultData(ErrorCode.SYS_PARAMETER_NOT_NULL); | |||
| } | |||
| // c端用户应该只能看到自己的订单细节 | |||
| WxOrder wxOrder = new WxOrder(); | |||
| Long id = 0L; | |||
| try { | |||
| id = Long.valueOf(orderId); | |||
| } catch (NumberFormatException e) { | |||
| logger.error("parse orderId failed"); | |||
| return new ResultData(ErrorCode.SYS_PARAMETER_NOT_NULL.getCode(), "订单ID转换异常:"+orderId); | |||
| } | |||
| wxOrder.setId(id); | |||
| Long memberId; | |||
| try { | |||
| memberId = getMemberId(); | |||
| } catch (Exception e) { | |||
| return new ResultData(Result.ERROR,e.getMessage()); | |||
| } | |||
| wxOrder.setCUserId(memberId); | |||
| WxOrderCouponVo wxOrderCVo = wxOrderService.detailCUserVo(wxOrder); | |||
| if (wxOrderCVo == null){ | |||
| wxOrderCVo = new WxOrderCouponVo(); | |||
| wxOrderCVo.setLevel(1); | |||
| wxOrder.setComposeOrderId(wxOrder.getId()); | |||
| wxOrder.setId(null); | |||
| List<WxOrderCouponVo> wxOrders = wxOrderService.goodsDetailCUserVo(wxOrder); | |||
| if(wxOrders != null && wxOrders.size() > 0){ | |||
| wxOrderCVo.setOrderCouponVoList(wxOrders); | |||
| WxOrderCouponVo wxOrderCouponVo = wxOrders.get(0); | |||
| wxOrderCVo.setComposeOrderType(wxOrderCouponVo.getComposeOrderType()); | |||
| wxOrderCVo.setComposeOrderId(wxOrderCouponVo.getCouponOrderId()); | |||
| wxOrderCVo.setOrderStatus(wxOrderCouponVo.getOrderStatus()); | |||
| wxOrderCVo.setCreateDate(wxOrderCouponVo.getCreateDate()); | |||
| wxOrderCVo.setPayment(wxOrders.stream().mapToInt(o -> o.getPayment()).sum()); | |||
| }else{ | |||
| return new ResultData(ErrorCode.ORDER_IS_NOT_FIND); | |||
| } | |||
| }else{ | |||
| wxOrderCVo.setLevel(0); | |||
| Date now = new Date(); | |||
| if (wxOrderCVo.getValidStartDate() != null && wxOrderCVo.getValidEndDate() != null | |||
| && !wxOrderCVo.getType().equals(EnumCouponType.COUPON_PREORDER.getCode())) { | |||
| if (wxOrderCVo.getValidStartDate().getTime() > now.getTime()) { | |||
| wxOrderCVo.setValidStatus(EnumCouponOrderValidStatus.PREPARED.getCode()); | |||
| } else if (wxOrderCVo.getValidEndDate().getTime() < now.getTime()) { | |||
| wxOrderCVo.setValidStatus(EnumCouponOrderValidStatus.ENDED.getCode()); | |||
| } else { | |||
| wxOrderCVo.setValidStatus(EnumCouponChannelActivityStatus.STARTED.getCode()); | |||
| } | |||
| } | |||
| if(wxOrderCVo.getType().equals(EnumCouponType.COUPON_PREORDER.getCode()) | |||
| && wxOrderCVo.getPickStartDate() != null && wxOrderCVo.getPickEndDate() != null){ | |||
| // wxOrderCVo.setValidStartDate(wxOrderCVo.getPickStartDate()); | |||
| // wxOrderCVo.setValidEndDate(wxOrderCVo.getPickEndDate()); | |||
| if (wxOrderCVo.getPickStartDate().getTime() > now.getTime()) { | |||
| wxOrderCVo.setValidStatus(EnumCouponOrderValidStatus.PREPARED.getCode()); | |||
| } else if (wxOrderCVo.getPickEndDate().getTime() < now.getTime()) { | |||
| wxOrderCVo.setValidStatus(EnumCouponOrderValidStatus.ENDED.getCode()); | |||
| } else { | |||
| wxOrderCVo.setValidStatus(EnumCouponChannelActivityStatus.STARTED.getCode()); | |||
| } | |||
| } | |||
| } | |||
| return new ResultData(wxOrderCVo); | |||
| } | |||
| @ApiOperation(value = "根据orderId查询接口", notes = "{\"orderId\":\"string\"}") | |||
| @GetMapping("/findById") | |||
| @ApiImplicitParams({ | |||
| @@ -391,7 +362,7 @@ public class WxOrderController extends BaseController { | |||
| id = Long.valueOf(orderId); | |||
| } catch (NumberFormatException e) { | |||
| logger.error("parse orderId failed"); | |||
| return new ResultData(ErrorCode.SYS_PARAMETER_NOT_NULL.getCode(), "订单ID转换异常"); | |||
| return new ResultData(ErrorCode.SYS_PARAMETER_NOT_NULL.getCode(), "订单ID转换异常:"+orderId); | |||
| } | |||
| WxOrder order = null; | |||
| try { | |||
| @@ -421,7 +392,7 @@ public class WxOrderController extends BaseController { | |||
| id = Long.valueOf(couponId); | |||
| } catch (NumberFormatException e) { | |||
| logger.error("parse couponId failed"); | |||
| return new ResultData(ErrorCode.SYS_PARAMETER_NOT_NULL.getCode(), "券ID转换异常"); | |||
| return new ResultData(ErrorCode.SYS_PARAMETER_NOT_NULL.getCode(), "券ID转换异常:"+couponId); | |||
| } | |||
| WxCoupon wxCoupon = null; | |||
| try { | |||
| @@ -490,7 +461,7 @@ public class WxOrderController extends BaseController { | |||
| id = Long.valueOf(orderId); | |||
| } catch (NumberFormatException e) { | |||
| logger.error("parse orderId failed"); | |||
| return new ResultData(ErrorCode.SYS_PARAMETER_NOT_NULL.getCode(), "订单ID转换异常"); | |||
| return new ResultData(ErrorCode.SYS_PARAMETER_NOT_NULL.getCode(), "订单ID转换异常:"+orderId); | |||
| } | |||
| wxOrder.setId(id); | |||
| wxOrder.updateTenantInfo(getTenantInfo()); | |||
| @@ -507,5 +478,63 @@ public class WxOrderController extends BaseController { | |||
| } | |||
| } | |||
| @ApiOperation("购物车订单详情接口") | |||
| @GetMapping("goodsDetail") | |||
| @ApiImplicitParams({ | |||
| @ApiImplicitParam(name = "orderId", value = "订单id", dataType = "String", paramType = "query", required = true) | |||
| }) | |||
| public ResultData goodsDetail(String mainOrderId) { | |||
| if (StringUtils.isBlank(mainOrderId) || mainOrderId.equalsIgnoreCase(Constant.UNDEFINED)) { | |||
| return new ResultData(ErrorCode.SYS_PARAMETER_NOT_NULL); | |||
| } | |||
| // c端用户应该只能看到自己的订单细节 | |||
| WxOrder wxOrder = new WxOrder(); | |||
| Long composeOrderId = 0L; | |||
| try { | |||
| composeOrderId = Long.valueOf(mainOrderId); | |||
| } catch (NumberFormatException e) { | |||
| logger.error("parse composeOrderId failed"); | |||
| return new ResultData(ErrorCode.SYS_PARAMETER_NOT_NULL.getCode(), "订单ID转换异常:"+mainOrderId); | |||
| } | |||
| wxOrder.setComposeOrderId(composeOrderId); | |||
| Long memberId; | |||
| try { | |||
| memberId = getMemberId(); | |||
| } catch (Exception e) { | |||
| return new ResultData(Result.ERROR,e.getMessage()); | |||
| } | |||
| wxOrder.setCUserId(memberId); | |||
| List<WxOrderCouponVo> wxOrders = wxOrderService.goodsDetailCUserVo(wxOrder); | |||
| if (wxOrders == null) | |||
| return new ResultData(ErrorCode.ORDER_IS_NOT_FIND); | |||
| return new ResultData(wxOrders); | |||
| } | |||
| @ApiOperation("分页订单列表接口") | |||
| @GetMapping("listGoods") | |||
| @ApiImplicitParams({ | |||
| @ApiImplicitParam(name = "pageNum", value = "页数", dataType = "int", paramType = "query", required = true), | |||
| @ApiImplicitParam(name = "pageSize", value = "每页条数", dataType = "int", paramType = "query", required = true), | |||
| }) | |||
| public ResultData listGoods(@ModelAttribute WxOrder wxOrder, Integer pageNum, Integer pageSize) { | |||
| // c端用户应该只能看到自己的订单 | |||
| if (wxOrder == null){ | |||
| wxOrder = new WxOrder(); | |||
| } | |||
| Long memberId; | |||
| try { | |||
| memberId = getMemberId(); | |||
| } catch (Exception e) { | |||
| return new ResultData(Result.ERROR,e.getMessage()); | |||
| } | |||
| wxOrder.setCUserId(memberId); | |||
| wxOrder.setSortColumns(BaseEntity.SortField.UpdateDate_DESC); | |||
| final PageInfo<WxOrderCouponVo> page = wxOrderService.listGoodsCAsPage(wxOrder, pageNum, pageSize); | |||
| return new ResultData(page); | |||
| } | |||
| } | |||
| @@ -94,6 +94,7 @@ public class WxOrderGroupController extends BaseController { | |||
| @ApiImplicitParam(name = "id", value = "id", dataType = "Long", paramType = "query", required = true), | |||
| }) | |||
| public ResultData toOrderGroup(@RequestBody WxOrderGroup wxOrderGroup) { | |||
| logger.info("toOrderGroup "+wxOrderGroup); | |||
| if (wxOrderGroup.getId() == null) { | |||
| return new ResultData(ErrorCode.SYS_PARAMETER_NOT_NULL.getCode(), "id不能为空"); | |||
| } | |||
| @@ -24,10 +24,12 @@ import com.iformall.common.ResultData; | |||
| import com.iformall.domain.po.WxAppinfo; | |||
| import com.iformall.domain.po.WxCUser; | |||
| import com.iformall.domain.po.WxCUserBasicInfo; | |||
| import com.iformall.domain.po.WxBatchOrder; | |||
| import com.iformall.domain.po.WxCoupon; | |||
| import com.iformall.domain.po.WxOrder; | |||
| import com.iformall.domain.po.WxPayAccount; | |||
| import com.iformall.domain.po.WxPayOrder; | |||
| import com.iformall.enums.EnumComposeOrder; | |||
| import com.iformall.enums.EnumCreditLockedStatus; | |||
| import com.iformall.enums.EnumOrderStatus; | |||
| import com.iformall.enums.EnumPayStatus; | |||
| @@ -39,6 +41,8 @@ import com.iformall.service.WxCouponService; | |||
| import com.iformall.service.WxOrderService; | |||
| import com.iformall.service.WxPayAccountService; | |||
| import com.iformall.service.WxPayOrderService; | |||
| import com.iformall.service.order.OrderFactory; | |||
| import com.iformall.service.order.entity.WxComposeOrder; | |||
| import com.iformall.service.pay.entity.PayExtraParam; | |||
| import com.iformall.utils.IPUtil; | |||
| @@ -71,6 +75,9 @@ public class WxPayOrderController extends BaseController { | |||
| @Autowired | |||
| private WxAppinfoService wxAppinfoService; | |||
| @Autowired | |||
| OrderFactory orderFactory; | |||
| /** | |||
| * 微信支付 | |||
| * @param paramMap | |||
| @@ -87,17 +94,23 @@ public class WxPayOrderController extends BaseController { | |||
| logger.info("orderId不能为空: " + paramMap.toString()); | |||
| return new ResultData(ErrorCode.SYS_PARAMETER_NOT_NULL.getCode(), "orderId不能为空"); | |||
| } | |||
| String composeOrderType = paramMap.get("composeOrderType"); | |||
| if (StringUtils.isBlank(composeOrderType)) { | |||
| logger.info("composeOrderType不能为空: " + paramMap.toString()); | |||
| return new ResultData(ErrorCode.SYS_PARAMETER_NOT_NULL.getCode(), "composeOrderType不能为空"); | |||
| } | |||
| WxCUser user = getWxCUser(); | |||
| if (!user.basicInfoIs()) { | |||
| logger.error("暂未成为会员,请授权手机号"); | |||
| return new ResultData(ErrorCode.USER_IS_NOT_MEMBER.getCode(), "暂未成为会员,请授权手机号"); | |||
| } | |||
| return _create(orderIdStr,user.getUserId(),EnumPayWay.PAY_WAY_WECHAT,user.getAppId(),new PayExtraParam("openId",user.getOpenId()),request); | |||
| return _create(orderIdStr,composeOrderType,user.getUserId(),EnumPayWay.PAY_WAY_WECHAT,user.getAppId(),new PayExtraParam("openId",user.getOpenId()),request); | |||
| } | |||
| private ResultData _create(String orderIdStr,Long userId, EnumPayWay payWay,String appId,PayExtraParam parm,HttpServletRequest request) { | |||
| private ResultData _create(String orderIdStr,String composeOrderType,Long userId, EnumPayWay payWay,String appId,PayExtraParam parm,HttpServletRequest request) { | |||
| WxCUserBasicInfo wxCUserBasicInfo = wxCUserBasicInfoService.getById(userId,getFinalTenantId()); | |||
| if ( null == wxCUserBasicInfo) { | |||
| logger.error("会员用户不存在."+userId); | |||
| @@ -120,22 +133,23 @@ public class WxPayOrderController extends BaseController { | |||
| record.setOrderId(orderId); | |||
| try { | |||
| record.setIp(IPUtil.getIpAddr(request)); | |||
| record.setComposeOrder(Integer.parseInt(composeOrderType)); | |||
| return wxPayOrderService.createPayOrder(appInfo, wxCUserBasicInfo, record, payWay,parm); | |||
| } catch (MallinkException e) { | |||
| logger.error("payment wechat, order create error, req 2: " + record.toString() + ", e:" + e.getMessage()); | |||
| logger.error("payment wechat, order create error, req 2: " + record.toString() + ", e:" + e.getMessage(),e); | |||
| return new ResultData(e.getErrorCode(), e.getMessage()); | |||
| } catch (Exception e) { | |||
| logger.error("payment wechat, order create error, req 3: " + record.toString() + ", e:" + e.getMessage()); | |||
| logger.error("payment wechat, order create error, req 3: " + record.toString() + ", e:" + e.getMessage(),e); | |||
| return new ResultData(ErrorCode.PAY_ORDER_ERROR, e.getMessage()); | |||
| } | |||
| } | |||
| @ApiOperation(value = "更新支付订单状态", notes = "{\"payOrderId\":\"string\",\"orderId\":\"string\",\"status\":integer,\"reason\":\"string\"}") | |||
| @ApiOperation(value = "更新支付订单状态", notes = "{\"payOrderId\":\"string\",\"composeOrderId\":\"string\",\"status\":integer,\"reason\":\"string\"}") | |||
| @PostMapping("/updatePayOrder") | |||
| public ResultData updatePayOrder(@RequestBody Map<String, Object> paramMap) { | |||
| logger.info("/api/pay/updatePayOrder" + paramMap.toString()); | |||
| String payOrderIdStr = (String) paramMap.get("payOrderId"); | |||
| String orderIdStr = (String) paramMap.get("orderId"); | |||
| String orderIdStr = (String) paramMap.get("composeOrderId"); | |||
| String reasonStr = (String) paramMap.get("reason"); | |||
| Integer status = (Integer) paramMap.get("status"); | |||
| if (StringUtils.isBlank(orderIdStr)) { | |||
| @@ -185,31 +199,12 @@ public class WxPayOrderController extends BaseController { | |||
| if (null == payOrder) { | |||
| return new ResultData(ErrorCode.PAY_ORDER_ERROR, "未查询到payOrder."); | |||
| } | |||
| WxOrder order = wxOrderService.getById(orderId,payOrder.getTenantId()); | |||
| if (null == order) { | |||
| return new ResultData(ErrorCode.PAY_ORDER_ERROR, "未查询到Order["+orderId+"]."); | |||
| } | |||
| WxCoupon wxCoupon = wxCouponService.getById(order.getProductId(),order.getTenantId()); | |||
| if (null == wxCoupon) { | |||
| return new ResultData(ErrorCode.PAY_ORDER_ERROR, "未查询到优惠券[orderId:"+orderId+"]."); | |||
| } | |||
| //拼团的订单,如果查询到是拼团待付款的,则重新查询是否已经真的支付,其他的直接返回订单信息 | |||
| if (wxPayOrderService.isOrderGroupCoupon(payOrder, wxCoupon)) { | |||
| if (!order.getOrderStatus().equals(EnumOrderStatus.ORDER_STATUS_COOPERATING_UNPAID.getCode())) { | |||
| return new ResultData(Result.SUCCESS, "支付状态更新成功", order); | |||
| } | |||
| }else { | |||
| //非拼团的订单,支付成功,关闭订单,撤销支付订单,支付转退款的,直接返回订单信息,其他需要查询真实支付状态 | |||
| if (payOrder.getPayOrderStatus().equals(EnumPayStatus.PAY_STATUS_SUCCESS.getCode())|| | |||
| payOrder.getPayOrderStatus().equals(EnumPayStatus.PAY_STATUS_CLOSE.getCode())|| | |||
| payOrder.getPayOrderStatus().equals(EnumPayStatus.PAY_STATUS_REVERSE.getCode())|| | |||
| payOrder.getPayOrderStatus().equals(EnumPayStatus.PAY_STATUS_REFUND.getCode())) { | |||
| return new ResultData(Result.SUCCESS, "支付状态更新成功", order); | |||
| } | |||
| } | |||
| WxComposeOrder composeOrder = orderFactory.getOrderAdapterService(payOrder.getComposeOrder()).getComposeOrder(payOrder.getOrderId(), payOrder.getTenantId()); | |||
| //查询微信订单状态并更新 | |||
| check(composeOrder,payOrder); | |||
| WxAppinfo appInfo = wxAppinfoService.getCAppInfo(payOrder, EnumPayWay.getEnum(payOrder.getPayVendor())); | |||
| //WxCUser user = getUser(); | |||
| //WxAppinfo appInfo = getAppInfo(user.getAppId()); | |||
| @@ -218,13 +213,13 @@ public class WxPayOrderController extends BaseController { | |||
| } | |||
| WxPayAccount payAccount = wxPayAccountService.getById(appInfo.getPayId()); | |||
| try { | |||
| WxPayOrder wo = wxPayOrderService.handleWxOrderQuery(payOrder, order, appInfo, payAccount, IdWorker.get(),false); | |||
| WxPayOrder wo = wxPayOrderService.handleWxOrderQuery(payOrder, composeOrder,appInfo, payAccount, IdWorker.get(),false); | |||
| if (null != wo) { | |||
| return new ResultData(Result.SUCCESS, "支付状态更新成功", order); | |||
| return new ResultData(Result.SUCCESS, "支付状态更新成功", composeOrder); | |||
| } | |||
| }catch(MallinkException e) { | |||
| //已经同步了微信的支付状态,表示已经更新 | |||
| return new ResultData(Result.SUCCESS, "支付状态更新成功", order); | |||
| return new ResultData(Result.SUCCESS, "支付状态更新成功", composeOrder); | |||
| } | |||
| return new ResultData(ErrorCode.PAY_ORDER_ERROR, "查询微信订单支付状态失败,请稍后!"); | |||
| @@ -234,14 +229,49 @@ public class WxPayOrderController extends BaseController { | |||
| } | |||
| return new ResultData(Result.SUCCESS, "支付状态更新成功"); | |||
| } catch (MallinkException e) { | |||
| logger.error("支付状态更新失败2: " + payOrder.toString() + ", e:" + e.getMessage()); | |||
| logger.error("支付状态更新失败2: " + payOrder.toString() + ", e:" + e.getMessage(),e); | |||
| return new ResultData(e.getErrorCode(), e.getMessage()); | |||
| } catch (Exception e) { | |||
| logger.error("支付状态更新失败3: " + payOrder.toString() + ", e:" + e.getMessage()); | |||
| logger.error("支付状态更新失败3: " + payOrder.toString() + ", e:" + e.getMessage(),e); | |||
| return new ResultData(ErrorCode.PAY_ORDER_ERROR, "支付状态更新失败3: " + payOrder.toString() + ", e:" + e.getMessage()); | |||
| } | |||
| } | |||
| private boolean check(WxComposeOrder composeOrder,WxPayOrder payOrder) { | |||
| if (EnumComposeOrder.isSingle(composeOrder.getComposeOrderType())) { | |||
| WxOrder order = composeOrder.getSingleOrder(); | |||
| if (null == order) { | |||
| throw new MallinkException(ErrorCode.PAY_ORDER_ERROR.getCode(), "未查询到Order["+payOrder.getOrderId()+"]."); | |||
| } | |||
| WxCoupon wxCoupon = wxCouponService.getById(order.getProductId(),order.getTenantId()); | |||
| if (null == wxCoupon) { | |||
| throw new MallinkException(ErrorCode.PAY_ORDER_ERROR.getCode(), "未查询到优惠券[orderId:"+payOrder.getOrderId()+"]."); | |||
| } | |||
| //拼团的订单,如果查询到是拼团待付款的,则重新查询是否已经真的支付,其他的直接返回订单信息 | |||
| if (wxPayOrderService.isOrderGroupCoupon(payOrder, wxCoupon)) { | |||
| if (!order.getOrderStatus().equals(EnumOrderStatus.ORDER_STATUS_COOPERATING_UNPAID.getCode())) { | |||
| return true; | |||
| } | |||
| }else { | |||
| //非拼团的订单,支付成功,关闭订单,撤销支付订单,支付转退款的,直接返回订单信息,其他需要查询真实支付状态 | |||
| if (payOrder.getPayOrderStatus().equals(EnumPayStatus.PAY_STATUS_SUCCESS.getCode())|| | |||
| payOrder.getPayOrderStatus().equals(EnumPayStatus.PAY_STATUS_CLOSE.getCode())|| | |||
| payOrder.getPayOrderStatus().equals(EnumPayStatus.PAY_STATUS_REVERSE.getCode())|| | |||
| payOrder.getPayOrderStatus().equals(EnumPayStatus.PAY_STATUS_REFUND.getCode())) { | |||
| return true; | |||
| } | |||
| } | |||
| }else { | |||
| if (payOrder.getPayOrderStatus().equals(EnumPayStatus.PAY_STATUS_SUCCESS.getCode())|| | |||
| payOrder.getPayOrderStatus().equals(EnumPayStatus.PAY_STATUS_CLOSE.getCode())|| | |||
| payOrder.getPayOrderStatus().equals(EnumPayStatus.PAY_STATUS_REVERSE.getCode())|| | |||
| payOrder.getPayOrderStatus().equals(EnumPayStatus.PAY_STATUS_REFUND.getCode())) { | |||
| return true; | |||
| } | |||
| } | |||
| return false; | |||
| } | |||
| @ApiOperation("分页列表接口") | |||
| @GetMapping("/list") | |||
| @ApiImplicitParams({ | |||
| @@ -223,6 +223,7 @@ public class WxPressOrderController extends BaseController { | |||
| orderUpdatePress.updateTenantInfo(order); | |||
| // 保存订单 | |||
| wxOrderService.saveOrUpdate(orderUpdatePress); | |||
| // 发送砍价成功消息 | |||
| if(index.equals(wxCouponCVo.getPressLimitNum())) { | |||
| wxOrderPressService.sendPressComplateMsg(orderUpdatePress); | |||
| @@ -2,6 +2,7 @@ package com.iformall.controller; | |||
| import com.github.pagehelper.PageInfo; | |||
| import com.iformall.common.ErrorCode; | |||
| import com.iformall.common.Result; | |||
| import com.iformall.common.ResultData; | |||
| import com.iformall.domain.po.WxCUserBasicInfo; | |||
| import com.iformall.domain.po.WxQuestionOneself; | |||
| @@ -79,11 +80,17 @@ public class WxQuestionOneselfController extends BaseController { | |||
| public ResultData detailsById(Long id) { | |||
| logger.debug("[" + getIpAddr() + "] WxQuestionOneselfController::detailsById"); | |||
| Map<String,Object> map = new HashMap(); | |||
| Long memberId; | |||
| try { | |||
| memberId = getMemberId(); | |||
| } catch (Exception e) { | |||
| return new ResultData(Result.ERROR,e.getMessage()); | |||
| } | |||
| WxQuestionOneself wxQuestionOneself = wxQuestionOneselfService.detailsById(id); | |||
| if(wxQuestionOneself != null){ | |||
| WxQuestionOneselfUser userQ = new WxQuestionOneselfUser(); | |||
| userQ.updateTenantInfo(getTenantInfo()); | |||
| userQ.setUserId(getMemberId()); | |||
| userQ.setUserId(memberId); | |||
| userQ.setQuestionId(wxQuestionOneself.getId()); | |||
| wxQuestionOneself.setUserStatus(wxQuestionOneselfUserService.countQuestion(userQ)); | |||
| @@ -742,6 +742,8 @@ public class WxUserGrantController extends BaseController { | |||
| userVo.setName(wxCUserBasicInfo.getName()); | |||
| userVo.setBirthdate(wxCUserBasicInfo.getBirthdate()); | |||
| userVo.setSex(wxCUserBasicInfo.getSex()); | |||
| userVo.setHeight(wxCUserBasicInfo.getHeight()); | |||
| userVo.setWeight(wxCUserBasicInfo.getWeight()); | |||
| userVo.setAddress(wxCUserBasicInfo.getAddress()); | |||
| userVo.setStatus(wxCUserBasicInfo.getStatus()); | |||
| userVo.setChildrenList(wxCUserBasicInfo.getChildrenList()); | |||
| @@ -894,6 +896,8 @@ public class WxUserGrantController extends BaseController { | |||
| record.setAvatarUrl(wxCUserBasicInfo.getAvatarUrl()); | |||
| record.setBirthdate(wxCUserBasicInfo.getBirthdate()); | |||
| record.setSex(wxCUserBasicInfo.getSex()); | |||
| record.setWeight(wxCUserBasicInfo.getWeight()); | |||
| record.setHeight(wxCUserBasicInfo.getHeight()); | |||
| record.setAddress(wxCUserBasicInfo.getAddress()); | |||
| record.setUpdateDate(new Date()); | |||
| record.setFinalTenantId(tenantEntity.getFinalTenantId()); | |||
| @@ -118,6 +118,6 @@ public class RequestInterceptor extends HandlerInterceptorAdapter { | |||
| @Override | |||
| public void afterCompletion(HttpServletRequest request, HttpServletResponse response, Object handler, Exception ex) throws Exception { | |||
| logger.debug("afterCompletion"); | |||
| logger.debug("afterCompletion:"); | |||
| } | |||
| } | |||
| @@ -0,0 +1,71 @@ | |||
| package com.iformall.interceptor; | |||
| import java.io.BufferedReader; | |||
| import java.io.IOException; | |||
| import javax.servlet.http.HttpServletRequest; | |||
| import org.aspectj.lang.ProceedingJoinPoint; | |||
| import org.aspectj.lang.annotation.Around; | |||
| import org.aspectj.lang.annotation.Aspect; | |||
| import org.aspectj.lang.annotation.Pointcut; | |||
| import org.springframework.context.annotation.Configuration; | |||
| import org.springframework.web.context.request.RequestAttributes; | |||
| import org.springframework.web.context.request.RequestContextHolder; | |||
| import org.springframework.web.context.request.ServletRequestAttributes; | |||
| import com.alibaba.fastjson.JSON; | |||
| import lombok.extern.slf4j.Slf4j; | |||
| /** | |||
| * 测试所有controler请求返回信息输出 | |||
| * @author alascor | |||
| * | |||
| */ | |||
| //@Aspect | |||
| //@Configuration | |||
| @Slf4j | |||
| public class TestControllerReturnAspect { | |||
| //@Pointcut("execution(* com.iformall.controller.*Controller.*(..))") | |||
| public void excudeService() { | |||
| } | |||
| //@Around("excudeService()") | |||
| public Object doAround(ProceedingJoinPoint pjp) throws Throwable { | |||
| RequestAttributes ra = RequestContextHolder.getRequestAttributes(); | |||
| ServletRequestAttributes sra = (ServletRequestAttributes) ra; | |||
| HttpServletRequest request = sra.getRequest(); | |||
| String method = request.getMethod(); | |||
| String uri = request.getRequestURI(); | |||
| String paraString = JSON.toJSONString(request.getParameterMap()); | |||
| String requestBody = getBodyRequest(request); | |||
| //log.info("***************************************************"); | |||
| //log.info("请求开始, URI: {}, method: {}, params: {}", uri, method, paraString); | |||
| // result的值就是被拦截方法的返回值 | |||
| Object result = pjp.proceed(); | |||
| log.info("开发调试请求结果日志,生产请关闭!!!!>>>>>>>>请求结束,URI: {}, method: {}, params: {},requestBody:{}. 返回值:{} " ,uri, method, paraString,requestBody, JSON.toJSONString(result)); | |||
| return result; | |||
| } | |||
| private String getBodyRequest(HttpServletRequest request) throws IOException { | |||
| // 直接从HttpServletRequest的Reader流中获取RequestBody | |||
| BufferedReader reader = request.getReader(); | |||
| StringBuilder builder = new StringBuilder(); | |||
| String line = reader.readLine(); | |||
| while(line != null){ | |||
| builder.append(line); | |||
| line = reader.readLine(); | |||
| } | |||
| reader.close(); | |||
| String reqBody = builder.toString(); | |||
| return reqBody; | |||
| } | |||
| } | |||
| @@ -35,6 +35,7 @@ public class TenantInfoImpl implements TenantInfo { | |||
| "wx_score_rules", | |||
| "wx_level_config", | |||
| "wx_c_user_basic_info", | |||
| "user_basic_info_address", | |||
| "wx_c_user_basic_child", | |||
| "wx_c_user_basic_sign", | |||
| "wx_credit_history", | |||
| @@ -56,6 +57,7 @@ public class TenantInfoImpl implements TenantInfo { | |||
| "wx_authorizer_info", | |||
| "wx_c_user", | |||
| "wx_c_user_basic_info", | |||
| "user_basic_info_address", | |||
| "wx_c_user_basic_child", | |||
| "wx_c_user_basic_sign", | |||
| "wx_c_user_car", | |||
| @@ -7,6 +7,7 @@ import org.springframework.beans.factory.annotation.Value; | |||
| import org.springframework.boot.SpringApplication; | |||
| import org.springframework.boot.autoconfigure.SpringBootApplication; | |||
| import org.springframework.context.annotation.Bean; | |||
| import org.springframework.context.annotation.EnableAspectJAutoProxy; | |||
| import org.springframework.scheduling.annotation.EnableAsync; | |||
| import springfox.documentation.swagger2.annotations.EnableSwagger2; | |||
| @@ -20,6 +21,7 @@ import springfox.documentation.swagger2.annotations.EnableSwagger2; | |||
| @EnableEncryptableProperties | |||
| @EnableAsync | |||
| @EnableRocketMQ | |||
| @EnableAspectJAutoProxy(exposeProxy = true) | |||
| public class CallbackApplication { | |||
| @Value("${fm.exception}") | |||
| @@ -9,6 +9,7 @@ import com.iformall.service.*; | |||
| import com.iformall.service.pay.alipay.AliPayUtil; | |||
| import com.iformall.service.pay.alipay.api.enums.EnumMemberCardConfig; | |||
| import com.iformall.service.pay.alipay.api.result.UserAuthData; | |||
| import com.iformall.utils.AlipayMsgPage; | |||
| import org.apache.commons.lang3.StringUtils; | |||
| import org.slf4j.Logger; | |||
| @@ -58,8 +59,9 @@ public class AliPayController extends BaseController { | |||
| private void writeResponse(HttpServletResponse response,String msg) { | |||
| PrintWriter out; | |||
| try { | |||
| response.setContentType("text/html"); | |||
| out = response.getWriter(); | |||
| out.print(msg); | |||
| out.print(AlipayMsgPage.getPageContent(msg)); | |||
| out.close(); | |||
| } catch (IOException e) { | |||
| logger.error(" alipayCallback writeResponse error.",e); | |||
| @@ -0,0 +1,140 @@ | |||
| package com.iformall.utils; | |||
| public class AlipayMsgPage { | |||
| public final static String page_content_pre = "<!DOCTYPE html>\r\n" + | |||
| "<html lang=\"en\">\r\n" + | |||
| "\r\n" + | |||
| "<head>\r\n" + | |||
| " <meta charset=\"UTF-8\">\r\n" + | |||
| " <meta name=\"viewport\" content=\"width=device-width, initial-scale=1.0\">\r\n" + | |||
| " <meta http-equiv=\"X-UA-Compatible\" content=\"ie=edge\">\r\n" + | |||
| "\r\n" + | |||
| "</head>\r\n" + | |||
| "\r\n" + | |||
| "<body>\r\n" + | |||
| " <div class=\"tisBox\">"; | |||
| public final static String page_content_end = "</div>\r\n" + | |||
| "</body>\r\n" + | |||
| "\r\n" + | |||
| "</html>\r\n" + | |||
| "<style>\r\n" + | |||
| " @charset \"utf-8\";\r\n" + | |||
| " body,\r\n" + | |||
| " p,\r\n" + | |||
| " h1,\r\n" + | |||
| " h2,\r\n" + | |||
| " h3,\r\n" + | |||
| " h4,\r\n" + | |||
| " h5,\r\n" + | |||
| " h6,\r\n" + | |||
| " dl,\r\n" + | |||
| " ol,\r\n" + | |||
| " li,\r\n" + | |||
| " ul,\r\n" + | |||
| " dd,\r\n" + | |||
| " input,\r\n" + | |||
| " textarea,\r\n" + | |||
| " button {\r\n" + | |||
| " padding: 0;\r\n" + | |||
| " margin: 0;\r\n" + | |||
| " }\r\n" + | |||
| " \r\n" + | |||
| " html {\r\n" + | |||
| " font-size: calc(100vw/7.5);\r\n" + | |||
| " }\r\n" + | |||
| " \r\n" + | |||
| " body {\r\n" + | |||
| " font-size: .24rem;\r\n" + | |||
| " }\r\n" + | |||
| " \r\n" + | |||
| " img {\r\n" + | |||
| " vertical-align: top;\r\n" + | |||
| " border: 0;\r\n" + | |||
| " }\r\n" + | |||
| " \r\n" + | |||
| " a {\r\n" + | |||
| " color: inherit;\r\n" + | |||
| " text-decoration: none;\r\n" + | |||
| " }\r\n" + | |||
| " \r\n" + | |||
| " li {\r\n" + | |||
| " list-style: none;\r\n" + | |||
| " }\r\n" + | |||
| " \r\n" + | |||
| " body {\r\n" + | |||
| " font-family: \"微软雅黑\", \"宋体\", Arial;\r\n" + | |||
| " font-size: 12px;\r\n" + | |||
| " color: #666;\r\n" + | |||
| " }\r\n" + | |||
| " \r\n" + | |||
| " input {\r\n" + | |||
| " color: inherit;\r\n" + | |||
| " font-size: inherit;\r\n" + | |||
| " font-family: inherit;\r\n" + | |||
| " }\r\n" + | |||
| " \r\n" + | |||
| " textarea {\r\n" + | |||
| " resize: none;\r\n" + | |||
| " }\r\n" + | |||
| " \r\n" + | |||
| " input:focus,\r\n" + | |||
| " button:focus,\r\n" + | |||
| " textarea:focus,\r\n" + | |||
| " select:focus {\r\n" + | |||
| " outline: none;\r\n" + | |||
| " }\r\n" + | |||
| " /*input,button,textarea,select{\r\n" + | |||
| " outline: none;\r\n" + | |||
| "}*/\r\n" + | |||
| " \r\n" + | |||
| " input[type=\"button\"],\r\n" + | |||
| " input[type=\"reset\"],\r\n" + | |||
| " input[type=\"submit\"] {\r\n" + | |||
| " cursor: pointer;\r\n" + | |||
| " }\r\n" + | |||
| " \r\n" + | |||
| " a:hover {\r\n" + | |||
| " color: #53cac3 !important;\r\n" + | |||
| " }\r\n" + | |||
| " \r\n" + | |||
| " .sl {\r\n" + | |||
| " white-space: nowrap;\r\n" + | |||
| " overflow: hidden;\r\n" + | |||
| " text-overflow: ellipsis;\r\n" + | |||
| " }\r\n" + | |||
| " \r\n" + | |||
| " .w {\r\n" + | |||
| " width: 1170px;\r\n" + | |||
| " margin-left: auto;\r\n" + | |||
| " margin-right: auto;\r\n" + | |||
| " }\r\n" + | |||
| " \r\n" + | |||
| " .cl:after {\r\n" + | |||
| " content: \"\";\r\n" + | |||
| " display: block;\r\n" + | |||
| " clear: both;\r\n" + | |||
| " height: 0;\r\n" + | |||
| " overflow: hidden;\r\n" + | |||
| " visibility: hidden;\r\n" + | |||
| " }\r\n" + | |||
| " \r\n" + | |||
| " .cl {\r\n" + | |||
| " zoom: 1;\r\n" + | |||
| " }\r\n" + | |||
| " \r\n" + | |||
| " .tisBox {\r\n" + | |||
| " position: fixed;\r\n" + | |||
| " top: 30%;\r\n" + | |||
| " left: 40%;\r\n" + | |||
| " padding: 0.2rem;\r\n" + | |||
| " border-radius: 0.12rem;\r\n" + | |||
| " background-color: #409eff;\r\n" + | |||
| " color: #fff;\r\n" + | |||
| " }\r\n" + | |||
| "</style>"; | |||
| public static String getPageContent(String msg) { | |||
| return page_content_pre+msg+page_content_end; | |||
| } | |||
| } | |||
| @@ -1,18 +1,15 @@ | |||
| package com.iformall; | |||
| import com.iformall.domain.po.msg.FmInsideCouponVerifyMsg; | |||
| import com.iformall.enums.EnumMsgRecordType; | |||
| import com.iformall.service.msg.impl.FmInsideCouponVerifyMsgServiceImpl; | |||
| import com.ulisesbocchio.jasyptspringboot.annotation.EnableEncryptableProperties; | |||
| import org.mybatis.spring.annotation.MapperScan; | |||
| import org.rocketmq.starter.annotation.EnableRocketMQ; | |||
| import org.springframework.beans.BeansException; | |||
| import org.springframework.beans.factory.annotation.Autowired; | |||
| import org.springframework.beans.factory.annotation.Value; | |||
| import org.springframework.boot.SpringApplication; | |||
| import org.springframework.boot.autoconfigure.SpringBootApplication; | |||
| import org.springframework.context.ConfigurableApplicationContext; | |||
| import org.springframework.context.annotation.Bean; | |||
| import org.springframework.context.annotation.EnableAspectJAutoProxy; | |||
| import springfox.documentation.swagger2.annotations.EnableSwagger2; | |||
| /** | |||
| @@ -24,6 +21,7 @@ import springfox.documentation.swagger2.annotations.EnableSwagger2; | |||
| @EnableSwagger2 | |||
| @EnableRocketMQ | |||
| @EnableEncryptableProperties | |||
| @EnableAspectJAutoProxy(exposeProxy = true) | |||
| public class ConsumerApplication { | |||
| @Value("${fm.exception}") | |||
| @@ -35,6 +35,7 @@ public class TenantInfoImpl implements TenantInfo { | |||
| "wx_score_rules", | |||
| "wx_level_config", | |||
| "wx_c_user_basic_info", | |||
| "user_basic_info_address", | |||
| "wx_c_user_basic_child", | |||
| "wx_c_user_basic_sign", | |||
| "wx_credit_history", | |||
| @@ -56,6 +57,7 @@ public class TenantInfoImpl implements TenantInfo { | |||
| "wx_authorizer_info", | |||
| "wx_c_user", | |||
| "wx_c_user_basic_info", | |||
| "user_basic_info_address", | |||
| "wx_c_user_basic_child", | |||
| "wx_c_user_basic_sign", | |||
| "wx_c_user_car", | |||
| @@ -7,6 +7,7 @@ import org.springframework.beans.factory.annotation.Value; | |||
| import org.springframework.boot.SpringApplication; | |||
| import org.springframework.boot.autoconfigure.SpringBootApplication; | |||
| import org.springframework.context.annotation.Bean; | |||
| import org.springframework.context.annotation.EnableAspectJAutoProxy; | |||
| /** | |||
| * @author Stormeye | |||
| @@ -16,6 +17,7 @@ import org.springframework.context.annotation.Bean; | |||
| @MapperScan(basePackages = {"com.iformall.mapper"}) | |||
| @EnableEncryptableProperties | |||
| @EnableRocketMQ | |||
| @EnableAspectJAutoProxy(exposeProxy = true) | |||
| public class PosApplication { | |||
| @Value("${fm.exception}") | |||
| @@ -2099,7 +2099,7 @@ public class PosServiceImpl implements PosService { | |||
| payOrder.setId(idWorker.nextId()); | |||
| payOrder.updateTenantInfo(merchantBUser); | |||
| payOrder.setCUserId(memId); | |||
| payOrder.setOrderId(order.getId()); | |||
| payOrder.setOrderId(EnumComposeOrder.getPayOrderId(order)); | |||
| payOrder.setCreateTime(curDate); | |||
| payOrder.setUpdateTime(curDate); | |||
| payOrder.setPayTimeStart(curDate); | |||
| @@ -2140,7 +2140,7 @@ public class PosServiceImpl implements PosService { | |||
| Long posPayOrderId, Integer neuPaymentAmount, Date neuPosPayOrderTime, String posPayOrderNo) { | |||
| // 1. insert into PayOrder | |||
| WxPayOrder payOrderQ = new WxPayOrder(); | |||
| payOrderQ.setOrderId(order.getId()); | |||
| payOrderQ.setOrderId(EnumComposeOrder.getPayOrderId(order)); | |||
| payOrderQ.updateTenantInfo(merchantBUser); | |||
| List<WxPayOrder> payOrderList = payOrderMapper.findList(payOrderQ); | |||
| WxPayOrder payOrder = null; | |||
| @@ -2153,7 +2153,7 @@ public class PosServiceImpl implements PosService { | |||
| payOrder.updateTenantInfo(merchantBUser); | |||
| payOrder.setCUserId(memId); | |||
| payOrder.setBUserId(merchantBUser.getId()); | |||
| payOrder.setOrderId(order.getId()); | |||
| payOrder.setOrderId(EnumComposeOrder.getPayOrderId(order)); | |||
| payOrder.setCreateTime(curDate); | |||
| payOrder.setUpdateTime(curDate); | |||
| payOrder.setPayTimeStart(curDate); | |||
| @@ -2186,6 +2186,7 @@ public class PosServiceImpl implements PosService { | |||
| updateCO.setId(couponOrderId); | |||
| updateCO.setCouponOrderStatus(EnumCouponOrderStatus.COUPON_ORDER_USED.getCode()); | |||
| updateCO.setPayVendor(EnumPayWay.PAY_WAY_POS_NEU.getCode()); | |||
| couponOrderMapper.updateById(updateCO); | |||
| } | |||
| WxCouponOrderCVo couponOrderCVo = couponOrderService.detailCUserVo(posPayOrderNo,merchantBUser); | |||
| @@ -2214,7 +2215,7 @@ public class PosServiceImpl implements PosService { | |||
| logger.error("交易核销积分异常:" + e.getMessage()); | |||
| } | |||
| // 3. 核销后处理 | |||
| couponOrderService.sendInsideCouponVerifyMsg(merchantBUser, couponOrderId, merchantBUser.getId()); | |||
| couponOrderService.sendInsideCouponVerifyMsg(merchantBUser, couponOrderId, merchantBUser.getMerchantId()); | |||
| } | |||
| return payOrder; | |||
| } | |||
| @@ -2238,7 +2239,7 @@ public class PosServiceImpl implements PosService { | |||
| // 1. insert into PayOrder | |||
| WxPayOrder payOrderQ = new WxPayOrder(); | |||
| payOrderQ.updateTenantInfo(buUser); | |||
| payOrderQ.setOrderId(order.getId()); | |||
| payOrderQ.setOrderId(EnumComposeOrder.getPayOrderId(order)); | |||
| List<WxPayOrder> payOrderList = payOrderMapper.findList(payOrderQ); | |||
| WxPayOrder payOrder = null; | |||
| if (null == payOrderList || payOrderList.size()<=0) { | |||
| @@ -2326,7 +2327,7 @@ public class PosServiceImpl implements PosService { | |||
| payOrder.setTenantId(buUser.getTenantId()); | |||
| payOrder.updateTenantInfo(buUser); | |||
| payOrder.setCUserId(memId); | |||
| payOrder.setOrderId(order.getId()); | |||
| payOrder.setOrderId(EnumComposeOrder.getPayOrderId(order)); | |||
| payOrder.setCreateTime(curDate); | |||
| payOrder.setUpdateTime(curDate); | |||
| payOrder.setPayTimeStart(curDate); | |||
| @@ -2391,7 +2392,7 @@ public class PosServiceImpl implements PosService { | |||
| WxPayOrder payOrderQ = new WxPayOrder(); | |||
| payOrderQ.updateTenantInfo(refundOrder); | |||
| payOrderQ.setCUserId(refundOrder.getCUserId()); | |||
| payOrderQ.setOrderId(refundOrder.getId()); | |||
| payOrderQ.setOrderId(EnumComposeOrder.getPayOrderId(refundOrder)); | |||
| payOrderQ.setPayOrderStatus(EnumPayStatus.PAY_STATUS_SUCCESS.getCode()); | |||
| payOrderQ.setPosPayOrderId(posPayOrderId); | |||
| @@ -2495,7 +2496,9 @@ public class PosServiceImpl implements PosService { | |||
| order.setPosOrderId(posOrderId); | |||
| order.setPosOrderCreateTime(posOrderTime.getTime()); | |||
| order.setPosOrderCreateSn(orderCreateSn); | |||
| order.setComposeOrderId(0L); | |||
| order.setComposeOrderType(EnumComposeOrder.SINGLE.getCode()); | |||
| order.setCouponNumber(1); | |||
| try { | |||
| orderMapper.insert(order); | |||
| } catch (Exception e) { | |||
| @@ -2576,6 +2579,9 @@ public class PosServiceImpl implements PosService { | |||
| order.setPosOrderCreateTime(posOrderTime.getTime()); | |||
| order.setPosOrderCreateSn(orderCreateSn); | |||
| order.setOrderNumber(orderQ.getOrderNumber()); | |||
| order.setComposeOrderId(0L); | |||
| order.setComposeOrderType(EnumComposeOrder.SINGLE.getCode()); | |||
| order.setCouponNumber(1); | |||
| try { | |||
| orderMapper.insert(order); | |||
| @@ -8,6 +8,8 @@ import org.springframework.boot.SpringApplication; | |||
| import org.springframework.boot.autoconfigure.SpringBootApplication; | |||
| import org.springframework.context.annotation.Bean; | |||
| import org.springframework.context.annotation.EnableAspectJAutoProxy; | |||
| import org.springframework.scheduling.annotation.EnableAsync; | |||
| import org.springframework.scheduling.annotation.EnableScheduling; | |||
| import springfox.documentation.swagger2.annotations.EnableSwagger2; | |||
| @@ -21,6 +23,8 @@ import springfox.documentation.swagger2.annotations.EnableSwagger2; | |||
| @EnableRocketMQ | |||
| @EnableEncryptableProperties | |||
| @EnableAspectJAutoProxy(exposeProxy = true) | |||
| @EnableScheduling | |||
| @EnableAsync | |||
| public class ScheduleApplication { | |||
| @Value("${fm.exception}") | |||
| @@ -6,14 +6,14 @@ import org.springframework.scheduling.annotation.SchedulingConfigurer; | |||
| import org.springframework.scheduling.concurrent.ThreadPoolTaskScheduler; | |||
| import org.springframework.scheduling.config.ScheduledTaskRegistrar; | |||
| @Configuration | |||
| @EnableScheduling | |||
| public class SchedulingConfig implements SchedulingConfigurer { | |||
| @Override | |||
| public void configureTasks(ScheduledTaskRegistrar taskRegistrar) { | |||
| } | |||
| } | |||
| //@Configuration | |||
| //@EnableScheduling | |||
| //public class SchedulingConfig implements SchedulingConfigurer { | |||
| // | |||
| // @Override | |||
| // public void configureTasks(ScheduledTaskRegistrar taskRegistrar) { | |||
| // | |||
| // | |||
| // } | |||
| // | |||
| //} | |||
| @@ -16,6 +16,7 @@ import org.apache.commons.lang3.StringUtils; | |||
| import org.slf4j.Logger; | |||
| import org.slf4j.LoggerFactory; | |||
| import org.springframework.beans.factory.annotation.Autowired; | |||
| import org.springframework.scheduling.annotation.Async; | |||
| import org.springframework.scheduling.annotation.Scheduled; | |||
| import org.springframework.stereotype.Component; | |||
| @@ -47,6 +48,7 @@ public class ActivitySchedule { | |||
| /** | |||
| * 每天12点执行 | |||
| */ | |||
| @Async | |||
| @Scheduled(cron = "0 0 12 * * ?") | |||
| public void sendMsg() { | |||
| logger.info("限时活动参与提醒任务启动"); | |||
| @@ -91,6 +93,7 @@ public class ActivitySchedule { | |||
| /** | |||
| * 5分钟一次 | |||
| */ | |||
| @Async | |||
| @Scheduled(cron = "0 */5 * * * ?") | |||
| public void activityExipred() { | |||
| logger.info("活动报名结束任务"); | |||
| @@ -11,6 +11,7 @@ import org.apache.commons.collections.map.HashedMap; | |||
| import org.slf4j.Logger; | |||
| import org.slf4j.LoggerFactory; | |||
| import org.springframework.beans.factory.annotation.Autowired; | |||
| import org.springframework.scheduling.annotation.Async; | |||
| import org.springframework.scheduling.annotation.Scheduled; | |||
| import org.springframework.stereotype.Component; | |||
| @@ -40,6 +41,7 @@ public class BillNotificationSchedule { | |||
| /** | |||
| * 每天9点执行 | |||
| */ | |||
| @Async | |||
| @Scheduled(cron = "0 0 14 * * ?") | |||
| public void sendMsgFromBill() { | |||
| logger.info("账单通知任务启动"); | |||
| @@ -8,6 +8,7 @@ import com.iformall.service.WxBillAllService; | |||
| import org.slf4j.Logger; | |||
| import org.slf4j.LoggerFactory; | |||
| import org.springframework.beans.factory.annotation.Autowired; | |||
| import org.springframework.scheduling.annotation.Async; | |||
| import org.springframework.scheduling.annotation.Scheduled; | |||
| import org.springframework.stereotype.Component; | |||
| @@ -30,6 +31,7 @@ public class BillStatusSchedule { | |||
| /** | |||
| * 每天1点执行 | |||
| */ | |||
| @Async | |||
| @Scheduled(cron = "0 0 1 * * ?") | |||
| public void updateBillStatus() { | |||
| logger.info("账单状态更新开始"); | |||
| @@ -22,6 +22,7 @@ import com.iformall.service.pay.service.cashout.entity.CashOutAdapterResult; | |||
| import org.slf4j.Logger; | |||
| import org.slf4j.LoggerFactory; | |||
| import org.springframework.beans.factory.annotation.Autowired; | |||
| import org.springframework.scheduling.annotation.Async; | |||
| import org.springframework.scheduling.annotation.Scheduled; | |||
| import org.springframework.stereotype.Component; | |||
| import org.springframework.transaction.annotation.Propagation; | |||
| @@ -56,7 +57,8 @@ public class CashOutSchedule { | |||
| return wxMallMapper.findList(wxMall); | |||
| } | |||
| @Async | |||
| @Scheduled(cron = "0 5 0 * * ?") // 每天凌晨00:05 | |||
| public void merchantCountSchedule() { | |||
| List<WxMall> malls = getMalls(); | |||
| @@ -75,6 +77,7 @@ public class CashOutSchedule { | |||
| } | |||
| } | |||
| @Async | |||
| @Scheduled(cron = "0 0 0/6 * * ?") // 执行一次 | |||
| public void cashOutFailSchedule() { | |||
| List<WxMall> malls = getMalls(); | |||
| @@ -14,6 +14,7 @@ import org.apache.commons.lang3.StringUtils; | |||
| import org.slf4j.Logger; | |||
| import org.slf4j.LoggerFactory; | |||
| import org.springframework.beans.factory.annotation.Autowired; | |||
| import org.springframework.scheduling.annotation.Async; | |||
| import org.springframework.scheduling.annotation.Scheduled; | |||
| import org.springframework.stereotype.Component; | |||
| @@ -56,6 +57,7 @@ public class ChartDataSchedule { | |||
| /** | |||
| * 每天7点执行 | |||
| */ | |||
| @Async | |||
| @Scheduled(cron = "0 0 7 * * ?") | |||
| public void createData() { | |||
| createCarData(); | |||
| @@ -11,6 +11,7 @@ import lombok.extern.slf4j.Slf4j; | |||
| import org.slf4j.Logger; | |||
| import org.slf4j.LoggerFactory; | |||
| import org.springframework.beans.factory.annotation.Autowired; | |||
| import org.springframework.scheduling.annotation.Async; | |||
| import org.springframework.scheduling.annotation.Scheduled; | |||
| import org.springframework.stereotype.Component; | |||
| @@ -37,6 +38,7 @@ public class ContractSchedule { | |||
| /** | |||
| * 凌晨5分 | |||
| */ | |||
| @Async | |||
| @Scheduled(cron = "0 5 0 * * ?") | |||
| public void updateContractStatus() { | |||
| //更新合同状态,正常到期 | |||
| @@ -10,6 +10,7 @@ import com.iformall.mapper.*; | |||
| import org.slf4j.Logger; | |||
| import org.slf4j.LoggerFactory; | |||
| import org.springframework.beans.factory.annotation.Autowired; | |||
| import org.springframework.scheduling.annotation.Async; | |||
| import org.springframework.scheduling.annotation.Scheduled; | |||
| import org.springframework.stereotype.Component; | |||
| import org.springframework.transaction.annotation.Propagation; | |||
| @@ -46,6 +47,7 @@ public class CouponExpiringSchedule { | |||
| return wxMallMapper.findList(wxMall); | |||
| } | |||
| @Async | |||
| @Scheduled(cron = "0 5 0 * * ?") // 每天凌晨00:05 作废过期券,商户禁用券 | |||
| //@Scheduled(cron = "*/10 * * * * ?") // 测试10秒中一次 | |||
| public void couponExpiringSchedule() { | |||
| @@ -53,7 +55,7 @@ public class CouponExpiringSchedule { | |||
| for (WxMall mall : malls) { | |||
| try { | |||
| wxCouponMapper.offExpiriedCouponByValidDate(mall.getTenantId()); | |||
| wxCouponMapper.offExpiriedCouponByMerchantStatus(mall.getTenantId()); | |||
| wxCouponMapper.offExpiriedCouponByMerchantStatus(mall.getTenantId(),wxCouponMapper.getValidMerchantProductIds(mall.getTenantId())); | |||
| wxCouponSendMapper.offExpiriedCouponSendByCouponStatus(mall.getTenantId()); | |||
| wxCouponChannelMapper.offExpiriedCouponChannelByCouponStatus(mall.getTenantId()); | |||
| @@ -63,6 +65,7 @@ public class CouponExpiringSchedule { | |||
| } | |||
| } | |||
| @Async | |||
| @Scheduled(cron = "0 10 0 * * ?") // 每天凌晨00:10 下架定向发放 | |||
| //@Scheduled(cron = "*/10 * * * * ?") // 测试10秒中一次 | |||
| public void couponSendExpiringSchedule() { | |||
| @@ -76,6 +79,7 @@ public class CouponExpiringSchedule { | |||
| } | |||
| } | |||
| @Async | |||
| @Scheduled(cron = "0 10 0 * * ?") // 每天凌晨00:10 下架主动领取 | |||
| //@Scheduled(cron = "*/10 * * * * ?") // 测试10秒中一次 | |||
| public void couponChannelExpiringSchedule() { | |||
| @@ -91,12 +95,14 @@ public class CouponExpiringSchedule { | |||
| } | |||
| } | |||
| @Async | |||
| @Scheduled(cron = "0 15 0 * * ?") // 每天凌晨00:15 下架券广告 | |||
| //@Scheduled(cron = "*/10 * * * * ?") // 测试10秒中一次 | |||
| public void screenAdExpiringSchedule() { | |||
| wxScreenAdMapper.offScreeAdByCouponChannelStatus(); | |||
| } | |||
| @Async | |||
| @Scheduled(cron = "0 0,1,2,3 0/1 * * ?") // 每小时 0, 1 ,2 ,3 分钟(整点)执行//限时抢购 | |||
| //@Scheduled(cron = "*/10 * * * * ?") // 测试10秒中一次 | |||
| public void couponChannel2ExpiringSchedule() { | |||
| @@ -110,6 +116,7 @@ public class CouponExpiringSchedule { | |||
| } | |||
| } | |||
| @Async | |||
| @Scheduled(cron = "0 20 0 * * ?") // 每天凌晨00:20 下架游戏 | |||
| //@Scheduled(cron = "*/10 * * * * ?") // 测试10秒中一次 | |||
| public void gameExpiringSchedule() { | |||
| @@ -117,20 +124,22 @@ public class CouponExpiringSchedule { | |||
| wxGame.setStatus(EnumGameStatus.STATUS_THROW_IN.getCode()); | |||
| List<WxGame> list = wxGameMapper.findList(wxGame); | |||
| list.stream().forEach(g->{ | |||
| WxCouponChannel couponChannel = new WxCouponChannel(); | |||
| couponChannel.updateTenantInfo(g); | |||
| couponChannel.setTargetAd(EnumCouponChannelType.COUPON_CHANNEL_ID_GAME.getCode()); | |||
| couponChannel.setSubTargetId(g.getId()); | |||
| couponChannel.setStatus(EnumCouponChannelStatus.STATUS_THROW_IN.getCode()); | |||
| int count = wxCouponChannelMapper.countCouponChannel(couponChannel); | |||
| if (count == 0) { | |||
| WxGame record = new WxGame(); | |||
| record.setId(g.getId()); | |||
| record.setStatus(EnumGameStatus.STATUS_TAKE_OFFF.getCode()); | |||
| wxGameMapper.updateById(record); | |||
| } | |||
| }); | |||
| if (null != list && list.size() > 0 ) { | |||
| list.stream().forEach(g->{ | |||
| WxCouponChannel couponChannel = new WxCouponChannel(); | |||
| couponChannel.updateTenantInfo(g); | |||
| couponChannel.setTargetAd(EnumCouponChannelType.COUPON_CHANNEL_ID_GAME.getCode()); | |||
| couponChannel.setSubTargetId(g.getId()); | |||
| couponChannel.setStatus(EnumCouponChannelStatus.STATUS_THROW_IN.getCode()); | |||
| int count = wxCouponChannelMapper.countCouponChannel(couponChannel); | |||
| if (count == 0) { | |||
| WxGame record = new WxGame(); | |||
| record.setId(g.getId()); | |||
| record.setStatus(EnumGameStatus.STATUS_TAKE_OFFF.getCode()); | |||
| wxGameMapper.updateById(record); | |||
| } | |||
| }); | |||
| } | |||
| } | |||
| @@ -2,11 +2,13 @@ package com.iformall.schedule; | |||
| import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; | |||
| import com.iformall.common.ErrorCode; | |||
| import com.iformall.common.ResultData; | |||
| import com.iformall.domain.dto.WxSharingOrderDto; | |||
| import com.iformall.domain.po.*; | |||
| import com.iformall.enums.*; | |||
| import com.iformall.exception.MallinkException; | |||
| import com.iformall.mapper.*; | |||
| import com.iformall.service.WxCouponOrderService; | |||
| import com.iformall.service.WxOrderService; | |||
| import com.iformall.service.WxProfitSharingOrderService; | |||
| import com.iformall.service.WxRefundOrderService; | |||
| @@ -15,6 +17,7 @@ import org.slf4j.Logger; | |||
| import org.slf4j.LoggerFactory; | |||
| import org.springframework.aop.framework.AopContext; | |||
| import org.springframework.beans.factory.annotation.Autowired; | |||
| import org.springframework.scheduling.annotation.Async; | |||
| import org.springframework.scheduling.annotation.Scheduled; | |||
| import org.springframework.stereotype.Component; | |||
| import org.springframework.transaction.annotation.Propagation; | |||
| @@ -30,6 +33,9 @@ public class CouponOrderExpiringSchedule { | |||
| @Autowired | |||
| private WxCouponOrderMapper wxCouponOrderMapper; | |||
| @Autowired | |||
| private WxCouponOrderService wxCouponOrderService; | |||
| @Autowired | |||
| private WxRefundOrderService wxRefundOrderService; | |||
| @@ -57,7 +63,6 @@ public class CouponOrderExpiringSchedule { | |||
| return wxMallMapper.findList(wxMall); | |||
| } | |||
| @Scheduled(cron = "0 0 5 * * ?") // 每天凌晨00:05 | |||
| // @Scheduled(cron = "*/10 * * * * ?") // 测试10秒中一次 | |||
| public void couponOrderExpiringSchedule() { | |||
| @@ -66,15 +71,17 @@ public class CouponOrderExpiringSchedule { | |||
| List<WxMall> malls = getMalls(); | |||
| for (WxMall mall: malls) { | |||
| List<WxCouponOrder> list = wxCouponOrderMapper.findExpiredFreeCouponOrderByValidDate(mall.getTenantId()); | |||
| list.stream().forEach(co -> { | |||
| // 券过期,更改状态及库存退回 | |||
| try { | |||
| proxy.couponOrderExpire(co, true); | |||
| } catch (Exception e) { | |||
| logger.error(e.getMessage()); | |||
| } | |||
| }); | |||
| if (null != list && list.size() > 0 ) { | |||
| list.stream().forEach(co -> { | |||
| // 券过期,更改状态及库存退回 | |||
| try { | |||
| proxy.couponOrderExpire(co, true); | |||
| } catch (Exception e) { | |||
| logger.error(e.getMessage(),e); | |||
| } | |||
| }); | |||
| } | |||
| } | |||
| } | |||
| @@ -86,13 +93,15 @@ public class CouponOrderExpiringSchedule { | |||
| List<WxMall> malls = getMalls(); | |||
| for (WxMall mall: malls) { | |||
| List<WxCouponOrder> list = wxCouponOrderMapper.findExpiredCouponOrderByValidDate(mall.getTenantId()); | |||
| list.stream().forEach(co -> { | |||
| try { | |||
| proxy.refund(co); | |||
| }catch(Exception e) { | |||
| logger.error(e.getMessage()); | |||
| } | |||
| }); | |||
| if (null != list && list.size() > 0 ) { | |||
| list.stream().forEach(co -> { | |||
| try { | |||
| proxy.refund(co); | |||
| }catch(Exception e) { | |||
| logger.error(e.getMessage(),e); | |||
| } | |||
| }); | |||
| } | |||
| } | |||
| } | |||
| @@ -104,10 +113,40 @@ public class CouponOrderExpiringSchedule { | |||
| couponOrderExpireRefund(order, true); | |||
| } | |||
| @Scheduled(cron = "0 0 5 * * ?") // 每天凌晨00:05 | |||
| // @Scheduled(cron = "*/10 * * * * ?") // 测试10秒中一次 | |||
| public void couponOrderGoodsVerifySchedule() {//14天确认收获 系统自动核销 | |||
| List<WxMall> malls = getMalls(); | |||
| for (WxMall mall: malls) { | |||
| List<WxCouponOrder> list = wxCouponOrderMapper.findExpiredCouponOrderGoodsVerify(mall.getTenantId()); | |||
| if (null != list && list.size() > 0 ) { | |||
| list.stream().forEach(co -> { | |||
| WxCouponOrder couponOrder = null; | |||
| try { | |||
| couponOrder = wxCouponOrderService.verify(co,null,EnumCouponVerifyType.VERIFY_C_AUTO); | |||
| } catch (MallinkException e) { | |||
| logger.error("核销异常: " + e.getMessage()); | |||
| } catch (Exception e) { | |||
| logger.error("核销异常: " + e.getMessage()); | |||
| } | |||
| if (couponOrder != null && couponOrder.getMerchantId() != null) { | |||
| wxCouponOrderService.sendInsideCouponVerifyMsg(couponOrder, couponOrder.getId(), couponOrder.getMerchantId()); | |||
| } | |||
| }); | |||
| } | |||
| } | |||
| } | |||
| @Transactional(propagation = Propagation.REQUIRED, readOnly = false, rollbackFor = {Exception.class}) | |||
| public void couponOrderExpire(WxCouponOrder co, boolean bStockBack) { | |||
| //商品订单不过期 | |||
| if(EnumCouponType.COUPON_DISTRIBUTION.getCode().equals(co.getCouponType())){ | |||
| return; | |||
| } | |||
| // 标记 couponOrder过期 | |||
| WxCouponOrder updateRecord = new WxCouponOrder(); | |||
| updateRecord.setId(co.getId()); | |||
| @@ -123,7 +162,8 @@ public class CouponOrderExpiringSchedule { | |||
| // 库存退回 | |||
| if(bStockBack) { | |||
| WxOrder order = wxOrderMapper.selectById(co.getOrderId(),co.getTenantId()); | |||
| if(order != null) { | |||
| //券包子券没有库存 | |||
| if(order != null && order.getParentOrderId() == 0l) { | |||
| wxOrderService.stockBack(order); | |||
| } | |||
| } | |||
| @@ -162,7 +202,11 @@ public class CouponOrderExpiringSchedule { | |||
| try { | |||
| WxPayOrder wxPayOrder = new WxPayOrder(); | |||
| wxPayOrder.updateTenantInfo(co); | |||
| wxPayOrder.setOrderId(co.getOrderId()); | |||
| Long orderId = co.getOrderId(); | |||
| if (!EnumComposeOrder.isSingle(co.getComposeOrderType())) { | |||
| orderId = co.getComposeOrderId(); | |||
| } | |||
| wxPayOrder.setOrderId(orderId); | |||
| wxPayOrder.setPayOrderStatus(EnumPayStatus.PAY_STATUS_SUCCESS.getCode()); | |||
| wxPayOrder = wxPayOrderMapper.selectOne(new QueryWrapper(wxPayOrder)); | |||
| if (wxPayOrder != null && wxPayOrder.getShare().equals(EnumPayShare.YES.getCode())) { | |||
| @@ -176,18 +220,18 @@ public class CouponOrderExpiringSchedule { | |||
| wxSharingOrderDto.setPayTimeEnd(wxPayOrder.getPayTimeEnd()); | |||
| wxSharingOrderDto.updateTenantInfo(wxPayOrder); | |||
| wxSharingOrderDto.setTransactionId(wxPayOrder.getTransactionId()); | |||
| if (wxPayOrder.getRateAmount() != null) { | |||
| if (wxPayOrder.getChildOrderShare(co.getOrderId()).getRateAmount() != null) { | |||
| // 实际分账金额为 分账金额 + 通道费差 | |||
| wxSharingOrderDto.setShareAmount(wxPayOrder.getShareAmount()+wxPayOrder.getRateAmount()); | |||
| wxSharingOrderDto.setShareAmount(wxPayOrder.getChildOrderShare(co.getOrderId()).getShareAmount()+wxPayOrder.getChildOrderShare(co.getOrderId()).getRateAmount()); | |||
| } else { | |||
| // 未设置通道费差 | |||
| wxSharingOrderDto.setShareAmount(wxPayOrder.getShareAmount()); | |||
| wxSharingOrderDto.setShareAmount(wxPayOrder.getChildOrderShare(co.getOrderId()).getShareAmount()); | |||
| } | |||
| wxProfitSharingOrderService.finishSharingOrder(wxSharingOrderDto,wxPayOrder.getPayVendor()); | |||
| } | |||
| } catch (MallinkException e) { | |||
| logger.error("券过期不退款: " + co.getId() + " ERROR:" + e.getMessage()); | |||
| logger.error("券过期不退款: " + co.getId() + " ERROR:" + e.getMessage(),e); | |||
| throw new MallinkException(e.getErrorCode(), e.getMessage()); | |||
| } | |||
| @@ -16,6 +16,7 @@ import org.apache.commons.lang3.StringUtils; | |||
| import org.slf4j.Logger; | |||
| import org.slf4j.LoggerFactory; | |||
| import org.springframework.beans.factory.annotation.Autowired; | |||
| import org.springframework.scheduling.annotation.Async; | |||
| import org.springframework.scheduling.annotation.Scheduled; | |||
| import org.springframework.stereotype.Component; | |||
| @@ -74,7 +75,7 @@ public class CouponSendSchedule { | |||
| @Autowired | |||
| private PushLimitService pushLimitService; | |||
| @Async | |||
| //@Scheduled(cron = "0 0 6 1 * ?") // 每月1号发放会员的权益券 | |||
| @Scheduled(cron = "0 0 6 * * ?") // 测试每天6点发券 | |||
| //@Scheduled(cron = "*/30 * * * * ?") // 测试30秒中一次 | |||
| @@ -219,6 +220,7 @@ public class CouponSendSchedule { | |||
| /** | |||
| * 生日券发放 | |||
| */ | |||
| @Async | |||
| @Scheduled(cron = "0 30 8 * * ?") // 测试每天8:30点发券 | |||
| public void birthdayCouponSendSchedule() { | |||
| logger.info("生日发券: 任务开始"); | |||
| @@ -9,6 +9,7 @@ import com.iformall.service.WxDateAmountRecordService; | |||
| import org.slf4j.Logger; | |||
| import org.slf4j.LoggerFactory; | |||
| import org.springframework.beans.factory.annotation.Autowired; | |||
| import org.springframework.scheduling.annotation.Async; | |||
| import org.springframework.scheduling.annotation.Scheduled; | |||
| import org.springframework.stereotype.Component; | |||
| import org.springframework.transaction.annotation.Propagation; | |||
| @@ -69,32 +70,34 @@ public class DaliyAmountSchedule { | |||
| wxDateAmountRecordService.saveAmount(dateAmountRecord); | |||
| list = wxCouponOrderMapper.findListOfVerifiedByDate(dateMap); | |||
| logger.info("\nfind " + list.size() + " coupon order from " + startDate + " to " + endDate); | |||
| total_price = list.stream().mapToInt(p -> p.getCouponPrice()).sum(); | |||
| logger.info("\nFound " + list.size() + " coupon orders \n" + | |||
| "for merchantId:" + merchant.getId() + "\n" + | |||
| "from " + startDate + " to " + endDate + "\n" + | |||
| "TOTAL VERIFIED=" + total_price); | |||
| dateAmountRecord.setPayPrice(total_price); | |||
| dateAmountRecord.setType(EnumDateAmtType.VERIFY_RECORD.getCode()); | |||
| wxDateAmountRecordService.saveAmount(dateAmountRecord); | |||
| Map microPayMap = wxOrderMapper.dayMicroPayAmountList(dateMap); | |||
| Long countMic = (Long) microPayMap.get("count"); | |||
| BigDecimal totalPriceMic = (BigDecimal) microPayMap.get("total_price"); | |||
| logger.info("\nFound " + countMic + " order " + "\n" + | |||
| "for merchantId:" + merchant.getId() + "\n" + | |||
| "from " + startDate + " to " + endDate + "\n" + | |||
| "TOTAL Payment=" + totalPriceMic); | |||
| dateAmountRecord.setPayPrice(totalPriceMic.intValue()); | |||
| dateAmountRecord.setType(EnumDateAmtType.MICROPAY_RECORD.getCode()); | |||
| wxDateAmountRecordService.saveAmount(dateAmountRecord); | |||
| if (null != list && list.size() > 0) { | |||
| logger.info("\nfind " + list.size() + " coupon order from " + startDate + " to " + endDate); | |||
| total_price = list.stream().mapToInt(p -> p.getCouponPrice()).sum(); | |||
| logger.info("\nFound " + list.size() + " coupon orders \n" + | |||
| "for merchantId:" + merchant.getId() + "\n" + | |||
| "from " + startDate + " to " + endDate + "\n" + | |||
| "TOTAL VERIFIED=" + total_price); | |||
| dateAmountRecord.setPayPrice(total_price); | |||
| dateAmountRecord.setType(EnumDateAmtType.VERIFY_RECORD.getCode()); | |||
| wxDateAmountRecordService.saveAmount(dateAmountRecord); | |||
| Map microPayMap = wxOrderMapper.dayMicroPayAmountList(dateMap); | |||
| Long countMic = (Long) microPayMap.get("count"); | |||
| BigDecimal totalPriceMic = (BigDecimal) microPayMap.get("total_price"); | |||
| logger.info("\nFound " + countMic + " order " + "\n" + | |||
| "for merchantId:" + merchant.getId() + "\n" + | |||
| "from " + startDate + " to " + endDate + "\n" + | |||
| "TOTAL Payment=" + totalPriceMic); | |||
| dateAmountRecord.setPayPrice(totalPriceMic.intValue()); | |||
| dateAmountRecord.setType(EnumDateAmtType.MICROPAY_RECORD.getCode()); | |||
| wxDateAmountRecordService.saveAmount(dateAmountRecord); | |||
| } | |||
| } | |||
| @Async | |||
| @Scheduled(cron = "0 0 1 * * ?") // 每天凌晨1点盘点前一天的数据 | |||
| //@Scheduled(cron = "0 0 1 * * ?") // 测试10秒中一次 | |||
| public void daliyAmountSchedule() { | |||
| @@ -10,6 +10,7 @@ import com.iformall.mapper.WxDeviceMapper; | |||
| import org.slf4j.Logger; | |||
| import org.slf4j.LoggerFactory; | |||
| import org.springframework.beans.factory.annotation.Autowired; | |||
| import org.springframework.scheduling.annotation.Async; | |||
| import org.springframework.scheduling.annotation.Scheduled; | |||
| import org.springframework.stereotype.Component; | |||
| @@ -32,6 +33,7 @@ public class DeviceHbCheckSchedule { | |||
| @Autowired | |||
| KwMeterMapper kwMeterMapper; | |||
| @Async | |||
| @Scheduled(cron = "0 */5 * * * *?") // 每5分钟检查一次 | |||
| //@Scheduled(cron = "*/10 * * * * ?") // 测试10秒中一次 | |||
| public void offlineCheckSchedule() { | |||
| @@ -4,6 +4,7 @@ import com.iformall.mapper.WxCuserFloatingLayerMapper; | |||
| import org.slf4j.Logger; | |||
| import org.slf4j.LoggerFactory; | |||
| import org.springframework.beans.factory.annotation.Autowired; | |||
| import org.springframework.scheduling.annotation.Async; | |||
| import org.springframework.scheduling.annotation.Scheduled; | |||
| import org.springframework.stereotype.Component; | |||
| @@ -22,6 +23,7 @@ public class FloatingLayerSchedule { | |||
| /** | |||
| * 每天23点执行 | |||
| */ | |||
| @Async | |||
| @Scheduled(cron = "0 0 23 * * ?") | |||
| public void sendMsg() { | |||
| logger.info("删除浮层用户数据开始"); | |||
| @@ -19,6 +19,7 @@ import org.apache.commons.collections.CollectionUtils; | |||
| import org.apache.commons.lang3.StringUtils; | |||
| import org.springframework.beans.factory.annotation.Autowired; | |||
| import org.springframework.core.env.Environment; | |||
| import org.springframework.scheduling.annotation.Async; | |||
| import org.springframework.scheduling.annotation.Scheduled; | |||
| import org.springframework.stereotype.Component; | |||
| @@ -59,6 +60,7 @@ public class InvestSchedule { | |||
| private static final String TAG_REMIND = "招商定时任务-提醒"; | |||
| @Async | |||
| @Scheduled(cron = "0 0 14 * * ?") // 每天下午两点执行定时任务 | |||
| //@Scheduled(cron = "0 */30 * * * *?") // 测试,每30分钟执行 | |||
| public void messageSchedule() { | |||
| @@ -70,6 +72,7 @@ public class InvestSchedule { | |||
| log.info("{}: 结束", TAG_MESSAGE); | |||
| } | |||
| @Async | |||
| @Scheduled(cron = "0 */5 * * * *?") | |||
| public void remindSchedule() { | |||
| log.info("{}: 开始", TAG_REMIND); | |||
| @@ -5,6 +5,7 @@ import com.iformall.mapper.WxBillRentMapper; | |||
| import org.slf4j.Logger; | |||
| import org.slf4j.LoggerFactory; | |||
| import org.springframework.beans.factory.annotation.Autowired; | |||
| import org.springframework.scheduling.annotation.Async; | |||
| import org.springframework.scheduling.annotation.Scheduled; | |||
| import org.springframework.stereotype.Component; | |||
| @@ -21,6 +22,7 @@ public class LatePayBillActionSchedule { | |||
| /** | |||
| * 每天凌晨1点执行 | |||
| */ | |||
| @Async | |||
| @Scheduled(cron = "0 0 1 * * ?") | |||
| public void updateBillStatus() { | |||
| try { | |||
| @@ -14,6 +14,7 @@ import com.iformall.utils.DateUtils; | |||
| import org.slf4j.Logger; | |||
| import org.slf4j.LoggerFactory; | |||
| import org.springframework.beans.factory.annotation.Autowired; | |||
| import org.springframework.scheduling.annotation.Async; | |||
| import org.springframework.scheduling.annotation.Scheduled; | |||
| import org.springframework.stereotype.Component; | |||
| import java.util.List; | |||
| @@ -43,6 +44,7 @@ public class MsgSendingSchedule { | |||
| /** | |||
| * 每小时第一分钟执行 | |||
| */ | |||
| @Async | |||
| @Scheduled(cron = "0 1 */1 * * ?") | |||
| public void sendmsgschedule() { | |||
| logger.info("sendmsg定时任务启动"); | |||
| @@ -11,6 +11,7 @@ import org.slf4j.Logger; | |||
| import org.slf4j.LoggerFactory; | |||
| import org.springframework.aop.framework.AopContext; | |||
| import org.springframework.beans.factory.annotation.Autowired; | |||
| import org.springframework.scheduling.annotation.Async; | |||
| import org.springframework.scheduling.annotation.Scheduled; | |||
| import org.springframework.stereotype.Component; | |||
| import org.springframework.transaction.annotation.Propagation; | |||
| @@ -20,6 +21,7 @@ import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; | |||
| import com.iformall.common.ErrorCode; | |||
| import com.iformall.common.ResultData; | |||
| import com.iformall.enums.EnumAppType; | |||
| import com.iformall.enums.EnumComposeOrder; | |||
| import com.iformall.enums.EnumOrderStatus; | |||
| import com.iformall.enums.EnumOrderType; | |||
| import com.iformall.enums.EnumPayStatus; | |||
| @@ -31,6 +33,8 @@ import com.iformall.service.WxOrderService; | |||
| import com.iformall.service.WxPayOrderService; | |||
| import com.iformall.service.WxRefundOrderService; | |||
| import com.iformall.service.helper.WxPayOrderServiceHelper; | |||
| import com.iformall.service.order.OrderFactory; | |||
| import com.iformall.service.order.entity.WxComposeOrder; | |||
| import com.iformall.service.pay.PayServiceFactory; | |||
| import com.iformall.service.pay.service.pay.entity.PayQueryAdapterResult; | |||
| import com.iformall.utils.DateUtils; | |||
| @@ -84,12 +88,14 @@ public class OrderExpiringSchedule { | |||
| @Autowired | |||
| PayServiceFactory payServiceFactory; | |||
| @Autowired | |||
| OrderFactory orderFactory; | |||
| private List<WxMall> getMalls() { | |||
| WxMall wxMall =new WxMall(); | |||
| return wxMallMapper.findList(wxMall); | |||
| } | |||
| @Scheduled(cron = "0 */5 * * * *?") // 每5分钟检查一次 | |||
| //@Scheduled(cron = "*/10 * * * * ?") // 测试10秒中一次 | |||
| public void orderExpireSchedule() { | |||
| @@ -117,13 +123,15 @@ public class OrderExpiringSchedule { | |||
| dateMap.put("endDate", expireDate); | |||
| dateMap.put("tenantId", tenantId); | |||
| List<WxOrder> orderCoupons = wxOrderMapper.findListOfUnpaidOrderByDate(dateMap); | |||
| orderCoupons.stream().forEach( o -> { | |||
| try { | |||
| proxy.orderExpired(o,true,payWay); | |||
| } catch (Exception e) { | |||
| logger.error("券过期失败" + e.getMessage()); | |||
| } | |||
| }); | |||
| if (null != orderCoupons && orderCoupons.size() > 0) { | |||
| orderCoupons.stream().forEach( o -> { | |||
| try { | |||
| proxy.orderExpired(o,true,payWay); | |||
| } catch (Exception e) { | |||
| logger.error("券过期失败" + e.getMessage()); | |||
| } | |||
| }); | |||
| } | |||
| // 砍价相关订单, | |||
| // 1. 如果已经砍价完成,必须60分钟内支付, 未支付,订单过期 | |||
| @@ -132,25 +140,29 @@ public class OrderExpiringSchedule { | |||
| dateMap.put("endDate", pressExpireDate); | |||
| dateMap.put("tenantId", tenantId); | |||
| List<WxOrder> orderPresss = wxOrderMapper.findListOfCompleteUnPaidPressOrderByDate(dateMap); | |||
| orderPresss.stream().forEach( o -> { | |||
| try { | |||
| proxy.orderPressExpired(o, true,true,payWay); | |||
| } catch (Exception e) { | |||
| logger.error("砍价券支付过期失败" + e.getMessage()); | |||
| } | |||
| }); | |||
| if (null != orderPresss && orderPresss.size() > 0) { | |||
| orderPresss.stream().forEach( o -> { | |||
| try { | |||
| proxy.orderPressExpired(o, true,true,payWay); | |||
| } catch (Exception e) { | |||
| logger.error("砍价券支付过期失败" + e.getMessage()); | |||
| } | |||
| }); | |||
| } | |||
| // 2. 当前已超过砍价结束时间, 订单过期 | |||
| dateMap.put("type", EnumOrderType.COUPON.getCode()); | |||
| dateMap.put("endDate", curDate); | |||
| dateMap.put("tenantId", tenantId); | |||
| orderPresss = wxOrderMapper.findListOfUnpaidPressOrderByDate(dateMap); | |||
| orderPresss.stream().forEach( o -> { | |||
| try { | |||
| proxy.orderPressExpired(o, false,true,payWay); | |||
| } catch (Exception e) { | |||
| logger.error("砍价券过期失败" +e.getMessage()); | |||
| } | |||
| }); | |||
| if (null != orderPresss && orderPresss.size() > 0) { | |||
| orderPresss.stream().forEach( o -> { | |||
| try { | |||
| proxy.orderPressExpired(o, false,true,payWay); | |||
| } catch (Exception e) { | |||
| logger.error("砍价券过期失败" +e.getMessage()); | |||
| } | |||
| }); | |||
| } | |||
| // 拼团取消 | |||
| @@ -168,13 +180,15 @@ public class OrderExpiringSchedule { | |||
| dateMap.put("endDate", groupExpireDate); | |||
| dateMap.put("tenantId", tenantId); | |||
| List<WxOrder> orderGroups = wxOrderMapper.findListOfUnpaidGroupOrderByDate(dateMap); | |||
| orderGroups.stream().forEach( o -> { | |||
| try { | |||
| proxy.orderGroupExpired(o,true,true,payWay); | |||
| } catch (Exception e) { | |||
| logger.error("砍价券支付过期失败" + e.getMessage()); | |||
| } | |||
| }); | |||
| if (null != orderGroups && orderGroups.size() > 0) { | |||
| orderGroups.stream().forEach( o -> { | |||
| try { | |||
| proxy.orderGroupExpired(o,true,true,payWay); | |||
| } catch (Exception e) { | |||
| logger.error("砍价券支付过期失败" + e.getMessage()); | |||
| } | |||
| }); | |||
| } | |||
| //更新拼团过期状态 | |||
| @@ -182,57 +196,71 @@ public class OrderExpiringSchedule { | |||
| //拼团过期 | |||
| order.setOrderStatus(EnumOrderStatus.ORDER_STATUS_COOPERATING_OVERTIME.getCode()); | |||
| order.setTenantId(tenantId); | |||
| wxOrderMapper.selectList(new QueryWrapper(order)).stream().forEach(o -> { | |||
| try { | |||
| proxy.expiredAndReturnMoney((WxOrder) o,false,payWay); | |||
| } catch (Exception e) { | |||
| logger.error("拼团过期退款失败" + e.getMessage()); | |||
| } | |||
| }); | |||
| List<WxOrder> _orderList = wxOrderMapper.selectList(new QueryWrapper(order)); | |||
| if (null != _orderList && _orderList.size() > 0) { | |||
| _orderList.stream().forEach(o -> { | |||
| try { | |||
| proxy.expiredAndReturnMoney((WxOrder) o,false,payWay); | |||
| } catch (Exception e) { | |||
| logger.error("拼团过期退款失败" + e.getMessage()); | |||
| } | |||
| }); | |||
| } | |||
| //拼团券下架 | |||
| order.setOrderStatus(EnumOrderStatus.ORDER_STATUS_COOPERATING_CANCEL.getCode()); | |||
| wxOrderMapper.selectList(new QueryWrapper(order)).stream().forEach(o -> { | |||
| try { | |||
| proxy.returnMoney((WxOrder) o,payWay); | |||
| } catch (Exception e) { | |||
| logger.error("拼团券下架退款失败" + e.getMessage()); | |||
| } | |||
| }); | |||
| _orderList = wxOrderMapper.selectList(new QueryWrapper(order)); | |||
| if (null != _orderList && _orderList.size() > 0) { | |||
| _orderList.stream().forEach(o -> { | |||
| try { | |||
| proxy.returnMoney((WxOrder) o,payWay); | |||
| } catch (Exception e) { | |||
| logger.error("拼团券下架退款失败" + e.getMessage()); | |||
| } | |||
| }); | |||
| } | |||
| //参团失败 | |||
| order.setOrderStatus(EnumOrderStatus.ORDER_STATUS_COOPERATING_FAILD.getCode()); | |||
| wxOrderMapper.selectList(new QueryWrapper(order)).stream().forEach(o -> { | |||
| try { | |||
| proxy.expiredAndReturnMoney((WxOrder) o,true,payWay); | |||
| } catch (Exception e) { | |||
| logger.error("参团失败退款失败" + e.getMessage()); | |||
| } | |||
| }); | |||
| _orderList = wxOrderMapper.selectList(new QueryWrapper(order)); | |||
| if (null != _orderList && _orderList.size() > 0) { | |||
| _orderList.stream().forEach(o -> { | |||
| try { | |||
| proxy.expiredAndReturnMoney((WxOrder) o,true,payWay); | |||
| } catch (Exception e) { | |||
| logger.error("参团失败退款失败" + e.getMessage()); | |||
| } | |||
| }); | |||
| } | |||
| //无需查询付款状态的订单-退款,回滚库存 | |||
| order.setOrderStatus(EnumOrderStatus.ORDER_STATUS_COOPERATING_SCHEDU_REFUND.getCode()); | |||
| wxOrderMapper.selectList(new QueryWrapper(order)).stream().forEach(o -> { | |||
| try { | |||
| proxy.expiredAndReturnMoney((WxOrder) o,false,payWay); | |||
| } catch (Exception e) { | |||
| logger.error("参团失败退款失败" + e.getMessage()); | |||
| } | |||
| }); | |||
| _orderList = wxOrderMapper.selectList(new QueryWrapper(order)); | |||
| if (null != _orderList && _orderList.size() > 0) { | |||
| _orderList.stream().forEach(o -> { | |||
| try { | |||
| proxy.expiredAndReturnMoney((WxOrder) o,false,payWay); | |||
| } catch (Exception e) { | |||
| logger.error("参团失败退款失败" + e.getMessage()); | |||
| } | |||
| }); | |||
| } | |||
| //此处是拼团完成后,会将其他失效的订单置成该状态。需要查询是否已经付款,如果已经付款,则退款,退款回回滚库存。如果没付款,则主动回滚库存 | |||
| order.setOrderStatus(EnumOrderStatus.ORDER_STATUS_COOPERATING_COMPLETE_REFUND.getCode()); | |||
| wxOrderMapper.selectList(new QueryWrapper(order)).stream().forEach(o -> { | |||
| try { | |||
| proxy.expiredCheckAndReturnMoney((WxOrder) o,payWay); | |||
| } catch (Exception e) { | |||
| logger.error("参团失败退款失败" + e.getMessage()); | |||
| } | |||
| }); | |||
| _orderList = wxOrderMapper.selectList(new QueryWrapper(order)); | |||
| if (null != _orderList && _orderList.size() > 0) { | |||
| _orderList.stream().forEach(o -> { | |||
| try { | |||
| proxy.expiredCheckAndReturnMoney((WxOrder) o,payWay); | |||
| } catch (Exception e) { | |||
| logger.error("参团失败退款失败" + e.getMessage()); | |||
| } | |||
| }); | |||
| } | |||
| } | |||
| @Transactional(propagation = Propagation.REQUIRED, readOnly = false, rollbackFor = {Exception.class}) | |||
| public void expiredCheckAndReturnMoney(WxOrder wxOrder,EnumPayWay payWay) throws MallinkException, Exception { | |||
| if (wxPaySuccess(wxOrder, false, payWay)) { | |||
| @@ -252,7 +280,7 @@ public class OrderExpiringSchedule { | |||
| public boolean wxPaySuccess(WxOrder order,boolean autoReHandle,EnumPayWay payWay) throws MallinkException, Exception { | |||
| WxPayOrder payOrderq = new WxPayOrder(); | |||
| payOrderq.setOrderId(order.getId()); | |||
| payOrderq.setOrderId(EnumComposeOrder.getPayOrderId(order)); | |||
| payOrderq.setTenantId(order.getTenantId()); | |||
| List<WxPayOrder> payorderlist = wxPayOrderMapper.findList(payOrderq); | |||
| if (null == payorderlist || payorderlist.size() <=0 ) { | |||
| @@ -288,11 +316,14 @@ public class OrderExpiringSchedule { | |||
| } | |||
| //Map<String, String> retMap = WxPayOrderServiceHelper.wxOrderPayStatusMap(wxpayOrder, order, appInfo, payAccount); | |||
| //int status = WxPayOrderServiceHelper.getPayStatusFromMap(retMap, wxpayOrder.getPayOrderNo()); | |||
| PayQueryAdapterResult payResult = payServiceFactory.getPayAdapterService(wxpayOrder.getPayVendor()).queryPayStatus(wxpayOrder, order, appInfo, payAccount); | |||
| PayQueryAdapterResult payResult = payServiceFactory.getPayAdapterService(wxpayOrder.getPayVendor()).queryPayStatus(wxpayOrder, appInfo, payAccount); | |||
| //如果是支付成功,并且需要重试成功流程, | |||
| if (EnumPayStatus.PAY_STATUS_SUCCESS.getCode().intValue() == payResult.getCode()) { | |||
| if (autoReHandle) { | |||
| wxPayOrderService.handleSuccessOrder(wxpayOrder, order, payResult,true); | |||
| WxComposeOrder composeOrder = orderFactory.getOrderAdapterService(wxpayOrder.getComposeOrder()).getComposeOrder(wxpayOrder.getOrderId(), wxpayOrder.getTenantId()); | |||
| //无论是不是批量的,都是执行单个订单 | |||
| composeOrder.setSingleOrder(order); | |||
| wxPayOrderService.handleSuccessOrder(wxpayOrder, composeOrder, payResult, true,true); | |||
| } | |||
| return true; | |||
| } | |||
| @@ -310,8 +341,8 @@ public class OrderExpiringSchedule { | |||
| // 库存退回 | |||
| wxOrderService.stockBack(order); | |||
| // 微信 关单 | |||
| wxOrderService.orderClose(order,payWay); | |||
| // 微信 关单,批量的订单关单有问题 | |||
| //wxOrderService.orderClose(order,payWay); | |||
| // 订单状态更改 | |||
| WxOrder updateOrder = new WxOrder(); | |||
| @@ -370,7 +401,7 @@ public class OrderExpiringSchedule { | |||
| wxOrderService.stockBack(order); | |||
| } | |||
| // 微信 关单 | |||
| wxOrderService.orderClose(updateOrder,payWay); | |||
| //wxOrderService.orderClose(updateOrder,payWay); | |||
| logger.info("拼团订单: " + order.getId() + " create at " + order.getCreateDate() + " expired at " + curDate); | |||
| } | |||
| @@ -391,7 +422,7 @@ public class OrderExpiringSchedule { | |||
| WxPayOrder payOrderQ = new WxPayOrder(); | |||
| payOrderQ.updateTenantInfo(order); | |||
| payOrderQ.setCUserId(order.getCUserId()); | |||
| payOrderQ.setOrderId(order.getId()); | |||
| payOrderQ.setOrderId(EnumComposeOrder.getPayOrderId(order)); | |||
| //payOrderQ.setPayOrderStatus(EnumPayStatus.PAY_STATUS_SUCCESS.getCode()); | |||
| WxPayOrder payOrder = null; | |||
| @@ -17,6 +17,7 @@ import org.apache.commons.lang3.StringUtils; | |||
| import org.slf4j.Logger; | |||
| import org.slf4j.LoggerFactory; | |||
| import org.springframework.beans.factory.annotation.Autowired; | |||
| import org.springframework.scheduling.annotation.Async; | |||
| import org.springframework.scheduling.annotation.Scheduled; | |||
| import org.springframework.stereotype.Component; | |||
| @@ -60,20 +61,23 @@ public class PowerBillAutoBuildSchedule { | |||
| /** | |||
| * 每天5点执行 | |||
| */ | |||
| @Async | |||
| @Scheduled(cron = "0 0 5 * * ?") | |||
| public void powerBillAutoConfigStart() { | |||
| logger.info("自动生成电费账单开始...."); | |||
| int dayOfMonth = LocalDate.now().getDayOfMonth(); | |||
| List<WxPowerBillAutoConfig> wxPowerBillAutoConfigs = wxPowerBillAutoConfigMapper.selectList(new QueryWrapper(null)); | |||
| wxPowerBillAutoConfigs = wxPowerBillAutoConfigs.stream().filter(config -> StringUtils.isNotEmpty(config.getUnitPrice()) | |||
| && StringUtils.isNotEmpty(config.getBuildDay()) | |||
| && StringUtils.isNotEmpty(config.getReceiveDay())) | |||
| .collect(Collectors.toList()); | |||
| for (int i = 0; i < wxPowerBillAutoConfigs.size(); i++) { | |||
| WxPowerBillAutoConfig wxPowerBillAutoConfig = wxPowerBillAutoConfigs.get(i); | |||
| if (String.valueOf(dayOfMonth).equals(wxPowerBillAutoConfig.getBuildDay())) { | |||
| merchantPowerBillConfigStart(wxPowerBillAutoConfig); | |||
| } | |||
| if (null != wxPowerBillAutoConfigs) { | |||
| wxPowerBillAutoConfigs = wxPowerBillAutoConfigs.stream().filter(config -> StringUtils.isNotEmpty(config.getUnitPrice()) | |||
| && StringUtils.isNotEmpty(config.getBuildDay()) | |||
| && StringUtils.isNotEmpty(config.getReceiveDay())) | |||
| .collect(Collectors.toList()); | |||
| for (int i = 0; i < wxPowerBillAutoConfigs.size(); i++) { | |||
| WxPowerBillAutoConfig wxPowerBillAutoConfig = wxPowerBillAutoConfigs.get(i); | |||
| if (String.valueOf(dayOfMonth).equals(wxPowerBillAutoConfig.getBuildDay())) { | |||
| merchantPowerBillConfigStart(wxPowerBillAutoConfig); | |||
| } | |||
| } | |||
| } | |||
| logger.info("自动生成电费账单结束...."); | |||
| } | |||
| @@ -82,8 +86,10 @@ public class PowerBillAutoBuildSchedule { | |||
| WxMerchantPowerBillConfig wxMerchantPowerBillConfig = new WxMerchantPowerBillConfig(); | |||
| wxMerchantPowerBillConfig.updateTenantInfo(wxPowerBillAutoConfig); | |||
| List<WxMerchantPowerBillConfig> wxMerchantPowerBillConfigs = wxMerchantPowerBillConfigMapper.selectList(new QueryWrapper(wxMerchantPowerBillConfig)); | |||
| for (int i = 0; i < wxMerchantPowerBillConfigs.size(); i++) { | |||
| buildPowerBill(wxMerchantPowerBillConfigs.get(i), wxPowerBillAutoConfig); | |||
| if (null != wxMerchantPowerBillConfigs) { | |||
| for (int i = 0; i < wxMerchantPowerBillConfigs.size(); i++) { | |||
| buildPowerBill(wxMerchantPowerBillConfigs.get(i), wxPowerBillAutoConfig); | |||
| } | |||
| } | |||
| } | |||
| @@ -15,6 +15,7 @@ import com.iformall.service.WxProfitSharingOrderService; | |||
| import org.slf4j.Logger; | |||
| import org.slf4j.LoggerFactory; | |||
| import org.springframework.beans.factory.annotation.Autowired; | |||
| import org.springframework.scheduling.annotation.Async; | |||
| import org.springframework.scheduling.annotation.Scheduled; | |||
| import org.springframework.stereotype.Component; | |||
| @@ -40,6 +41,7 @@ public class SharingOrderRedoSchedule { | |||
| return wxMallMapper.findList(wxMall); | |||
| } | |||
| @Async | |||
| @Scheduled(cron = "0 0 2 * * ?") // 每天凌晨02:00分账重试 | |||
| //@Scheduled(cron = "*/10 * * * * ?") // 测试10秒中一次 | |||
| public void sharingOrderResultSchedule() { | |||
| @@ -50,40 +52,44 @@ public class SharingOrderRedoSchedule { | |||
| wxProfitSharingOrder.setType(EnumProfitSharingOrderType.PROFIT_SHARING_SINGLE.getCode()); | |||
| wxProfitSharingOrder.setSharingStatus(EnumProfitSharingOrderStatus.PROFIT_SHARING_APPLY_FAILED.getCode()); | |||
| List<WxProfitSharingOrder> list = wxProfitSharingOrderMapper.findList(wxProfitSharingOrder); | |||
| list.stream().forEach(sharingOrder->{ | |||
| try { | |||
| ResultData result = wxProfitSharingOrderService.redoSharingOrder(sharingOrder); | |||
| if (result.code != ResultData.SUCCESS) { | |||
| logger.error("分账重试失败:" + EnumProfitSharingOrderType.PROFIT_SHARING_SINGLE.getMessage() | |||
| + " ID:" +sharingOrder.getId() | |||
| + " RES:" + result.message); | |||
| } | |||
| } catch (Exception e){ | |||
| logger.error("分账重试失败:" + EnumProfitSharingOrderType.PROFIT_SHARING_SINGLE.getMessage() | |||
| + " ID:" +sharingOrder.getId() | |||
| + " MSG:" + e.getMessage()); | |||
| } | |||
| }); | |||
| if (null != list) { | |||
| list.stream().forEach(sharingOrder->{ | |||
| try { | |||
| ResultData result = wxProfitSharingOrderService.redoSharingOrder(sharingOrder); | |||
| if (result.code != ResultData.SUCCESS) { | |||
| logger.error("分账重试失败:" + EnumProfitSharingOrderType.PROFIT_SHARING_SINGLE.getMessage() | |||
| + " ID:" +sharingOrder.getId() | |||
| + " RES:" + result.message); | |||
| } | |||
| } catch (Exception e){ | |||
| logger.error("分账重试失败:" + EnumProfitSharingOrderType.PROFIT_SHARING_SINGLE.getMessage() | |||
| + " ID:" +sharingOrder.getId() | |||
| + " MSG:" + e.getMessage()); | |||
| } | |||
| }); | |||
| } | |||
| wxProfitSharingOrder.setType(EnumProfitSharingOrderType.PROFIT_SHARING_MULTI.getCode()); | |||
| wxProfitSharingOrder.setSharingStatus(EnumProfitSharingOrderStatus.PROFIT_SHARING_APPLY_FAILED.getCode()); | |||
| list = wxProfitSharingOrderMapper.findList(wxProfitSharingOrder); | |||
| list.stream().forEach(sharingOrder->{ | |||
| try { | |||
| ResultData result = wxProfitSharingOrderService.redoSharingOrder(sharingOrder); | |||
| if (result.code != ResultData.SUCCESS) { | |||
| logger.error("分账重试失败:" + EnumProfitSharingOrderType.PROFIT_SHARING_MULTI.getMessage() | |||
| + " ID:" +sharingOrder.getId() | |||
| + " RES:" + result.message); | |||
| } | |||
| } catch (Exception e){ | |||
| logger.error("分账重试失败:" + EnumProfitSharingOrderType.PROFIT_SHARING_MULTI.getMessage() | |||
| + " ID:" +sharingOrder.getId() | |||
| + " MSG:" + e.getMessage()); | |||
| } | |||
| }); | |||
| if (null != list) { | |||
| list.stream().forEach(sharingOrder->{ | |||
| try { | |||
| ResultData result = wxProfitSharingOrderService.redoSharingOrder(sharingOrder); | |||
| if (result.code != ResultData.SUCCESS) { | |||
| logger.error("分账重试失败:" + EnumProfitSharingOrderType.PROFIT_SHARING_MULTI.getMessage() | |||
| + " ID:" +sharingOrder.getId() | |||
| + " RES:" + result.message); | |||
| } | |||
| } catch (Exception e){ | |||
| logger.error("分账重试失败:" + EnumProfitSharingOrderType.PROFIT_SHARING_MULTI.getMessage() | |||
| + " ID:" +sharingOrder.getId() | |||
| + " MSG:" + e.getMessage()); | |||
| } | |||
| }); | |||
| } | |||
| } | |||
| } | |||
| @@ -15,6 +15,7 @@ import com.iformall.service.WxProfitSharingOrderService; | |||
| import org.slf4j.Logger; | |||
| import org.slf4j.LoggerFactory; | |||
| import org.springframework.beans.factory.annotation.Autowired; | |||
| import org.springframework.scheduling.annotation.Async; | |||
| import org.springframework.scheduling.annotation.Scheduled; | |||
| import org.springframework.stereotype.Component; | |||
| @@ -39,6 +40,7 @@ public class SharingOrderRedoScheduletttttttttttttttttttttttttt { | |||
| return wxMallMapper.findList(wxMall); | |||
| } | |||
| @Async | |||
| @Scheduled(cron = "0 5 0 * * ?") // 每天凌晨02:00分账重试 | |||
| //@Scheduled(cron = "*/10 * * * * ?") // 测试10秒中一次 | |||
| public void sharingOrderResultSchedule() { | |||
| @@ -9,6 +9,7 @@ import com.iformall.service.WxProfitSharingOrderService; | |||
| import org.slf4j.Logger; | |||
| import org.slf4j.LoggerFactory; | |||
| import org.springframework.beans.factory.annotation.Autowired; | |||
| import org.springframework.scheduling.annotation.Async; | |||
| import org.springframework.scheduling.annotation.Scheduled; | |||
| import org.springframework.stereotype.Component; | |||
| @@ -33,6 +34,7 @@ public class SharingOrderResultSchedule { | |||
| return wxMallMapper.findList(wxMall); | |||
| } | |||
| @Async | |||
| @Scheduled(cron = "0 15 0 * * ?") // 每天凌晨00:15更新分账结果 | |||
| //@Scheduled(cron = "*/10 * * * * ?") // 测试10秒中一次 | |||
| public void sharingOrderResultSchedule() { | |||
| @@ -9,6 +9,7 @@ import org.apache.commons.lang3.StringUtils; | |||
| import org.slf4j.Logger; | |||
| import org.slf4j.LoggerFactory; | |||
| import org.springframework.beans.factory.annotation.Autowired; | |||
| import org.springframework.scheduling.annotation.Async; | |||
| import org.springframework.scheduling.annotation.Scheduled; | |||
| import org.springframework.stereotype.Component; | |||
| @@ -31,6 +32,7 @@ public class SysMonitorSchedule { | |||
| @Autowired | |||
| private SysMonitorMapper sysMonitorMapper; | |||
| @Async | |||
| @Scheduled(cron = "0 */5 * * * *?") // 每隔5分钟检查一下各个网址 | |||
| public void checkUrls() { | |||
| if(isFmMonitor) { | |||
| @@ -8,6 +8,7 @@ import me.chanjar.weixin.common.error.WxErrorException; | |||
| import org.slf4j.Logger; | |||
| import org.slf4j.LoggerFactory; | |||
| import org.springframework.beans.factory.annotation.Autowired; | |||
| import org.springframework.scheduling.annotation.Async; | |||
| import org.springframework.scheduling.annotation.Scheduled; | |||
| import org.springframework.stereotype.Component; | |||
| @@ -28,7 +29,7 @@ public class WeChatAccessTokenSchedule { | |||
| @Autowired | |||
| MaUtil maUtil; | |||
| @Async | |||
| @Scheduled(cron = "0 1 * * * ?") // 每小时第一分钟执行 | |||
| public void getAccessTokens() { | |||
| @@ -15,6 +15,7 @@ import org.apache.commons.lang3.StringUtils; | |||
| import org.slf4j.Logger; | |||
| import org.slf4j.LoggerFactory; | |||
| import org.springframework.beans.factory.annotation.Autowired; | |||
| import org.springframework.scheduling.annotation.Async; | |||
| import org.springframework.scheduling.annotation.Scheduled; | |||
| import org.springframework.stereotype.Component; | |||
| @@ -48,7 +49,7 @@ public class WxAppVisitSchedule { | |||
| @Autowired | |||
| MaUtil maUtil; | |||
| @Async | |||
| @Scheduled(cron = "0 0 9/1 * * ? ") //早晨9点开始每小时取一次,获取前一日,微信时间为GMT | |||
| public void daliyVisitRetrive() { | |||
| try { | |||
| @@ -80,7 +81,7 @@ public class WxAppVisitSchedule { | |||
| } | |||
| } | |||
| @Async | |||
| @Scheduled(cron = "0 0 2 * * ? ") //2点做一次补录 | |||
| public void completeVisitRetrive() { | |||
| try { | |||
| @@ -8,6 +8,7 @@ import org.apache.commons.lang3.StringUtils; | |||
| import org.slf4j.Logger; | |||
| import org.slf4j.LoggerFactory; | |||
| import org.springframework.beans.factory.annotation.Autowired; | |||
| import org.springframework.scheduling.annotation.Async; | |||
| import org.springframework.scheduling.annotation.Scheduled; | |||
| import org.springframework.stereotype.Component; | |||
| @@ -34,6 +35,7 @@ public class WxCUserTagsSchedule { | |||
| @Autowired | |||
| WxMallService wxMallService; | |||
| @Async | |||
| // TODO 先不执行打标签操作了, 数据量太大,导致数据库CPU 100% | |||
| //@Scheduled(cron = "0 0 0 25 * ?") // 每月25日凌晨01:00对会员列表扫描补录标签 | |||
| @Scheduled(cron = "0 0 2 * * ?") // 测试1分钟一次 | |||
| @@ -61,13 +63,15 @@ public class WxCUserTagsSchedule { | |||
| PageInfo page; | |||
| do{ | |||
| page = wxCUserBasicInfoService.listAsPage(wxCUserBasicInfo, pageIndex++, pageSize); | |||
| page.getList().stream().forEach(cubi -> { | |||
| try { | |||
| wxCUserTagsService.triggerAssignTags(EnumAssignTagsTrigger.ASSIGN_TAGS_TRIGGER_SCAN, new WxCUserBasicTagVo((WxCUserBasicInfo)cubi,mall.getTenantId()),mall,null); | |||
| }catch(Exception e) { | |||
| logger.error("wxCUserTagsSchedule error."+cubi.toString(),e); | |||
| } | |||
| }); | |||
| if (null != page && null != page.getList()) { | |||
| page.getList().stream().forEach(cubi -> { | |||
| try { | |||
| wxCUserTagsService.triggerAssignTags(EnumAssignTagsTrigger.ASSIGN_TAGS_TRIGGER_SCAN, new WxCUserBasicTagVo((WxCUserBasicInfo)cubi,mall.getTenantId()),mall,null); | |||
| }catch(Exception e) { | |||
| logger.error("wxCUserTagsSchedule error."+cubi.toString(),e); | |||
| } | |||
| }); | |||
| } | |||
| } while ((page.isHasNextPage())); | |||
| } | |||
| @@ -2,6 +2,7 @@ package com.iformall.schedule; | |||
| import com.iformall.service.WxMsgRecordService; | |||
| import org.springframework.beans.factory.annotation.Value; | |||
| import org.springframework.scheduling.annotation.Async; | |||
| import org.springframework.scheduling.annotation.Scheduled; | |||
| import org.springframework.stereotype.Component; | |||
| @@ -16,6 +17,7 @@ public class WxMsgRecordSchedule { | |||
| @Value("${fm.clear_data_before_msg_record}") | |||
| private int monthBefore; | |||
| @Async | |||
| @Scheduled(cron = "0 0 1 1 * ?") // 每月1日凌晨01:00清理过期的wx_msg_record表 | |||
| public void clearOldData() { | |||
| msgRecordService.clearOldData(monthBefore); | |||
| @@ -140,6 +140,10 @@ public enum ErrorCode{ | |||
| COUPON_ONLY_FOR_NEW_MEMBER(2044, "您已经参加过新会员活动"), | |||
| COUPON_ALREADY_IN_NEW_MEMBER(2045, "您已经不是新用户"), | |||
| COUPON_VALID_NOT_SUPPORTED(2046, "券类型不支持"), | |||
| COUPON_IS_EMPTY_GIFT(2120, "子券不存在"), | |||
| COUPON_IS_TAKE_OFF_GIFT(2122, "子券存在作废券"), | |||
| COUPON_VALID_DATE_ERR_GIFT(2135, "存在子券有效期在券包有效期之前"), | |||
| /** | |||
| * 车流 2040 | |||
| */ | |||
| @@ -223,6 +227,16 @@ public enum ErrorCode{ | |||
| COUPON_HANDSEL_VERIFY(4010, "商户发券异常"), | |||
| COUPON_MANJIAN_USE_PRICE_NO_ALLOW_(4011, "满减券金额不符合条件"), | |||
| COUPON_ORDER_TYPE_NOT_SUPPORTED(4012, "券类型不支持"), | |||
| COUPON_ORDER_SEND_ERROR(4013, "券包发卷失败"), | |||
| COUPON_ORDER_DATE_ERROR(4014, "券包数据异常"), | |||
| /** | |||
| * 商品 | |||
| */ | |||
| COUPON_GOODS_DELIVERY_NULL(5000,"物流信息为空"), | |||
| COUPON_GOODS_TYPE_NOT_SUPPORTED(5001,"该类型不支持发货"), | |||
| COUPON_GOODS_STATUS_NOT_SUPPORTED(5002,"该状态不支持发货"), | |||
| COUPON_GOODS_ADDRESS_ERROR(5003,"配送信息错误"), | |||
| /** | |||
| * 卡 | |||
| @@ -76,6 +76,13 @@ public class BaseMyBatisConfiguration { | |||
| basicInfoSharding.setRule(EnumShardingRule.HASH.getCode()); | |||
| shardingList.add(basicInfoSharding); | |||
| ShardingSphere basicInfoAddressSharding = new ShardingSphere(); | |||
| basicInfoAddressSharding.setColumn("final_tenant_id"); | |||
| basicInfoAddressSharding.setTableName("user_basic_info_address"); | |||
| basicInfoAddressSharding.setCount(100); | |||
| basicInfoAddressSharding.setRule(EnumShardingRule.HASH.getCode()); | |||
| shardingList.add(basicInfoAddressSharding); | |||
| ShardingSphere basicSignSharding = new ShardingSphere(); | |||
| basicSignSharding.setColumn("tenant_id"); | |||
| basicSignSharding.setTableName("wx_c_user_basic_sign"); | |||
| @@ -247,6 +254,13 @@ public class BaseMyBatisConfiguration { | |||
| alipayCUserSharding.setRule(EnumShardingRule.HASH.getCode()); | |||
| shardingList.add(alipayCUserSharding); | |||
| ShardingSphere wxComposeOrderSharding = new ShardingSphere(); | |||
| wxComposeOrderSharding.setColumn("tenant_id"); | |||
| wxComposeOrderSharding.setTableName("wx_batch_order"); | |||
| wxComposeOrderSharding.setCount(100); | |||
| wxComposeOrderSharding.setRule(EnumShardingRule.HASH.getCode()); | |||
| shardingList.add(wxComposeOrderSharding); | |||
| //初始化 | |||
| shardingSpherePlugin.setShardingSpheres(shardingList); | |||
| Properties properties = new Properties(); | |||
| @@ -0,0 +1,25 @@ | |||
| package com.iformall.domain.dto; | |||
| import com.iformall.domain.po.UserBasicInfoAddress; | |||
| import lombok.Data; | |||
| import java.io.Serializable; | |||
| import com.iformall.domain.po.WxCoupon; | |||
| @Data | |||
| public class OrderComposeSaveDto implements Serializable { | |||
| private static final long serialVersionUID = 1L; | |||
| OrderSaveDto signleOrder;//单个券/实物商品 | |||
| int count;//购买数量 | |||
| Integer shippingType = 0;//配送类型 | |||
| UserBasicInfoAddress address;//配送地址 | |||
| WxCoupon wxCoupon; | |||
| } | |||
| @@ -21,5 +21,10 @@ public class OrderSaveDto implements Serializable { | |||
| //被操作人的ID 供A端使用 | |||
| private Long userId; | |||
| public boolean isPressOrder() { | |||
| boolean isPress = this.getPress() != null ? this.getPress() : false; | |||
| return isPress; | |||
| } | |||
| } | |||
| @@ -0,0 +1,86 @@ | |||
| package com.iformall.domain.po; | |||
| import com.baomidou.mybatisplus.annotation.TableField; | |||
| import com.baomidou.mybatisplus.annotation.TableName; | |||
| import com.fasterxml.jackson.annotation.JsonIgnore; | |||
| import com.iformall.domain.po.base.TenantEntity; | |||
| import com.iformall.domain.po.base.TenantEntityWithoutFinalTenantId; | |||
| import lombok.Data; | |||
| import lombok.EqualsAndHashCode; | |||
| import lombok.ToString; | |||
| import org.apache.commons.lang3.StringUtils; | |||
| import java.util.Date; | |||
| @TableName(value = "user_basic_info_address") | |||
| @Data | |||
| @ToString(callSuper = true) | |||
| @EqualsAndHashCode(callSuper = true) | |||
| public class UserBasicInfoAddress extends TenantEntityWithoutFinalTenantId { | |||
| protected Long id; | |||
| @io.swagger.annotations.ApiModelProperty(value="如果是集团版的,存集团版的tenantId,如果是商场,则存商场",name="finalTenantId") | |||
| private String finalTenantId; | |||
| @JsonIgnore | |||
| @TableField(exist = false) | |||
| protected String shardFinalTableSuffix; | |||
| public String getShardFinalTableSuffix(){ | |||
| if(StringUtils.isNotBlank(finalTenantId)){ | |||
| shardFinalTableSuffix = "_" + Integer.parseInt(finalTenantId)%100; | |||
| } | |||
| return shardFinalTableSuffix; | |||
| } | |||
| @io.swagger.annotations.ApiModelProperty(value="",name="userId") | |||
| private Long userId; | |||
| @io.swagger.annotations.ApiModelProperty(value="收货人",name="consignee") | |||
| private String consignee; | |||
| @io.swagger.annotations.ApiModelProperty(value="国家",name="country") | |||
| private String country; | |||
| @io.swagger.annotations.ApiModelProperty(value="省",name="province") | |||
| private String province; | |||
| @io.swagger.annotations.ApiModelProperty(value="市",name="city") | |||
| private String city; | |||
| @io.swagger.annotations.ApiModelProperty(value="区",name="district") | |||
| private String district; | |||
| @io.swagger.annotations.ApiModelProperty(value="所属地区",name="region") | |||
| private String region; | |||
| private String address; | |||
| @io.swagger.annotations.ApiModelProperty(value="更新时间",name="updateDate") | |||
| private Date updateDate; | |||
| @io.swagger.annotations.ApiModelProperty(value="创建时间",name="createDate") | |||
| private Date createDate; | |||
| @io.swagger.annotations.ApiModelProperty(value="邮编",name="zipcode") | |||
| private String zipcode; | |||
| @io.swagger.annotations.ApiModelProperty(value="手机号",name="mobile") | |||
| private String mobile; | |||
| @io.swagger.annotations.ApiModelProperty(value="",name="isDefault") | |||
| private Integer isDefault; | |||
| @io.swagger.annotations.ApiModelProperty(value="标识",name="mark") | |||
| private String mark; | |||
| public void undateFinalTenantId(TenantEntity tenantEntity){ | |||
| setFinalTenantId(tenantEntity.getTenantId()); | |||
| if(StringUtils.isNotBlank(tenantEntity.getParentTenantId())){ | |||
| setFinalTenantId(tenantEntity.getParentTenantId()); | |||
| } | |||
| } | |||
| } | |||
| @@ -0,0 +1,31 @@ | |||
| package com.iformall.domain.po; | |||
| import com.baomidou.mybatisplus.annotation.TableName; | |||
| import com.iformall.domain.po.base.TenantEntity; | |||
| import lombok.Data; | |||
| import lombok.EqualsAndHashCode; | |||
| import lombok.ToString; | |||
| import java.util.Date; | |||
| @TableName(value = "wx_batch_order") | |||
| @Data | |||
| @ToString(callSuper = true) | |||
| @EqualsAndHashCode(callSuper = true) | |||
| public class WxBatchOrder extends TenantEntity { | |||
| /** | |||
| * | |||
| */ | |||
| private static final long serialVersionUID = 1L; | |||
| protected Long id; | |||
| @io.swagger.annotations.ApiModelProperty(value="c端用户id",name="cUserId") | |||
| private Long cUserId; | |||
| @io.swagger.annotations.ApiModelProperty(value="支付金额(分):允许有负数,退款时为负值。",name="payment") | |||
| private Integer payment; | |||
| @io.swagger.annotations.ApiModelProperty(value="创建时间/砍价开始时间",name="createDate") | |||
| private Date createDate; | |||
| @io.swagger.annotations.ApiModelProperty(value="更新时间",name="updateDate") | |||
| private Date updateDate; | |||
| } | |||
| @@ -29,6 +29,9 @@ public class WxCoupon extends TenantEntity { | |||
| @TableField(exist = false) | |||
| protected List<Integer> types; | |||
| @TableField(exist = false) | |||
| protected List<Integer> sendTypes; | |||
| @TableField(exist = false) | |||
| protected List<Long> notinTypes; | |||
| @@ -43,6 +46,10 @@ public class WxCoupon extends TenantEntity { | |||
| @SortColumn(column = "use_price") | |||
| private String usePriceStr; | |||
| @TableField(exist = false) | |||
| @SortColumn(column = "freight_price") | |||
| private String freightPriceStr; | |||
| @TableField(exist = false) | |||
| @SortColumn(column = "price") | |||
| private String priceStr; | |||
| @@ -67,7 +74,7 @@ public class WxCoupon extends TenantEntity { | |||
| @io.swagger.annotations.ApiModelProperty(value="查询-结束时间",name="enddate") | |||
| private Date enddate; | |||
| @io.swagger.annotations.ApiModelProperty(value="券类型(1.满减券,2.代金券,3.团购券,4.礼品券,5.停车券,6.多商户券,8.砍价券,9.团购券,50.积分券,51.积分停车券,100.消费卡)",name="type") | |||
| @io.swagger.annotations.ApiModelProperty(value="券类型(1.满减券,2.代金券,3.团购券,4.礼品券,5.停车券,6.多商户券,8.砍价券,9.团购券,10.预购商品,11.可配送商品,12.券礼包,50.积分券,51.积分停车券,100.消费卡)",name="type") | |||
| private Integer type; | |||
| @io.swagger.annotations.ApiModelProperty(value="封面图",name="coverImg") | |||
| private String coverImg; | |||
| @@ -86,6 +93,8 @@ public class WxCoupon extends TenantEntity { | |||
| private Integer salePrice; | |||
| @io.swagger.annotations.ApiModelProperty(value="使用条件金额(适用于类型1,2,3,4)",name="usePrice") | |||
| private Integer usePrice; | |||
| @io.swagger.annotations.ApiModelProperty(value="运费",name="freightPrice") | |||
| private Integer freightPrice; | |||
| //EnumCouponUseLimitRule | |||
| @io.swagger.annotations.ApiModelProperty(value="限领规则",name="useLimitRule") | |||
| private Integer useLimitRule; | |||
| @@ -213,6 +222,13 @@ public class WxCoupon extends TenantEntity { | |||
| @io.swagger.annotations.ApiModelProperty(value="富文本内容",name="html") | |||
| private String html; | |||
| //List<Long> String | |||
| @io.swagger.annotations.ApiModelProperty(value="卷包内容",name="giftList") | |||
| private String giftList; | |||
| @TableField(exist = false) | |||
| private List<WxCoupon> giftCouponList; | |||
| @TableField(exist = false) | |||
| @SortColumn(column = "press_count") | |||
| private Integer pressSendCount; | |||
| @@ -279,6 +295,13 @@ public class WxCoupon extends TenantEntity { | |||
| return usePriceStr; | |||
| } | |||
| public String getFreightPriceStr() { | |||
| if(freightPrice!=null) { | |||
| freightPriceStr = new BigDecimal(freightPrice).divide(new BigDecimal(100)).toString(); | |||
| } | |||
| return freightPriceStr; | |||
| } | |||
| public String getPriceStr() { | |||
| if(price!=null) { | |||
| priceStr = new BigDecimal(price).divide(new BigDecimal(100)).toString(); | |||
| @@ -340,5 +363,4 @@ public class WxCoupon extends TenantEntity { | |||
| } | |||
| return false; | |||
| } | |||
| } | |||
| @@ -3,13 +3,16 @@ package com.iformall.domain.po; | |||
| import com.baomidou.mybatisplus.annotation.TableField; | |||
| import com.baomidou.mybatisplus.annotation.TableName; | |||
| import com.fasterxml.jackson.annotation.JsonFormat; | |||
| import com.iformall.common.SortColumn; | |||
| import com.iformall.domain.po.base.TenantEntity; | |||
| import lombok.Data; | |||
| import lombok.EqualsAndHashCode; | |||
| import lombok.ToString; | |||
| import java.math.BigDecimal; | |||
| import java.text.DecimalFormat; | |||
| import java.util.Date; | |||
| import java.util.List; | |||
| @TableName(value = "wx_coupon_order") | |||
| @Data | |||
| @@ -21,7 +24,7 @@ public class WxCouponOrder extends TenantEntity { | |||
| @io.swagger.annotations.ApiModelProperty(value = "卡券ID", name = "couponId") | |||
| private Long couponId; | |||
| @io.swagger.annotations.ApiModelProperty(value = "券类型(1.满减券,2.代金券,3.团购券,4.礼品券,5.停车券,6.多商户券,8.砍价券,9.团购券,100.消费卡)", name = "couponType") | |||
| @io.swagger.annotations.ApiModelProperty(value = "券类型(1.满减券,2.代金券,3.团购券,4.礼品券,5.停车券,6.多商户券,8.砍价券,9.团购券,10.预购商品,11.可配送商品,12.券礼包,50.积分券,51.积分停车券,100.消费卡)", name = "couponType") | |||
| private Integer couponType; | |||
| @io.swagger.annotations.ApiModelProperty(value = "c端用户id", name = "cUserId") | |||
| private Long cUserId; | |||
| @@ -54,7 +57,17 @@ public class WxCouponOrder extends TenantEntity { | |||
| @io.swagger.annotations.ApiModelProperty(value="赠券商户编号",name="sendMerchantId") | |||
| private Long sendMerchantId; | |||
| @io.swagger.annotations.ApiModelProperty(value="赠券商户员工编号",name="sendMerchantUserId") | |||
| private Long sendMerchantUserId; | |||
| private Long sendMerchantUserId; | |||
| @io.swagger.annotations.ApiModelProperty(value="组合订单类型EnumComposeOrder",name="composeOrderType") | |||
| private Integer composeOrderType; | |||
| @io.swagger.annotations.ApiModelProperty(value="组合订单编号",name="composeOrderId") | |||
| private Long composeOrderId; | |||
| @io.swagger.annotations.ApiModelProperty(value="父订单编号",name="parentCouponOrderId") | |||
| private Long parentCouponOrderId; | |||
| @io.swagger.annotations.ApiModelProperty(value="商品数量",name="couponNumber") | |||
| private Integer couponNumber; | |||
| @TableField(exist = false) | |||
| private String couponName; | |||
| @@ -120,4 +133,34 @@ public class WxCouponOrder extends TenantEntity { | |||
| this.cUserId = cUserId; | |||
| } | |||
| @io.swagger.annotations.ApiModelProperty(value="运费",name="freightPrice") | |||
| private Integer freightPrice; | |||
| @TableField(exist = false) | |||
| @SortColumn(column = "freight_price") | |||
| private String freightPriceStr; | |||
| public String getFreightPriceStr() { | |||
| if(freightPrice!=null) { | |||
| freightPriceStr = new BigDecimal(freightPrice).divide(new BigDecimal(100)).toString(); | |||
| } | |||
| return freightPriceStr; | |||
| } | |||
| @io.swagger.annotations.ApiModelProperty(value="收货地址",name="shippingAddress") | |||
| private String shippingAddress; | |||
| @io.swagger.annotations.ApiModelProperty(value="配送类型 0:默认(无) 1:自提 2:配送",name="shippingType") | |||
| private Integer shippingType; | |||
| @io.swagger.annotations.ApiModelProperty(value="配送状态 0:默认(无) 1*:自提 2*:配送",name="shippingStatus") | |||
| private Integer shippingStatus; | |||
| @io.swagger.annotations.ApiModelProperty(value="配送信息",name="deliveryInfo") | |||
| private String deliveryInfo; | |||
| @TableField(exist = false) | |||
| private List<Integer> shippingStatuss; | |||
| } | |||
| @@ -3,6 +3,7 @@ package com.iformall.domain.po; | |||
| import cn.afterturn.easypoi.excel.annotation.Excel; | |||
| import com.baomidou.mybatisplus.annotation.TableField; | |||
| import com.baomidou.mybatisplus.annotation.TableName; | |||
| import com.iformall.common.SortColumn; | |||
| import com.iformall.domain.po.base.TenantEntity; | |||
| import lombok.Data; | |||
| import lombok.EqualsAndHashCode; | |||
| @@ -93,7 +94,22 @@ public class WxOrder extends TenantEntity { | |||
| @io.swagger.annotations.ApiModelProperty(value="总计支付金额(分),收银台用券时使用",name="totalPayment") | |||
| private Integer totalPayment; | |||
| @io.swagger.annotations.ApiModelProperty(value="组合订单编号",name="composeOrderId") | |||
| private Long composeOrderId; | |||
| @io.swagger.annotations.ApiModelProperty(value="商品数量",name="couponNumber") | |||
| private Integer couponNumber; | |||
| @io.swagger.annotations.ApiModelProperty(value="组合订单类型EnumComposeOrder",name="composeOrderType") | |||
| private Integer composeOrderType; | |||
| @io.swagger.annotations.ApiModelProperty(value="父订单编号",name="parentOrderId") | |||
| private Long parentOrderId; | |||
| @TableField(exist = false) | |||
| protected List<Integer> statusS; | |||
| @@ -104,7 +120,7 @@ public class WxOrder extends TenantEntity { | |||
| @TableField(exist = false) | |||
| private String title; | |||
| @Excel(name = "商品属性", width = 20, orderNum = "4", replace = {"消费卡_1", "优惠券_2", "砍价_3", "拼团_4", " _-1"}) | |||
| @Excel(name = "商品属性", width = 20, orderNum = "4", replace = {"消费卡_1", "优惠券_2", "砍价_3", "拼团_4","可配送商品_6","券礼包_7", " _-1"}) | |||
| @TableField(exist = false) | |||
| private Integer attribute; | |||
| @@ -127,4 +143,25 @@ public class WxOrder extends TenantEntity { | |||
| @TableField(exist = false) | |||
| private String paymentStr; | |||
| @io.swagger.annotations.ApiModelProperty(value="运费",name="freightPrice") | |||
| private Integer freightPrice; | |||
| @TableField(exist = false) | |||
| @SortColumn(column = "freight_price") | |||
| private String freightPriceStr; | |||
| public String getFreightPriceStr() { | |||
| if(freightPrice!=null) { | |||
| freightPriceStr = new BigDecimal(freightPrice).divide(new BigDecimal(100)).toString(); | |||
| } | |||
| return freightPriceStr; | |||
| } | |||
| @io.swagger.annotations.ApiModelProperty(value="收货地址",name="shippingAddress") | |||
| private String shippingAddress; | |||
| @io.swagger.annotations.ApiModelProperty(value="配送类型 0:默认(无) 1:自提 2:配送",name="shippingType") | |||
| private Integer shippingType; | |||
| } | |||
| @@ -1,13 +1,19 @@ | |||
| package com.iformall.domain.po; | |||
| import com.alibaba.fastjson.JSON; | |||
| import com.alibaba.fastjson.JSONObject; | |||
| import com.baomidou.mybatisplus.annotation.TableName; | |||
| import com.iformall.domain.po.base.TenantEntity; | |||
| import com.iformall.service.order.entity.WxComposeChildOrderShare; | |||
| import lombok.Data; | |||
| import lombok.EqualsAndHashCode; | |||
| import lombok.ToString; | |||
| import java.util.*; | |||
| import org.apache.commons.lang3.StringUtils; | |||
| @TableName(value = "wx_pay_order") | |||
| @Data | |||
| @EqualsAndHashCode(callSuper = true) | |||
| @@ -52,11 +58,28 @@ public class WxPayOrder extends TenantEntity { | |||
| private Integer shareAmount; | |||
| @io.swagger.annotations.ApiModelProperty(value="通道费差(购买时刻的通道费差,分账完结时使用)",name="rateAmount") | |||
| private Integer rateAmount; | |||
| @io.swagger.annotations.ApiModelProperty(value="子订单分账金额json",name="childOrderShare") | |||
| private String childOrderShare; | |||
| public WxComposeChildOrderShare getChildOrderShare(Long wxOrderId) { | |||
| if (StringUtils.isBlank(this.childOrderShare)) { | |||
| return new WxComposeChildOrderShare(this.payAmount, this.shareAmount, this.rateAmount); | |||
| } | |||
| Map childs = JSON.parseObject(this.childOrderShare, Map.class); | |||
| JSONObject childOrderShare = (JSONObject) childs.get(String.valueOf(wxOrderId)); | |||
| if (null != childOrderShare) { | |||
| return new WxComposeChildOrderShare(childOrderShare.getInteger("realPayMent"), childOrderShare.getInteger("shareAmount"), childOrderShare.getInteger("rateAmount")); | |||
| } | |||
| return null; | |||
| } | |||
| @io.swagger.annotations.ApiModelProperty(value="支付失败原因",name="failReason") | |||
| private String failReason; | |||
| @io.swagger.annotations.ApiModelProperty(value="支付后结果来源(0:callback, 1:query)",name="payEndFrom") | |||
| private Integer payEndFrom; | |||
| @io.swagger.annotations.ApiModelProperty(value="是否为组合订单,1-是 0-不是",name="composeOrder") | |||
| private Integer composeOrder; | |||
| @io.swagger.annotations.ApiModelProperty(value="支付后结果来源(0:inside, 1:POS支付)",name="payFrom") | |||
| private Integer payFrom; | |||
| @io.swagger.annotations.ApiModelProperty(value="支付订单号,来源于POS, inside时,填写couponOrderId",name="posPayOrderId") | |||
| @@ -65,12 +65,12 @@ public class BaseTenantEntity extends BaseEntity { | |||
| } | |||
| } | |||
| public TenantEntity getTenantInfo() { | |||
| TenantEntity tenantEntity = new TenantEntity(); | |||
| tenantEntity.setTenantId(tenantId); | |||
| tenantEntity.setParentTenantId(parentTenantId); | |||
| return tenantEntity; | |||
| } | |||
| // public TenantEntity getTenantInfo() { | |||
| // TenantEntity tenantEntity = new TenantEntity(); | |||
| // tenantEntity.setTenantId(tenantId); | |||
| // tenantEntity.setParentTenantId(parentTenantId); | |||
| // return tenantEntity; | |||
| // } | |||
| public String getTenantId() { | |||
| return tenantId; | |||
| @@ -16,6 +16,6 @@ public class FmInsideCouponVerifyMsg extends BaseMsg{ | |||
| private String parentTenantId; | |||
| @io.swagger.annotations.ApiModelProperty(value = "券包ID", name = "couponOrderId") | |||
| private Long couponOrderId; | |||
| @io.swagger.annotations.ApiModelProperty(value = "B端用户ID", name = "bUserId") | |||
| private Long bUserId; | |||
| @io.swagger.annotations.ApiModelProperty(value = "B端商户ID", name = "merchantId") | |||
| private Long merchantId; | |||
| } | |||
| @@ -32,6 +32,12 @@ public class WxCUserVo extends WxCUser { | |||
| @io.swagger.annotations.ApiModelProperty(value="姓名",name="name") | |||
| private String name; | |||
| @io.swagger.annotations.ApiModelProperty(value="高",name="height") | |||
| private String height; | |||
| @io.swagger.annotations.ApiModelProperty(value="重",name="weight") | |||
| private String weight; | |||
| @io.swagger.annotations.ApiModelProperty(value="折扣率",name="discountRate") | |||
| private Integer discountRate; | |||
| @@ -21,7 +21,7 @@ public class WxCouponOrderBVo extends WxCouponOrder { | |||
| private static final long serialVersionUID = 6687954932922444531L; | |||
| @Excel(name = "券码", width = 20, orderNum = "1", prefix = "`") | |||
| @Excel(name = "兑换码", width = 20, orderNum = "1", prefix = "`") | |||
| protected Long id; | |||
| /** 基础购买到的券信息 */ | |||
| @@ -32,7 +32,7 @@ public class WxCouponOrderBVo extends WxCouponOrder { | |||
| @io.swagger.annotations.ApiModelProperty(value = "该订单对应券的实际过期时间 ", name = "expiredTime") | |||
| private Date expiredTime; | |||
| @Excel(name = "券名称", width = 50, orderNum = "2") | |||
| @Excel(name = "券/商品名称", width = 50, orderNum = "2") | |||
| @io.swagger.annotations.ApiModelProperty(value="券名称",name="title") | |||
| private String title; | |||
| @@ -93,7 +93,7 @@ public class WxCouponOrderBVo extends WxCouponOrder { | |||
| @io.swagger.annotations.ApiModelProperty(value="面额",name="price") | |||
| private Integer price; | |||
| @Excel(name = "所属业态", width = 50, orderNum = "11", replace = {"餐饮_1", "娱乐_2", "服饰_3", "亲子_4", "超市_5", "其它_6", "美妆_7", "珠宝_8", "服务_9", "家居_10"}) | |||
| @Excel(name = "所属业态", width = 50, orderNum = "11", replace = {"餐饮_1", "娱乐_2", "服饰_3", "亲子_4", "超市_5", "其它_6", "美妆_7", "珠宝_8", "服务_9", "家居_10", "_null"}) | |||
| @io.swagger.annotations.ApiModelProperty(value = "业态", name = "business") | |||
| private Integer business; | |||
| @@ -134,7 +134,7 @@ public class WxCouponOrderBVo extends WxCouponOrder { | |||
| private String bUserName; | |||
| @io.swagger.annotations.ApiModelProperty(value="b端用户手机号",name="bUserPhone") | |||
| private String bUserPhone; | |||
| @Excel(name = "券所属商户", width = 50, orderNum = "3") | |||
| @Excel(name = "所属商户", width = 50, orderNum = "3") | |||
| @io.swagger.annotations.ApiModelProperty(value="使用券商户名",name="merchantName") | |||
| private String merchantName; | |||
| @@ -189,7 +189,7 @@ public class WxCouponOrderBVo extends WxCouponOrder { | |||
| @TableField(exist = false) | |||
| private Long couponId; | |||
| @Excel(name = "券类型", width = 50, orderNum = "15", replace = {"满减券_1", "代金券_2", "团购券_3", "礼品券_4", "停车券_5", "通用券_6", "砍价券_8", "团购券_9", "预购商品_10", "积分券_50", "积分停车券_51", "消费卡_100"}) | |||
| @Excel(name = "类型", width = 50, orderNum = "15", replace = {"满减券_1", "代金券_2", "团购券_3", "礼品券_4", "停车券_5", "通用券_6", "砍价券_8", "团购券_9", "预购商品_10", "可配送商品_11", "券礼包_12", "积分券_50", "积分停车券_51", "消费卡_100"}) | |||
| @TableField(exist = false) | |||
| private Integer couponType; | |||
| @@ -249,5 +249,12 @@ public class WxCouponOrderBVo extends WxCouponOrder { | |||
| } | |||
| return couponPriceStr; | |||
| } | |||
| @Excel(name = "配送类型", width = 50, orderNum = "16", replace = {"线上购买_0", "到店自提_1", "配送到家_2"}) | |||
| @io.swagger.annotations.ApiModelProperty(value="配送类型 0:默认(无) 1:自提 2:配送",name="shippingType") | |||
| private Integer shippingType; | |||
| @Excel(name = "配送状态", width = 50, orderNum = "17", replace = {"线上购买_0", "待自提_10", "待自提_14", "已自提_15", "待发货_20", "待收货_24", "已收货_25"}) | |||
| @io.swagger.annotations.ApiModelProperty(value="配送状态 0:默认(无) 1*:自提 2*:配送",name="shippingStatus") | |||
| private Integer shippingStatus; | |||
| } | |||
| @@ -47,4 +47,8 @@ public class WxOrderCouponPressVo extends WxOrder { | |||
| @io.swagger.annotations.ApiModelProperty(value="商户列表",name="orderPressList") | |||
| private List<WxOrderPressVo> orderPressList; | |||
| @io.swagger.annotations.ApiModelProperty(value="组合订单类型EnumComposeOrder",name="composeOrderType") | |||
| private Integer composeOrderType; | |||
| } | |||
| @@ -2,10 +2,13 @@ package com.iformall.domain.vo; | |||
| import com.baomidou.mybatisplus.annotation.TableField; | |||
| import com.fasterxml.jackson.annotation.JsonIgnoreProperties; | |||
| import com.iformall.common.SortColumn; | |||
| import com.iformall.domain.po.WxCoupon; | |||
| import com.iformall.domain.po.base.TenantEntity; | |||
| import lombok.Data; | |||
| import lombok.EqualsAndHashCode; | |||
| import java.math.BigDecimal; | |||
| import java.util.Date; | |||
| import java.util.List; | |||
| @@ -20,6 +23,11 @@ public class WxOrderCouponVo extends TenantEntity { | |||
| @TableField(exist = false) | |||
| private Integer validStatus; | |||
| @TableField(exist = false) | |||
| private Integer level; | |||
| @TableField(exist = false) | |||
| private List<WxOrderCouponVo> orderCouponVoList; | |||
| /** 基础购买到的券信息 */ | |||
| @io.swagger.annotations.ApiModelProperty(value="订单码;正反向交易保持一致。",name="orderNumber") | |||
| private Long orderNumber; | |||
| @@ -103,5 +111,50 @@ public class WxOrderCouponVo extends TenantEntity { | |||
| @io.swagger.annotations.ApiModelProperty(value = "补贴额", name = "subsidyNum") | |||
| private Integer subsidyNum; | |||
| @io.swagger.annotations.ApiModelProperty(value="组合订单类型EnumComposeOrder",name="composeOrderType") | |||
| private Integer composeOrderType; | |||
| @io.swagger.annotations.ApiModelProperty(value="组合订单编号",name="composeOrderId") | |||
| private Long composeOrderId; | |||
| @io.swagger.annotations.ApiModelProperty(value="父订单编号",name="parentOrderId") | |||
| private Long parentOrderId; | |||
| @io.swagger.annotations.ApiModelProperty(value="商品数量",name="couponNumber") | |||
| private Integer couponNumber; | |||
| @io.swagger.annotations.ApiModelProperty(value="运费",name="freightPrice") | |||
| private Integer freightPrice; | |||
| @TableField(exist = false) | |||
| @SortColumn(column = "freight_price") | |||
| private String freightPriceStr; | |||
| public String getFreightPriceStr() { | |||
| if(freightPrice!=null) { | |||
| freightPriceStr = new BigDecimal(freightPrice).divide(new BigDecimal(100)).toString(); | |||
| } | |||
| return freightPriceStr; | |||
| } | |||
| @io.swagger.annotations.ApiModelProperty(value="收货地址",name="shippingAddress") | |||
| private String shippingAddress; | |||
| @io.swagger.annotations.ApiModelProperty(value="配送类型 0:默认(无) 1:自提 2:配送",name="shippingType") | |||
| private Integer shippingType; | |||
| @io.swagger.annotations.ApiModelProperty(value="配送状态 0:默认(无) 1*:自提 2*:配送",name="shippingStatus") | |||
| private Integer shippingStatus; | |||
| @io.swagger.annotations.ApiModelProperty(value="配送信息",name="deliveryInfo") | |||
| private String deliveryInfo; | |||
| @io.swagger.annotations.ApiModelProperty(value="卷包内容",name="giftList") | |||
| private String giftList; | |||
| @TableField(exist = false) | |||
| private List<WxCoupon> giftCouponList; | |||
| } | |||
| @@ -0,0 +1,67 @@ | |||
| package com.iformall.enums; | |||
| import com.iformall.domain.po.WxOrder; | |||
| /** | |||
| * @author gongbiao | |||
| */ | |||
| public enum EnumComposeOrder { | |||
| SINGLE(0, "单个订单类型,如拼团,砍价"), | |||
| ONE_NUMBER_ORDER_BATCH(1, "购物车式组合下单,1个数量1个订单(针对同样产品)"), | |||
| MULITY_NUMBER_ORDER_BATCH(2,"购物车式组合下单,多个数量1个订单(针对同样产品)"), | |||
| PACKAGECOUPON(3,"券包订单类型"), | |||
| ; | |||
| public static EnumComposeOrder getEnum(Integer code) { | |||
| for (EnumComposeOrder value : values()) { | |||
| if (value.getCode().equals(code)) { | |||
| return value; | |||
| } | |||
| } | |||
| return null; | |||
| } | |||
| private Integer code; | |||
| private String message; | |||
| EnumComposeOrder(Integer code, String message) { | |||
| this.code = code; | |||
| this.message = message; | |||
| } | |||
| public Integer getCode() { | |||
| return code; | |||
| } | |||
| public String getMessage() { | |||
| return message; | |||
| } | |||
| public static Long getPayOrderId(WxOrder order) { | |||
| if (order.getComposeOrderType().intValue() == SINGLE.getCode().intValue()) { | |||
| return order.getId(); | |||
| }else { | |||
| return order.getComposeOrderId(); | |||
| } | |||
| } | |||
| //是单个支付还是组合支付 | |||
| public static boolean isSingle(Integer type) { | |||
| if (type.intValue() == SINGLE.getCode().intValue()) { | |||
| return true; | |||
| }else { | |||
| return false; | |||
| } | |||
| } | |||
| //子订单是单个还是一起,购物车的子订单是单个,可以单个支付,券包的子订单不能单个支付 | |||
| // public static boolean childOrderIsSingle(Integer type) { | |||
| // if (type.intValue() == SINGLE.getCode().intValue() || type.intValue() == ONE_NUMBER_ORDER_BATCH.getCode().intValue() | |||
| // || type.intValue() == MULITY_NUMBER_ORDER_BATCH.getCode().intValue()) { | |||
| // return true; | |||
| // }else { | |||
| // return false; | |||
| // } | |||
| // } | |||
| } | |||
| @@ -7,7 +7,8 @@ public enum EnumCouponSendType { | |||
| // 1:主动领取 2:定向投放 | |||
| ACTIVE(1,"主动领取"), | |||
| PASSIVE(2, "定向投放") | |||
| PASSIVE(2, "定向投放"), | |||
| GIFT(3, "礼包券") | |||
| ; | |||
| public static EnumCouponSendType getEnum(Integer code) { | |||
| @@ -16,6 +16,8 @@ public enum EnumCouponType { | |||
| COUPON_PRESS(8, "砍价券"), | |||
| COUPON_GROUP(9, "团购券"), | |||
| COUPON_PREORDER(10, "预购商品"), | |||
| COUPON_DISTRIBUTION(11, "可配送商品"), | |||
| COUPON_GIFT(12, "券礼包"), | |||
| COUPON_CREDIT(50,"积分券"), | |||
| COUPON_CREDIT_PARK(51,"积分停车券"), | |||
| CARD_MULTIMCH(100, "消费卡"), | |||
| @@ -29,6 +31,16 @@ public enum EnumCouponType { | |||
| } | |||
| return null; | |||
| } | |||
| public static boolean mustHasMerchant(Integer code) { | |||
| if (null == code) { | |||
| return true; | |||
| } | |||
| if (COUPON_GIFT.code.equals(code)) { | |||
| return false; | |||
| } | |||
| return true; | |||
| } | |||
| private Integer code; | |||
| private String message; | |||
| @@ -14,6 +14,11 @@ public enum EnumCouponVerifyType { | |||
| VERIFY_POS_INDEPENDENT(1, "POS独立核销"), | |||
| VERIFY_POS_PAY(2, "POS交易核销"), | |||
| VERIFY_C(3,"用户自主核销"), | |||
| VERIFY_C_AUTO(30,"用户自主核销"), | |||
| VERIFY_AUTO(4,"系统自动核销"), | |||
| ; | |||
| public static EnumCouponVerifyType getEnum(Integer code) { | |||
| @@ -10,7 +10,9 @@ public enum EnumMerchantSubsidySource { | |||
| COUPON(2, "券核销"), | |||
| PRESS(3, "砍价核销"), | |||
| GROUP(4, "拼团核销"), | |||
| CASHIER(5, "收银台"),; | |||
| CASHIER(5, "收银台"), | |||
| DISTRIBUTION_GOODS(6, "可配送商品"), | |||
| GIFT_BAG(7, "券订单"),; | |||
| public static EnumMerchantSubsidySource getEnum(Integer code) { | |||
| for (EnumMerchantSubsidySource value : values()) { | |||
| @@ -2,7 +2,8 @@ package com.iformall.enums; | |||
| public enum EnumMerchantType { | |||
| MERCHANT_MORE(-1, "多商户") | |||
| MERCHANT_MORE(-1, "多商户"), | |||
| MERCHANT_NONE(-2, "无归属商户") | |||
| ; | |||
| public static EnumMerchantType getEnum(Integer code) { | |||
| @@ -0,0 +1,50 @@ | |||
| package com.iformall.enums; | |||
| /** | |||
| * @author gongbiao | |||
| */ | |||
| public enum EnumOrderShopingStatus { | |||
| ONLINE_PURCHASE(0,"线上购买"),//不需要发货 | |||
| WAIT_SENG_GOODS(1,"待发货(查询用)"), | |||
| SENG_GOODS(2,"已发货(查询用)"), | |||
| FINISH_SENG_GOODS(3,"已完成(查询用)"), | |||
| READY_SELF_MENTION(10,"自提商品准备中"), | |||
| WAIT_SELF_MENTION(14,"已备货,待自提"), | |||
| ALREADY_SELF_MENTION(15,"已自提"), | |||
| READY_DISTRIBUTION(20,"配送商品准备中"), | |||
| WAIT_DISTRIBUTION(24,"已发货,待收货"), | |||
| ALREADY_DISTRIBUTION(25,"已收货") | |||
| ; | |||
| public static EnumOrderShopingStatus getEnum(Integer code) { | |||
| for (EnumOrderShopingStatus value : values()) { | |||
| if (value.getCode().equals(code)) { | |||
| return value; | |||
| } | |||
| } | |||
| return null; | |||
| } | |||
| private Integer code; | |||
| private String message; | |||
| EnumOrderShopingStatus(Integer code, String message) { | |||
| this.code = code; | |||
| this.message = message; | |||
| } | |||
| public Integer getCode() { | |||
| return code; | |||
| } | |||
| public String getMessage() { | |||
| return message; | |||
| } | |||
| } | |||
| @@ -0,0 +1,39 @@ | |||
| package com.iformall.enums; | |||
| /** | |||
| * @author gongbiao | |||
| */ | |||
| public enum EnumOrderShopingType { | |||
| ONLINE_PURCHASE(0,"线上购买"), | |||
| SELF_MENTION(1,"自提"), | |||
| DISTRIBUTION(2,"配送") | |||
| ; | |||
| public static EnumOrderShopingType getEnum(Integer code) { | |||
| for (EnumOrderShopingType value : values()) { | |||
| if (value.getCode().equals(code)) { | |||
| return value; | |||
| } | |||
| } | |||
| return null; | |||
| } | |||
| private Integer code; | |||
| private String message; | |||
| EnumOrderShopingType(Integer code, String message) { | |||
| this.code = code; | |||
| this.message = message; | |||
| } | |||
| public Integer getCode() { | |||
| return code; | |||
| } | |||
| public String getMessage() { | |||
| return message; | |||
| } | |||
| } | |||
| @@ -21,7 +21,8 @@ public enum EnumPayWay { | |||
| PAY_WAY_NOT_UNPAY_BATCH_SEND(96, "后台批量发券,无需支付",null,null,null), | |||
| PAY_WAY_NOT_UNPAY_TRADE(97, "交易发券,无需支付",null,null,null), | |||
| PAY_WAY_NOT_UNPAY_PASSWD(98, "根据卡密兑换卡,无需支付",null,null,null), | |||
| PAY_WAY_NOT_UNPAY_CREDIT(99, "积分兑换券,无需支付",null,null,null) | |||
| PAY_WAY_NOT_UNPAY_CREDIT(99, "积分兑换券,无需支付",null,null,null), | |||
| PAY_WAY_NOT_UNPAY_GIFTLIST(100, "卷包子券,无需支付",null,null,null) | |||
| ; | |||
| public static EnumPayWay getEnum(Integer code) { | |||
| @@ -0,0 +1,19 @@ | |||
| package com.iformall.mapper; | |||
| import com.iformall.common.CommonMapper; | |||
| import com.iformall.domain.po.UserBasicInfoAddress; | |||
| import com.iformall.domain.po.WxCUserBasicInfo; | |||
| import java.util.List; | |||
| public interface UserBasicInfoAddressMapper extends CommonMapper<UserBasicInfoAddress, String> { | |||
| List<WxCUserBasicInfo> findList(UserBasicInfoAddress record); | |||
| int deleteById(UserBasicInfoAddress record); | |||
| int updateDefault(UserBasicInfoAddress record); | |||
| int updateUnDefault(UserBasicInfoAddress record); | |||
| } | |||
| @@ -0,0 +1,20 @@ | |||
| package com.iformall.mapper; | |||
| import com.iformall.common.CommonMapper; | |||
| import com.iformall.domain.po.WxBatchOrder; | |||
| import java.util.List; | |||
| import org.apache.ibatis.annotations.Param; | |||
| public interface WxBatchOrderMapper extends CommonMapper<WxBatchOrder, Long> { | |||
| List<WxBatchOrder> findList(WxBatchOrder order); | |||
| Integer countList(WxBatchOrder order); | |||
| WxBatchOrder selectById(@Param("id")Long id,@Param("tenantId")String tenantId); | |||
| void updateCUserId(WxBatchOrder order); | |||
| } | |||
| @@ -31,7 +31,8 @@ public interface WxCouponMapper extends CommonMapper<WxCoupon, Long> { | |||
| void offExpiriedCouponByValidDate(@Param("tenantId")String tenantId); | |||
| void offExpiriedCouponByMerchantStatus(@Param("tenantId")String tenantId); | |||
| List<Long> getValidMerchantProductIds(@Param("tenantId")String tenantId); | |||
| void offExpiriedCouponByMerchantStatus(@Param("tenantId")String tenantId,@Param("validIds")List<Long> validIds); | |||
| /** | |||
| * 查询时间段内销售金额 | |||
| @@ -25,6 +25,8 @@ public interface WxCouponOrderMapper extends CommonMapper<WxCouponOrder, Long> { | |||
| List<WxCouponOrder> findExpiredCouponOrderByValidDate(@Param("tenantId")String tenantId); | |||
| List<WxCouponOrder> findExpiredCouponOrderGoodsVerify(@Param("tenantId")String tenantId); | |||
| // 券包核销 | |||
| int updateVerifyCouponOrder(WxCouponOrder wxCouponOrder); | |||
| int updateVerifyCouponOrderStatus(WxCouponOrder wxCouponOrder); | |||
| @@ -33,6 +35,7 @@ public interface WxCouponOrderMapper extends CommonMapper<WxCouponOrder, Long> { | |||
| //统一的计数接口 | |||
| int findCount(WxCouponOrder wxCouponOrder); | |||
| int findProductCount(WxCouponOrder wxCouponOrder); | |||
| List<Map<String, Object>> getCountByBusinessId(WxCouponOrder wxCouponOrder); | |||
| List<Map<String, Object>> getCountBySubBusinessId(WxCouponOrder wxCouponOrder); | |||
| //统一额度统计接口 | |||
| @@ -94,4 +97,7 @@ public interface WxCouponOrderMapper extends CommonMapper<WxCouponOrder, Long> { | |||
| List<Long> cardDeferCouponOrderId(@Param("couponId")Long couponId,@Param("tenantId")String tenantId); | |||
| Integer findWriteOffCount(WxCouponOrder wxCouponOrder); | |||
| List<WxCouponOrderBVo> findGoodsList(WxCouponOrderBVo record); | |||
| } | |||
| @@ -19,6 +19,7 @@ public interface WxOrderMapper extends CommonMapper<WxOrder, Long> { | |||
| List<WxOrder> findList(WxOrder wxOrder); | |||
| Integer countList(WxOrder wxOrder); | |||
| Integer countListProduct(WxOrder wxOrder); | |||
| int countCouponConditionType1(WxOrder wxOrder); | |||
| List<WxOrder> findListOfUnpaidOrderByDate(Map dateMap); | |||
| @@ -64,5 +65,8 @@ public interface WxOrderMapper extends CommonMapper<WxOrder, Long> { | |||
| void updateOrderGroupStatusByCouponChannelId(WxOrder updateOrder); | |||
| void updateOrderStatusForGroup(@Param("tenantId")String tenantId); | |||
| void updateCUserId(WxOrder updateOrder); | |||
| List<WxOrderCouponVo> listGoodsCAsPage(WxOrder record); | |||
| } | |||
| @@ -0,0 +1,27 @@ | |||
| package com.iformall.service; | |||
| import com.github.pagehelper.PageInfo; | |||
| import com.iformall.common.ResultData; | |||
| import com.iformall.domain.po.*; | |||
| public interface UserBasicInfoAddressService { | |||
| /** | |||
| * 根据实体查询分页列表 | |||
| * | |||
| * @param record | |||
| * @param pageIndex | |||
| * @param pageSize | |||
| * @return | |||
| */ | |||
| PageInfo<UserBasicInfoAddress> listAsPage(UserBasicInfoAddress record, Integer pageIndex, Integer pageSize); | |||
| void saveOrUpdate(UserBasicInfoAddress userBasicInfoAddress); | |||
| Integer deleteById(UserBasicInfoAddress record); | |||
| void updateDefault(UserBasicInfoAddress record); | |||
| UserBasicInfoAddress findById(UserBasicInfoAddress userBasicInfoAddress); | |||
| } | |||
| @@ -6,7 +6,9 @@ import com.iformall.common.ResultData; | |||
| import com.iformall.domain.po.*; | |||
| import com.iformall.domain.po.base.TenantEntity; | |||
| import com.iformall.domain.vo.*; | |||
| import com.iformall.enums.EnumCouponVerifyType; | |||
| import com.iformall.enums.EnumPayWay; | |||
| import com.iformall.service.order.entity.WxComposeOrder; | |||
| import javax.servlet.http.HttpServletRequest; | |||
| import javax.servlet.http.HttpServletResponse; | |||
| @@ -54,27 +56,26 @@ public interface WxCouponOrderService { | |||
| * @param couponOrder | |||
| * @param bUser 核销人(登录用户) | |||
| */ | |||
| WxCouponOrder verify(WxCouponOrder couponOrder, WxMerchantBUser bUser); | |||
| WxCouponOrder verify(WxCouponOrder couponOrder, WxMerchantBUser bUser, EnumCouponVerifyType couponVerifyType); | |||
| /** | |||
| * 核销后发送消息 | |||
| */ | |||
| void sendInsideCouponVerifyMsg(TenantEntity tenantEntity, Long couponOrderId, Long buUserId); | |||
| void sendInsideCouponVerifyMsg(TenantEntity tenantEntity, Long couponOrderId, Long merchantId); | |||
| /** | |||
| * 核销后处理 | |||
| * | |||
| * @param couponOrder | |||
| * @param bUser 核销人(登录用户) | |||
| * @param | |||
| */ | |||
| void actionAfterVerify(WxCouponOrder couponOrder, WxMerchantBUser bUser); | |||
| void actionAfterVerify(WxCouponOrder couponOrder, WxMerchant merchant); | |||
| /** | |||
| * 核销发券 | |||
| * @param couponOrder | |||
| * @param bUser | |||
| */ | |||
| boolean sendCouponAfterVerify(WxCouponOrder couponOrder, WxMerchantBUser bUser); | |||
| boolean sendCouponAfterVerify(WxCouponOrder couponOrder); | |||
| /** | |||
| * B端刷卡支付发券 | |||
| @@ -88,7 +89,7 @@ public interface WxCouponOrderService { | |||
| * 核销分账 | |||
| * @param couponOrder | |||
| */ | |||
| void shareAfterVerify(WxCouponOrder couponOrder, Long merchantId,Integer payWay); | |||
| void shareAfterVerify(WxCouponOrder couponOrder, Long merchantId,Integer payWay,boolean mulityShare); | |||
| /** | |||
| * 核销后补贴 | |||
| @@ -98,9 +99,9 @@ public interface WxCouponOrderService { | |||
| /** | |||
| * 核销模板消息 | |||
| * @param couponOrder | |||
| * @param bUser | |||
| * @param merchant | |||
| */ | |||
| void sendVerifyMsg(WxCouponOrder couponOrder, WxMerchantBUser bUser, boolean hadSentCoupon); | |||
| void sendVerifyMsg(WxCouponOrder couponOrder, WxMerchant merchant, boolean hadSentCoupon); | |||
| /** | |||
| * 根据日期 b用户查券list | |||
| @@ -206,7 +207,7 @@ public interface WxCouponOrderService { | |||
| */ | |||
| JSONArray queryMicroPayCouponOrder(WxMerchantBUser user, WxCUserBasicInfo cUser, Integer price); | |||
| WxPayOrder microPayPreVerify(WxOrder microOrder, WxCouponOrder couponOrder, WxMerchantBUser bUser, Integer price, EnumPayWay payWay,String ipstr,String authCode); | |||
| WxPayOrder microPayPreVerify(WxComposeOrder composeOrder, WxCouponOrder couponOrder, WxMerchantBUser bUser, Integer price, EnumPayWay payWay,String ipstr,String authCode); | |||
| Integer microPayVerify(WxMerchantBUser bUser, Long couponOrderId,EnumPayWay payWay); | |||
| @@ -220,4 +221,6 @@ public interface WxCouponOrderService { | |||
| void statisticsWriteOff(WxCouponOrder wxCouponOrder, Map<String, Object> resultMap); | |||
| Integer findCount(WxCouponOrder wxCouponOrder); | |||
| PageInfo<WxCouponOrderBVo> goodsListAsPage(WxCouponOrderBVo couponOrderBvo, Integer pageNum, Integer pageSize); | |||
| } | |||
| @@ -8,20 +8,18 @@ import javax.servlet.http.HttpServletResponse; | |||
| import com.github.pagehelper.PageInfo; | |||
| import com.iformall.common.ResultData; | |||
| import com.iformall.domain.dto.OrderComposeSaveDto; | |||
| import com.iformall.domain.dto.OrderSaveDto; | |||
| import com.iformall.domain.po.WxCUserBasicInfo; | |||
| import com.iformall.domain.po.WxCoupon; | |||
| import com.iformall.domain.po.WxCouponOrder; | |||
| import com.iformall.domain.po.WxMerchant; | |||
| import com.iformall.domain.po.WxMerchantBUser; | |||
| import com.iformall.domain.po.WxOrder; | |||
| import com.iformall.domain.po.*; | |||
| import com.iformall.domain.po.base.TenantEntity; | |||
| import com.iformall.domain.vo.WxCouponSendVo; | |||
| import com.iformall.domain.vo.WxOrderCouponPressVo; | |||
| import com.iformall.domain.vo.WxOrderCouponVo; | |||
| import com.iformall.domain.vo.WxOrderQueryVo; | |||
| import com.iformall.enums.EnumComposeOrder; | |||
| import com.iformall.enums.EnumOrderStatus; | |||
| import com.iformall.enums.EnumPayWay; | |||
| import com.iformall.service.order.entity.WxComposeOrder; | |||
| public interface WxOrderService { | |||
| @@ -88,12 +86,19 @@ public interface WxOrderService { | |||
| */ | |||
| WxCouponOrder sendFreeCouponToUser(Long userId,TenantEntity tenantinfo,Long couponId, WxCouponSendVo wxCouponSendVo,EnumPayWay payWay,Long merchantId,Long bUserId); | |||
| /** | |||
| * 发券包子券 | |||
| * @param couponOrder | |||
| * @param couponIds | |||
| */ | |||
| void sendSubCouponToUser(WxCouponOrder couponOrder, List<Long> couponIds); | |||
| /** | |||
| * orderSuccess 订单已支付 | |||
| * @param updateOrder | |||
| * @return | |||
| */ | |||
| int couponOrderSuccess(WxOrder updateOrder); | |||
| WxCouponOrder couponOrderSuccess(WxOrder updateOrder); | |||
| /** | |||
| * microPayOrderSuccess 刷卡支付成功 | |||
| @@ -112,7 +117,7 @@ public interface WxOrderService { | |||
| /** | |||
| * 订单关单 | |||
| */ | |||
| ResultData orderClose(WxOrder order,EnumPayWay payWay); | |||
| //ResultData orderClose(WxOrder order,EnumPayWay payWay); | |||
| /** | |||
| * 根据Id获得实体 | |||
| @@ -156,6 +161,7 @@ public interface WxOrderService { | |||
| WxOrderCouponVo detailCUserVo(WxOrder record); | |||
| List<WxOrderCouponVo> goodsDetailCUserVo(WxOrder wxOrder); | |||
| void stockBack(WxOrder updateOrder); | |||
| @@ -192,7 +198,7 @@ public interface WxOrderService { | |||
| * @param coupon | |||
| * @return | |||
| */ | |||
| WxOrder saveOrderForCoupon(WxCUserBasicInfo user, WxCoupon coupon, OrderSaveDto orderSaveDto, boolean isPress,EnumPayWay payWay); | |||
| WxComposeOrder saveOrderForCoupon(boolean allowUnPayOrder,EnumComposeOrder composeOrderType,WxCUserBasicInfo user, List<OrderComposeSaveDto> orderSave,EnumPayWay payWay); | |||
| void sendOrderSuccessActionMsg(WxOrder updateOrder); | |||
| /** | |||
| @@ -208,13 +214,15 @@ public interface WxOrderService { | |||
| * 订单处理 | |||
| * 1. 检查coupon是否免费 | |||
| */ | |||
| boolean checkCouponIsFree(WxCoupon coupon); | |||
| boolean checkCouponIsFree(WxCoupon coupon,Integer shippingType); | |||
| // 2. 创建免费订单, 领取 couponOrder | |||
| WxOrder saveFreeOrderForCoupon(WxCUserBasicInfo user, WxCoupon coupon, Long couponChannelId, String formId, Long couponPasswordId,EnumPayWay payWay); | |||
| WxOrder saveFreeOrderForCoupon(boolean allowUnPayOrder,WxComposeOrder composeOrder, WxCUserBasicInfo user, WxCoupon coupon, int couponNumber, | |||
| Long couponChannelId, String formId, Long couponPasswordId, EnumPayWay payWay, | |||
| Integer shippingType, UserBasicInfoAddress address); | |||
| // 3. 创建有价订单 | |||
| WxOrder saveNoFreeOrderForCoupon(WxCUserBasicInfo user, WxCoupon coupon, Long couponChannelId, boolean isPress, Long orderGroupId, String formId); | |||
| WxOrder saveNoFreeOrderForCoupon(boolean allowUnPayOrder,WxComposeOrder composeOrder,WxCUserBasicInfo user, WxCoupon coupon,int couponNumber,OrderComposeSaveDto orderdto); | |||
| /** | |||
| * 下订单成功后处理 | |||
| @@ -237,8 +245,12 @@ public interface WxOrderService { | |||
| int countGroupOrder(Long groupId,boolean ignoreUnPay,String tenantId); | |||
| int countUserCouponGroupOrder(Long cuserId,Long couponId,String tenantId); | |||
| int countUserCouponGroupOrder(WxCUserBasicInfo wxCUserBasicInfo,Long couponId,String tenantId); | |||
| //ResultData saveOrder(OrderSaveDto orderSaveDto,Long cUserId,EnumPayWay payWay,TenantEntity tenantEntity); | |||
| ResultData composeSaveOrder(boolean allowUnPayOrder,EnumComposeOrder composeOrderType,List<OrderComposeSaveDto> composeOrderSaveDto,Long cUserId,EnumPayWay payWay,TenantEntity tenantEntity); | |||
| ResultData saveOrder(OrderSaveDto orderSaveDto,Long cUserId,EnumPayWay payWay,TenantEntity tenantEntity); | |||
| PageInfo<WxOrderCouponVo> listGoodsCAsPage(WxOrder wxOrder, Integer pageNum, Integer pageSize); | |||
| } | |||
| @@ -7,22 +7,25 @@ import com.iformall.common.IdWorker; | |||
| import com.iformall.common.ResultData; | |||
| import com.iformall.domain.po.WxAppinfo; | |||
| import com.iformall.domain.po.WxCUserBasicInfo; | |||
| import com.iformall.domain.po.WxBatchOrder; | |||
| import com.iformall.domain.po.WxCoupon; | |||
| import com.iformall.domain.po.WxMerchantBUser; | |||
| import com.iformall.domain.po.WxOrder; | |||
| import com.iformall.domain.po.WxPayAccount; | |||
| import com.iformall.domain.po.WxPayOrder; | |||
| import com.iformall.enums.EnumComposeOrder; | |||
| import com.iformall.enums.EnumPayShare; | |||
| import com.iformall.enums.EnumPayWay; | |||
| import com.iformall.service.order.entity.WxComposeOrder; | |||
| import com.iformall.service.pay.entity.PayExtraParam; | |||
| import com.iformall.service.pay.service.pay.entity.PayAdapterResult; | |||
| import com.iformall.service.pay.service.pay.entity.PayQueryAdapterResult; | |||
| public interface WxPayOrderService { | |||
| public void handleSuccessOrder(WxPayOrder oldRecord,WxOrder order,PayQueryAdapterResult queryResult,boolean isScheduleTask); | |||
| public void handleSuccessOrder(WxPayOrder oldRecord,WxComposeOrder composeOrder,PayQueryAdapterResult queryResult,boolean isScheduleTask,boolean isOneChildOrder); | |||
| public WxPayOrder handleWxOrderQuery(WxPayOrder oldRecord,WxOrder order,WxAppinfo appInfo,WxPayAccount payAccount,IdWorker idworker,boolean repeatPay); | |||
| public WxPayOrder handleWxOrderQuery(WxPayOrder oldRecord,WxComposeOrder composeOrder,WxAppinfo appInfo,WxPayAccount payAccount,IdWorker idworker,boolean repeatPay); | |||
| /** | |||
| * 创建支付订单 | |||
| @@ -368,15 +368,17 @@ public class WxCUserTagsServiceHelper{ | |||
| int count = 0; | |||
| if(cardSpendCountList.size() > 0) { | |||
| for (Map<String, Object> cardSpendCount : cardSpendCountList) { | |||
| if (cardSpendCount.get("businessId").equals(b.getId().toString())) { | |||
| count += (Integer) cardSpendCount.get("buCount"); | |||
| if (cardSpendCount.get("business_id") != null | |||
| && cardSpendCount.get("business_id").equals(b.getId().toString())) { | |||
| count += (Integer) cardSpendCount.get("bu_count"); | |||
| } | |||
| } | |||
| } | |||
| if(cardOrderCountList.size() > 0) { | |||
| for (Map<String, Object> cardOrderCount : cardOrderCountList) { | |||
| if (cardOrderCount.get("business").equals(b.getId().toString())) { | |||
| count += (Integer) cardOrderCount.get("buCount"); | |||
| if (cardOrderCount.get("business") != null | |||
| && cardOrderCount.get("business").equals(b.getId().toString())) { | |||
| count += (Integer) cardOrderCount.get("bu_count"); | |||
| } | |||
| } | |||
| } | |||
| @@ -11,6 +11,7 @@ import com.iformall.common.ErrorCode; | |||
| import com.iformall.common.Result; | |||
| import com.iformall.common.ResultData; | |||
| import com.iformall.domain.po.WxAppinfo; | |||
| import com.iformall.domain.po.WxBatchOrder; | |||
| import com.iformall.domain.po.WxMerchantBUser; | |||
| import com.iformall.domain.po.WxOrder; | |||
| import com.iformall.domain.po.WxPayAccount; | |||
| @@ -33,17 +34,13 @@ public class WxPayOrderServiceHelper { | |||
| /** | |||
| * 微信订单是否可以支付 | |||
| */ | |||
| public static Map<String, String> wxOrderPayStatusMap(WxPayOrder record,WxOrder order,WxAppinfo appInfo,WxPayAccount payAccount) { | |||
| public static Map<String, String> wxOrderPayStatusMap(WxPayOrder record,WxAppinfo appInfo,WxPayAccount payAccount) { | |||
| if (record == null) { | |||
| throw new MallinkException(ErrorCode.PAY_ORDER_ERROR.getCode(), "wxPayOrder is null."); | |||
| } | |||
| if (StringUtils.isBlank(record.getPayOrderNo())) { | |||
| throw new MallinkException(ErrorCode.PAY_ORDER_ERROR.getCode(), "payOrderNo not found"); | |||
| } | |||
| if (order == null) { | |||
| throw new MallinkException(ErrorCode.PAY_ORDER_ERROR.getCode(), "Order not found"); | |||
| } | |||
| String response = wechatPayOrderQuery(appInfo, record,payAccount); | |||
| logger.info("pay order query, " + record.toString() + ", response: " + response); | |||
| @@ -128,8 +125,8 @@ public class WxPayOrderServiceHelper { | |||
| } | |||
| } | |||
| public static int wxOrderPayStatus(WxPayOrder record,WxOrder order,WxAppinfo appInfo,WxPayAccount payAccount) { | |||
| Map<String, String> returnMap = wxOrderPayStatusMap(record,order,appInfo,payAccount); | |||
| public static int wxOrderPayStatus(WxPayOrder record,WxAppinfo appInfo,WxPayAccount payAccount) { | |||
| Map<String, String> returnMap = wxOrderPayStatusMap(record,appInfo,payAccount); | |||
| return getPayStatusFromMap(returnMap,record.getPayOrderNo()); | |||
| } | |||