...
|
...
|
@@ -10,7 +10,6 @@ import java.util.HashMap; |
|
|
import java.util.List;
|
|
|
import java.util.Map;
|
|
|
import java.util.Set;
|
|
|
import java.util.jar.Manifest;
|
|
|
|
|
|
import javax.annotation.Resource;
|
|
|
import javax.servlet.http.HttpServletRequest;
|
...
|
...
|
@@ -36,9 +35,11 @@ import com.agent.entity.agent.PackageTypeEntity; |
|
|
import com.agent.entity.agent.PreparesecondaryEntity;
|
|
|
import com.agent.entity.agent.PubDgEntity;
|
|
|
import com.agent.entity.agent.TBasCarrierEntity;
|
|
|
import com.agent.entity.agent.WaybillReceiptType;
|
|
|
import com.agent.entity.system.UserEntity;
|
|
|
import com.agent.imf.agent.redis.RedisSaveMessage;
|
|
|
import com.agent.service.agent.BasicAgentService;
|
|
|
import com.agent.service.agent.ConsignorService;
|
|
|
import com.agent.service.agent.ManifestBillService;
|
|
|
import com.agent.service.agent.ManifestCommodityService;
|
|
|
import com.agent.service.agent.ManifestContainerService;
|
...
|
...
|
@@ -47,12 +48,14 @@ import com.agent.service.agent.PackageTypeService; |
|
|
import com.agent.service.agent.PreparesecondaryService;
|
|
|
import com.agent.service.agent.PubDgService;
|
|
|
import com.agent.service.agent.TBasCarrierService;
|
|
|
import com.agent.service.agent.WaybillReceiptService;
|
|
|
import com.agent.service.system.RoleService;
|
|
|
import com.agent.util.HttpJsonMsg;
|
|
|
import com.agent.vo.ResponseModel;
|
|
|
import com.agent.vo.agent.CommodityVo;
|
|
|
import com.agent.xml.common.XmlHead;
|
|
|
import com.agent.xml.common.XmlUtil;
|
|
|
import com.agent.xml.fhlsli.FSXmlKit;
|
|
|
import com.agent.xml.manifestdeclare.DeclarePreparemasterXmlBody;
|
|
|
import com.agent.xml.manifestdeclare.ManifestBorderTransportMeansXml;
|
|
|
import com.agent.xml.manifestdeclare.ManifestCarrierXml;
|
...
|
...
|
@@ -79,6 +82,7 @@ import com.plugin.easyui.DataGrid; |
|
|
import com.plugin.easyui.EasyPage;
|
|
|
|
|
|
import tools.DBConnection;
|
|
|
import tools.NumKit;
|
|
|
import tools.Tools;
|
|
|
import tools.oclass.FemyList;
|
|
|
|
...
|
...
|
@@ -87,8 +91,7 @@ import tools.oclass.FemyList; |
|
|
*/
|
|
|
@Controller
|
|
|
@RequestMapping(value = "/manifest")
|
|
|
public class ManifestController extends BasicController{
|
|
|
|
|
|
public class ManifestController extends BasicController {
|
|
|
private static final Logger logger = LoggerFactory.getLogger(ManifestController.class);
|
|
|
|
|
|
public static boolean isSuccess = false;
|
...
|
...
|
@@ -123,138 +126,145 @@ public class ManifestController extends BasicController{ |
|
|
@Resource
|
|
|
private TBasCarrierService tbasService;
|
|
|
|
|
|
@Resource
|
|
|
private ConsignorService consignorService;
|
|
|
|
|
|
@Resource
|
|
|
private WaybillReceiptService receiptService;
|
|
|
|
|
|
/**
|
|
|
* 列表页面
|
|
|
*
|
|
|
* @return
|
|
|
*/
|
|
|
@RequestMapping(value = "/list")
|
|
|
public String getList(Model model){
|
|
|
public String getList(Model model) {
|
|
|
return "manifest/list";
|
|
|
}
|
|
|
//app端接口
|
|
|
//获取主单列表
|
|
|
|
|
|
// app端接口
|
|
|
// 获取主单列表
|
|
|
@RequestMapping(value = "/cross/grid.json")
|
|
|
@ResponseBody
|
|
|
public DataGrid<ManifestEntity> cross_grid_json(HttpServletRequest request, HttpServletResponse response, EasyPage<ManifestEntity> pageForm){
|
|
|
// response.setCharacterEncoding("UTF-8");
|
|
|
// response.setHeader("Cache-Control", "no-cache, no-store, must-revalidate");
|
|
|
// response.setHeader("Pragma", "no-cache");
|
|
|
public DataGrid<ManifestEntity> cross_grid_json(HttpServletRequest request, HttpServletResponse response,
|
|
|
EasyPage<ManifestEntity> pageForm) {
|
|
|
// response.setCharacterEncoding("UTF-8");
|
|
|
// response.setHeader("Cache-Control", "no-cache, no-store, must-revalidate");
|
|
|
// response.setHeader("Pragma", "no-cache");
|
|
|
response.setHeader("Access-Control-Allow-Origin", "*");
|
|
|
// response.setDateHeader("Expires", 0);
|
|
|
// response.setDateHeader("Expires", 0);
|
|
|
|
|
|
Map<String, Object> searchParams = Servlets.getParametersStartingWith(request, "search_");
|
|
|
searchParams.put("EQ_USER_ID", Tools.getUserId());
|
|
|
pageForm.setSearchParams(searchParams);
|
|
|
//添加用户id的条件
|
|
|
// 添加用户id的条件
|
|
|
pageForm.parseData(manifestService.getPage(pageForm));
|
|
|
return pageForm.getData();
|
|
|
}
|
|
|
|
|
|
@RequestMapping(value = "/cross/edit")
|
|
|
@ResponseBody
|
|
|
public Map cross_edit(Long id, HttpServletResponse response){
|
|
|
System.out.println("id:"+id);
|
|
|
public Map cross_edit(Long id, HttpServletResponse response) {
|
|
|
System.out.println("id:" + id);
|
|
|
response.setHeader("Access-Control-Allow-Origin", "*");
|
|
|
Map model = new HashMap();
|
|
|
ManifestEntity manifest = null;
|
|
|
//判断是否是便捷
|
|
|
if(id!=null){
|
|
|
// 判断是否是便捷
|
|
|
if (id != null) {
|
|
|
manifest = manifestService.findOne(id);
|
|
|
}
|
|
|
|
|
|
UserEntity user = SessionUtil.getUser();
|
|
|
if(user!=null && user.getAgent()!=null){
|
|
|
if (user != null && user.getAgent() != null) {
|
|
|
BasicAgentEntity agent = agentService.findOne(user.getAgent());
|
|
|
model.put("agent",agent);
|
|
|
if(id == null) //是新增表单
|
|
|
model.put("agent", agent);
|
|
|
if (id == null) // 是新增表单
|
|
|
{
|
|
|
manifest = new ManifestEntity();
|
|
|
manifest.setAgentcompany(agent.getNameCn());
|
|
|
manifest.setAgentman(null); //设置代理人名称为null
|
|
|
manifest.setAgentman(null); // 设置代理人名称为null
|
|
|
}
|
|
|
}
|
|
|
model.put("manifest",manifest);
|
|
|
//海关关区
|
|
|
List<String> Customs = getCustoms();
|
|
|
model.put("CusToms",Customs);
|
|
|
//付款方式
|
|
|
model.put("manifest", manifest);
|
|
|
// 海关关区
|
|
|
List<String> Customs = getCustomsCode();
|
|
|
model.put("CusToms", Customs);
|
|
|
// 付款方式
|
|
|
List<String> payTypes = getPayTypes();
|
|
|
model.put("payTypes",payTypes);
|
|
|
//海关状态
|
|
|
model.put("payTypes", payTypes);
|
|
|
// 海关状态
|
|
|
List<String> customsStatus = getcustomsStatus();
|
|
|
model.put("customsStatus",customsStatus);
|
|
|
model.put("customsStatus", customsStatus);
|
|
|
|
|
|
//危险品代码
|
|
|
// 危险品代码
|
|
|
List<PubDgEntity> dgList = dgService.findAll();
|
|
|
model.put("dgList",dgList);
|
|
|
model.put("dgList", dgList);
|
|
|
|
|
|
//包装种类
|
|
|
// 包装种类
|
|
|
List<PackageTypeEntity> typeList = packageTypeService.findAll();
|
|
|
model.put("typeList",typeList);
|
|
|
model.put("typeList", typeList);
|
|
|
|
|
|
// model.addAttribute("customsStatus",flag);
|
|
|
// model.addAttribute("customsStatus",flag);
|
|
|
return model;
|
|
|
}
|
|
|
//保存或新增
|
|
|
@RequestMapping(value = "/cross/save" , method = {RequestMethod.POST })
|
|
|
|
|
|
// 保存或新增
|
|
|
@RequestMapping(value = "/cross/save", method = { RequestMethod.POST })
|
|
|
@ResponseBody
|
|
|
public ResponseModel cross_save(ManifestEntity manifest, HttpServletRequest reuqest, HttpServletResponse response){
|
|
|
public ResponseModel cross_save(ManifestEntity manifest, HttpServletRequest reuqest, HttpServletResponse response) {
|
|
|
ResponseModel model = new ResponseModel();
|
|
|
response.setHeader("Access-Control-Allow-Origin", "*");
|
|
|
try {
|
|
|
manifest.setUSER_ID(Tools.getUserId());
|
|
|
if(manifestService.isExistsByWaybill(manifest))
|
|
|
{
|
|
|
if (manifestService.isExistsByWaybill(manifest)) {
|
|
|
model.setMsg("该订单已存在!");
|
|
|
model.setStatus(500);
|
|
|
}
|
|
|
else
|
|
|
{
|
|
|
} else {
|
|
|
String stowagedate = reuqest.getParameter("stowagedate");
|
|
|
manifest.setStowagedate(manifest.getStowagedate(stowagedate));
|
|
|
//处理预配时间
|
|
|
manifest.setUSER_ID(SessionUtil.getUser().getId()); //设置用户id
|
|
|
// 处理预配时间
|
|
|
manifest.setUSER_ID(SessionUtil.getUser().getId()); // 设置用户id
|
|
|
manifest = manifestService.save(manifest);
|
|
|
model.setData(manifest);
|
|
|
model.setStatus(200);
|
|
|
model.setMsg(HttpJsonMsg.SUCCESS);
|
|
|
}
|
|
|
}catch (Exception e){
|
|
|
} catch (Exception e) {
|
|
|
model.setStatus(500);
|
|
|
model.setMsg(HttpJsonMsg.ERROR);
|
|
|
logger.error("系统异常 >>", e);
|
|
|
}
|
|
|
return model;
|
|
|
}
|
|
|
//保存并发送主单信息
|
|
|
@RequestMapping(value = "/cross/savesend" , method = {RequestMethod.POST })
|
|
|
|
|
|
// 保存并发送主单信息
|
|
|
@RequestMapping(value = "/cross/savesend", method = { RequestMethod.POST })
|
|
|
@ResponseBody
|
|
|
public ResponseModel cross_savesend(ManifestEntity manifest,HttpServletRequest request,HttpServletResponse response){
|
|
|
public ResponseModel cross_savesend(ManifestEntity manifest, HttpServletRequest request,
|
|
|
HttpServletResponse response) {
|
|
|
ResponseModel model = new ResponseModel();
|
|
|
response.setHeader("Access-Control-Allow-Origin", "*");
|
|
|
try {
|
|
|
manifest.setUSER_ID(Tools.getUserId());
|
|
|
if(manifestService.isExistsByWaybill(manifest))
|
|
|
{
|
|
|
if (manifestService.isExistsByWaybill(manifest)) {
|
|
|
model.setStatus(500);
|
|
|
model.setMsg("该订单号已存在!");
|
|
|
}
|
|
|
else
|
|
|
{
|
|
|
} else {
|
|
|
String stowagedate = request.getParameter("stowagedate");
|
|
|
manifest.setStowagedate(manifest.getStowagedate(stowagedate));
|
|
|
//保存
|
|
|
// 保存
|
|
|
manifest.setIsdelete(1);
|
|
|
manifest.setResponse_text("主单已发送");
|
|
|
manifestService.save(manifest);
|
|
|
System.out.println("收货人名称:" + manifest.getSh_name());
|
|
|
System.out.println("发货人名称:" + manifest.getCo_name());
|
|
|
System.out.println("-----------------id:"+manifest.getId());
|
|
|
//生成报文并且发送
|
|
|
System.out.println("-----------------id:" + manifest.getId());
|
|
|
// 生成报文并且发送
|
|
|
String rootPath = request.getSession().getServletContext().getRealPath("/");
|
|
|
String path = rootPath+"/excel/manifest"+new Date().getTime()+".xml";
|
|
|
System.out.println(path); //path
|
|
|
String ndlrxml = XmlUtil.convertToXml2(manifestService.sendXml(manifest), path);
|
|
|
String dlcfxml = XmlUtil.convertToXml2(manifestService.senddlcfXml(manifest), path);
|
|
|
String path = rootPath + "/excel/manifest" + new Date().getTime() + ".xml";
|
|
|
System.out.println(path); // path
|
|
|
String ndlrxml = XmlUtil.convertToXml2(manifestService.sendNDLRXml(manifest), path);
|
|
|
String dlcfxml = XmlUtil.convertToXml2(manifestService.sendDLCFXml(manifest), path);
|
|
|
System.out.println(ndlrxml);
|
|
|
System.err.println(dlcfxml);
|
|
|
new RedisSaveMessage().saveMessage(ndlrxml);
|
...
|
...
|
@@ -262,129 +272,132 @@ public class ManifestController extends BasicController{ |
|
|
model.setStatus(200);
|
|
|
model.setMsg(HttpJsonMsg.SUCCESS);
|
|
|
}
|
|
|
} catch (Exception e){
|
|
|
} catch (Exception e) {
|
|
|
model.setStatus(500);
|
|
|
model.setMsg(HttpJsonMsg.ERROR);
|
|
|
logger.error("系统异常 >>", e);
|
|
|
}
|
|
|
return model;
|
|
|
}
|
|
|
//分单列表获取接口
|
|
|
@RequestMapping(value="/cross/sub/grid.json")
|
|
|
|
|
|
// 分单列表获取接口
|
|
|
@RequestMapping(value = "/cross/sub/grid.json")
|
|
|
@ResponseBody
|
|
|
public DataGrid<PreparesecondaryEntity> cross_gridSub(Long mawbId,HttpServletRequest request, HttpServletResponse response) {
|
|
|
public DataGrid<PreparesecondaryEntity> cross_gridSub(Long mawbId, HttpServletRequest request,
|
|
|
HttpServletResponse response) {
|
|
|
response.setHeader("Access-Control-Allow-Origin", "*");
|
|
|
DataGrid<PreparesecondaryEntity> dg = new DataGrid<>();
|
|
|
dg.setRows(preparesecondaryServer.findByMawbId(mawbId));
|
|
|
return dg;
|
|
|
}
|
|
|
//获取一条分单详情的接口
|
|
|
@RequestMapping(value="/cross/subedit", method = {RequestMethod.POST })
|
|
|
|
|
|
// 获取一条分单详情的接口
|
|
|
@RequestMapping(value = "/cross/subedit", method = { RequestMethod.POST })
|
|
|
@ResponseBody
|
|
|
private Map subedit(Long id,Long mawbId, HttpServletResponse response){
|
|
|
private Map subedit(Long id, Long mawbId, HttpServletResponse response) {
|
|
|
Map model = new HashMap();
|
|
|
ManifestEntity manifest = null;
|
|
|
List<PreparesecondaryEntity> preparesecondaryList = null;
|
|
|
PreparesecondaryEntity pre = null;
|
|
|
String str = "" ;
|
|
|
String str = "";
|
|
|
response.setHeader("Access-Control-Allow-Origin", "*");
|
|
|
if(mawbId!=null){
|
|
|
if (mawbId != null) {
|
|
|
manifest = manifestService.findOne(mawbId);
|
|
|
pre = preparesecondaryServer.findOne(mawbId);
|
|
|
preparesecondaryList = preparesecondaryServer.findAll(manifest.getId());
|
|
|
if(preparesecondaryList.isEmpty()){
|
|
|
if (preparesecondaryList.isEmpty()) {
|
|
|
str = calculate(manifest);
|
|
|
}else{
|
|
|
str = calculates(manifest,preparesecondaryList);
|
|
|
} else {
|
|
|
str = calculates(manifest, preparesecondaryList);
|
|
|
}
|
|
|
}
|
|
|
if(id !=null){
|
|
|
if (id != null) {
|
|
|
pre = preparesecondaryServer.findOne(id);
|
|
|
manifest = manifestService.findOne(pre.getPreparemasterid());
|
|
|
preparesecondaryList = preparesecondaryServer.findAll(manifest.getId());
|
|
|
if(preparesecondaryList.isEmpty()){
|
|
|
if (preparesecondaryList.isEmpty()) {
|
|
|
str = calculate(manifest);
|
|
|
}else{
|
|
|
str = calculates(manifest,preparesecondaryList);
|
|
|
} else {
|
|
|
str = calculates(manifest, preparesecondaryList);
|
|
|
}
|
|
|
}
|
|
|
|
|
|
UserEntity user = SessionUtil.getUser();
|
|
|
if(user!=null && user.getAgent()!=null){
|
|
|
if (user != null && user.getAgent() != null) {
|
|
|
BasicAgentEntity agent = agentService.findOne(user.getAgent());
|
|
|
model.put("agent",agent);
|
|
|
model.put("agent", agent);
|
|
|
}
|
|
|
//海关关区
|
|
|
List<String> Customs = getCustoms();
|
|
|
model.put("CusToms",Customs);
|
|
|
//付款方式
|
|
|
// 海关关区
|
|
|
List<String> Customs = getCustomsCode();
|
|
|
model.put("CusToms", Customs);
|
|
|
// 付款方式
|
|
|
List<String> payTypes = getPayTypes();
|
|
|
model.put("payTypes",payTypes);
|
|
|
//海关状态
|
|
|
model.put("payTypes", payTypes);
|
|
|
// 海关状态
|
|
|
List<String> customsStatus = getcustomsStatus();
|
|
|
model.put("customsStatus",customsStatus);
|
|
|
model.put("customsStatus", customsStatus);
|
|
|
|
|
|
//危险品代码
|
|
|
// 危险品代码
|
|
|
List<PubDgEntity> dgList = dgService.findAll();
|
|
|
model.put("dgList",dgList);
|
|
|
model.put("dgList", dgList);
|
|
|
|
|
|
//包装种类
|
|
|
// 包装种类
|
|
|
List<PackageTypeEntity> typeList = packageTypeService.findAll();
|
|
|
model.put("typeList",typeList);
|
|
|
model.put("typeList", typeList);
|
|
|
|
|
|
model.put("is_strs",str);
|
|
|
model.put("id",mawbId);
|
|
|
model.put("manifest",manifest);
|
|
|
model.put("pre",pre);
|
|
|
model.put("is_strs", str);
|
|
|
model.put("id", mawbId);
|
|
|
model.put("manifest", manifest);
|
|
|
model.put("pre", pre);
|
|
|
return model;
|
|
|
}
|
|
|
//保存分单
|
|
|
@RequestMapping(value = "/cross/sub_save" , method = {RequestMethod.POST })
|
|
|
|
|
|
// 保存分单
|
|
|
@RequestMapping(value = "/cross/sub_save", method = { RequestMethod.POST })
|
|
|
@ResponseBody
|
|
|
public ResponseModel cross_sub_save(PreparesecondaryEntity Preparesecondary, HttpServletResponse response){
|
|
|
public ResponseModel cross_sub_save(PreparesecondaryEntity Preparesecondary, HttpServletResponse response) {
|
|
|
ResponseModel model = new ResponseModel();
|
|
|
try {
|
|
|
response.setHeader("Access-Control-Allow-Origin", "*");
|
|
|
//已存在,提示给用户
|
|
|
if(preparesecondaryServer.isExists(Preparesecondary)){
|
|
|
// 已存在,提示给用户
|
|
|
if (preparesecondaryServer.isExists(Preparesecondary)) {
|
|
|
model.setStatus(500);
|
|
|
model.setMsg("该订单号已存在!");
|
|
|
}else{
|
|
|
} else {
|
|
|
Preparesecondary.setCreateDate(new Date());
|
|
|
Preparesecondary = preparesecondaryServer.save(Preparesecondary);
|
|
|
model.setData(Preparesecondary);
|
|
|
model.setStatus(200);
|
|
|
model.setMsg(HttpJsonMsg.SUCCESS);
|
|
|
}
|
|
|
}catch (Exception e){
|
|
|
} catch (Exception e) {
|
|
|
model.setStatus(500);
|
|
|
model.setMsg(HttpJsonMsg.ERROR);
|
|
|
logger.error("系统异常 >>", e);
|
|
|
}
|
|
|
return model;
|
|
|
}
|
|
|
@RequestMapping(value = "/cross/presavesend" , method = {RequestMethod.POST })
|
|
|
|
|
|
@RequestMapping(value = "/cross/presavesend", method = { RequestMethod.POST })
|
|
|
@ResponseBody
|
|
|
public ResponseModel cross_presavesend(PreparesecondaryEntity Preparesecondary,HttpServletRequest request,
|
|
|
HttpServletResponse response){
|
|
|
public ResponseModel cross_presavesend(PreparesecondaryEntity Preparesecondary, HttpServletRequest request,
|
|
|
HttpServletResponse response) {
|
|
|
ResponseModel model = new ResponseModel();
|
|
|
try {
|
|
|
response.setHeader("Access-Control-Allow-Origin", "*");
|
|
|
if(preparesecondaryServer.isExists(Preparesecondary))
|
|
|
{
|
|
|
if (preparesecondaryServer.isExists(Preparesecondary)) {
|
|
|
model.setStatus(500);
|
|
|
model.setMsg("该订单号已存在!");
|
|
|
}
|
|
|
else{
|
|
|
} else {
|
|
|
String stowagedate = request.getParameter("stowagedate");
|
|
|
Preparesecondary.setStowagedate(Preparesecondary.getStowagedate(stowagedate));
|
|
|
|
|
|
//生成报文并且发送
|
|
|
// 生成报文并且发送
|
|
|
String rootPath = request.getSession().getServletContext().getRealPath("/");
|
|
|
String path = rootPath+"/excel/manifest"+new Date().getTime()+".xml";
|
|
|
String path = rootPath + "/excel/manifest" + new Date().getTime() + ".xml";
|
|
|
String ndlrxml = XmlUtil.convertToXml2(manifestService.presenddlcfNdlrXml(Preparesecondary), path);
|
|
|
String dlcfxml = XmlUtil.convertToXml2(manifestService.presenddlcfdlcfXml(Preparesecondary), path);
|
|
|
//发送redis储存数据
|
|
|
// 发送redis储存数据
|
|
|
// System.out.println(ndlrxml);
|
|
|
new RedisSaveMessage().saveMessage(ndlrxml);
|
|
|
new RedisSaveMessage().saveMessage(dlcfxml);
|
...
|
...
|
@@ -396,7 +409,7 @@ public class ManifestController extends BasicController{ |
|
|
Preparesecondary.setResponse_text("分单已发送");
|
|
|
preparesecondaryServer.save(Preparesecondary);
|
|
|
}
|
|
|
}catch (Exception e){
|
|
|
} catch (Exception e) {
|
|
|
model.setStatus(500);
|
|
|
model.setMsg(HttpJsonMsg.ERROR);
|
|
|
logger.error("系统异常 >>", e);
|
...
|
...
|
@@ -404,28 +417,21 @@ public class ManifestController extends BasicController{ |
|
|
return model;
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
* 查询分页数据
|
|
|
*
|
|
|
* @return
|
|
|
*/
|
|
|
@RequestMapping(value="/grid.json")
|
|
|
@RequestMapping(value = "/grid.json")
|
|
|
@ResponseBody
|
|
|
public DataGrid<ManifestEntity> grid(HttpServletRequest request,EasyPage<ManifestEntity> pageForm) {
|
|
|
public DataGrid<ManifestEntity> grid(HttpServletRequest request, EasyPage<ManifestEntity> pageForm) {
|
|
|
Map<String, Object> searchParams = Servlets.getParametersStartingWith(request, "search_");
|
|
|
// searchParams.put("EQ_isdelete", 0);
|
|
|
// searchParams.put("EQ_isdelete", 0);
|
|
|
pageForm.setSearchParams(searchParams);
|
|
|
//UserEntity ue = (UserEntity)SecurityUtils.getSubject().getSession().getAttribute("user");
|
|
|
UserEntity ue = (UserEntity)SecurityUtils.getSubject().getSession().getAttribute("user");
|
|
|
if(ue != null){
|
|
|
// UserEntity ue =
|
|
|
// (UserEntity)SecurityUtils.getSubject().getSession().getAttribute("user");
|
|
|
UserEntity ue = (UserEntity) SecurityUtils.getSubject().getSession().getAttribute("user");
|
|
|
if (ue != null) {
|
|
|
Long u = ue.getId();
|
|
|
Set<String> sk = pageForm.getSearchParams().keySet();
|
|
|
pageForm.getSearchParams().put("EQ_USER_ID", u);
|
...
|
...
|
@@ -442,22 +448,20 @@ public class ManifestController extends BasicController{ |
|
|
* @return
|
|
|
* @return
|
|
|
*/
|
|
|
@RequestMapping(value = "/infor" )
|
|
|
@RequestMapping(value = "/infor")
|
|
|
@ResponseBody
|
|
|
public List<ManifestEntity> infor(String id,Model model) {
|
|
|
public List<ManifestEntity> infor(String id, Model model) {
|
|
|
List<ManifestEntity> li = manifestService.queryByUserId(Tools.getUserId());
|
|
|
List<ManifestEntity> result = new FemyList();
|
|
|
for(ManifestEntity me : li){
|
|
|
if(result.contains(me))
|
|
|
{
|
|
|
}
|
|
|
else
|
|
|
{
|
|
|
for (ManifestEntity me : li) {
|
|
|
if (result.contains(me)) {
|
|
|
} else {
|
|
|
result.add(me);
|
|
|
}
|
|
|
}
|
|
|
return result;
|
|
|
}
|
|
|
|
|
|
/**
|
|
|
* * 模糊查询匹配信息
|
|
|
*
|
...
|
...
|
@@ -465,24 +469,21 @@ public class ManifestController extends BasicController{ |
|
|
* @return
|
|
|
* @return
|
|
|
*/
|
|
|
@RequestMapping(value = "/inforPre" )
|
|
|
@RequestMapping(value = "/inforPre")
|
|
|
@ResponseBody
|
|
|
public List<PreparesecondaryEntity> inforPre(String id,Model model) {
|
|
|
public List<PreparesecondaryEntity> inforPre(String id, Model model) {
|
|
|
List<PreparesecondaryEntity> li = preparesecondaryServer.queryByUserId(Tools.getUserId());
|
|
|
List<PreparesecondaryEntity> result = new FemyList();
|
|
|
for(PreparesecondaryEntity pe : li){
|
|
|
if(result.contains(pe)){
|
|
|
for (PreparesecondaryEntity pe : li) {
|
|
|
if (result.contains(pe)) {
|
|
|
|
|
|
}
|
|
|
else
|
|
|
{
|
|
|
} else {
|
|
|
result.add(pe);
|
|
|
}
|
|
|
}
|
|
|
return result;
|
|
|
}
|
|
|
|
|
|
|
|
|
/**
|
|
|
* 编辑
|
|
|
*
|
...
|
...
|
@@ -490,86 +491,83 @@ public class ManifestController extends BasicController{ |
|
|
* @return
|
|
|
*/
|
|
|
@RequestMapping(value = "/edit")
|
|
|
public String edit(Long id,Model model){
|
|
|
public String edit(Long id, Model model) {
|
|
|
ManifestEntity manifest = null;
|
|
|
//判断是否是便捷
|
|
|
if(id!=null){
|
|
|
// 判断是否是便捷
|
|
|
if (id != null) {
|
|
|
manifest = manifestService.findOne(id);
|
|
|
}
|
|
|
|
|
|
UserEntity user = SessionUtil.getUser();
|
|
|
if(user!=null && user.getAgent()!=null){
|
|
|
if (user != null && user.getAgent() != null) {
|
|
|
BasicAgentEntity agent = agentService.findOne(user.getAgent());
|
|
|
model.addAttribute("agent",agent);
|
|
|
if(id == null) //是新增表单
|
|
|
model.addAttribute("agent", agent);
|
|
|
if (id == null) // 是新增表单
|
|
|
{
|
|
|
manifest = new ManifestEntity();
|
|
|
manifest.setAgentcompany(agent.getNameCn());
|
|
|
manifest.setAgentman(null); //设置代理人名称为null
|
|
|
manifest.setAgentman(null); // 设置代理人名称为null
|
|
|
}
|
|
|
}
|
|
|
model.addAttribute("manifest",manifest);
|
|
|
//海关关区
|
|
|
List<String> Customs = getCustoms();
|
|
|
model.addAttribute("CusToms",Customs);
|
|
|
//付款方式
|
|
|
model.addAttribute("manifest", manifest);
|
|
|
// 海关关区
|
|
|
List<String> Customs = getCustomsCode();
|
|
|
model.addAttribute("CusToms", Customs);
|
|
|
// 付款方式
|
|
|
List<String> payTypes = getPayTypes();
|
|
|
model.addAttribute("payTypes",payTypes);
|
|
|
//海关状态
|
|
|
model.addAttribute("payTypes", payTypes);
|
|
|
// 海关状态
|
|
|
List<String> customsStatus = getcustomsStatus();
|
|
|
model.addAttribute("customsStatus",customsStatus);
|
|
|
model.addAttribute("customsStatus", customsStatus);
|
|
|
|
|
|
//危险品代码
|
|
|
// 危险品代码
|
|
|
List<PubDgEntity> dgList = dgService.findAll();
|
|
|
model.addAttribute("dgList",dgList);
|
|
|
model.addAttribute("dgList", dgList);
|
|
|
|
|
|
//包装种类
|
|
|
// 包装种类
|
|
|
List<PackageTypeEntity> typeList = packageTypeService.findAll();
|
|
|
model.addAttribute("typeList",typeList);
|
|
|
model.addAttribute("typeList", typeList);
|
|
|
|
|
|
// model.addAttribute("customsStatus",flag);
|
|
|
// model.addAttribute("customsStatus",flag);
|
|
|
return "manifest/edit";
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
* 查询主单号是否存在
|
|
|
*
|
|
|
* @param mawbNo
|
|
|
* @return
|
|
|
*/
|
|
|
@RequestMapping(value = "/queryMawbNo",method = {RequestMethod.POST})
|
|
|
@RequestMapping(value = "/queryMawbNo", method = { RequestMethod.POST })
|
|
|
@ResponseBody
|
|
|
public ResponseModel queryMawbId(Long id,String mawbNo){
|
|
|
public ResponseModel queryMawbId(Long id, String mawbNo) {
|
|
|
ResponseModel model = new ResponseModel();
|
|
|
List<ManifestEntity> list = null;
|
|
|
if(StringUtils.isNotEmpty(mawbNo)){
|
|
|
if (StringUtils.isNotEmpty(mawbNo)) {
|
|
|
list = manifestService.findByMawbNo(mawbNo);
|
|
|
}
|
|
|
boolean exist = false;
|
|
|
if(CollectionUtils.isNotEmpty(list)){
|
|
|
if(list.size()>0){
|
|
|
if (CollectionUtils.isNotEmpty(list)) {
|
|
|
if (list.size() > 0) {
|
|
|
exist = true;
|
|
|
}
|
|
|
}
|
|
|
if(exist){
|
|
|
if (exist) {
|
|
|
model.setStatus(500);
|
|
|
}
|
|
|
else {
|
|
|
} else {
|
|
|
model.setStatus(200);
|
|
|
}
|
|
|
return model;
|
|
|
}
|
|
|
|
|
|
|
|
|
/**
|
|
|
* 查询分制单分页数据
|
|
|
*
|
|
|
* @return
|
|
|
*/
|
|
|
@RequestMapping(value="/sub/grid.json")
|
|
|
@RequestMapping(value = "/sub/grid.json")
|
|
|
@ResponseBody
|
|
|
public DataGrid<PreparesecondaryEntity> gridSub(Long mawbId,HttpServletRequest request) {
|
|
|
public DataGrid<PreparesecondaryEntity> gridSub(Long mawbId, HttpServletRequest request) {
|
|
|
DataGrid<PreparesecondaryEntity> dg = new DataGrid<>();
|
|
|
dg.setRows(preparesecondaryServer.findByMawbId(mawbId));
|
|
|
return dg;
|
...
|
...
|
@@ -581,65 +579,64 @@ public class ManifestController extends BasicController{ |
|
|
* @param id
|
|
|
* @return
|
|
|
*/
|
|
|
@RequestMapping(value = "/subedit", method = {RequestMethod.GET })
|
|
|
private String subedit(Long id,Long mawbId,String type, Model model){
|
|
|
@RequestMapping(value = "/subedit", method = { RequestMethod.GET })
|
|
|
private String subedit(Long id, Long mawbId, String type, Model model) {
|
|
|
ManifestEntity manifest = null;
|
|
|
List<PreparesecondaryEntity> preparesecondaryList = null;
|
|
|
PreparesecondaryEntity pre = null;
|
|
|
String str = "" ;
|
|
|
if(mawbId!=null ){
|
|
|
String str = "";
|
|
|
if (mawbId != null) {
|
|
|
manifest = manifestService.findOne(mawbId);
|
|
|
pre = preparesecondaryServer.findOne(mawbId);
|
|
|
preparesecondaryList = preparesecondaryServer.findAll(manifest.getId());
|
|
|
if(preparesecondaryList.isEmpty()){
|
|
|
if (preparesecondaryList.isEmpty()) {
|
|
|
str = calculate(manifest);
|
|
|
}else{
|
|
|
str = calculates(manifest,preparesecondaryList);
|
|
|
} else {
|
|
|
str = calculates(manifest, preparesecondaryList);
|
|
|
}
|
|
|
}
|
|
|
if(id !=null){
|
|
|
if (id != null) {
|
|
|
pre = preparesecondaryServer.findOne(id);
|
|
|
manifest = manifestService.findOne(pre.getPreparemasterid());
|
|
|
preparesecondaryList = preparesecondaryServer.findAll(manifest.getId());
|
|
|
if(preparesecondaryList.isEmpty()){
|
|
|
if (preparesecondaryList.isEmpty()) {
|
|
|
str = calculate(manifest);
|
|
|
}else{
|
|
|
str = calculates(manifest,preparesecondaryList);
|
|
|
} else {
|
|
|
str = calculates(manifest, preparesecondaryList);
|
|
|
}
|
|
|
}
|
|
|
|
|
|
UserEntity user = SessionUtil.getUser();
|
|
|
if(user!=null && user.getAgent()!=null){
|
|
|
if (user != null && user.getAgent() != null) {
|
|
|
BasicAgentEntity agent = agentService.findOne(user.getAgent());
|
|
|
model.addAttribute("agent",agent);
|
|
|
model.addAttribute("agent", agent);
|
|
|
}
|
|
|
//海关关区
|
|
|
List<String> Customs = getCustoms();
|
|
|
model.addAttribute("CusToms",Customs);
|
|
|
//付款方式
|
|
|
// 海关关区
|
|
|
List<String> Customs = getCustomsCode();
|
|
|
model.addAttribute("CusToms", Customs);
|
|
|
// 付款方式
|
|
|
List<String> payTypes = getPayTypes();
|
|
|
model.addAttribute("payTypes",payTypes);
|
|
|
//海关状态
|
|
|
model.addAttribute("payTypes", payTypes);
|
|
|
// 海关状态
|
|
|
List<String> customsStatus = getcustomsStatus();
|
|
|
model.addAttribute("customsStatus",customsStatus);
|
|
|
model.addAttribute("customsStatus", customsStatus);
|
|
|
|
|
|
//危险品代码
|
|
|
// 危险品代码
|
|
|
List<PubDgEntity> dgList = dgService.findAll();
|
|
|
model.addAttribute("dgList",dgList);
|
|
|
model.addAttribute("dgList", dgList);
|
|
|
|
|
|
//包装种类
|
|
|
// 包装种类
|
|
|
List<PackageTypeEntity> typeList = packageTypeService.findAll();
|
|
|
model.addAttribute("typeList",typeList);
|
|
|
model.addAttribute("typeList", typeList);
|
|
|
|
|
|
model.addAttribute("is_strs",str);
|
|
|
model.addAttribute("id",mawbId);
|
|
|
model.addAttribute("manifest",manifest);
|
|
|
model.addAttribute("pre",pre);
|
|
|
model.addAttribute("is_strs", str);
|
|
|
model.addAttribute("id", mawbId);
|
|
|
model.addAttribute("manifest", manifest);
|
|
|
model.addAttribute("pre", pre);
|
|
|
return "manifest/sub_edit";
|
|
|
}
|
|
|
|
|
|
|
|
|
//计算 运单件数 运单重量 预配件数 预配重量
|
|
|
// 计算 运单件数 运单重量 预配件数 预配重量
|
|
|
private String calculates(ManifestEntity manifest, List<PreparesecondaryEntity> preparesecondaryList) {
|
|
|
int pp = 0;
|
|
|
int tw = 0;
|
...
|
...
|
@@ -647,54 +644,45 @@ public class ManifestController extends BasicController{ |
|
|
int pw = 0;
|
|
|
|
|
|
for (PreparesecondaryEntity pre : preparesecondaryList) {
|
|
|
pp += Integer.parseInt(pre.getPreparepiece()) ;
|
|
|
tw += Integer.parseInt(pre.getTotalweight()) ;
|
|
|
tp += Integer.parseInt(pre.getTotalpiece()) ;
|
|
|
pw += Integer.parseInt(pre.getPrepareweight()) ;
|
|
|
}
|
|
|
|
|
|
int zpp =Integer.parseInt(manifest.getPreparetotalpiece())-pp;
|
|
|
int ztw =Integer.parseInt(manifest.getTotalweight())-tw;
|
|
|
int ztp =Integer.parseInt(manifest.getTotalpiece())-tp;
|
|
|
int zpw =Integer.parseInt(manifest.getPreparetotalweight())-pw;
|
|
|
|
|
|
String str ="{";
|
|
|
str +="\"id\":\""+manifest.getId()+"\",";
|
|
|
str +="\"waybillnomaster\":\""+manifest.getWaybillnomaster()+"\",";
|
|
|
str +="\"totalpiece\":\""+ztp+"\",";
|
|
|
str +="\"totalweight\":\""+ztw+"\",";
|
|
|
str +="\"preparetotalpiece\":\""+zpp+"\",";
|
|
|
str +="\"preparetotalweight\":\""+zpw+"\"";
|
|
|
str +="}";
|
|
|
pp += Integer.parseInt(pre.getPreparepiece());
|
|
|
tw += Integer.parseInt(pre.getTotalweight());
|
|
|
tp += Integer.parseInt(pre.getTotalpiece());
|
|
|
pw += Integer.parseInt(pre.getPrepareweight());
|
|
|
}
|
|
|
|
|
|
int zpp = Integer.parseInt(manifest.getPreparetotalpiece()) - pp;
|
|
|
int ztw = Integer.parseInt(manifest.getTotalweight()) - tw;
|
|
|
int ztp = Integer.parseInt(manifest.getTotalpiece()) - tp;
|
|
|
int zpw = Integer.parseInt(manifest.getPreparetotalweight()) - pw;
|
|
|
|
|
|
String str = "{";
|
|
|
str += "\"id\":\"" + manifest.getId() + "\",";
|
|
|
str += "\"waybillnomaster\":\"" + manifest.getWaybillnomaster() + "\",";
|
|
|
str += "\"totalpiece\":\"" + ztp + "\",";
|
|
|
str += "\"totalweight\":\"" + ztw + "\",";
|
|
|
str += "\"preparetotalpiece\":\"" + zpp + "\",";
|
|
|
str += "\"preparetotalweight\":\"" + zpw + "\"";
|
|
|
str += "}";
|
|
|
return str;
|
|
|
}
|
|
|
|
|
|
//计算 运单件数 运单重量 预配件数 预配重量
|
|
|
// 计算 运单件数 运单重量 预配件数 预配重量
|
|
|
private String calculate(ManifestEntity manifest) {
|
|
|
String str ="{";
|
|
|
str +="\"id\":\""+manifest.getId()+"\",";
|
|
|
str +="\"waybillnomaster\":\""+manifest.getWaybillnomaster()+"\",";
|
|
|
str +="\"totalpiece\":\""+manifest.getTotalpiece()+"\",";
|
|
|
str +="\"totalweight\":\""+manifest.getTotalweight()+"\",";
|
|
|
str +="\"preparetotalpiece\":\""+manifest.getPreparetotalpiece()+"\",";
|
|
|
str +="\"preparetotalweight\":\""+manifest.getPreparetotalweight()+"\"";
|
|
|
str +="}";
|
|
|
String str = "{";
|
|
|
str += "\"id\":\"" + manifest.getId() + "\",";
|
|
|
str += "\"waybillnomaster\":\"" + manifest.getWaybillnomaster() + "\",";
|
|
|
str += "\"totalpiece\":\"" + manifest.getTotalpiece() + "\",";
|
|
|
str += "\"totalweight\":\"" + manifest.getTotalweight() + "\",";
|
|
|
str += "\"preparetotalpiece\":\"" + manifest.getPreparetotalpiece() + "\",";
|
|
|
str += "\"preparetotalweight\":\"" + manifest.getPreparetotalweight() + "\"";
|
|
|
str += "}";
|
|
|
return str;
|
|
|
}
|
|
|
|
|
|
|
|
|
//海关状态
|
|
|
// 海关状态
|
|
|
private List<String> getcustomsStatus() {
|
|
|
List<String> list = new ArrayList<>();
|
|
|
list.add("4604");
|
|
|
list.add("4620");
|
|
|
return list;
|
|
|
}
|
|
|
|
|
|
//海关关区
|
|
|
private List<String> getCustoms() {
|
|
|
List<String> list = new ArrayList<>();
|
|
|
//国际转运
|
|
|
// 国际转运
|
|
|
list.add("001");// 进、出口货物
|
|
|
list.add("002");// 国际转运货物
|
|
|
list.add("003");// 国境货物
|
...
|
...
|
@@ -702,10 +690,18 @@ public class ManifestController extends BasicController{ |
|
|
return list;
|
|
|
}
|
|
|
|
|
|
//支付方式
|
|
|
// 海关关区
|
|
|
private List<String> getCustomsCode() {
|
|
|
List<String> list = new ArrayList<>();
|
|
|
list.add("4604");
|
|
|
list.add("4620");
|
|
|
return list;
|
|
|
}
|
|
|
|
|
|
// 支付方式
|
|
|
private List<String> getPayTypes() {
|
|
|
List<String> list = new ArrayList<>();
|
|
|
//预付
|
|
|
// 预付
|
|
|
list.add("001");// 预付
|
|
|
list.add("002");// 到付
|
|
|
return list;
|
...
|
...
|
@@ -717,64 +713,63 @@ public class ManifestController extends BasicController{ |
|
|
* @param id
|
|
|
* @return
|
|
|
*/
|
|
|
// @RequestMapping(value = "/bill/edit")
|
|
|
// public String editBill(Long id,Long manifestId,Model model){
|
|
|
// ManifestBillEntity bill = null;
|
|
|
// if(id==null){
|
|
|
// bill = new ManifestBillEntity();
|
|
|
// bill.setManifestId(manifestId);
|
|
|
// }else {
|
|
|
// bill = billService.findOne(id);
|
|
|
// }
|
|
|
// //包装种类
|
|
|
// List<PackageTypeEntity> typeList = packageTypeService.findAll();
|
|
|
// model.addAttribute("typeList",typeList);
|
|
|
// model.addAttribute("bill",bill);
|
|
|
// return "manifest/edit_bill";
|
|
|
// }
|
|
|
|
|
|
//查询主单号是否已经存在
|
|
|
// @RequestMapping(value = "/bill/edit")
|
|
|
// public String editBill(Long id,Long manifestId,Model model){
|
|
|
// ManifestBillEntity bill = null;
|
|
|
// if(id==null){
|
|
|
// bill = new ManifestBillEntity();
|
|
|
// bill.setManifestId(manifestId);
|
|
|
// }else {
|
|
|
// bill = billService.findOne(id);
|
|
|
// }
|
|
|
// //包装种类
|
|
|
// List<PackageTypeEntity> typeList = packageTypeService.findAll();
|
|
|
// model.addAttribute("typeList",typeList);
|
|
|
// model.addAttribute("bill",bill);
|
|
|
// return "manifest/edit_bill";
|
|
|
// }
|
|
|
|
|
|
// 查询主单号是否已经存在
|
|
|
@RequestMapping(value = "existsManifestNo")
|
|
|
@ResponseBody
|
|
|
public ResponseModel editBill(String waybill){
|
|
|
public ResponseModel editBill(String waybill) {
|
|
|
ResponseModel model = new ResponseModel(200, null, null);
|
|
|
List<ManifestEntity> manifestList = manifestService.findByMawbNo(waybill);
|
|
|
if(manifestList.size() > 0)
|
|
|
{
|
|
|
if (manifestList.size() > 0) {
|
|
|
model.setData("该注单号已经存在了!");
|
|
|
model.setStatus(0);
|
|
|
}
|
|
|
return model;
|
|
|
}
|
|
|
|
|
|
/**
|
|
|
* 保存
|
|
|
*
|
|
|
* @param manifest
|
|
|
* @return
|
|
|
*/
|
|
|
@RequestMapping(value = "/save" , method = {RequestMethod.POST })
|
|
|
@RequestMapping(value = "/save", method = { RequestMethod.POST })
|
|
|
@ResponseBody
|
|
|
public ResponseModel save(ManifestEntity manifest, HttpServletRequest reuqest){
|
|
|
public ResponseModel save(ManifestEntity manifest, HttpServletRequest reuqest) {
|
|
|
consignorService.saveFromManifest(manifest);
|
|
|
|
|
|
ResponseModel model = new ResponseModel();
|
|
|
try {
|
|
|
manifest.setUSER_ID(Tools.getUserId());
|
|
|
if(manifestService.isExistsByWaybill(manifest))
|
|
|
{
|
|
|
if (manifestService.isExistsByWaybill(manifest)) {
|
|
|
model.setMsg("该订单已存在!");
|
|
|
model.setStatus(500);
|
|
|
}
|
|
|
else
|
|
|
{
|
|
|
} else {
|
|
|
String stowagedate = reuqest.getParameter("stowagedate");
|
|
|
manifest.setStowagedate(manifest.getStowagedate(stowagedate));
|
|
|
manifest.setSave_time(new Long(System.currentTimeMillis()));
|
|
|
//处理预配时间
|
|
|
// 处理预配时间
|
|
|
manifest = manifestService.save(manifest);
|
|
|
model.setData(manifest);
|
|
|
model.setStatus(200);
|
|
|
model.setMsg(HttpJsonMsg.SUCCESS);
|
|
|
}
|
|
|
}catch (Exception e){
|
|
|
} catch (Exception e) {
|
|
|
model.setStatus(500);
|
|
|
model.setMsg(HttpJsonMsg.ERROR);
|
|
|
logger.error("系统异常 >>", e);
|
...
|
...
|
@@ -782,136 +777,155 @@ public class ManifestController extends BasicController{ |
|
|
return model;
|
|
|
}
|
|
|
|
|
|
//撤销主单
|
|
|
// 撤销主单
|
|
|
@RequestMapping(value = "/backout")
|
|
|
@ResponseBody
|
|
|
public ResponseModel backout(HttpServletRequest request, Long id){
|
|
|
public ResponseModel backout(HttpServletRequest request, Long id) {
|
|
|
ResponseModel model = new ResponseModel(1, null, "");
|
|
|
ManifestEntity manifest = null;
|
|
|
try{
|
|
|
if(id != null)
|
|
|
{
|
|
|
try {
|
|
|
if (id != null) {
|
|
|
WaybillReceiptType type = WaybillReceiptType.DELETE;
|
|
|
|
|
|
manifest = manifestService.findOne((id));
|
|
|
String rootPath = request.getSession().getServletContext().getRealPath("/");
|
|
|
String path = rootPath+"/excel/manifest"+new Date().getTime()+".xml"; //获取生成报文路径
|
|
|
String ndlxml = XmlUtil.convertToXml2(manifestService.sendBackoutXml(manifest), path); //转换报文
|
|
|
String path = rootPath + "/excel/manifest" + new Date().getTime() + ".xml"; // 获取生成报文路径
|
|
|
String ndlxml = XmlUtil.convertToXml2(manifestService.sendBackoutXml(manifest), path); // 转换报文
|
|
|
System.out.println(path);
|
|
|
System.out.println(ndlxml);
|
|
|
new RedisSaveMessage().saveMessage(ndlxml); //发送
|
|
|
new RedisSaveMessage().saveMessage(ndlxml); // 发送
|
|
|
model.setStatus(200);
|
|
|
|
|
|
manifest.setResponse_text("撤销请求已发送");
|
|
|
manifest.setResponse_text("主单——" + type.getName());
|
|
|
manifest.setResponse_code(String.valueOf(type.getValue()));
|
|
|
manifestService.save(manifest);
|
|
|
|
|
|
receiptService.saveFromManifest(manifest, type);
|
|
|
}
|
|
|
}catch(Exception e){
|
|
|
} catch (Exception e) {
|
|
|
model.setStatus(10060);
|
|
|
model.setMsg("连接超时!");
|
|
|
}
|
|
|
return model;
|
|
|
}
|
|
|
|
|
|
/*
|
|
|
* 撤销分单
|
|
|
*/
|
|
|
@RequestMapping(value = "housebillbackout")
|
|
|
@ResponseBody
|
|
|
public ResponseModel housebillbackout(HttpServletRequest request, Long id){
|
|
|
public ResponseModel housebillbackout(HttpServletRequest request, Long id) {
|
|
|
ResponseModel model = new ResponseModel(1, null, "");
|
|
|
|
|
|
return model;
|
|
|
}
|
|
|
|
|
|
@RequestMapping(value = "app/send", method = {RequestMethod.POST})
|
|
|
@RequestMapping(value = "app/send", method = { RequestMethod.POST })
|
|
|
@ResponseBody
|
|
|
public ResponseModel app_send(ManifestEntity manifest, HttpServletRequest request, HttpServletResponse response){
|
|
|
public ResponseModel app_send(ManifestEntity manifest, HttpServletRequest request, HttpServletResponse response) {
|
|
|
ResponseModel model = new ResponseModel(200, null, "主单发送成功!");
|
|
|
|
|
|
|
|
|
return model;
|
|
|
}
|
|
|
|
|
|
/**
|
|
|
* 保存并且发送
|
|
|
* 主单提交表单保存并且发送报文
|
|
|
*
|
|
|
* @param manifest
|
|
|
* @return
|
|
|
*/
|
|
|
@RequestMapping(value = "/savesend" , method = {RequestMethod.POST })
|
|
|
@RequestMapping(value = "/savesend", method = { RequestMethod.POST })
|
|
|
@ResponseBody
|
|
|
public ResponseModel savesend(ManifestEntity manifest,HttpServletRequest request,HttpServletResponse response){
|
|
|
public ResponseModel savesend(ManifestEntity manifest, HttpServletRequest request, HttpServletResponse response) {
|
|
|
consignorService.saveFromManifest(manifest);
|
|
|
|
|
|
ResponseModel model = new ResponseModel();
|
|
|
try {
|
|
|
manifest.setUSER_ID(Tools.getUserId());
|
|
|
if(manifestService.isExistsByWaybill(manifest))
|
|
|
{
|
|
|
if (manifestService.isExistsByWaybill(manifest)) {
|
|
|
model.setStatus(500);
|
|
|
model.setMsg("该订单号已存在!");
|
|
|
}
|
|
|
else
|
|
|
{
|
|
|
String stowagedate = request.getParameter("stowagedate");
|
|
|
} else {
|
|
|
String responseCode = manifest.getResponse_code();
|
|
|
int resCode = NumKit.parseString2Int(responseCode);
|
|
|
WaybillReceiptType oldType = WaybillReceiptType.valueOf(resCode);
|
|
|
WaybillReceiptType type = oldType != null ? WaybillReceiptType.UPDATE : WaybillReceiptType.APPLY;
|
|
|
|
|
|
String stowagedate = request.getParameter("stowagedate");
|
|
|
manifest.setStowagedate(manifest.getStowagedate(stowagedate));
|
|
|
|
|
|
//保存
|
|
|
// 保存
|
|
|
manifest.setIsdelete(1);
|
|
|
manifest.setResponse_text("主单已发送");
|
|
|
manifest.setResponse_code(String.valueOf(type.getValue()));
|
|
|
manifest.setResponse_text("主单——" + type.getName());
|
|
|
manifest.setSave_time(System.currentTimeMillis());
|
|
|
manifestService.save(manifest);
|
|
|
receiptService.saveFromManifest(manifest, type);
|
|
|
|
|
|
System.out.println("收货人名称:" + manifest.getSh_name());
|
|
|
System.out.println("发货人名称:" + manifest.getCo_name());
|
|
|
System.out.println("-----------------id:"+manifest.getId());
|
|
|
//生成报文并且发送
|
|
|
System.out.println("-----------------id:" + manifest.getId());
|
|
|
// 生成报文并且发送
|
|
|
String rootPath = request.getSession().getServletContext().getRealPath("/");
|
|
|
String path = rootPath+"/excel/manifest"+new Date().getTime()+".xml";
|
|
|
System.out.println(path); //path
|
|
|
String ndlrxml = XmlUtil.convertToXml2(manifestService.sendXml(manifest), path);
|
|
|
String dlcfxml = XmlUtil.convertToXml2(manifestService.senddlcfXml(manifest), path);
|
|
|
String path = rootPath + "/excel/manifest" + new Date().getTime() + ".xml";
|
|
|
String ndlrxml = XmlUtil.convertToXml2(manifestService.sendNDLRXml(manifest), path);
|
|
|
String dlcfxml = XmlUtil.convertToXml2(manifestService.sendDLCFXml(manifest), path);
|
|
|
String slifxml = XmlUtil.convertToXml(FSXmlKit.sliXml(manifest));
|
|
|
System.out.println("===================ndlrxml===================");
|
|
|
System.out.println(ndlrxml);
|
|
|
System.out.println();
|
|
|
|
|
|
System.out.println("===================dlcfxml===================");
|
|
|
System.err.println(dlcfxml);
|
|
|
System.out.println();
|
|
|
|
|
|
System.out.println("===================slifxml===================");
|
|
|
System.err.println(slifxml);
|
|
|
System.out.println();
|
|
|
|
|
|
new RedisSaveMessage().saveMessage(ndlrxml);
|
|
|
new RedisSaveMessage().saveMessage(dlcfxml);
|
|
|
new RedisSaveMessage().saveMessage(slifxml);
|
|
|
model.setStatus(200);
|
|
|
model.setMsg(HttpJsonMsg.SUCCESS);
|
|
|
}
|
|
|
}catch (Exception e){
|
|
|
} catch (Exception e) {
|
|
|
model.setStatus(500);
|
|
|
model.setMsg(HttpJsonMsg.ERROR);
|
|
|
logger.error("系统异常 >>", e);
|
|
|
}
|
|
|
return model;
|
|
|
}
|
|
|
|
|
|
/**
|
|
|
* 发送交运报并且保存
|
|
|
*
|
|
|
* @param manifest
|
|
|
* @return
|
|
|
*/
|
|
|
@RequestMapping(value = "/sendDelivery" , method = {RequestMethod.POST })
|
|
|
@RequestMapping(value = "/sendDelivery", method = { RequestMethod.POST })
|
|
|
@ResponseBody
|
|
|
public ResponseModel sendDelivery(ManifestEntity manifest,HttpServletRequest request,HttpServletResponse response){
|
|
|
public ResponseModel sendDelivery(ManifestEntity manifest, HttpServletRequest request,
|
|
|
HttpServletResponse response) {
|
|
|
ResponseModel model = new ResponseModel();
|
|
|
try {
|
|
|
manifest.setUSER_ID(Tools.getUserId());
|
|
|
if(manifestService.isExistsByWaybill(manifest)){
|
|
|
if (manifestService.isExistsByWaybill(manifest)) {
|
|
|
model.setStatus(500);
|
|
|
model.setMsg("订单已存在!");
|
|
|
}
|
|
|
else{
|
|
|
//保存
|
|
|
} else {
|
|
|
// 保存
|
|
|
manifest.setDe_ids(1);
|
|
|
String stowagedate = request.getParameter("stowagedate");
|
|
|
manifest.setStowagedate(manifest.getStowagedate(stowagedate));
|
|
|
manifest = manifestService.save(manifest);
|
|
|
//生成报文并且发送
|
|
|
// 生成报文并且发送
|
|
|
String rootPath = request.getSession().getServletContext().getRealPath("/");
|
|
|
String path = rootPath+"/excel/manifest"+new Date().getTime()+".xml";
|
|
|
String path = rootPath + "/excel/manifest" + new Date().getTime() + ".xml";
|
|
|
String dlcfxml = XmlUtil.convertToXml2(manifestService.sendDeliveryXml(manifest), path);
|
|
|
// System.out.println(dlcfxml);
|
|
|
new RedisSaveMessage().saveMessage(dlcfxml);
|
|
|
model.setStatus(200);
|
|
|
model.setMsg(HttpJsonMsg.SUCCESS);
|
|
|
}
|
|
|
}catch (Exception e){
|
|
|
} catch (Exception e) {
|
|
|
model.setStatus(500);
|
|
|
model.setMsg(HttpJsonMsg.ERROR);
|
|
|
logger.error("系统异常 >>", e);
|
...
|
...
|
@@ -925,9 +939,9 @@ public class ManifestController extends BasicController{ |
|
|
* @param manifest
|
|
|
* @return
|
|
|
*/
|
|
|
@RequestMapping(value = "/saveis_delete" , method = {RequestMethod.POST })
|
|
|
@RequestMapping(value = "/saveis_delete", method = { RequestMethod.POST })
|
|
|
@ResponseBody
|
|
|
public ResponseModel saveis_delete(ManifestEntity manifest){
|
|
|
public ResponseModel saveis_delete(ManifestEntity manifest) {
|
|
|
ResponseModel model = new ResponseModel();
|
|
|
try {
|
|
|
manifest.setIsdelete(1);
|
...
|
...
|
@@ -935,7 +949,7 @@ public class ManifestController extends BasicController{ |
|
|
model.setData(manifest);
|
|
|
model.setStatus(200);
|
|
|
model.setMsg(HttpJsonMsg.SUCCESS);
|
|
|
}catch (Exception e){
|
|
|
} catch (Exception e) {
|
|
|
model.setStatus(500);
|
|
|
model.setMsg(HttpJsonMsg.ERROR);
|
|
|
logger.error("系统异常 >>", e);
|
...
|
...
|
@@ -949,23 +963,25 @@ public class ManifestController extends BasicController{ |
|
|
* @param manifest
|
|
|
* @return
|
|
|
*/
|
|
|
@RequestMapping(value = "/sub_save" , method = {RequestMethod.POST })
|
|
|
@RequestMapping(value = "/sub_save", method = { RequestMethod.POST })
|
|
|
@ResponseBody
|
|
|
public ResponseModel sub_save(PreparesecondaryEntity Preparesecondary){
|
|
|
public ResponseModel sub_save(PreparesecondaryEntity preparesecondary) {
|
|
|
consignorService.saveFromPreparesecondary(preparesecondary);
|
|
|
|
|
|
ResponseModel model = new ResponseModel();
|
|
|
try {
|
|
|
//已存在,提示给用户
|
|
|
if(preparesecondaryServer.isExists(Preparesecondary)){
|
|
|
// 已存在,提示给用户
|
|
|
if (preparesecondaryServer.isExists(preparesecondary)) {
|
|
|
model.setStatus(500);
|
|
|
model.setMsg("该订单号已存在!");
|
|
|
}else{
|
|
|
Preparesecondary.setCreateDate(new Date());
|
|
|
Preparesecondary = preparesecondaryServer.save(Preparesecondary);
|
|
|
model.setData(Preparesecondary);
|
|
|
} else {
|
|
|
preparesecondary.setCreateDate(new Date());
|
|
|
preparesecondary = preparesecondaryServer.save(preparesecondary);
|
|
|
model.setData(preparesecondary);
|
|
|
model.setStatus(200);
|
|
|
model.setMsg(HttpJsonMsg.SUCCESS);
|
|
|
}
|
|
|
}catch (Exception e){
|
|
|
} catch (Exception e) {
|
|
|
model.setStatus(500);
|
|
|
model.setMsg(HttpJsonMsg.ERROR);
|
|
|
logger.error("系统异常 >>", e);
|
...
|
...
|
@@ -973,28 +989,34 @@ public class ManifestController extends BasicController{ |
|
|
return model;
|
|
|
}
|
|
|
|
|
|
//撤销分单
|
|
|
// 撤销分单
|
|
|
@RequestMapping(value = "prebackout")
|
|
|
@ResponseBody
|
|
|
public ResponseModel prebackout(HttpServletRequest request, Long id){
|
|
|
public ResponseModel prebackout(HttpServletRequest request, Long id) {
|
|
|
ResponseModel model = new ResponseModel(200, null, "");
|
|
|
if(id != null)
|
|
|
{
|
|
|
System.out.println("id:"+id);
|
|
|
if (id != null) {
|
|
|
System.out.println("id:" + id);
|
|
|
PreparesecondaryEntity preparesecondary = preparesecondaryServer.findOne(id);
|
|
|
if(preparesecondary != null)
|
|
|
{
|
|
|
try{
|
|
|
if (preparesecondary != null) {
|
|
|
try {
|
|
|
WaybillReceiptType type = WaybillReceiptType.DELETE;
|
|
|
|
|
|
String rootPath = request.getSession().getServletContext().getRealPath("/");
|
|
|
String path = rootPath+"/excel/manifest"+new Date().getTime()+".xml";
|
|
|
String ndlrxml = XmlUtil.convertToXml2(manifestService.backoutpresenddlcfNdlrXml(preparesecondary), path);
|
|
|
//String dlcfxml = XmlUtil.convertToXml2(manifestService.presenddlcfdlcfXml(preparesecondary), path);
|
|
|
String path = rootPath + "/excel/manifest" + new Date().getTime() + ".xml";
|
|
|
String ndlrxml = XmlUtil.convertToXml2(manifestService.backoutpresenddlcfNdlrXml(preparesecondary),
|
|
|
path);
|
|
|
// String dlcfxml =
|
|
|
// XmlUtil.convertToXml2(manifestService.presenddlcfdlcfXml(preparesecondary),
|
|
|
// path);
|
|
|
|
|
|
//System.out.println(ndlrxml);
|
|
|
// System.out.println(ndlrxml);
|
|
|
new RedisSaveMessage().saveMessage(ndlrxml);
|
|
|
preparesecondary.setResponse_text("撤销请求已发送");
|
|
|
preparesecondary.setResponse_text("分单——" + type.getName());
|
|
|
preparesecondary.setResponse_code(String.valueOf(type.getValue()));
|
|
|
preparesecondaryServer.save(preparesecondary);
|
|
|
}catch(Exception e){
|
|
|
|
|
|
receiptService.saveFromPreparesecondary(preparesecondary, type);
|
|
|
} catch (Exception e) {
|
|
|
model.setStatus(500);
|
|
|
model.setMsg(HttpJsonMsg.ERROR);
|
|
|
}
|
...
|
...
|
@@ -1002,46 +1024,67 @@ public class ManifestController extends BasicController{ |
|
|
}
|
|
|
return model;
|
|
|
}
|
|
|
|
|
|
/**
|
|
|
* 保存并且发送
|
|
|
* 子单提交表单保存并且发送报文
|
|
|
*
|
|
|
* @param manifest
|
|
|
* @return
|
|
|
*/
|
|
|
@RequestMapping(value = "/presavesend" , method = {RequestMethod.POST })
|
|
|
@RequestMapping(value = "/presavesend", method = { RequestMethod.POST })
|
|
|
@ResponseBody
|
|
|
public ResponseModel presavesend(PreparesecondaryEntity Preparesecondary,HttpServletRequest request){
|
|
|
public ResponseModel presavesend(PreparesecondaryEntity preparesecondary, HttpServletRequest request) {
|
|
|
consignorService.saveFromPreparesecondary(preparesecondary);
|
|
|
|
|
|
ResponseModel model = new ResponseModel();
|
|
|
try {
|
|
|
if(preparesecondaryServer.isExists(Preparesecondary))
|
|
|
{
|
|
|
if (preparesecondaryServer.isExists(preparesecondary)) {
|
|
|
model.setStatus(500);
|
|
|
model.setMsg("该订单号已存在!");
|
|
|
}
|
|
|
else{
|
|
|
} else {
|
|
|
String responseCode = preparesecondary.getResponse_code();
|
|
|
int resCode = NumKit.parseString2Int(responseCode);
|
|
|
WaybillReceiptType oldType = WaybillReceiptType.valueOf(resCode);
|
|
|
WaybillReceiptType type = oldType != null ? WaybillReceiptType.UPDATE : WaybillReceiptType.APPLY;
|
|
|
|
|
|
String stowagedate = request.getParameter("stowagedate");
|
|
|
Preparesecondary.setStowagedate(Preparesecondary.getStowagedate(stowagedate));
|
|
|
//生成报文并且发送
|
|
|
preparesecondary.setStowagedate(preparesecondary.getStowagedate(stowagedate));
|
|
|
// 生成报文并且发送
|
|
|
String rootPath = request.getSession().getServletContext().getRealPath("/");
|
|
|
String path = rootPath+"/excel/manifest"+new Date().getTime()+".xml";
|
|
|
String ndlrxml = XmlUtil.convertToXml2(manifestService.presenddlcfNdlrXml(Preparesecondary), path);
|
|
|
String dlcfxml = XmlUtil.convertToXml2(manifestService.presenddlcfdlcfXml(Preparesecondary), path);
|
|
|
//发送redis储存数据
|
|
|
String path = rootPath + "/excel/manifest" + new Date().getTime() + ".xml";
|
|
|
String ndlrxml = XmlUtil.convertToXml2(manifestService.presenddlcfNdlrXml(preparesecondary), path);
|
|
|
String dlcfxml = XmlUtil.convertToXml2(manifestService.presenddlcfdlcfXml(preparesecondary), path);
|
|
|
String fhlfxml = XmlUtil.convertToXml(FSXmlKit.fhlXml(preparesecondary));
|
|
|
// 发送redis储存数据
|
|
|
// System.out.println(ndlrxml);
|
|
|
new RedisSaveMessage().saveMessage(ndlrxml);
|
|
|
new RedisSaveMessage().saveMessage(dlcfxml);
|
|
|
model.setData(Preparesecondary);
|
|
|
new RedisSaveMessage().saveMessage(fhlfxml);
|
|
|
|
|
|
model.setData(preparesecondary);
|
|
|
model.setStatus(200);
|
|
|
model.setMsg(HttpJsonMsg.SUCCESS);
|
|
|
|
|
|
System.out.println("===================ndlrxml===================");
|
|
|
System.out.println(ndlrxml);
|
|
|
System.out.println(dlcfxml);
|
|
|
System.out.println();
|
|
|
|
|
|
System.out.println("===================dlcfxml===================");
|
|
|
System.err.println(dlcfxml);
|
|
|
System.out.println();
|
|
|
|
|
|
System.out.println("===================fhlfxml===================");
|
|
|
System.err.println(fhlfxml);
|
|
|
System.out.println();
|
|
|
|
|
|
preparesecondary.setIsdelete(1);
|
|
|
preparesecondary.setResponse_code(String.valueOf(type.getValue()));
|
|
|
preparesecondary.setResponse_text("分单——" + type.getName());
|
|
|
preparesecondaryServer.save(preparesecondary);
|
|
|
receiptService.saveFromPreparesecondary(preparesecondary, type);
|
|
|
|
|
|
Preparesecondary.setIsdelete(1);
|
|
|
Preparesecondary.setResponse_text("分单已发送");
|
|
|
preparesecondaryServer.save(Preparesecondary);
|
|
|
}
|
|
|
}catch (Exception e){
|
|
|
} catch (Exception e) {
|
|
|
model.setStatus(500);
|
|
|
model.setMsg(HttpJsonMsg.ERROR);
|
|
|
logger.error("系统异常 >>", e);
|
...
|
...
|
@@ -1055,31 +1098,30 @@ public class ManifestController extends BasicController{ |
|
|
* @param manifest
|
|
|
* @return
|
|
|
*/
|
|
|
@RequestMapping(value = "/presendDelivery" , method = {RequestMethod.POST })
|
|
|
@RequestMapping(value = "/presendDelivery", method = { RequestMethod.POST })
|
|
|
@ResponseBody
|
|
|
public ResponseModel presendDelivery(PreparesecondaryEntity Preparesecondary,HttpServletRequest request){
|
|
|
public ResponseModel presendDelivery(PreparesecondaryEntity Preparesecondary, HttpServletRequest request) {
|
|
|
ResponseModel model = new ResponseModel();
|
|
|
|
|
|
try {
|
|
|
if(preparesecondaryServer.isExists(Preparesecondary)){
|
|
|
if (preparesecondaryServer.isExists(Preparesecondary)) {
|
|
|
model.setStatus(500);
|
|
|
model.setMsg("改订单号已经存在了!");
|
|
|
}
|
|
|
else{
|
|
|
} else {
|
|
|
Preparesecondary.setIsdelete(1);
|
|
|
Preparesecondary = preparesecondaryServer.save(Preparesecondary);
|
|
|
//生成报文并且发送
|
|
|
// 生成报文并且发送
|
|
|
String rootPath = request.getSession().getServletContext().getRealPath("/");
|
|
|
String path = rootPath+"/excel/manifest"+new Date().getTime()+".xml";
|
|
|
String path = rootPath + "/excel/manifest" + new Date().getTime() + ".xml";
|
|
|
String dlcfxml = XmlUtil.convertToXml2(manifestService.sendPreXml(Preparesecondary), path);
|
|
|
//发送redis储存数据
|
|
|
// 发送redis储存数据
|
|
|
// System.out.println(dlcfxml);
|
|
|
new RedisSaveMessage().saveMessage(dlcfxml);
|
|
|
model.setData(Preparesecondary);
|
|
|
model.setStatus(200);
|
|
|
model.setMsg(HttpJsonMsg.SUCCESS);
|
|
|
}
|
|
|
}catch (Exception e){
|
|
|
} catch (Exception e) {
|
|
|
model.setStatus(500);
|
|
|
model.setMsg(HttpJsonMsg.ERROR);
|
|
|
logger.error("系统异常 >>", e);
|
...
|
...
|
@@ -1093,53 +1135,51 @@ public class ManifestController extends BasicController{ |
|
|
* @param manifest
|
|
|
* @return
|
|
|
*/
|
|
|
@RequestMapping(value = "/daryMawbNo" , method = {RequestMethod.POST })
|
|
|
@RequestMapping(value = "/daryMawbNo", method = { RequestMethod.POST })
|
|
|
@ResponseBody
|
|
|
public ResponseModel daryMawbNo(Long id,String mawbNo){
|
|
|
public ResponseModel daryMawbNo(Long id, String mawbNo) {
|
|
|
ResponseModel model = new ResponseModel();
|
|
|
List<PreparesecondaryEntity> list = null;
|
|
|
if(StringUtils.isNotEmpty(mawbNo)){
|
|
|
if (StringUtils.isNotEmpty(mawbNo)) {
|
|
|
list = preparesecondaryServer.findByMawbNo(mawbNo);
|
|
|
}
|
|
|
boolean exist = false;
|
|
|
if(CollectionUtils.isNotEmpty(list)){
|
|
|
if(list.size()>0){
|
|
|
if (CollectionUtils.isNotEmpty(list)) {
|
|
|
if (list.size() > 0) {
|
|
|
exist = true;
|
|
|
}
|
|
|
}
|
|
|
if(exist){
|
|
|
if (exist) {
|
|
|
model.setStatus(500);
|
|
|
}
|
|
|
else {
|
|
|
} else {
|
|
|
model.setStatus(200);
|
|
|
}
|
|
|
return model;
|
|
|
}
|
|
|
|
|
|
|
|
|
@RequestMapping(value = "/xml",method = RequestMethod.POST)
|
|
|
@RequestMapping(value = "/xml", method = RequestMethod.POST)
|
|
|
@ResponseBody
|
|
|
public ResponseModel createXml(Long id,HttpServletRequest request,HttpServletResponse response) throws Exception {
|
|
|
public ResponseModel createXml(Long id, HttpServletRequest request, HttpServletResponse response) throws Exception {
|
|
|
ResponseModel model = new ResponseModel();
|
|
|
String rootPath = request.getSession().getServletContext().getRealPath("/");
|
|
|
String path = rootPath+"/excel/manifest"+new Date().getTime()+".xml";
|
|
|
String path = rootPath + "/excel/manifest" + new Date().getTime() + ".xml";
|
|
|
String xml = "";
|
|
|
if(id!=null){
|
|
|
xml = beanToXml(path,id);
|
|
|
if (id != null) {
|
|
|
xml = beanToXml(path, id);
|
|
|
}
|
|
|
model.setData(xml);
|
|
|
return model;
|
|
|
}
|
|
|
|
|
|
//生成报文
|
|
|
private String beanToXml(String path,Long id) throws Exception{
|
|
|
// 生成报文
|
|
|
private String beanToXml(String path, Long id) throws Exception {
|
|
|
ManifestEntity maen = manifestService.findOne(id);
|
|
|
List<PreparesecondaryEntity> preparesecondaryList = preparesecondaryServer.findAll(maen.getId());
|
|
|
|
|
|
DeclarePreparemasterXmlBody body = new DeclarePreparemasterXmlBody();
|
|
|
//设置xml开头
|
|
|
// 设置xml开头
|
|
|
XmlHead head = new XmlHead();
|
|
|
head.setMessageID("CN_MT2201_1P0_460470678920X_"+Constant.dateTimeFormatnumber.format(new Date()));
|
|
|
head.setMessageID("CN_MT2201_1P0_460470678920X_" + Constant.dateTimeFormatnumber.format(new Date()));
|
|
|
head.setFunctionCode("9");
|
|
|
head.setMessageType("MT2201");
|
|
|
head.setSenderID("460470678920X_DXPENT0000460002");
|
...
|
...
|
@@ -1147,37 +1187,37 @@ public class ManifestController extends BasicController{ |
|
|
head.setSendTime(Constant.dateTimeFormatnumber.format(new Date()));
|
|
|
head.setVersion("1.0");
|
|
|
body.setHead(head);
|
|
|
//预配舱单
|
|
|
// 预配舱单
|
|
|
ManifestDeclarationXml dec = new ManifestDeclarationXml();
|
|
|
//预配舱单主表信息
|
|
|
//承运人
|
|
|
// 预配舱单主表信息
|
|
|
// 承运人
|
|
|
ManifestCarrierXml carr = new ManifestCarrierXml();
|
|
|
carr.setId(maen.getCarrier());
|
|
|
dec.setCarrier(carr);
|
|
|
|
|
|
//起始站
|
|
|
// 起始站
|
|
|
ManifestOrgXml mo = new ManifestOrgXml();
|
|
|
mo.setId(maen.getOriginatingstation());
|
|
|
dec.setOrg(mo);
|
|
|
|
|
|
//目的站
|
|
|
// 目的站
|
|
|
ManifestDesXml md = new ManifestDesXml();
|
|
|
md.setId(maen.getDestinationstation());
|
|
|
dec.setDes(md);
|
|
|
|
|
|
//航班号-航班日期
|
|
|
// 航班号-航班日期
|
|
|
ManifestBorderTransportMeansXml mt = new ManifestBorderTransportMeansXml();
|
|
|
mt.setJourneyid(maen.getFlightno()+"/"+Constant.dateFormat.format(maen.getFlightdate()));
|
|
|
mt.setJourneyid(maen.getFlightno() + "/" + Constant.dateFormat.format(maen.getFlightdate()));
|
|
|
dec.setBordertransportmeans(mt);
|
|
|
|
|
|
ManifestConsignmentXml mcs = new ManifestConsignmentXml();
|
|
|
|
|
|
//运单号
|
|
|
// 运单号
|
|
|
ManifestTransportContractDocumentXml mac = new ManifestTransportContractDocumentXml();
|
|
|
mac.setId(maen.getWaybillnomaster());
|
|
|
mcs.setTransportcontractdocument(mac);
|
|
|
|
|
|
//装载日期
|
|
|
// 装载日期
|
|
|
ManifestLoadingLocationXml ml = new ManifestLoadingLocationXml();
|
|
|
ml.setId("CGO/4604");
|
|
|
ml.setLoadingdate(Constant.dateTimeFormatnumber.format(maen.getStowagedate()));
|
...
|
...
|
@@ -1207,29 +1247,29 @@ public class ManifestController extends BasicController{ |
|
|
mcs.setAgentname(maen.getAgentman());
|
|
|
mcs.setAgentCompany(maen.getAgentcompany());
|
|
|
|
|
|
// ManifestConsigneeXml mcons = new ManifestConsigneeXml();
|
|
|
// mcons.setName(maen.getConsigneename());
|
|
|
//
|
|
|
// ManifestAddressXml madd = new ManifestAddressXml();
|
|
|
// madd.setLine(maen.getConsigneeaddress());
|
|
|
// madd.setCityname(maen.getConsigneecity());
|
|
|
// madd.setCountrycode(maen.getCountrycode());
|
|
|
// madd.setProvincecode(maen.getProvincecode());
|
|
|
// madd.setProvincename(maen.getProvincename());
|
|
|
// madd.setZipcode(maen.getZipcode());
|
|
|
// mcons.setAddress(madd);
|
|
|
// mcs.setConsignee(mcons);
|
|
|
//
|
|
|
// ManifestConsigneeXml mcons = new ManifestConsigneeXml();
|
|
|
// mcons.setName(maen.getConsigneename());
|
|
|
//
|
|
|
// ManifestAddressXml madd = new ManifestAddressXml();
|
|
|
// madd.setLine(maen.getConsigneeaddress());
|
|
|
// madd.setCityname(maen.getConsigneecity());
|
|
|
// madd.setCountrycode(maen.getCountrycode());
|
|
|
// madd.setProvincecode(maen.getProvincecode());
|
|
|
// madd.setProvincename(maen.getProvincename());
|
|
|
// madd.setZipcode(maen.getZipcode());
|
|
|
// mcons.setAddress(madd);
|
|
|
// mcs.setConsignee(mcons);
|
|
|
//
|
|
|
ManifestConsignorXml maci = new ManifestConsignorXml();
|
|
|
// maci.setName(maen.getShippername());
|
|
|
// maci.setName(maen.getShippername());
|
|
|
ManifestsAddressXml msadd = new ManifestsAddressXml();
|
|
|
// msadd.setLine(maen.getShipperaddress());
|
|
|
// msadd.setCityname(maen.getShippercity());
|
|
|
// msadd.setLine(maen.getShipperaddress());
|
|
|
// msadd.setCityname(maen.getShippercity());
|
|
|
maci.setAddress(msadd);
|
|
|
mcs.setConsignor(maci);
|
|
|
|
|
|
//预配舱单子表信息
|
|
|
if(preparesecondaryList !=null ){
|
|
|
// 预配舱单子表信息
|
|
|
if (preparesecondaryList != null) {
|
|
|
List<ManifestConsignmentItemXml> ls = new ArrayList<ManifestConsignmentItemXml>();
|
|
|
for (PreparesecondaryEntity entity : preparesecondaryList) {
|
|
|
ManifestConsignmentItemXml maconca = new ManifestConsignmentItemXml();
|
...
|
...
|
@@ -1246,7 +1286,8 @@ public class ManifestController extends BasicController{ |
|
|
maconca.setDes(dess);
|
|
|
|
|
|
ManifestBorderTransportMeansXml mtm = new ManifestBorderTransportMeansXml();
|
|
|
mtm.setJourneyid(entity.getFlightno()+"/"+Constant.dateFormat.format(maen.getFlightdate()));;
|
|
|
mtm.setJourneyid(entity.getFlightno() + "/" + Constant.dateFormat.format(maen.getFlightdate()));
|
|
|
;
|
|
|
maconca.setBorderTransportMeans(mtm);
|
|
|
|
|
|
ManifestTransportContractDocumentXml masc = new ManifestTransportContractDocumentXml();
|
...
|
...
|
@@ -1277,23 +1318,23 @@ public class ManifestController extends BasicController{ |
|
|
maconca.setAgentname(entity.getAgentman());
|
|
|
maconca.setCustomscode(entity.getCustomscode());
|
|
|
|
|
|
// ManifestAddressXml madds = new ManifestAddressXml();
|
|
|
// madds.setLine(entity.getConsigneeaddress());
|
|
|
// madds.setCityname(entity.getConsigneecity());
|
|
|
// madds.setCountrycode(entity.getCountrycode());
|
|
|
// madds.setProvincecode(maen.getProvincecode());
|
|
|
// madds.setProvincename(entity.getProvincename());
|
|
|
// madds.setZipcode(entity.getZipcode());
|
|
|
// mcons.setAddress(madds);
|
|
|
// maconca.setConsignee(mcons);
|
|
|
//
|
|
|
// ManifestConsignorXml macis = new ManifestConsignorXml();
|
|
|
// macis.setName(entity.getShippername());
|
|
|
// ManifestsAddressXml msadds = new ManifestsAddressXml();
|
|
|
// msadds.setLine(entity.getShipperaddress());
|
|
|
// msadds.setCityname(entity.getShippercity());
|
|
|
// macis.setAddress(msadds);
|
|
|
// maconca.setConsignor(macis);
|
|
|
// ManifestAddressXml madds = new ManifestAddressXml();
|
|
|
// madds.setLine(entity.getConsigneeaddress());
|
|
|
// madds.setCityname(entity.getConsigneecity());
|
|
|
// madds.setCountrycode(entity.getCountrycode());
|
|
|
// madds.setProvincecode(maen.getProvincecode());
|
|
|
// madds.setProvincename(entity.getProvincename());
|
|
|
// madds.setZipcode(entity.getZipcode());
|
|
|
// mcons.setAddress(madds);
|
|
|
// maconca.setConsignee(mcons);
|
|
|
//
|
|
|
// ManifestConsignorXml macis = new ManifestConsignorXml();
|
|
|
// macis.setName(entity.getShippername());
|
|
|
// ManifestsAddressXml msadds = new ManifestsAddressXml();
|
|
|
// msadds.setLine(entity.getShipperaddress());
|
|
|
// msadds.setCityname(entity.getShippercity());
|
|
|
// macis.setAddress(msadds);
|
|
|
// maconca.setConsignor(macis);
|
|
|
|
|
|
ls.add(maconca);
|
|
|
}
|
...
|
...
|
@@ -1303,288 +1344,295 @@ public class ManifestController extends BasicController{ |
|
|
|
|
|
body.setDeclaration(dec);
|
|
|
|
|
|
|
|
|
ManifestDeclareMsgXml dms = new ManifestDeclareMsgXml();
|
|
|
ManifestDeclareMetaXml mdme = new ManifestDeclareMetaXml();
|
|
|
mdme.setSndr("CDCF");
|
|
|
mdme.setRcvr("");
|
|
|
mdme.setSeqn(maen.getWaybillnomaster()+Constant.dateTimeFormatnumber.format(new Date()));
|
|
|
mdme.setSeqn(maen.getWaybillnomaster() + Constant.dateTimeFormatnumber.format(new Date()));
|
|
|
mdme.setDdtm(Constant.dateTimeFormatnumber.format(new Date()));
|
|
|
mdme.setType("HYXX");
|
|
|
mdme.setStyp("CDCF");//CDCF NDLR
|
|
|
mdme.setStyp("CDCF");// CDCF NDLR
|
|
|
dms.setMeta(mdme);
|
|
|
dms.setDeclarepreparemasterxmlbody(body);
|
|
|
|
|
|
String xml = XmlUtil.convertToXml2(dms, path);
|
|
|
|
|
|
// System.out.println(xml);
|
|
|
// IMFServletManifst mis = new IMFServletManifst();
|
|
|
// mis.init(xml.toString());
|
|
|
// System.out.println(xml);
|
|
|
// IMFServletManifst mis = new IMFServletManifst();
|
|
|
// mis.init(xml.toString());
|
|
|
|
|
|
return xml;
|
|
|
}
|
|
|
|
|
|
// private String beanToXml(String path,Long id){
|
|
|
// ManifestEntity manifestEntity = manifestService.findOne(id);
|
|
|
//
|
|
|
// if(manifestEntity==null){
|
|
|
// manifestEntity = new ManifestEntity();
|
|
|
// }
|
|
|
// List<ManifestBillEntity> billList = null;
|
|
|
// ManifestBillEntity billEntity = new ManifestBillEntity();
|
|
|
// ManifestCommodityEntity commodityEntity = new ManifestCommodityEntity();
|
|
|
// ManifestContainerEntity containerEntity = new ManifestContainerEntity();
|
|
|
// if(manifestEntity.getId()!=null){
|
|
|
// billList = billService.findByManifestId(manifestEntity.getId());
|
|
|
// }
|
|
|
// if(CollectionUtils.isNotEmpty(billList)){
|
|
|
// billEntity = billList.get(0);
|
|
|
// }
|
|
|
// List<ManifestCommodityEntity> commodities = null;
|
|
|
// if(billEntity.getId()!=null){
|
|
|
// commodities = commodityService.findByBillId(billEntity.getId());
|
|
|
// }
|
|
|
// if(CollectionUtils.isNotEmpty(commodities)){
|
|
|
// commodityEntity = commodities.get(0);
|
|
|
// }
|
|
|
//
|
|
|
// DeclareXmlBody body = new DeclareXmlBody();
|
|
|
//
|
|
|
// XmlHead head = new XmlHead();
|
|
|
// head.setMessageID(id==null?"":id.toString());
|
|
|
// head.setMessageType("Manifest");
|
|
|
// head.setSenderID(SessionUtil.getUser().getId().toString());
|
|
|
// head.setSendTime(Constant.dateFormat.format(new Date()));
|
|
|
// head.setFunctionCode("");
|
|
|
// head.setReceiverID(SessionUtil.getUser().getId().toString());
|
|
|
// head.setVersion("1.0");
|
|
|
// body.setHead(head);
|
|
|
//
|
|
|
// DeclareManifestXml manifestXml = new DeclareManifestXml();
|
|
|
//
|
|
|
// NameXml nameXml = new NameXml();
|
|
|
// nameXml.setName(manifestEntity.getTransferName());
|
|
|
// manifestXml.setRepresentativePerson(nameXml);
|
|
|
//
|
|
|
// IDXml idXml = new IDXml();
|
|
|
// idXml.setId(manifestEntity.getLeaveCode());
|
|
|
// manifestXml.setExitCustomsOffice(idXml);
|
|
|
//
|
|
|
// IDXml idXml1 = new IDXml();
|
|
|
// idXml1.setId(manifestEntity.getAgentCompanyCode());
|
|
|
// manifestXml.setAgent(idXml1);
|
|
|
//
|
|
|
// IDXml idXml2 = new IDXml();
|
|
|
// idXml2.setId(manifestEntity.getCarrierCode());
|
|
|
// manifestXml.setCarrier(idXml2);
|
|
|
//
|
|
|
// DeclareBorderTransportMeansXml transportMeansXml = new DeclareBorderTransportMeansXml();
|
|
|
// transportMeansXml.setJourneyID(manifestEntity.getVoyageNo());
|
|
|
// transportMeansXml.setTypeCode(manifestEntity.getModeCode());
|
|
|
// transportMeansXml.setId(manifestEntity.getToolCode());
|
|
|
// transportMeansXml.setName(manifestEntity.getToolName());
|
|
|
// transportMeansXml.setFirstArrivalLocationID(manifestEntity.getFirstPortCode());
|
|
|
// transportMeansXml.setArrivalDateTime(manifestEntity.getFirstPortDate()!=null?Constant.dateFormat.format(manifestEntity.getFirstPortDate()):"");
|
|
|
// transportMeansXml.setDepartureDateTime(manifestEntity.getDepartureDate()!=null?Constant.dateFormat.format(manifestEntity.getDepartureDate()):"");
|
|
|
//
|
|
|
// DeclareConsignmentXml consignmentXml = new DeclareConsignmentXml();
|
|
|
//
|
|
|
// DeclareTransportContractDocumentXml contractDocumentXml = new DeclareTransportContractDocumentXml();
|
|
|
//
|
|
|
// contractDocumentXml.setId(billEntity.getLadingNo());
|
|
|
// contractDocumentXml.setChangeReasonCode(billEntity.getModifyReasonCode());
|
|
|
// contractDocumentXml.setConditionCode(billEntity.getTransportCode());
|
|
|
// consignmentXml.setTransportContractDocument(contractDocumentXml);
|
|
|
//
|
|
|
// IDXml idXml3 = new IDXml();
|
|
|
// idXml3.setId(billEntity.getSubLadingNo());
|
|
|
// consignmentXml.setAssociatedTransportDocument(idXml3);
|
|
|
//
|
|
|
// consignmentXml.setGrossVolumeMeasure(billEntity.getVolume()!=null?billEntity.getVolume().toString():"");
|
|
|
// consignmentXml.setValueAmount(billEntity.getCashType());
|
|
|
//
|
|
|
// DeclareLoadingLocationXml loadingLocationXml = new DeclareLoadingLocationXml();
|
|
|
// loadingLocationXml.setId(billEntity.getEncasementCode());
|
|
|
// loadingLocationXml.setLoadingDate(billEntity.getCarryVehicleTime());
|
|
|
// consignmentXml.setLoadingLocation(loadingLocationXml);
|
|
|
//
|
|
|
// DeclareUnloadingLocationXml unloadingLocationXml = new DeclareUnloadingLocationXml();
|
|
|
// unloadingLocationXml.setId(billEntity.getUnlodingCode());
|
|
|
// unloadingLocationXml.setArrivalDate(billEntity.getArrivalDate()!=null?Constant.dateFormat.format(billEntity.getArrivalDate()):"");
|
|
|
// consignmentXml.setUnloadingLocation(unloadingLocationXml);
|
|
|
//
|
|
|
// DeclareGoodsReceiptPlaceXml receiptPlaceXml = new DeclareGoodsReceiptPlaceXml();
|
|
|
//
|
|
|
// receiptPlaceXml.setId(billEntity.getReceiveCode());
|
|
|
// receiptPlaceXml.setName(billEntity.getReceiveName());
|
|
|
// consignmentXml.setGoodsReceiptPlace(receiptPlaceXml);
|
|
|
//
|
|
|
// IDXml idXml4 = new IDXml();
|
|
|
// idXml4.setId(billEntity.getTransitCode());
|
|
|
// consignmentXml.setTranshipmentLocation(idXml4);
|
|
|
//
|
|
|
// IDXml idXml5 = new IDXml();
|
|
|
// idXml5.setId(billEntity.getTransitDestinationCode());
|
|
|
// consignmentXml.setTransitDestination(idXml5);
|
|
|
//
|
|
|
// consignmentXml.setRoutingCountryCode(billEntity.getTransitCountryCode());
|
|
|
//
|
|
|
// IDXml idXml6 = new IDXml();
|
|
|
// idXml6.setId(billEntity.getConsignLocation());
|
|
|
// consignmentXml.setGoodsConsignedPlace(idXml6);
|
|
|
//
|
|
|
// consignmentXml.setCustomsStatusCode(billEntity.getCustomsStatusCode());
|
|
|
// consignmentXml.setTransportSplitIndicator(billEntity.getSendSign());
|
|
|
//
|
|
|
// DeclareMethodCodeXml methodCodeXml = new DeclareMethodCodeXml();
|
|
|
// methodCodeXml.setMethodCode(billEntity.getPaymentMethod());
|
|
|
// consignmentXml.setFreightPayment(methodCodeXml);
|
|
|
//
|
|
|
// DeclareConsignmentPackagingXml packagingXml = new DeclareConsignmentPackagingXml();
|
|
|
// packagingXml.setTypeCode(billEntity.getPackageType());
|
|
|
// packagingXml.setQuantityQuantity(billEntity.getPieces()!=null?billEntity.getPieces().toString():"");
|
|
|
// consignmentXml.setConsignmentPackaging(packagingXml);
|
|
|
//
|
|
|
// consignmentXml.setTotalGrossMassMeasure(billEntity.getTotalGrossWeight()!=null?billEntity.getTotalGrossWeight().toString():"");
|
|
|
//
|
|
|
// DeclarePreviousCustomsDocumentXml documentXml = new DeclarePreviousCustomsDocumentXml();
|
|
|
// documentXml.setId(billEntity.getPreviousCustomsNo());
|
|
|
// documentXml.setTypeCode(billEntity.getPreviousCustomsType());
|
|
|
// consignmentXml.setPreviousCustomsDocument(documentXml);
|
|
|
//
|
|
|
// DeclareDeliveryDestinationXml deliveryDestinationXml = new DeclareDeliveryDestinationXml();
|
|
|
// deliveryDestinationXml.setLine(billEntity.getDeliverDestination());
|
|
|
// deliveryDestinationXml.setCityName(billEntity.getDeliverCity());
|
|
|
// deliveryDestinationXml.setCountrySubEntityName(billEntity.getDeliverProvinceCode());
|
|
|
// deliveryDestinationXml.setPostcodeID(billEntity.getDeliverPostCode());
|
|
|
// deliveryDestinationXml.setCountryCode(billEntity.getDeliverCountryCode());
|
|
|
// consignmentXml.setDeliveryDestination(deliveryDestinationXml);
|
|
|
//
|
|
|
// DeclareIntermediateCarrierXml intermediateCarrierXml = new DeclareIntermediateCarrierXml();
|
|
|
// intermediateCarrierXml.setId(billEntity.getCarrierSign());
|
|
|
// DeclareCommunicationXml communicationXml = new DeclareCommunicationXml();
|
|
|
// communicationXml.setId(billEntity.getCarrierContactNo());
|
|
|
// communicationXml.setTypeID(billEntity.getCarrierContactType());
|
|
|
// intermediateCarrierXml.setCommunication(communicationXml);
|
|
|
// consignmentXml.setIntermediateCarrier(intermediateCarrierXml);
|
|
|
//
|
|
|
// //收货人
|
|
|
// DeclareConsigneeXml consigneeXml = new DeclareConsigneeXml();
|
|
|
// consigneeXml.setId(billEntity.getReceiverCode());
|
|
|
// consigneeXml.setName(billEntity.getReceiverName());
|
|
|
//
|
|
|
// DeclareAddressXml addressXml = new DeclareAddressXml();
|
|
|
// addressXml.setLine(billEntity.getReceiverAddress());
|
|
|
// addressXml.setCityName(billEntity.getReceiverCity());
|
|
|
// addressXml.setCountrySubEntityID(billEntity.getReceiverProvinceCode());
|
|
|
// addressXml.setCountrySubEntityName(billEntity.getReceiverProvince());
|
|
|
// addressXml.setCountryCode(billEntity.getReceiverCountryCode());
|
|
|
// addressXml.setPostcodeID(billEntity.getReceiverPostCode());
|
|
|
// consigneeXml.setAddress(addressXml);
|
|
|
// DeclareCommunicationXml communicationXml1 = new DeclareCommunicationXml();
|
|
|
// communicationXml1.setId(billEntity.getReceiverContactNo());
|
|
|
// communicationXml1.setTypeID(billEntity.getReceiverContactType());
|
|
|
// consigneeXml.setCommunication(communicationXml1);
|
|
|
//
|
|
|
// DeclareContactXml contactXml = new DeclareContactXml();
|
|
|
// contactXml.setName(billEntity.getReceiverName());
|
|
|
// DeclareCommunicationXml communicationXml2 = new DeclareCommunicationXml();
|
|
|
// communicationXml2.setId(billEntity.getReceiverContactNo());
|
|
|
// communicationXml2.setTypeID(billEntity.getReceiverContactType());
|
|
|
// contactXml.setCommunication(communicationXml2);
|
|
|
// consigneeXml.setContact(contactXml);
|
|
|
//
|
|
|
// consignmentXml.setConsignee(consigneeXml);
|
|
|
//
|
|
|
// //发货人
|
|
|
// DeclareConsigneeXml consigneeXml1 = new DeclareConsigneeXml();
|
|
|
// consigneeXml1.setId(billEntity.getSenderCode());
|
|
|
// consigneeXml1.setName(billEntity.getSenderName());
|
|
|
// DeclareAddressXml addressXml1 = new DeclareAddressXml();
|
|
|
// addressXml1.setLine(billEntity.getSenderAddress());
|
|
|
// addressXml1.setCityName(billEntity.getSenderCity());
|
|
|
// addressXml1.setCountrySubEntityID(billEntity.getSenderProvinceCode());
|
|
|
// addressXml1.setCountrySubEntityName(billEntity.getSenderProvince());
|
|
|
// addressXml1.setPostcodeID(billEntity.getSenderPostCode());
|
|
|
// addressXml1.setCountryCode(billEntity.getSenderCountryCode());
|
|
|
// consigneeXml1.setAddress(addressXml1);
|
|
|
// DeclareCommunicationXml communicationXml3 = new DeclareCommunicationXml();
|
|
|
// communicationXml3.setId(billEntity.getSenderContactNo());
|
|
|
// communicationXml3.setTypeID(billEntity.getSenderContactType());
|
|
|
// consigneeXml1.setCommunication(communicationXml3);
|
|
|
// consignmentXml.setConsignor(consigneeXml1);
|
|
|
//
|
|
|
// //通知人
|
|
|
// DeclareConsigneeXml consigneeXml2 = new DeclareConsigneeXml();
|
|
|
// consigneeXml2.setId(billEntity.getNotifierCode());
|
|
|
// consigneeXml2.setName(billEntity.getNotifier());
|
|
|
// addressXml.setLine(billEntity.getNotifierAddress());
|
|
|
// addressXml.setCityName(billEntity.getNotifierCity());
|
|
|
// addressXml.setCountrySubEntityID(billEntity.getNotifierProvinceCode());
|
|
|
// addressXml.setCountrySubEntityName(billEntity.getNotifierProvince());
|
|
|
// addressXml.setPostcodeID(billEntity.getNotifierPostCode());
|
|
|
// addressXml.setCountryCode(billEntity.getNotifierCountryCode());
|
|
|
// consigneeXml2.setAddress(addressXml);
|
|
|
// DeclareCommunicationXml communicationXml4 = new DeclareCommunicationXml();
|
|
|
// communicationXml4.setId(billEntity.getNotifierContact());
|
|
|
// communicationXml4.setTypeID(billEntity.getNotifierContactCode());
|
|
|
// consigneeXml2.setCommunication(communicationXml4);
|
|
|
// consignmentXml.setNotifyParty(consigneeXml2);
|
|
|
//
|
|
|
// //危险品联系人
|
|
|
// DeclareUNDGContactXml dgXml = new DeclareUNDGContactXml();
|
|
|
// dgXml.setName(billEntity.getDangerContact());
|
|
|
// DeclareCommunicationXml communicationXml5 = new DeclareCommunicationXml();
|
|
|
// communicationXml5.setId(billEntity.getDangerContactNo());
|
|
|
// communicationXml5.setTypeID(billEntity.getDangerContactType());
|
|
|
// dgXml.setCommunication(communicationXml5);
|
|
|
// consignmentXml.setuNDGContact(dgXml);
|
|
|
//
|
|
|
// //商品信息
|
|
|
// DeclareConsignmentItemXml itemXml = new DeclareConsignmentItemXml();
|
|
|
// itemXml.setSequenceNumeric(commodityEntity.getSerialNo());
|
|
|
// DeclareConsignmentItemPackagingXml itemPackagingXml = new DeclareConsignmentItemPackagingXml();
|
|
|
// itemPackagingXml.setQuantityQuantity(commodityEntity.getPieces()!=null?commodityEntity.getPieces().toString():"");
|
|
|
// itemPackagingXml.setTypeCode(commodityEntity.getPackageType());
|
|
|
// itemPackagingXml.setMarksNumbers(commodityEntity.getMark());
|
|
|
// itemXml.setConsignmentItemPackaging(itemPackagingXml);
|
|
|
//
|
|
|
// DeclareCommodityXml commodityXml = new DeclareCommodityXml();
|
|
|
// commodityXml.setCargoDescription(commodityEntity.getSummary());
|
|
|
// commodityXml.setuNDGCode(commodityEntity.getDangerNo());
|
|
|
// commodityXml.setTariffClassificationCode(commodityEntity.getTariffNo());
|
|
|
//
|
|
|
// ContentXml contentXml = new ContentXml();
|
|
|
// contentXml.setContent(commodityEntity.getRemark());
|
|
|
// itemXml.setAdditionalInformation(contentXml);
|
|
|
//
|
|
|
// DeclareGoodsMeasureXml goodsMeasureXml = new DeclareGoodsMeasureXml();
|
|
|
// goodsMeasureXml.setGrossMassMeasure(commodityEntity.getGrossWeight()!=null?commodityEntity.getGrossWeight().toString():"");
|
|
|
// itemXml.setGoodsMeasure(goodsMeasureXml);
|
|
|
//
|
|
|
// DeclareCustomsProcedureXml procedureXml = new DeclareCustomsProcedureXml();
|
|
|
// procedureXml.setCurrentCode(commodityEntity.getProcedureCode());
|
|
|
// itemXml.setCustomsProcedure(procedureXml);
|
|
|
//
|
|
|
// idXml.setId(commodityEntity.getConsign());
|
|
|
// itemXml.setuCR(idXml);
|
|
|
//
|
|
|
// DeclareOriginXml originXml = new DeclareOriginXml();
|
|
|
// originXml.setOriginCountryCode(commodityEntity.getOriginCode());
|
|
|
// itemXml.setOrigin(originXml);
|
|
|
// consignmentXml.setConsignmentItem(itemXml);
|
|
|
//
|
|
|
// manifestXml.setConsignment(consignmentXml);
|
|
|
//
|
|
|
// contentXml.setContent(manifestEntity.getRemark());
|
|
|
// manifestXml.setAdditionalInformation(contentXml);
|
|
|
//
|
|
|
// body.setDeclaration(manifestXml);
|
|
|
// String xml = XmlUtil.convertToXml2(body, path);
|
|
|
// return xml;
|
|
|
// }
|
|
|
|
|
|
|
|
|
// private String beanToXml(String path,Long id){
|
|
|
// ManifestEntity manifestEntity = manifestService.findOne(id);
|
|
|
//
|
|
|
// if(manifestEntity==null){
|
|
|
// manifestEntity = new ManifestEntity();
|
|
|
// }
|
|
|
// List<ManifestBillEntity> billList = null;
|
|
|
// ManifestBillEntity billEntity = new ManifestBillEntity();
|
|
|
// ManifestCommodityEntity commodityEntity = new ManifestCommodityEntity();
|
|
|
// ManifestContainerEntity containerEntity = new ManifestContainerEntity();
|
|
|
// if(manifestEntity.getId()!=null){
|
|
|
// billList = billService.findByManifestId(manifestEntity.getId());
|
|
|
// }
|
|
|
// if(CollectionUtils.isNotEmpty(billList)){
|
|
|
// billEntity = billList.get(0);
|
|
|
// }
|
|
|
// List<ManifestCommodityEntity> commodities = null;
|
|
|
// if(billEntity.getId()!=null){
|
|
|
// commodities = commodityService.findByBillId(billEntity.getId());
|
|
|
// }
|
|
|
// if(CollectionUtils.isNotEmpty(commodities)){
|
|
|
// commodityEntity = commodities.get(0);
|
|
|
// }
|
|
|
//
|
|
|
// DeclareXmlBody body = new DeclareXmlBody();
|
|
|
//
|
|
|
// XmlHead head = new XmlHead();
|
|
|
// head.setMessageID(id==null?"":id.toString());
|
|
|
// head.setMessageType("Manifest");
|
|
|
// head.setSenderID(SessionUtil.getUser().getId().toString());
|
|
|
// head.setSendTime(Constant.dateFormat.format(new Date()));
|
|
|
// head.setFunctionCode("");
|
|
|
// head.setReceiverID(SessionUtil.getUser().getId().toString());
|
|
|
// head.setVersion("1.0");
|
|
|
// body.setHead(head);
|
|
|
//
|
|
|
// DeclareManifestXml manifestXml = new DeclareManifestXml();
|
|
|
//
|
|
|
// NameXml nameXml = new NameXml();
|
|
|
// nameXml.setName(manifestEntity.getTransferName());
|
|
|
// manifestXml.setRepresentativePerson(nameXml);
|
|
|
//
|
|
|
// IDXml idXml = new IDXml();
|
|
|
// idXml.setId(manifestEntity.getLeaveCode());
|
|
|
// manifestXml.setExitCustomsOffice(idXml);
|
|
|
//
|
|
|
// IDXml idXml1 = new IDXml();
|
|
|
// idXml1.setId(manifestEntity.getAgentCompanyCode());
|
|
|
// manifestXml.setAgent(idXml1);
|
|
|
//
|
|
|
// IDXml idXml2 = new IDXml();
|
|
|
// idXml2.setId(manifestEntity.getCarrierCode());
|
|
|
// manifestXml.setCarrier(idXml2);
|
|
|
//
|
|
|
// DeclareBorderTransportMeansXml transportMeansXml = new
|
|
|
// DeclareBorderTransportMeansXml();
|
|
|
// transportMeansXml.setJourneyID(manifestEntity.getVoyageNo());
|
|
|
// transportMeansXml.setTypeCode(manifestEntity.getModeCode());
|
|
|
// transportMeansXml.setId(manifestEntity.getToolCode());
|
|
|
// transportMeansXml.setName(manifestEntity.getToolName());
|
|
|
// transportMeansXml.setFirstArrivalLocationID(manifestEntity.getFirstPortCode());
|
|
|
// transportMeansXml.setArrivalDateTime(manifestEntity.getFirstPortDate()!=null?Constant.dateFormat.format(manifestEntity.getFirstPortDate()):"");
|
|
|
// transportMeansXml.setDepartureDateTime(manifestEntity.getDepartureDate()!=null?Constant.dateFormat.format(manifestEntity.getDepartureDate()):"");
|
|
|
//
|
|
|
// DeclareConsignmentXml consignmentXml = new DeclareConsignmentXml();
|
|
|
//
|
|
|
// DeclareTransportContractDocumentXml contractDocumentXml = new
|
|
|
// DeclareTransportContractDocumentXml();
|
|
|
//
|
|
|
// contractDocumentXml.setId(billEntity.getLadingNo());
|
|
|
// contractDocumentXml.setChangeReasonCode(billEntity.getModifyReasonCode());
|
|
|
// contractDocumentXml.setConditionCode(billEntity.getTransportCode());
|
|
|
// consignmentXml.setTransportContractDocument(contractDocumentXml);
|
|
|
//
|
|
|
// IDXml idXml3 = new IDXml();
|
|
|
// idXml3.setId(billEntity.getSubLadingNo());
|
|
|
// consignmentXml.setAssociatedTransportDocument(idXml3);
|
|
|
//
|
|
|
// consignmentXml.setGrossVolumeMeasure(billEntity.getVolume()!=null?billEntity.getVolume().toString():"");
|
|
|
// consignmentXml.setValueAmount(billEntity.getCashType());
|
|
|
//
|
|
|
// DeclareLoadingLocationXml loadingLocationXml = new
|
|
|
// DeclareLoadingLocationXml();
|
|
|
// loadingLocationXml.setId(billEntity.getEncasementCode());
|
|
|
// loadingLocationXml.setLoadingDate(billEntity.getCarryVehicleTime());
|
|
|
// consignmentXml.setLoadingLocation(loadingLocationXml);
|
|
|
//
|
|
|
// DeclareUnloadingLocationXml unloadingLocationXml = new
|
|
|
// DeclareUnloadingLocationXml();
|
|
|
// unloadingLocationXml.setId(billEntity.getUnlodingCode());
|
|
|
// unloadingLocationXml.setArrivalDate(billEntity.getArrivalDate()!=null?Constant.dateFormat.format(billEntity.getArrivalDate()):"");
|
|
|
// consignmentXml.setUnloadingLocation(unloadingLocationXml);
|
|
|
//
|
|
|
// DeclareGoodsReceiptPlaceXml receiptPlaceXml = new
|
|
|
// DeclareGoodsReceiptPlaceXml();
|
|
|
//
|
|
|
// receiptPlaceXml.setId(billEntity.getReceiveCode());
|
|
|
// receiptPlaceXml.setName(billEntity.getReceiveName());
|
|
|
// consignmentXml.setGoodsReceiptPlace(receiptPlaceXml);
|
|
|
//
|
|
|
// IDXml idXml4 = new IDXml();
|
|
|
// idXml4.setId(billEntity.getTransitCode());
|
|
|
// consignmentXml.setTranshipmentLocation(idXml4);
|
|
|
//
|
|
|
// IDXml idXml5 = new IDXml();
|
|
|
// idXml5.setId(billEntity.getTransitDestinationCode());
|
|
|
// consignmentXml.setTransitDestination(idXml5);
|
|
|
//
|
|
|
// consignmentXml.setRoutingCountryCode(billEntity.getTransitCountryCode());
|
|
|
//
|
|
|
// IDXml idXml6 = new IDXml();
|
|
|
// idXml6.setId(billEntity.getConsignLocation());
|
|
|
// consignmentXml.setGoodsConsignedPlace(idXml6);
|
|
|
//
|
|
|
// consignmentXml.setCustomsStatusCode(billEntity.getCustomsStatusCode());
|
|
|
// consignmentXml.setTransportSplitIndicator(billEntity.getSendSign());
|
|
|
//
|
|
|
// DeclareMethodCodeXml methodCodeXml = new DeclareMethodCodeXml();
|
|
|
// methodCodeXml.setMethodCode(billEntity.getPaymentMethod());
|
|
|
// consignmentXml.setFreightPayment(methodCodeXml);
|
|
|
//
|
|
|
// DeclareConsignmentPackagingXml packagingXml = new
|
|
|
// DeclareConsignmentPackagingXml();
|
|
|
// packagingXml.setTypeCode(billEntity.getPackageType());
|
|
|
// packagingXml.setQuantityQuantity(billEntity.getPieces()!=null?billEntity.getPieces().toString():"");
|
|
|
// consignmentXml.setConsignmentPackaging(packagingXml);
|
|
|
//
|
|
|
// consignmentXml.setTotalGrossMassMeasure(billEntity.getTotalGrossWeight()!=null?billEntity.getTotalGrossWeight().toString():"");
|
|
|
//
|
|
|
// DeclarePreviousCustomsDocumentXml documentXml = new
|
|
|
// DeclarePreviousCustomsDocumentXml();
|
|
|
// documentXml.setId(billEntity.getPreviousCustomsNo());
|
|
|
// documentXml.setTypeCode(billEntity.getPreviousCustomsType());
|
|
|
// consignmentXml.setPreviousCustomsDocument(documentXml);
|
|
|
//
|
|
|
// DeclareDeliveryDestinationXml deliveryDestinationXml = new
|
|
|
// DeclareDeliveryDestinationXml();
|
|
|
// deliveryDestinationXml.setLine(billEntity.getDeliverDestination());
|
|
|
// deliveryDestinationXml.setCityName(billEntity.getDeliverCity());
|
|
|
// deliveryDestinationXml.setCountrySubEntityName(billEntity.getDeliverProvinceCode());
|
|
|
// deliveryDestinationXml.setPostcodeID(billEntity.getDeliverPostCode());
|
|
|
// deliveryDestinationXml.setCountryCode(billEntity.getDeliverCountryCode());
|
|
|
// consignmentXml.setDeliveryDestination(deliveryDestinationXml);
|
|
|
//
|
|
|
// DeclareIntermediateCarrierXml intermediateCarrierXml = new
|
|
|
// DeclareIntermediateCarrierXml();
|
|
|
// intermediateCarrierXml.setId(billEntity.getCarrierSign());
|
|
|
// DeclareCommunicationXml communicationXml = new DeclareCommunicationXml();
|
|
|
// communicationXml.setId(billEntity.getCarrierContactNo());
|
|
|
// communicationXml.setTypeID(billEntity.getCarrierContactType());
|
|
|
// intermediateCarrierXml.setCommunication(communicationXml);
|
|
|
// consignmentXml.setIntermediateCarrier(intermediateCarrierXml);
|
|
|
//
|
|
|
// //收货人
|
|
|
// DeclareConsigneeXml consigneeXml = new DeclareConsigneeXml();
|
|
|
// consigneeXml.setId(billEntity.getReceiverCode());
|
|
|
// consigneeXml.setName(billEntity.getReceiverName());
|
|
|
//
|
|
|
// DeclareAddressXml addressXml = new DeclareAddressXml();
|
|
|
// addressXml.setLine(billEntity.getReceiverAddress());
|
|
|
// addressXml.setCityName(billEntity.getReceiverCity());
|
|
|
// addressXml.setCountrySubEntityID(billEntity.getReceiverProvinceCode());
|
|
|
// addressXml.setCountrySubEntityName(billEntity.getReceiverProvince());
|
|
|
// addressXml.setCountryCode(billEntity.getReceiverCountryCode());
|
|
|
// addressXml.setPostcodeID(billEntity.getReceiverPostCode());
|
|
|
// consigneeXml.setAddress(addressXml);
|
|
|
// DeclareCommunicationXml communicationXml1 = new DeclareCommunicationXml();
|
|
|
// communicationXml1.setId(billEntity.getReceiverContactNo());
|
|
|
// communicationXml1.setTypeID(billEntity.getReceiverContactType());
|
|
|
// consigneeXml.setCommunication(communicationXml1);
|
|
|
//
|
|
|
// DeclareContactXml contactXml = new DeclareContactXml();
|
|
|
// contactXml.setName(billEntity.getReceiverName());
|
|
|
// DeclareCommunicationXml communicationXml2 = new DeclareCommunicationXml();
|
|
|
// communicationXml2.setId(billEntity.getReceiverContactNo());
|
|
|
// communicationXml2.setTypeID(billEntity.getReceiverContactType());
|
|
|
// contactXml.setCommunication(communicationXml2);
|
|
|
// consigneeXml.setContact(contactXml);
|
|
|
//
|
|
|
// consignmentXml.setConsignee(consigneeXml);
|
|
|
//
|
|
|
// //发货人
|
|
|
// DeclareConsigneeXml consigneeXml1 = new DeclareConsigneeXml();
|
|
|
// consigneeXml1.setId(billEntity.getSenderCode());
|
|
|
// consigneeXml1.setName(billEntity.getSenderName());
|
|
|
// DeclareAddressXml addressXml1 = new DeclareAddressXml();
|
|
|
// addressXml1.setLine(billEntity.getSenderAddress());
|
|
|
// addressXml1.setCityName(billEntity.getSenderCity());
|
|
|
// addressXml1.setCountrySubEntityID(billEntity.getSenderProvinceCode());
|
|
|
// addressXml1.setCountrySubEntityName(billEntity.getSenderProvince());
|
|
|
// addressXml1.setPostcodeID(billEntity.getSenderPostCode());
|
|
|
// addressXml1.setCountryCode(billEntity.getSenderCountryCode());
|
|
|
// consigneeXml1.setAddress(addressXml1);
|
|
|
// DeclareCommunicationXml communicationXml3 = new DeclareCommunicationXml();
|
|
|
// communicationXml3.setId(billEntity.getSenderContactNo());
|
|
|
// communicationXml3.setTypeID(billEntity.getSenderContactType());
|
|
|
// consigneeXml1.setCommunication(communicationXml3);
|
|
|
// consignmentXml.setConsignor(consigneeXml1);
|
|
|
//
|
|
|
// //通知人
|
|
|
// DeclareConsigneeXml consigneeXml2 = new DeclareConsigneeXml();
|
|
|
// consigneeXml2.setId(billEntity.getNotifierCode());
|
|
|
// consigneeXml2.setName(billEntity.getNotifier());
|
|
|
// addressXml.setLine(billEntity.getNotifierAddress());
|
|
|
// addressXml.setCityName(billEntity.getNotifierCity());
|
|
|
// addressXml.setCountrySubEntityID(billEntity.getNotifierProvinceCode());
|
|
|
// addressXml.setCountrySubEntityName(billEntity.getNotifierProvince());
|
|
|
// addressXml.setPostcodeID(billEntity.getNotifierPostCode());
|
|
|
// addressXml.setCountryCode(billEntity.getNotifierCountryCode());
|
|
|
// consigneeXml2.setAddress(addressXml);
|
|
|
// DeclareCommunicationXml communicationXml4 = new DeclareCommunicationXml();
|
|
|
// communicationXml4.setId(billEntity.getNotifierContact());
|
|
|
// communicationXml4.setTypeID(billEntity.getNotifierContactCode());
|
|
|
// consigneeXml2.setCommunication(communicationXml4);
|
|
|
// consignmentXml.setNotifyParty(consigneeXml2);
|
|
|
//
|
|
|
// //危险品联系人
|
|
|
// DeclareUNDGContactXml dgXml = new DeclareUNDGContactXml();
|
|
|
// dgXml.setName(billEntity.getDangerContact());
|
|
|
// DeclareCommunicationXml communicationXml5 = new DeclareCommunicationXml();
|
|
|
// communicationXml5.setId(billEntity.getDangerContactNo());
|
|
|
// communicationXml5.setTypeID(billEntity.getDangerContactType());
|
|
|
// dgXml.setCommunication(communicationXml5);
|
|
|
// consignmentXml.setuNDGContact(dgXml);
|
|
|
//
|
|
|
// //商品信息
|
|
|
// DeclareConsignmentItemXml itemXml = new DeclareConsignmentItemXml();
|
|
|
// itemXml.setSequenceNumeric(commodityEntity.getSerialNo());
|
|
|
// DeclareConsignmentItemPackagingXml itemPackagingXml = new
|
|
|
// DeclareConsignmentItemPackagingXml();
|
|
|
// itemPackagingXml.setQuantityQuantity(commodityEntity.getPieces()!=null?commodityEntity.getPieces().toString():"");
|
|
|
// itemPackagingXml.setTypeCode(commodityEntity.getPackageType());
|
|
|
// itemPackagingXml.setMarksNumbers(commodityEntity.getMark());
|
|
|
// itemXml.setConsignmentItemPackaging(itemPackagingXml);
|
|
|
//
|
|
|
// DeclareCommodityXml commodityXml = new DeclareCommodityXml();
|
|
|
// commodityXml.setCargoDescription(commodityEntity.getSummary());
|
|
|
// commodityXml.setuNDGCode(commodityEntity.getDangerNo());
|
|
|
// commodityXml.setTariffClassificationCode(commodityEntity.getTariffNo());
|
|
|
//
|
|
|
// ContentXml contentXml = new ContentXml();
|
|
|
// contentXml.setContent(commodityEntity.getRemark());
|
|
|
// itemXml.setAdditionalInformation(contentXml);
|
|
|
//
|
|
|
// DeclareGoodsMeasureXml goodsMeasureXml = new DeclareGoodsMeasureXml();
|
|
|
// goodsMeasureXml.setGrossMassMeasure(commodityEntity.getGrossWeight()!=null?commodityEntity.getGrossWeight().toString():"");
|
|
|
// itemXml.setGoodsMeasure(goodsMeasureXml);
|
|
|
//
|
|
|
// DeclareCustomsProcedureXml procedureXml = new DeclareCustomsProcedureXml();
|
|
|
// procedureXml.setCurrentCode(commodityEntity.getProcedureCode());
|
|
|
// itemXml.setCustomsProcedure(procedureXml);
|
|
|
//
|
|
|
// idXml.setId(commodityEntity.getConsign());
|
|
|
// itemXml.setuCR(idXml);
|
|
|
//
|
|
|
// DeclareOriginXml originXml = new DeclareOriginXml();
|
|
|
// originXml.setOriginCountryCode(commodityEntity.getOriginCode());
|
|
|
// itemXml.setOrigin(originXml);
|
|
|
// consignmentXml.setConsignmentItem(itemXml);
|
|
|
//
|
|
|
// manifestXml.setConsignment(consignmentXml);
|
|
|
//
|
|
|
// contentXml.setContent(manifestEntity.getRemark());
|
|
|
// manifestXml.setAdditionalInformation(contentXml);
|
|
|
//
|
|
|
// body.setDeclaration(manifestXml);
|
|
|
// String xml = XmlUtil.convertToXml2(body, path);
|
|
|
// return xml;
|
|
|
// }
|
|
|
|
|
|
/**
|
|
|
* 保存
|
...
|
...
|
@@ -1593,17 +1641,17 @@ public class ManifestController extends BasicController{ |
|
|
* @return
|
|
|
*/
|
|
|
@ResponseBody
|
|
|
@RequestMapping(value = "/bill/save",method = RequestMethod.POST)
|
|
|
public ResponseModel saveBill(String billJson,String voJson){
|
|
|
@RequestMapping(value = "/bill/save", method = RequestMethod.POST)
|
|
|
public ResponseModel saveBill(String billJson, String voJson) {
|
|
|
ResponseModel model = new ResponseModel();
|
|
|
try {
|
|
|
ManifestBillEntity bill = JSONObject.parseObject(billJson,ManifestBillEntity.class);
|
|
|
List<CommodityVo> voList = JSONArray.parseArray(voJson,CommodityVo.class);
|
|
|
bill = billService.save(bill,voList);
|
|
|
ManifestBillEntity bill = JSONObject.parseObject(billJson, ManifestBillEntity.class);
|
|
|
List<CommodityVo> voList = JSONArray.parseArray(voJson, CommodityVo.class);
|
|
|
bill = billService.save(bill, voList);
|
|
|
model.setData(bill.getManifestId());
|
|
|
model.setStatus(200);
|
|
|
model.setMsg(HttpJsonMsg.SUCCESS);
|
|
|
}catch (Exception e){
|
|
|
} catch (Exception e) {
|
|
|
model.setStatus(500);
|
|
|
model.setMsg(HttpJsonMsg.ERROR);
|
|
|
logger.error("系统异常 >>", e);
|
...
|
...
|
@@ -1611,32 +1659,31 @@ public class ManifestController extends BasicController{ |
|
|
|
|
|
return model;
|
|
|
}
|
|
|
|
|
|
/*
|
|
|
* 获取3字码对应的信息,然后自动填写上
|
|
|
*/
|
|
|
@RequestMapping("/gettreecode")
|
|
|
@ResponseBody
|
|
|
public ResponseModel gettreecode(HttpServletRequest request, String STOCKPRE){
|
|
|
public ResponseModel gettreecode(HttpServletRequest request, String STOCKPRE) {
|
|
|
ResponseModel model = new ResponseModel(1, null, "");
|
|
|
|
|
|
//这种方法获取到了对象的数量,但是获取不到对象本省,有问题,暂时不用这种方法
|
|
|
// List<TBasCarrierEntity> tbc = tbasService.findAll();
|
|
|
// for(int i = 0; i < tbc.size(); i ++)
|
|
|
// {
|
|
|
// }
|
|
|
// model.setData(tbc);
|
|
|
if(STOCKPRE != null)
|
|
|
{
|
|
|
// 这种方法获取到了对象的数量,但是获取不到对象本省,有问题,暂时不用这种方法
|
|
|
// List<TBasCarrierEntity> tbc = tbasService.findAll();
|
|
|
// for(int i = 0; i < tbc.size(); i ++)
|
|
|
// {
|
|
|
// }
|
|
|
// model.setData(tbc);
|
|
|
if (STOCKPRE != null) {
|
|
|
Connection c = DBConnection.dbConn("CGOASM", "vmvnv1v2");
|
|
|
//List<TBasCarrierEntity> list = new ArrayList<TBasCarrierEntity>();
|
|
|
// List<TBasCarrierEntity> list = new ArrayList<TBasCarrierEntity>();
|
|
|
Statement sql;
|
|
|
try {
|
|
|
sql = c.createStatement(ResultSet.TYPE_SCROLL_INSENSITIVE, ResultSet.CONCUR_UPDATABLE);
|
|
|
String sqlStr = "SELECT * FROM T_BAS_CARRIER WHERE STOCKPRE='"+STOCKPRE+"'";
|
|
|
String sqlStr = "SELECT * FROM T_BAS_CARRIER WHERE STOCKPRE='" + STOCKPRE + "'";
|
|
|
ResultSet rs = sql.executeQuery(sqlStr);
|
|
|
|
|
|
while(rs.next())
|
|
|
{
|
|
|
while (rs.next()) {
|
|
|
TBasCarrierEntity tbs = new TBasCarrierEntity();
|
|
|
tbs.setcARRIERID(rs.getString(1));
|
|
|
tbs.setsTOCKPRE(rs.getString(2));
|
...
|
...
|
@@ -1646,8 +1693,8 @@ public class ManifestController extends BasicController{ |
|
|
tbs.setcARRYWAY(rs.getString(6));
|
|
|
tbs.setoPERATIONTIME(rs.getString(7));
|
|
|
tbs.setiSFOREIGN(rs.getString(8));
|
|
|
//tbs.setfREQORDERING(rs.getInt(9));
|
|
|
//tbs.setId(rs.getInt(9)));
|
|
|
// tbs.setfREQORDERING(rs.getInt(9));
|
|
|
// tbs.setId(rs.getInt(9)));
|
|
|
model.setData(tbs);
|
|
|
}
|
|
|
} catch (SQLException e) {
|
...
|
...
|
@@ -1659,38 +1706,39 @@ public class ManifestController extends BasicController{ |
|
|
|
|
|
return model;
|
|
|
}
|
|
|
|
|
|
/**
|
|
|
* 获取商品信息
|
|
|
*
|
|
|
* @param billId
|
|
|
* @return
|
|
|
*/
|
|
|
@ResponseBody
|
|
|
@RequestMapping(value = "/commodity/get",method = RequestMethod.POST)
|
|
|
public String getCommodity(Long billId){
|
|
|
return JSON.toJSONString(commodityService.getCommodityVos(billId),filter);
|
|
|
@RequestMapping(value = "/commodity/get", method = RequestMethod.POST)
|
|
|
public String getCommodity(Long billId) {
|
|
|
return JSON.toJSONString(commodityService.getCommodityVos(billId), filter);
|
|
|
}
|
|
|
|
|
|
|
|
|
/**
|
|
|
* 编辑商品信息
|
|
|
*
|
|
|
* @param id
|
|
|
* @return
|
|
|
*/
|
|
|
@RequestMapping(value = "/commodity/edit")
|
|
|
public String getContainer(Long id,Model model){
|
|
|
public String getContainer(Long id, Model model) {
|
|
|
CommodityVo vo = new CommodityVo();
|
|
|
model.addAttribute("vo",vo);
|
|
|
model.addAttribute("vo", vo);
|
|
|
return "manifest/edit_commodity";
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
* 删除
|
|
|
*
|
|
|
* @param ids
|
|
|
* @return
|
|
|
*/
|
|
|
@RequestMapping(value = "/delete" , method = {RequestMethod.POST })
|
|
|
@RequestMapping(value = "/delete", method = { RequestMethod.POST })
|
|
|
@ResponseBody
|
|
|
public ResponseModel delete(String ids) {
|
|
|
ResponseModel model = new ResponseModel();
|
...
|
...
|
@@ -1708,10 +1756,11 @@ public class ManifestController extends BasicController{ |
|
|
|
|
|
/**
|
|
|
* 删除
|
|
|
*
|
|
|
* @param ids
|
|
|
* @return
|
|
|
*/
|
|
|
@RequestMapping(value = "/subdelete" , method = {RequestMethod.POST })
|
|
|
@RequestMapping(value = "/subdelete", method = { RequestMethod.POST })
|
|
|
@ResponseBody
|
|
|
public ResponseModel subdelete(Long id) {
|
|
|
ResponseModel model = new ResponseModel();
|
...
|
...
|
@@ -1727,14 +1776,13 @@ public class ManifestController extends BasicController{ |
|
|
return model;
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
* 删除
|
|
|
*
|
|
|
* @param id
|
|
|
* @return
|
|
|
*/
|
|
|
@RequestMapping(value = "/bill/delete" , method = {RequestMethod.POST })
|
|
|
@RequestMapping(value = "/bill/delete", method = { RequestMethod.POST })
|
|
|
@ResponseBody
|
|
|
public ResponseModel deleteBill(Long id) {
|
|
|
ResponseModel model = new ResponseModel();
|
...
|
...
|
@@ -1750,5 +1798,4 @@ public class ManifestController extends BasicController{ |
|
|
return model;
|
|
|
}
|
|
|
|
|
|
|
|
|
} |
...
|
...
|
|