Commit 2fbadc1edd6257ca3c0f78e99bf6f077154b2af7

Authored by 潘钊
2 parents 0a11a033 fc20d76f

Merge branch 'minhang' of http://222.66.0.204:8090/panzhaov5/bsth_control into minhang

src/main/java/com/bsth/controller/oil/CwjyController.java
@@ -12,6 +12,7 @@ import org.springframework.web.bind.annotation.RequestMethod; @@ -12,6 +12,7 @@ import org.springframework.web.bind.annotation.RequestMethod;
12 import org.springframework.web.bind.annotation.RequestParam; 12 import org.springframework.web.bind.annotation.RequestParam;
13 import org.springframework.web.bind.annotation.RestController; 13 import org.springframework.web.bind.annotation.RestController;
14 14
  15 +import com.bsth.common.ResponseCode;
15 import com.bsth.controller.BaseController; 16 import com.bsth.controller.BaseController;
16 import com.bsth.data.BasicData; 17 import com.bsth.data.BasicData;
17 import com.bsth.entity.Line; 18 import com.bsth.entity.Line;
@@ -35,7 +36,16 @@ public class CwjyController extends BaseController<Cwjy, Integer>{ @@ -35,7 +36,16 @@ public class CwjyController extends BaseController<Cwjy, Integer>{
35 t.setNbbm(t.getNbbm().trim().toUpperCase()); 36 t.setNbbm(t.getNbbm().trim().toUpperCase());
36 Line line=BasicData.nbbm2LineMap.get(t.getNbbm()); 37 Line line=BasicData.nbbm2LineMap.get(t.getNbbm());
37 t.setLine(line == null?"" : line.getLineCode()); 38 t.setLine(line == null?"" : line.getLineCode());
38 - return service.save(t); 39 + Map<String, Object> map = new HashMap<>();
  40 + try {
  41 + map=service.save(t);
  42 + }catch (Exception e) {
  43 + // TODO: handle exception
  44 + if(e.getMessage().indexOf("PK_CWJYUK")>0){
  45 + map.put("fage", "存在相同数据,数据已经过滤");
  46 + }
  47 + }
  48 + return map;
39 } 49 }
40 50
41 @RequestMapping(value = "/checkNbbm",method = RequestMethod.GET) 51 @RequestMapping(value = "/checkNbbm",method = RequestMethod.GET)
src/main/java/com/bsth/service/oil/impl/CwjyServiceImpl.java
@@ -393,5 +393,7 @@ public class CwjyServiceImpl extends BaseServiceImpl&lt;Cwjy,Integer&gt; implements Cw @@ -393,5 +393,7 @@ public class CwjyServiceImpl extends BaseServiceImpl&lt;Cwjy,Integer&gt; implements Cw
393 393
394 return cs; 394 return cs;
395 } 395 }
  396 +
  397 +
396 398
397 } 399 }
src/main/resources/static/pages/oil/jyszList.html
@@ -115,7 +115,8 @@ @@ -115,7 +115,8 @@
115 <td>{{obj.xgr}}</td> 115 <td>{{obj.xgr}}</td>
116 <td>{{obj.createDate}}</td> 116 <td>{{obj.createDate}}</td>
117 <td> 117 <td>
118 - <!--<a class="btn btn-sm blue btn-outline" href="edit.html?no={{obj.id}}" data-pjax><i class="fa fa-edit"></i> 编辑</a>--> 118 + <button type="button" class="btn btn-sm blue btn-jyszList"
  119 + data-id="{{obj.id}}">删除</button>
119 </td> 120 </td>
120 </tr> 121 </tr>
121 {{/each}} 122 {{/each}}
@@ -241,9 +242,7 @@ $(function(){ @@ -241,9 +242,7 @@ $(function(){
241 $.each(data.content, function(i, obj) { 242 $.each(data.content, function(i, obj) {
242 obj.createDate = moment(obj.createDate).format("YYYY-MM-DD"); 243 obj.createDate = moment(obj.createDate).format("YYYY-MM-DD");
243 }); 244 });
244 - console.log(data.content);  
245 var bodyHtm = template('jysz_list_temp', {list: data.content}); 245 var bodyHtm = template('jysz_list_temp', {list: data.content});
246 -  
247 $('#datatable_jysz tbody').html(bodyHtm) 246 $('#datatable_jysz tbody').html(bodyHtm)
248 .find('.icheck').iCheck(icheckOptions) 247 .find('.icheck').iCheck(icheckOptions)
249 .on('ifChanged', iCheckChange); 248 .on('ifChanged', iCheckChange);
@@ -252,6 +251,7 @@ $(function(){ @@ -252,6 +251,7 @@ $(function(){
252 initPagination = true; 251 initPagination = true;
253 showPagination(data); 252 showPagination(data);
254 } 253 }
  254 + $('.btn-jyszList').on('click', remJysz);
255 layer.close(i); 255 layer.close(i);
256 }); 256 });
257 } 257 }
@@ -302,9 +302,14 @@ $(function(){ @@ -302,9 +302,14 @@ $(function(){
302 } 302 }
303 }); 303 });
304 } 304 }
305 -  
306 -  
307 //删除 305 //删除
  306 + function remJysz(){
  307 + var id = $(this).data('id');
  308 + removeConfirm('确定要删除选中的数据?', '/cwjy/' + id ,function(){
  309 + $('tr.filter .filter-submit').click();
  310 + });
  311 + }
  312 + /*
308 $('#removeButton').on('click', function(){ 313 $('#removeButton').on('click', function(){
309 if($(this).attr('disabled')) 314 if($(this).attr('disabled'))
310 return; 315 return;
@@ -314,7 +319,7 @@ $(function(){ @@ -314,7 +319,7 @@ $(function(){
314 removeConfirm('确定要删除选中的数据?', '/resource/' + id ,function(){ 319 removeConfirm('确定要删除选中的数据?', '/resource/' + id ,function(){
315 $('tr.filter .filter-submit').click(); 320 $('tr.filter .filter-submit').click();
316 }); 321 });
317 - }); 322 + }); */
318 323
319 324
320 $('#addJysz').on('click', function(){ 325 $('#addJysz').on('click', function(){