|
@@ -36,7 +36,9 @@ import com.fjhx.common.utils.Assert;
|
|
|
import com.fjhx.customer.entity.customer.dto.CustomerDto;
|
|
|
import com.fjhx.customer.entity.customer.po.Customer;
|
|
|
import com.fjhx.customer.service.customer.CustomerService;
|
|
|
+import com.fjhx.file.entity.FileInfo;
|
|
|
import com.fjhx.file.entity.FileInfoVo;
|
|
|
+import com.fjhx.file.service.FileInfoService;
|
|
|
import com.fjhx.file.utils.ObsFileUtil;
|
|
|
import com.fjhx.flow.service.flow.FlowExampleService;
|
|
|
import com.fjhx.item.entity.product.dto.ProductInfoSelectDto;
|
|
@@ -197,6 +199,9 @@ public class ContractServiceImpl extends ServiceImpl<ContractMapper, Contract>
|
|
|
@Autowired
|
|
|
private PayDetailService payDetailService;
|
|
|
|
|
|
+ @Autowired
|
|
|
+ private FileInfoService fileInfoService;
|
|
|
+
|
|
|
/**
|
|
|
* 合同和样品单 下拉分页
|
|
|
*/
|
|
@@ -230,15 +235,16 @@ public class ContractServiceImpl extends ServiceImpl<ContractMapper, Contract>
|
|
|
|
|
|
/**
|
|
|
* 头部统计
|
|
|
+ *
|
|
|
* @param dto
|
|
|
* @return
|
|
|
*/
|
|
|
@Override
|
|
|
public Map<String, Object> getHeadStatistic(ContractSelectDto dto) {
|
|
|
IWrapper<Contract> wrapper = getWrapper();
|
|
|
- setContractParam(dto,wrapper);
|
|
|
+ setContractParam(dto, wrapper);
|
|
|
SysUser sysUser = UserUtil.getUserInfo();
|
|
|
- Map<String,Object> map = new HashMap<>();
|
|
|
+ Map<String, Object> map = new HashMap<>();
|
|
|
if (StringUtils.isEmpty(sysUser.getUserCode())) {//不是业务员看所有
|
|
|
map = baseMapper.getHeadStatistic(wrapper);
|
|
|
} else {//是业务员
|
|
@@ -249,12 +255,12 @@ public class ContractServiceImpl extends ServiceImpl<ContractMapper, Contract>
|
|
|
wrapper.in("t1", Contract::getBuyCorporationId, authIdList);
|
|
|
map = baseMapper.getHeadStatistic(wrapper);
|
|
|
}
|
|
|
- if(MapUtils.isNotEmpty(map)){
|
|
|
- String customers = map.getOrDefault("customerList","").toString();
|
|
|
+ if (MapUtils.isNotEmpty(map)) {
|
|
|
+ String customers = map.getOrDefault("customerList", "").toString();
|
|
|
int customerCount = customers.split(",").length;
|
|
|
- map.put("customerCount",customerCount);
|
|
|
+ map.put("customerCount", customerCount);
|
|
|
}
|
|
|
- map.put("customerList","");
|
|
|
+ map.put("customerList", "");
|
|
|
return map;
|
|
|
}
|
|
|
|
|
@@ -267,7 +273,7 @@ public class ContractServiceImpl extends ServiceImpl<ContractMapper, Contract>
|
|
|
@Override
|
|
|
public Page<ContractVo> getPage(ContractSelectDto dto) {
|
|
|
IWrapper<Contract> wrapper = getWrapper();
|
|
|
- setContractParam(dto,wrapper);
|
|
|
+ setContractParam(dto, wrapper);
|
|
|
SysUser sysUser = UserUtil.getUserInfo();
|
|
|
if (StringUtils.isEmpty(sysUser.getUserCode())) {//不是业务员看所有
|
|
|
return pageCommon(dto, wrapper);
|
|
@@ -283,10 +289,11 @@ public class ContractServiceImpl extends ServiceImpl<ContractMapper, Contract>
|
|
|
|
|
|
/**
|
|
|
* 赋值查询参数
|
|
|
+ *
|
|
|
* @param dto
|
|
|
* @param wrapper
|
|
|
*/
|
|
|
- private void setContractParam(ContractSelectDto dto,IWrapper<Contract> wrapper){
|
|
|
+ private void setContractParam(ContractSelectDto dto, IWrapper<Contract> wrapper) {
|
|
|
wrapper.orderByDesc("t1", Contract::getCreateTime);
|
|
|
if (StringUtils.isNotEmpty(dto.getStatus())) {
|
|
|
wrapper.eq("t1", Contract::getStatus, dto.getStatus());
|
|
@@ -1108,6 +1115,18 @@ public class ContractServiceImpl extends ServiceImpl<ContractMapper, Contract>
|
|
|
public void contractHandover(ContractDto dto) {
|
|
|
ObsFileUtil.editFile(dto.getFileList(), dto.getId(), 1);
|
|
|
ObsFileUtil.editFile(dto.getPackageFileList(), dto.getId(), 2);
|
|
|
+
|
|
|
+ //刷新合同是否有样品单附件状态
|
|
|
+ DynamicDataSourceContextHolder.push(SourceConstant.BASE);
|
|
|
+ long count = fileInfoService.count(q -> q.eq(FileInfo::getBusinessId, dto.getId()).eq(FileInfo::getBusinessType, 1));
|
|
|
+ DynamicDataSourceContextHolder.poll();
|
|
|
+ Integer isDeliveryFile = (count > 0) ? 1 : 0;
|
|
|
+ contractService.update(q -> q
|
|
|
+ .eq(Contract::getId, dto.getId())
|
|
|
+ .set(Contract::getIsDeliveryFile, isDeliveryFile)
|
|
|
+ .set(Contract::getUpdateTime, new Date())
|
|
|
+ .set(BasePo::getUpdateUser, SecurityUtils.getUserId())
|
|
|
+ );
|
|
|
}
|
|
|
|
|
|
/**
|