Commit 2803b252 by shiwenbo

合同增加service接口

parent 9a565898
...@@ -188,6 +188,16 @@ public class ContractServiceImpl implements ContractService { ...@@ -188,6 +188,16 @@ public class ContractServiceImpl implements ContractService {
} }
@Override @Override
public KObject getExecutingContractByContractInfoId(UUID infoId) {
List<KObject> executingContracts = contractDao.getExecutingContractByContractInfoId(infoId);
if(executingContracts.size() != 1){
//不该出现的情况,需要查明
logger.error("不该出现的情况,需要查明:合同["+infoId.toString()+"]是变更审批,审批完成后发现原合同没有执行中的");
}
return executingContracts.get(0);
}
@Override
public void changelog(UUID infoId) { public void changelog(UUID infoId) {
KObject log = Amino.getApplicationContext() KObject log = Amino.getApplicationContext()
.getBean(LogConstants.LOG_ENTIY_NAME, KClass.class).newInstance(); .getBean(LogConstants.LOG_ENTIY_NAME, KClass.class).newInstance();
......
...@@ -36,7 +36,7 @@ public class ContractWarnSettingProcessor implements DataProcessor { ...@@ -36,7 +36,7 @@ public class ContractWarnSettingProcessor implements DataProcessor {
//合同,项目,购砂单位 //合同,项目,购砂单位
UUID contractId = UUID.fromString(row.get("billId").toString()); UUID contractId = UUID.fromString(row.get("billId").toString());
KObject contractInfo = contractService.queryContractInfo(contractId); KObject contractInfo = contractService.queryContractInfo(contractId);
KObject contract = contractService.getLastContractByInfoId(contractInfo.getUuid("id")); KObject contract = contractService.getExecutingContractByContractInfoId(contractInfo.getUuid("id"));
Assert.notNull(contract, "找不到对应的合同!"); Assert.notNull(contract, "找不到对应的合同!");
row.put("projectName", contract.isNull("project") ? "" : contract.get("project").getString("projectName")); row.put("projectName", contract.isNull("project") ? "" : contract.get("project").getString("projectName"));
row.put("contractName", contract.getString("contractName")); row.put("contractName", contract.getString("contractName"));
......
...@@ -60,6 +60,8 @@ public interface ContractService { ...@@ -60,6 +60,8 @@ public interface ContractService {
KObject getLastContractByInfoId(UUID infoId); KObject getLastContractByInfoId(UUID infoId);
KObject getExecutingContractByContractInfoId(UUID infoId);
/** /**
* 记录变更操作日志 * 记录变更操作日志
**/ **/
......
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