Browse Source

修复 工单bug

weiximei 6 years ago
parent
commit
036555e3d4

+ 27
- 1
CODE/smart-community/app-api/src/main/java/com/community/huiju/common/hk/test/OpenapiTest.java View File

180
         
180
         
181
         return data;
181
         return data;
182
 	}
182
 	}
183
-	
183
+
184
+
185
+
186
+	/**
187
+	 * HTTPS方式
188
+	 * 分页获取监控点信息 测试
189
+	 * @return
190
+	 * @throws Exception
191
+	 */
192
+	private static String testGetDoorEventsHistory() throws Exception{
193
+		String url = OPENAPI_IP_PORT_HTTPS + "/openapi/service/acs/event/getDoorEventsHistory";
194
+		Map<String, Object> map = new HashMap<String, Object>();
195
+		map.put("appkey", APPKEY);//设置APPKEY
196
+		map.put("time", System.currentTimeMillis());//设置时间参数
197
+		map.put("pageNo", 1);//设置分页参数
198
+		map.put("pageSize", 5);//设置分页参数
199
+		map.put("opUserUuid", OP_USER_UUID);//设置操作用户UUID
200
+		String params = JSON.toJSONString(map);
201
+		System.out.println(" ====== getCameras请求参数:【" + params + "】");
202
+		String data = HttpClientSSLUtils.doPost(url + "?token=" + Digests.buildToken(url + "?" + params, null, SECRET), params);
203
+		System.out.println(" ====== getCameras请求返回结果:【{" + data + "}】");
204
+
205
+		return data;
206
+	}
207
+
208
+
209
+
184
 }
210
 }

+ 10
- 6
CODE/smart-community/app-api/src/main/java/com/community/huiju/service/impl/SocialServiceImpl.java View File

11
 import com.github.pagehelper.PageHelper;
11
 import com.github.pagehelper.PageHelper;
12
 import com.google.common.collect.Maps;
12
 import com.google.common.collect.Maps;
13
 import com.sun.org.apache.bcel.internal.generic.NEW;
13
 import com.sun.org.apache.bcel.internal.generic.NEW;
14
+import org.springframework.beans.BeanUtils;
14
 import org.springframework.beans.factory.annotation.Autowired;
15
 import org.springframework.beans.factory.annotation.Autowired;
15
 import org.springframework.stereotype.Service;
16
 import org.springframework.stereotype.Service;
16
 import org.springframework.transaction.annotation.Transactional;
17
 import org.springframework.transaction.annotation.Transactional;
386
     public ResponseBean updateTransaction(String paramets,Integer userId,Integer id) {
387
     public ResponseBean updateTransaction(String paramets,Integer userId,Integer id) {
387
         ResponseBean response = new ResponseBean();
388
         ResponseBean response = new ResponseBean();
388
         JSONObject jsonObject = JSONObject.parseObject(paramets);
389
         JSONObject jsonObject = JSONObject.parseObject(paramets);
389
-        String transactionTitle = (String) jsonObject.get("transactionTitle");
390
-        String transactionContent = (String) jsonObject.get("transactionContent");
391
         String imageUrl = (String) jsonObject.get("imageUrl");
390
         String imageUrl = (String) jsonObject.get("imageUrl");
391
+
392
         TpTransaction tpTransaction = JSONObject.parseObject(paramets, TpTransaction.class);
392
         TpTransaction tpTransaction = JSONObject.parseObject(paramets, TpTransaction.class);
393
-        TpTransaction taUser = tpTransactionMapper.getById(id);
394
-        if (null != taUser && userId.equals(taUser.getTaUserId())) {
393
+        TpTransaction transaction = tpTransactionMapper.getById(id);
394
+        transaction.setTransactionTitle(tpTransaction.getTransactionTitle());
395
+        transaction.setTransactionContent(tpTransaction.getTransactionContent());
396
+
397
+
398
+        if (null != transaction && userId.equals(transaction.getTaUserId())) {
395
             tdImagesMapper.deleteTdImages(Integer.valueOf(id), Constant.TRANSACTION);
399
             tdImagesMapper.deleteTdImages(Integer.valueOf(id), Constant.TRANSACTION);
396
             try {
400
             try {
397
-                insertTdImage(tpTransaction, imageUrl, userId, Constant.TRANSACTION);
401
+                insertTdImage(transaction, imageUrl, userId, Constant.TRANSACTION);
398
             } catch (IOException e) {
402
             } catch (IOException e) {
399
                 e.printStackTrace();
403
                 e.printStackTrace();
400
                 throw new RuntimeException("图片修改异常");
404
                 throw new RuntimeException("图片修改异常");
401
             }
405
             }
402
-            tpTransactionMapper.updateTransaction(Integer.valueOf(id), transactionTitle, transactionContent, userId);
406
+            tpTransactionMapper.updateTransaction(Integer.valueOf(id), transaction.getTransactionTitle(), transaction.getTransactionContent(), userId);
403
             response.addSuccess("修改成功");
407
             response.addSuccess("修改成功");
404
             return response;
408
             return response;
405
 
409
 

+ 2
- 0
CODE/smart-community/app-api/src/main/resources/mapper/TpTicketMapper.xml View File

214
     <include refid="Base_Column_List" />
214
     <include refid="Base_Column_List" />
215
     from tp_ticket
215
     from tp_ticket
216
       <trim prefix="where" prefixOverrides="and">
216
       <trim prefix="where" prefixOverrides="and">
217
+        and status = 1
217
         <if test="communityId != null" >
218
         <if test="communityId != null" >
218
           and community_id = #{communityId,jdbcType=INTEGER}
219
           and community_id = #{communityId,jdbcType=INTEGER}
219
         </if>
220
         </if>
246
     WHERE
247
     WHERE
247
         t.id = #{ticketId,jdbcType=INTEGER}
248
         t.id = #{ticketId,jdbcType=INTEGER}
248
         AND t.community_id = #{communityId,jdbcType=INTEGER}
249
         AND t.community_id = #{communityId,jdbcType=INTEGER}
250
+        and status = 1
249
   </select>
251
   </select>
250
 </mapper>
252
 </mapper>

+ 2
- 0
CODE/smart-community/app-api/src/main/resources/mapper/TpTransactionMapper.xml View File

204
     <if test="transactionTitle != null and transactionTitle !=''">
204
     <if test="transactionTitle != null and transactionTitle !=''">
205
       and transaction_title LIKE concat('%',#{transactionTitle,jdbcType=VARCHAR},'%')
205
       and transaction_title LIKE concat('%',#{transactionTitle,jdbcType=VARCHAR},'%')
206
     </if>
206
     </if>
207
+    and status = 1
207
     order by create_date DESC
208
     order by create_date DESC
208
   </select>
209
   </select>
209
 
210
 
216
     <if test="type != null and type != ''">
217
     <if test="type != null and type != ''">
217
       and type = #{type,jdbcType=INTEGER}
218
       and type = #{type,jdbcType=INTEGER}
218
     </if>
219
     </if>
220
+    and status = 1
219
     order by create_date DESC
221
     order by create_date DESC
220
   </select>
222
   </select>
221
 
223