作者 申海龙

安检申报 货主 类型改为单选 列表展示海关关区 发布时间 海关关区搜索

package com.agent.controller.agent;
import com.agent.entity.agent.ManifestEntity;
import com.agent.entity.agent.SDCargoNameEntity;
import com.agent.entity.agent.SDCargoTypeEntity;
import com.agent.entity.agent.SecurityDeclarationEntity;
import com.agent.entity.agent.*;
import com.agent.entity.system.UserEntity;
import com.agent.service.agent.ManifestService;
import com.agent.service.system.SDCargoNameService;
... ... @@ -78,7 +75,7 @@ public class SecurityDeclarationController {
*/
@RequestMapping(value = "/grid.json")
@ResponseBody
public DataGrid<SecurityDeclarationVo> grid(HttpServletRequest request, EasyPage<SecurityDeclarationEntity> pageForm) {
public DataGrid<SecurityDeclarationVo> grid(HttpServletRequest request, EasyPage<SecurityManifestEntity> pageForm) {
Map<String, Object> searchParams = Servlets.getParametersStartingWith(request, "search_");
UserEntity ue = (UserEntity)SecurityUtils.getSubject().getSession().getAttribute("user");
... ... @@ -94,24 +91,25 @@ public class SecurityDeclarationController {
pageForm.parseData(securityDeclarationService.getPage(pageForm));
DataGrid<SecurityDeclarationEntity> securityDeclarationEntityDataGrid = pageForm.getData();
DataGrid<SecurityManifestEntity> securityDeclarationEntityDataGrid = pageForm.getData();
List<SecurityDeclarationVo>rows = new ArrayList<>();
if (CollectionUtils.isNotEmpty(securityDeclarationEntityDataGrid.getRows())){
for (SecurityDeclarationEntity sd: securityDeclarationEntityDataGrid.getRows()){
for (SecurityManifestEntity sd: securityDeclarationEntityDataGrid.getRows()){
SecurityDeclarationVo sdVo = new SecurityDeclarationVo();
sdVo.setId(sd.getId());
sdVo.setSd_waybill(sd.getSd_waybill());
sdVo.setSd_cargo_shipper_name(sd.getSd_cargo_shipper_name());
sdVo.setSd_cargo_agent_name(sd.getSd_cargo_agent_name());
sdVo.setSd_transport_certificate(sd.getSd_transport_certificate());
sdVo.setSd_transportation_prove(sd.getSd_transportation_prove());
sdVo.setSd_iata_number(sd.getSd_iata_number());
if("1".equals(sd.getSd_static())){
sdVo.setSd_waybill(sd.getWaybill());
sdVo.setSd_cargo_shipper_name(sd.getShippername());
sdVo.setSd_cargo_agent_name(sd.getAgentname());
sdVo.setSd_transport_certificate(sd.getCertificate());
sdVo.setSd_transportation_prove(sd.getProve());
sdVo.setSd_iata_number(sd.getIata());
if("1".equals(sd.getStatics())){
sdVo.setSd_static("已发送安检申报报文");
}
sdVo.setOperation(sd.getOperation());
sdVo.setCustoms(sd.getCustoms());
rows.add(sdVo);
}
}
... ... @@ -219,6 +217,9 @@ public class SecurityDeclarationController {
sd.setSd_transport_certificate(transportCertificate);
sd.setSd_transportation_prove(transportationProve);
sd.setSd_static("1");
SimpleDateFormat simpleDateFormat = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
String format = simpleDateFormat.format(new Date());
sd.setOperation_time(format);
if (ue != null){
if (ue.getId() != null ){
sd.setUSER_ID(ue.getId());
... ... @@ -368,8 +369,8 @@ public class SecurityDeclarationController {
String cName = cargoName.replaceAll(",", ",");
String[] split = cName.split(",");
for (int i=0; i<split.length; i++){
SDCargoNameEntity sdCargoNameEntity = new SDCargoNameEntity();
if (!StringUtils.isBlank(split[i]) || !"".equals(split[i])){
SDCargoNameEntity sdCargoNameEntity = new SDCargoNameEntity();
sdCargoNameEntity.setSd_waybill(waybill);
sdCargoNameEntity.setSd_cargo_name(split[i]);
sdCargoNameService.save(sdCargoNameEntity);
... ... @@ -395,6 +396,9 @@ public class SecurityDeclarationController {
manifestEntity.setUSER_ID(ue.getId());
}
}
SimpleDateFormat simpleDateFormats = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
String format = simpleDateFormats.format(new Date());
sd.setOperation_time(format);
securityDeclarationService.save(sd);
// 生成报文并且发送
... ... @@ -660,7 +664,9 @@ public class SecurityDeclarationController {
sd.setSd_transportation_prove(transportationProve);
sd.setSd_static("1");
sd.setUSER_ID(ue.getId());
SimpleDateFormat simpleDateFormats = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
String format = simpleDateFormats.format(new Date());
sd.setOperation_time(format);
if (securityDeclarationService.update(sd)>0){
model.setStatus(200);
}
... ...
... ... @@ -56,6 +56,19 @@ public class SecurityDeclarationEntity extends IdEntity implements Serializable
*/
private String sd_static;
/**
* 操作时间
* @return
*/
private String operation_time;
public String getOperation_time() {
return operation_time;
}
public void setOperation_time(String operation_time) {
this.operation_time = operation_time;
}
public Long getUSER_ID() {
return USER_ID;
... ...
package com.agent.entity.agent;
import com.agent.entity.IdEntity;
import javax.persistence.Entity;
import javax.persistence.Table;
import java.io.Serializable;
/**
* @Auther: shenhl
* @Date: 2019/7/23 16:47
*/
@Entity
@Table(name = "SECURITY_MANIFEST")
public class SecurityManifestEntity extends IdEntity implements Serializable {
private static final long serialVersionUID = 1L;
// private Long id;
private String waybill;
private String shippername;
private String agentname;
private String iata;
private String certificate;
private String prove;
private Long userid;
private String operation;
private String customs;
private String statics;
public String getStatics() {
return statics;
}
public void setStatics(String statics) {
this.statics = statics;
}
// @Override
// public Long getId() {
// return id;
// }
//
// @Override
// public void setId(Long id) {
// this.id = id;
// }
public String getWaybill() {
return waybill;
}
public void setWaybill(String waybill) {
this.waybill = waybill;
}
public String getShippername() {
return shippername;
}
public void setShippername(String shippername) {
this.shippername = shippername;
}
public String getAgentname() {
return agentname;
}
public void setAgentname(String agentname) {
this.agentname = agentname;
}
public String getIata() {
return iata;
}
public void setIata(String iata) {
this.iata = iata;
}
public String getCertificate() {
return certificate;
}
public void setCertificate(String certificate) {
this.certificate = certificate;
}
public String getProve() {
return prove;
}
public void setProve(String prove) {
this.prove = prove;
}
public Long getUserid() {
return userid;
}
public void setUserid(Long userid) {
this.userid = userid;
}
public String getOperation() {
return operation;
}
public void setOperation(String operation) {
this.operation = operation;
}
public String getCustoms() {
return customs;
}
public void setCustoms(String customs) {
this.customs = customs;
}
}
... ...
... ... @@ -25,4 +25,9 @@ public interface SDCargoNameRepository extends PagingAndSortingRepository<SDCarg
@Query(value = "delete from SD_CARGO_NAME where id = ?1", nativeQuery = true)
int deleteAlls(Long waybill);
@Transactional
@Modifying
@Query(value = "delete from SD_CARGO_NAME where sd_waybill = ?1", nativeQuery = true)
int deletes(String waybillnomaster);
}
... ...
... ... @@ -16,10 +16,10 @@ public interface SecurityDeclarationRepository extends PagingAndSortingRepositor
@Transactional
@Modifying
@Query(value = "update SECURITY_DECLARATION set SD_WAYBILL=?2, SD_CARGO_SHIPPER_NAME=?4, SD_CARGO_AGENT_NAME=?3, SD_IATA_NUMBER=?5, SD_TRANSPORT_CERTIFICATE=?6, SD_TRANSPORTATION_PROVE=?7, USER_ID=?8 where id=?1", nativeQuery = true)
@Query(value = "update SECURITY_DECLARATION set SD_WAYBILL=?2, SD_CARGO_SHIPPER_NAME=?4, SD_CARGO_AGENT_NAME=?3, SD_IATA_NUMBER=?5, SD_TRANSPORT_CERTIFICATE=?6, SD_TRANSPORTATION_PROVE=?7, USER_ID=?8, OPERATION_TIME=?9 where id=?1", nativeQuery = true)
int update(Long id, String waybill,
String cargoAgent, String cargoShipper,
String iata, String tranposrt, String prove, Long userId);
String iata, String tranposrt, String prove, Long userId, String operation);
@Query(value = "select count(*) from SECURITY_DECLARATION where SD_WAYBILL = ?1", nativeQuery = true)
int findWaybill(String waybill);
... ...
package com.agent.repository.system;
import com.agent.entity.agent.SecurityDeclarationEntity;
import com.agent.entity.agent.SecurityManifestEntity;
import org.springframework.data.jpa.repository.JpaSpecificationExecutor;
import org.springframework.data.jpa.repository.Modifying;
import org.springframework.data.jpa.repository.Query;
import org.springframework.data.repository.PagingAndSortingRepository;
import org.springframework.transaction.annotation.Transactional;
/**
* @Auther: shenhl
* @Date: 2019/4/24 16:38
*/
public interface SecurityManifestRepository extends PagingAndSortingRepository<SecurityManifestEntity, Long>,
JpaSpecificationExecutor<SecurityManifestEntity> {
}
... ...
... ... @@ -9,6 +9,7 @@ import javax.annotation.Resource;
import com.agent.entity.agent.*;
import com.agent.repository.system.HzWaybillRepository;
import com.agent.repository.system.SDCargoNameRepository;
import com.agent.repository.system.SecurityDeclarationRepository;
import org.springframework.data.domain.Page;
import org.springframework.data.domain.PageRequest;
... ... @@ -128,6 +129,9 @@ public class ManifestService extends BasicService<ManifestEntity> {
@Resource
private SecurityDeclarationRepository securityDeclarationRepository;
@Resource
private SDCargoNameRepository sdCargoNameRepository;
/**
* 分页查询
*
... ... @@ -221,6 +225,9 @@ public class ManifestService extends BasicService<ManifestEntity> {
if (waybill1 != null){
securityDeclarationRepository.delete(waybill1.getId());
}
sdCargoNameRepository.deletes(waybillnomaster);
}
}catch (Exception e){
e.printStackTrace();
... ...
... ... @@ -2,7 +2,9 @@ package com.agent.service.system;
import com.agent.entity.Constant;
import com.agent.entity.agent.SecurityDeclarationEntity;
import com.agent.entity.agent.SecurityManifestEntity;
import com.agent.repository.system.SecurityDeclarationRepository;
import com.agent.repository.system.SecurityManifestRepository;
import com.agent.service.BasicService;
import com.agent.vo.agent.SDVo;
import com.agent.xml.common.XmlHead;
... ... @@ -22,11 +24,13 @@ import java.util.Date;
* @Date: 2019/4/24 16:46
*/
@Service
public class SecurityDeclarationService extends BasicService<SecurityDeclarationEntity> {
public class SecurityDeclarationService extends BasicService<SecurityManifestEntity> {
@Autowired
private SecurityDeclarationRepository securityDeclarationRepository;
@Autowired
private SecurityManifestRepository securityManifestRepository;
/**
* 分页查询
... ... @@ -34,11 +38,11 @@ public class SecurityDeclarationService extends BasicService<SecurityDeclaration
* @param pageForm 分页对象
* @return 包含分页信息和数据的分页对象
*/
public Page<SecurityDeclarationEntity> getPage(EasyPage<SecurityDeclarationEntity> pageForm) {
public Page<SecurityManifestEntity> getPage(EasyPage<SecurityManifestEntity> pageForm) {
PageRequest pageRequest = buildPageRequest(pageForm);
Specification<SecurityDeclarationEntity> spec = buildSpecification(pageForm);
Specification<SecurityManifestEntity> spec = buildSpecification(pageForm);
Page<SecurityDeclarationEntity> page = securityDeclarationRepository.findAll(spec, pageRequest);
Page<SecurityManifestEntity> page = securityManifestRepository.findAll(spec, pageRequest);
return page;
}
... ... @@ -61,7 +65,7 @@ public class SecurityDeclarationService extends BasicService<SecurityDeclaration
return securityDeclarationRepository.update(sd.getId(), sd.getSd_waybill(),
sd.getSd_cargo_agent_name(), sd.getSd_cargo_shipper_name(),
sd.getSd_iata_number(), sd.getSd_transport_certificate(),
sd.getSd_transportation_prove(), sd.getUSER_ID());
sd.getSd_transportation_prove(), sd.getUSER_ID(), sd.getOperation_time());
}
... ...
... ... @@ -52,6 +52,26 @@ public class SecurityDeclarationVo {
*/
private String sd_static;
private String operation;
private String customs;
public String getOperation() {
return operation;
}
public void setOperation(String operation) {
this.operation = operation;
}
public String getCustoms() {
return customs;
}
public void setCustoms(String customs) {
this.customs = customs;
}
public Long getId() {
return id;
}
... ...
... ... @@ -61,16 +61,16 @@
<td class="kv-content">
<label>
<input id="one" name="one" type="checkbox" ${fn:contains(type, 1)?"checked":""} value="1" >普通货物
<input id="one" name="one" type="radio" ${fn:contains(type, 1)?"checked":""} value="1" >普通货物
</label>
<label>
<input id="two" name="two" type="checkbox" ${fn:contains(type, 2)?"checked":""} value="2">特种货物
<input id="two" name="one" type="radio" ${fn:contains(type, 2)?"checked":""} value="2">特种货物
</label>
<label>
<input id="three" name="three" type="checkbox" ${fn:contains(type, 3)?"checked":""} value="3">危险品
<input id="three" name="one" type="radio" ${fn:contains(type, 3)?"checked":""} value="3">危险品
</label>
<label>
<input id="four" name="four" type="checkbox" ${fn:contains(type, 4)?"checked":""} value="4">航空快件
<input id="four" name="one" type="radio" ${fn:contains(type, 4)?"checked":""} value="4">航空快件
</label>
</td>
</tr>
... ...
... ... @@ -61,16 +61,16 @@
<td class="kv-content">
<label>
<input id="one" name="one" type="checkbox" ${fn:contains(type, 1)?"checked":""} value="1" >普通货物
<input id="one" name="one" type="radio" ${fn:contains(type, 1)?"checked":""} value="1" >普通货物
</label>
<label>
<input id="two" name="two" type="checkbox" ${fn:contains(type, 2)?"checked":""} value="2">特种货物
<input id="two" name="one" type="radio" ${fn:contains(type, 2)?"checked":""} value="2">特种货物
</label>
<label>
<input id="three" name="three" type="checkbox" ${fn:contains(type, 3)?"checked":""} value="3">危险品
<input id="three" name="one" type="radio" ${fn:contains(type, 3)?"checked":""} value="3">危险品
</label>
<label>
<input id="four" name="four" type="checkbox" ${fn:contains(type, 4)?"checked":""} value="4">航空快件
<input id="four" name="one" type="radio" ${fn:contains(type, 4)?"checked":""} value="4">航空快件
</label>
</td>
</tr>
... ...
... ... @@ -71,16 +71,16 @@
<td class="kv-content">
<label>
<input id="one" name="one" type="checkbox" value="1" >普通货物
<input id="one" name="one" type="radio" value="1" checked>普通货物
</label>
<label>
<input id="two" name="two" type="checkbox" value="2">特种货物
<input id="two" name="one" type="radio" value="2">特种货物
</label>
<label>
<input id="three" name="three" type="checkbox" value="3">危险品
<input id="three" name="one" type="radio" value="3">危险品
</label>
<label>
<input id="four" name="four" type="checkbox" value="4">航空快件
<input id="four" name="one" type="radio" value="4">航空快件
</label>
</td>
</tr>
... ... @@ -219,40 +219,6 @@
layer = layui.layer;
});
var selectFals = false;
function submit(){
layerIndex = parent.layer.load(1, {
shade: [0.6,'#000000'] //0.1透明度
});
var chboxValue=[];
var checkBox = $("input[name=one],input[name=two],input[name=three],input[name=four]");
for (var i=0; i<checkBox.length; i++){
if (checkBox[i].checked){
selectFals = true;
}
}
if (selectFals == true){
var data = $("#form").serialize();
$.post("<%=basePath%>declaration/save",data,function (data) {
parent.layer.close(layerIndex);
if (data.status == 200) {
var index = parent.layer.getFrameIndex(window.name); // 获取窗口索引
parent.layer.close(index);
window.location.href = "<%=basePath%>declaration/list";
} else {
layer.open({content:""+data.msg});
}
});
}else {
alert("货主类型至少选择一项");
return false;
}
}
function viewXml(){
if($("#ids").val()==''){
layer.open({content:"<spring:message code='manifest.send.message.failed'/>"});
... ... @@ -267,7 +233,7 @@
})
}
}
var selectFals = false;
//发送报文并且保存
function savesend(){
var isValid = $("#form").valid();
... ...
... ... @@ -44,6 +44,8 @@
<th field="sd_iata_number">航协编号</th>
<th field="sd_transport_certificate" formatter="certificate">运输条件鉴定书</th>
<th field="sd_transportation_prove" formatter="prove">航空公司同意运输证明</th>
<th field="operation">发布时间</th>
<th field="customs">海关关区</th>
<th field="sd_static"formatter="sdStatic" width="80">状态</th>
<th field=".." formatter="operatorFormat" width="60">操作</th>
</tr>
... ... @@ -53,6 +55,7 @@
<form id="searchForm">
<table class="search_form_table">
<spring:message code="manifest.bill.number"/>:<input id="manifnum" type="text" name="search_LIKE_sd_waybill" style="width:166px;height:35px;line-height:35px;">
海关关区:<input id="manifnum" type="text" name="search_EQ_customs" style="width:166px;height:35px;line-height:35px;">
<a href="javascript:doSearch()" class="easyui-linkbutton" iconCls="icon-search" data-options="selected:true"><spring:message code="opt.search" /></a>
<a href="javascript:doSaves()" class="easyui-linkbutton" style="background:#18A197;color:#FFF;border: 1px solid #18A197;" iconCls="icon-add">添加</a>
<%--<a href="javascript:printAll()" class="easyui-linkbutton" style="background:red;color:#FFF;border: 1px solid red">批量打印</a>--%>
... ...
... ... @@ -63,16 +63,16 @@
<td class="kv-content">
<label>
<input id="one" name="one" type="checkbox" value="1" checked>普通货物
<input id="one" name="one" type="radio" value="1" checked>普通货物
</label>
<label>
<input id="two" name="two" type="checkbox" value="2">特种货物
<input id="two" name="one" type="radio" value="2">特种货物
</label>
<label>
<input id="three" name="three" type="checkbox" value="3">危险品
<input id="three" name="one" type="radio" value="3">危险品
</label>
<label>
<input id="four" name="four" type="checkbox" value="4">航空快件
<input id="four" name="one" type="radio" value="4">航空快件
</label>
</td>
</tr>
... ... @@ -266,6 +266,7 @@
return false;
}
}
}
//发送交运报文
function sendDelivery(){
... ...
... ... @@ -98,8 +98,8 @@
发货人<span class="required_span">*</span>
</td>
<td class="kv-content">
<select required id="for_short_shipper" name="for_short_shipper">
<option value="" selected></option>
<select id="for_short_shipper" name="for_short_shipper">
<option value=""></option>
<c:forEach items="${shipper}" var="shipper">
<option value="${shipper.id}" <c:forEach items="${hzId}" var = "hzId"> ${shipper.id eq hzId.hzinfor_id?"selected":""} </c:forEach>>${shipper.for_short}&nbsp;&nbsp;${shipper.full_name}</option>
</c:forEach>
... ... @@ -110,7 +110,7 @@
</td>
<td class="kv-content">
<select id="for_short_booking" name="for_short_booking">
<option value="" selected></option>
<option value=""></option>
<c:forEach items="${booking}" var="booking">
<option value="${booking.id}" <c:forEach items="${hzId}" var = "hzId"> ${booking.id eq hzId.hzinfor_id?"selected":""} </c:forEach>>${booking.for_short}&nbsp;&nbsp;${booking.full_name}</option>
</c:forEach>
... ... @@ -121,7 +121,7 @@
</td>
<td class="kv-content">
<select id="for_short_operation" name="for_short_operation">
<option value="" selected></option>
<option value=""></option>
<c:forEach items="${operation}" var="operation">
<option value="${operation.id}" <c:forEach items="${hzId}" var = "hzId"> ${operation.id eq hzId.hzinfor_id?"selected":""} </c:forEach> >${operation.for_short}&nbsp;&nbsp;${operation.full_name}</option>
</c:forEach>
... ...