提交 38a5fa3e authored 作者: 朱运伟's avatar 朱运伟

bug 修复,项目完善

上级 9f9a10cf
......@@ -21,7 +21,10 @@ import org.springframework.stereotype.Component;
import java.util.Calendar;
import java.util.Iterator;
/***
* 从工程计量与支付系统拉取智慧建设数据
* 定时任务
*/
@Component
@Configuration
@EnableScheduling
......@@ -34,7 +37,7 @@ public class GetZhjsInterfaceData {
private final ZhjsZqzfzsService zhjsZqzfzsService;
private final ZhjsZqzfzsMxService zhjsZqzfzsMxService;
@Scheduled(cron = "59 59 23 ? * *")
@Scheduled(cron = "00 28 17 ? * *")
// @Scheduled(cron = "0/5 * * * * ?")
public void scheduledSaveEvent() throws Exception{
String token = zhjsGcxmService.getTokenData();
......
package com.elephant.framework.galaxy.aroad.module.common.getInterfaceData;
import com.alibaba.fastjson.JSONObject;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.http.ResponseEntity;
import org.springframework.stereotype.Component;
import org.springframework.stereotype.Service;
import org.springframework.web.client.RestTemplate;
@Service
@Component
public class HttpClient {
@Value("${jlzf.url}")
private String jlzf_url;
public String client(String token) {
RestTemplate template = new RestTemplate();
String url = "http://118.24.7.48:8088/updateAccessTokenSysInterfaceEnterprise.action?refreshtoken="+token;
String url = jlzf_url+"/updateAccessTokenSysInterfaceEnterprise.action?refreshtoken="+token;
ResponseEntity<String> response = template.getForEntity(url, String.class);
return response.getBody();
}
public static String callOtherInterface(String propUrl, String token, String createData) {
public String callOtherInterface(String propUrl, String token, String createData) {
RestTemplate rest =new RestTemplate();
String json = "{'createDate':"+createData+"}";
String url = "http://118.24.7.48:8088/"+propUrl+"?access_token="+token+"&key={json}";
String json = "{\"createDate\":\""+createData+"\"}";
String url = jlzf_url+propUrl+"?access_token="+token+"&key="+json;
ResponseEntity<String> res= rest.getForEntity(url,String.class,json);
return res.getBody();
}
......
......@@ -129,6 +129,7 @@ public class ZhjgDckhRwController extends BaseController {
@SysLog("新增督查情况任务表")
@PostMapping
public R save(@RequestBody ZhjgDckhRw zhjgDckhRw) {
zhjgDckhRw.setFkzt("0");
boolean rw = zhjgDckhRwService.save(zhjgDckhRw);
return new R<>(rw);
}
......
......@@ -2,6 +2,8 @@ package com.elephant.framework.galaxy.aroad.module.zhjg.controller;
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.elephant.framework.galaxy.aroad.module.zhjg.entity.ZhjgDckhRw;
import com.elephant.framework.galaxy.aroad.module.zhjg.service.ZhjgDckhRwService;
import com.elephant.framework.galaxy.aroad.response.R;
import com.elephant.framework.galaxy.aroad.module.common.annotation.SysLog;
import com.elephant.framework.galaxy.aroad.module.zhjg.entity.ZhjgDckhRwFk;
......@@ -26,6 +28,7 @@ import java.time.LocalDateTime;
public class ZhjgDckhRwFkController extends BaseController {
private final ZhjgDckhRwFkService zhjgDckhRwFkService;
private final ZhjgDckhRwService zhjgDckhRwService;
/**
* 分页查询
......@@ -60,6 +63,11 @@ public class ZhjgDckhRwFkController extends BaseController {
Integer deptId = SecurityUtils.getUser().getDeptId();
zhjgDckhRwFk.setFkdw(deptId);
zhjgDckhRwFk.setFksj(LocalDateTime.now());
ZhjgDckhRw rw = zhjgDckhRwService.getById(zhjgDckhRwFk.getRwid());
if (rw !=null){
rw.setFkzt("1");
zhjgDckhRwService.updateById(rw);
}
return new R<>(zhjgDckhRwFkService.save(zhjgDckhRwFk));
}
......
......@@ -124,6 +124,10 @@ public class ZhjgDckhRw extends Model<ZhjgDckhRw> {
* 备注信息
*/
private String remarks;
/**
* 反馈状态
*/
private String fkzt;
@TableField(exist = false)
private String[] cydws;
......
......@@ -12,7 +12,11 @@ import com.elephant.framework.galaxy.aroad.module.zhjs.service.ZhjsGcxmService;
import com.elephant.framework.galaxy.aroad.module.zhjs.service.ZhjsTokenService;
import lombok.AllArgsConstructor;
import net.sf.json.JSONObject;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.context.annotation.PropertySource;
import org.springframework.http.ResponseEntity;
import org.springframework.stereotype.Component;
import org.springframework.stereotype.Service;
import org.springframework.web.client.RestTemplate;
......@@ -28,12 +32,16 @@ import java.util.List;
* @date 2019-04-08 18:14:32
*/
@Service
@AllArgsConstructor
@Component
public class ZhjsGcxmServiceImpl extends ServiceImpl<ZhjsGcxmMapper, ZhjsGcxm> implements ZhjsGcxmService {
final ZhjsGcxmMapper zhjsGcxmMapper;
final HttpClient httpClient;
final ZhjsTokenService zhjsTokenService;
@Autowired
private ZhjsGcxmMapper zhjsGcxmMapper;
@Autowired
private HttpClient httpClient;
@Autowired
private ZhjsTokenService zhjsTokenService;
@Value("${jlzf.url}")
private String jlzf_url;
private static String[] citys = new String[]{"济南","青岛","淄博","枣庄","东营","烟台","潍坊","济宁","泰安","威海","日照","滨州","德州","聊城"
,"临沂","菏泽","莱芜"};
......@@ -54,7 +62,7 @@ public class ZhjsGcxmServiceImpl extends ServiceImpl<ZhjsGcxmMapper, ZhjsGcxm> i
JSONObject jsonObject = JSONObject.fromObject(httpClient.client(zhjsToken.getToken()));
if("1".equals(jsonObject.getString("code"))) {
zhjsToken.setToken(JSONObject.fromObject(jsonObject.getString("data")).getString("token"));
zhjsToken.setCreatetime(new java.text.SimpleDateFormat("yyyy-MM-dd hh:mm:ss").format(new Date()));
zhjsToken.setCreatetime(new java.text.SimpleDateFormat("yyyy-MM-dd HH:mm:ss").format(new Date()));
System.out.println(zhjsToken);
zhjsTokenService.setZhjsToken(token, zhjsToken);
System.out.println("更新token成功,值为:"+zhjsToken.getToken());
......@@ -72,7 +80,7 @@ public class ZhjsGcxmServiceImpl extends ServiceImpl<ZhjsGcxmMapper, ZhjsGcxm> i
public String getHzmxByProId(String token, String proId) {
RestTemplate rest =new RestTemplate();
String json = "{'pro_id':'"+proId+"'}";
String url = "http://118.24.7.48:8088/getSummaryListTestInterfaces.action?access_token="+token+"&key={json}";
String url = jlzf_url+"/getSummaryListTestInterfaces.action?access_token="+token+"&key={json}";
ResponseEntity<String> res= rest.getForEntity(url,String.class,json);
return JSONObject.fromObject(res.getBody()).getString("data");
}
......
......@@ -50,12 +50,16 @@ fdfs:
width: 60
height: 60
tracker-list: # tracker地址
- 47.105.47.32:22122
- 47.105.47.32:22122
connect:
host_1: 192.168.7.200
host_2: 192.168.7.210
host_3: 192.168.7.220
port_net: 9300
shape:
url: http://47.105.99.44:8080/sdlkapi/LRS/GetAmapGeometry?geometry=
identify-url: http://47.105.99.44:8080/sdlkapi/LRS/IdentifyM?longitude=
\ No newline at end of file
identify-url: http://47.105.99.44:8080/sdlkapi/LRS/IdentifyM?longitude=
#计量与支付系统拉取数据地址
jlzf:
url: http://118.24.7.48:8088
\ No newline at end of file
......@@ -28,6 +28,7 @@
<result property="updatePerson" column="update_person"/>
<result property="updateTime" column="update_time"/>
<result property="status" column="status"/>
<result property="fkzt" column="fkzt"/>
<result property="delFlag" column="del_flag"/>
<result property="remarks" column="remarks"/>
</resultMap>
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论