ソースを参照

国家局接口

gaodd 1 年間 前
コミット
e872408563

+ 5 - 0
src/main/java/com/chinaitop/depot/DepotBusinessApplication.java

@@ -14,6 +14,7 @@ import org.springframework.context.annotation.Bean;
14 14
 import org.springframework.context.annotation.ComponentScan;
15 15
 import org.springframework.scheduling.concurrent.ThreadPoolTaskScheduler;
16 16
 import org.springframework.session.data.redis.config.annotation.web.http.EnableRedisHttpSession;
17
+import org.springframework.web.client.RestTemplate;
17 18
 import org.springframework.web.context.support.AnnotationConfigWebApplicationContext;
18 19
 import org.springframework.web.servlet.DispatcherServlet;
19 20
 
@@ -65,5 +66,9 @@ public class DepotBusinessApplication {
65 66
 		return new ThreadPoolTaskScheduler();
66 67
 	}*/
67 68
 	
69
+	@Bean
70
+    public RestTemplate restTemplate() {
71
+        return new RestTemplate();
72
+    }
68 73
 
69 74
 }

+ 0 - 1
src/main/java/com/chinaitop/depot/business/mapper/BusinessContractMapper.java

@@ -121,7 +121,6 @@ public interface BusinessContractMapper {
121 121
     //根据通知单状态查询合同数据
122 122
     List<Map<String,Object>> contractData(Map<String,Object> map);
123 123
 
124
-	Map<String, Object> getHtGjjDate(Integer id);
125 124
 
126 125
 	/*List<BusinessContract> getAllContractInfo();*/
127 126
 }

+ 1 - 66
src/main/java/com/chinaitop/depot/business/mapper/BusinessContractMapper.xml

@@ -1275,70 +1275,5 @@
1275 1275
     from business_contract contract 
1276 1276
   </select> -->
1277 1277
   
1278
-  <select id="getHtGjjDate" parameterType="java.lang.Integer" resultType="java.util.Map">
1279
-  		select 
1280
-		a.id id,
1281
-		substr(org.kqbm, 1,18)||a.contract_number hth,
1282
-		a.contract_title htmc,
1283
-		substr(org.kqbm, 1,18) dwdm,
1284
-		case when a.contract_type='3147' or a.contract_type='7130' then '2' when a.contract_type='3148' or a.contract_type='7131' then '1' end ywlx, 
1285
-		case customer.classify when '3152' then '2' when '3153' then '1' else '2' end khlx, 
1286
-		case customer.classify when '3152' then '' when '3153' then customer.social_credit_code end khtyshxydm, 
1287
-		ifnull(customer.name, '检测客户') khmc, -- 7.客户名称,--Y
1288
-		case customer.classify when '3152' then customer.name when '3153' then customer.legal_person else '检测者' end fddbr, 
1289
-		e1.enumname || customer.address txdz,
1290
-		customer.yzbm yzbm, 
1291
-		customer.linkman lxrxm, 
1292
-		case customer.classify when '3152' then customer.mobile when '3153' then customer.enterprise_phone end lxrdh, 
1293
-		upper(customer.lxrsfzh) sfzh, 
1294
-		customer.email dzyx, 
1295
-		DATE_FORMAT(a.signing_time, '%Y-%m-%d') qdrq, 
1296
-		DATE_FORMAT(a.disable_date, '%Y-%m-%d') ydwcsj, 
1297
-		a.qddd qddd, 
1298
-		e2.gbcode lspzdm, 
1299
-		e3.gbcode lsxzdm, 
1300
-		case when a.contract_type='3147' or a.contract_type='7130' then ifnull(b.in_price, '1') when a.contract_type='3148' or a.contract_type='7131' then ifnull(b.out_price, '1') else '1' end htdj, 
1301
-		case when a.contract_type='3147' or a.contract_type='7130' then ifnull(b.in_count,'1') when a.contract_type='3148' or a.contract_type='7131' then ifnull(b.out_count,'1') else '1' end ydgxlssl,
1302
-		case when a.contract_type='3147' or a.contract_type='7130' then ifnull(b.in_detail_total_price, '1') when a.contract_type='3148' or a.contract_type='7131' then ifnull(b.out_detail_total_price, '1') else '1' end htzje,
1303
-		a.lybzj lybzj, 
1304
-		'' sswcsj, 
1305
-		'' Lysl, 
1306
-		'' Lyl, 
1307
-		'' Jsjg, 
1308
-		'' Jszje, 
1309
-		'1' jsyhtyzx, 
1310
-		'' jsyhtbyzyy, 
1311
-		e4.gbcode khfkhh, 
1312
-		customer.account_number khfzh, 
1313
-		a.khqyr khqyr, 
1314
-		ifnull(e5.gbcode, '999') bfkhh, 
1315
-		ifnull(a.bfzh, '00000000000') bfzh, 
1316
-		a.signing_man bfqyr, 
1317
-		'' shr, 
1318
-		DATE_FORMAT(a.agree_time, '%Y-%m-%d hh:mm:ss') shsj, 
1319
-		case when a.in_application='2' or a.in_application='3' then ifnull(DATE_FORMAT(a.disable_date, '%Y-%m-%d'), null)  else null end wcrq, 
1320
-		DATE_FORMAT(a.updatetime, '%Y-%m-%d hh:mm:ss') zhgxsj 
1321
-		from business_contract a
1322
-		inner join (
1323
-		  select org_id,contract_number,max(create_time) createtime 
1324
-		  from business_contract 
1325
-		  group by org_id,contract_number
1326
-		) x on a.org_id=x.org_id and a.contract_number=x.contract_number and a.create_time=x.createtime
1327
-		left join (
1328
-		  select zid, max(id) id from business_store_ware_detail
1329
-		  where type in ('contract','cblContract')
1330
-		  group by zid
1331
-		) b1 on b1.zid=a.id
1332
-		left join business_store_ware_detail b on b.id=b1.id
1333
-		left join basic_storehouse house on house.storehouse_id=b.house_id
1334
-		left join basic_warehouse ware on ware.warehouse_id=b.warehouse_id
1335
-		left join org_info org on org.org_id=a.org_id
1336
-		left join business_customer customer on customer.id=a.customer_bid
1337
-		left join basic_enum e1 on e1.enumid=customer.county
1338
-		left join basic_enum e2 on e2.enumid=b.grain_kind
1339
-		left join basic_enum e3 on e3.enumid=b.grain_attribute
1340
-		left join basic_enum e4 on e4.enumid=customer.bank_name
1341
-		left join basic_enum e5 on e5.enumname=a.bfkhh
1342
-		where a.audit_state=2 and a.id = #{id}
1343
-  </select>
1278
+  
1344 1279
 </mapper>

+ 10 - 25
src/main/java/com/chinaitop/depot/business/service/impl/BusinessContractServiceImpl.java

@@ -84,11 +84,6 @@ public class BusinessContractServiceImpl implements BusinessContractService {
84 84
     @Resource
85 85
     private RestTemplate restTemplate;
86 86
 
87
-    @Bean
88
-    public RestTemplate restTemplate() {
89
-        return new RestTemplate();
90
-    }
91
-    
92 87
     @Value("${jsgjjsjUrl}")
93 88
     private String jsgjjsjUrl;
94 89
 
@@ -1500,31 +1495,21 @@ public class BusinessContractServiceImpl implements BusinessContractService {
1500 1495
      */
1501 1496
     public void sxtgjjjk(Integer id, Integer orgId, String czbz) {
1502 1497
 
1503
-        Map<String, Object> gjjMap = contractMapper.getHtGjjDate(id);
1504
-        gjjMap.put("czbz", czbz);
1505
-        gjjMap.put("is_upload", 0);
1506
-        String tableName = "ODS_UP_HTXXJK";
1507
-
1508
-        /**
1498
+    	String tableName = "ODS_UP_HTXXJK";
1499
+		/**
1509 1500
          * restTemplate调用
1510 1501
          */
1511
-        // String url = "http://localhost:9022/recPublish/sendMessage";//
1512
-        // 发送post请求,并打印结果,以String类型接收响应结果JSON字符串
1502
+        //String url = "http://localhost:9022/recPublish/sendMessage";//
1503
+        //发送post请求,并打印结果,以String类型接收响应结果JSON字符串
1504
+		
1513 1505
         MultiValueMap<String, Object> sendMap = new LinkedMultiValueMap<>();
1514
-        //Map<String, Object>  sendMap = new HashMap<String, Object>();
1515
-        ObjectMapper objectMapper = new ObjectMapper();
1516
-        String jsonMap;
1517
-        try {
1518
-            jsonMap = objectMapper.writeValueAsString(gjjMap);
1519
-            sendMap.add("gjjMapJson", jsonMap);
1520
-        } catch (JsonProcessingException e) {
1521
-            // TODO Auto-generated catch block
1522
-            e.printStackTrace();
1523
-        }
1524
-        sendMap.add("tableName", tableName);
1525
-        sendMap.add("orgId", orgId);
1506
+		sendMap.add("tableName", tableName);
1507
+		sendMap.add("czbz", czbz);
1508
+		sendMap.add("ywId", id);
1509
+		sendMap.add("orgId", orgId);
1526 1510
 
1527 1511
         restTemplate.postForObject(jsgjjsjUrl, sendMap, String.class);
1512
+        
1528 1513
     }
1529 1514
 
1530 1515
 }