Showing
6 changed files
with
68 additions
and
28 deletions
| ... | @@ -139,6 +139,22 @@ CREATE TABLE T_ICLEAR_API_MAWBDETAIL( | ... | @@ -139,6 +139,22 @@ CREATE TABLE T_ICLEAR_API_MAWBDETAIL( |
| 139 | ---ALTER TABLE T_ICLEAR_API_MAWB ADD SOURCE_TYPE VARCHAR(10); | 139 | ---ALTER TABLE T_ICLEAR_API_MAWB ADD SOURCE_TYPE VARCHAR(10); |
| 140 | ALTER TABLE T_CHM_CONSIGNMENT_DETAIL ADD DETAILID VARCHAR(50); | 140 | ALTER TABLE T_CHM_CONSIGNMENT_DETAIL ADD DETAILID VARCHAR(50); |
| 141 | 141 | ||
| 142 | +--添加tsn口岸 | ||
| 143 | +INSERT into T_AU_ORGANIZATION(CODE,NAME,TYPE_ID,PARENT_ID,[LEVEL],CREATE_USER_ID,CREATE_TIME)VALUES('tsn','tsn口岸',84534,1,6,5503,GETDATE()) | ||
| 144 | + | ||
| 145 | +--添加tsn口岸操作员01 | ||
| 146 | +insert into T_AU_USER (LOGIN_NAME,USERNAME,PASSWORD,IS_VALID,VISIBLE,CREATE_TIME,VERSION,CHANGE_PASSWORD,ORG_ID,ORG_NAME,INIT_OWNER_NAME,TYPE_ID,TYPE_NAME)VALUES('tsnczy1','TSN操作员01','985111aed0bc0920dce9b362de2b1fa122a5ccdd6ac2a8e9b3ae5cfa58169f7725830de4566b7c43',1,1,GETDATE(),0,1,(select ID from T_AU_ORGANIZATION where code = 'tsn'),(select NAME from T_AU_ORGANIZATION where code = 'tsn'),1,(select ID from T_BI_DICTIONARY_ENTRIES where ID = 84534),(select CHINESE_NAME from T_BI_DICTIONARY_ENTRIES where ID = 84534)) | ||
| 147 | + | ||
| 148 | +--添加tsn口岸操作员02 | ||
| 149 | +insert into T_AU_USER (LOGIN_NAME,USERNAME,PASSWORD,IS_VALID,VISIBLE,CREATE_TIME,VERSION,CHANGE_PASSWORD,ORG_ID,ORG_NAME,INIT_OWNER_NAME,TYPE_ID,TYPE_NAME)VALUES('tsnczy2','TSN操作员02','985111aed0bc0920dce9b362de2b1fa122a5ccdd6ac2a8e9b3ae5cfa58169f7725830de4566b7c43',1,1,GETDATE(),0,1,(select ID from T_AU_ORGANIZATION where code = 'tsn'),(select NAME from T_AU_ORGANIZATION where code = 'tsn'),1,(select ID from T_BI_DICTIONARY_ENTRIES where ID = 84534),(select CHINESE_NAME from T_BI_DICTIONARY_ENTRIES where ID = 84534)) | ||
| 150 | + | ||
| 151 | +--添加权限 | ||
| 152 | +insert into T_AU_USER_ROLES (USER_ID,ROLE_ID,VERSION)VALUES(53573,3910,0); | ||
| 153 | +insert into T_AU_USER_ROLES (USER_ID,ROLE_ID,VERSION)VALUES(53574,3910,0); | ||
| 154 | + | ||
| 155 | +--数据字段中添加天津口岸 | ||
| 156 | +insert INTO T_BI_DICTIONARY_ENTRIES(CODE,CHINESE_NAME,ENGLISH_NAME,DESCRIPTION,STATUS,DICT_ID,DICT_CODE,ORDINAL)VALUES('port_tsn','TSN','TSN','TSN',1,'50161','port',50) | ||
| 157 | + | ||
| 142 | 158 | ||
| 143 | 159 | ||
| 144 | 160 | ... | ... |
| ... | @@ -96,7 +96,6 @@ public class Mawb implements Serializable { | ... | @@ -96,7 +96,6 @@ public class Mawb implements Serializable { |
| 96 | private String ediId; | 96 | private String ediId; |
| 97 | 97 | ||
| 98 | @ApiModelProperty(value = "海关编号", name = "EntryId", example = "001") | 98 | @ApiModelProperty(value = "海关编号", name = "EntryId", example = "001") |
| 99 | - @NotBlank(message="参数entryId不能为空") | ||
| 100 | @Column(name = "ENTRYID") | 99 | @Column(name = "ENTRYID") |
| 101 | private String entryId; | 100 | private String entryId; |
| 102 | 101 | ... | ... |
| ... | @@ -25,6 +25,28 @@ public class Constant { | ... | @@ -25,6 +25,28 @@ public class Constant { |
| 25 | */ | 25 | */ |
| 26 | public static Map<String , DictionaryEntries> dictionaryEntriesCache = new HashMap<>(); | 26 | public static Map<String , DictionaryEntries> dictionaryEntriesCache = new HashMap<>(); |
| 27 | 27 | ||
| 28 | + //运单类型 | ||
| 29 | + public static final String CONS_TYPE = "consType"; | ||
| 30 | + /** | ||
| 31 | + * A类型 | ||
| 32 | + */ | ||
| 33 | + public static final String consType_A = "consType_A"; | ||
| 34 | + /** | ||
| 35 | + * B类型 | ||
| 36 | + */ | ||
| 37 | + public static final String consType_B = "consType_B"; | ||
| 38 | + /** | ||
| 39 | + * C类型 | ||
| 40 | + */ | ||
| 41 | + public static final String consType_C = "consType_C"; | ||
| 42 | + /** | ||
| 43 | + * D类型 | ||
| 44 | + */ | ||
| 45 | + public static final String consType_D = "consType_D"; | ||
| 46 | + /** | ||
| 47 | + * tsn口岸 | ||
| 48 | + */ | ||
| 49 | + public static final String PORT_TSN = "port_tsn"; | ||
| 28 | /** | 50 | /** |
| 29 | * 货源地 | 51 | * 货源地 |
| 30 | */ | 52 | */ | ... | ... |
| ... | @@ -376,8 +376,10 @@ public class ChmConsignment implements Serializable { | ... | @@ -376,8 +376,10 @@ public class ChmConsignment implements Serializable { |
| 376 | /** | 376 | /** |
| 377 | * 运单类型ID | 377 | * 运单类型ID |
| 378 | */ | 378 | */ |
| 379 | - @Column(name = "CONS_TYPE_ID") | 379 | + @JsonIgnore |
| 380 | - private String consTypeId; | 380 | + @ManyToOne(targetEntity = DictionaryEntries.class) |
| 381 | + @JoinColumn(name = "CONS_TYPE_ID") | ||
| 382 | + private DictionaryEntries consTypeId; | ||
| 381 | 383 | ||
| 382 | /** | 384 | /** |
| 383 | * 运单类型 | 385 | * 运单类型 |
| ... | @@ -385,6 +387,13 @@ public class ChmConsignment implements Serializable { | ... | @@ -385,6 +387,13 @@ public class ChmConsignment implements Serializable { |
| 385 | @Column(name = "CONS_TYPE") | 387 | @Column(name = "CONS_TYPE") |
| 386 | private String consType; | 388 | private String consType; |
| 387 | 389 | ||
| 390 | + @JsonIgnore | ||
| 391 | + @ManyToOne(targetEntity = DictionaryEntries.class) | ||
| 392 | + @JoinColumn(name = "PORT_ID") | ||
| 393 | + private DictionaryEntries portId; | ||
| 394 | + | ||
| 395 | + @Column(name = "PORT_NAME") | ||
| 396 | + private String portName; | ||
| 388 | 397 | ||
| 389 | @OneToMany(mappedBy = "chmConsignment", cascade = CascadeType.ALL) | 398 | @OneToMany(mappedBy = "chmConsignment", cascade = CascadeType.ALL) |
| 390 | private List<ChmConsignmentDetail> chmConsignmentDetailList; | 399 | private List<ChmConsignmentDetail> chmConsignmentDetailList; | ... | ... |
| ... | @@ -54,12 +54,13 @@ public class ChmConsignmentDetailService { | ... | @@ -54,12 +54,13 @@ public class ChmConsignmentDetailService { |
| 54 | //第一计量单位(法定单位) | 54 | //第一计量单位(法定单位) |
| 55 | DictionaryEntries firstUnitDictionaryEntries = Constant.dictionaryEntriesCache.get(Constant.TRANSACTION_UNIT+ mawbDetail.getFirstUnit()); | 55 | DictionaryEntries firstUnitDictionaryEntries = Constant.dictionaryEntriesCache.get(Constant.TRANSACTION_UNIT+ mawbDetail.getFirstUnit()); |
| 56 | result.setUnitLegalFirstId(firstUnitDictionaryEntries); | 56 | result.setUnitLegalFirstId(firstUnitDictionaryEntries); |
| 57 | - result.setKnockdownUnit(firstUnitDictionaryEntries.getChineseName()); | 57 | + result.setUnitLegalFirst(firstUnitDictionaryEntries.getChineseName()); |
| 58 | 58 | ||
| 59 | //第一法定数量 | 59 | //第一法定数量 |
| 60 | result.setQtyLegalFirst(BigDecimal.valueOf(mawbDetail.getFirstQty().doubleValue())); | 60 | result.setQtyLegalFirst(BigDecimal.valueOf(mawbDetail.getFirstQty().doubleValue())); |
| 61 | //成交计量单位 | 61 | //成交计量单位 |
| 62 | - DictionaryEntries knockdownUnitEntries = Constant.dictionaryEntriesCache.get(Constant.TRANSACTION_UNIT+ mawbDetail.getFirstUnit()); | 62 | + //2021年7月8日 成交单位有修改,原取值第一法定计量单位,先取值成交单位。xjq |
| 63 | + DictionaryEntries knockdownUnitEntries = Constant.dictionaryEntriesCache.get(Constant.TRANSACTION_UNIT+ mawbDetail.getGunit()); | ||
| 63 | result.setKnockdownUnitDic(knockdownUnitEntries); | 64 | result.setKnockdownUnitDic(knockdownUnitEntries); |
| 64 | result.setKnockdownUnit(knockdownUnitEntries.getChineseName()); | 65 | result.setKnockdownUnit(knockdownUnitEntries.getChineseName()); |
| 65 | //商品规格、型号 | 66 | //商品规格、型号 | ... | ... |
| ... | @@ -154,9 +154,9 @@ public class ChmConsignmentService { | ... | @@ -154,9 +154,9 @@ public class ChmConsignmentService { |
| 154 | } | 154 | } |
| 155 | 155 | ||
| 156 | //运单类型 | 156 | //运单类型 |
| 157 | - DictionaryEntries consType = Constant.dictionaryEntriesCache.get(Constant.MSG_TYPE_D); | 157 | + DictionaryEntries consType = Constant.dictionaryEntriesCache.get(Constant.consType_D); |
| 158 | if(consType != null){ | 158 | if(consType != null){ |
| 159 | - result.setConsTypeId(String.valueOf(consType.getId())); | 159 | + result.setConsTypeId(consType); |
| 160 | result.setConsType(consType.getChineseName()); | 160 | result.setConsType(consType.getChineseName()); |
| 161 | } | 161 | } |
| 162 | 162 | ||
| ... | @@ -238,6 +238,13 @@ public class ChmConsignmentService { | ... | @@ -238,6 +238,13 @@ public class ChmConsignmentService { |
| 238 | result.setConsStatus(transferWaybillStatusDictionaryEntries.getChineseName()); | 238 | result.setConsStatus(transferWaybillStatusDictionaryEntries.getChineseName()); |
| 239 | } | 239 | } |
| 240 | 240 | ||
| 241 | + //添加TSN口岸 | ||
| 242 | + DictionaryEntries portTSN = Constant.dictionaryEntriesCache.get(Constant.PORT_TSN); | ||
| 243 | + if (!Objects.equals(portTSN,null)){ | ||
| 244 | + result.setPortId(portTSN); | ||
| 245 | + result.setPortName(portTSN.getChineseName()); | ||
| 246 | + } | ||
| 247 | + | ||
| 241 | //西门子数据都为TSN口岸,可通过口岸查询查看 | 248 | //西门子数据都为TSN口岸,可通过口岸查询查看 |
| 242 | if (creator.equals("IDE")){ | 249 | if (creator.equals("IDE")){ |
| 243 | result.setDeclaredPort("TSN"); | 250 | result.setDeclaredPort("TSN"); |
| ... | @@ -355,7 +362,6 @@ public class ChmConsignmentService { | ... | @@ -355,7 +362,6 @@ public class ChmConsignmentService { |
| 355 | //条件1、状态为 待申报海关 | 362 | //条件1、状态为 待申报海关 |
| 356 | //条件2、本次推送时间 > 上次推送的时间 | 363 | //条件2、本次推送时间 > 上次推送的时间 |
| 357 | }else if(!Objects.equals(chmConsignmentDB,null) | 364 | }else if(!Objects.equals(chmConsignmentDB,null) |
| 358 | - //TODO 确定是不是transferWaybillStatus_5 | ||
| 359 | && Objects.equals(chmConsignmentDB.getConsStatusDic().getCode(),"transferWaybillStatus_5") | 365 | && Objects.equals(chmConsignmentDB.getConsStatusDic().getCode(),"transferWaybillStatus_5") |
| 360 | //TODO 提交时需要打开 | 366 | //TODO 提交时需要打开 |
| 361 | && pushTime.getTime()>chmConsignmentDB.getUpdateTime().getTime() | 367 | && pushTime.getTime()>chmConsignmentDB.getUpdateTime().getTime() |
| ... | @@ -365,28 +371,15 @@ public class ChmConsignmentService { | ... | @@ -365,28 +371,15 @@ public class ChmConsignmentService { |
| 365 | 371 | ||
| 366 | 372 | ||
| 367 | //由于订单明细中,无法确定唯一一条数据,所以无法做到update,只能先删除在插入 | 373 | //由于订单明细中,无法确定唯一一条数据,所以无法做到update,只能先删除在插入 |
| 368 | -// for(ChmConsignmentDetail newDetail:chmConsignment.getChmConsignmentDetailList()){ | 374 | + for(ChmConsignmentDetail newDetail:chmConsignment.getChmConsignmentDetailList()){ |
| 369 | -// for(ChmConsignmentDetail oldDetail: chmConsignmentDB.getChmConsignmentDetailList()){ | 375 | + for(ChmConsignmentDetail oldDetail: chmConsignmentDB.getChmConsignmentDetailList()){ |
| 370 | -// if(Objects.equals(newDetail.getSkuCode(),oldDetail.getSkuCode())){ | 376 | + if(Objects.equals(newDetail.getDetailId(),oldDetail.getDetailId())){ |
| 371 | -// //newDetail.setChmConsignment(chmConsignmentDB); | 377 | + //newDetail.setChmConsignment(chmConsignmentDB); |
| 372 | -// newDetail.setId(oldDetail.getId()); | 378 | + newDetail.setId(oldDetail.getId()); |
| 373 | -// } | 379 | + } |
| 374 | -// } | 380 | + } |
| 375 | -// } | ||
| 376 | - //TODO 因为现在有了DetailId,所以可以根据DetailID进行更新,所以需要改为 update,去的掉detele的动作 | ||
| 377 | - List<Long> detailIdList = new ArrayList(); | ||
| 378 | - chmConsignmentDB.getChmConsignmentDetailList().forEach(detail->{ | ||
| 379 | - detailIdList.add(detail.getId()); | ||
| 380 | - }); | ||
| 381 | - if(detailIdList.size()>0){ | ||
| 382 | - chmConsignmentDetailService.deleteChmConsignmentDetailBatch(detailIdList); | ||
| 383 | - chmConsignmentDB.setChmConsignmentDetailList(null); | ||
| 384 | } | 381 | } |
| 385 | 382 | ||
| 386 | - | ||
| 387 | - | ||
| 388 | - | ||
| 389 | - | ||
| 390 | chmConsignment.setId(chmConsignmentDB.getId()); | 383 | chmConsignment.setId(chmConsignmentDB.getId()); |
| 391 | chmConsignment.setCreateTime(chmConsignmentDB.getCreateTime()); | 384 | chmConsignment.setCreateTime(chmConsignmentDB.getCreateTime()); |
| 392 | chmConsignment.setUpdateTime(pushTime); | 385 | chmConsignment.setUpdateTime(pushTime); | ... | ... |
-
Please register or login to post a comment