|
@@ -1082,7 +1082,22 @@ public class WorkInvoiceTwoController extends BaseController {
|
|
|
map.put("areaName",projectRecords.getArea().getName());//项目地区名称
|
|
|
map.put("projectNum",projectRecords.getProjectId());//项目编号
|
|
|
map.put("reportDataNum",projectRecords.getReportData().getNumber());//报告号
|
|
|
- if(projectRecords.getWorkContractInfo() == null || null == projectRecords.getWorkContractInfo().getClient() || StringUtils.isBlank(projectRecords.getWorkContractInfo().getClient().getName())){
|
|
|
+
|
|
|
+ if(null != projectRecords.getWorkContractInfo() && StringUtils.isNotBlank(projectRecords.getWorkContractInfo().getId())){
|
|
|
+ String id = projectRecords.getWorkContractInfo().getId();
|
|
|
+ WorkContractInfo workContractInfo = workContractInfoService.get(id);
|
|
|
+ if(workContractInfo!=null){
|
|
|
+ String oid = workContractInfo.getChargeCompany();
|
|
|
+ Office office = officeService.get(oid);
|
|
|
+ if(office!=null){
|
|
|
+ map.put("officeName",office.getTopCompany());//部门
|
|
|
+ map.put("officeId",office.getId());//部门
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ projectRecords.setWorkContractInfo(workContractInfo);
|
|
|
+ }
|
|
|
+ if(projectRecords.getWorkContractInfo() == null){
|
|
|
//无合同状态下,获取委托方的名称
|
|
|
projectRecordsService.queryLinkmanInfos(projectRecords);
|
|
|
if (projectRecords.getWorkClientLinkmanList() != null && projectRecords.getWorkClientLinkmanList().size() > 0) {
|
|
@@ -1090,19 +1105,10 @@ public class WorkInvoiceTwoController extends BaseController {
|
|
|
map.put("clientName",linkman.getClientId().getName());//委托方
|
|
|
}
|
|
|
}else{
|
|
|
- map.put("clientName",projectRecords.getWorkContractInfo().getClient().getName());//委托方
|
|
|
+ map.put("clientName",projectRecords.getWorkContractInfo().getClientName());//委托方
|
|
|
}
|
|
|
map.put("workContractName",projectRecords.getWorkContractInfo().getName());//合同名称
|
|
|
- String id = projectRecords.getWorkContractInfo().getId();
|
|
|
- WorkContractInfo workContractInfo = workContractInfoService.get(id);
|
|
|
- if(workContractInfo!=null){
|
|
|
- String oid = workContractInfo.getChargeCompany();
|
|
|
- Office office = officeService.get(oid);
|
|
|
- if(office!=null){
|
|
|
- map.put("officeName",office.getTopCompany());//部门
|
|
|
- map.put("officeId",office.getId());//部门
|
|
|
- }
|
|
|
- }
|
|
|
+
|
|
|
return JsonMapper.toJsonString(map);
|
|
|
}
|
|
|
/**
|