소스 검색

git-svn-id: https://192.168.57.71/svn/hbghj@124 201dd7a2-ec1b-f84b-8b06-88221118ff88

ld_liufl 8 년 전
부모
커밋
35e2abbdc9

BIN
gkaq/yjpt-java/trunk/flexResource/resource/yjpt/login/login_qrcode.jpg


+ 41 - 0
gkaq/yjpt-java/trunk/java_src/com/jtgh/yjpt/entity/cjhs/CjhsDbEntity.java

@@ -0,0 +1,41 @@
+package com.jtgh.yjpt.entity.cjhs;
+
+import javax.persistence.Entity;
+import javax.persistence.Id;
+import javax.persistence.Table;
+
+@Entity
+@Table(name = "T_CJHS_GKBD")
+public class CjhsDbEntity {
+	private Long gksbbh;
+	private String hssbbh;
+	private  Long  bsxh;
+	private Long xh;
+
+	public Long getBsxh() {
+		return bsxh;
+	}
+	public void setBsxh(Long bsxh) {
+		this.bsxh = bsxh;
+	}
+	public Long getXh() {
+		return xh;
+	}
+	public void setXh(Long xh) {
+		this.xh = xh;
+	}
+	@Id
+	public Long getGksbbh() {
+		return gksbbh;
+	}
+	public void setGksbbh(Long gksbbh) {
+		this.gksbbh = gksbbh;
+	}
+	public String getHssbbh() {
+		return hssbbh;
+	}
+	public void setHssbbh(String hssbbh) {
+		this.hssbbh = hssbbh;
+	}
+
+}

+ 171 - 0
gkaq/yjpt-java/trunk/java_src/com/jtgh/yjpt/entity/cjhs/CjhsEntity.java

@@ -0,0 +1,171 @@
+package com.jtgh.yjpt.entity.cjhs;
+
+import java.util.Date;
+import java.util.List;
+import javax.persistence.Transient;
+
+/**
+ * 海事对接表
+ * 
+ */
+
+public class CjhsEntity {
+
+	/** 申报单编号主键 */
+	private String sbdbh;
+
+	/** 船舶名称 */
+	private String cbmc;
+
+	/**
+	 * 作业港口名称
+	 */
+	private String zygkmc;
+
+	/**
+	 * 泊位代码
+	 */
+	private String bwdm;
+
+	/** 泊位名称 */
+	private String bwmc;
+
+	/**
+	 * 所属码头
+	 */
+	private String ssmt;
+
+
+	// 航次
+	private String hc;
+	// 内外贸标志
+	private String nwmbz;
+	// 进出港标志
+	private String jcgbz;
+
+	public String getHc() {
+		return hc;
+	}
+
+	public void setHc(String hc) {
+		this.hc = hc;
+	}
+
+	public String getNwmbz() {
+		return nwmbz;
+	}
+
+	public void setNwmbz(String nwmbz) {
+		this.nwmbz = nwmbz;
+	}
+
+	public String getJcgbz() {
+		return jcgbz;
+	}
+
+	public void setJcgbz(String jcgbz) {
+		this.jcgbz = jcgbz;
+	}
+
+	/**
+	 * 开始作业时间
+	 */
+	private Date kszysj;
+
+	/**
+	 * 结束作业时间
+	 */
+	private Date jszysj;
+
+	/**
+	 * 流转标志
+	 */
+	private String lzbz;
+	/**
+	 * 子表货物表
+	 */
+	private List<CjhsHwEntity> hshwList = null;
+
+	public List<CjhsHwEntity> getHshwList() {
+		return hshwList;
+	}
+
+	public void setHshwList(List<CjhsHwEntity> hshwList) {
+		this.hshwList = hshwList;
+	}
+
+	public String getBwdm() {
+		return bwdm;
+	}
+
+	public String getBwmc() {
+		return bwmc;
+	}
+
+	@Transient
+	public String getCbmc() {
+		return cbmc;
+	}
+
+	public Date getJszysj() {
+		return jszysj;
+	}
+
+	public Date getKszysj() {
+		return kszysj;
+	}
+
+	public String getLzbz() {
+		return lzbz;
+	}
+
+	public String getSbdbh() {
+		return sbdbh;
+	}
+
+	public void setSbdbh(String sbdbh) {
+		this.sbdbh = sbdbh;
+	}
+
+	public void setBwdm(String bwdm) {
+		this.bwdm = bwdm;
+	}
+
+	public void setBwmc(String bwmc) {
+		this.bwmc = bwmc;
+	}
+
+	public void setCbmc(String cbmc) {
+		this.cbmc = cbmc;
+	}
+
+	public void setJszysj(Date jszysj) {
+		this.jszysj = jszysj;
+	}
+
+	public void setKszysj(Date kszysj) {
+		this.kszysj = kszysj;
+	}
+
+	public void setLzbz(String lzbz) {
+		this.lzbz = lzbz;
+	}
+
+	public String getZygkmc() {
+		return zygkmc;
+	}
+
+	public void setZygkmc(String zygkmc) {
+		this.zygkmc = zygkmc;
+	}
+
+	public String getSsmt() {
+		return ssmt;
+	}
+
+	public void setSsmt(String ssmt) {
+		this.ssmt = ssmt;
+	}
+
+
+}

+ 76 - 0
gkaq/yjpt-java/trunk/java_src/com/jtgh/yjpt/entity/cjhs/CjhsHwEntity.java

@@ -0,0 +1,76 @@
+package com.jtgh.yjpt.entity.cjhs;
+
+
+
+
+/**
+ * 海事对接货物表
+ * 
+ */
+public class CjhsHwEntity  {
+	
+	/**
+	 * 申报单编号
+	 */
+	private String sbdbh;
+	
+	
+	/**
+	 * 危规编号
+	 */
+	private String wgbh;
+	
+	/**
+	 * 危险品名称
+	 */
+	private String  zqysmczw;
+	
+	/**
+	 * 总重量
+	 */
+	private double zzl;
+
+	public String getSbdbh() {
+		return sbdbh;
+	}
+	public void setSbdbh(String sbdbh) {
+		this.sbdbh = sbdbh;
+	}
+	
+	public double getZzl() {
+		return zzl;
+	}
+	public void setZzl(double zzl) {
+		this.zzl = zzl;
+	}
+	public String getWgbh() {
+		return wgbh;
+	}
+	public void setWgbh(String wgbh) {
+		this.wgbh = wgbh;
+	}
+	public String getZqysmczw() {
+		return zqysmczw;
+	}
+	public void setZqysmczw(String zqysmczw) {
+		this.zqysmczw = zqysmczw;
+	}
+	
+	private Long  bsxh;
+	
+	private Long xh;
+	
+	public Long getBsxh() {
+		return bsxh;
+	}
+	public void setBsxh(Long bsxh) {
+		this.bsxh = bsxh;
+	}
+	public Long getXh() {
+		return xh;
+	}
+	public void setXh(Long xh) {
+		this.xh = xh;
+	}
+}
+

+ 30 - 0
gkaq/yjpt-java/trunk/java_src/com/jtgh/yjpt/service/cjhs/CjhsService.java

@@ -0,0 +1,30 @@
+package com.jtgh.yjpt.service.cjhs;
+
+import java.util.List;
+
+import org.springframework.data.domain.Page;
+import org.springframework.data.domain.Pageable;
+import org.springframework.data.jpa.domain.Specification;
+
+import com.jtgh.yjpt.entity.cjhs.CjhsDbEntity;
+import com.jtgh.yjpt.entity.cjhs.CjhsEntity;
+
+
+/**
+ * 海事比对服务
+ * 
+ * @author 袁晓冬
+ * 
+ */
+public interface CjhsService {
+
+	Page<CjhsDbEntity> findAll(Specification<CjhsDbEntity> spec,
+			Pageable pageable);
+	
+	public List<CjhsDbEntity> findByGksbbh(Long gksbbh);
+
+	public  CjhsEntity findCjhsByGksbbh(Long gksbbh);
+	
+	void save(CjhsDbEntity entity);
+
+}

+ 115 - 0
gkaq/yjpt-java/trunk/java_src/com/jtgh/yjpt/service/impl/cjhs/CjhsServiceImpl.java

@@ -0,0 +1,115 @@
+package com.jtgh.yjpt.service.impl.cjhs;
+
+import java.util.HashMap;
+import java.util.List;
+import java.util.Map;
+
+import javax.persistence.EntityManager;
+import javax.persistence.PersistenceContext;
+
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.data.domain.Page;
+import org.springframework.data.domain.Pageable;
+import org.springframework.data.jpa.domain.Specification;
+import org.springframework.stereotype.Service;
+
+import com.jtgh.cjhs.entity.DtywCbsbEntity;
+import com.jtgh.cjhs.service.DtywCbsbService;
+import com.jtgh.yjpt.entity.cjhs.CjhsDbEntity;
+import com.jtgh.yjpt.entity.cjhs.CjhsEntity;
+import com.jtgh.yjpt.entity.zysqbp.ZysqbpEntity;
+import com.jtgh.yjpt.service.cjhs.CjhsService;
+import com.jtgh.yjpt.service.common.QueryService;
+import com.jtgh.yjpt.service.zysqbp.ZysqbpService;
+
+@Service
+public class CjhsServiceImpl implements CjhsService {
+	@Autowired
+	private QueryService query;
+	@Autowired
+	@PersistenceContext(unitName = "entityManagerFactory")
+	private EntityManager entityManager;
+
+	@Autowired
+	private ZysqbpService zysqbpService;
+	@Autowired
+	private CjhsService cjhsService;
+	@Autowired
+	private DtywCbsbService dtywCbsbService;
+
+	@Override
+	public Page<CjhsDbEntity> findAll(Specification<CjhsDbEntity> spec,
+			Pageable pageable) {
+		try {
+			return query.findAll(spec, pageable, CjhsDbEntity.class);
+		} catch (Exception e) {
+			e.printStackTrace();
+			return null;
+		}
+	}
+
+	@Override
+	public void save(CjhsDbEntity entity) {
+		entityManager.persist(entity);
+	}
+
+	@Override
+	public List<CjhsDbEntity> findByGksbbh(Long gksbbh) {
+		try {
+			Map<String, Object> params = new HashMap<String, Object>();
+			params.put("gksbbh", gksbbh);
+			return query.nativeQuery(
+					"SELECT * FROM T_CJHS_GKBD WHERE GKSBBH=#{gksbbh}",
+					CjhsDbEntity.class, params);
+		} catch (Exception e) {
+			e.printStackTrace();
+			return null;
+		}
+	}
+
+	/**
+	 * 获取海事申报记录,不论结果都返回
+	 */
+	@Override
+	public CjhsEntity findCjhsByGksbbh(Long gksbbh) {
+		CjhsEntity cjhs = null;
+		ZysqbpEntity vo = zysqbpService.findOne(gksbbh);
+		// 获取比对数据
+		try {
+			List<CjhsDbEntity> cjhsdbList = cjhsService.findByGksbbh(gksbbh);
+			if (cjhsdbList == null || cjhsdbList.size() <= 0) {
+				List<DtywCbsbEntity> dtywCbsbEntityList = dtywCbsbService
+						.findByZwcm(vo.getCm());
+				if (dtywCbsbEntityList != null) {
+					DtywCbsbEntity dtywCbsbEntity = dtywCbsbEntityList.get(0);
+					cjhs = changeFromDtywCbsb(dtywCbsbEntity);
+				}
+			} else {
+				CjhsDbEntity cjhsdbEntity = cjhsdbList.get(0);
+				DtywCbsbEntity dtywCbsbEntity =dtywCbsbService.findBySbdbh(cjhsdbEntity.getHssbbh()); 
+				cjhs = changeFromDtywCbsb(dtywCbsbEntity);
+			}
+		} catch (Exception e) {
+			e.printStackTrace();
+		}
+		return cjhs;
+	}
+	
+	public CjhsEntity changeFromDtywCbsb(DtywCbsbEntity entity){
+		CjhsEntity cjhs = new CjhsEntity();
+		cjhs.setBwmc(bwmc);
+		cjhs.setBwdm(entity.getBwdm());
+		cjhs.setCbmc(entity.getZwcm());
+		cjhs.setHc(entity.getHc());
+		cjhs.setJcgbz(entity.getJcgbz());
+		cjhs.setJszysj(entity.getJszysj());
+		cjhs.setKszysj(entity.getKszysj());
+		cjhs.setLzbz(entity.getLzbz());
+		cjhs.setNwmbz(entity.getNwmbz());
+		cjhs.setSbdbh(entity.getSbdbh());
+		cjhs.setSsmt(ssmt);
+		cjhs.setZygkmc(entity.getZygkmc());
+		return cjhs;
+	}
+
+}

+ 6 - 0
gkaq/yjpt-java/trunk/resources/spring/application.properties

@@ -12,6 +12,12 @@ jdbc.qlyg.password     =
 jdbc.xzzx.url               = 
 jdbc.xzzx.username    =  
 jdbc.xzzx.password     =  
+
+#********************************** cjhs jdbc info**********************************************#
+jdbc.cjhs.url               =  jdbc:oracle:thin:@192.168.57.36:1521:orcl
+jdbc.cjhs.username    =  hbhs
+jdbc.cjhs.password     =  hbhs
+
 #dbcp settings
 dbcp.maxIdle=30
 dbcp.minIdle=5

+ 5 - 0
gkaq/yjpt-java/trunk/resources/spring/application.properties.ftl

@@ -18,6 +18,11 @@ jdbc.xzzx.url               =
 jdbc.xzzx.username    =  
 jdbc.xzzx.password     =  
 </#if>
+#********************************** cjhs jdbc info**********************************************#
+jdbc.cjhs.url               =  
+jdbc.cjhs.username    =  
+jdbc.cjhs.password     =  
+
 #dbcp settings
 dbcp.maxIdle=30
 dbcp.minIdle=5

+ 39 - 0
gkaq/yjpt-java/trunk/resources/spring/applicationContext-datachange.xml

@@ -13,6 +13,44 @@
 		http://www.springframework.org/schema/data/jpa http://www.springframework.org/schema/data/jpa/spring-jpa.xsd
 		http://www.springframework.org/schema/aop http://www.springframework.org/schema/aop/spring-aop-3.0.xsd">
 	<description>数据交换配置 </description>
+	<!-- 长江海事 Jpa Entity Manager 配置 -->
+	<bean id="entityManagerFactory-cjhs" 
+		class="org.springframework.orm.jpa.LocalContainerEntityManagerFactoryBean">
+		<property name="dataSource" ref="dataSource-cjhs" />
+		<property name="jpaVendorAdapter" ref="hibernateJpaVendorAdapter" />
+		<property name="packagesToScan" value="com.jtgh.cjhs.entity" />
+		<property name="jpaProperties">
+			<props>
+				<prop key="hibernate.hbm2ddl.auto">${hibernate.hbm2ddl.auto}</prop>
+				<prop key="hibernate.dialect">${hibernate.dialect}</prop>
+				<prop key="hibernate.ejb.naming_strategy">org.hibernate.cfg.ImprovedNamingStrategy</prop>
+				<prop key="hibernate.jdbc.use_streams_for_binary">true</prop>
+				<prop key="hibernate.show_sql">false</prop>
+				<prop key="hibernate.format_sql">true</prop>
+			</props>
+		</property>
+	</bean>
+	<bean id="dataSource-cjhs" class="org.apache.commons.dbcp.BasicDataSource"
+		  destroy-method="close" lazy-init="false">
+		<property name="driverClassName" value="${jdbc.driver}" />
+		<property name="url" value="${jdbc.cjhs.url}" />
+		<property name="username" value="${jdbc.cjhs.username}" />
+		<property name="password" value="${jdbc.cjhs.password}" />
+		<property name="validationQuery" value="SELECT 1 FROM DUAL" />
+		<property name="testOnBorrow" value="true" />
+		<property name="maxIdle" value="${dbcp.maxIdle}" />
+		<property name="maxActive" value="${dbcp.maxActive}" />
+		<property name="defaultAutoCommit" value="false" />
+		<property name="timeBetweenEvictionRunsMillis" value="3600000" />
+		<property name="minEvictableIdleTimeMillis" value="3600000" />
+	</bean>
+	
+	<!-- Spring Data Jpa配置 -->
+	<jpa:repositories base-package="com.jtgh.cjhs.dao"
+					  entity-manager-factory-ref="entityManagerFactory-cjhs"
+					  factory-class="com.jtgh.cjhs.dao.common.CjhsRepositoryFactoryBean" />
+		
+	
 	<!-- 权利阳光 Jpa Entity Manager 配置 -->
 	<bean id="entityManagerFactory-qlyg" 
 		class="org.springframework.orm.jpa.LocalContainerEntityManagerFactoryBean">
@@ -47,6 +85,7 @@
 			</props>
 		</property>
 	</bean>
+
 	<bean id="dataSource-xzzx" class="org.apache.commons.dbcp.BasicDataSource"
 		  destroy-method="close" lazy-init="false">
 		<property name="driverClassName" value="${jdbc.driver}" />

+ 20 - 1
gkaq/yjpt-java/trunk/resources/sql/init/1.table.sql

@@ -10351,4 +10351,23 @@ comment on column T_YJPT_DCYHGZ.szd
   is '所在地';
 comment on column T_YJPT_DCYHGZ.xmmc
 alter table T_YJPT_DCYHGZ 
-add constraint T_YJPT_DCYHGZ_PK primary key (ID);
+add constraint T_YJPT_DCYHGZ_PK primary key (ID);
+
+create table T_CJHS_GKBD
+(
+  gksbbh NUMBER not null,
+  hssbbh VARCHAR2(36) not null,
+  bsxh   NUMBER  not null,
+  xh    NUMBER not null
+);
+alter table T_CJHS_GKBD
+  add primary key (GKSBBH);
+  comment on table T_CJHS_GKBD
+  is '长江海事比对数据';
+--Add comments to the columns 
+comment on column T_HS_GKBD.gksbbh
+  is '港口申报单编号';
+  comment on column T_HS_GKBD.hssbbh
+  is '海事申报单编号';
+  comment on column T_HS_GKBD.xh
+  is '流水号';

+ 20 - 0
gkaq/yjpt-java/trunk/resources/sql/init/9.update.sql.ftl

@@ -614,3 +614,23 @@ Alter table t_yjpt_gq modify gqszsylx varchar(10);
 
 --经营人的自动审批字段置为空 20160923
 update  t_yjpt_user u set u.byzd2="" where u.sfjyr='Y';
+
+--长江海事港口比对
+create table T_CJHS_GKBD
+(
+  gksbbh NUMBER not null,
+  hssbbh VARCHAR2(36) not null,
+  bsxh   NUMBER  not null,
+  xh    NUMBER not null
+);
+alter table T_CJHS_GKBD
+  add primary key (GKSBBH);
+  comment on table T_CJHS_GKBD
+  is '长江海事比对数据';
+--Add comments to the columns 
+comment on column T_HS_GKBD.gksbbh
+  is '港口申报单编号';
+  comment on column T_HS_GKBD.hssbbh
+  is '海事申报单编号';
+  comment on column T_HS_GKBD.xh
+  is '流水号';