Showing
6 changed files
with
47 additions
and
12 deletions
doc/新增脚本20210907.sql
0 → 100644
| 1 | + | ||
| 2 | +---海关编码 | ||
| 3 | +INSERT INTO T_BI_DICTIONARY(CODE,CHINESE_NAME,ENGLISH_NAME,DESCRIPTION,STATUS,PARENT_ID) VALUES('customsNo','海关编码','customsNo','海关编码',1,23) | ||
| 4 | + | ||
| 5 | +INSERT INTO T_BI_DICTIONARY_ENTRIES (CODE,CHINESE_NAME,ENGLISH_NAME,DESCRIPTION,STATUS,DICT_ID,DICT_CODE,ORDINAL,EXT2,EXT6) VALUES('0101','PVG','PVG','PVG',1,(SELECT ID FROM T_BI_DICTIONARY WHERE CHINESE_NAME ='海关编码'),(SELECT CODE FROM T_BI_DICTIONARY WHERE CHINESE_NAME ='海关编码'),5001,'port_pvg','0101') | ||
| 6 | + | ||
| 7 | +INSERT INTO T_BI_DICTIONARY_ENTRIES (CODE,CHINESE_NAME,ENGLISH_NAME,DESCRIPTION,STATUS,DICT_ID,DICT_CODE,ORDINAL,EXT2,EXT6) VALUES('2233','PEK','PEK','PEK',1,(SELECT ID FROM T_BI_DICTIONARY WHERE CHINESE_NAME ='海关编码'),(SELECT CODE FROM T_BI_DICTIONARY WHERE CHINESE_NAME ='海关编码'),5002,'port_pek','2233') | ||
| 8 | + | ||
| 9 | +INSERT INTO T_BI_DICTIONARY_ENTRIES (CODE,CHINESE_NAME,ENGLISH_NAME,DESCRIPTION,STATUS,DICT_ID,DICT_CODE,ORDINAL,EXT2,EXT6) VALUES('0207','TSN','TSN','TSN',1,(SELECT ID FROM T_BI_DICTIONARY WHERE CHINESE_NAME ='海关编码'),(SELECT CODE FROM T_BI_DICTIONARY WHERE CHINESE_NAME ='海关编码'),5003,'port_tsn','0207') |
| ... | @@ -48,6 +48,10 @@ public class Constant { | ... | @@ -48,6 +48,10 @@ public class Constant { |
| 48 | */ | 48 | */ |
| 49 | public static final String PORT_TSN = "port_tsn"; | 49 | public static final String PORT_TSN = "port_tsn"; |
| 50 | /** | 50 | /** |
| 51 | + * 海关编码 | ||
| 52 | + */ | ||
| 53 | + public static final String CUSTOMSNO = "customsNo"; | ||
| 54 | + /** | ||
| 51 | * 货源地 | 55 | * 货源地 |
| 52 | */ | 56 | */ |
| 53 | public static Map<String,DomesticDestinationMapping> domesticDestinationMappingCache = new HashMap(); | 57 | public static Map<String,DomesticDestinationMapping> domesticDestinationMappingCache = new HashMap(); | ... | ... |
| ... | @@ -251,8 +251,8 @@ public class ChmConsignmentDetail implements Serializable { | ... | @@ -251,8 +251,8 @@ public class ChmConsignmentDetail implements Serializable { |
| 251 | /** | 251 | /** |
| 252 | * 录入品名 | 252 | * 录入品名 |
| 253 | */ | 253 | */ |
| 254 | -// @Column(name = "INPUT_ITEM") | 254 | + @Column(name = "INPUT_ITEM") |
| 255 | -// private String inputItem; | 255 | + private String inputItem; |
| 256 | 256 | ||
| 257 | 257 | ||
| 258 | @Override | 258 | @Override | ... | ... |
| ... | @@ -33,4 +33,12 @@ public interface DictionaryEntriesRepository extends JpaRepository<DictionaryEn | ... | @@ -33,4 +33,12 @@ public interface DictionaryEntriesRepository extends JpaRepository<DictionaryEn |
| 33 | @Query(nativeQuery = true, value = "select ID,CODE,CHINESE_NAME,DICT_CODE,EXT2,EXT3,EXT6 from T_BI_DICTIONARY_ENTRIES where STATUS=1") | 33 | @Query(nativeQuery = true, value = "select ID,CODE,CHINESE_NAME,DICT_CODE,EXT2,EXT3,EXT6 from T_BI_DICTIONARY_ENTRIES where STATUS=1") |
| 34 | public List<DictionaryEntries> findAllDictionaryEntries(); | 34 | public List<DictionaryEntries> findAllDictionaryEntries(); |
| 35 | 35 | ||
| 36 | + /** | ||
| 37 | + * 根据dictCode查找 | ||
| 38 | + * @param code | ||
| 39 | + * @return | ||
| 40 | + */ | ||
| 41 | + @Query(nativeQuery = true, value = "SELECT * FROM T_BI_DICTIONARY_ENTRIES WHERE DICT_CODE = ?1 AND EXT6 = ?2") | ||
| 42 | + public DictionaryEntries findDictionaryEntriesByDicCode(String code,String numBer); | ||
| 43 | + | ||
| 36 | } | 44 | } | ... | ... |
| ... | @@ -6,6 +6,7 @@ import com.erry.iclear.dateInterface.entity.*; | ... | @@ -6,6 +6,7 @@ import com.erry.iclear.dateInterface.entity.*; |
| 6 | import com.erry.iclear.dateInterface.repository.ChmConsignmentDetailRepository; | 6 | import com.erry.iclear.dateInterface.repository.ChmConsignmentDetailRepository; |
| 7 | import com.erry.iclear.dateInterface.repository.ChmConsignmentRepository; | 7 | import com.erry.iclear.dateInterface.repository.ChmConsignmentRepository; |
| 8 | import com.erry.iclear.dateInterface.util.NumberUtils; | 8 | import com.erry.iclear.dateInterface.util.NumberUtils; |
| 9 | +import com.erry.iclear.dateInterface.util.StringUtil; | ||
| 9 | import lombok.extern.slf4j.Slf4j; | 10 | import lombok.extern.slf4j.Slf4j; |
| 10 | import org.apache.commons.lang3.StringUtils; | 11 | import org.apache.commons.lang3.StringUtils; |
| 11 | import org.springframework.beans.factory.annotation.Autowired; | 12 | import org.springframework.beans.factory.annotation.Autowired; |
| ... | @@ -123,6 +124,8 @@ public class ChmConsignmentDetailService { | ... | @@ -123,6 +124,8 @@ public class ChmConsignmentDetailService { |
| 123 | result.setDomesticDestination(Objects.equals(destinationCountryDictionaryEntries,null)?"":destinationCountryDictionaryEntries.getChineseName()); | 124 | result.setDomesticDestination(Objects.equals(destinationCountryDictionaryEntries,null)?"":destinationCountryDictionaryEntries.getChineseName()); |
| 124 | } | 125 | } |
| 125 | result.setDetailId(mawbDetail.getDetailId()); | 126 | result.setDetailId(mawbDetail.getDetailId()); |
| 127 | + //录入品名 | ||
| 128 | + result.setInputItem(StringUtil.isEmptyWithTrim(mawbDetail.getGname()) == true ? "" : mawbDetail.getGname()); | ||
| 126 | }catch (Exception e){ | 129 | }catch (Exception e){ |
| 127 | log.error("convertToChmConsignmentDetail() error:"+e.getMessage()); | 130 | log.error("convertToChmConsignmentDetail() error:"+e.getMessage()); |
| 128 | } | 131 | } | ... | ... |
| ... | @@ -9,8 +9,10 @@ import com.erry.iclear.dateInterface.entity.ChmConsignment; | ... | @@ -9,8 +9,10 @@ import com.erry.iclear.dateInterface.entity.ChmConsignment; |
| 9 | import com.erry.iclear.dateInterface.entity.ChmConsignmentDetail; | 9 | import com.erry.iclear.dateInterface.entity.ChmConsignmentDetail; |
| 10 | import com.erry.iclear.dateInterface.entity.DictionaryEntries; | 10 | import com.erry.iclear.dateInterface.entity.DictionaryEntries; |
| 11 | import com.erry.iclear.dateInterface.repository.ChmConsignmentRepository; | 11 | import com.erry.iclear.dateInterface.repository.ChmConsignmentRepository; |
| 12 | +import com.erry.iclear.dateInterface.repository.DictionaryEntriesRepository; | ||
| 12 | import com.erry.iclear.dateInterface.util.DateUtils; | 13 | import com.erry.iclear.dateInterface.util.DateUtils; |
| 13 | import com.erry.iclear.dateInterface.util.NumberUtils; | 14 | import com.erry.iclear.dateInterface.util.NumberUtils; |
| 15 | +import com.erry.iclear.dateInterface.util.StringUtil; | ||
| 14 | import lombok.extern.slf4j.Slf4j; | 16 | import lombok.extern.slf4j.Slf4j; |
| 15 | import org.apache.commons.lang3.StringUtils; | 17 | import org.apache.commons.lang3.StringUtils; |
| 16 | import org.springframework.beans.BeanUtils; | 18 | import org.springframework.beans.BeanUtils; |
| ... | @@ -38,6 +40,9 @@ public class ChmConsignmentService { | ... | @@ -38,6 +40,9 @@ public class ChmConsignmentService { |
| 38 | @Autowired | 40 | @Autowired |
| 39 | private ChmConsignmentDetailService chmConsignmentDetailService; | 41 | private ChmConsignmentDetailService chmConsignmentDetailService; |
| 40 | 42 | ||
| 43 | + @Autowired | ||
| 44 | + private DictionaryEntriesRepository dictionaryEntriesRepository; | ||
| 45 | + | ||
| 41 | /** | 46 | /** |
| 42 | * 转换主单 | 47 | * 转换主单 |
| 43 | * @return | 48 | * @return |
| ... | @@ -64,7 +69,22 @@ public class ChmConsignmentService { | ... | @@ -64,7 +69,22 @@ public class ChmConsignmentService { |
| 64 | //合同号 | 69 | //合同号 |
| 65 | result.setContractCode(mawb.getContrNo()); | 70 | result.setContractCode(mawb.getContrNo()); |
| 66 | //主管海关(申报地海关) | 71 | //主管海关(申报地海关) |
| 72 | + if (!StringUtil.isEmptyWithTrim(mawb.getCustomMaster())){ | ||
| 73 | + //wy on 2021年9月7日15:12 ,根据申报地海关编码判断口岸 | ||
| 67 | result.setCustomsNo(mawb.getCustomMaster()); | 74 | result.setCustomsNo(mawb.getCustomMaster()); |
| 75 | + DictionaryEntries dictionaryEntries = dictionaryEntriesRepository.findDictionaryEntriesByDicCode(Constant.CUSTOMSNO,mawb.getCustomMaster()); | ||
| 76 | + if (dictionaryEntries != null){ | ||
| 77 | + //添加TSN口岸 | ||
| 78 | + DictionaryEntries portTSN = Constant.dictionaryEntriesCache.get(dictionaryEntries.getExt2()); | ||
| 79 | + if (!Objects.equals(portTSN,null)){ | ||
| 80 | + result.setPortId(portTSN); | ||
| 81 | + result.setPortName(portTSN.getChineseName()); | ||
| 82 | + //申报口岸 | ||
| 83 | + result.setDeclaredPort(portTSN.getChineseName()); | ||
| 84 | + } | ||
| 85 | + } | ||
| 86 | + } | ||
| 87 | + | ||
| 68 | //征免性质 | 88 | //征免性质 |
| 69 | DictionaryEntries levyTypeDictionaryEntries = Constant.dictionaryEntriesCache.get(Constant.NATURE_EXEMPTION+mawb.getCutMode()); | 89 | DictionaryEntries levyTypeDictionaryEntries = Constant.dictionaryEntriesCache.get(Constant.NATURE_EXEMPTION+mawb.getCutMode()); |
| 70 | if(!Objects.equals(levyTypeDictionaryEntries,null)){ | 90 | if(!Objects.equals(levyTypeDictionaryEntries,null)){ |
| ... | @@ -201,16 +221,7 @@ public class ChmConsignmentService { | ... | @@ -201,16 +221,7 @@ public class ChmConsignmentService { |
| 201 | result.setConsStatusDic(transferWaybillStatusDictionaryEntries); | 221 | result.setConsStatusDic(transferWaybillStatusDictionaryEntries); |
| 202 | result.setConsStatus(transferWaybillStatusDictionaryEntries.getChineseName()); | 222 | result.setConsStatus(transferWaybillStatusDictionaryEntries.getChineseName()); |
| 203 | } | 223 | } |
| 204 | - //添加TSN口岸 | 224 | + |
| 205 | - DictionaryEntries portTSN = Constant.dictionaryEntriesCache.get(Constant.PORT_TSN); | ||
| 206 | - if (!Objects.equals(portTSN,null)){ | ||
| 207 | - result.setPortId(portTSN); | ||
| 208 | - result.setPortName(portTSN.getChineseName()); | ||
| 209 | - } | ||
| 210 | - //西门子数据都为TSN口岸,可通过口岸查询查看 | ||
| 211 | - if (creator.equals("IDE")){ | ||
| 212 | - result.setDeclaredPort("TSN"); | ||
| 213 | - } | ||
| 214 | //推送时间作为创建时间,可以用来校验数据的有序性,如果新的推送时间小于已有的创建时间,就不更新数据 | 225 | //推送时间作为创建时间,可以用来校验数据的有序性,如果新的推送时间小于已有的创建时间,就不更新数据 |
| 215 | result.setCreateTime(new Date()); | 226 | result.setCreateTime(new Date()); |
| 216 | result.setUpdateTime(pushTime); | 227 | result.setUpdateTime(pushTime); | ... | ... |
-
Please register or login to post a comment