Commit 7142c1ce by kangxiaoshan

大后天

parent d86e028f
...@@ -301,12 +301,16 @@ public class ContractServiceImpl implements ContractService { ...@@ -301,12 +301,16 @@ public class ContractServiceImpl implements ContractService {
} }
resource.setPayMoney(0L);
resource.setInvoice(0L); resource.setInvoice(0L);
Long extraFlow = resource.getExtraFlow(); Long extraFlow = resource.getExtraFlow();
if(extraFlow==null){ if(extraFlow==null){
extraFlow = 0L; extraFlow = 0L;
} }
if(resource.getPayMoney()==null){
resource.setPayMoney(0L);
}
resource.setDs(DateUtil.getBeforeDays(0)); resource.setDs(DateUtil.getBeforeDays(0));
...@@ -1078,6 +1082,10 @@ public class ContractServiceImpl implements ContractService { ...@@ -1078,6 +1082,10 @@ public class ContractServiceImpl implements ContractService {
Contract contract = contractRepository.findByCode(resource.getContractCode()); Contract contract = contractRepository.findByCode(resource.getContractCode());
if (resource.getType().equals("pay")) { if (resource.getType().equals("pay")) {
contract.setPayMoney(contract.getPayMoney()+resource.getMoney()); contract.setPayMoney(contract.getPayMoney()+resource.getMoney());
//判断回款状态
this.dealContractStatus(contract,loginUser,"update");
} else { } else {
contract.setInvoiceMoney(contract.getInvoiceMoney().add(new BigDecimal(resource.getMoney().toString())) ); contract.setInvoiceMoney(contract.getInvoiceMoney().add(new BigDecimal(resource.getMoney().toString())) );
} }
...@@ -1111,7 +1119,7 @@ public class ContractServiceImpl implements ContractService { ...@@ -1111,7 +1119,7 @@ public class ContractServiceImpl implements ContractService {
resource.setContent(packageMap.get(contract.getPriceLevel())+"改为"+packageMap.get(resource.getLevel())); resource.setContent(packageMap.get(contract.getPriceLevel())+"改为"+packageMap.get(resource.getLevel()));
resource.setMarke(contract.getMoney()+"元改为"+resource.getMoney()+"元"); resource.setMarke(contract.getMoney()+"元改为"+resource.getMoney()+"元");
contract.setMoney(resource.getMoney() + contract.getMoney()); contract.setMoney(resource.getMoney());
contract.setPriceLevel(resource.getLevel()); contract.setPriceLevel(resource.getLevel());
// Double rebat = getRebat(contract.getProduct(), contract.getPriceLevel().intValue(), contract.getMoney()); // Double rebat = getRebat(contract.getProduct(), contract.getPriceLevel().intValue(), contract.getMoney());
...@@ -1243,7 +1251,6 @@ public class ContractServiceImpl implements ContractService { ...@@ -1243,7 +1251,6 @@ public class ContractServiceImpl implements ContractService {
contract.setPayMoney(contract.getPayMoney() + resource.getMoney() - contractMoney.getMoney()); contract.setPayMoney(contract.getPayMoney() + resource.getMoney() - contractMoney.getMoney());
} else { } else {
// contract.setInvoice(contract.getInvoice() + resource.getMoney() - contractMoney.getMoney()); // contract.setInvoice(contract.getInvoice() + resource.getMoney() - contractMoney.getMoney());
contract.setInvoiceMoney(contract.getInvoiceMoney().add(new BigDecimal(resource.getMoney())).subtract(new BigDecimal(contractMoney.getMoney()))); contract.setInvoiceMoney(contract.getInvoiceMoney().add(new BigDecimal(resource.getMoney())).subtract(new BigDecimal(contractMoney.getMoney())));
} }
...@@ -1329,6 +1336,7 @@ public class ContractServiceImpl implements ContractService { ...@@ -1329,6 +1336,7 @@ public class ContractServiceImpl implements ContractService {
if (ids != null) { if (ids != null) {
// 已关联合同 字典
Map<String,String> filterMap = new HashMap(); Map<String,String> filterMap = new HashMap();
for(ContractRelation relation : ids){ for(ContractRelation relation : ids){
...@@ -1338,11 +1346,12 @@ public class ContractServiceImpl implements ContractService { ...@@ -1338,11 +1346,12 @@ public class ContractServiceImpl implements ContractService {
} }
// 所有可关联合同
List<Map> resultBefore = contractRepository.contractCodePlatform(plats); List<Map> resultBefore = contractRepository.contractCodePlatform(plats);
for (Map m : resultBefore) { for (Map m : resultBefore) {
String m_id = m.get("id").toString() + "_"; String m_id = m.get("id").toString() + "_";
if (filterMap.get(m_id) == null && m_id.equals(contractId+"_")) { if (filterMap.get(m_id) == null && !m_id.equals(contractId+"_")) {
result.add(m); result.add(m);
} }
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment