yzc 1 рік тому
батько
коміт
78aa27209d

+ 14 - 0
hx-sale/src/main/java/com/fjhx/sale/entity/contract/po/Contract.java

@@ -463,4 +463,18 @@ public class Contract extends BasePo {
      */
     private String rejectRemark;
 
+    /**
+     * 是否含运费
+     */
+    private Integer isFreight;
+    /**
+     * 是否含税
+     */
+    private Integer isTax;
+    /**
+     * 跟单员id
+     */
+    private Long merchUserId;
+
+
 }

+ 6 - 0
hx-sale/src/main/java/com/fjhx/sale/entity/contract/vo/ContractVo.java

@@ -234,5 +234,11 @@ public class ContractVo extends Contract {
      */
     private Integer produceStatus;
 
+    /**
+     * 跟单员名称
+     */
+    private String merchUserName;
+
+
 }
 

+ 11 - 0
hx-sale/src/main/java/com/fjhx/sale/service/contract/impl/ContractServiceImpl.java

@@ -102,6 +102,7 @@ import com.ruoyi.common.utils.wrapper.IWrapper;
 import com.ruoyi.common.utils.wrapper.SqlField;
 import com.ruoyi.framework.config.ThreadPoolConfig;
 import com.ruoyi.system.service.ISysDeptService;
+import com.ruoyi.system.service.ISysUserService;
 import com.ruoyi.system.utils.UserUtil;
 import org.apache.commons.collections4.MapUtils;
 import org.springframework.beans.factory.annotation.Autowired;
@@ -218,6 +219,8 @@ public class ContractServiceImpl extends ServiceImpl<ContractMapper, Contract>
     private StockWaitService stockWaitService;
     @Autowired
     private StockWaitDetailsService stockWaitDetailsService;
+    @Autowired
+    private ISysUserService sysUserService;
 
     /**
      * 合同和样品单 下拉分页
@@ -358,11 +361,16 @@ public class ContractServiceImpl extends ServiceImpl<ContractMapper, Contract>
             List<Long> corporationIds = corporationService.listObject(Corporation::getId, q -> q.like(Corporation::getName, dto.getKeyword()));
             List<Long> customerIds = customerService.listObject(Customer::getId, q -> q.like(Customer::getName, dto.getKeyword()));
 
+            List<SysUser> list = sysUserService.list(IWrapper.<SysUser>getWrapper().like(SysUser::getNickName, dto.getKeyword()));
+            List<Long> uIds = list.stream().map(SysUser::getUserId).collect(Collectors.toList());
+
             wrapper.and(q -> q
                     .like("t1", Contract::getCode, dto.getKeyword())
                     .or().like("t1", Contract::getUserName, dto.getUserName())
                     .or().in("t1", Contract::getSellCorporationId, corporationIds)
                     .or().in("t1", Contract::getBuyCorporationId, customerIds)
+                    .or().in("t1", Contract::getMerchUserId, uIds)
+
             );
         }
 
@@ -520,6 +528,9 @@ public class ContractServiceImpl extends ServiceImpl<ContractMapper, Contract>
             item.setSellCorporationName(corporation.getName());
         });
 
+        //赋值跟单人
+        UserUtil.assignmentNickName(list, Contract::getMerchUserId, ContractVo::setMerchUserName);
+
         return page;
     }