Przeglądaj źródła

Merge remote-tracking branch 'origin/master'

FengChaoYu 4 tygodni temu
rodzic
commit
293c72eb84

+ 1 - 1
src/main/java/com/gree/mall/manager/bean/coupon/CouponBean.java

@@ -23,7 +23,7 @@ public class CouponBean extends Coupon {
     private List<CouponUserTypeBean> userList;
     private List<CouponUserTypeBean> userList;
 
 
     @ApiModelProperty( value = "商户列表")
     @ApiModelProperty( value = "商户列表")
-    private List<CouponCompany> couponCompanyList;
+    private List<CouponCompany> couponCompanys;
 
 
     @ApiModelProperty( value = "商家列表")
     @ApiModelProperty( value = "商家列表")
     private List<CouponWebsit> couponWebsitList;
     private List<CouponWebsit> couponWebsitList;

+ 0 - 5
src/main/java/com/gree/mall/manager/bean/coupon/CouponVO.java

@@ -48,8 +48,6 @@ public class CouponVO  {
     @ApiModelProperty(value = "每人限领次数")
     @ApiModelProperty(value = "每人限领次数")
     private Integer receiveLimitCount;
     private Integer receiveLimitCount;
 
 
-    @ApiModelProperty(value = "显示时间")
-    private Date displayTime;
 
 
     @ApiModelProperty(value = "状态")
     @ApiModelProperty(value = "状态")
     private CouponStatusEnum flag;
     private CouponStatusEnum flag;
@@ -60,9 +58,6 @@ public class CouponVO  {
     @ApiModelProperty(value = "优惠券领取结束时间")
     @ApiModelProperty(value = "优惠券领取结束时间")
     private Date obtainEndTime;
     private Date obtainEndTime;
 
 
-    @ApiModelProperty(value = "领券多少天内有效")
-    private Integer activeDay;
-
     @ApiModelProperty(value = "优惠券使用开始时间")
     @ApiModelProperty(value = "优惠券使用开始时间")
     private Date activeStartTime;
     private Date activeStartTime;
 
 

+ 3 - 0
src/main/java/com/gree/mall/manager/bean/goods/GoodsBean.java

@@ -19,6 +19,9 @@ public class GoodsBean extends Goods {
     @ApiModelProperty("轮播图")
     @ApiModelProperty("轮播图")
     private List<CommonFile> images;
     private List<CommonFile> images;
 
 
+    @ApiModelProperty("所属商户")
+    private List<GoodsCompany> goodsCompanies;
+
 
 
     private String category1;
     private String category1;
     private String category2;
     private String category2;

+ 2 - 1
src/main/java/com/gree/mall/manager/controller/order/OrderRefundController.java

@@ -30,6 +30,7 @@ public class OrderRefundController {
     @ApiOperation("列表")
     @ApiOperation("列表")
     public ResponseHelper<Page<OrderRefundDetailBean>> list(HttpServletRequest request,
     public ResponseHelper<Page<OrderRefundDetailBean>> list(HttpServletRequest request,
                                                             @ApiParam(value = "订单号",required = false) @RequestParam(required = false) String orderId,
                                                             @ApiParam(value = "订单号",required = false) @RequestParam(required = false) String orderId,
+                                                            @ApiParam(value = "网点",required = false) @RequestParam(required = false) String websitId,
                                                             @ApiParam(value = "售后订单号",required = false) @RequestParam(required = false) String orderRefundId,
                                                             @ApiParam(value = "售后订单号",required = false) @RequestParam(required = false) String orderRefundId,
                                                             @ApiParam(value = "用户名",required = false) @RequestParam(required = false) String userName,
                                                             @ApiParam(value = "用户名",required = false) @RequestParam(required = false) String userName,
                                                             @ApiParam(value = "手机号",required = false) @RequestParam(required = false) String phone,
                                                             @ApiParam(value = "手机号",required = false) @RequestParam(required = false) String phone,
@@ -42,7 +43,7 @@ public class OrderRefundController {
                                                             @ApiParam(value = "页大小",required = true) @RequestParam(required = true) Integer pageSize
                                                             @ApiParam(value = "页大小",required = true) @RequestParam(required = true) Integer pageSize
     ) throws RemoteServiceException {
     ) throws RemoteServiceException {
         IPage<OrderRefundDetailBean> list = orderRefundLogic
         IPage<OrderRefundDetailBean> list = orderRefundLogic
-                .list(request,orderId, orderRefundId, userName, phone, orderStatus, startCreateTime, endCreateTime, startExamineTime, endExamineTime, pageNum, pageSize);
+                .list(websitId,request,orderId, orderRefundId, userName, phone, orderStatus, startCreateTime, endCreateTime, startExamineTime, endExamineTime, pageNum, pageSize);
         return ResponseHelper.success(list);
         return ResponseHelper.success(list);
     }
     }
 
 

+ 2 - 1
src/main/java/com/gree/mall/manager/controller/order/OrderShareController.java

@@ -18,6 +18,7 @@ import org.springframework.web.bind.annotation.*;
 import javax.servlet.http.HttpServletRequest;
 import javax.servlet.http.HttpServletRequest;
 import javax.servlet.http.HttpServletResponse;
 import javax.servlet.http.HttpServletResponse;
 import java.rmi.RemoteException;
 import java.rmi.RemoteException;
+import java.util.List;
 
 
 @Slf4j
 @Slf4j
 @RestController
 @RestController
@@ -39,7 +40,7 @@ public class OrderShareController {
             @ApiParam(value = "订单号", required = false) @RequestParam(required = false) String orderId,
             @ApiParam(value = "订单号", required = false) @RequestParam(required = false) String orderId,
             @ApiParam(value = "用户名", required = false) @RequestParam(required = false) String workUserName,
             @ApiParam(value = "用户名", required = false) @RequestParam(required = false) String workUserName,
             @ApiParam(value = "手机号", required = false) @RequestParam(required = false) String phone,
             @ApiParam(value = "手机号", required = false) @RequestParam(required = false) String phone,
-            @ApiParam(value = "结算状态: ING=结算中  OVER=已结算  CANCEL=已取消 EXCEPTION=异常结算", required = false) @RequestParam(required = false) String status,
+            @ApiParam(value = "结算状态: ING=结算中  OVER=已结算  CANCEL=已取消 EXCEPTION=异常结算", required = false) @RequestParam(required = false) List<String> status,
             @ApiParam(value = "开始创建时间", required = false) @RequestParam(required = false) String startTime,
             @ApiParam(value = "开始创建时间", required = false) @RequestParam(required = false) String startTime,
             @ApiParam(value = "结束创建时间", required = false) @RequestParam(required = false) String endTime,
             @ApiParam(value = "结束创建时间", required = false) @RequestParam(required = false) String endTime,
             @ApiParam(value = "开始结算时间", required = false) @RequestParam(required = false) String startSettleTime,
             @ApiParam(value = "开始结算时间", required = false) @RequestParam(required = false) String startSettleTime,

+ 10 - 2
src/main/java/com/gree/mall/manager/logic/admin/AdminDeptLogic.java

@@ -52,14 +52,20 @@ public class AdminDeptLogic {
     public List<AdminDeptTree> tree(HttpServletRequest request) {
     public List<AdminDeptTree> tree(HttpServletRequest request) {
         final AdminUserCom adminUser = commonLogic.getAdminUser();
         final AdminUserCom adminUser = commonLogic.getAdminUser();
         List<AdminDept> list = new ArrayList<>();
         List<AdminDept> list = new ArrayList<>();
-        if (!adminUser.getType().equals(1) ){
+
+        List<Integer> types = new ArrayList<>();
+        types.add(0);
+        types.add(1);
+        types.add(3);
+
+
+        if (!types.contains(adminUser.getType()) ){
             list = adminDeptService.lambdaQuery()
             list = adminDeptService.lambdaQuery()
                     .in(CollectionUtil.isNotEmpty(adminUser.getAdminCompanyIds()), AdminDept::getCompanyId, adminUser.getAdminCompanyIds())
                     .in(CollectionUtil.isNotEmpty(adminUser.getAdminCompanyIds()), AdminDept::getCompanyId, adminUser.getAdminCompanyIds())
                     .eq(AdminDept::getPId, "1")
                     .eq(AdminDept::getPId, "1")
                     .list();
                     .list();
         }else{
         }else{
             list = adminDeptService.lambdaQuery()
             list = adminDeptService.lambdaQuery()
-                    .in(CollectionUtil.isNotEmpty(adminUser.getAdminCompanyIds()), AdminDept::getCompanyId, adminUser.getCompanyId())
                     .eq(AdminDept::getAdminDeptId, "1")
                     .eq(AdminDept::getAdminDeptId, "1")
                     .list();
                     .list();
         }
         }
@@ -79,8 +85,10 @@ public class AdminDeptLogic {
     }
     }
 
 
     private List<AdminDeptTree> treeModule(String adminDeptId) {
     private List<AdminDeptTree> treeModule(String adminDeptId) {
+        AdminUserCom adminUser = commonLogic.getAdminUser();
         //最父级资源树
         //最父级资源树
         List<AdminDept> collect = adminDeptService.lambdaQuery()
         List<AdminDept> collect = adminDeptService.lambdaQuery()
+                .in(CollectionUtil.isNotEmpty(adminUser.getAdminCompanyIds()), AdminDept::getCompanyId, adminUser.getAdminCompanyIds())
                 .eq(AdminDept::getPId, adminDeptId).list();
                 .eq(AdminDept::getPId, adminDeptId).list();
 
 
         if (collect.size() == 0) {
         if (collect.size() == 0) {

+ 27 - 8
src/main/java/com/gree/mall/manager/logic/admin/AdminWebsitLogic.java

@@ -12,14 +12,8 @@ import com.gree.mall.manager.enums.IsYesNoEnum;
 import com.gree.mall.manager.exception.RemoteServiceException;
 import com.gree.mall.manager.exception.RemoteServiceException;
 import com.gree.mall.manager.logic.common.CommonLogic;
 import com.gree.mall.manager.logic.common.CommonLogic;
 import com.gree.mall.manager.logic.common.LbsAmapLogic;
 import com.gree.mall.manager.logic.common.LbsAmapLogic;
-import com.gree.mall.manager.plus.entity.AdminCompanyWechat;
-import com.gree.mall.manager.plus.entity.AdminWebsit;
-import com.gree.mall.manager.plus.entity.AdminZone;
-import com.gree.mall.manager.plus.entity.SysDictCompany;
-import com.gree.mall.manager.plus.service.AdminCompanyWechatService;
-import com.gree.mall.manager.plus.service.AdminWebsitService;
-import com.gree.mall.manager.plus.service.AdminZoneService;
-import com.gree.mall.manager.plus.service.SysDictCompanyService;
+import com.gree.mall.manager.plus.entity.*;
+import com.gree.mall.manager.plus.service.*;
 import com.gree.mall.manager.utils.StringUtil;
 import com.gree.mall.manager.utils.StringUtil;
 import com.gree.mall.manager.zfire.bean.ZfireParamBean;
 import com.gree.mall.manager.zfire.bean.ZfireParamBean;
 import com.gree.mall.manager.zfire.util.FieldUtils;
 import com.gree.mall.manager.zfire.util.FieldUtils;
@@ -61,6 +55,9 @@ public class AdminWebsitLogic {
     @Autowired
     @Autowired
     LbsAmapLogic lbsAmapLogic;
     LbsAmapLogic lbsAmapLogic;
 
 
+    @Autowired
+    AdminDeptWebsitService adminDeptWebsitService;
+
     /**
     /**
      * 区域列表
      * 区域列表
      */
      */
@@ -144,6 +141,13 @@ public class AdminWebsitLogic {
         adminUserBean.setPermissions(adminUserPermissions);
         adminUserBean.setPermissions(adminUserPermissions);
         adminUserLogic.save(adminUserBean, request);
         adminUserLogic.save(adminUserBean, request);
 
 
+        AdminDeptWebsit adminDeptWebsit = new AdminDeptWebsit();
+        adminDeptWebsit.setWebsitName(adminWebsit.getName());
+        adminDeptWebsit.setWebsitId(adminWebsit.getWebsitId());
+        adminDeptWebsit.setAdminDeptId(adminWebsit.getCompanyId());
+        adminDeptWebsit.setDeptName(adminWebsit.getCompanyName());
+        adminDeptWebsit.insert();
+
     }
     }
     /**
     /**
      * 编辑部门
      * 编辑部门
@@ -285,6 +289,13 @@ public class AdminWebsitLogic {
             if (oneP == null)
             if (oneP == null)
                 throw new RemoteServiceException("第"+rowIndex+"行,找不到上级商户");
                 throw new RemoteServiceException("第"+rowIndex+"行,找不到上级商户");
 
 
+
+            AdminWebsit adminWebsitServiceById = adminWebsitService.getById((String) row.get(1));
+
+            if (adminWebsitServiceById != null) {
+                throw new RemoteServiceException("第"+rowIndex+"行,商家编号已存在");
+            }
+
             adminWebsit.setCompanyName(oneP.getCompanyName());
             adminWebsit.setCompanyName(oneP.getCompanyName());
             adminWebsit.setCompanyId(oneP.getCompanyWechatId());
             adminWebsit.setCompanyId(oneP.getCompanyWechatId());
             adminWebsit.setWebsitId((String) row.get(1));
             adminWebsit.setWebsitId((String) row.get(1));
@@ -362,6 +373,14 @@ public class AdminWebsitLogic {
 
 
             adminUserBean.setPermissions(adminUserPermissions);
             adminUserBean.setPermissions(adminUserPermissions);
             adminUserLogic.save(adminUserBean, request);
             adminUserLogic.save(adminUserBean, request);
+
+
+            AdminDeptWebsit adminDeptWebsit = new AdminDeptWebsit();
+            adminDeptWebsit.setWebsitName(adminWebsit.getName());
+            adminDeptWebsit.setWebsitId(adminWebsit.getWebsitId());
+            adminDeptWebsit.setAdminDeptId(adminWebsit.getCompanyId());
+            adminDeptWebsit.setDeptName(adminWebsit.getCompanyName());
+            adminDeptWebsit.insert();
         }
         }
     }
     }
 }
 }

+ 17 - 11
src/main/java/com/gree/mall/manager/logic/coupon/CouponLogic.java

@@ -136,14 +136,20 @@ public class CouponLogic {
      * @return
      * @return
      */
      */
     public CouponDetailBean detail(String couponId) {
     public CouponDetailBean detail(String couponId) {
+        AdminUserCom adminUser = commonLogic.getAdminUser();
         Coupon coupon = couponService.getById(couponId);
         Coupon coupon = couponService.getById(couponId);
         CouponDetailBean couponBean = new CouponDetailBean();
         CouponDetailBean couponBean = new CouponDetailBean();
         BeanUtils.copyProperties(coupon, couponBean);
         BeanUtils.copyProperties(coupon, couponBean);
         couponBean.setGoodsList(couponGoodsService.lambdaQuery().eq(CouponGoods::getCouponId, couponId).list());
         couponBean.setGoodsList(couponGoodsService.lambdaQuery().eq(CouponGoods::getCouponId, couponId).list());
         couponBean.setTagList(couponDateMapper.couponTagDetail(couponId));
         couponBean.setTagList(couponDateMapper.couponTagDetail(couponId));
         couponBean.setUserList(couponDateMapper.couponTagUser(couponId));
         couponBean.setUserList(couponDateMapper.couponTagUser(couponId));
-        couponBean.setCouponCompanyList(couponCompanyService.lambdaQuery().eq(CouponCompany::getCouponId, couponId).list());
-        couponBean.setCouponWebsitList(couponWebsitService.lambdaQuery().eq(CouponWebsit::getCouponId, couponId).list());
+        couponBean.setCouponCompanyList(couponCompanyService.lambdaQuery().eq(CouponCompany::getCouponId, couponId)
+                .in(CouponCompany::getCompanyId,adminUser.getAdminCompanyIds())
+                .list());
+        couponBean.setCouponWebsitList(couponWebsitService.lambdaQuery()
+                .eq(CouponWebsit::getCouponId, couponId)
+                .in(CouponWebsit::getWebsitId, adminUser.getAdminWebsitIds())
+                .list());
         return couponBean;
         return couponBean;
     }
     }
 
 
@@ -157,7 +163,7 @@ public class CouponLogic {
     public void add(HttpServletRequest request,CouponBean couponBean) throws RemoteServiceException {
     public void add(HttpServletRequest request,CouponBean couponBean) throws RemoteServiceException {
         AdminUserCom adminUser = commonLogic.getAdminUser(request);
         AdminUserCom adminUser = commonLogic.getAdminUser(request);
 
 
-        if (CollectionUtils.isEmpty(couponBean.getCouponCompanyList()))
+        if (CollectionUtils.isEmpty(couponBean.getCouponCompanys()))
             throw new RemoteServiceException("请选择使用商户");
             throw new RemoteServiceException("请选择使用商户");
 
 
  /*       if (couponBean.getActiveType() == 1) {
  /*       if (couponBean.getActiveType() == 1) {
@@ -182,13 +188,13 @@ public class CouponLogic {
         String couponId = couponBean.getCouponId();
         String couponId = couponBean.getCouponId();
 
 
 
 
-        for (CouponCompany couponCompany : couponBean.getCouponCompanyList()) {
+        for (CouponCompany couponCompany : couponBean.getCouponCompanys()) {
             AdminCompany adminCompany = adminCompanyService.getById(couponCompany.getCompanyId());
             AdminCompany adminCompany = adminCompanyService.getById(couponCompany.getCompanyId());
             couponCompany.setCouponId(couponId);
             couponCompany.setCouponId(couponId);
             couponCompany.setCompanyName(adminCompany.getAdminCompanyName());
             couponCompany.setCompanyName(adminCompany.getAdminCompanyName());
         }
         }
 
 
-        couponCompanyService.saveBatch(couponBean.getCouponCompanyList());
+        couponCompanyService.saveBatch(couponBean.getCouponCompanys());
 
 
         if (!CollectionUtils.isEmpty(couponBean.getCouponWebsitList())){
         if (!CollectionUtils.isEmpty(couponBean.getCouponWebsitList())){
             for (CouponWebsit couponWebsit : couponBean.getCouponWebsitList()) {
             for (CouponWebsit couponWebsit : couponBean.getCouponWebsitList()) {
@@ -217,7 +223,7 @@ public class CouponLogic {
         if (couponBean.getReceiveCrowd().equals(Convert.toInt(CouponCrowdEnum.ALL.getKey())) && couponBean.getUserList() != null) {
         if (couponBean.getReceiveCrowd().equals(Convert.toInt(CouponCrowdEnum.ALL.getKey())) && couponBean.getUserList() != null) {
             List<CouponUser> couponUserList = new ArrayList<>();
             List<CouponUser> couponUserList = new ArrayList<>();
             List<User> userList = userService.lambdaQuery()
             List<User> userList = userService.lambdaQuery()
-                    .in(CollectionUtils.isNotEmpty(couponBean.getCouponCompanyList()),User::getCompanyId, couponBean.getCouponCompanyList().stream().map(CouponCompany::getCompanyId).collect(Collectors.toList()))
+                    .in(CollectionUtils.isNotEmpty(couponBean.getCouponCompanys()),User::getCompanyId, couponBean.getCouponCompanys().stream().map(CouponCompany::getCompanyId).collect(Collectors.toList()))
                     .in(CollectionUtils.isNotEmpty(couponBean.getCouponWebsitList()),User::getWebsitId, couponBean.getCouponWebsitList().stream().map(CouponWebsit::getWebsitId).collect(Collectors.toList()))
                     .in(CollectionUtils.isNotEmpty(couponBean.getCouponWebsitList()),User::getWebsitId, couponBean.getCouponWebsitList().stream().map(CouponWebsit::getWebsitId).collect(Collectors.toList()))
                     .list();
                     .list();
             for (User user : userList) {
             for (User user : userList) {
@@ -267,7 +273,7 @@ public class CouponLogic {
             List<UserCoupon> userCouponList = new ArrayList<>();
             List<UserCoupon> userCouponList = new ArrayList<>();
             List<User> userList = userService.lambdaQuery()
             List<User> userList = userService.lambdaQuery()
                     .eq(User::getType, UserTypeEnum.SERVICE.toString())
                     .eq(User::getType, UserTypeEnum.SERVICE.toString())
-                    .in(CollectionUtils.isNotEmpty(couponBean.getCouponCompanyList()),User::getCompanyId, couponBean.getCouponCompanyList().stream().map(CouponCompany::getCompanyId).collect(Collectors.toList()))
+                    .in(CollectionUtils.isNotEmpty(couponBean.getCouponCompanys()),User::getCompanyId, couponBean.getCouponCompanys().stream().map(CouponCompany::getCompanyId).collect(Collectors.toList()))
                     .in(CollectionUtils.isNotEmpty(couponBean.getCouponWebsitList()),User::getWebsitId, couponBean.getCouponWebsitList().stream().map(CouponWebsit::getWebsitId).collect(Collectors.toList()))
                     .in(CollectionUtils.isNotEmpty(couponBean.getCouponWebsitList()),User::getWebsitId, couponBean.getCouponWebsitList().stream().map(CouponWebsit::getWebsitId).collect(Collectors.toList()))
                     .list();
                     .list();
             List<CouponUser> couponUserList = new ArrayList<>();
             List<CouponUser> couponUserList = new ArrayList<>();
@@ -289,7 +295,7 @@ public class CouponLogic {
             List<CouponUser> couponUserList = new ArrayList<>();
             List<CouponUser> couponUserList = new ArrayList<>();
             List<User> userList = userService.lambdaQuery()
             List<User> userList = userService.lambdaQuery()
                     .eq(User::getType, UserTypeEnum.GENERAL.toString())
                     .eq(User::getType, UserTypeEnum.GENERAL.toString())
-                    .in(CollectionUtils.isNotEmpty(couponBean.getCouponCompanyList()),User::getCompanyId, couponBean.getCouponCompanyList().stream().map(CouponCompany::getCompanyId).collect(Collectors.toList()))
+                    .in(CollectionUtils.isNotEmpty(couponBean.getCouponCompanys()),User::getCompanyId, couponBean.getCouponCompanys().stream().map(CouponCompany::getCompanyId).collect(Collectors.toList()))
                     .in(CollectionUtils.isNotEmpty(couponBean.getCouponWebsitList()),User::getWebsitId, couponBean.getCouponWebsitList().stream().map(CouponWebsit::getWebsitId).collect(Collectors.toList()))
                     .in(CollectionUtils.isNotEmpty(couponBean.getCouponWebsitList()),User::getWebsitId, couponBean.getCouponWebsitList().stream().map(CouponWebsit::getWebsitId).collect(Collectors.toList()))
                     .list();
                     .list();
             for (User user : userList) {
             for (User user : userList) {
@@ -404,13 +410,13 @@ public class CouponLogic {
         couponBean.setCreateTime(null);
         couponBean.setCreateTime(null);
 
 
         couponCompanyService.lambdaUpdate().eq(CouponCompany::getCouponId,coupon.getCouponId()).remove();
         couponCompanyService.lambdaUpdate().eq(CouponCompany::getCouponId,coupon.getCouponId()).remove();
-        for (CouponCompany couponCompany : couponBean.getCouponCompanyList()) {
+        for (CouponCompany couponCompany : couponBean.getCouponCompanys()) {
             AdminCompany adminCompany = adminCompanyService.getById(couponCompany.getCompanyId());
             AdminCompany adminCompany = adminCompanyService.getById(couponCompany.getCompanyId());
             couponCompany.setCouponId(coupon.getCouponId());
             couponCompany.setCouponId(coupon.getCouponId());
             couponCompany.setCompanyName(adminCompany.getAdminCompanyName());
             couponCompany.setCompanyName(adminCompany.getAdminCompanyName());
         }
         }
 
 
-        couponCompanyService.saveBatch(couponBean.getCouponCompanyList());
+        couponCompanyService.saveBatch(couponBean.getCouponCompanys());
 
 
         couponWebsitService.lambdaUpdate().eq(CouponWebsit::getCouponId,coupon.getCouponId()).remove();
         couponWebsitService.lambdaUpdate().eq(CouponWebsit::getCouponId,coupon.getCouponId()).remove();
         if (!CollectionUtils.isEmpty(couponBean.getCouponWebsitList())){
         if (!CollectionUtils.isEmpty(couponBean.getCouponWebsitList())){
@@ -469,7 +475,7 @@ public class CouponLogic {
                                 //.eq(UserCoupon::getTransferType, true)
                                 //.eq(UserCoupon::getTransferType, true)
                                 .one();
                                 .one();
                         if (userCoupon == null) {
                         if (userCoupon == null) {
-                            userCouponService.save(assignCoupon(adminUser, couponBean, couponUserTypeBean.getUserId()));
+                           // userCouponService.save(assignCoupon(adminUser, couponBean, couponUserTypeBean.getUserId()));
                         }
                         }
 
 
                     }
                     }

+ 1 - 0
src/main/java/com/gree/mall/manager/logic/goods/GoodsApplyLogic.java

@@ -207,6 +207,7 @@ public class GoodsApplyLogic {
 
 
         if (ifStatus) {
         if (ifStatus) {
             goodsApplyAddUp.setStatus(ExamineStatusEnum.OK.getKey());
             goodsApplyAddUp.setStatus(ExamineStatusEnum.OK.getKey());
+            goodsApplyAddUp.updateById();
         }else {
         }else {
             goodsApplyAddUp.setStatus(ExamineStatusEnum.WAIT.getKey());
             goodsApplyAddUp.setStatus(ExamineStatusEnum.WAIT.getKey());
             goodsApplyAddUp.updateById();
             goodsApplyAddUp.updateById();

+ 34 - 27
src/main/java/com/gree/mall/manager/logic/goods/GoodsLogic.java

@@ -314,6 +314,7 @@ public class GoodsLogic {
      * @return
      * @return
      */
      */
     public GoodsBean detail(String goodsId) throws RemoteServiceException {
     public GoodsBean detail(String goodsId) throws RemoteServiceException {
+        AdminUserCom adminUser = commonLogic.getAdminUser();
         Goods goods = goodsService.getById(goodsId);
         Goods goods = goodsService.getById(goodsId);
         List<GoodsSpec> goodsSpecs = goodsSpecService.lambdaQuery()
         List<GoodsSpec> goodsSpecs = goodsSpecService.lambdaQuery()
                 .eq(GoodsSpec::getGoodsId, goodsId)
                 .eq(GoodsSpec::getGoodsId, goodsId)
@@ -330,6 +331,11 @@ public class GoodsLogic {
         BeanUtils.copyProperties(goods, goodsBean);
         BeanUtils.copyProperties(goods, goodsBean);
         goodsBean.setGoodsSpecs(goodsSpecs);
         goodsBean.setGoodsSpecs(goodsSpecs);
         goodsBean.setImages(commonLogic.queryFileByObjId(goods.getGoodsId(), Constant.Img.GOODS_IMG));
         goodsBean.setImages(commonLogic.queryFileByObjId(goods.getGoodsId(), Constant.Img.GOODS_IMG));
+
+        goodsBean.setGoodsCompanies(goodsCompanyService.lambdaQuery()
+        .in(CollectionUtils.isNotEmpty(adminUser.getAdminCompanyIds()),GoodsCompany::getCompanyId,adminUser.getAdminCompanyIds())
+                .eq(GoodsCompany::getGoodsId,goods.getGoodsId()).list()
+        );
         goodsBean.setStock(goodsStock);
         goodsBean.setStock(goodsStock);
         List<GoodsTemplate> goodsTemplates = goodsTemplateService.lambdaQuery()
         List<GoodsTemplate> goodsTemplates = goodsTemplateService.lambdaQuery()
                 .eq(GoodsTemplate::getGoodsId, goodsId)
                 .eq(GoodsTemplate::getGoodsId, goodsId)
@@ -434,17 +440,28 @@ public class GoodsLogic {
         }
         }
         goodsBean.setUpdateTime(new Date());
         goodsBean.setUpdateTime(new Date());
         goodsBean.setCreateTime(creatDate);
         goodsBean.setCreateTime(creatDate);
+        String name ="";
+        for (GoodsCompany goodsCompany : goodsBean.getGoodsCompanies()) {
+
+            AdminCompany adminCompany = adminCompanyService.getById(goodsCompany.getCompanyId());
+            name = name+adminCompany.getAdminCompanyName()+",";
+            goodsCompany.setGoodsId(goodsBean.getGoodsId());
+            goodsCompany.setConpanyName(adminCompany.getAdminCompanyName());
+        }
+
+        goodsCompanyService.saveBatch(goodsBean.getGoodsCompanies());
 
 
-        List<GoodsCompany> goodsCompanies = new ArrayList<>();
+        String result = name.substring(0, name.length() - 1);
+        goodsBean.setPutCompanyName(result);
 
 
-        if (!StringUtil.isEmpty(goodsBean.getPutCompanyId())) {
+/*        if (!StringUtil.isEmpty(goodsBean.getPutCompanyId())) {
             goodsBean.setPutCompanyId(goodsBean.getPutCompanyId());
             goodsBean.setPutCompanyId(goodsBean.getPutCompanyId());
             String[] split = StringUtils.split(goodsBean.getPutCompanyId(), ",");
             String[] split = StringUtils.split(goodsBean.getPutCompanyId(), ",");
 
 
-            String name ="";
+
             for (String s : split) {
             for (String s : split) {
                 AdminCompany adminCompany = adminCompanyService.getById(s);
                 AdminCompany adminCompany = adminCompanyService.getById(s);
-                name = name+adminCompany.getAdminCompanyName()+",";
+
 
 
                 GoodsCompany goodsCompany = new GoodsCompany();
                 GoodsCompany goodsCompany = new GoodsCompany();
                 goodsCompany.setGoodsId(goodsBean.getGoodsId());
                 goodsCompany.setGoodsId(goodsBean.getGoodsId());
@@ -453,11 +470,10 @@ public class GoodsLogic {
 
 
                 goodsCompanies.add(goodsCompany);
                 goodsCompanies.add(goodsCompany);
             }
             }
-            String result = name.substring(0, name.length() - 1);
-            goodsBean.setPutCompanyName(result);
 
 
-            goodsCompanyService.saveBatch(goodsCompanies);
-        }
+
+
+        }*/
 
 
         GoodsCategory goodsCategory = goodsCategoryService.getById(goodsBean.getCategoryId());
         GoodsCategory goodsCategory = goodsCategoryService.getById(goodsBean.getCategoryId());
         GoodsCategory goodsCategoryPid = goodsCategoryService.getById(goodsCategory.getParentId());
         GoodsCategory goodsCategoryPid = goodsCategoryService.getById(goodsCategory.getParentId());
@@ -595,30 +611,21 @@ public class GoodsLogic {
 
 
         //设置企业微信id
         //设置企业微信id
         AdminUserCom adminUser = commonLogic.getAdminUser(request);
         AdminUserCom adminUser = commonLogic.getAdminUser(request);
-        List<GoodsCompany> goodsCompanies = new ArrayList<>();
 
 
         goodsCompanyService.lambdaUpdate().eq(GoodsCompany::getGoodsId,goodsBean.getGoodsId()).remove();
         goodsCompanyService.lambdaUpdate().eq(GoodsCompany::getGoodsId,goodsBean.getGoodsId()).remove();
-        if (!StringUtil.isEmpty(goodsBean.getPutCompanyId())) {
-            goodsBean.setPutCompanyId(goodsBean.getPutCompanyId());
-            String[] split = StringUtils.split(goodsBean.getPutCompanyId(), ",");
+        String name ="";
+        for (GoodsCompany goodsCompany : goodsBean.getGoodsCompanies()) {
 
 
-            String name ="";
-            for (String s : split) {
-                AdminCompany adminCompany = adminCompanyService.getById(s);
-                name = name+adminCompany.getAdminCompanyName()+",";
-
-                GoodsCompany goodsCompany = new GoodsCompany();
-                goodsCompany.setGoodsId(goodsBean.getGoodsId());
-                goodsCompany.setConpanyName(adminCompany.getAdminCompanyName());
-                goodsCompany.setCompanyId(adminCompany.getAdminCompanyId());
+            AdminCompany adminCompany = adminCompanyService.getById(goodsCompany.getCompanyId());
+            name = name+adminCompany.getAdminCompanyName()+",";
+            goodsCompany.setGoodsId(goodsBean.getGoodsId());
+            goodsCompany.setConpanyName(adminCompany.getAdminCompanyName());
+        }
 
 
-                goodsCompanies.add(goodsCompany);
-            }
-            String result = name.substring(0, name.length() - 1);
-            goodsBean.setPutCompanyName(result);
+        goodsCompanyService.saveBatch(goodsBean.getGoodsCompanies());
 
 
-            goodsCompanyService.saveBatch(goodsCompanies);
-        }
+        String result = name.substring(0, name.length() - 1);
+        goodsBean.setPutCompanyName(result);
 
 
         List<GoodsSpec> notRemoveList = new ArrayList<>();
         List<GoodsSpec> notRemoveList = new ArrayList<>();
         //查找未删除的规格
         //查找未删除的规格

+ 2 - 1
src/main/java/com/gree/mall/manager/logic/order/OrderRefundLogic.java

@@ -72,7 +72,7 @@ public class OrderRefundLogic {
      *
      *
      * @return
      * @return
      */
      */
-    public IPage<OrderRefundDetailBean> list(HttpServletRequest request, String orderId, String orderRefundId, String userName, String phone, String orderStatus,
+    public IPage<OrderRefundDetailBean> list(String websitId,HttpServletRequest request, String orderId, String orderRefundId, String userName, String phone, String orderStatus,
                                              String startCreateTime, String endCreateTime, String startExamineTime, String endExamineTime,
                                              String startCreateTime, String endCreateTime, String startExamineTime, String endExamineTime,
                                              Integer pageNum, Integer pageSize) {
                                              Integer pageNum, Integer pageSize) {
         AdminUserCom adminUser = commonLogic.getAdminUser(request);
         AdminUserCom adminUser = commonLogic.getAdminUser(request);
@@ -85,6 +85,7 @@ public class OrderRefundLogic {
                 .like(StringUtils.isNotEmpty(userName), OrderRefund::getUserName, userName)
                 .like(StringUtils.isNotEmpty(userName), OrderRefund::getUserName, userName)
                 .and(StringUtils.isNotEmpty(phone), v -> v.like(OrderRefund::getPhone, phone).or().like(OrderRefund::getRecePhone, phone))
                 .and(StringUtils.isNotEmpty(phone), v -> v.like(OrderRefund::getPhone, phone).or().like(OrderRefund::getRecePhone, phone))
                 .eq(StringUtils.isNotEmpty(orderStatus), OrderRefund::getOrderStatus, orderStatus)
                 .eq(StringUtils.isNotEmpty(orderStatus), OrderRefund::getOrderStatus, orderStatus)
+                .eq(StringUtils.isNotEmpty(websitId), OrderRefund::getWebsitId, websitId)
                 .between(StringUtils.isNotEmpty(startCreateTime) && StringUtils.isNotEmpty(endCreateTime), OrderRefund::getCreateTime, startCreateTime, endCreateTime + " 23:59:59")
                 .between(StringUtils.isNotEmpty(startCreateTime) && StringUtils.isNotEmpty(endCreateTime), OrderRefund::getCreateTime, startCreateTime, endCreateTime + " 23:59:59")
                 .between(StringUtils.isNotEmpty(startExamineTime) && StringUtils.isNotEmpty(endExamineTime), OrderRefund::getExamineTime, startExamineTime, endExamineTime + " 23:59:59")
                 .between(StringUtils.isNotEmpty(startExamineTime) && StringUtils.isNotEmpty(endExamineTime), OrderRefund::getExamineTime, startExamineTime, endExamineTime + " 23:59:59")
                 .orderByDesc(OrderRefund::getCreateTime).page(new Page<>(pageNum, pageSize));
                 .orderByDesc(OrderRefund::getCreateTime).page(new Page<>(pageNum, pageSize));

+ 12 - 5
src/main/java/com/gree/mall/manager/logic/order/OrderShareLogic.java

@@ -58,7 +58,7 @@ public class OrderShareLogic {
     private final OrderRefundService orderRefundService;
     private final OrderRefundService orderRefundService;
 
 
 
 
-    public IPage<OrderShare> list(HttpServletRequest request,String userId, String websitId, String orderShareId, String orderId, String workUserName, String phone, String status,
+    public IPage<OrderShare> list(HttpServletRequest request,String userId, String websitId, String orderShareId, String orderId, String workUserName, String phone, List<String> status,
                                   String startTime, String endTime, String startSettleTime, String endSettleTime, String position,
                                   String startTime, String endTime, String startSettleTime, String endSettleTime, String position,
                                   String startPayTime,String endPayTime, String payType, Integer pageNo, Integer pageSize) {
                                   String startPayTime,String endPayTime, String payType, Integer pageNo, Integer pageSize) {
         AdminUserCom adminUser = commonLogic.getAdminUser(request);
         AdminUserCom adminUser = commonLogic.getAdminUser(request);
@@ -69,9 +69,10 @@ public class OrderShareLogic {
                 .eq(StringUtils.isNotEmpty(userId), OrderShare::getUserId, userId)
                 .eq(StringUtils.isNotEmpty(userId), OrderShare::getUserId, userId)
                 .like(StringUtils.isNotEmpty(orderShareId), OrderShare::getOrderShareId, orderShareId)
                 .like(StringUtils.isNotEmpty(orderShareId), OrderShare::getOrderShareId, orderShareId)
                 .like(StringUtils.isNotEmpty(orderId), OrderShare::getOrderId, orderId)
                 .like(StringUtils.isNotEmpty(orderId), OrderShare::getOrderId, orderId)
+                .eq(StringUtils.isNotEmpty(websitId), OrderShare::getWebsitId, websitId)
                 .like(StringUtils.isNotEmpty(workUserName), OrderShare::getWorkUserName, workUserName)
                 .like(StringUtils.isNotEmpty(workUserName), OrderShare::getWorkUserName, workUserName)
                 .like(StringUtils.isNotEmpty(phone), OrderShare::getPhone, phone)
                 .like(StringUtils.isNotEmpty(phone), OrderShare::getPhone, phone)
-                .eq(StringUtils.isNotEmpty(status), OrderShare::getStatus, status)
+                .in(CollectionUtils.isNotEmpty(status), OrderShare::getStatus, status)
                 .between(StringUtils.isNotEmpty(startTime) && StringUtils.isNotEmpty(endTime), OrderShare::getCreateTime, startTime, endTime)
                 .between(StringUtils.isNotEmpty(startTime) && StringUtils.isNotEmpty(endTime), OrderShare::getCreateTime, startTime, endTime)
                 .between(StringUtils.isNotEmpty(startSettleTime) && StringUtils.isNotEmpty(endSettleTime), OrderShare::getSettleTime, startSettleTime, endSettleTime)
                 .between(StringUtils.isNotEmpty(startSettleTime) && StringUtils.isNotEmpty(endSettleTime), OrderShare::getSettleTime, startSettleTime, endSettleTime)
                 .between(StringUtils.isNotEmpty(startPayTime) && StringUtils.isNotEmpty(endPayTime),OrderShare::getPayTime,startPayTime,endPayTime)
                 .between(StringUtils.isNotEmpty(startPayTime) && StringUtils.isNotEmpty(endPayTime),OrderShare::getPayTime,startPayTime,endPayTime)
@@ -86,7 +87,9 @@ public class OrderShareLogic {
                        String workUserName, String phone, String status, String startTime, String endTime, String startSettleTime, String endSettleTime,
                        String workUserName, String phone, String status, String startTime, String endTime, String startSettleTime, String endSettleTime,
                        String payType,
                        String payType,
                        String position,String startPayTime,String endPayTime) throws Exception {
                        String position,String startPayTime,String endPayTime) throws Exception {
-        List<OrderShare> list = list(request,userId, websitId, orderShareId, orderId, workUserName, phone, status, startTime, endTime,
+        List<String> strings = new ArrayList<>();
+        strings.add(status);
+        List<OrderShare> list = list(request,userId, websitId, orderShareId, orderId, workUserName, phone, strings, startTime, endTime,
                 startSettleTime, endSettleTime, position,startPayTime,endPayTime, payType,1,-1).getRecords();
                 startSettleTime, endSettleTime, position,startPayTime,endPayTime, payType,1,-1).getRecords();
         String[] titles = {"序号","结算编号","订单类型", "订单编号", "店铺名称", "商品信息", "单价", "数量", "总金额",
         String[] titles = {"序号","结算编号","订单类型", "订单编号", "店铺名称", "商品信息", "单价", "数量", "总金额",
                 "商品佣金", "订单佣金","优惠金额","结算金额","平台优惠券名称", "交易单号",
                 "商品佣金", "订单佣金","优惠金额","结算金额","平台优惠券名称", "交易单号",
@@ -208,7 +211,9 @@ public class OrderShareLogic {
         excelData.setTitles(Arrays.asList(titles));
         excelData.setTitles(Arrays.asList(titles));
         excelData.setName("结算订单");
         excelData.setName("结算订单");
 
 
-        List<OrderShare> list = list(request, userId, websitId, orderShareId, orderId, workUserName, phone, status, startTime, endTime,
+        List<String> statuss = new ArrayList<>();
+        statuss.add(status);
+        List<OrderShare> list = list(request, userId, websitId, orderShareId, orderId, workUserName, phone, statuss, startTime, endTime,
                 startSettleTime, endSettleTime, position, startPayTime, endPayTime, payType,1, -1).getRecords();
                 startSettleTime, endSettleTime, position, startPayTime, endPayTime, payType,1, -1).getRecords();
 
 
         if (CollectionUtils.isEmpty(list)) {
         if (CollectionUtils.isEmpty(list)) {
@@ -385,7 +390,9 @@ public class OrderShareLogic {
      * @return
      * @return
      */
      */
     public BigDecimal totalAmount(String userId) {
     public BigDecimal totalAmount(String userId) {
-        List<OrderShare> list = orderShareService.lambdaQuery().eq(OrderShare::getUserId, userId).list();
+        List<OrderShare> list = orderShareService.lambdaQuery().eq(OrderShare::getUserId, userId)
+                .ne(OrderShare::getStatus,"CANCEL")
+                .list();
         return list.stream().map(OrderShare::getAmount).reduce(BigDecimal::add).orElse(new BigDecimal(0));
         return list.stream().map(OrderShare::getAmount).reduce(BigDecimal::add).orElse(new BigDecimal(0));
     }
     }
 
 

BIN
src/main/resources/template/商家导入.xlsx