Pārlūkot izejas kodu

版本修复提交

xgb 1 nedēļu atpakaļ
vecāks
revīzija
b88ccdd1dc
21 mainītis faili ar 405 papildinājumiem un 8 dzēšanām
  1. 8 0
      fs-admin/src/main/java/com/fs/hisStore/controller/FsStoreOrderAuditScrmController.java
  2. 13 0
      fs-company/src/main/java/com/fs/company/controller/company/CompanyUserController.java
  3. 9 0
      fs-company/src/main/java/com/fs/hisStore/controller/FsStoreOrderAuditScrmController.java
  4. 53 3
      fs-company/src/main/java/com/fs/hisStore/controller/FsStoreStatisticsScrmController.java
  5. 3 0
      fs-service/src/main/java/com/fs/company/mapper/CompanyUserMapper.java
  6. 9 0
      fs-service/src/main/java/com/fs/company/service/ICompanyUserService.java
  7. 12 0
      fs-service/src/main/java/com/fs/company/service/impl/CompanyUserServiceImpl.java
  8. 6 0
      fs-service/src/main/java/com/fs/crm/mapper/CrmCustomerMapper.java
  9. 4 0
      fs-service/src/main/java/com/fs/crm/param/CrmLineCustomerListQueryParam.java
  10. 3 0
      fs-service/src/main/java/com/fs/his/param/FsStoreOrderParam.java
  11. 11 0
      fs-service/src/main/java/com/fs/hisStore/mapper/FsStoreOrderAuditScrmMapper.java
  12. 27 0
      fs-service/src/main/java/com/fs/hisStore/param/FsStoreOrderAuditParam.java
  13. 8 0
      fs-service/src/main/java/com/fs/hisStore/param/FsStoreOrderParam.java
  14. 8 0
      fs-service/src/main/java/com/fs/hisStore/param/FsStoreStatisticsParam.java
  15. 10 0
      fs-service/src/main/java/com/fs/hisStore/service/IFsStoreOrderAuditScrmService.java
  16. 105 2
      fs-service/src/main/java/com/fs/hisStore/service/impl/FsStoreOrderAuditScrmServiceImpl.java
  17. 21 0
      fs-service/src/main/java/com/fs/hisStore/vo/FsStoreOrderAuditVO.java
  18. 6 0
      fs-service/src/main/java/com/fs/hisStore/vo/FsStoreOrderVO.java
  19. 45 0
      fs-service/src/main/resources/mapper/hisStore/FsStoreOrderAuditScrmMapper.xml
  20. 19 3
      fs-service/src/main/resources/mapper/hisStore/FsStoreOrderScrmMapper.xml
  21. 25 0
      fs-user-app/src/main/java/com/fs/app/controller/store/StoreOrderScrmController.java

+ 8 - 0
fs-admin/src/main/java/com/fs/hisStore/controller/FsStoreOrderAuditScrmController.java

@@ -38,4 +38,12 @@ public class FsStoreOrderAuditScrmController extends BaseController {
         fsStoreOrderAuditService.audit(param, user.getUserId(), true);
         return AjaxResult.success();
     }
+
+    @PreAuthorize("@ss.hasAnyPermi('store:storeOrderAudit:auditBatch')")
+    @GetMapping("/auditBatch")
+    public AjaxResult auditBatch(@RequestParam("ids") String ids) {
+        SysUser user = SecurityUtils.getLoginUser().getUser();
+        fsStoreOrderAuditService.auditBatch(ids, user.getUserId(), true);
+        return AjaxResult.success();
+    }
 }

+ 13 - 0
fs-company/src/main/java/com/fs/company/controller/company/CompanyUserController.java

@@ -104,6 +104,19 @@ public class CompanyUserController extends BaseController
         List<CompanyUser> list = companyUserService.selectCompanyUserList(user);
         return getDataTable(list);
     }
+
+    /**
+     * @Description: 获取公司下所有用户名称
+     * @Param:
+     * @Return:
+     * @Author xgb
+     * @Date 2025/9/16 9:37
+     */
+    @GetMapping("/getAllCompanyUserName")
+    public R getAllCompanyUserName() {
+        List<CompanyUser> list = companyUserService.selectCompanyUserListName();
+        return R.ok().put("data", list);
+    }
     @GetMapping("/getUserList")
     public R getUserList()
     {

+ 9 - 0
fs-company/src/main/java/com/fs/hisStore/controller/FsStoreOrderAuditScrmController.java

@@ -2,6 +2,7 @@ package com.fs.hisStore.controller;
 
 import com.fs.common.core.controller.BaseController;
 import com.fs.common.core.domain.AjaxResult;
+import com.fs.common.core.domain.entity.SysUser;
 import com.fs.common.core.page.TableDataInfo;
 import com.fs.company.domain.CompanyUser;
 import com.fs.framework.security.SecurityUtils;
@@ -40,4 +41,12 @@ public class FsStoreOrderAuditScrmController extends BaseController {
         fsStoreOrderAuditService.audit(param, user.getUserId(), false);
         return AjaxResult.success();
     }
+
+    @PreAuthorize("@ss.hasAnyPermi('store:storeOrderAudit:auditBatch')")
+    @GetMapping("/auditBatch")
+    public AjaxResult auditBatch(@RequestParam("ids") String ids) {
+        CompanyUser user = SecurityUtils.getLoginUser().getUser();
+        fsStoreOrderAuditService.auditBatch(ids, user.getUserId(), true);
+        return AjaxResult.success();
+    }
 }

+ 53 - 3
fs-company/src/main/java/com/fs/hisStore/controller/FsStoreStatisticsScrmController.java

@@ -13,8 +13,10 @@ import com.fs.framework.service.TokenService;
 import com.fs.hisStore.param.FsStoreStatisticsParam;
 import com.fs.hisStore.service.IFsStoreOrderScrmService;
 import com.fs.hisStore.service.IFsStorePaymentScrmService;
+import com.fs.hisStore.vo.FsStoreOrderCountsVO;
 import com.fs.hisStore.vo.FsStoreOrderStatisticsVO;
 import com.fs.hisStore.vo.FsStorePaymentStatisticsVO;
+import com.fs.hisStore.vo.FsStoreProductCountsVO;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.security.access.prepost.PreAuthorize;
 import org.springframework.web.bind.annotation.GetMapping;
@@ -23,6 +25,7 @@ import org.springframework.web.bind.annotation.RestController;
 
 import java.util.ArrayList;
 import java.util.List;
+import java.util.Map;
 import java.util.stream.Collectors;
 
 /**
@@ -66,9 +69,54 @@ public class FsStoreStatisticsScrmController extends BaseController
             param.setUsers(userIds.toArray(new Long[userIds.size()]));
         }
         if(param.getUsers()!=null&&param.getUsers().length>0){
-            List<FsStoreOrderStatisticsVO> list= storeOrderService.selectFsStoreOrderStatisticsList(param);
+            TimeUtils.TimeEntity timeEntity=TimeUtils.parseTime(param.getType()==null?null:param.getType().toString(),param.getStartTime(),param.getEndTime());
+            timeEntity.setUserIds(param.getUsers());
+            Integer cycleNum = timeEntity.getCycleNum();
+            Integer beginTime = timeEntity.getBeginTime();
+            List<Integer> timeList = new ArrayList<>();
+            for (int i = 1; i <= cycleNum; i++) {
+                timeList.add(beginTime);
+                beginTime = TimeUtils.formatTime(beginTime);
+            }
+            Map<String, Object> map = timeEntity.toMap();
+            map.put("orderType",param.getOrderType());
+            map.put("orderMedium",param.getOrderMedium());
+            List<JSONObject> jsonObjectList = storeOrderService.selectFsStoreOrderCounts(map);
+            List<String> dates = jsonObjectList.stream().map(jsonObject -> jsonObject.getString("type")).collect(Collectors.toList());
+            List<Integer> orderCount = jsonObjectList.stream().map(jsonObject -> jsonObject.getInteger("orderCount")).collect(Collectors.toList());
+            List<Integer> payPrice = jsonObjectList.stream().map(jsonObject -> jsonObject.getInteger("payPrice")).collect(Collectors.toList());
+            //表格数据
+            List<FsStoreOrderCountsVO> tableData = storeOrderService.selectFsStoreOrderCountsByDept(map,param.getDeptId());
+            return R.ok().put("dates",dates).put("orderCount",orderCount).put("payPrice",payPrice).put("tableData",tableData);
+        }
+        else {
+            return R.ok("未查找到数据");
+        }
+    }
 
-            TimeUtils.TimeEntity timeEntity=TimeUtils.parseTime(param.getType().toString(),param.getStartTime(),param.getEndTime());
+
+    @PreAuthorize("@ss.hasPermi('store:statistics:storeProduct')")
+    @GetMapping("/storeProduct")
+    public R storeProduct(FsStoreStatisticsParam param)
+    {
+        if(StringUtils.isNotEmpty(param.getUserIds())){
+            String[] userIds=param.getUserIds().split(",");
+            Long[] ids=new Long[userIds.length];
+            for(int i=0;i<ids.length; i++){
+                ids[i]=Long.parseLong(userIds[i]);
+            }
+            param.setUsers(ids);
+        }
+        else{
+            //获取部门下的所有用户
+            CompanyUser usermap=new CompanyUser();
+            usermap.setDeptId(param.getDeptId());
+            List<CompanyUser> users = userService.getUserListByDeptId(usermap);
+            List<Long> userIds = users.stream().map(element -> element.getUserId()).collect(Collectors.toList());
+            param.setUsers(userIds.toArray(new Long[userIds.size()]));
+        }
+        if(param.getUsers()!=null&&param.getUsers().length>0){
+            TimeUtils.TimeEntity timeEntity=TimeUtils.parseTime(param.getType()==null?null:param.getType().toString(),param.getStartTime(),param.getEndTime());
             timeEntity.setUserIds(param.getUsers());
             Integer cycleNum = timeEntity.getCycleNum();
             Integer beginTime = timeEntity.getBeginTime();
@@ -81,7 +129,9 @@ public class FsStoreStatisticsScrmController extends BaseController
             List<String> dates = jsonObjectList.stream().map(jsonObject -> jsonObject.getString("type")).collect(Collectors.toList());
             List<Integer> orderCount = jsonObjectList.stream().map(jsonObject -> jsonObject.getInteger("orderCount")).collect(Collectors.toList());
             List<Integer> payPrice = jsonObjectList.stream().map(jsonObject -> jsonObject.getInteger("payPrice")).collect(Collectors.toList());
-            return R.ok().put("list",list).put("dates",dates).put("orderCount",orderCount).put("payPrice",payPrice);
+            //表格数据
+            List<FsStoreProductCountsVO> tableData = storeOrderService.selectFsStoreProductCountsByDept(timeEntity.toMap(),param.getDeptId());
+            return R.ok().put("dates",dates).put("orderCount",orderCount).put("payPrice",payPrice).put("tableData",tableData);
         }
         else {
             return R.ok("未查找到数据");

+ 3 - 0
fs-service/src/main/java/com/fs/company/mapper/CompanyUserMapper.java

@@ -318,4 +318,7 @@ public interface CompanyUserMapper
 
 
     List<String> selectCompanyUserNameByIdsList(@Param("companyUserIDs")List<Long> companyUserID);
+
+    @Select("select user_id,nick_name from company_user")
+    List<CompanyUser> selectCompanyUserListName();
 }

+ 9 - 0
fs-service/src/main/java/com/fs/company/service/ICompanyUserService.java

@@ -236,4 +236,13 @@ public interface ICompanyUserService {
     R bindDoctor(CompanyUser param);
 
     R unBindDoctor(Long userId);
+
+    /**
+     * @Description: 获取全员工姓名列表
+     * @Param:
+     * @Return:
+     * @Author xgb
+     * @Date 2025/9/9 11:29
+     */
+    List<CompanyUser> selectCompanyUserListName();
 }

+ 12 - 0
fs-service/src/main/java/com/fs/company/service/impl/CompanyUserServiceImpl.java

@@ -974,4 +974,16 @@ public class CompanyUserServiceImpl implements ICompanyUserService
             return R.error();
         }
     }
+
+    /**
+     * @Description: 获取公司用户名称
+     * @Param:
+     * @Return:
+     * @Author xgb
+     * @Date 2025/9/9 11:30
+     */
+    @Override
+    public List<CompanyUser> selectCompanyUserListName() {
+        return companyUserMapper.selectCompanyUserListName();
+    }
 }

+ 6 - 0
fs-service/src/main/java/com/fs/crm/mapper/CrmCustomerMapper.java

@@ -479,6 +479,12 @@ public interface CrmCustomerMapper extends BaseMapper<CrmCustomer> {
             "<if test = 'maps.endTime != null and maps.endTime != \"\" '> " +
             "and date_format(c.create_time,'%y%m%d') &lt;= date_format(#{maps.endTime},'%y%m%d') " +
             "</if>" +
+            "<if test = 'maps.customerLevel != null'> " +
+            "and c.customer_level =#{maps.customerLevel} " +
+            "</if>" +
+            "<if test = 'maps.companyUserNickName != null and  maps.companyUserNickName !=\"\"    '> " +
+            "and u.nick_name like CONCAT('%',#{maps.companyUserNickName},'%') " +
+            "</if>" +
             " order by c.customer_id desc "+
             "</script>"})
     List<CrmLineCustomerListQueryVO> selectCrmLineCustomerListQuery(@Param("maps") CrmLineCustomerListQueryParam param);

+ 4 - 0
fs-service/src/main/java/com/fs/crm/param/CrmLineCustomerListQueryParam.java

@@ -85,4 +85,8 @@ public class CrmLineCustomerListQueryParam extends BaseQueryParam
     @Excel(name = "标签" )
     private String tags;
 
+    /** 客户级别 */
+    private Long customerLevel;
+    /** 员工姓名 */
+    private String companyUserNickName;
 }

+ 3 - 0
fs-service/src/main/java/com/fs/his/param/FsStoreOrderParam.java

@@ -245,4 +245,7 @@ public class FsStoreOrderParam extends BaseEntity implements Serializable {
 
     //erp账户
     private String erpAccount;
+
+    /* 媒体来源 */
+    private Integer orderMedium;
 }

+ 11 - 0
fs-service/src/main/java/com/fs/hisStore/mapper/FsStoreOrderAuditScrmMapper.java

@@ -4,6 +4,7 @@ import com.baomidou.mybatisplus.core.mapper.BaseMapper;
 import com.fs.hisStore.domain.FsStoreOrderAuditScrm;
 import com.fs.hisStore.param.FsStoreOrderAuditParam;
 import com.fs.hisStore.vo.FsStoreOrderAuditVO;
+import org.apache.ibatis.annotations.Param;
 
 import java.util.List;
 
@@ -15,4 +16,14 @@ public interface FsStoreOrderAuditScrmMapper extends BaseMapper<FsStoreOrderAudi
      * @return  list
      */
     List<FsStoreOrderAuditVO> selectStoreOrderAuditVOList(FsStoreOrderAuditParam param);
+
+    /**
+     * @Description: 批量审批
+     * @Param:
+     * @Return:
+     * @Author xgb
+     * @Date 2025/9/16 11:08
+     */
+    void updateBatchAudit(@Param("entity") FsStoreOrderAuditScrm entity, @Param("ids") List<Long> ids);
+
 }

+ 27 - 0
fs-service/src/main/java/com/fs/hisStore/param/FsStoreOrderAuditParam.java

@@ -2,6 +2,8 @@ package com.fs.hisStore.param;
 
 import lombok.Data;
 
+import java.math.BigDecimal;
+
 @Data
 public class FsStoreOrderAuditParam {
     /**
@@ -16,4 +18,29 @@ public class FsStoreOrderAuditParam {
      * 审核状态
      */
     private Integer auditStatus;
+
+    /**
+     * 收件人
+     */
+    private  String realName;
+    /**
+     * 手机号
+     */
+    private String userPhone;
+
+    /* 订单创建 */
+    private String beginTime;
+
+    private String endTime;
+
+    private String auditBeginTime;
+
+    private String auditEndTime;
+
+    private BigDecimal orderAmountSmall;
+
+    private BigDecimal orderAmountBig;
+
+    /* 订单类型 */
+    private String orderType;
 }

+ 8 - 0
fs-service/src/main/java/com/fs/hisStore/param/FsStoreOrderParam.java

@@ -5,6 +5,7 @@ import com.fs.common.core.domain.BaseEntity;
 import lombok.Data;
 
 import java.io.Serializable;
+import java.math.BigDecimal;
 
 @Data
 public class FsStoreOrderParam extends BaseEntity implements Serializable
@@ -89,4 +90,11 @@ public class FsStoreOrderParam extends BaseEntity implements Serializable
 
     private Long storeId;
 
+    /* 实收金额 */
+    private BigDecimal payPrice;
+    /* 媒体来源 */
+    private Integer orderMedium;
+    /* 审核状态 */
+    private Integer auditStatus;
+
 }

+ 8 - 0
fs-service/src/main/java/com/fs/hisStore/param/FsStoreStatisticsParam.java

@@ -14,6 +14,14 @@ public class FsStoreStatisticsParam implements Serializable
     String startTime;
     String endTime;
     Long deptId;
+    /**
+     * 订单类型 字典表字段
+     */
+    String orderType;
+    /**
+     * 来源媒体 字典表字段
+     */
+    String orderMedium;
 
 
 }

+ 10 - 0
fs-service/src/main/java/com/fs/hisStore/service/IFsStoreOrderAuditScrmService.java

@@ -24,4 +24,14 @@ public interface IFsStoreOrderAuditScrmService extends IService<FsStoreOrderAudi
      * @param isAdmin 是否管理端
      */
     void audit(FsStoreOrderAuditReviewParam param, Long userId, boolean isAdmin);
+
+    /**
+     * @Description: 批量审核
+     * @Param:
+     * @Return:
+     * @Author xgb
+     * @Date 2025/9/16 10:48
+     */
+
+    void auditBatch(String ids, Long userId, boolean b);
 }

+ 105 - 2
fs-service/src/main/java/com/fs/hisStore/service/impl/FsStoreOrderAuditScrmServiceImpl.java

@@ -17,8 +17,10 @@ import org.springframework.stereotype.Service;
 import org.springframework.transaction.annotation.Transactional;
 
 import java.time.LocalDateTime;
+import java.util.Arrays;
 import java.util.List;
 import java.util.Objects;
+import java.util.stream.Collectors;
 
 @Service
 @AllArgsConstructor
@@ -44,8 +46,8 @@ public class FsStoreOrderAuditScrmServiceImpl extends ServiceImpl<FsStoreOrderAu
      * @param isAdmin 是否管理端
      */
     @Transactional(rollbackFor = Exception.class)
-    @Override
-    public void audit(FsStoreOrderAuditReviewParam param, Long userId, boolean isAdmin) {
+//    @Override
+    public void auditBak(FsStoreOrderAuditReviewParam param, Long userId, boolean isAdmin) {
         FsStoreOrderAuditScrm fsStoreOrderAudit = baseMapper.selectById(param.getAuditId());
         if (Objects.isNull(fsStoreOrderAudit)) {
             throw new CustomException("记录不存在");
@@ -91,4 +93,105 @@ public class FsStoreOrderAuditScrmServiceImpl extends ServiceImpl<FsStoreOrderAu
         auditLog.setCreateTime(LocalDateTime.now());
         fsStoreOrderAuditLogService.save(auditLog);
     }
+
+    /**
+     * 审核
+     *
+     * 2025-09-12
+     * 倍力优审核只需销售审核,审核一次  不需要两次审核,做需求改造
+     * 去掉总后台审核
+     *
+     * @param param   参数
+     * @param userId  用户ID
+     * @param isAdmin 是否管理端
+     */
+    @Transactional(rollbackFor = Exception.class)
+    @Override
+    public void audit(FsStoreOrderAuditReviewParam param, Long userId, boolean isAdmin) {
+        FsStoreOrderAuditScrm fsStoreOrderAudit = baseMapper.selectById(param.getAuditId());
+        if (Objects.isNull(fsStoreOrderAudit)) {
+            throw new CustomException("记录不存在");
+        }
+        OrderAuditStateEnum orderAuditStateEnum = OrderAuditStateEnum.getOrderAuditStateEnum(fsStoreOrderAudit.getAuditStatus());
+        if (OrderAuditStateEnum.COMPANY_PENDING != orderAuditStateEnum) {
+            throw new CustomException("请勿重复审核");
+        }
+
+        LocalDateTime now = LocalDateTime.now();
+        OrderAuditStateEnum newStatus;
+        String message;
+        if (param.getReviewType() == 1) { // 审核通过
+            newStatus = OrderAuditStateEnum.APPROVED;
+            message = "审核通过";
+        } else { // 审核拒绝
+            newStatus = OrderAuditStateEnum.COMPANY_REJECT;
+            if (StringUtils.isBlank(param.getReviewContent())) {
+                throw new CustomException("被拒原因不能为空");
+            }
+
+            // 拒绝原因放在备注 中 订单查询展示 xgb修改 20250915
+            message = "销售:审核拒绝;"+param.getReviewContent();
+            fsStoreOrderAudit.setReason(param.getReviewContent());
+        }
+
+
+        fsStoreOrderAudit.setCompanyAuditTime(now);
+        fsStoreOrderAudit.setCompanyAuditUserId(userId);
+        fsStoreOrderAudit.setAuditStatus(newStatus.getValue());
+
+        baseMapper.updateById(fsStoreOrderAudit);
+
+        FsStoreOrderAuditLogScrm auditLog = new FsStoreOrderAuditLogScrm();
+        auditLog.setAuditId(fsStoreOrderAudit.getId());
+        auditLog.setOrderId(fsStoreOrderAudit.getOrderId());
+        auditLog.setContent(message);
+        auditLog.setCreateTime(LocalDateTime.now());
+        fsStoreOrderAuditLogService.save(auditLog);
+    }
+
+    /**
+     * @Description: 批量 审核
+     * @Param:
+     * @Return:
+     * @Author xgb
+     * @Date 2025/9/12 15:23
+     */
+
+    @Override
+    @Transactional
+    public void auditBatch(String ids, Long userId, boolean b) {
+        // 查询订单审核列表 判断都为待审核状态
+        List<FsStoreOrderAuditScrm> list = baseMapper.selectBatchIds(Arrays.asList(StringUtils.split(ids, ",")));
+        if (list.stream().anyMatch(item -> OrderAuditStateEnum.getOrderAuditStateEnum(item.getAuditStatus()) != OrderAuditStateEnum.COMPANY_PENDING)) {
+            throw new CustomException("请勿重复审核");
+        }
+
+        // 批量更新状态
+        FsStoreOrderAuditScrm update = new FsStoreOrderAuditScrm();
+        update.setAuditStatus(OrderAuditStateEnum.APPROVED.getValue());
+        update.setCompanyAuditTime(LocalDateTime.now());
+        update.setCompanyAuditUserId(userId);
+        List<Long> idLists = list.stream().map(FsStoreOrderAuditScrm::getId).collect(Collectors.toList());
+        baseMapper.updateBatchAudit(update,idLists);
+
+
+        //    FsStoreOrderAuditLog auditLog = new FsStoreOrderAuditLog();
+        //        auditLog.setAuditId(fsStoreOrderAudit.getId());
+        //        auditLog.setOrderId(fsStoreOrderAudit.getOrderId());
+        //        auditLog.setContent(message);
+        //        auditLog.setCreateTime(LocalDateTime.now());
+
+        // 批量插入日志
+        List<FsStoreOrderAuditLogScrm> auditLogs = list.stream().map(item -> {
+            FsStoreOrderAuditLogScrm auditLog = new FsStoreOrderAuditLogScrm();
+            auditLog.setAuditId(item.getId());
+            auditLog.setOrderId(item.getOrderId());
+            auditLog.setContent("销售:审核通过");
+            auditLog.setCreateTime(LocalDateTime.now());
+            return auditLog;
+        }).collect(Collectors.toList());
+
+        fsStoreOrderAuditLogService.saveBatch(auditLogs);
+
+    }
 }

+ 21 - 0
fs-service/src/main/java/com/fs/hisStore/vo/FsStoreOrderAuditVO.java

@@ -3,6 +3,7 @@ package com.fs.hisStore.vo;
 import com.fasterxml.jackson.annotation.JsonFormat;
 import lombok.Data;
 
+import java.math.BigDecimal;
 import java.time.LocalDateTime;
 
 @Data
@@ -74,4 +75,24 @@ public class FsStoreOrderAuditVO {
      */
     @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
     private LocalDateTime createTime;
+
+    /**
+     * 收件人
+     */
+    private  String realName;
+
+    /* 订单类型 */
+    private String orderType;
+
+    /* 送货地址 */
+    private String userAddress;
+    /* 实收金额 */
+    private BigDecimal payPrice;
+    /* 订单金额 */
+    private BigDecimal totalPrice;
+    /* 手机号 */
+    private String userPhone;
+    /* 订单创建时间 */
+    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
+    private LocalDateTime orderCreateTime;
 }

+ 6 - 0
fs-service/src/main/java/com/fs/hisStore/vo/FsStoreOrderVO.java

@@ -244,5 +244,11 @@ public class FsStoreOrderVO implements Serializable
 
     private String orderMedium;
 
+    /** 审核状态 */
+    private Integer auditStatus;
+    /* 发货时间 */
+    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
+    private Date deliverySendTime;
+
 
 }

+ 45 - 0
fs-service/src/main/resources/mapper/hisStore/FsStoreOrderAuditScrmMapper.xml

@@ -18,6 +18,13 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
             fsoa.reason,
             fsoa.create_time,
             fso.order_code,
+            fso.user_address,
+            fso.real_name,
+            fso.user_phone,
+            fso.total_price,
+            fso.pay_price,
+            fso.order_type,
+            fso.create_time orderCreateTime,
             c.company_name,
             cu.nick_name companyUserName,
             cau.nick_name companyAuditUserName,
@@ -38,7 +45,45 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
             <if test="auditStatus != null">
                 and fsoa.audit_status = #{auditStatus}
             </if>
+            <if test="realName != null and realName != ''">
+                and fso.real_name like concat('%', #{realName}, '%')
+            </if>
+            <if test="userPhone != null and userPhone != ''">
+                and fso.user_phone like concat('%', #{userPhone}, '%')
+            </if>
+            <if test="beginTime != null and endTime != null">
+                and date_format(fso.create_time, '%Y-%m-%d') &gt;= #{beginTime} and date_format(fso.create_time, '%Y-%m-%d') &lt;= #{endTime}
+            </if>
+            <if test="auditBeginTime != null and auditEndTime != null">
+                and date_format(fsoa.admin_audit_time, '%Y-%m-%d') &gt;= #{auditBeginTime} and date_format(fsoa.admin_audit_time, '%Y-%m-%d') &lt;= #{auditEndTime}
+            </if>
+            <if test="orderAmountSmall != null and orderAmountBig != null">
+                and fso.pay_price &gt;= #{orderAmountSmall} and fso.pay_price &lt;= #{orderAmountBig}
+            </if>
+            <if test="orderType != null">
+                and fso.order_type = #{orderType}
+            </if>
         </where>
         order by fsoa.admin_audit_time desc, fsoa.company_audit_time desc, fsoa.create_time desc
     </select>
+
+    <update id="updateBatchAudit">
+        update fs_store_order_audit_scrm
+        set audit_status = #{entity.auditStatus},
+        company_audit_time = #{entity.companyAuditTime},
+        company_audit_user_id = #{entity.companyAuditUserId}
+        where id in
+        <foreach item="item" collection="ids" separator="," open="(" close=")" index="index">
+            #{item}
+        </foreach>
+
+    </update>
+
+
+
+
+
+
+
+
 </mapper>

+ 19 - 3
fs-service/src/main/resources/mapper/hisStore/FsStoreOrderScrmMapper.xml

@@ -460,6 +460,12 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
             <if test="companyId != null  ">
                 AND o.company_id = #{companyId}
             </if>
+            <if test="orderType != null and orderType != ''">
+                AND o.order_type = #{orderType}
+            </if>
+            <if test="orderMedium != null and orderMedium != ''">
+                AND o.order_medium = #{orderMedium}
+            </if>
         </where>
 
         ) t
@@ -830,6 +836,12 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
             <if test="companyId != null  ">
                 AND so.company_id = #{companyId}
             </if>
+            <if test="orderType != null and orderType != ''">
+                AND so.order_type = #{orderType}
+            </if>
+            <if test="orderMedium != null and orderMedium != ''">
+                AND so.order_medium = #{orderMedium}
+            </if>
 
         ) o GROUP BY o.company_user_id
     </select>
@@ -859,8 +871,8 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
         (
         SELECT o.id, o.order_type,i.json_info,i.item_id
         FROM
-        fs_store_order_item i
-        LEFT JOIN fs_store_order o ON o.id = i.order_id
+        fs_store_order_item_scrm i
+        LEFT JOIN fs_store_order_scrm o ON o.id = i.order_id
         LEFT JOIN company_user u ON o.company_user_id = u.user_id
         where i.product_id = #{productId}
         and o.`status` = 3
@@ -877,7 +889,6 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
 
         ) t
         GROUP BY t.order_type
-        HAVING t.order_type > 0
     </select>
 
     <update id="batchUpdateInOrderCode">
@@ -892,4 +903,9 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
             #{item.orderNumber}
         </foreach>
     </update>
+
+
+
+
+
 </mapper>

+ 25 - 0
fs-user-app/src/main/java/com/fs/app/controller/store/StoreOrderScrmController.java

@@ -402,6 +402,31 @@ public class StoreOrderScrmController extends AppBaseController {
                         throw new CustomException("支付失败" + e.getMessage());
                     }
                 }
+            }else if(order.getPayType().equals("1") && order.getPayMoney().compareTo(BigDecimal.ZERO) ==0 ){// 判断0金额订单
+                FsStorePaymentScrm storePayment=new FsStorePaymentScrm();
+                storePayment.setCompanyId(order.getCompanyId());
+                storePayment.setCompanyUserId(order.getCompanyUserId());
+//                storePayment.setPayMode(fsPayConfig.getType());
+                storePayment.setStatus(1);
+                storePayment.setPayCode(payCode);
+                storePayment.setPayMoney(order.getPayMoney());
+                storePayment.setCreateTime(new Date());
+                storePayment.setPayTypeCode("weixin");
+                storePayment.setBusinessType(2);
+                storePayment.setRemark("商城订单支付");
+                storePayment.setOpenId(user.getRealName());
+                storePayment.setUserId(user.getUserId());
+                storePayment.setBusinessOrderId(order.getId().toString());
+                storePayment.setOrderId(order.getId());
+                fsStorePaymentMapper.insertFsStorePayment(storePayment);
+
+                FsStoreOrderScrm storeOrder = new FsStoreOrderScrm();
+                storeOrder.setId(order.getId());
+                storeOrder.setPaid(OrderInfoEnum.PAY_STATUS_1.getValue());
+                storeOrder.setStatus(OrderInfoEnum.STATUS_1.getValue());
+                storeOrder.setPayTime(new Date());
+                orderService.updateFsStoreOrder(storeOrder);
+                return R.ok().put("payType",4);
             }
 //            else if(order.getPayType().equals("3")){
             else if(order.getPayType().equals("3") && order.getPayMoney().compareTo(new BigDecimal(0))<=0){