作者 申海龙

预配 安检 excel 导入导出

@@ -5,10 +5,7 @@ import com.agent.entity.Constant; @@ -5,10 +5,7 @@ import com.agent.entity.Constant;
5 import com.agent.entity.agent.*; 5 import com.agent.entity.agent.*;
6 import com.agent.entity.system.UserEntity; 6 import com.agent.entity.system.UserEntity;
7 import com.agent.service.agent.*; 7 import com.agent.service.agent.*;
8 -import com.agent.service.system.HzInfoService;  
9 -import com.agent.service.system.HzWaybillService;  
10 -import com.agent.service.system.RoleService;  
11 -import com.agent.service.system.UserService; 8 +import com.agent.service.system.*;
12 import com.agent.util.ExcelUtil; 9 import com.agent.util.ExcelUtil;
13 import com.agent.util.HttpJsonMsg; 10 import com.agent.util.HttpJsonMsg;
14 import com.agent.vo.ResponseModel; 11 import com.agent.vo.ResponseModel;
@@ -115,6 +112,15 @@ public class ManifestController extends BasicController { @@ -115,6 +112,15 @@ public class ManifestController extends BasicController {
115 @Resource 112 @Resource
116 private HzWaybillService hzWaybillService; 113 private HzWaybillService hzWaybillService;
117 114
  115 + @Resource
  116 + private SecurityDeclarationService securityDeclarationService;
  117 +
  118 + @Resource
  119 + private SDCargoNameService sdCargoNameService;
  120 +
  121 + @Resource
  122 + private SDCargoTypeService sdCargoTypeService;
  123 +
118 private BasicAgentEntity getAgent() { 124 private BasicAgentEntity getAgent() {
119 UserEntity user = Tools.getUserEntity(); 125 UserEntity user = Tools.getUserEntity();
120 long agent_id = user.getAgent(); 126 long agent_id = user.getAgent();
@@ -2268,12 +2274,19 @@ public class ManifestController extends BasicController { @@ -2268,12 +2274,19 @@ public class ManifestController extends BasicController {
2268 2274
2269 2275
2270 for (ArrayList<String> arr: readResult) { 2276 for (ArrayList<String> arr: readResult) {
2271 - 2277 + String wbm = "";
2272 if (!StringUtils.isBlank(arr.get(1))){ 2278 if (!StringUtils.isBlank(arr.get(1))){
  2279 + if(arr.get(1).contains("-")){
  2280 +
  2281 + wbm = arr.get(1);
  2282 + }else {
2273 String s1 = arr.get(1); 2283 String s1 = arr.get(1);
2274 String substring = s1.substring(0, 3); 2284 String substring = s1.substring(0, 3);
2275 String substring1 = s1.substring(3); 2285 String substring1 = s1.substring(3);
2276 - String wbm = substring+"-"+substring1; 2286 + wbm = substring+"-"+substring1;
  2287 + }
  2288 +
  2289 +
2277 //查询主单号时候存在 2290 //查询主单号时候存在
2278 ManifestEntity wbm1 = manifestService.findWbm(wbm); 2291 ManifestEntity wbm1 = manifestService.findWbm(wbm);
2279 if (wbm1==null){ 2292 if (wbm1==null){
@@ -2350,12 +2363,68 @@ public class ManifestController extends BasicController { @@ -2350,12 +2363,68 @@ public class ManifestController extends BasicController {
2350 2363
2351 //货物海关状态代码 2364 //货物海关状态代码
2352 manifestEntity.setCustomsstatus(arr.get(33)); 2365 manifestEntity.setCustomsstatus(arr.get(33));
  2366 +
  2367 + // 安检申报
  2368 + SecurityDeclarationEntity sd = new SecurityDeclarationEntity();
  2369 + sd.setSd_waybill(wbm);
  2370 + // 航空货物托运人名称
  2371 + sd.setSd_cargo_shipper_name(arr.get(34));
  2372 + // 航空货物销售代理人名称
  2373 + sd.setSd_cargo_agent_name(arr.get(35));
  2374 + // 航协资质编号
  2375 + if (!StringUtils.isBlank(arr.get(36))){
  2376 + sd.setSd_iata_number(arr.get(36));
  2377 + }
  2378 +
  2379 + sd.setSd_static("1");
  2380 + // 发布时间
  2381 + SimpleDateFormat simpleDateFormat2 = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
  2382 + String format = simpleDateFormat2.format(new Date());
  2383 + sd.setOperation_time(format);
  2384 + // 运输条件鉴定书
  2385 + if (!StringUtils.isBlank(arr.get(37))){
  2386 +
  2387 + String certificate = arr.get(37);
  2388 + if (certificate != null){
  2389 + String s2 = certificate.replaceAll(",", ",");
  2390 + sd.setSd_transportation_prove(s2);
  2391 + }
  2392 + }
  2393 +
  2394 + // 航空公司同意运输证明
  2395 + if (!StringUtils.isBlank(arr.get(38))){
  2396 +
  2397 + String prove = arr.get(38);
  2398 + if (prove != null){
  2399 + String s2 = prove.replaceAll(",", ",");
  2400 + sd.setSd_transportation_prove(s2);
  2401 + }
  2402 + }
  2403 + // 用户ID
  2404 + sd.setUSER_ID(userId);
  2405 +
  2406 + // 航空货物性质
  2407 + SDCargoTypeEntity sdCargoTypeEntity = new SDCargoTypeEntity();
  2408 + sdCargoTypeEntity.setSd_waybill(wbm);
  2409 + sdCargoTypeEntity.setSd_cargo_type(arr.get(39));
  2410 + sdCargoTypeService.save(sdCargoTypeEntity);
  2411 +
  2412 + // 航空货物品名
  2413 + String[] cargoName = arr.get(40).replace(",",",").split(",");
  2414 + for (int i = 0; i < cargoName.length; i++){
  2415 + SDCargoNameEntity sdCargoNameEntity = new SDCargoNameEntity();
  2416 + sdCargoNameEntity.setSd_waybill(wbm);
  2417 + sdCargoNameEntity.setSd_cargo_name(cargoName[i]);
  2418 + sdCargoNameService.save(sdCargoNameEntity);
  2419 + }
  2420 + securityDeclarationService.save(sd);
  2421 +
2353 manifestService.save(manifestEntity); 2422 manifestService.save(manifestEntity);
2354 model.setStatus(200); 2423 model.setStatus(200);
2355 }else { 2424 }else {
2356 model.setStatus(201); 2425 model.setStatus(201);
2357 model.setMsg(wbm1.getWaybillnomaster()+"单号已存在"); 2426 model.setMsg(wbm1.getWaybillnomaster()+"单号已存在");
2358 - continue; 2427 + break;
2359 } 2428 }
2360 }else { 2429 }else {
2361 break; 2430 break;
@@ -42,6 +42,6 @@ public interface SDTWOTYPERepository extends PagingAndSortingRepository<SDTWOTYP @@ -42,6 +42,6 @@ public interface SDTWOTYPERepository extends PagingAndSortingRepository<SDTWOTYP
42 @Query(value = "DELETE FROM SD_TWO_TYPE WHERE TWO_TYPE_NAME = ?1", nativeQuery = true) 42 @Query(value = "DELETE FROM SD_TWO_TYPE WHERE TWO_TYPE_NAME = ?1", nativeQuery = true)
43 int cargoNameDelete(String twoName); 43 int cargoNameDelete(String twoName);
44 44
45 - @Query(value = "select * from (select stt.*, row_number() over(partition by stt.TWO_TYPE_NAME order by 1) rn from SD_TWO_TYPE stt) stt where stt.rn = 1", nativeQuery = true) 45 + @Query(value = "select * from (select stt.*, row_number() over(partition by stt.TWO_TYPE_NAME order by 1) rn from SD_TWO_TYPE stt) stt where stt.rn = 1 ORDER BY stt.BIG_TYPE_ID", nativeQuery = true)
46 List<SDTWOTYPEEntity> twoFindAll(); 46 List<SDTWOTYPEEntity> twoFindAll();
47 } 47 }
@@ -62,7 +62,8 @@ @@ -62,7 +62,8 @@
62 <a href="javascript:doSearch()" class="easyui-linkbutton" iconCls="icon-search" data-options="selected:true"><spring:message code="opt.search" /></a> 62 <a href="javascript:doSearch()" class="easyui-linkbutton" iconCls="icon-search" data-options="selected:true"><spring:message code="opt.search" /></a>
63 <a href="javascript:editRow()" class="easyui-linkbutton" style="background:#18A197;color:#FFF;border: 1px solid #18A197;" iconCls="icon-add"><spring:message code="opt.add" /></a> 63 <a href="javascript:editRow()" class="easyui-linkbutton" style="background:#18A197;color:#FFF;border: 1px solid #18A197;" iconCls="icon-add"><spring:message code="opt.add" /></a>
64 <%--<a href="javascript:doDelete()" class="easyui-linkbutton" style="background:red;color:#FFF;border: 1px solid red" iconCls="icon-no"><spring:message code="opt.delete" /></a> --%> 64 <%--<a href="javascript:doDelete()" class="easyui-linkbutton" style="background:red;color:#FFF;border: 1px solid red" iconCls="icon-no"><spring:message code="opt.delete" /></a> --%>
65 - <%--<a href="javascript:excelUpload()" class="easyui-linkbutton" style="background:#0EA14E;color:#FFF;border: 1px solid #18A197;"><spring:message code="manifest.excel"/></a>--%> 65 + <a href="javascript:excelUpload()" class="easyui-linkbutton" style="background:#0EA14E;color:#FFF;border: 1px solid #18A197;"><spring:message code="manifest.excel"/></a>
  66 + <a href="<%=basePath %>resource/excel/excel.xls" class="easyui-linkbutton" style="background:#0EA14E;color:#FFF;border: 1px solid #18A197;">模板下载</a>
66 </table> 67 </table>
67 </form> 68 </form>
68 </div> 69 </div>
不能预览此文件类型