|
@@ -1,12 +1,12 @@
|
|
|
package com.fjhx.purchase.service.impl;
|
|
|
|
|
|
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
|
|
|
-import com.fjhx.utils.DateUtil;
|
|
|
-import com.fjhx.utils.ListUtil;
|
|
|
+import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
|
|
import com.fjhx.entity.purchase.PurchaseContract;
|
|
|
import com.fjhx.purchase.mapper.PurchaseContractMapper;
|
|
|
import com.fjhx.purchase.service.PurchaseContractService;
|
|
|
-import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
|
|
+import com.fjhx.utils.DateUtil;
|
|
|
+import com.fjhx.utils.ListUtil;
|
|
|
import org.springblade.core.tool.utils.ObjectUtil;
|
|
|
import org.springframework.stereotype.Service;
|
|
|
|
|
@@ -30,6 +30,7 @@ public class PurchaseContractServiceImpl extends ServiceImpl<PurchaseContractMap
|
|
|
|
|
|
/**
|
|
|
* 校验是否为第一次购买此物料得供应商
|
|
|
+ *
|
|
|
* @param supplierId
|
|
|
* @param materialCode
|
|
|
* @return
|
|
@@ -37,13 +38,14 @@ public class PurchaseContractServiceImpl extends ServiceImpl<PurchaseContractMap
|
|
|
@Override
|
|
|
public int checkNewSupplier(String supplierId, String materialCode) {
|
|
|
int count = baseMapper.selectCount(Wrappers.<PurchaseContract>query().lambda().
|
|
|
- eq(PurchaseContract::getSupplierId,supplierId).
|
|
|
- eq(PurchaseContract::getMaterialCode,materialCode));
|
|
|
+ eq(PurchaseContract::getSupplierId, supplierId).
|
|
|
+ eq(PurchaseContract::getMaterialCode, materialCode));
|
|
|
return count;
|
|
|
}
|
|
|
|
|
|
/**
|
|
|
* 上次面料采购
|
|
|
+ *
|
|
|
* @param materialCode
|
|
|
* @return
|
|
|
*/
|
|
@@ -54,52 +56,54 @@ public class PurchaseContractServiceImpl extends ServiceImpl<PurchaseContractMap
|
|
|
|
|
|
/**
|
|
|
* 合同历史付款记录
|
|
|
+ *
|
|
|
* @return
|
|
|
*/
|
|
|
@Override
|
|
|
- public List<Map<String,Object>> historyPayList() {
|
|
|
+ public List<Map<String, Object>> historyPayList() {
|
|
|
return baseMapper.historyPayList();
|
|
|
}
|
|
|
|
|
|
/**
|
|
|
* 历史付款列表
|
|
|
+ *
|
|
|
* @param condition
|
|
|
* @return
|
|
|
*/
|
|
|
@Override
|
|
|
public List<PurchaseContract> getPayList(Map<String, Object> condition) throws ParseException {
|
|
|
List<PurchaseContract> list = baseMapper.getPayList(condition);
|
|
|
- Map<String,Object> map = new HashMap<>();
|
|
|
+ Map<String, Object> map = new HashMap<>();
|
|
|
//初始化map集合
|
|
|
- map.put("subscribeCheck",true);
|
|
|
- map.put("inoutBillCheck",false);
|
|
|
- map.put("quantityCheck",false);
|
|
|
- map.put("ContractCheck",false);
|
|
|
- map.put("invoiceCheck",false);
|
|
|
- map.put("payDate",null);
|
|
|
- for(PurchaseContract p:list){
|
|
|
+ map.put("subscribeCheck", true);
|
|
|
+ map.put("inoutBillCheck", false);
|
|
|
+ map.put("quantityCheck", false);
|
|
|
+ map.put("ContractCheck", false);
|
|
|
+ map.put("invoiceCheck", false);
|
|
|
+ map.put("payDate", null);
|
|
|
+ for (PurchaseContract p : list) {
|
|
|
//处理是否入库判定
|
|
|
- if(ObjectUtil.isNotEmpty(p.getPurContractState())&&p.getPurContractState()==3){
|
|
|
- map.put("inoutBillCheck",true);
|
|
|
+ if (ObjectUtil.isNotEmpty(p.getPurContractState()) && p.getPurContractState() == 3) {
|
|
|
+ map.put("inoutBillCheck", true);
|
|
|
}
|
|
|
//处理是否质检判定
|
|
|
- if(ObjectUtil.isNotEmpty(p.getQuantityStatus())){
|
|
|
- map.put("quantityCheck",ListUtil.checkList(Arrays.asList(p.getQuantityStatus()),"1"));
|
|
|
+ if (ObjectUtil.isNotEmpty(p.getQuantityStatus())) {
|
|
|
+ map.put("quantityCheck", ListUtil.checkList(Arrays.asList(p.getQuantityStatus()), "1"));
|
|
|
}
|
|
|
//处理合同判定
|
|
|
- if(ObjectUtil.isNotEmpty(p.getContractStatus())&&
|
|
|
- p.getContractStatus().contains("3")){
|
|
|
- map.put("ContractCheck",true);
|
|
|
+ if (ObjectUtil.isNotEmpty(p.getContractStatus()) &&
|
|
|
+ p.getContractStatus().contains("3")) {
|
|
|
+ map.put("ContractCheck", true);
|
|
|
}
|
|
|
//处理发票判定
|
|
|
- if(ObjectUtil.isNotEmpty(p.getContractAmount())
|
|
|
- &&p.getContractAmount().compareTo(p.getApplyPayAmount())>-1){
|
|
|
- map.put("invoiceCheck",true);
|
|
|
+ if (ObjectUtil.isNotEmpty(p.getContractAmount())
|
|
|
+ && p.getContractAmount().compareTo(p.getApplyPayAmount()) > -1) {
|
|
|
+ map.put("invoiceCheck", true);
|
|
|
}
|
|
|
//处理付款期限
|
|
|
- if(ObjectUtil.isNotEmpty(p.getCompleteStockTime())){
|
|
|
- String date = DateUtil.dateMinusMonth(p.getCompleteStockTime(),p.getAccountDate());
|
|
|
- map.put("payDate",DateUtil.differenceDate(date));
|
|
|
+ if (ObjectUtil.isNotEmpty(p.getCompleteStockTime())) {
|
|
|
+ String date = DateUtil.dateMinusMonth(p.getCompleteStockTime(), p.getAccountDate());
|
|
|
+ map.put("payDate", DateUtil.differenceDate(date));
|
|
|
}
|
|
|
p.setCheck(map);
|
|
|
}
|
|
@@ -108,6 +112,7 @@ public class PurchaseContractServiceImpl extends ServiceImpl<PurchaseContractMap
|
|
|
|
|
|
/**
|
|
|
* 历史付款列表--条数
|
|
|
+ *
|
|
|
* @param condition
|
|
|
* @return
|
|
|
*/
|
|
@@ -118,16 +123,18 @@ public class PurchaseContractServiceImpl extends ServiceImpl<PurchaseContractMap
|
|
|
|
|
|
/**
|
|
|
* 统计供应商总付款金额
|
|
|
+ *
|
|
|
* @param condition
|
|
|
* @return
|
|
|
*/
|
|
|
@Override
|
|
|
- public List<Map<String,Object>> getPayGroupBySu(Map<String, Object> condition) {
|
|
|
+ public List<Map<String, Object>> getPayGroupBySu(Map<String, Object> condition) {
|
|
|
return baseMapper.getPayGroupBySu(condition);
|
|
|
}
|
|
|
|
|
|
/**
|
|
|
* 获取总金额
|
|
|
+ *
|
|
|
* @param date
|
|
|
* @return
|
|
|
*/
|