|
|
@ -26,6 +26,7 @@ import com.yxt.supervise.report.feign.crm.projectcreditbalance.ProjectCreditBala |
|
|
|
import com.yxt.supervise.report.feign.crm.projectcreditfile.ProjectCreditFileFeign; |
|
|
|
import com.yxt.supervise.report.feign.crm.projectphaserecord.ProjectPhaseRecordFeign; |
|
|
|
import com.yxt.supervise.report.feign.crm.projectshgm.ProjectShGmDto; |
|
|
|
import com.yxt.supervise.report.feign.crm.projectshgm.ProjectShGmFeign; |
|
|
|
import com.yxt.supervise.report.feign.monitor.YDeviceFeign; |
|
|
|
import com.yxt.supervise.report.feign.monitor.YDeviceImageFeign; |
|
|
|
import com.yxt.supervise.report.shanhai.ShRequester; |
|
|
@ -67,6 +68,8 @@ public class DataCenterRest { |
|
|
|
private ProjectCreditBalanceFeign projectCreditBalanceFeign; |
|
|
|
@Autowired |
|
|
|
private ProjectCreditFileFeign projectCreditFileFeign; |
|
|
|
@Autowired |
|
|
|
private ProjectShGmFeign projectShGmFeign; |
|
|
|
|
|
|
|
//数据总览
|
|
|
|
/*********************************************36524演示************************************/ |
|
|
@ -492,8 +495,8 @@ public class DataCenterRest { |
|
|
|
List<String> title=new ArrayList<>(); |
|
|
|
title.add("贷款支持-折"); |
|
|
|
title.add("贷款支持-柱"); |
|
|
|
title.add("总贷款-折"); |
|
|
|
title.add("总贷款-柱"); |
|
|
|
title.add("总投资-折"); |
|
|
|
title.add("总投资-柱"); |
|
|
|
map.put("titile",title); |
|
|
|
SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd"); |
|
|
|
String EndDate=sdf.format(DateUtil.offsetMonth(DateUtil.parse(query.getDate()),-7)); |
|
|
@ -507,7 +510,8 @@ public class DataCenterRest { |
|
|
|
SimpleDateFormat sdf1 = new SimpleDateFormat("yyyy-MM"); |
|
|
|
// String date=sdf1.format(DateUtil.offsetMonth(DateUtil.parse(query.getDate()),-k));
|
|
|
|
String date=sdf1.format(DateUtil.offsetMonth(DateUtil.parse(EndDate),k)); |
|
|
|
a.add(date); |
|
|
|
int date1=DateUtil.month(DateUtil.offsetMonth(DateUtil.parseDate(EndDate),k))+1; |
|
|
|
a.add(String.valueOf(date1)+"月"); |
|
|
|
ShGmVo vo=crmMapper.getGm(date); |
|
|
|
if(null!=vo){ |
|
|
|
dkzcCount.add(vo.getDkzcCount().toString()); |
|
|
@ -528,6 +532,7 @@ public class DataCenterRest { |
|
|
|
map.put("ztzCount",ztzCount); |
|
|
|
return rb.success().setData(map); |
|
|
|
} |
|
|
|
|
|
|
|
@ApiOperation("项目分页列表") |
|
|
|
@PostMapping("/getProjectPageList") |
|
|
|
public Object getProjectPageList(@RequestBody PagerQuery<IndexQuery> pq){ |
|
|
@ -570,6 +575,9 @@ public class DataCenterRest { |
|
|
|
if(StringUtils.isNotBlank(query.getWarehouseCode())){ |
|
|
|
sendBody.put("warehouseCode",query.getWarehouseCode()); |
|
|
|
} |
|
|
|
if(StringUtils.isNotBlank(query.getBelongingPlace())){ |
|
|
|
sendBody.put("belongingPlace",query.getBelongingPlace()); |
|
|
|
} |
|
|
|
sendBodyMM.put("params",sendBody); |
|
|
|
// List<ProjectDetailsVo> projectDetailsVos=c.getListPage(new RestTemplate().postForEntity(a, sendBodyMM, String.class),ProjectDetailsVo.class);
|
|
|
|
JSONObject jsonObject=com.alibaba.fastjson.JSONObject.parseObject(new RestTemplate().postForEntity(a, sendBodyMM, String.class).getBody()); |
|
|
@ -659,14 +667,20 @@ public class DataCenterRest { |
|
|
|
|
|
|
|
@ApiOperation("dingshi") |
|
|
|
@GetMapping("/rr") |
|
|
|
@Scheduled(cron = "0 0 0 1 * ? ") |
|
|
|
@Scheduled(cron = "1 0 0 * * ? ") |
|
|
|
public void rr(){ |
|
|
|
//山海系统
|
|
|
|
String a ="63_17_0_2069_1,63_17_0_2048_1,63_17_0_2049_1,63_17_0_2070_1,63_17_0_2073_1,63_17_0_2075_1,63_17_0_2078_1,63_17_0_2080_1,63_17_0_2087_1,63_17_0_2090_1"; |
|
|
|
List<String> list=new ArrayList<>(); |
|
|
|
SimpleDateFormat sdf=new SimpleDateFormat("yyyy-MM-dd"); |
|
|
|
String format = sdf.format(new Date()); |
|
|
|
list.add("2000-01-01"); |
|
|
|
list.add(format); |
|
|
|
IndexQuery query =new IndexQuery(); |
|
|
|
query.setPage("1"); |
|
|
|
query.setLimit("1000"); |
|
|
|
query.setOrder_type("10"); |
|
|
|
query.setSearch_time(list.stream().toArray(String []::new)); |
|
|
|
BigDecimal ztz=new BigDecimal(0); |
|
|
|
Integer ztzCount =0; |
|
|
|
for (String s : a.split(",")) { |
|
|
@ -695,7 +709,10 @@ public class DataCenterRest { |
|
|
|
A d=new A(); |
|
|
|
String url ="https://wms.yxtsoft.com/apiv1/external/apiadmin/warehouseinfo/list"; |
|
|
|
RestTemplate restTemplate = new RestTemplate(); |
|
|
|
ResponseEntity<String> forEntity = restTemplate.getForEntity(url,String.class); |
|
|
|
Map<String, Object> sendBodyMM = new HashMap<>(); |
|
|
|
sendBodyMM.put("engTime",format); |
|
|
|
sendBodyMM.put("orgPath","0d19bc72-9370-45d3-bfda-5662eab34e4b"); |
|
|
|
ResponseEntity<String> forEntity = restTemplate.postForEntity(url,sendBodyMM,String.class); |
|
|
|
List<ProjectDetailsVo> vos= d.getList(forEntity,ProjectDetailsVo.class); |
|
|
|
BigDecimal dkzc=new BigDecimal(0); |
|
|
|
Integer dkzcCount =0; |
|
|
@ -730,31 +747,143 @@ public class DataCenterRest { |
|
|
|
dto.setZtzCount(ztzCount); |
|
|
|
dto.setOrderDate(new Date()); |
|
|
|
dto.setEnterpriseSid("0d19bc72-9370-45d3-bfda-5662eab34e4b"); |
|
|
|
projectShGmFeign.save(dto); |
|
|
|
} |
|
|
|
|
|
|
|
@ApiOperation("dingshi") |
|
|
|
@GetMapping("/rr1") |
|
|
|
public void rr(@RequestParam("orderDate")String orderDate){ |
|
|
|
//山海系统
|
|
|
|
String a ="63_17_0_2069_1,63_17_0_2048_1,63_17_0_2049_1,63_17_0_2070_1,63_17_0_2073_1,63_17_0_2075_1,63_17_0_2078_1,63_17_0_2080_1,63_17_0_2087_1,63_17_0_2090_1"; |
|
|
|
List<String> list=new ArrayList<>(); |
|
|
|
// SimpleDateFormat sdf=new SimpleDateFormat("yyyy-MM-dd");
|
|
|
|
// String format = sdf.format(new Date());
|
|
|
|
list.add("2000-01-01"); |
|
|
|
list.add(orderDate); |
|
|
|
IndexQuery query =new IndexQuery(); |
|
|
|
query.setPage("1"); |
|
|
|
query.setLimit("1000"); |
|
|
|
query.setOrder_type("10"); |
|
|
|
query.setSearch_time(list.stream().toArray(String []::new)); |
|
|
|
BigDecimal ztz=new BigDecimal(0); |
|
|
|
Integer ztzCount =0; |
|
|
|
for (String s : a.split(",")) { |
|
|
|
query.setWorkflow(s); |
|
|
|
BaseResponse<BaseResponseListObj<OrderIndexVo>> vos=ShRequester.getsystem$order$index(query); |
|
|
|
List<OrderIndexVo > c =vos.getData().getList(); |
|
|
|
for (OrderIndexVo orderIndexVo : c) { |
|
|
|
String d=""; |
|
|
|
if(orderIndexVo.getAll_power().substring(orderIndexVo.getAll_power().length()-2).equals("MW")){ |
|
|
|
d =orderIndexVo.getAll_power().replace("MW",""); |
|
|
|
BigDecimal bigDecimal=new BigDecimal(d); |
|
|
|
bigDecimal=bigDecimal.multiply(new BigDecimal(1000000)); |
|
|
|
bigDecimal=bigDecimal.multiply(new BigDecimal(3)); |
|
|
|
ztz=ztz.add(bigDecimal); |
|
|
|
}else if(orderIndexVo.getAll_power().substring(orderIndexVo.getAll_power().length()-2).equals("KW")){ |
|
|
|
d =orderIndexVo.getAll_power().replace("KW",""); |
|
|
|
BigDecimal bigDecimal=new BigDecimal(d); |
|
|
|
bigDecimal=bigDecimal.multiply(new BigDecimal(1000)); |
|
|
|
bigDecimal=bigDecimal.multiply(new BigDecimal(3)); |
|
|
|
ztz=ztz.add(bigDecimal); |
|
|
|
} |
|
|
|
} |
|
|
|
ztzCount=ztzCount+vos.getData().getCount(); |
|
|
|
} |
|
|
|
//商享通
|
|
|
|
A d=new A(); |
|
|
|
String url ="https://wms.yxtsoft.com/apiv1/external/apiadmin/warehouseinfo/list"; |
|
|
|
RestTemplate restTemplate = new RestTemplate(); |
|
|
|
Map<String, Object> sendBodyMM = new HashMap<>(); |
|
|
|
sendBodyMM.put("engTime",orderDate); |
|
|
|
ResponseEntity<String> forEntity = restTemplate.postForEntity(url,sendBodyMM,String.class); |
|
|
|
List<ProjectDetailsVo> vos= d.getList(forEntity,ProjectDetailsVo.class); |
|
|
|
BigDecimal dkzc=new BigDecimal(0); |
|
|
|
Integer dkzcCount =0; |
|
|
|
for (ProjectDetailsVo orderIndexVo : vos) { |
|
|
|
String g=""; |
|
|
|
if(orderIndexVo.getSquareMeter().substring(orderIndexVo.getSquareMeter().length()-2).equals("MW")){ |
|
|
|
g =orderIndexVo.getSquareMeter().replace("MW",""); |
|
|
|
BigDecimal bigDecimal=new BigDecimal(g); |
|
|
|
bigDecimal=bigDecimal.multiply(new BigDecimal(1000000)); |
|
|
|
bigDecimal=bigDecimal.multiply(new BigDecimal(1)); |
|
|
|
dkzc=dkzc.add(bigDecimal); |
|
|
|
}else if(orderIndexVo.getSquareMeter().substring(orderIndexVo.getSquareMeter().length()-2).equals("KW")){ |
|
|
|
g =orderIndexVo.getSquareMeter().replace("KW",""); |
|
|
|
BigDecimal bigDecimal=new BigDecimal(g); |
|
|
|
bigDecimal=bigDecimal.multiply(new BigDecimal(1000)); |
|
|
|
bigDecimal=bigDecimal.multiply(new BigDecimal(1)); |
|
|
|
dkzc=dkzc.add(bigDecimal); |
|
|
|
}else{ |
|
|
|
// g =orderIndexVo.getSquareMeter().replace("MW","");
|
|
|
|
BigDecimal bigDecimal=new BigDecimal(g); |
|
|
|
bigDecimal=bigDecimal.multiply(new BigDecimal(1000000)); |
|
|
|
bigDecimal=bigDecimal.multiply(new BigDecimal(1)); |
|
|
|
dkzc=dkzc.add(bigDecimal); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
dkzcCount=dkzcCount+vos.size(); |
|
|
|
ProjectShGmDto dto=new ProjectShGmDto(); |
|
|
|
dto.setDkzc(dkzc); |
|
|
|
dto.setZtz(ztz); |
|
|
|
dto.setDkzcCount(dkzcCount); |
|
|
|
dto.setZtzCount(ztzCount); |
|
|
|
dto.setOrderDate(DateUtil.parse(orderDate)); |
|
|
|
dto.setEnterpriseSid("0d19bc72-9370-45d3-bfda-5662eab34e4b"); |
|
|
|
projectShGmFeign.save(dto); |
|
|
|
} |
|
|
|
@ApiOperation("获取客户") |
|
|
|
@PostMapping("/getSuppliserInfo") |
|
|
|
public ResultBean getSuppliserInfo(@RequestBody DataCenterQuery query){ |
|
|
|
public Object getSuppliserInfo(@RequestBody PagerQuery<DataCenterQuery> pq){ |
|
|
|
ResultBean rb=new ResultBean(); |
|
|
|
A c =new A(); |
|
|
|
List<ProjectInfo> projectInfo=crmMapper.getEnterByProjetSid(pq.getParams().getProjectSid()); |
|
|
|
Map<String,Object> sendBodyMM=new HashMap<>(); |
|
|
|
Map<String, Object> sendBody = new HashMap<>(); |
|
|
|
sendBodyMM.put("current",pq.getCurrent()); |
|
|
|
sendBodyMM.put("size",pq.getSize()); |
|
|
|
sendBody.put("orgPath",projectInfo.get(0).getEnterpriseSid()); |
|
|
|
sendBodyMM.put("params",sendBody); |
|
|
|
RestTemplate restTemplate = new RestTemplate(); |
|
|
|
List<ProjectInfo> projectInfo=crmMapper.getEnterByProjetSid(query.getProjectSid()); |
|
|
|
ResponseEntity<String> forEntity1 = restTemplate.getForEntity("https://wms.yxtsoft.com/apiv1/external/apiadmin/supplierinfo/getSupplierCountByOrgSid?orgSid="+projectInfo.get(0).getEnterpriseSid(),String.class); |
|
|
|
ResponseEntity<String> forEntity1 = restTemplate.postForEntity("https://wms.yxtsoft.com/apiv1/external/apiadmin/supplierinfo/listPage1",sendBodyMM,String.class); |
|
|
|
// ResponseEntity<String> forEntity1 = restTemplate.getForEntity("http://192.168.0.105:6023/apiadmin/supplierinfo/getSupplierCountByOrgSid?orgSid="+projectInfo.get(0).getEnterpriseSid(),String.class);
|
|
|
|
List<SupplierInfoVo> supplierInfoVo = c.getList(forEntity1, SupplierInfoVo.class); |
|
|
|
return rb.success().setData(supplierInfoVo); |
|
|
|
// List<SupplierInfoVo> supplierInfoVo = c.getList(forEntity1, SupplierInfoVo.class);
|
|
|
|
return forEntity1.getBody(); |
|
|
|
} |
|
|
|
@ApiOperation("获取供应商") |
|
|
|
@PostMapping("/getCustomerInfo") |
|
|
|
public ResultBean getCustomerInfo(@RequestBody DataCenterQuery query){ |
|
|
|
public Object getCustomerInfo(@RequestBody PagerQuery<DataCenterQuery> pq){ |
|
|
|
ResultBean rb=new ResultBean(); |
|
|
|
A c =new A(); |
|
|
|
RestTemplate restTemplate = new RestTemplate(); |
|
|
|
List<ProjectInfo> projectInfo=crmMapper.getEnterByProjetSid(query.getProjectSid()); |
|
|
|
ResponseEntity<String> forEntity = restTemplate.getForEntity("https://wms.yxtsoft.com/apiv1/external/v1/crmcustomertemp/getCustomerByOrgSid?orgSid="+projectInfo.get(0).getEnterpriseSid(),String.class); |
|
|
|
List<ProjectInfo> projectInfo=crmMapper.getEnterByProjetSid(pq.getParams().getProjectSid()); |
|
|
|
Map<String,Object> sendBodyMM=new HashMap<>(); |
|
|
|
Map<String, Object> sendBody = new HashMap<>(); |
|
|
|
sendBodyMM.put("current",pq.getCurrent()); |
|
|
|
sendBodyMM.put("size",pq.getSize()); |
|
|
|
sendBody.put("orgPath",projectInfo.get(0).getEnterpriseSid()); |
|
|
|
sendBodyMM.put("params",sendBody); |
|
|
|
ResponseEntity<String> forEntity = restTemplate.postForEntity("https://wms.yxtsoft.com/apiv1/external/v1/crmcustomertemp/listPage1",sendBodyMM,String.class); |
|
|
|
// ResponseEntity<String> forEntity1 = restTemplate.getForEntity("http://192.168.0.105:6023/apiadmin/supplierinfo/getSupplierCountByOrgSid?orgSid="+projectInfo.get(0).getEnterpriseSid(),String.class);
|
|
|
|
List<CrmCustomerTempVo> jsonObject = c.getList(forEntity,CrmCustomerTempVo.class); |
|
|
|
return rb.success().setData(jsonObject); |
|
|
|
// List<CrmCustomerTempVo> jsonObject = c.getList(forEntity,CrmCustomerTempVo.class);
|
|
|
|
System.out.println(forEntity); |
|
|
|
return forEntity.getBody(); |
|
|
|
} |
|
|
|
@ApiOperation("项目报告") |
|
|
|
@PostMapping("/getProjectReportByNode") |
|
|
|
public ResultBean getProjectReportByNode(@RequestBody PagerQuery<DataCenterQuery> pq){ |
|
|
|
ResultBean rb=new ResultBean(); |
|
|
|
DataCenterQuery query=pq.getParams(); |
|
|
|
QueryWrapper<ProjectRecordVo> qw = new QueryWrapper<>(); |
|
|
|
Map<String,Object> map=new HashMap<>(); |
|
|
|
// ProjectInfo projectInfo=crmMapper.getProject(query.getProjectSid());
|
|
|
|
List<ProjectInfo> projectInfo=crmMapper.getEnterByProjetSid(query.getProjectSid()); |
|
|
|
qw.eq("a.enterpriseSid",projectInfo.get(0).getEnterpriseSid()); |
|
|
|
qw.eq("d.nodeValue",query.getNodeValue()); |
|
|
|
qw.apply("url is not null"); |
|
|
|
IPage<ProjectRecordVo> page = PagerUtil.queryToPage(pq); |
|
|
|
IPage<ProjectRecordVo> pagging = crmMapper.getPhaseFiles(page, qw); |
|
|
|
|
|
|
|
return rb.success().setData(pagging); |
|
|
|
} |
|
|
|
} |
|
|
|