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

bug 修复,项目完善

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