瀏覽代碼

药剂、安全管理

gaodd 1 年之前
父節點
當前提交
e2ce6fc5fe

+ 2 - 0
src/main/java/com/chinaitop/depot/business/mapper/BusinessDrugStandingBookMapper.java

@@ -62,4 +62,6 @@ public interface BusinessDrugStandingBookMapper {
62 62
 
63 63
 	List<Map<String, Object>> getAllDataList(Map<String, Object> map);
64 64
 
65
+	Map<String, Object> getYjGjjDate(Integer id);
66
+
65 67
 }

+ 43 - 2
src/main/java/com/chinaitop/depot/business/mapper/BusinessDrugStandingBookMapper.xml

@@ -121,7 +121,7 @@
121 121
       <include refid="Example_Where_Clause" />
122 122
     </if>
123 123
   </delete>
124
-  <insert id="insert" parameterType="com.chinaitop.depot.business.model.BusinessDrugStandingBook" >
124
+  <insert id="insert" parameterType="com.chinaitop.depot.business.model.BusinessDrugStandingBook" useGeneratedKeys="true" keyProperty="id">
125 125
     insert into business_drug_standing_book (id, type, drug_info_id,
126 126
       drug_number, drug_kind, drug_name, 
127 127
       drug_type, drug_packing, drug_specification, 
@@ -139,7 +139,7 @@
139 139
       #{isLastShelfData,jdbcType=INTEGER}, #{createTime,jdbcType=TIMESTAMP}, #{orgId,jdbcType=INTEGER}, 
140 140
       #{drugRestoreId,jdbcType=INTEGER}, #{updatetime,jdbcType=TIMESTAMP}, #{drugSpecificationUnit,jdbcType=INTEGER})
141 141
   </insert>
142
-  <insert id="insertSelective" parameterType="com.chinaitop.depot.business.model.BusinessDrugStandingBook" >
142
+  <insert id="insertSelective" parameterType="com.chinaitop.depot.business.model.BusinessDrugStandingBook" useGeneratedKeys="true" keyProperty="id">
143 143
     insert into business_drug_standing_book
144 144
     <trim prefix="(" suffix=")" suffixOverrides="," >
145 145
         id,
@@ -928,4 +928,45 @@ select
928 928
 		ORDER by drugkind
929 929
   </select>
930 930
   
931
+  <select id="getYjGjjDate" parameterType="java.lang.Integer" resultType="java.util.Map">
932
+  		select
933
+		d.drug_number id,
934
+		a.id sj_id,
935
+		b.kqbm||'0'||substr(d.drug_number, length(d.drug_number)-1, 2) yjbh	,
936
+		b.kqbm kqdm	,
937
+		b.tykqbm tykqbm,
938
+		b.credit_code dwdm	,
939
+		b.org_name kqmc	,
940
+		e1.enumname yjmc	,
941
+		case d.drug_packing when '5509' then '1' when '5511' then '2' else '3' end bzw	   , 
942
+		d.drug_specification||(case d.drug_unit when '5505' then 'L' when '5507' then 'kg' end) ggxh	,
943
+		d.aqsysms aqsysms, 
944
+		a.manufacturer sccj	,
945
+		c.cgly cgly	,
946
+		d.cctj cctj	,
947
+		d.ccdd ccdd	,
948
+		d.bzwclfs bzwclfs, 
949
+		d.syhclfs czclfs	,
950
+		TIMESTAMPDIFF(DAY, DATE_FORMAT(c.production_date,'%Y-%m-%d'), DATE_FORMAT(c.expire_date,'%Y-%m-%d')) AS bzq, 
951
+		DATE_FORMAT(c.create_time,'%Y-%m-%d') cgrq	,
952
+		case a.drug_specification_unit when '5505' then CAST(a.amount AS DECIMAL(20,3))*1000 else CAST(a.amount AS DECIMAL) end kcsl,
953
+		case a.drug_specification_unit when '5505' then '3' else '1' end kcsldw,  
954
+		DATE_FORMAT(a.updatetime, '%Y-%m-%d %H:%i:%s') zhgxsj   
955
+		from business_drug_standing_book a
956
+		left join org_info b on b.org_id=a.org_id
957
+		left join business_drug_info d on d.id=a.drug_info_id
958
+		left join (
959
+		  select * from (
960
+		    select 
961
+		      id drug_storage_id, drug_info_id, manufacturer, 
962
+		      row_number() over(partition by drug_info_id, manufacturer order by id desc) nums 
963
+		    from business_drug_storage where 1=1
964
+		  )  s
965
+		  where s.nums=1
966
+		) f on f.drug_info_id=a.drug_info_id and f.manufacturer=a.manufacturer
967
+		left join business_drug_storage c on c.id=f.drug_storage_id
968
+		left join basic_enum e1 on e1.enumid=d.drug_name
969
+		where a.is_last_shelf_data=1 and a.amount>0 and a.id = #{id};
970
+
971
+  </select>
931 972
 </mapper>

+ 62 - 0
src/main/java/com/chinaitop/depot/business/service/impl/BusinessDrugStandingBookServiceImpl.java

@@ -4,12 +4,19 @@ import com.chinaitop.depot.business.mapper.BusinessDrugStandingBookMapper;
4 4
 import com.chinaitop.depot.business.model.*;
5 5
 import com.chinaitop.depot.business.service.BusinessDrugStandingBookService;
6 6
 import com.chinaitop.depot.utils.ParameterUtil;
7
+import com.fasterxml.jackson.core.JsonProcessingException;
8
+import com.fasterxml.jackson.databind.ObjectMapper;
7 9
 import com.github.pagehelper.PageHelper;
8 10
 import org.apache.commons.lang.StringUtils;
9 11
 import org.springframework.beans.factory.annotation.Autowired;
12
+import org.springframework.context.annotation.Bean;
10 13
 import org.springframework.stereotype.Service;
11 14
 import org.springframework.transaction.annotation.Transactional;
15
+import org.springframework.util.LinkedMultiValueMap;
16
+import org.springframework.util.MultiValueMap;
17
+import org.springframework.web.client.RestTemplate;
12 18
 
19
+import javax.annotation.Resource;
13 20
 import javax.servlet.http.HttpServletRequest;
14 21
 import java.math.BigDecimal;
15 22
 import java.util.ArrayList;
@@ -35,6 +42,14 @@ public class BusinessDrugStandingBookServiceImpl implements BusinessDrugStanding
35 42
 
36 43
     @Autowired
37 44
     private BusinessDrugStandingBookMapper drugStandingBookMapper;
45
+    
46
+    @Resource
47
+    private RestTemplate restTemplate;
48
+
49
+    @Bean
50
+    public RestTemplate restTemplate() {
51
+        return new RestTemplate();
52
+    }
38 53
 
39 54
     /**
40 55
      * 入库新增台账数据.
@@ -94,6 +109,7 @@ public class BusinessDrugStandingBookServiceImpl implements BusinessDrugStanding
94 109
             drugStandingBookBefore.setIsLastShelfData(0);
95 110
             drugStandingBookBefore.setUpdatetime(new Date());
96 111
             drugStandingBookMapper.updateByPrimaryKeySelective(drugStandingBookBefore);
112
+            this.gjjjk(drugStandingBook.getId(), drugStandingBook.getOrgId(), "u");
97 113
         } else {
98 114
             // 第一次,两个台账数量都等于入库数量.
99 115
             String new_amount = amount(amount, drugStorage.getStorageCount(), SCALE_ADD);//入库后的最新台账数量
@@ -103,6 +119,8 @@ public class BusinessDrugStandingBookServiceImpl implements BusinessDrugStanding
103 119
         // 新增.
104 120
         drugStandingBook.setUpdatetime(new Date());
105 121
         drugStandingBookMapper.insert(drugStandingBook);
122
+        
123
+        this.gjjjk(drugStandingBook.getId(), drugStandingBook.getOrgId(), "i");
106 124
     }
107 125
 
108 126
     @Override
@@ -171,6 +189,7 @@ public class BusinessDrugStandingBookServiceImpl implements BusinessDrugStanding
171 189
             drugStandingBookBefore.setIsLastShelfData(0);
172 190
             drugStandingBookBefore.setUpdatetime(new Date());
173 191
             drugStandingBookMapper.updateByPrimaryKeySelective(drugStandingBookBefore);
192
+            this.gjjjk(drugStandingBook.getId(), drugStandingBook.getOrgId(), "u");
174 193
         } else {
175 194
             // 第一次.
176 195
             throw new RuntimeException("没有对应的数据可以出库!");
@@ -178,6 +197,7 @@ public class BusinessDrugStandingBookServiceImpl implements BusinessDrugStanding
178 197
         // 新增.
179 198
         drugStandingBook.setUpdatetime(new Date());
180 199
         drugStandingBookMapper.insert(drugStandingBook);
200
+        this.gjjjk(drugStandingBook.getId(), drugStandingBook.getOrgId(), "i");
181 201
     }
182 202
 
183 203
     private String amount(String y_num, String rk_num, String type) {
@@ -322,6 +342,7 @@ public class BusinessDrugStandingBookServiceImpl implements BusinessDrugStanding
322 342
                     drugStandingBookBefore.setIsLastShelfData(0);
323 343
                     drugStandingBookBefore.setUpdatetime(new Date());
324 344
                     drugStandingBookMapper.updateByPrimaryKeySelective(drugStandingBookBefore);
345
+                    this.gjjjk(drugStandingBook.getId(), drugStandingBook.getOrgId(), "u");
325 346
                 }
326 347
 
327 348
             } else if (Double.parseDouble(checkCount) < Double.parseDouble(shelfAmount)) {
@@ -343,6 +364,7 @@ public class BusinessDrugStandingBookServiceImpl implements BusinessDrugStanding
343 364
                     drugStandingBookBefore.setIsLastShelfData(0);
344 365
                     drugStandingBookBefore.setUpdatetime(new Date());
345 366
                     drugStandingBookMapper.updateByPrimaryKeySelective(drugStandingBookBefore);
367
+                    this.gjjjk(drugStandingBook.getId(), drugStandingBook.getOrgId(), "u");
346 368
                 } else {
347 369
                     // 第一次.
348 370
                     throw new RuntimeException("没有对应的数据可以出库!");
@@ -354,6 +376,7 @@ public class BusinessDrugStandingBookServiceImpl implements BusinessDrugStanding
354 376
             // 新增台账.
355 377
             drugStandingBook.setUpdatetime(new Date());
356 378
             drugStandingBookMapper.insert(drugStandingBook);
379
+            this.gjjjk(drugStandingBook.getId(), drugStandingBook.getOrgId(), "i");
357 380
         }
358 381
     }
359 382
 
@@ -436,6 +459,7 @@ public class BusinessDrugStandingBookServiceImpl implements BusinessDrugStanding
436 459
             drugStandingBookBefore.setIsLastShelfData(0);
437 460
             drugStandingBookBefore.setUpdatetime(new Date());
438 461
             drugStandingBookMapper.updateByPrimaryKeySelective(drugStandingBookBefore);
462
+            this.gjjjk(drugStandingBook.getId(), drugStandingBook.getOrgId(), "u");
439 463
         } else {
440 464
             // 第一次.
441 465
             throw new RuntimeException("没有对应的数据可以归还!");
@@ -443,6 +467,7 @@ public class BusinessDrugStandingBookServiceImpl implements BusinessDrugStanding
443 467
         // 新增
444 468
         drugStandingBook.setUpdatetime(new Date());
445 469
         drugStandingBookMapper.insertSelective(drugStandingBook);
470
+        this.gjjjk(drugStandingBook.getId(), drugStandingBook.getOrgId(), "i");
446 471
     }
447 472
 
448 473
     /**
@@ -503,10 +528,14 @@ public class BusinessDrugStandingBookServiceImpl implements BusinessDrugStanding
503 528
             standingBookOld.setIsLastShelfData(0);
504 529
             standingBookOld.setUpdatetime(new Date());
505 530
             drugStandingBookMapper.updateByPrimaryKeySelective(standingBookOld);
531
+            this.gjjjk(drugStandingBook.getId(), drugStandingBook.getOrgId(), "u");
532
+
506 533
 
507 534
             // 新增.
508 535
             drugStandingBook.setUpdatetime(new Date());
509 536
             drugStandingBookMapper.insert(drugStandingBook);
537
+            this.gjjjk(drugStandingBook.getId(), drugStandingBook.getOrgId(), "i");
538
+
510 539
         } else {
511 540
             throw new IllegalArgumentException("没有相应的数据!");
512 541
         }
@@ -682,5 +711,38 @@ public class BusinessDrugStandingBookServiceImpl implements BusinessDrugStanding
682 711
 		
683 712
 		return list;
684 713
 	}
714
+	
715
+	
716
+	/**
717
+	 * 国家局数据
718
+	 */
719
+    public void gjjjk(Integer id, Integer orgId,String czbz) {
720
+        
721
+		Map<String, Object>  gjjMap = drugStandingBookMapper.getYjGjjDate(id);
722
+		gjjMap.put("czbz",czbz);
723
+		gjjMap.put("is_upload", 0);
724
+		String tableName = "ODS_UP_YJXXJK";
725
+		
726
+		/**
727
+         * restTemplate调用
728
+         */
729
+        String url = "http://localhost:9022/recPublish/sendMessage";//
730
+        // 发送post请求,并打印结果,以String类型接收响应结果JSON字符串
731
+        MultiValueMap<String, Object> sendMap = new LinkedMultiValueMap<>();
732
+		//Map<String, Object>  sendMap = new HashMap<String, Object>();
733
+        ObjectMapper objectMapper = new ObjectMapper();
734
+        String jsonMap;
735
+        try {
736
+			 jsonMap = objectMapper.writeValueAsString(gjjMap);
737
+			 sendMap.add("gjjMapJson",jsonMap);
738
+		} catch (JsonProcessingException e) {
739
+			// TODO Auto-generated catch block
740
+			e.printStackTrace();
741
+		}
742
+		sendMap.add("tableName", tableName);
743
+		sendMap.add("orgId",orgId);
744
+
745
+       String result = (String) restTemplate.postForObject(url, sendMap, String.class);
746
+    }
685 747
 
686 748
 }

+ 2 - 0
src/main/java/com/chinaitop/depot/risk/mapper/StorageSafeManageMapper.java

@@ -43,4 +43,6 @@ public interface StorageSafeManageMapper {
43 43
      * @return
44 44
      */
45 45
     Map<String, Object> getBasicEnumObj(Integer enumid);
46
+
47
+	Map<String, Object> getAqglGjjDate(Integer id);
46 48
 }

+ 39 - 0
src/main/java/com/chinaitop/depot/risk/mapper/StorageSafeManageMapper.xml

@@ -628,4 +628,43 @@
628 628
     select enumid,enumcode,gbcode,enumname from basic_enum
629 629
     where enumid = #{enumid,jdbcType=INTEGER}
630 630
   </select>
631
+  
632
+  <select id="getAqglGjjDate" parameterType="java.lang.Integer" resultType="java.util.Map">
633
+  		
634
+	select 
635
+	a.id id,
636
+	b.kqbm kqdm,
637
+	b.tykqbm tykqbm,
638
+	dw.dwdm dwdm,
639
+	e3.enumname || e4.enumname || e5.enumname || a.address dd,
640
+	a.fxdbm,
641
+	a.sbr,
642
+	a.hjbw,
643
+	TRIM(BOTH ' ' FROM REPLACE(REPLACE(a.fxxx, CHAR(13), ''), CHAR(10), '')) fxxx,
644
+	e1.gbcode fxlx,
645
+	e2.gbcode fxfj,
646
+	a.fxglcs,
647
+	TRIM(BOTH ' ' FROM REPLACE(REPLACE(a.yhxx, CHAR(13), ''), CHAR(10), '')) yhxx,
648
+	a.yhpcxx,
649
+	a.yhzgxx,
650
+	a.yhysxx,
651
+	a.sgjbxx,
652
+	a.zgsx,
653
+	a.zrdw,
654
+	a.zrr,
655
+	a.zgysxx,
656
+	a.fxgzjgzrr,
657
+	a.czbz,
658
+	a.zhgxsj
659
+	from storage_safe_manage a 
660
+	left join org_info b on b.org_id=a.org_id
661
+	left join basic_enum e1 on e1.enumid=a.fxlx
662
+	left join basic_enum e2 on e2.enumid=a.fxfj
663
+	left join basic_enum e3 on e3.enumid=b.zc_province
664
+	left join basic_enum e4 on e4.enumid=b.zc_city
665
+	left join basic_enum e5 on e5.enumid=b.zc_county
666
+	left join province_all.biz_unit_info dw on dw.id = b.unit_info_id
667
+	where 1=1 and a.id = #{id};
668
+
669
+  </select>
631 670
 </mapper>

+ 2 - 1
src/main/java/com/chinaitop/depot/risk/mapper/ViolationWarningAlarmMapper.java

@@ -1,6 +1,5 @@
1 1
 package com.chinaitop.depot.risk.mapper;
2 2
 
3
-import com.chinaitop.depot.risk.model.RiskManagement;
4 3
 import com.chinaitop.depot.risk.model.ViolationWarningAlarm;
5 4
 
6 5
 
@@ -19,4 +18,6 @@ public interface ViolationWarningAlarmMapper {
19 18
     ViolationWarningAlarm selectById(Integer id);
20 19
 
21 20
     void updateById(ViolationWarningAlarm riskManagement);
21
+
22
+	Map<String, Object> getWgyjGjjDate(Integer id);
22 23
 }

+ 25 - 0
src/main/java/com/chinaitop/depot/risk/mapper/ViolationWarningAlarmMapper.xml

@@ -127,5 +127,30 @@
127 127
         </set>
128 128
         where id = #{id,jdbcType=INTEGER}
129 129
     </update>
130
+    
131
+    
132
+    <select id="getWgyjGjjDate" parameterType="java.lang.Integer" resultType="java.util.Map">
133
+        
134
+		select 
135
+		a.id id,
136
+		CONCAT(org.kqbm,DATE_FORMAT(a.publish_time, '%Y%m%d'),case LENGTH(id) when '1' then CONCAT(00,id) when '2' then CONCAT(0,id) when '3' then id else SUBSTRING(id,LENGTH(id)-2,LENGTH(id)) end) yjxxdm,
137
+		DATE_FORMAT(a.publish_time, '%Y-%m-%d %H:%i:%s') fbsj,  
138
+		'01' wgztlx,
139
+		substr(org.kqbm, 1,18) qydm,  
140
+		org.tykqbm wgdwtybm,
141
+		offender wgxwr, 
142
+		org.org_name sjkd,  
143
+		'03' wglx,  
144
+		REPLACE(REPLACE(REPLACE(a.detail, char(10), ''), char(13), ''), ' ', '') wgqk,  
145
+		case a.status when '0' then '01' else '02' end czzt,  
146
+		a.dispose_content hxczqk,
147
+		a.disposer hxczr, 
148
+		DATE_FORMAT(a.dispose_time, '%Y-%m-%d %H:%i:%s') hxczsj,  
149
+		a.create_time zhgxsj 
150
+		from storage_pre_violation a
151
+		left join org_info org on org.org_id=a.org_id
152
+		where a.id = #{id};
153
+
154
+    </select>
130 155
 
131 156
 </mapper>

+ 52 - 0
src/main/java/com/chinaitop/depot/risk/service/impl/StorageSafeManageServiceImpl.java

@@ -6,7 +6,14 @@ import com.chinaitop.depot.risk.model.StorageSafeManageExample;
6 6
 import com.chinaitop.depot.risk.model.StorageSafeManageWithBLOBs;
7 7
 import com.chinaitop.depot.risk.service.StorageSafeManageService;
8 8
 import com.chinaitop.depot.utils.ParameterUtil;
9
+import com.fasterxml.jackson.core.JsonProcessingException;
10
+import com.fasterxml.jackson.databind.ObjectMapper;
11
+
12
+import org.springframework.context.annotation.Bean;
9 13
 import org.springframework.stereotype.Service;
14
+import org.springframework.util.LinkedMultiValueMap;
15
+import org.springframework.util.MultiValueMap;
16
+import org.springframework.web.client.RestTemplate;
10 17
 
11 18
 import javax.annotation.Resource;
12 19
 import java.util.List;
@@ -20,6 +27,14 @@ public class StorageSafeManageServiceImpl implements StorageSafeManageService {
20 27
     
21 28
     @Resource
22 29
     private BasicFeignClient basicFeignClient;
30
+    
31
+    @Resource
32
+    private RestTemplate restTemplate;
33
+
34
+    @Bean
35
+    public RestTemplate restTemplate() {
36
+        return new RestTemplate();
37
+    }
23 38
 
24 39
     @Override
25 40
     public List<StorageSafeManageWithBLOBs> findbyConditions(Integer orgId, Integer fxlx, Integer fxfj) throws Exception {
@@ -63,6 +78,8 @@ public class StorageSafeManageServiceImpl implements StorageSafeManageService {
63 78
             //附件
64 79
             basicFeignClient.updateFile(fileIds, storageSafeManage.getId(),"safeManage");
65 80
             
81
+            this.gjjjk(storageSafeManage.getId(), storageSafeManage.getOrgId(), "u");
82
+            
66 83
         } else {
67 84
         	//新增
68 85
             //String uuid = UUID.randomUUID().toString().replace("-", "");
@@ -79,6 +96,7 @@ public class StorageSafeManageServiceImpl implements StorageSafeManageService {
79 96
             storageSafeManageMapper.insert(storageSafeManage);
80 97
             //附件
81 98
             basicFeignClient.updateFile(fileIds, id,"safeManage");
99
+            this.gjjjk(id, storageSafeManage.getOrgId(), "i");
82 100
         }
83 101
        
84 102
     }
@@ -86,6 +104,8 @@ public class StorageSafeManageServiceImpl implements StorageSafeManageService {
86 104
     @Override
87 105
     public void deleteById(String id) throws Exception {
88 106
         storageSafeManageMapper.deleteByPrimaryKey(id);
107
+        this.gjjjk(Integer.valueOf(id), Integer.valueOf(id), "d");
108
+
89 109
     }
90 110
 
91 111
     /**
@@ -111,4 +131,36 @@ public class StorageSafeManageServiceImpl implements StorageSafeManageService {
111 131
 
112 132
         return fxdbm;
113 133
     }
134
+    
135
+    /**
136
+   	 * 国家局数据
137
+   	 */
138
+       public void gjjjk(Integer id, Integer orgId,String czbz) {
139
+           
140
+   		Map<String, Object>  gjjMap = storageSafeManageMapper.getAqglGjjDate(id);
141
+   		gjjMap.put("czbz",czbz);
142
+   		gjjMap.put("is_upload", 0);
143
+   		String tableName = "ODS_UP_AQGLXXJK";
144
+   		
145
+   		/**
146
+            * restTemplate调用
147
+            */
148
+           String url = "http://localhost:9022/recPublish/sendMessage";//
149
+           // 发送post请求,并打印结果,以String类型接收响应结果JSON字符串
150
+           MultiValueMap<String, Object> sendMap = new LinkedMultiValueMap<>();
151
+   		//Map<String, Object>  sendMap = new HashMap<String, Object>();
152
+           ObjectMapper objectMapper = new ObjectMapper();
153
+           String jsonMap;
154
+           try {
155
+   			 jsonMap = objectMapper.writeValueAsString(gjjMap);
156
+   			 sendMap.add("gjjMapJson",jsonMap);
157
+   		} catch (JsonProcessingException e) {
158
+   			// TODO Auto-generated catch block
159
+   			e.printStackTrace();
160
+   		}
161
+   		sendMap.add("tableName", tableName);
162
+   		sendMap.add("orgId",orgId);
163
+
164
+          String result = (String) restTemplate.postForObject(url, sendMap, String.class);
165
+       }
114 166
 }

+ 54 - 0
src/main/java/com/chinaitop/depot/risk/service/impl/ViolationWarningAlarmServiceImpl.java

@@ -3,12 +3,22 @@ package com.chinaitop.depot.risk.service.impl;
3 3
 import com.chinaitop.depot.risk.mapper.ViolationWarningAlarmMapper;
4 4
 import com.chinaitop.depot.risk.model.ViolationWarningAlarm;
5 5
 import com.chinaitop.depot.risk.service.ViolationWarningAlarmService;
6
+import com.fasterxml.jackson.core.JsonProcessingException;
7
+import com.fasterxml.jackson.databind.ObjectMapper;
8
+
6 9
 import lombok.RequiredArgsConstructor;
10
+
11
+import org.springframework.context.annotation.Bean;
7 12
 import org.springframework.stereotype.Service;
13
+import org.springframework.util.LinkedMultiValueMap;
14
+import org.springframework.util.MultiValueMap;
15
+import org.springframework.web.client.RestTemplate;
8 16
 
9 17
 import java.util.List;
10 18
 import java.util.Map;
11 19
 
20
+import javax.annotation.Resource;
21
+
12 22
 /**
13 23
  * class
14 24
  *
@@ -20,6 +30,15 @@ import java.util.Map;
20 30
 public class ViolationWarningAlarmServiceImpl implements ViolationWarningAlarmService {
21 31
 
22 32
     private final ViolationWarningAlarmMapper violationWarningAlarmMapper;
33
+    
34
+    @Resource
35
+    private RestTemplate restTemplate;
36
+
37
+    @Bean
38
+    public RestTemplate restTemplate() {
39
+        return new RestTemplate();
40
+    }
41
+    
23 42
     @Override
24 43
     public List<ViolationWarningAlarm> selectListPage(Map<String, Object> queryMap) {
25 44
         return  violationWarningAlarmMapper.selectListPage(queryMap);
@@ -33,5 +52,40 @@ public class ViolationWarningAlarmServiceImpl implements ViolationWarningAlarmSe
33 52
     @Override
34 53
     public void updateDate(ViolationWarningAlarm violationWarningAlarm) {
35 54
         violationWarningAlarmMapper.updateById(violationWarningAlarm);
55
+        this.gjjjk(violationWarningAlarm.getId(), violationWarningAlarm.getOrgId(), "u");
56
+        
36 57
     }
58
+    
59
+    
60
+    /**
61
+   	 * 国家局数据
62
+   	 */
63
+       public void gjjjk(Integer id, Integer orgId,String czbz) {
64
+           
65
+   		Map<String, Object>  gjjMap = violationWarningAlarmMapper.getWgyjGjjDate(id);
66
+   		gjjMap.put("czbz",czbz);
67
+   		gjjMap.put("is_upload", 0);
68
+   		String tableName = "ODS_UP_WGYJXXJK";
69
+   		
70
+   		/**
71
+            * restTemplate调用
72
+            */
73
+           String url = "http://localhost:9022/recPublish/sendMessage";//
74
+           // 发送post请求,并打印结果,以String类型接收响应结果JSON字符串
75
+           MultiValueMap<String, Object> sendMap = new LinkedMultiValueMap<>();
76
+   		//Map<String, Object>  sendMap = new HashMap<String, Object>();
77
+           ObjectMapper objectMapper = new ObjectMapper();
78
+           String jsonMap;
79
+           try {
80
+   			 jsonMap = objectMapper.writeValueAsString(gjjMap);
81
+   			 sendMap.add("gjjMapJson",jsonMap);
82
+   		} catch (JsonProcessingException e) {
83
+   			// TODO Auto-generated catch block
84
+   			e.printStackTrace();
85
+   		}
86
+   		sendMap.add("tableName", tableName);
87
+   		sendMap.add("orgId",orgId);
88
+
89
+          String result = (String) restTemplate.postForObject(url, sendMap, String.class);
90
+       }
37 91
 }