|
@@ -11,6 +11,7 @@ import com.fjhx.area.utils.CustomizeAreaUtil;
|
|
|
import com.fjhx.common.constant.SourceConstant;
|
|
|
import com.fjhx.common.entity.corporation.po.Corporation;
|
|
|
import com.fjhx.common.entity.documentary.bo.DocumentaryData;
|
|
|
+import com.fjhx.common.enums.FlowStatusEnum1;
|
|
|
import com.fjhx.common.service.corporation.CorporationService;
|
|
|
import com.fjhx.common.service.documentary.GetDocumentaryBusinessTemplate;
|
|
|
import com.fjhx.flow.service.flow.FlowExampleService;
|
|
@@ -19,8 +20,6 @@ import com.fjhx.purchase.entity.invoice.vo.InvoiceDetailsVo;
|
|
|
import com.fjhx.purchase.entity.pay.vo.PayDetailVo;
|
|
|
import com.fjhx.purchase.entity.purchase.bo.PurchaseDocumentaryBo;
|
|
|
import com.fjhx.purchase.entity.purchase.enums.PurchaseStatusEnum;
|
|
|
-import com.fjhx.purchase.entity.purchase.po.Purchase;
|
|
|
-import com.fjhx.purchase.entity.purchase.vo.PurchaseDocumentaryVo;
|
|
|
import com.fjhx.purchase.service.invoice.InvoiceDetailsService;
|
|
|
import com.fjhx.purchase.service.pay.PayDetailService;
|
|
|
import com.fjhx.sale.entity.pack.po.PackDetail;
|
|
@@ -66,7 +65,7 @@ import java.util.stream.Collectors;
|
|
|
*/
|
|
|
@Service
|
|
|
@DS(SourceConstant.SALE)
|
|
|
-public class EhsdPurchaseServiceImpl extends ServiceImpl<EhsdPurchaseMapper, EhsdPurchase> implements EhsdPurchaseService , GetDocumentaryBusinessTemplate {
|
|
|
+public class EhsdPurchaseServiceImpl extends ServiceImpl<EhsdPurchaseMapper, EhsdPurchase> implements EhsdPurchaseService, GetDocumentaryBusinessTemplate {
|
|
|
|
|
|
@Autowired
|
|
|
private EhsdPurchaseProductService ehsdPurchaseProductService;
|
|
@@ -112,9 +111,19 @@ public class EhsdPurchaseServiceImpl extends ServiceImpl<EhsdPurchaseMapper, Ehs
|
|
|
if (ObjectUtils.isNotEmpty(dto.getKeyword())) {
|
|
|
wrapper.keyword(dto.getKeyword(), new SqlField("t2.name"), new SqlField("t1.`code`"));
|
|
|
}
|
|
|
+
|
|
|
+ //不显示已变更数据
|
|
|
+ wrapper.ne(EhsdPurchase::getStatus, FlowStatusEnum1.UPDATE.getKey());
|
|
|
+
|
|
|
+ //不显示 在审批中 但是 有历史合同id的数据
|
|
|
+ wrapper.and(q->q
|
|
|
+ .ne(EhsdPurchase::getStatus, FlowStatusEnum1.UNDER_REVIEW.getKey())
|
|
|
+ .isNull("t1.old_purchase_id")
|
|
|
+ );
|
|
|
+
|
|
|
Page<EhsdPurchaseVo> page = this.baseMapper.getPage(dto.getPage(), wrapper);
|
|
|
List<EhsdPurchaseVo> records = page.getRecords();
|
|
|
- if(ObjectUtils.isEmpty(records)){
|
|
|
+ if (ObjectUtils.isEmpty(records)) {
|
|
|
return page;
|
|
|
}
|
|
|
// 赋值流程id
|
|
@@ -124,10 +133,10 @@ public class EhsdPurchaseServiceImpl extends ServiceImpl<EhsdPurchaseMapper, Ehs
|
|
|
List<Long> pids = records.stream().map(EhsdPurchaseVo::getId).collect(Collectors.toList());
|
|
|
List<PayDetailVo> payDetailVoList = payDetailService.getSumMoneyByPurchaseIds(pids);
|
|
|
Map<Long, BigDecimal> payMap = payDetailVoList.stream().collect(Collectors.toMap(PayDetailVo::getPurchaseId, PayDetailVo::getSumMoney));
|
|
|
- records.forEach(item->item.setSumPayMoney(payMap.getOrDefault(item.getId(),BigDecimal.ZERO)));
|
|
|
+ records.forEach(item -> item.setSumPayMoney(payMap.getOrDefault(item.getId(), BigDecimal.ZERO)));
|
|
|
|
|
|
//赋值用户名称
|
|
|
- UserUtil.assignmentNickName(records,EhsdPurchase::getCreateUser,EhsdPurchase::setUserName);
|
|
|
+ UserUtil.assignmentNickName(records, EhsdPurchase::getCreateUser, EhsdPurchase::setUserName);
|
|
|
|
|
|
return page;
|
|
|
}
|
|
@@ -179,7 +188,7 @@ public class EhsdPurchaseServiceImpl extends ServiceImpl<EhsdPurchaseMapper, Ehs
|
|
|
List<Long> eppIds = ehsdPurchaseProductVos.stream().map(EhsdPurchaseProductVo::getId).collect(Collectors.toList());
|
|
|
Map<Long, List<EhsdPurchaseProductMountings>> eppMap = ehsdPurchaseProductMountingsService.mapKGroup(
|
|
|
EhsdPurchaseProductMountings::getPurchaseProductId, q -> q
|
|
|
- .in(EhsdPurchaseProductMountings::getPurchaseProductId, eppIds)
|
|
|
+ .in(EhsdPurchaseProductMountings::getPurchaseProductId, eppIds)
|
|
|
);
|
|
|
for (EhsdPurchaseProductVo ehsdPurchaseProductVo : ehsdPurchaseProductVos) {
|
|
|
List<EhsdPurchaseProductMountings> ehsdPurchaseProductMountings = eppMap.get(ehsdPurchaseProductVo.getId());
|
|
@@ -300,7 +309,7 @@ public class EhsdPurchaseServiceImpl extends ServiceImpl<EhsdPurchaseMapper, Ehs
|
|
|
*/
|
|
|
@Override
|
|
|
public boolean updatePurchaseId(Long id, long newId, Long userId) {
|
|
|
- return baseMapper.updatePurchaseId(id,newId,userId);
|
|
|
+ return baseMapper.updatePurchaseId(id, newId, userId);
|
|
|
}
|
|
|
|
|
|
}
|