正在显示
5 个修改的文件
包含
83 行增加
和
2 行删除
@@ -13,6 +13,7 @@ import com.agent.vo.agent.SecurityDeclarationVo; | @@ -13,6 +13,7 @@ import com.agent.vo.agent.SecurityDeclarationVo; | ||
13 | import com.agent.xml.XmlBuildTask; | 13 | import com.agent.xml.XmlBuildTask; |
14 | import com.framework.core.Servlets; | 14 | import com.framework.core.Servlets; |
15 | import com.framework.mail.MailSenderService; | 15 | import com.framework.mail.MailSenderService; |
16 | +import com.framework.shiro.SessionUtil; | ||
16 | import com.framework.util.MessageKit; | 17 | import com.framework.util.MessageKit; |
17 | import com.framework.util.MessageType; | 18 | import com.framework.util.MessageType; |
18 | import com.framework.util.StringUtils; | 19 | import com.framework.util.StringUtils; |
@@ -23,6 +24,7 @@ import org.apache.shiro.SecurityUtils; | @@ -23,6 +24,7 @@ import org.apache.shiro.SecurityUtils; | ||
23 | import org.springframework.beans.factory.annotation.Autowired; | 24 | import org.springframework.beans.factory.annotation.Autowired; |
24 | import org.springframework.stereotype.Controller; | 25 | import org.springframework.stereotype.Controller; |
25 | import org.springframework.ui.Model; | 26 | import org.springframework.ui.Model; |
27 | +import org.springframework.web.bind.annotation.RequestBody; | ||
26 | import org.springframework.web.bind.annotation.RequestMapping; | 28 | import org.springframework.web.bind.annotation.RequestMapping; |
27 | import org.springframework.web.bind.annotation.ResponseBody; | 29 | import org.springframework.web.bind.annotation.ResponseBody; |
28 | import tools.Tools; | 30 | import tools.Tools; |
@@ -512,6 +514,28 @@ public class SecurityDeclarationController { | @@ -512,6 +514,28 @@ public class SecurityDeclarationController { | ||
512 | return "declaration/edit"; | 514 | return "declaration/edit"; |
513 | } | 515 | } |
514 | 516 | ||
517 | + | ||
518 | + @RequestMapping(value = "/doDelete") | ||
519 | + @ResponseBody | ||
520 | + public ResponseModel doDelete(Long id){ | ||
521 | + | ||
522 | + ResponseModel model = new ResponseModel(); | ||
523 | + | ||
524 | + UserEntity user = SessionUtil.getUser(); | ||
525 | + if (user.getId() == 1){ | ||
526 | + | ||
527 | + if (securityDeclarationService.sdDelete(id)>0){ | ||
528 | + | ||
529 | + model.setStatus(200); | ||
530 | + } | ||
531 | + | ||
532 | + return model; | ||
533 | + }else { | ||
534 | + model.setStatus(201); | ||
535 | + return model; | ||
536 | + } | ||
537 | + } | ||
538 | + | ||
515 | /** | 539 | /** |
516 | * 安检申报修改 | 540 | * 安检申报修改 |
517 | * @param request | 541 | * @param request |
@@ -25,4 +25,10 @@ public interface SDCargoTypeRepository extends PagingAndSortingRepository<SDCarg | @@ -25,4 +25,10 @@ public interface SDCargoTypeRepository extends PagingAndSortingRepository<SDCarg | ||
25 | @Query(value = "delete from SD_CARGO_TYPE where id=?1", nativeQuery = true) | 25 | @Query(value = "delete from SD_CARGO_TYPE where id=?1", nativeQuery = true) |
26 | int deleteAlls(Long waybill); | 26 | int deleteAlls(Long waybill); |
27 | 27 | ||
28 | + @Transactional | ||
29 | + @Modifying | ||
30 | + @Query(value = "delete from SD_CARGO_TYPE where sd_waybill=?1", nativeQuery = true) | ||
31 | + int typeDelete(String waybill); | ||
32 | + | ||
33 | + | ||
28 | } | 34 | } |
@@ -10,6 +10,7 @@ import javax.annotation.Resource; | @@ -10,6 +10,7 @@ import javax.annotation.Resource; | ||
10 | import com.agent.entity.agent.*; | 10 | import com.agent.entity.agent.*; |
11 | import com.agent.repository.system.HzWaybillRepository; | 11 | import com.agent.repository.system.HzWaybillRepository; |
12 | import com.agent.repository.system.SDCargoNameRepository; | 12 | import com.agent.repository.system.SDCargoNameRepository; |
13 | +import com.agent.repository.system.SDCargoTypeRepository; | ||
13 | import com.agent.repository.system.SecurityDeclarationRepository; | 14 | import com.agent.repository.system.SecurityDeclarationRepository; |
14 | import org.springframework.data.domain.Page; | 15 | import org.springframework.data.domain.Page; |
15 | import org.springframework.data.domain.PageRequest; | 16 | import org.springframework.data.domain.PageRequest; |
@@ -132,6 +133,9 @@ public class ManifestService extends BasicService<ManifestEntity> { | @@ -132,6 +133,9 @@ public class ManifestService extends BasicService<ManifestEntity> { | ||
132 | @Resource | 133 | @Resource |
133 | private SDCargoNameRepository sdCargoNameRepository; | 134 | private SDCargoNameRepository sdCargoNameRepository; |
134 | 135 | ||
136 | + @Resource | ||
137 | + private SDCargoTypeRepository sdCargoTypeRepository; | ||
138 | + | ||
135 | /** | 139 | /** |
136 | * 分页查询 | 140 | * 分页查询 |
137 | * | 141 | * |
@@ -228,6 +232,8 @@ public class ManifestService extends BasicService<ManifestEntity> { | @@ -228,6 +232,8 @@ public class ManifestService extends BasicService<ManifestEntity> { | ||
228 | 232 | ||
229 | sdCargoNameRepository.deletes(waybillnomaster); | 233 | sdCargoNameRepository.deletes(waybillnomaster); |
230 | 234 | ||
235 | + sdCargoTypeRepository.typeDelete(waybillnomaster); | ||
236 | + | ||
231 | } | 237 | } |
232 | }catch (Exception e){ | 238 | }catch (Exception e){ |
233 | e.printStackTrace(); | 239 | e.printStackTrace(); |
@@ -3,6 +3,8 @@ package com.agent.service.system; | @@ -3,6 +3,8 @@ package com.agent.service.system; | ||
3 | import com.agent.entity.Constant; | 3 | import com.agent.entity.Constant; |
4 | import com.agent.entity.agent.SecurityDeclarationEntity; | 4 | import com.agent.entity.agent.SecurityDeclarationEntity; |
5 | import com.agent.entity.agent.SecurityManifestEntity; | 5 | import com.agent.entity.agent.SecurityManifestEntity; |
6 | +import com.agent.repository.system.SDCargoNameRepository; | ||
7 | +import com.agent.repository.system.SDCargoTypeRepository; | ||
6 | import com.agent.repository.system.SecurityDeclarationRepository; | 8 | import com.agent.repository.system.SecurityDeclarationRepository; |
7 | import com.agent.repository.system.SecurityManifestRepository; | 9 | import com.agent.repository.system.SecurityManifestRepository; |
8 | import com.agent.service.BasicService; | 10 | import com.agent.service.BasicService; |
@@ -33,6 +35,12 @@ public class SecurityDeclarationService extends BasicService<SecurityManifestEnt | @@ -33,6 +35,12 @@ public class SecurityDeclarationService extends BasicService<SecurityManifestEnt | ||
33 | @Autowired | 35 | @Autowired |
34 | private SecurityManifestRepository securityManifestRepository; | 36 | private SecurityManifestRepository securityManifestRepository; |
35 | 37 | ||
38 | + @Autowired | ||
39 | + private SDCargoTypeRepository sdCargoTypeRepository; | ||
40 | + | ||
41 | + @Autowired | ||
42 | + private SDCargoNameRepository sdCargoNameRepository; | ||
43 | + | ||
36 | /** | 44 | /** |
37 | * 分页查询 | 45 | * 分页查询 |
38 | * | 46 | * |
@@ -141,4 +149,26 @@ public class SecurityDeclarationService extends BasicService<SecurityManifestEnt | @@ -141,4 +149,26 @@ public class SecurityDeclarationService extends BasicService<SecurityManifestEnt | ||
141 | return body; | 149 | return body; |
142 | } | 150 | } |
143 | 151 | ||
152 | + /** | ||
153 | + * 安检删除 | ||
154 | + */ | ||
155 | + public int sdDelete(Long id){ | ||
156 | + | ||
157 | + try { | ||
158 | + SecurityDeclarationEntity one = securityDeclarationRepository.findOne(id); | ||
159 | + | ||
160 | + securityDeclarationRepository.delete(id); | ||
161 | + | ||
162 | + sdCargoNameRepository.deletes(one.getSd_waybill()); | ||
163 | + | ||
164 | + sdCargoTypeRepository.typeDelete(one.getSd_waybill()); | ||
165 | + | ||
166 | + return 1; | ||
167 | + | ||
168 | + }catch (Exception e){ | ||
169 | + return 0; | ||
170 | + } | ||
171 | + | ||
172 | + } | ||
173 | + | ||
144 | } | 174 | } |
@@ -58,6 +58,7 @@ | @@ -58,6 +58,7 @@ | ||
58 | 海关关区:<input id="manifnum" type="text" name="search_EQ_customs" style="width:166px;height:35px;line-height:35px;"> | 58 | 海关关区:<input id="manifnum" type="text" name="search_EQ_customs" style="width:166px;height:35px;line-height:35px;"> |
59 | <a href="javascript:doSearch()" class="easyui-linkbutton" iconCls="icon-search" data-options="selected:true"><spring:message code="opt.search" /></a> | 59 | <a href="javascript:doSearch()" class="easyui-linkbutton" iconCls="icon-search" data-options="selected:true"><spring:message code="opt.search" /></a> |
60 | <a href="javascript:doSaves()" class="easyui-linkbutton" style="background:#18A197;color:#FFF;border: 1px solid #18A197;" iconCls="icon-add">添加</a> | 60 | <a href="javascript:doSaves()" class="easyui-linkbutton" style="background:#18A197;color:#FFF;border: 1px solid #18A197;" iconCls="icon-add">添加</a> |
61 | + | ||
61 | <%--<a href="javascript:printAll()" class="easyui-linkbutton" style="background:red;color:#FFF;border: 1px solid red">批量打印</a>--%> | 62 | <%--<a href="javascript:printAll()" class="easyui-linkbutton" style="background:red;color:#FFF;border: 1px solid red">批量打印</a>--%> |
62 | </table> | 63 | </table> |
63 | </form> | 64 | </form> |
@@ -107,7 +108,8 @@ | @@ -107,7 +108,8 @@ | ||
107 | 108 | ||
108 | function operatorFormat(val, row, index) { | 109 | function operatorFormat(val, row, index) { |
109 | var html = "<a href='javascript:void(0)' onclick='print("+row.id+")' style='text-decoration:none;color:blue;'>打印</a>" + | 110 | var html = "<a href='javascript:void(0)' onclick='print("+row.id+")' style='text-decoration:none;color:blue;'>打印</a>" + |
110 | - " <a href='javascript:void(0)' onclick='findOne("+row.id+")' style='text-decoration:none;color:blue;'>查看</a>"; | 111 | + " <a href='javascript:void(0)' onclick='findOne("+row.id+")' style='text-decoration:none;color:blue;'>查看</a>"+ |
112 | + " <a href='javascript:void(0)' onclick='doDelete("+row.id+")' style='text-decoration:none;color:blue;'>删除</a>"; | ||
111 | 113 | ||
112 | return html; | 114 | return html; |
113 | } | 115 | } |
@@ -223,7 +225,17 @@ | @@ -223,7 +225,17 @@ | ||
223 | } | 225 | } |
224 | 226 | ||
225 | 227 | ||
226 | - | 228 | + function doDelete(id) { |
229 | + $.post("<%=basePath %>declaration/doDelete",{id:id},function(data){ | ||
230 | + if(data.status == 200) { | ||
231 | + layer.confirm("<spring:message code="opt.delsuccess" />!",{btn:['<spring:message code="opt.confirm" />','<spring:message code="opt.cancel" />']},function(){ | ||
232 | + window.location.href="<%=basePath %>declaration/list"; | ||
233 | + }) | ||
234 | + }else{ | ||
235 | + layer.open({content:"请联系管理员删除"}); | ||
236 | + } | ||
237 | + },"json"); | ||
238 | + } | ||
227 | 239 | ||
228 | function editRow(id){ | 240 | function editRow(id){ |
229 | layer.open({ | 241 | layer.open({ |
@@ -307,6 +319,9 @@ | @@ -307,6 +319,9 @@ | ||
307 | <%--}--%> | 319 | <%--}--%> |
308 | <%--},"json");--%> | 320 | <%--},"json");--%> |
309 | } | 321 | } |
322 | + | ||
323 | + | ||
324 | + | ||
310 | </script> | 325 | </script> |
311 | </body> | 326 | </body> |
312 | </html> | 327 | </html> |
-
请 注册 或 登录 后发表评论