Selaa lähdekoodia

二手小程序新后台机构列表

zhijiezhao 1 kuukausi sitten
vanhempi
commit
ea29c4f927

+ 23 - 3
src/main/java/com/caimei365/manager/controller/caimei/order/OrderApi.java

@@ -1,14 +1,34 @@
 package com.caimei365.manager.controller.caimei.order;
 
+import com.caimei365.manager.entity.PaginationVo;
+import com.caimei365.manager.entity.ResponseJson;
+import com.caimei365.manager.entity.caimei.CmShopOrder;
+import com.caimei365.manager.service.caimei.order.OrderService;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.web.bind.annotation.GetMapping;
 import org.springframework.web.bind.annotation.RequestMapping;
+import org.springframework.web.bind.annotation.RequestParam;
 import org.springframework.web.bind.annotation.RestController;
 
-/**
- * 订单管理接口
- */
+
 @RestController
 @RequestMapping("/order")
 public class OrderApi {
 
+    @Autowired
+    private OrderService orderService;
+
+    @GetMapping("/listByShop")
+    public ResponseJson<PaginationVo<CmShopOrder>> listByShop(Integer sendOutStatus, Integer receiptStatus, Integer shopId,
+                                                              String beginTime, String endTime,
+                                                              @RequestParam(value = "pageNum", defaultValue = "1") int pageNum,
+                                                              @RequestParam(value = "pageSize", defaultValue = "20") int pageSize) {
+        return orderService.listByShop(sendOutStatus, receiptStatus, shopId, beginTime, endTime, pageNum, pageSize);
+    }
+
+    @GetMapping("/shopOrder/detail")
+    public ResponseJson<CmShopOrder> shopOrderDetail(Integer shopOrderId) {
+        return orderService.shopOrderDetail(shopOrderId);
+    }
 
 }

+ 17 - 0
src/main/java/com/caimei365/manager/controller/caimei/user/UserApi.java

@@ -1,8 +1,16 @@
 package com.caimei365.manager.controller.caimei.user;
 
+import com.caimei365.manager.entity.PaginationVo;
+import com.caimei365.manager.entity.ResponseJson;
+import com.caimei365.manager.entity.caimei.cmUser.CmClub;
+import com.caimei365.manager.service.caimei.user.CmUserService;
+import org.springframework.web.bind.annotation.GetMapping;
 import org.springframework.web.bind.annotation.RequestMapping;
+import org.springframework.web.bind.annotation.RequestParam;
 import org.springframework.web.bind.annotation.RestController;
 
+import javax.annotation.Resource;
+
 /**
  * 用户管理接口
  */
@@ -11,4 +19,13 @@ import org.springframework.web.bind.annotation.RestController;
 public class UserApi {
 
 
+    @Resource
+    private CmUserService userService;
+
+    @GetMapping("/club/list")
+    public ResponseJson<PaginationVo<CmClub>> getClubList(CmClub club,
+                                                          @RequestParam(value = "pageNum", defaultValue = "1") int pageNum,
+                                                          @RequestParam(value = "pageSize", defaultValue = "20") int pageSize) {
+        return userService.getClubList(club, pageNum, pageSize);
+    }
 }

+ 16 - 0
src/main/java/com/caimei365/manager/dao/order/OrderMapper.java

@@ -0,0 +1,16 @@
+package com.caimei365.manager.dao.order;
+
+import com.caimei365.manager.entity.caimei.CmShopOrder;
+import org.apache.ibatis.annotations.Mapper;
+import org.apache.ibatis.annotations.Param;
+
+import java.util.List;
+
+@Mapper
+public interface OrderMapper {
+
+    List<CmShopOrder> listByShop(@Param("sendOutStatus") Integer sendOutStatus, @Param("receiptStatus") Integer receiptStatus,
+                                 @Param("shopId") Integer shopId, @Param("beginTime") String beginTime, @Param("endTime") String endTime);
+
+    CmShopOrder getShopOrderDetail(Integer shopOrderId);
+}

+ 10 - 6
src/main/java/com/caimei365/manager/dao/user/UserMapper.java

@@ -1,13 +1,14 @@
 package com.caimei365.manager.dao.user;
 
-import java.util.List;
-
 import com.caimei365.manager.entity.ZylShop;
 import com.caimei365.manager.entity.caimei.ZylTicket;
+import com.caimei365.manager.entity.caimei.cmUser.CmClub;
+import com.caimei365.manager.entity.caimei.cmUser.CmClubLabel;
 import com.caimei365.manager.entity.caimei.cmUser.User;
 import com.caimei365.manager.entity.caimei.providers.ServiceProviderModel;
 import org.apache.ibatis.annotations.Mapper;
-import org.apache.ibatis.annotations.Param;
+
+import java.util.List;
 
 /**
  * 用户信息Mapper接口
@@ -16,8 +17,7 @@ import org.apache.ibatis.annotations.Param;
  * @date 2023-12-14
  */
 @Mapper
-public interface UserMapper
-{
+public interface UserMapper {
     /**
      * 通过对象查询用户信息列表
      *
@@ -86,7 +86,7 @@ public interface UserMapper
     /**
      * 批量删除用户信息
      *
-     * @param  需要删除的数据主键集合
+     * @param 需要删除的数据主键集合
      * @return 结果
      */
     int delUser(User user);
@@ -100,4 +100,8 @@ public interface UserMapper
     void updateGift(Integer userId);
 
     void updateCmproviderStatus(ServiceProviderModel cmProviders);
+
+    List<CmClub> findClubList(CmClub club);
+
+    List<CmClubLabel> findLabels(Integer dynamicStatus);
 }

+ 40 - 6
src/main/java/com/caimei365/manager/entity/caimei/CmShopOrder.java

@@ -3,16 +3,18 @@ package com.caimei365.manager.entity.caimei;
 import lombok.Data;
 
 import java.io.Serializable;
+import java.util.List;
+
 
-/**
- * Description
- *
- * @author : Charles
- * @date : 2021/7/12
- */
 @Data
 public class CmShopOrder implements Serializable {
     private static final long serialVersionUID = 1L;
+
+    private List<OrderProductVo> orderProducts;
+
+    private String clubName;
+
+    private Integer organizeId;
     /**
      * 子订单ID
      */
@@ -85,6 +87,12 @@ public class CmShopOrder implements Serializable {
      * 总价 = totalFee
      */
     private Double totalAmount;
+
+    private Double receiptAmount;
+
+    private Double accountAmount;
+
+    private Double couponAmount;
     /**
      * 总金额 = 订单商品totalAmount
      */
@@ -97,6 +105,12 @@ public class CmShopOrder implements Serializable {
      * 付供应商 商品费=成本价*(购买数量  + 赠品数量)
      */
     private Double shopProductAmount;
+
+    private Integer outStoreNum;
+
+    private Integer presentNum;
+
+    private Integer useBalanceFlag;
     /**
      * 付供应商 运费
      */
@@ -125,6 +139,26 @@ public class CmShopOrder implements Serializable {
      * (付款供应商)付款状态:1待付款、2部分付款、3已付款
      */
     private Integer payStatus;
+
+    private Integer settleStatus;
+
+    private Integer orderStatusFlag;
+    /**
+     * 发货状态:1待发货、2部分发货、3已发货
+     */
+    private Integer sendOutStatus;
+    /**
+     * 退款状态:1无退款、3有退款
+     */
+    private Integer refundStatus;
+
+    private Integer shopPostFlag;
+
+    private Integer shopStatus;
+    /**
+     * 收款状态:1待收款、2部分收款、3已收款
+     */
+    private Integer receiptStatus;
     /**
      * 已付款金额
      */

+ 259 - 0
src/main/java/com/caimei365/manager/entity/caimei/OrderProductVo.java

@@ -0,0 +1,259 @@
+package com.caimei365.manager.entity.caimei;
+
+import lombok.Data;
+
+import java.io.Serializable;
+
+
+@Data
+public class OrderProductVo implements Serializable {
+    private static final long serialVersionUID = 1L;
+
+    private Integer organizeId;
+    /**
+     * 商品类型(0正常商品,1协商赠品,2促销赠品)
+     */
+    private Integer productType;
+
+    private Integer skuId;
+    /**
+     * 商品货号
+     */
+    private String productCode;
+    /**
+     * 商品分账商户号
+     */
+    private String splitCode;
+    /**
+     * 商品Id
+     */
+    private Integer productId;
+    /**
+     * 供应商Id
+     */
+    private Integer shopId;
+    /**
+     * 商品名称
+     */
+    private String name;
+    /**
+     * 主图
+     */
+    private String image;
+    /**
+     * 价格
+     */
+    private Double price;
+    /**
+     * 供应商名称
+     */
+    private String shopName;
+    /**
+     * 商品的类别:1正常商品(默认),2二手商品
+     */
+    private Integer productCategory;
+    /**
+     * 成本价选中标志:1固定成本 2比例成
+     */
+    private Integer costCheckFlag;
+    /**
+     * 成本价
+     */
+    private Double costPrice;
+    /**
+     * 市场价 = 商品表市场价
+     */
+    private Double normalPrice;
+    /**
+     * 比例成本百分比
+     */
+    private Double shopPercent;
+    /**
+     * 启用阶梯价标志 0否 1是
+     */
+    private Integer ladderPriceFlag;
+    /**
+     * 折后单价
+     */
+    private Double discountPrice;
+    /**
+     * 折扣比例
+     */
+    private Double discount;
+    /**
+     * 总价  = price X num
+     */
+    private Double totalAmount;
+    /**
+     * 折后总价  = discountPrice X num + totalAddedValueTax
+     */
+    private Double totalFee;
+    /**
+     * 应付金额 = totalFee - discountFee(经理折扣,仅后台下单有经理折扣)
+     */
+    private Double shouldPayFee;
+    /**
+     * 包装规格
+     */
+    private String productUnit;
+    /**
+     * 购买数量
+     */
+    private Integer num;
+    /**
+     * 赠送数量
+     */
+    private Integer presentNum;
+    /**
+     * 协销订单:经理折扣(平摊到每个商品上,按照每种商品的总价占订单总价的比例来均分);普通订单 无
+     */
+    private Double discountFee;
+    /**
+     * 是否含税 0不含税,1含税,2未知
+     */
+    private Integer includedTax;
+    /**
+     * 发票类型(基于是否含税基础) 1增值税票,2普通票, 3不能开票
+     */
+    private Integer invoiceType;
+    /**
+     * 机构 税率
+     */
+    private Double taxRate;
+    /**
+     * 机构 单个税费=税率X折后单价
+     */
+    private Double addedValueTax;
+    /**
+     * 机构 总税费=单个税费X购买数量
+     */
+    private Double totalAddedValueTax;
+    /**
+     * 供应商 税率
+     */
+    private Double shopTaxRate;
+    /**
+     * 供应商 单个付供应商税费=税率X成本
+     */
+    private Double singleShouldPayTotalTax;
+    /**
+     * 供应商 总税费(应付税费)=单个税费X购买数量
+     */
+    private Double shouldPayTotalTax;
+    /**
+     * 供应商 商品费=成本价*(购买数量  + 赠品数量)
+     */
+    private Double shopProductAmount;
+    /**
+     * 后台设置的单个应付供应商金额
+     */
+    private Double singleShopFee;
+    /**
+     * 该商品总的应付供应商金额
+     */
+    private Double shopFee;
+    /**
+     * 后台设置单个应付第三方金额
+     */
+    private Double singleOtherFee;
+    /**
+     * 该商品总的应付第三方金额
+     */
+    private Double otherFee;
+    /**
+     * 后台计算的单个应付采美金额
+     */
+    private Double singleCmFee;
+    /**
+     * 该商品总的应付采美金额 (受赠品影响)
+     */
+    private Double cmFee;
+    /**
+     * 支付状态 0 未进账 1 待财务审核 2 已进账(适用协销的单笔线下进账和自助订单线下或异常进账)
+     */
+    private Integer payStatus;
+    /**
+     * 订单商品再次购买标识 0否 1是
+     */
+    private Integer buyAgainFlag;
+    /**
+     * 未出库数量
+     */
+    private Integer notOutStore;
+    /**
+     * 下单时商品购买价格类型快照 0 机构价,1活动价 ,2阶梯价
+     */
+    private Integer actProduct;
+    /**
+     * 商品类型(0正常商品,1协商赠品,2促销赠品)
+     */
+    private Integer giftType;
+
+    /**
+     * 订单号(保存订单用)
+     */
+    private Integer orderId;
+    /**
+     * 订单编号(保存订单用)
+     */
+    private String orderNo;
+    /**
+     * 子订单ID(保存订单用)
+     */
+    private Integer shopOrderId;
+    /**
+     * 子订单编号(保存订单用)
+     */
+    private String shopOrderNo;
+    /**
+     * 订单商品Id(保存订单用)
+     */
+    private Integer orderProductId;
+    /**
+     * 订单促销id
+     */
+    private Integer orderPromotionsId;
+    /**
+     * 已发货数量
+     */
+    private Integer shipmentsNum;
+
+    /**
+     * 已退货数量
+     */
+    private Integer returnedNum;
+
+    /**
+     * 已取消发货数量
+     */
+    private Integer actualCancelNum;
+    /**
+     * 商品前台展示单价是否含税,1不含税,2含税,3其他
+     */
+    private Integer includedTaxFlag;
+    /**
+     * 超级会员优惠价格标识:0不是,1是
+     */
+    private Integer svipPriceFlag;
+    /**
+     * 超级会员优惠价类型:1折扣价,2直接优惠价
+     */
+    private Integer svipPriceType;
+    /**
+     * 超级会员折扣
+     */
+    private Double svipDiscount;
+    /**
+     * 超级会员价格标签
+     */
+    private String svipPriceTag;
+    /**
+     * 能否退货  1 能 2不能
+     */
+    private Integer returnGoodsStutas;
+
+    /**
+     * 特殊商品退货须知提示  (取后台帮助中心id1040的数据)
+     */
+    private String  helpContent;
+}

+ 201 - 51
src/main/java/com/caimei365/manager/entity/caimei/cmUser/CmClub.java

@@ -12,66 +12,216 @@ public class CmClub {
 
     private static final long serialVersionUID = 1L;
 
-    private String checkMan;        //审核人
-    private Integer clubId;        // 会所ID
-    private Integer userId;        // 用户ID
-    private Integer userOrganizeId;//用户组织ID
-    private String name;        // 会所名称
-    private String sname;        // 简称
+    /**
+     * 审核人
+     */
+    private String checkMan;
+    /**
+     * 会所ID
+     */
+    private Integer clubId;
+    /**
+     * 用户ID
+     */
+    private Integer userId;
+    /**
+     * 用户组织ID
+     */
+    private Integer userOrganizeId;
+    /**
+     * 会所名称
+     */
+    private String name;
+    /**
+     * 简称
+     */
+    private String sname;
     private String contractEmail;
-    private String logo;        // logo
-    private String legalPerson;        // 法人
-    private Integer provinceId;        // 省
-    private Integer cityId;        // 市
-    private Integer townId;        // 地址ID
-    private String flag;        // 拉会所上线的用户的cmBindId,以逗号结尾
+    /**
+     * logo
+     */
+    private String logo;
+    /**
+     * 法人
+     */
+    private String legalPerson;
+    /**
+     * 省
+     */
+    private Integer provinceId;
+    /**
+     * 市
+     */
+    private Integer cityId;
+    /**
+     * 地址ID
+     */
+    private Integer townId;
+    /**
+     * 拉会所上线的用户的cmBindId,以逗号结尾
+     */
+    private String flag;
 
-    private Integer spId;        // 协销Id
-    private String scanTime;        // 扫描时间
-    private String address;        // 详细地址
-    private String linkMan;        // 联系人
-    private Integer linkManIdentity;    //联系人身份:1老板,2采购,3运营
-    private String contractPhone;        // 联系电话
-    private String contractMobile;        // 联系手机
-    private String fax;        // 传真
-    private String info;        // 公司简介
-    private String addTime;        // 注册时间
-    private String auditTime;        // 审核时间
-    private String auditNote;        // 审核备注
-    private Integer status;        // 状态
-    private String businessLicenseImage;        // 营业执照
+    /**
+     * 协销Id
+     */
+    private Integer spId;
+    /**
+     * 扫描时间
+     */
+    private String scanTime;
+    /**
+     * 详细地址
+     */
+    private String address;
+    /**
+     * 联系人
+     */
+    private String linkMan;
+    /**
+     * 联系人身份:1老板,2采购,3运营
+     */
+    private Integer linkManIdentity;
+    /**
+     * 联系电话
+     */
+    private String contractPhone;
+    /**
+     * 联系手机
+     */
+    private String contractMobile;
 
-    private String mainpro;        // 主打项目
-    private String scanFlag;        // 扫描状态 0待扫描 1 已扫描 2已上线
-    private String headpic;        // 门头照
-    private Date lastModify;        // 最后更新时间
-    private String firstClubType; // 一级分类为医美=1和生美=2
-    private String secondClubType; // 医美的二级分类为诊所=1、门诊=2、医院=3。  生美没有二级分类
-    private String department; // 若为医美分类下的门诊和医院则需要填写科室。
-    private String medicalPracticeLicenseImg; // 医美分类必须上传医疗执业许可证
-    private String socialCreditCode;//统一社会编码
+    /**
+     * 公司简介
+     */
+    private String info;
+    /**
+     * 注册时间
+     */
+    private String addTime;
+    /**
+     * 审核时间
+     */
+    private String auditTime;
+    /**
+     * 审核备注
+     */
+    private String auditNote;
+    /**
+     * 状态
+     */
+    private Integer status;
+    /**
+     * 营业执照
+     */
+    private String businessLicenseImage;
+
+    /**
+     * 主打项目
+     */
+    private String mainpro;
+    /**
+     * 扫描状态 0待扫描 1 已扫描 2已上线
+     */
+    private String scanFlag;
+    /**
+     * 门头照
+     */
+    private String headpic;
+    /**
+     * 最后更新时间
+     */
+    private Date lastModify;
+    /**
+     * 一级分类为医美=1和生美=2
+     */
+    private String firstClubType;
+    /**
+     * 医美的二级分类为诊所=1、门诊=2、医院=3。  生美没有二级分类
+     */
+    private String secondClubType;
+    /**
+     * 若为医美分类下的门诊和医院则需要填写科室。
+     */
+    private String department;
+    /**
+     * 医美分类必须上传医疗执业许可证
+     */
+    private String medicalPracticeLicenseImg;
+    /**
+     * 统一社会编码
+     */
+    private String socialCreditCode;
 
     /**
      * 非持久化字段
+     * 注册来源: 0网站 1小程序
+     */
+    private String source;
+    /**
+     * 创客名称
+     */
+    private String spName;
+    /**
+     * 企业会所用户账号
      */
-    private String source; //注册来源: 0网站 1小程序
-    private String spName; //创客名称
-    private String account;//企业会所用户账号
+    private String account;
     private String mobile;
-    private String userName;  //联系人
-    private String bindMobile;  //企业绑定手机号
-    private String email;       //邮箱
+    /**
+     * 联系人
+     */
+    private String userName;
+    /**
+     * 企业绑定手机号
+     */
+    private String bindMobile;
+    /**
+     * 邮箱
+     */
+    private String email;
     private Date registerTime;
-    private String registerIP;// IP
-    private String town; // 区
-    private String city; // 市
-    private String province; //省
-    private String startTime;     //注册时间开始 查询条件
-    private String endTime;        //注册时间结束  查询条件
+    /**
+     * IP
+     */
+    private String registerIP;
+    /**
+     * 区
+     */
+    private String town;
+    /**
+     * 市
+     */
+    private String city;
+    /**
+     * 省
+     */
+    private String province;
+    /**
+     * 注册时间开始 查询条件
+     */
+    private String startTime;
+    /**
+     * 注册时间结束  查询条件
+     */
+    private String endTime;
+
+    /**
+     *  分配协销时间 查询条件
+     */
     @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
-    private Date providerTime;     //分配协销时间 查询条件
+    private Date providerTime;
+
+    /**
+     * 上次登录时间 查询条件
+     */
     @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
-    private Date loginTime;     //上次登录时间 查询条件
-    private String userIdentity;  //用户身份
-    private Integer svipUserFlag;   //超级会员用户标识,1是,2不是
+    private Date loginTime;
+    /**
+     * 用户身份
+     */
+    private String userIdentity;
+    /**
+     * 超级会员用户标识,1是,2不是
+     */
+    private Integer svipUserFlag;
 }

+ 36 - 0
src/main/java/com/caimei365/manager/entity/caimei/cmUser/CmClubLabel.java

@@ -0,0 +1,36 @@
+package com.caimei365.manager.entity.caimei.cmUser;
+
+import lombok.Data;
+
+@Data
+public class CmClubLabel {
+    private Integer id;
+    /**
+     * 机构Id
+     */
+    private Integer clubId;
+    /**
+     * 关键词
+     */
+    private String label;
+    /**
+     * 页面类型
+     */
+    private Integer pageType;
+    /**
+     * 0:动态标签;1:静态标签
+     */
+    private Integer dynamicStatus;
+    /**
+     * 出现次数
+     */
+    private Integer appearNumber;
+    /**
+     * 添加时间
+     */
+    private String addTime;
+    /**
+     * 删除标记
+     */
+    private Integer delFlag;
+}

+ 5 - 0
src/main/java/com/caimei365/manager/entity/caimei/product/Product.java

@@ -18,6 +18,11 @@ import java.util.List;
 @Data
 public class Product {
 
+    /**
+     * 需求标记:1卖出 2买入
+     */
+    private Integer buyFlag;
+
     private Integer allocateStatus;
 
     private Integer publishMethod;

+ 13 - 0
src/main/java/com/caimei365/manager/service/caimei/order/OrderService.java

@@ -0,0 +1,13 @@
+package com.caimei365.manager.service.caimei.order;
+
+import com.caimei365.manager.entity.PaginationVo;
+import com.caimei365.manager.entity.ResponseJson;
+import com.caimei365.manager.entity.caimei.CmShopOrder;
+
+public interface OrderService {
+
+    ResponseJson<PaginationVo<CmShopOrder>> listByShop(Integer sendOutStatus, Integer receiptStatus, Integer shopId,
+                                                       String beginTime, String endTime, int pageNum, int pageSize);
+
+    ResponseJson<CmShopOrder> shopOrderDetail(Integer shopOrderId);
+}

+ 35 - 0
src/main/java/com/caimei365/manager/service/caimei/order/impl/OrderServiceImpl.java

@@ -0,0 +1,35 @@
+package com.caimei365.manager.service.caimei.order.impl;
+
+import com.caimei365.manager.dao.order.OrderMapper;
+import com.caimei365.manager.entity.PaginationVo;
+import com.caimei365.manager.entity.ResponseJson;
+import com.caimei365.manager.entity.caimei.CmShopOrder;
+import com.caimei365.manager.service.caimei.order.OrderService;
+import com.github.pagehelper.PageHelper;
+import org.springframework.stereotype.Service;
+
+import javax.annotation.Resource;
+import java.util.List;
+
+@Service
+public class OrderServiceImpl implements OrderService {
+
+    @Resource
+    private OrderMapper orderMapper;
+
+
+    @Override
+    public ResponseJson<PaginationVo<CmShopOrder>> listByShop(Integer sendOutStatus, Integer receiptStatus, Integer shopId,
+                                                              String beginTime, String endTime, int pageNum, int pageSize) {
+        PageHelper.startPage(pageNum, pageSize);
+        List<CmShopOrder> shopOrderList = orderMapper.listByShop(sendOutStatus,receiptStatus, shopId, beginTime, endTime);
+        PaginationVo<CmShopOrder> paginationVo = new PaginationVo<>(shopOrderList);
+        return ResponseJson.success(paginationVo);
+    }
+
+    @Override
+    public ResponseJson<CmShopOrder> shopOrderDetail(Integer shopOrderId) {
+        CmShopOrder shopOrder = orderMapper.getShopOrderDetail(shopOrderId);
+        return ResponseJson.success(shopOrder);
+    }
+}

+ 15 - 0
src/main/java/com/caimei365/manager/service/caimei/user/CmUserService.java

@@ -0,0 +1,15 @@
+package com.caimei365.manager.service.caimei.user;
+
+import com.caimei365.manager.entity.PaginationVo;
+import com.caimei365.manager.entity.ResponseJson;
+import com.caimei365.manager.entity.caimei.cmUser.CmClub;
+import com.caimei365.manager.entity.caimei.cmUser.CmClubLabel;
+
+import java.util.List;
+
+public interface CmUserService {
+
+    ResponseJson<PaginationVo<CmClub>> getClubList(CmClub club, int pageNum, int pageSize);
+
+    ResponseJson<List<CmClubLabel>> getClubLabels(Integer dynamicStatus);
+}

+ 36 - 0
src/main/java/com/caimei365/manager/service/caimei/user/impl/CmUserServiceImpl.java

@@ -0,0 +1,36 @@
+package com.caimei365.manager.service.caimei.user.impl;
+
+import com.caimei365.manager.dao.user.UserMapper;
+import com.caimei365.manager.entity.PaginationVo;
+import com.caimei365.manager.entity.ResponseJson;
+import com.caimei365.manager.entity.caimei.cmUser.CmClub;
+import com.caimei365.manager.entity.caimei.cmUser.CmClubLabel;
+import com.caimei365.manager.service.caimei.user.CmUserService;
+import com.github.pagehelper.PageHelper;
+import org.springframework.stereotype.Service;
+
+import javax.annotation.Resource;
+import java.util.List;
+
+@Service
+public class CmUserServiceImpl implements CmUserService {
+
+    @Resource
+    private UserMapper userMapper;
+
+    @Override
+    public ResponseJson<PaginationVo<CmClub>> getClubList(CmClub club, int pageNum, int pageSize) {
+        PageHelper.startPage(pageNum,pageSize);
+        List<CmClub> clubs = userMapper.findClubList(club);
+        PaginationVo<CmClub> pageList = new PaginationVo<>(clubs);
+        return ResponseJson.success(pageList);
+    }
+
+    @Override
+    public ResponseJson<List<CmClubLabel>> getClubLabels(Integer dynamicStatus) {
+        List<CmClubLabel> labels = userMapper.findLabels(dynamicStatus);
+        return null;
+    }
+
+
+}

+ 128 - 0
src/main/resources/mapper/order/OrderDao.xml

@@ -0,0 +1,128 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
+<mapper namespace="com.caimei365.manager.dao.order.OrderMapper">
+
+    <!-- 结果映射 -->
+    <resultMap id="shopOrderResult" type="com.caimei365.manager.entity.caimei.CmShopOrder" autoMapping="true">
+        <id property="shopOrderId" column="shopOrderId"/>
+
+        <collection property="orderProducts" ofType="com.caimei365.manager.entity.caimei.OrderProductVo">
+            <id property="orderProductId" column="orderProductId"/>
+            <result property="skuId" column="skuId"/>
+            <result property="productId" column="productId"/>
+            <result property="price" column="price"/>
+            <result property="image" column="productImage"/>
+            <result property="name" column="name"/>
+            <result property="num" column="num"/>
+        </collection>
+    </resultMap>
+
+    <select id="listByShop" resultMap="shopOrderResult">
+        select cso.shopOrderId,
+        cso.shopOrderNo,
+        cso.orderNo,
+        cso.orderId,
+        cso.organizeId,
+        cso.userId,
+        cso.shopId,
+        cso.orderPromotionsId,
+        cso.orderType,
+        cso.orderSubmitType,
+        cso.note,
+        cso.productAmount,
+        cso.totalAmount,
+        cso.needPayAmount,
+        cso.promotionFullReduction,
+        cso.orderTime,
+        cso.settleStatus,
+        cso.payStatus,
+        cso.sendOutStatus,
+        cso.refundStatus,
+        cso.shopStatus,
+        cso.clubId,
+        cso.spId,
+        cso.shopProductAmount,
+        cso.shopPostFee,
+        cso.shopTaxFee,
+        cso.shouldPayShopAmount,
+        cso.payedShopAmount,
+        cso.splitCode,
+        cso.receiptStatus,
+        (SELECT NAME FROM club WHERE clubId = cso.clubId) AS clubName,
+        (SELECT NAME FROM shop WHERE shopId = cso.shopId) AS shopName,
+        cso.itemCount,
+        cop.productId,
+        cop.skuId,
+        cop.orderProductId,
+        cop.price,
+        cop.productImage
+        from cm_shop_order cso
+        left join cm_order_product cop on cso.shopOrderID = cop.shopOrderID
+        where cso.shopID = #{shopId}
+        AND cso.delFlag = '0'
+        <if test="receiptStatus != null">
+            and cso.receiptStatus = #{receiptStatus}
+        </if>
+        <if test="sendOutStatus != null">
+            and cso.sendOutStatus = #{sendOutStatus}
+        </if>
+        <if test="beginTime != null and beginTime !=''">
+            and cso.orderTime >= #{beginTime}
+        </if>
+        <if test="endTime != null and endTime !=''">
+            AND cso.orderTime <![CDATA[ <= ]]> #{endTime}
+        </if>
+        GROUP BY cso.shoporderId
+        order by cso.shopOrderID desc
+    </select>
+
+    <select id="getShopOrderDetail" resultType="com.caimei365.manager.entity.caimei.CmShopOrder">
+        SELECT
+            ifnull(cso.receiptAmount,0) as receiptAmount,
+            cso.shopOrderID AS shopOrderId,
+            cso.shopOrderNo,
+            cso.orderID AS orderId,
+            cso.orderNo,
+            cso.orderType,
+            cso.shopID AS shopId,
+            cso.organizeID as organizeId,
+            cso.note,
+            cso.userID AS userId,
+            cso.clubID AS clubId,
+            cso.spID AS spId,
+            cso.orderPromotionsId,
+            cso.promotionFullReduction,
+            cso.brokerage,
+            cso.canRefundAmount,
+            cso.itemCount,
+            cso.totalAmount,
+            cso.productAmount,
+            cso.needPayAmount,
+            cso.shopProductAmount,
+            ifnull(cso.shopPostFee, 0) as shopPostFee,
+            IFNULL(cso.shopPostFlag, 0) AS shopPostFlag,
+            cso.shopTaxFee,
+            cso.shouldPayShopAmount,
+            cso.payedShopAmount,
+            ifnull(cso.accountAmount,0) as accountAmount,
+            cso.outStoreNum,
+            IFNULL(cso.presentNum,0) AS presentNum,
+            cso.orderTime,
+            cso.orderSubmitType,
+            cso.payStatus,
+            ifnull(cso.settlestatus, 1) as settlestatus,
+            ifnull(cso.sendOutStatus, 1) as sendOutStatus,
+            ifnull(cso.receiptStatus, 1) as receiptStatus,
+            ifnull(cso.orderStatusFlag, 1) as orderStatusFlag,
+            ifnull(cso.refundStatus, 1) as refundStatus,
+            cso.shopStatus,
+            cso.couponAmount,
+            ifnull(cso.useBalanceFlag, 0) as useBalanceFlag,
+            (SELECT NAME FROM club WHERE clubId = cso.clubId) AS clubName,
+            (SELECT NAME FROM shop WHERE shopId = cso.shopId) AS shopName
+        FROM cm_shop_order cso
+        WHERE cso.shopOrderID = #{shopOrderId}
+          AND cso.delFlag = '0'
+        GROUP BY cso.shoporderId
+    </select>
+</mapper>

+ 1 - 0
src/main/resources/mapper/product/ProductMapper.xml

@@ -203,6 +203,7 @@
         cshd.brandName AS "otherBrandName",
         cshd.publisher AS "publisher",
         cshd.source AS "source",
+        cshd.buyFlag AS "buyFlag",
         cshd.dockingPeopleName AS "dockingPeopleName",
         cb.name as "brandName",
         if(csp.id is not null,1,0) as "svipFlag",

+ 133 - 0
src/main/resources/mapper/user/UserMapper.xml

@@ -98,6 +98,139 @@
                user.openId
     </sql>
 
+    <select id="findLabels" resultType="com.caimei365.manager.entity.caimei.cmUser.CmClubLabel">
+        SELECT label, dynamicStatus
+        FROM cm_club_label
+        where dynamicStatus = #{dynamicStatus}
+    </select>
+
+
+    <select id="findClubList" resultType="com.caimei365.manager.entity.caimei.cmUser.CmClub">
+        SELECT
+        a.checkMan as "checkMan",
+        a.clubID AS "clubId",
+        a.userID AS "userId",
+        u.name AS "name",
+        a.sname AS "sname",
+        a.logo AS "logo",
+        a.legalPerson AS "legalPerson",
+        a.provinceID AS "provinceId",
+        a.cityID AS "cityId",
+        a.townID AS "townId",
+        a.flag AS "flag",
+        a.spID AS "spId",
+        a.mainServiceProviderID AS "mainServiceProviderId",
+        a.scanTime AS "scanTime",
+        a.address AS "address",
+        a.linkMan AS "linkMan",
+        a.linkManIdentity AS "linkManIdentity",
+        a.contractPhone AS "contractPhone",
+        a.contractMobile AS "contractMobile",
+        a.fax AS "fax",
+        a.info AS "info",
+        a.addTime AS "addTime",
+        a.auditTime AS "auditTime",
+        a.auditNote AS "auditNote",
+        a.status AS "status",
+        a.businessLicenseImage AS "businessLicenseImage",
+        a.mainpro AS "mainpro",
+        a.scanFlag AS "scanFlag",
+        a.headpic AS "headpic",
+        a.socialCreditCode AS "socialCreditCode",
+        a.lastModify AS "lastModify",
+        a.firstClubType AS "firstClubType",
+        a.secondClubType AS "secondClubType",
+        a.department AS "department",
+        a.medicalPracticeLicenseImg AS "medicalPracticeLicenseImg",
+        a.newDeal as "newDeal",
+        case sp.status when 91 then '采美默认协销经理(官方账号)' else sp.linkMan end AS "spName",
+        d.name AS "province",
+        c.name AS "city",
+        b.name AS "town",
+        u.account AS "account",
+        u.registerTime AS "registerTime",
+        u.registerIP AS "registerIP",
+        u.userName AS "userName",
+        u.bindMobile AS "bindMobile",
+        u.email AS "email",
+        u.userOrganizeID AS "userOrganizeId",
+        u.userIdentity AS "userIdentity",
+        if(csu.delFlag = '0' and now() <![CDATA[ < ]]> csu.endTime,1,0) as svipUserFlag,
+        u.source,
+        u.loginTime
+        FROM club a
+        LEFT JOIN user u ON u.userID = a.userID
+        LEFT JOIN cm_svip_user csu ON csu.userId = u.userID
+        LEFT JOIN serviceprovider sp ON sp.serviceProviderID = a.spID
+        LEFT JOIN town b ON b.townID=a.townID
+        LEFT JOIN city c ON c.cityID=a.cityID
+        LEFT JOIN province d ON d.provinceID=a.provinceID
+        <where>
+            u.userOrganizeID != 4 AND u.userIdentity != 8
+            <if test="userOrganizeId == null">
+                AND (u.userOrganizeID IN(0,1,5) or u.clubStatus != 92)
+            </if>
+            <if test="userOrganizeId != null">
+                AND u.userOrganizeID = #{userOrganizeId}
+            </if>
+            <if test="clubId != null and clubId != ''">
+                AND a.clubID = #{clubId}
+            </if>
+            <if test="clubId == 0">
+                AND a.clubID = #{clubId}
+            </if>
+            <if test="userId != null and userId != ''">
+                AND a.userID = #{userId}
+            </if>
+            <if test="account != null and account != ''">
+                AND u.account = #{account}
+            </if>
+            <if test="name != null and name != ''">
+                AND u.name LIKE concat('%',#{name},'%')
+            </if>
+            <if test="userName != null and userName != ''">
+                AND u.userName LIKE concat('%',#{userName},'%')
+            </if>
+            <if test="townId != null and townId != ''">
+                AND d.provinceID = #{provinceId}
+            </if>
+            <if test="cityId != null and cityId != ''">
+                AND c.cityID = #{cityId}
+            </if>
+            <if test="townId != null and townId != ''">
+                AND b.townID = #{townId}
+            </if>
+            <if test="status != null and status != ''">
+                AND a.status = #{status}
+            </if>
+            <if test="bindMobile != null and bindMobile != ''">
+                AND u.bindMobile LIKE concat('%',#{bindMobile},'%')
+            </if>
+            <if test="linkMan != null and linkMan != ''">
+                AND a.linkMan LIKE concat('%',#{linkMan},'%')
+            </if>
+            <if test="startTime != null and startTime != ''">
+                AND u.registerTime <![CDATA[ >= ]]> #{startTime}
+            </if>
+            <if test="endTime != null and endTime != ''">
+                AND u.registerTime <![CDATA[ <= ]]> #{endTime}
+            </if>
+            <if test="userIdentity != null and userIdentity != '' and userIdentity != '8'.toString()">
+                AND u.userIdentity = #{userIdentity}
+            </if>
+            <if test="userIdentity != null and userIdentity != '' and userIdentity == '8'.toString()">
+                AND csu.delFlag = '0' and now() <![CDATA[ < ]]> csu.endTime
+            </if>
+            <if test="spId != null and spId != ''">
+                AND sp.serviceProviderID = #{spId}
+            </if>
+        </where>
+        ORDER BY case when a.status = 91 then 0 else 1 end desc, a.addTime DESC
+    </select>
+
+
+
+
     <select id="getByUser" parameterType="User" resultMap="UserResult">
         <include refid="selectUserVo"/>
         from user AS user