Parcourir la source

Merge remote-tracking branch 'origin/master'

caozj il y a 2 ans
Parent
commit
c984bdf14c
32 fichiers modifiés avec 588 ajouts et 49 suppressions
  1. 8 0
      hx-account/src/main/java/com/fjhx/account/controller/account/AccountManagementController.java
  2. 2 0
      hx-account/src/main/java/com/fjhx/account/entity/account/dto/AccountManagementDto.java
  3. 20 0
      hx-account/src/main/java/com/fjhx/account/entity/account/po/AccountManagement.java
  4. 5 0
      hx-account/src/main/java/com/fjhx/account/entity/account/po/AccountRemainder.java
  5. 11 0
      hx-account/src/main/java/com/fjhx/account/mapper/account/AccountManagementMapper.java
  6. 5 0
      hx-account/src/main/java/com/fjhx/account/service/account/AccountManagementService.java
  7. 114 0
      hx-account/src/main/java/com/fjhx/account/service/account/impl/AccountManagementServiceImpl.java
  8. 3 0
      hx-account/src/main/resources/mapper/account/AccountManagementMapper.xml
  9. 6 1
      hx-common/src/main/java/com/fjhx/common/entity/corporation/po/Corporation.java
  10. 41 0
      hx-customer/src/main/java/com/fjhx/customer/controller/customer/CustomerTopController.java
  11. 17 0
      hx-customer/src/main/java/com/fjhx/customer/entity/customer/dto/CustomerTopDto.java
  12. 17 0
      hx-customer/src/main/java/com/fjhx/customer/entity/customer/dto/CustomerTopSelectDto.java
  13. 32 0
      hx-customer/src/main/java/com/fjhx/customer/entity/customer/po/CustomerTop.java
  14. 17 0
      hx-customer/src/main/java/com/fjhx/customer/entity/customer/vo/CustomerTopVo.java
  15. 4 0
      hx-customer/src/main/java/com/fjhx/customer/entity/customer/vo/CustomerVo.java
  16. 1 1
      hx-customer/src/main/java/com/fjhx/customer/mapper/customer/CustomerMapper.java
  17. 17 0
      hx-customer/src/main/java/com/fjhx/customer/mapper/customer/CustomerTopMapper.java
  18. 28 0
      hx-customer/src/main/java/com/fjhx/customer/service/customer/CustomerTopService.java
  19. 46 9
      hx-customer/src/main/java/com/fjhx/customer/service/customer/impl/CustomerServiceImpl.java
  20. 35 0
      hx-customer/src/main/java/com/fjhx/customer/service/customer/impl/CustomerTopServiceImpl.java
  21. 4 0
      hx-customer/src/main/resources/mapper/customer/CustomerTopMapper.xml
  22. 8 1
      hx-dingding/src/main/java/com/fjhx/dingding/controller/DingController.java
  23. 2 0
      hx-dingding/src/main/java/com/fjhx/dingding/service/DingService.java
  24. 64 5
      hx-dingding/src/main/java/com/fjhx/dingding/service/impl/DingServiceImpl.java
  25. 5 0
      hx-item/src/main/java/com/fjhx/item/entity/product/dto/ProductInfoSelectDto.java
  26. 4 1
      hx-item/src/main/java/com/fjhx/item/service/product/impl/ProductInfoServiceImpl.java
  27. 1 1
      hx-oa/src/main/java/com/fjhx/oa/controller/daily/DailyReportController.java
  28. 17 2
      hx-oa/src/main/java/com/fjhx/oa/entity/daily/vo/DailyReportVo.java
  29. 20 12
      hx-oa/src/main/java/com/fjhx/oa/service/daily/impl/DailyReportServiceImpl.java
  30. 32 0
      hx-supply/src/main/java/com/fjhx/supply/entity/supplier/po/SupplierInfo.java
  31. 1 16
      hx-supply/src/main/resources/mapper/supplier/SupplierInfoMapper.xml
  32. 1 0
      hx-wms/src/main/java/com/fjhx/wms/service/stock/impl/StockWaitServiceImpl.java

+ 8 - 0
hx-account/src/main/java/com/fjhx/account/controller/account/AccountManagementController.java

@@ -71,4 +71,12 @@ public class AccountManagementController {
         accountManagementService.delete(dto.getId());
     }
 
+    /**
+     * 导入账户表的数据
+     */
+    @PostMapping("/importsAmount")
+    public void importsAmount(@RequestBody AccountManagementDto dto) {
+        accountManagementService.importsAmount(dto);
+    }
+
 }

+ 2 - 0
hx-account/src/main/java/com/fjhx/account/entity/account/dto/AccountManagementDto.java

@@ -19,4 +19,6 @@ import java.util.List;
 public class AccountManagementDto extends AccountManagement {
     @TableField(exist = false)
     private List<AccountRemainder> accountRemainderList;
+
+    private String tenantId;
 }

+ 20 - 0
hx-account/src/main/java/com/fjhx/account/entity/account/po/AccountManagement.java

@@ -81,4 +81,24 @@ public class AccountManagement extends BasePo {
     private String beneficiaryAddress;
 
 
+
+//    /**
+//     * 云帆ID
+//     */
+//    private String yfId;
+//
+//    /**
+//     * 云帆——归属公司id(common模块corporation表id)
+//     */
+//    private String yfCorporationId;
+//
+//    private String yfCreateUser;
+//
+//    private String yfUpdateUser;
+//
+//    private String tenantId;
+
+
+
+
 }

+ 5 - 0
hx-account/src/main/java/com/fjhx/account/entity/account/po/AccountRemainder.java

@@ -44,4 +44,9 @@ public class AccountRemainder extends BasePo {
      * 交易状态:10 收入,20支出
      */
     private String status ;
+
+    /**
+     * 交易状态:10 收入,20支出
+     */
+    private String tenantId;
 }

+ 11 - 0
hx-account/src/main/java/com/fjhx/account/mapper/account/AccountManagementMapper.java

@@ -1,13 +1,19 @@
 package com.fjhx.account.mapper.account;
 
 import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
+import com.fjhx.account.entity.account.dto.AccountManagementDto;
+import com.fjhx.account.entity.account.dto.FundAccount;
 import com.fjhx.account.entity.account.po.AccountManagement;
 import com.baomidou.mybatisplus.core.mapper.BaseMapper;
 import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
 import com.fjhx.account.entity.account.vo.AccountManagementVo;
+import com.ruoyi.common.annotation.TenantIgnore;
+import com.ruoyi.common.core.domain.BaseSelectDto;
 import com.ruoyi.common.utils.wrapper.IWrapper;
 import org.apache.ibatis.annotations.Param;
 
+import java.util.List;
+
 
 /**
  * <p>
@@ -24,4 +30,9 @@ public interface AccountManagementMapper extends BaseMapper<AccountManagement> {
      */
     Page<AccountManagementVo> getPage(@Param("page") Page<Object> page, @Param("ew")LambdaQueryWrapper<AccountManagement> wrapper);
 
+    /**
+     * 查询云帆资金账户表的信息
+     */
+    @TenantIgnore
+    List<FundAccount> importsAmount(AccountManagementDto dto);
 }

+ 5 - 0
hx-account/src/main/java/com/fjhx/account/service/account/AccountManagementService.java

@@ -1,6 +1,7 @@
 package com.fjhx.account.service.account;
 
 import com.fjhx.account.entity.account.po.AccountManagement;
+import com.ruoyi.common.core.domain.BaseSelectDto;
 import com.ruoyi.common.core.service.BaseService;
 import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
 import com.fjhx.account.entity.account.vo.AccountManagementVo;
@@ -43,4 +44,8 @@ public interface AccountManagementService extends BaseService<AccountManagement>
      */
     void delete(Long id);
 
+    /**
+     * 导入账户表的数据
+     */
+    void importsAmount(AccountManagementDto dto);
 }

+ 114 - 0
hx-account/src/main/java/com/fjhx/account/service/account/impl/AccountManagementServiceImpl.java

@@ -2,8 +2,11 @@ package com.fjhx.account.service.account.impl;
 
 import cn.hutool.core.collection.ListUtil;
 import cn.hutool.core.util.ObjectUtil;
+import com.baomidou.dynamic.datasource.toolkit.DynamicDataSourceContextHolder;
 import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
+import com.baomidou.mybatisplus.core.toolkit.IdWorker;
 import com.baomidou.mybatisplus.core.toolkit.Wrappers;
+import com.fjhx.account.entity.account.dto.FundAccount;
 import com.fjhx.account.entity.account.po.AccountManagement;
 import com.fjhx.account.entity.account.po.AccountRemainder;
 import com.fjhx.account.entity.account.po.AccountRunningWater;
@@ -12,8 +15,16 @@ import com.fjhx.account.service.account.AccountManagementService;
 import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
 import com.fjhx.account.service.account.AccountRemainderService;
 import com.fjhx.account.service.account.AccountRunningWaterService;
+import com.fjhx.common.constant.SourceConstant;
+import com.fjhx.common.entity.corporation.po.Corporation;
+import com.fjhx.common.service.corporation.CorporationService;
 import com.obs.services.internal.ServiceException;
+import com.ruoyi.common.annotation.TenantIgnore;
+import com.ruoyi.common.core.domain.BaseSelectDto;
+import com.ruoyi.common.core.domain.entity.SysUser;
+import com.ruoyi.common.utils.SecurityUtils;
 import com.ruoyi.common.utils.StringUtils;
+import com.ruoyi.system.service.ISysUserService;
 import org.apache.poi.util.StringUtil;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.stereotype.Service;
@@ -25,6 +36,7 @@ import com.fjhx.account.entity.account.dto.AccountManagementDto;
 import cn.hutool.core.bean.BeanUtil;
 import org.springframework.transaction.annotation.Transactional;
 
+import java.util.ArrayList;
 import java.util.List;
 import java.util.stream.Collectors;
 
@@ -45,6 +57,12 @@ public class AccountManagementServiceImpl extends ServiceImpl<AccountManagementM
     @Autowired
     private AccountRunningWaterService accountRunningWaterService;
 
+    @Autowired
+    private CorporationService corporationService;
+
+    @Autowired
+    private ISysUserService sysUserService;
+
     /**
      * 账户-管理表分页
      */
@@ -141,6 +159,102 @@ public class AccountManagementServiceImpl extends ServiceImpl<AccountManagementM
                 .eq(AccountRemainder::getAccountManagementId,id));
     }
 
+    /**
+     * 导入账户表的数据
+     */
+    @Override
+    @Transactional(rollbackFor = {Exception.class})
+    @TenantIgnore
+    public void importsAmount(AccountManagementDto dto) {
+        //查询云帆账户表的数据
+//        List<FundAccount> fundAccounts = baseMapper.importsAmount(dto);
+//        for (FundAccount fundAccount : fundAccounts) {
+//            //添加资金账户表的数据
+//            AccountManagement accountManagement = new AccountManagement();
+//            //查询多公司表
+//            if (ObjectUtil.isNotEmpty(fundAccount.getCompanyId())){
+//                DynamicDataSourceContextHolder.push(SourceConstant.COMMON);
+//
+//                Corporation corporation = corporationService.getOne(Wrappers.<Corporation>lambdaQuery().eq(Corporation::getYfId,fundAccount.getCompanyId()));
+//                if(ObjectUtil.isNotEmpty(corporation)){
+//                    accountManagement.setCorporationId(corporation.getId());
+//                }
+//
+//                DynamicDataSourceContextHolder.poll();
+//            }
+//            accountManagement.setTenantId(fundAccount.getTenantId());
+//            accountManagement.setYfId(fundAccount.getId());
+//            accountManagement.setAlias(fundAccount.getName());
+//            accountManagement.setAccountOpening(fundAccount.getAccountNumber());
+//            accountManagement.setCreateTime(fundAccount.getCreateTime());
+//            accountManagement.setUpdateTime(fundAccount.getUpdateTime());
+//            accountManagement.setAccountOpening(fundAccount.getAccountNumber());
+//            //查询用户
+//            if (ObjectUtil.isNotEmpty(fundAccount.getCreateUser())){
+//                DynamicDataSourceContextHolder.push(SourceConstant.BASE);
+//                SysUser sysUser = sysUserService.getOne(Wrappers.<SysUser>lambdaQuery().eq(SysUser::getYfUserId, fundAccount.getCreateUser()));
+//                accountManagement.setCreateUser(sysUser.getUserId());
+//                DynamicDataSourceContextHolder.poll();
+//            }
+//
+//            if (ObjectUtil.isNotEmpty(fundAccount.getUpdateUser())){
+//                DynamicDataSourceContextHolder.push(SourceConstant.BASE);
+//                SysUser sysUser = sysUserService.getOne(Wrappers.<SysUser>lambdaQuery().eq(SysUser::getYfUserId, fundAccount.getUpdateUser()));
+//                accountManagement.setCreateUser(sysUser.getUserId());
+//                DynamicDataSourceContextHolder.poll();
+//            }
+//            accountManagement.setCreateTime(fundAccount.getCreateTime());
+//            accountManagement.setUpdateTime(fundAccount.getUpdateTime());
+//            baseMapper.insert(accountManagement);
+//
+//            //添加资金账户余额表的信息
+//            AccountRemainder accountRemainder = new AccountRemainder();
+//            accountRemainder.setTenantId(fundAccount.getTenantId());
+//            accountRemainder.setAccountManagementId(accountManagement.getId());
+//            //查询用户
+//            if (ObjectUtil.isNotEmpty(fundAccount.getCreateUser())){
+//                DynamicDataSourceContextHolder.push(SourceConstant.BASE);
+//                SysUser sysUser = sysUserService.getOne(Wrappers.<SysUser>lambdaQuery().eq(SysUser::getYfUserId, fundAccount.getCreateUser()));
+//                accountRemainder.setCreateUser(sysUser.getUserId());
+//                DynamicDataSourceContextHolder.poll();
+//            }
+//
+//            if (ObjectUtil.isNotEmpty(fundAccount.getUpdateUser())){
+//
+//                DynamicDataSourceContextHolder.push(SourceConstant.BASE);
+//                SysUser sysUser = sysUserService.getOne(Wrappers.<SysUser>lambdaQuery().eq(SysUser::getYfUserId, fundAccount.getUpdateUser()));
+//                accountRemainder.setCreateUser(sysUser.getUserId());
+//                DynamicDataSourceContextHolder.poll();
+//            }
+//            if (ObjectUtil.isNotEmpty(fundAccount.getRmbAmount())){
+//                accountRemainder.setId(IdWorker.getId());
+//                accountRemainder.setRemainder(fundAccount.getRmbAmount());
+//                accountRemainder.setCurrency("RMB");
+//                accountRemainderService.save(accountRemainder);
+//            }
+//            if (ObjectUtil.isNotEmpty(fundAccount.getDollarAmount())){
+//                accountRemainder.setId(IdWorker.getId());
+//                accountRemainder.setRemainder(fundAccount.getDollarAmount());
+//                accountRemainder.setCurrency("USD");
+//                accountRemainderService.save(accountRemainder);
+//            }
+//            if (ObjectUtil.isNotEmpty(fundAccount.getEuroAmount())){
+//                accountRemainder.setId(IdWorker.getId());
+//                accountRemainder.setRemainder(fundAccount.getEuroAmount());
+//                accountRemainder.setCurrency("EUR");
+//                accountRemainderService.save(accountRemainder);
+//            }
+//
+//            if (ObjectUtil.isNotEmpty(fundAccount.getSterlingAmount())){
+//                accountRemainder.setId(IdWorker.getId());
+//                accountRemainder.setRemainder(fundAccount.getSterlingAmount());
+//                accountRemainder.setCurrency("GBP");
+//                accountRemainderService.save(accountRemainder);
+//            }
+//        }
+
+    }
+
 
     /**
      * 添加账户-余额表的信息

+ 3 - 0
hx-account/src/main/resources/mapper/account/AccountManagementMapper.xml

@@ -7,5 +7,8 @@
         from account_management am
             ${ew.customSqlSegment}
     </select>
+    <select id="importsAmount" resultType="com.fjhx.account.entity.account.dto.FundAccount">
+        select * from t_erp_fund_account where tenant_id = #{tenantId}
+    </select>
 
 </mapper>

+ 6 - 1
hx-common/src/main/java/com/fjhx/common/entity/corporation/po/Corporation.java

@@ -12,7 +12,7 @@ import lombok.Setter;
  * 多公司配置
  * </p>
  *
- * @author 
+ * @author
  * @since 2023-04-10
  */
 @Getter
@@ -72,4 +72,9 @@ public class Corporation extends BasePo {
      */
     private String iaeeCode;
 
+    /**
+     * 进出口企业代码
+     */
+    private String yfId;
+
 }

+ 41 - 0
hx-customer/src/main/java/com/fjhx/customer/controller/customer/CustomerTopController.java

@@ -0,0 +1,41 @@
+package com.fjhx.customer.controller.customer;
+
+import org.springframework.web.bind.annotation.*;
+import com.fjhx.customer.entity.customer.dto.CustomerTopDto;
+import com.ruoyi.common.core.domain.BaseSelectDto;
+import com.fjhx.customer.service.customer.CustomerTopService;
+import org.springframework.beans.factory.annotation.Autowired;
+
+
+/**
+ * <p>
+ * 客户置顶表 前端控制器
+ * </p>
+ *
+ * @author 
+ * @since 2023-05-09
+ */
+@RestController
+@RequestMapping("/customerTop")
+public class CustomerTopController {
+
+    @Autowired
+    private CustomerTopService customerTopService;
+
+    /**
+     * 客户置顶表新增
+     */
+    @PostMapping("/add")
+    public void add(@RequestBody CustomerTopDto customerTopDto) {
+        customerTopService.add(customerTopDto);
+    }
+
+    /**
+     * 客户置顶表删除
+     */
+    @PostMapping("/delete")
+    public void delete(@RequestBody CustomerTopDto dto) {
+        customerTopService.delete(dto.getCustomerId());
+    }
+
+}

+ 17 - 0
hx-customer/src/main/java/com/fjhx/customer/entity/customer/dto/CustomerTopDto.java

@@ -0,0 +1,17 @@
+package com.fjhx.customer.entity.customer.dto;
+
+import com.fjhx.customer.entity.customer.po.CustomerTop;
+import lombok.Getter;
+import lombok.Setter;
+
+/**
+ * 客户置顶表新增编辑入参实体
+ *
+ * @author 
+ * @since 2023-05-09
+ */
+@Getter
+@Setter
+public class CustomerTopDto extends CustomerTop {
+
+}

+ 17 - 0
hx-customer/src/main/java/com/fjhx/customer/entity/customer/dto/CustomerTopSelectDto.java

@@ -0,0 +1,17 @@
+package com.fjhx.customer.entity.customer.dto;
+
+import com.ruoyi.common.core.domain.BaseSelectDto;
+import lombok.Getter;
+import lombok.Setter;
+
+/**
+ * 客户置顶表列表查询入参实体
+ *
+ * @author 
+ * @since 2023-05-09
+ */
+@Getter
+@Setter
+public class CustomerTopSelectDto extends BaseSelectDto {
+
+}

+ 32 - 0
hx-customer/src/main/java/com/fjhx/customer/entity/customer/po/CustomerTop.java

@@ -0,0 +1,32 @@
+package com.fjhx.customer.entity.customer.po;
+
+import com.ruoyi.common.core.domain.BasePo;
+import com.baomidou.mybatisplus.annotation.TableName;
+import java.util.Date;
+import lombok.Getter;
+import lombok.Setter;
+
+/**
+ * <p>
+ * 客户置顶表
+ * </p>
+ *
+ * @author 
+ * @since 2023-05-09
+ */
+@Getter
+@Setter
+@TableName("customer_top")
+public class CustomerTop extends BasePo {
+
+    /**
+     * 用户id
+     */
+    private Long userId;
+
+    /**
+     * 客户id
+     */
+    private Long customerId;
+
+}

+ 17 - 0
hx-customer/src/main/java/com/fjhx/customer/entity/customer/vo/CustomerTopVo.java

@@ -0,0 +1,17 @@
+package com.fjhx.customer.entity.customer.vo;
+
+import com.fjhx.customer.entity.customer.po.CustomerTop;
+import lombok.Getter;
+import lombok.Setter;
+
+/**
+ * 客户置顶表列表查询返回值实体
+ *
+ * @author 
+ * @since 2023-05-09
+ */
+@Getter
+@Setter
+public class CustomerTopVo extends CustomerTop {
+
+}

+ 4 - 0
hx-customer/src/main/java/com/fjhx/customer/entity/customer/vo/CustomerVo.java

@@ -48,5 +48,9 @@ public class CustomerVo extends Customer implements ISetAreaName {
      */
     private List<CustomerFollowRecords> customerFollowRecordsList;
 
+    /**
+     * 是否置顶
+     */
+    private Integer isTop;
 
 }

+ 1 - 1
hx-customer/src/main/java/com/fjhx/customer/mapper/customer/CustomerMapper.java

@@ -30,7 +30,7 @@ public interface CustomerMapper extends BaseMapper<Customer> {
     /**
      * 客户表分页
      */
-    Page<CustomerVo> getPage(@Param("page") Page<Object> page, @Param("ew")LambdaQueryWrapper<Customer> wrapper);
+    Page<CustomerVo> getPage(@Param("page") Page<Object> page, @Param("ew")IWrapper<CustomerVo> wrapper);
 
 
     /**

+ 17 - 0
hx-customer/src/main/java/com/fjhx/customer/mapper/customer/CustomerTopMapper.java

@@ -0,0 +1,17 @@
+package com.fjhx.customer.mapper.customer;
+
+import com.fjhx.customer.entity.customer.po.CustomerTop;
+import com.baomidou.mybatisplus.core.mapper.BaseMapper;
+
+
+/**
+ * <p>
+ * 客户置顶表 Mapper 接口
+ * </p>
+ *
+ * @author 
+ * @since 2023-05-09
+ */
+public interface CustomerTopMapper extends BaseMapper<CustomerTop> {
+
+}

+ 28 - 0
hx-customer/src/main/java/com/fjhx/customer/service/customer/CustomerTopService.java

@@ -0,0 +1,28 @@
+package com.fjhx.customer.service.customer;
+
+import com.fjhx.customer.entity.customer.po.CustomerTop;
+import com.ruoyi.common.core.service.BaseService;
+import com.fjhx.customer.entity.customer.dto.CustomerTopDto;
+
+
+/**
+ * <p>
+ * 客户置顶表 服务类
+ * </p>
+ *
+ * @author 
+ * @since 2023-05-09
+ */
+public interface CustomerTopService extends BaseService<CustomerTop> {
+
+    /**
+     * 客户置顶表新增
+     */
+    void add(CustomerTopDto customerTopDto);
+
+    /**
+     * 客户置顶表删除
+     */
+    void delete(Long id);
+
+}

+ 46 - 9
hx-customer/src/main/java/com/fjhx/customer/service/customer/impl/CustomerServiceImpl.java

@@ -2,7 +2,6 @@ package com.fjhx.customer.service.customer.impl;
 
 import cn.hutool.core.bean.BeanUtil;
 import cn.hutool.core.util.ObjectUtil;
-import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
 import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
 import com.baomidou.mybatisplus.core.toolkit.Wrappers;
 import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
@@ -12,15 +11,19 @@ import com.fjhx.customer.entity.customer.dto.CustomerDto;
 import com.fjhx.customer.entity.customer.dto.CustomerSelectDto;
 import com.fjhx.customer.entity.customer.po.Customer;
 import com.fjhx.customer.entity.customer.po.CustomerFollowRecords;
+import com.fjhx.customer.entity.customer.po.CustomerTop;
 import com.fjhx.customer.entity.customer.po.CustomerUser;
 import com.fjhx.customer.entity.customer.vo.CustomerVo;
 import com.fjhx.customer.mapper.customer.CustomerMapper;
 import com.fjhx.customer.service.customer.CustomerFollowRecordsService;
 import com.fjhx.customer.service.customer.CustomerService;
+import com.fjhx.customer.service.customer.CustomerTopService;
 import com.fjhx.customer.service.customer.CustomerUserService;
 import com.fjhx.customer.utils.code.CodeEnum;
 import com.obs.services.internal.ServiceException;
 import com.ruoyi.common.utils.SecurityUtils;
+import com.ruoyi.common.utils.StringUtils;
+import com.ruoyi.common.utils.wrapper.IWrapper;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.stereotype.Service;
 import org.springframework.transaction.annotation.Transactional;
@@ -41,6 +44,8 @@ public class CustomerServiceImpl extends ServiceImpl<CustomerMapper, Customer> i
     private CustomerUserService customerUserService;
     @Autowired
     private CustomerFollowRecordsService customerFollowRecordsService;
+    @Autowired
+    private CustomerTopService customerTopService;
 
 
     /**
@@ -51,23 +56,34 @@ public class CustomerServiceImpl extends ServiceImpl<CustomerMapper, Customer> i
      */
     @Override
     public Page<CustomerVo> getPage(CustomerSelectDto dto) {
-        LambdaQueryWrapper<Customer> wrapper = Wrappers.<Customer>lambdaQuery();
-        wrapper.eq(ObjectUtil.isNotEmpty(dto.getSource()), Customer::getSource, dto.getSource());
-        wrapper.eq(ObjectUtil.isNotEmpty(dto.getStatus()), Customer::getStatus, dto.getStatus());
+//        LambdaQueryWrapper<Customer> wrapper = Wrappers.<Customer>lambdaQuery();
+        IWrapper<CustomerVo> wrapper = IWrapper.getWrapper();
+        wrapper.eq("c", Customer::getSource, dto.getSource());
+        wrapper.eq(Customer::getStatus, dto.getStatus());
         //客户状态(0:公海客户  1:私海客户)(业务员ID为null为公海客户,业务员ID不为null为私海客户)
         if (ObjectUtil.isNotEmpty(dto.getType())) {
             //私海客户查询
             if (dto.getType().equals("1")) {
-                wrapper.isNotNull(Customer::getUserId);
+                wrapper.isNotNull("c.user_id");
             } else if (dto.getType().equals("0")) {
-                wrapper.and(wrapper1 -> wrapper1.isNull(Customer::getUserId).or().eq(Customer::getUserId, ""));
+                wrapper.and(wrapper1 -> wrapper1.isNull("c.user_id").or().eq(Customer::getUserId, ""));
             }
         }
         if (ObjectUtil.isNotEmpty(dto.getKeyword())) {
             //查询客户名称或者客户编码
             wrapper.and(wrapper1 -> wrapper1.like(Customer::getName, dto.getKeyword()).or().eq(Customer::getCode, dto.getKeyword()));
         }
+
+        //置顶条件
+        List<Long> customerIds = customerTopService.listObject(CustomerTop::getCustomerId, q -> q.eq(CustomerTop::getUserId,
+                SecurityUtils.getUserId()));
+        if (ObjectUtil.isNotEmpty(customerIds)) {
+            String join = StringUtils.join(customerIds, ",");
+            wrapper.orderByDesc("id IN ( " + join + " )");
+        }
+
         wrapper.orderByDesc(Customer::getCreateTime);
+
         Page<CustomerVo> page = this.baseMapper.getPage(dto.getPage(), wrapper);
 
         //复制城市信息
@@ -81,6 +97,11 @@ public class CustomerServiceImpl extends ServiceImpl<CustomerMapper, Customer> i
             record.setCustomerFollowRecordsList(customerFollowRecordsList);
         }
 
+        //赋值是否置顶
+        for (CustomerVo record : records) {
+            record.setIsTop(customerIds.contains(record.getId()) ? 1 : 0);
+        }
+
         return page;
     }
 
@@ -155,15 +176,25 @@ public class CustomerServiceImpl extends ServiceImpl<CustomerMapper, Customer> i
      */
     @Override
     public Page<CustomerVo> privateSeaPage(CustomerSelectDto dto) {
-        LambdaQueryWrapper<Customer> wrapper = Wrappers.<Customer>lambdaQuery();
-        wrapper.eq(ObjectUtil.isNotEmpty(dto.getSource()), Customer::getSource, dto.getSource());
-        wrapper.eq(ObjectUtil.isNotEmpty(dto.getStatus()), Customer::getStatus, dto.getStatus());
+//        LambdaQueryWrapper<Customer> wrapper = Wrappers.<Customer>lambdaQuery();
+        IWrapper<CustomerVo> wrapper = IWrapper.getWrapper();
+        wrapper.eq("c", Customer::getSource, dto.getSource());
+        wrapper.eq("c", Customer::getStatus, dto.getStatus());
         if (ObjectUtil.isNotEmpty(dto.getKeyword())) {
             //查询客户名称或者客户编码
             wrapper.and(wrapper1 -> wrapper1.like(Customer::getName, dto.getKeyword()).or().eq(Customer::getCode, dto.getKeyword()));
         }
         //添加权限(自己看自己)
         wrapper.eq(Customer::getUserId, SecurityUtils.getUserId());
+
+        //置顶条件
+        List<Long> customerIds = customerTopService.listObject(CustomerTop::getCustomerId, q -> q.eq(CustomerTop::getUserId,
+                SecurityUtils.getUserId()));
+        if (ObjectUtil.isNotEmpty(customerIds)) {
+            String join = StringUtils.join(customerIds, ",");
+            wrapper.orderByDesc("id IN ( " + join + " )");
+        }
+
         wrapper.orderByDesc(Customer::getCreateTime);
         Page<CustomerVo> page = baseMapper.getPage(dto.getPage(), wrapper);
         //复制城市信息
@@ -176,6 +207,12 @@ public class CustomerServiceImpl extends ServiceImpl<CustomerMapper, Customer> i
                             .orderByDesc(CustomerFollowRecords::getDate).last("limit 3"));
             record.setCustomerFollowRecordsList(customerFollowRecordsList);
         }
+
+        //赋值是否置顶
+        for (CustomerVo record : records) {
+            record.setIsTop(customerIds.contains(record.getId()) ? 1 : 0);
+        }
+
         return page;
     }
 

+ 35 - 0
hx-customer/src/main/java/com/fjhx/customer/service/customer/impl/CustomerTopServiceImpl.java

@@ -0,0 +1,35 @@
+package com.fjhx.customer.service.customer.impl;
+
+import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
+import com.fjhx.customer.entity.customer.dto.CustomerTopDto;
+import com.fjhx.customer.entity.customer.po.CustomerTop;
+import com.fjhx.customer.mapper.customer.CustomerTopMapper;
+import com.fjhx.customer.service.customer.CustomerTopService;
+import com.ruoyi.common.utils.SecurityUtils;
+import org.springframework.stereotype.Service;
+
+
+/**
+ * <p>
+ * 客户置顶表 服务实现类
+ * </p>
+ *
+ * @author
+ * @since 2023-05-09
+ */
+@Service
+public class CustomerTopServiceImpl extends ServiceImpl<CustomerTopMapper, CustomerTop> implements CustomerTopService {
+
+    @Override
+    public void add(CustomerTopDto customerTopDto) {
+        customerTopDto.setUserId(SecurityUtils.getUserId());
+        this.save(customerTopDto);
+    }
+
+    @Override
+    public void delete(Long id) {
+        CustomerTop customerTop = getOne(q -> q.eq(CustomerTop::getUserId, SecurityUtils.getUserId()).eq(CustomerTop::getCustomerId, id));
+        this.removeById(customerTop.getId());
+    }
+
+}

+ 4 - 0
hx-customer/src/main/resources/mapper/customer/CustomerTopMapper.xml

@@ -0,0 +1,4 @@
+<?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.fjhx.customer.mapper.customer.CustomerTopMapper">
+</mapper>

+ 8 - 1
hx-dingding/src/main/java/com/fjhx/dingding/controller/DingController.java

@@ -35,6 +35,11 @@ public class DingController {
     private static final String EVENT_CHECK_UPDATE_SUITE_URL = "check_update_suite_url";
 
     /**
+     * 推送事件
+     */
+    private static final String SYNC_HTTP_PUSH_HIGH = "SYNC_HTTP_PUSH_HIGH";
+
+    /**
      * https://open.dingtalk.com/document/isvapp/configure-synchttp-push
      * https://open.dingtalk.com/document/isvapp/authorization-event-1
      */
@@ -69,12 +74,14 @@ public class DingController {
                     log.info("验证更新回调URL有效性: " + plainText);
                     break;
 
+                case SYNC_HTTP_PUSH_HIGH:
+                    dingService.pushHigh(callBackContent);
+                    break;
                 default:
                     // 其他类型事件处理
                     log.info("其他类型事件: " + plainText);
 
                     dingService.saveCallback(callBackContent);
-
             }
 
             // 返回success的加密信息表示回调处理成功

+ 2 - 0
hx-dingding/src/main/java/com/fjhx/dingding/service/DingService.java

@@ -6,4 +6,6 @@ public interface DingService {
 
     void saveCallback(JSONObject callBackContent);
 
+    void pushHigh(JSONObject callBackContent);
+
 }

+ 64 - 5
hx-dingding/src/main/java/com/fjhx/dingding/service/impl/DingServiceImpl.java

@@ -2,20 +2,28 @@ package com.fjhx.dingding.service.impl;
 
 import cn.hutool.core.util.RandomUtil;
 import cn.hutool.extra.pinyin.PinyinUtil;
+import com.alibaba.fastjson.JSONArray;
 import com.alibaba.fastjson.JSONObject;
+import com.baomidou.mybatisplus.core.toolkit.IdWorker;
+import com.dingtalk.api.response.OapiV2DepartmentListsubResponse;
 import com.fjhx.dingding.entity.suite.po.SuiteTicketInfo;
 import com.fjhx.dingding.service.DingService;
 import com.fjhx.dingding.service.suite.SuiteTicketInfoService;
+import com.fjhx.dingding.utils.DingUtil;
 import com.fjhx.tenant.entity.tenant.po.TenantInfo;
 import com.fjhx.tenant.service.tenant.impl.TenantInfoServiceImpl;
 import com.ruoyi.common.constant.StatusConstant;
+import com.ruoyi.common.core.domain.entity.SysDept;
 import com.ruoyi.common.exception.ServiceException;
+import com.ruoyi.system.service.ISysDeptService;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.stereotype.Service;
 import org.springframework.transaction.PlatformTransactionManager;
 import org.springframework.transaction.TransactionDefinition;
 import org.springframework.transaction.TransactionStatus;
 
+import java.util.ArrayList;
+import java.util.Date;
 import java.util.List;
 import java.util.stream.Collectors;
 
@@ -35,6 +43,9 @@ public class DingServiceImpl implements DingService {
     @Autowired
     private TransactionDefinition transactionDefinition;
 
+    @Autowired
+    private ISysDeptService sysDeptService;
+
     /**
      * https://open.dingtalk.com/document/isvapp/data-formats
      */
@@ -58,6 +69,24 @@ public class DingServiceImpl implements DingService {
 
     }
 
+    @Override
+    public void pushHigh(JSONObject callBackContent) {
+        JSONArray bizData = callBackContent.getJSONArray("bizData");
+
+        for (JSONObject jsonObject : bizData.toJavaList(JSONObject.class)) {
+
+            switch (jsonObject.getInteger("biz_type")) {
+
+                case 2:
+                    saveSuiteTicketInfo(jsonObject);
+                    break;
+
+            }
+
+        }
+
+    }
+
 
     /**
      * 企业授权
@@ -144,6 +173,7 @@ public class DingServiceImpl implements DingService {
 
         }
 
+        // 创建租户
         TenantInfo tenantInfo = new TenantInfo();
         tenantInfo.setTenantId(tenantId);
         tenantInfo.setEnterpriseName(corpName);
@@ -151,15 +181,16 @@ public class DingServiceImpl implements DingService {
         tenantInfo.setFlowStatus(2);
         tenantInfo.setCorpid(corpid);
 
-        TransactionStatus transactionStatus = platformTransactionManager.getTransaction(transactionDefinition);
-
-
-
+        // 创建部门
+        ArrayList<SysDept> deptList = new ArrayList<>();
+        addDeptList(corpid, deptList, tenantId, 1L, 0L);
 
+        TransactionStatus transactionStatus = platformTransactionManager.getTransaction(transactionDefinition);
         try {
             // 保存租户
             tenantInfoService.save(tenantInfo);
-
+            // 保存部门
+            sysDeptService.saveBatch(deptList);
             // 提交事务
             platformTransactionManager.commit(transactionStatus);
         } catch (Exception e) {
@@ -167,7 +198,35 @@ public class DingServiceImpl implements DingService {
             platformTransactionManager.rollback(transactionStatus);
             throw new ServiceException("保存数据失败");
         }
+    }
 
+    /**
+     * 添加部门列表
+     */
+    private void addDeptList(String corpid, List<SysDept> deptList, String tenantId, Long dingParentId, Long myParentId) {
+
+        List<OapiV2DepartmentListsubResponse.DeptBaseResponse> tempDeptList = DingUtil.getDeptList(corpid, dingParentId);
+
+        if (tempDeptList.size() == 0) {
+            return;
+        }
+
+        for (OapiV2DepartmentListsubResponse.DeptBaseResponse deptBaseResponse : tempDeptList) {
+            SysDept sysDept = new SysDept();
+            sysDept.setDeptId(IdWorker.getId());
+            sysDept.setParentId(myParentId);
+            sysDept.setDeptName(deptBaseResponse.getName());
+            sysDept.setOrderNum(1);
+            sysDept.setStatus("0");
+            sysDept.setType(0);
+            sysDept.setTenantId(tenantId);
+            sysDept.setCreateTime(new Date());
+            sysDept.setDingDeptId(deptBaseResponse.getDeptId());
+
+            deptList.add(sysDept);
+
+            addDeptList(corpid, deptList, tenantId, deptBaseResponse.getDeptId(), sysDept.getDeptId());
+        }
     }
 
 }

+ 5 - 0
hx-item/src/main/java/com/fjhx/item/entity/product/dto/ProductInfoSelectDto.java

@@ -64,4 +64,9 @@ public class ProductInfoSelectDto extends BaseSelectDto {
      * 10 正序  20 倒序
      */
     private Integer orderBy;
+
+    /**
+     * 客户id
+     */
+    private Long customerId;
 }

+ 4 - 1
hx-item/src/main/java/com/fjhx/item/service/product/impl/ProductInfoServiceImpl.java

@@ -239,8 +239,11 @@ public class ProductInfoServiceImpl extends ServiceImpl<ProductInfoMapper, Produ
                     .or().like("pi", ProductInfo::getCode, dto.getKeyword())//产品编号
                     .or().like("c.name", dto.getKeyword()));//客户名称
         }
+        //根据客户id过滤
+        wrapper.eq("c.id", dto.getCustomerId());
         //根据产品分类id过滤
         wrapper.eq("pi", ProductInfo::getProductClassifyId, dto.getProductClassifyId());
+        wrapper.orderByDesc("pi", ProductInfo::getCreateTime);
 
         Page<ProductInfoVo> page = baseMapper.getCustomerProductList(dto.getPage(), wrapper);
         List<ProductInfoVo> records = page.getRecords();
@@ -435,7 +438,7 @@ public class ProductInfoServiceImpl extends ServiceImpl<ProductInfoMapper, Produ
         // 排除名称重复
         this.nameDuplication(ProductInfo::getName, productInfoDto.getName(), productInfoDto.getId(), "产品名称重复");
         // 排除自定义编码重复
-        this.nameDuplication(ProductInfo::getCustomCode, productInfoDto.getCustomCode(), "产品自定义编码重复");
+        this.nameDuplication(ProductInfo::getCustomCode, productInfoDto.getCustomCode(), productInfoDto.getId(), "产品自定义编码重复");
         this.updateById(productInfoDto);
         ObsFileUtil.editFile(productInfoDto.getFileList(), productInfoDto.getId());
     }

+ 1 - 1
hx-oa/src/main/java/com/fjhx/oa/controller/daily/DailyReportController.java

@@ -77,7 +77,7 @@ public class DailyReportController {
      * 分享日报
      */
     @PostMapping("/share")
-    public void share(DailyReportDto dto) {
+    public void share(@RequestBody DailyReportDto dto) {
         dailyReportService.share(dto.getId(), dto.getToUserId());
     }
 

+ 17 - 2
hx-oa/src/main/java/com/fjhx/oa/entity/daily/vo/DailyReportVo.java

@@ -4,6 +4,8 @@ import com.fjhx.oa.entity.daily.po.DailyReport;
 import lombok.Getter;
 import lombok.Setter;
 
+import java.util.List;
+
 /**
  * 日报列表查询返回值实体
  *
@@ -33,17 +35,30 @@ public class DailyReportVo extends DailyReport {
      * 我发送日报数量
      */
     private Long quantitySent;
+
     /**
      * 我接收日报数量
      */
     private Long receivedQuantity;
+
     /**
      * 今日发送日报的数量
      */
     private Long quantitySentToday;
-    /**周几*/
+
+    /**
+     * 周几
+     */
     private Integer week;
-    /**创建日期*/
+
+    /**
+     * 创建日期
+     */
     private String date;
 
+    /**
+     * 接收人列表
+     */
+    private List<DailyReportDetailsVo> detailsList;
+
 }

+ 20 - 12
hx-oa/src/main/java/com/fjhx/oa/service/daily/impl/DailyReportServiceImpl.java

@@ -1,5 +1,6 @@
 package com.fjhx.oa.service.daily.impl;
 
+import cn.hutool.core.bean.BeanUtil;
 import cn.hutool.core.util.ObjectUtil;
 import com.baomidou.dynamic.datasource.annotation.DS;
 import com.baomidou.dynamic.datasource.annotation.DSTransactional;
@@ -11,11 +12,13 @@ import com.fjhx.oa.entity.daily.dto.DailyReportDto;
 import com.fjhx.oa.entity.daily.dto.DailyReportSelectDto;
 import com.fjhx.oa.entity.daily.po.DailyReport;
 import com.fjhx.oa.entity.daily.po.DailyReportDetails;
+import com.fjhx.oa.entity.daily.vo.DailyReportDetailsVo;
 import com.fjhx.oa.entity.daily.vo.DailyReportVo;
 import com.fjhx.oa.mapper.daily.DailyReportMapper;
 import com.fjhx.oa.service.daily.DailyReportDetailsService;
 import com.fjhx.oa.service.daily.DailyReportService;
 import com.fjhx.socket.service.WebSocketServer;
+import com.ruoyi.common.constant.StatusConstant;
 import com.ruoyi.common.utils.SecurityUtils;
 import com.ruoyi.common.utils.wrapper.IWrapper;
 import com.ruoyi.system.utils.UserUtil;
@@ -23,10 +26,7 @@ import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.stereotype.Service;
 
 import java.text.SimpleDateFormat;
-import java.util.Arrays;
-import java.util.HashMap;
-import java.util.List;
-import java.util.Map;
+import java.util.*;
 import java.util.stream.Collectors;
 
 
@@ -79,15 +79,23 @@ public class DailyReportServiceImpl extends ServiceImpl<DailyReportMapper, Daily
     @Override
     public DailyReportVo detail(Long id) {
         DailyReportVo result = baseMapper.detail(id);
-        Map<Long, String> nickNameMapByIds = UserUtil.getNickNameMapByIds(Arrays.asList(result.getCreateUser()));
+        Map<Long, String> nickNameMapByIds = UserUtil.getNickNameMapByIds(Collections.singletonList(result.getCreateUser()));
         result.setUserName(nickNameMapByIds.get(result.getCreateUser()));
-        //添加已读记录
-        Long userid = SecurityUtils.getUserId();
-        DailyReportDetails dailyReportDetails = dailyReportDetailsService.getOne(q -> q.eq(DailyReportDetails::getDailyReportId, id).eq(DailyReportDetails::getRecipientId, userid));
-        if (ObjectUtil.isNotEmpty(dailyReportDetails)) {
-            dailyReportDetails.setIsRead(1);
-            dailyReportDetailsService.updateById(dailyReportDetails);
-        }
+
+        // 添加已读记录
+        dailyReportDetailsService.update(q -> q
+                .eq(DailyReportDetails::getDailyReportId, id)
+                .eq(DailyReportDetails::getRecipientId, SecurityUtils.getUserId())
+                .eq(DailyReportDetails::getIsRead, StatusConstant.NO)
+                .set(DailyReportDetails::getIsRead, StatusConstant.YES)
+        );
+
+        // 接收人列表
+        List<DailyReportDetails> detailsList = dailyReportDetailsService.list(q -> q.eq(DailyReportDetails::getDailyReportId, id));
+        List<DailyReportDetailsVo> detailsVoList = BeanUtil.copyToList(detailsList, DailyReportDetailsVo.class);
+        UserUtil.assignmentNickName(detailsVoList, DailyReportDetails::getRecipientId, DailyReportDetailsVo::setRecipientName);
+        result.setDetailsList(detailsVoList);
+
         return result;
     }
 

+ 32 - 0
hx-supply/src/main/java/com/fjhx/supply/entity/supplier/po/SupplierInfo.java

@@ -73,4 +73,36 @@ public class SupplierInfo extends BasePo {
      */
     private String victoriatouristJson;
 
+    /**
+     * 账户名
+     */
+    private String openingName;
+
+    /**
+     * 开户银行
+     */
+    private String openingBank;
+
+    /**
+     * 开户账号
+     */
+    private String accountOpening;
+
+    /**
+     * 联行号
+     */
+    private String interbankNumber;
+
+    /**
+     * 账期(/天)
+     */
+    private Integer accountPeriod;
+
+    /**
+     * 账期说明
+     */
+    private String accountPeriodRemark;
+
+
+
 }

+ 1 - 16
hx-supply/src/main/resources/mapper/supplier/SupplierInfoMapper.xml

@@ -3,22 +3,7 @@
 <mapper namespace="com.fjhx.supply.mapper.supplier.SupplierInfoMapper">
     <select id="getPage" resultType="com.fjhx.supply.entity.supplier.vo.SupplierInfoVo">
         select
-            si.id,
-            si.code,
-            si.type,
-            si.name,
-            si.country_id,
-            si.province_id,
-            si.city_id,
-            si.area_detail,
-            si.contact_person,
-            si.contact_number,
-            si.remark,
-            si.create_user,
-            si.create_time,
-            si.update_user,
-            si.update_time,
-            si.victoriatourist_json
+           si.*
         from supplier_info si
             ${ew.customSqlSegment}
     </select>

+ 1 - 0
hx-wms/src/main/java/com/fjhx/wms/service/stock/impl/StockWaitServiceImpl.java

@@ -277,6 +277,7 @@ public class StockWaitServiceImpl extends ServiceImpl<StockWaitMapper, StockWait
 
         //创建出入库记录
         StockJournal stockJournal = new StockJournal();
+        stockJournal.setOpType(stockWaitDto.getType() == 1 ? 1 : 2);
         stockJournal.setType(stockWaitDto.getType() == 1 ? 4 : 5);
         stockJournal.setCode(stockWait.getType() == 1 ? CodeEnum.SIN_CODE.getCode() : CodeEnum.SOUT_CODE.getCode());
         stockJournal.setWarehouseId(stockWaitDto.getWarehouseId());