2 files added
6 files modified
New file |
| | |
| | | package com.oying.utils.enums; |
| | | |
| | | import lombok.AllArgsConstructor; |
| | | import lombok.Getter; |
| | | |
| | | @Getter |
| | | @AllArgsConstructor |
| | | public enum MerchantRole { |
| | | |
| | | // 商户角色 |
| | | OWNER("OWNER", 1), |
| | | ADMIN("ADMIN", 2), |
| | | FINANCE("FINANCE", 3), |
| | | OPERATOR("OPERATOR", 4); |
| | | |
| | | private final String role; |
| | | private final Integer level; |
| | | } |
New file |
| | |
| | | package com.oying.utils.enums; |
| | | |
| | | import lombok.AllArgsConstructor; |
| | | import lombok.Getter; |
| | | |
| | | @Getter |
| | | @AllArgsConstructor |
| | | public enum StoreRole { |
| | | |
| | | // 门店角色 |
| | | ADMIN("ADMIN", 1), |
| | | OPERATOR("OPERATOR", 2); |
| | | |
| | | private final String role; |
| | | private final Integer level; |
| | | } |
| | |
| | | private Long storeId; |
| | | |
| | | @NotBlank |
| | | @ApiModelProperty(value = "门店名称") |
| | | private String storeName; |
| | | |
| | | @NotBlank |
| | | @ApiModelProperty(value = "门店LOGO") |
| | | private String storeLogo; |
| | | |
| | | @NotBlank |
| | | @ApiModelProperty(value = "描述") |
| | | private String orderDescribe; |
| | | |
| | |
| | | @ApiModelProperty(value = "门店ID") |
| | | private Long storeId; |
| | | |
| | | @NotBlank |
| | | @ApiModelProperty(value = "门店名称") |
| | | private String storeName; |
| | | |
| | | @NotBlank |
| | | @ApiModelProperty(value = "门店LOGO") |
| | | private String storeLogo; |
| | | |
| | | @NotNull |
| | | @ApiModelProperty(value = "原金额") |
| | | private BigDecimal originalPrice; |
| | |
| | | private Integer merchantSort; |
| | | |
| | | @ApiModelProperty(value = "状态") |
| | | private String enabled = "1"; |
| | | private String enabled = "0"; |
| | | |
| | | @ApiModelProperty(value = "审核人") |
| | | private String auditUser; |
| | |
| | | |
| | | @TableField(exist = false) |
| | | @ApiModelProperty(value = "用户ID") |
| | | private String userId; |
| | | private Long userId; |
| | | |
| | | public void copy(Merchant source) { |
| | | BeanUtil.copyProperties(source, this, CopyOptions.create().setIgnoreNullValue(true)); |
| | |
| | | package com.oying.modules.system.service.impl; |
| | | |
| | | import com.oying.modules.system.domain.Merchant; |
| | | import com.oying.modules.system.domain.UserMerchant; |
| | | import com.oying.modules.system.mapper.MerchantMapper; |
| | | import com.oying.modules.system.service.UserMerchantService; |
| | | import com.oying.utils.FileUtil; |
| | | import com.oying.utils.enums.MerchantRole; |
| | | import lombok.RequiredArgsConstructor; |
| | | import com.baomidou.mybatisplus.extension.plugins.pagination.Page; |
| | | import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; |
| | |
| | | public class MerchantServiceImpl extends ServiceImpl<MerchantMapper, Merchant> implements MerchantService { |
| | | |
| | | private final MerchantMapper merchantMapper; |
| | | private final UserMerchantService userMerchantService; |
| | | |
| | | @Override |
| | | public PageResult<Merchant> queryAll(MerchantsQueryCriteria criteria, Page<Object> page){ |
| | |
| | | @Transactional(rollbackFor = Exception.class) |
| | | public void create(Merchant resources) { |
| | | merchantMapper.insert(resources); |
| | | UserMerchant userMerchant = new UserMerchant(); |
| | | userMerchant.setMerchantId(resources.getMerchantId()); |
| | | userMerchant.setUserId(resources.getUserId()); |
| | | userMerchant.setRoleType(MerchantRole.OWNER.getRole()); |
| | | userMerchantService.create(userMerchant); |
| | | } |
| | | |
| | | @Override |
| | |
| | | <result column="order_num" property="orderNum"/> |
| | | <result column="user_id" property="userId"/> |
| | | <result column="store_id" property="storeId"/> |
| | | <result column="store_name" property="storeName"/> |
| | | <result column="store_logo" property="storeLogo"/> |
| | | <result column="order_describe" property="orderDescribe"/> |
| | | <result column="original_price" property="originalPrice"/> |
| | | <result column="paid_price" property="paidPrice"/> |
| | |
| | | </resultMap> |
| | | |
| | | <sql id="Base_Column_List"> |
| | | order_id, order_num, user_id, store_id, order_describe, original_price, paid_price, actually_pay_price, pay_state, pay_message, pay_type, pay_time, expire_time, openid, app_id, timestamp, nonce_str, package_val, sign_type, pay_sign, create_by, create_time, update_by, update_time |
| | | order_id, order_num, user_id, store_id, store_name, store_logo, order_describe, original_price, paid_price, actually_pay_price, pay_state, pay_message, pay_type, pay_time, expire_time, openid, app_id, timestamp, nonce_str, package_val, sign_type, pay_sign, create_by, create_time, update_by, update_time |
| | | </sql> |
| | | |
| | | <select id="findAll" resultMap="BaseResultMap"> |
| | |
| | | </where> |
| | | order by order_id desc |
| | | </select> |
| | | </mapper> |
| | | </mapper> |
| | |
| | | <result column="order_num" property="orderNum"/> |
| | | <result column="user_id" property="userId"/> |
| | | <result column="store_id" property="storeId"/> |
| | | <result column="store_name" property="storeName"/> |
| | | <result column="store_logo" property="storeLogo"/> |
| | | <result column="original_price" property="originalPrice"/> |
| | | <result column="paid_price" property="paidPrice"/> |
| | | <result column="actually_pay_price" property="actuallyPayPrice"/> |
| | |
| | | </resultMap> |
| | | |
| | | <sql id="Base_Column_List"> |
| | | return_id, return_num, order_num, user_id, store_id, original_price, paid_price, actually_pay_price, refund_price, refund_status, success_time, channel, reason, audit_user, audit_time, audit_message, create_by, create_time, update_by, update_time |
| | | return_id, return_num, order_num, user_id, store_id, store_name, store_logo, original_price, paid_price, actually_pay_price, refund_price, refund_status, success_time, channel, reason, audit_user, audit_time, audit_message, create_by, create_time, update_by, update_time |
| | | </sql> |
| | | |
| | | <select id="findAll" resultMap="BaseResultMap"> |
| | |
| | | </where> |
| | | order by return_id desc |
| | | </select> |
| | | </mapper> |
| | | </mapper> |