作者 Promise

提交版本

正在显示 54 个修改的文件 包含 3791 行增加0 行删除

要显示太多修改。

为保证性能只显示 54 of 54+ 个文件。

# java_base
基于java springmvc集成mybatis、mybatis Generator、maven、shiro的基本项目开发框架
\ No newline at end of file
... ...
Manifest-Version: 1.0
Class-Path:
... ...
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<groupId>com.tianbo</groupId>
<artifactId>statistics</artifactId>
<version>1.0-SNAPSHOT</version>
<build>
<finalName>statistics</finalName>
<plugins>
<!--mybatis 逆向工程插件-->
<plugin>
<groupId>org.mybatis.generator</groupId>
<artifactId>mybatis-generator-maven-plugin</artifactId>
<version>1.3.2</version>
<configuration>
<verbose>true</verbose>
<overwrite>true</overwrite>
</configuration>
<dependencies>
<dependency>
<groupId>com.tianbo</groupId>
<artifactId>plugin</artifactId>
<version>1.0</version>
<scope>system</scope>
<systemPath>/Users/mrz/Documents/maven/plugin.jar</systemPath>
</dependency>
</dependencies>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-surefire-plugin</artifactId>
<version>2.19.1</version>
<configuration>
<includes>
<include>**/*.java</include>
</includes>
</configuration>
</plugin>
</plugins>
</build>
<properties>
<spring.version>4.3.10.RELEASE</spring.version>
<shiro.version>1.2.3</shiro.version>
<!-- log4j日志文件管理包版本 -->
<slf4j.version>1.6.6</slf4j.version>
<log4j.version>1.2.17</log4j.version>
<commons-lang3.version>3.3</commons-lang3.version>
<commons-collections.version>3.2.1</commons-collections.version>
<jackson.version>2.8.9</jackson.version>
<junit.version>4.12</junit.version>
<ehcache.version>2.6.8</ehcache.version>
</properties>
<dependencies>
<!-- springframe start -->
<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-core</artifactId>
<version>${spring.version}</version>
</dependency>
<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-web</artifactId>
<version>${spring.version}</version>
</dependency>
<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-oxm</artifactId>
<version>${spring.version}</version>
</dependency>
<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-tx</artifactId>
<version>${spring.version}</version>
</dependency>
<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-jdbc</artifactId>
<version>${spring.version}</version>
</dependency>
<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-webmvc</artifactId>
<version>${spring.version}</version>
</dependency>
<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-aop</artifactId>
<version>${spring.version}</version>
</dependency>
<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-context-support</artifactId>
<version>${spring.version}</version>
</dependency>
<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-test</artifactId>
<version>${spring.version}</version>
</dependency>
<!-- springframe end -->
<!--aspectj start-->
<dependency>
<groupId>org.aspectj</groupId>
<artifactId>aspectjweaver</artifactId>
<version>1.8.6</version>
</dependency>
<dependency>
<groupId>com.google.code.gson</groupId>
<artifactId>gson</artifactId>
<version>2.6.2</version>
</dependency>
<dependency>
<groupId>org.aspectj</groupId>
<artifactId>aspectjrt</artifactId>
<version>1.8.6</version>
</dependency>
<!--aspectj end-->
<!--commons-io start-->
<dependency>
<groupId>commons-io</groupId>
<artifactId>commons-io</artifactId>
<version>2.4</version>
</dependency>
<!--commons-io end-->
<!--c3p0-->
<dependency>
<groupId>com.mchange</groupId>
<artifactId>c3p0</artifactId>
<version>0.9.5.1</version>
</dependency>
<dependency>
<groupId>org.jdom</groupId>
<artifactId>jdom2</artifactId>
<version>2.0.6</version>
</dependency>
<!--servlet/jsp api start-->
<dependency>
<groupId>javax.servlet</groupId>
<artifactId>servlet-api</artifactId>
<version>2.5</version>
</dependency>
<dependency>
<groupId>javax.servlet.jsp</groupId>
<artifactId>jsp-api</artifactId>
<version>2.1</version>
<scope>provided</scope>
</dependency>
<!--servlet/jsp api end-->
<!--junit4-->
<dependency>
<groupId>junit</groupId>
<artifactId>junit</artifactId>
<version>${junit.version}</version>
<scope>test</scope>
</dependency>
<!--mybatis-->
<dependency>
<groupId>org.mybatis</groupId>
<artifactId>mybatis</artifactId>
<version>3.3.0</version>
</dependency>
<!--mybatis spring整合-->
<dependency>
<groupId>org.mybatis</groupId>
<artifactId>mybatis-spring</artifactId>
<version>1.2.3</version>
</dependency>
<!--mysql driver-->
<dependency>
<groupId>mysql</groupId>
<artifactId>mysql-connector-java</artifactId>
<version>5.1.6</version>
</dependency>
<!--jstl-->
<dependency>
<groupId>jstl</groupId>
<artifactId>jstl</artifactId>
<version>1.2</version>
</dependency>
<!--oracle driver-->
<dependency>
<groupId>com.oracle</groupId>
<artifactId>ojdbc6</artifactId>
<version>11.2.0.4.0-atlassian-hosted</version>
</dependency>
<!-- ehcache -->
<dependency>
<groupId>net.sf.ehcache</groupId>
<artifactId>ehcache-core</artifactId>
<version>${ehcache.version}</version>
</dependency>
<!--shiro-->
<dependency>
<groupId>org.apache.shiro</groupId>
<artifactId>shiro-core</artifactId>
<version>${shiro.version}</version>
</dependency>
<dependency>
<groupId>org.apache.shiro</groupId>
<artifactId>shiro-web</artifactId>
<version>${shiro.version}</version>
</dependency>
<dependency>
<groupId>org.apache.shiro</groupId>
<artifactId>shiro-cas</artifactId>
<version>${shiro.version}</version>
</dependency>
<dependency>
<groupId>org.apache.shiro</groupId>
<artifactId>shiro-spring</artifactId>
<version>${shiro.version}</version>
</dependency>
<dependency>
<groupId>org.apache.shiro</groupId>
<artifactId>shiro-ehcache</artifactId>
<version>${shiro.version}</version>
</dependency>
<!-- 日志文件管理包 -->
<!-- log start -->
<dependency>
<groupId>log4j</groupId>
<artifactId>log4j</artifactId>
<version>${log4j.version}</version>
</dependency>
<dependency>
<groupId>org.slf4j</groupId>
<artifactId>slf4j-api</artifactId>
<version>${slf4j.version}</version>
</dependency>
<dependency>
<groupId>org.slf4j</groupId>
<artifactId>slf4j-log4j12</artifactId>
<version>${slf4j.version}</version>
</dependency>
<!-- log end -->
<dependency>
<groupId>commons-collections</groupId>
<artifactId>commons-collections</artifactId>
<version>${commons-collections.version}</version>
</dependency>
<dependency>
<groupId>org.apache.commons</groupId>
<artifactId>commons-lang3</artifactId>
<version>${commons-lang3.version}</version>
</dependency>
<!--jackson-->
<dependency>
<groupId>com.fasterxml.jackson.core</groupId>
<artifactId>jackson-core</artifactId>
<version>${jackson.version}</version>
</dependency>
<dependency>
<groupId>com.fasterxml.jackson.core</groupId>
<artifactId>jackson-databind</artifactId>
<version>${jackson.version}</version>
</dependency>
<dependency>
<groupId>com.fasterxml.jackson.core</groupId>
<artifactId>jackson-annotations</artifactId>
<version>${jackson.version}</version>
</dependency>
<dependency>
<groupId>org.apache.cxf</groupId>
<artifactId>cxf</artifactId>
<version>2.7.18</version>
<type>pom</type>
</dependency>
</dependencies>
</project>
\ No newline at end of file
... ...
package com.tianbo.common;
import com.tianbo.util.dao.Page;
import com.tianbo.util.dao.Totals;
import java.io.Serializable;
import java.util.List;
/**
* 返回对象以及对象分页
* @param <T>
*/
public class ModelAndPage<T> implements Serializable {
private static final long serialVersionUID = 6732325477388107799L;
private List<T> modelList;
private Page page;
private Totals totals;
public ModelAndPage(){
}
public ModelAndPage(List<T> list,Page page){
this.modelList = list;
this.page = page;
}
public ModelAndPage(List<T> list,Page page,Totals totals){
this.modelList = list;
this.page = page;
this.totals = totals;
}
public List<T> getModel() {
return modelList;
}
public void setModel(List<T> model) {
this.modelList = model;
}
public Page getPage() {
return page;
}
public void setPage(Page page) {
this.page = page;
}
public Totals getTotals() {
return totals;
}
public void setTotals(Totals totals) {
this.totals = totals;
}
}
... ...
package com.tianbo.common;
/**
* 解析XML文件
* @author zhangfan
*
*/
import java.io.File;
import java.io.FileInputStream;
import java.io.IOException;
import java.util.ArrayList;
import java.util.List;
import org.jdom2.Document;
import org.jdom2.Element;
import org.jdom2.input.SAXBuilder;
import com.tianbo.util.PropertiesUtils;
import com.tianbo.util.dao.flightMsg;
public class ReadXML {
private List<flightMsg> flightMsg = null;
private flightMsg flightBean = null;
private List<String> path = null;
private int count = 0;
public List<String> fileName(String fileName) {
File file = new File(fileName);
if(!file.exists()){//判断文件夹是否创建,没有创建则创建新文件夹
file.mkdirs();
}
File[] files = file.listFiles();
path = new ArrayList<String>();
for (int i = 0; i < files.length; i++) {
if (files[i].isFile()&&files[i].getPath().endsWith("xml")) {
String address = files[i].getPath();
String add = files[i].getName().substring(5, 9);
if(add.equals("1201")) {
path.add(address);
}
}
}
return path;
}
public List<flightMsg> getFlightMassage(List<String> path) {
flightMsg = new ArrayList<flightMsg>();
for (int i = 0; i <path.size(); i++) {
String fileName =path.get(i);
SAXBuilder saxBuilder = new SAXBuilder();
try {
Document document = saxBuilder.build(new FileInputStream(fileName));
Element element = document.getRootElement();
List<Element> elementList = element.getChildren();
flightBean = new flightMsg();
for (Element msgElement : elementList) {
List<Element> children = msgElement.getChildren();
for (Element chiElement : children) {
if(chiElement.getName().equals("MessageID")){
String id = chiElement.getValue();
flightBean.setPath(fileName);
String massageId = id.substring(id.length()-6).trim();
flightBean.setMassageId(massageId);
}else
if (chiElement.getName().equals("BorderTransportMeans")) {
List<Element> list = chiElement.getChildren();
for (Element element1 : list) {
if (element1.getName().equals("JourneyID")) {
String flightNO = element1.getValue().trim();
String[] msg = flightNO.split("/");
flightBean.setFlightNO(msg[0]);
flightBean.setFlightData(msg[1]);
}
}
} else if (chiElement.getName().equals("Consignment")) {
List<Element> list = chiElement.getChildren();
for (Element element1 : list) {
if (element1.getName().equals("ConsignmentPackaging")) {
String orderPrice = element1.getValue().trim();
flightBean.setOrderPrice(orderPrice);
} else if (element1.getName().equals("TotalGrossMassMeasure")) {
double orderHeight = Double.parseDouble(element1.getValue());
flightBean.setOrderHeight(orderHeight);
} else if (element1.getName().equals("ConsignmentItem")) {
List<Element> Shippinglist = element1.getChildren();
for (Element element2 : Shippinglist) {
if (element2.getName().equals("ConsignmentItemPackaging")) {
String shippingBillPrice = element2.getValue().trim();
flightBean.setShippingBillPrice(shippingBillPrice);
} else if (element2.getName().equals("GoodsMeasure")) {
double shippingBillHeight = Double.parseDouble(element2.getValue());
flightBean.setShippingBillHeight(shippingBillHeight);
}
}
}else if (element1.getName().equals("TransportContractDocument")) {
List<Element> orderFormIds = element1.getChildren();
for (Element element2 : orderFormIds) {
if (element2.getName().equals("ID")) {
String orderFormId = element2.getValue();
flightBean.setOrderFormId(orderFormId);
}
}
}else if (element1.getName().equals("TransportSplitIndicator")) {
int struts = Integer.parseInt(element1.getValue());
flightBean.setIdentifying(struts);
}else if(element1.getName().equals("CustomsStatusCode")){
String customsStatusCode = element1.getValue().trim();
flightBean.setCustomsStatusCode(customsStatusCode);
}
}
}
}
}
} catch (Exception e) {
e.printStackTrace();
}
if(flightBean.getOrderPrice().equals(flightBean.getShippingBillPrice()) && Double.toString(flightBean.getOrderHeight()).equals(Double.toString(flightBean.getShippingBillHeight()))
&&flightBean.getIdentifying() != 1 && flightBean.getCustomsStatusCode()!="002"){
sendFile s = new sendFile();
String patht = PropertiesUtils.readProperty("targetPath");
s.move(flightBean.getPath(), patht);
}else{
flightMsg.add(flightBean);
}
}
return flightMsg;
}
public static void main(String[] args) {
// String fileName = "E:/xmlBean.xml";
String fileName = PropertiesUtils.readProperty("path");
// new ReadXML().fileName(fileName1);
List<String> path = new ReadXML().fileName("e:/");
List<flightMsg> xmlflightMsg = new ReadXML().getFlightMassage(path);
for (flightMsg flightBean : xmlflightMsg) {
System.out.println(flightBean);
}
}
public List<String> fileName4(String fileName) {
File file = new File(fileName);
if(!file.exists()){//判断文件夹是否创建,没有创建则创建新文件夹
file.mkdirs();
}
File[] files = file.listFiles();
path = new ArrayList<String>();
for (int i = 0; i < files.length; i++) {
if (files[i].isFile()&&files[i].getPath().endsWith("xml")) {
String address = files[i].getPath();
String add = files[i].getName().substring(5, 9);
if(add.equals("2201")) {
path.add(address);
}
}
}
return path;
}
}
... ...
package com.tianbo.common;
import java.io.File;
import com.tianbo.util.PropertiesUtils;
public class sendFile {
public void move(String fileName,String path) {
// String fileName="e://xmlBean.xml";
// String endPath = "d://";
try {
File startFile = new File(fileName);
File tmpFile = new File(path);//获取文件夹路径
if(!tmpFile.exists()){//判断文件夹是否创建,没有创建则创建新文件夹
tmpFile.mkdirs();
}
System.out.println(path + startFile.getName());
if (startFile.renameTo(new File(path + startFile.getName()))) {
System.out.println("File is moved successful!");
} else {
System.out.println("File is failed to move!");
}
} catch (Exception e) {
e.printStackTrace();
}
}
// public static void main(String[] args) {
// new sendFile().move("d://xmlBean.xml","e:/");
// }
}
\ No newline at end of file
... ...
package com.tianbo.controller;
import java.util.List;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.servlet.ModelAndView;
import com.tianbo.common.ReadXML;
import com.tianbo.util.PropertiesUtils;
import com.tianbo.util.dao.flightMsg;
@Controller
public class CompareController {
@RequestMapping("/compare1")
public ModelAndView dateCompare1() {
ModelAndView modelAndView = new ModelAndView();
String disk = PropertiesUtils.readProperty("path1");
List<String> path = new ReadXML().fileName(disk);
List<flightMsg> flightMsgs = new ReadXML().getFlightMassage(path);
modelAndView.addObject("list", flightMsgs);
modelAndView.setViewName("DateCompare");
return modelAndView;
}
@RequestMapping("/compareSDM")
public ModelAndView dateCompareSDM() {
ModelAndView modelAndView = new ModelAndView();
String disk = PropertiesUtils.readProperty("path2");
List<String> path = new ReadXML().fileName(disk);
List<flightMsg> flightMsgs = new ReadXML().getFlightMassage(path);
modelAndView.addObject("list", flightMsgs);
modelAndView.setViewName("DateCompare");
return modelAndView;
}
@RequestMapping("/compare3")
public ModelAndView dateCompare3() {
ModelAndView modelAndView = new ModelAndView();
String disk = PropertiesUtils.readProperty("path3");
List<String> path = new ReadXML().fileName(disk);
List<flightMsg> flightMsgs = new ReadXML().getFlightMassage(path);
modelAndView.addObject("list", flightMsgs);
modelAndView.setViewName("DateCompare");
return modelAndView;
}
@RequestMapping("/compare4")
public ModelAndView dateCompare4() {
ModelAndView modelAndView = new ModelAndView();
String disk = PropertiesUtils.readProperty("path4");
List<String> path = new ReadXML().fileName4(disk);
List<flightMsg> flightMsgs = new ReadXML().getFlightMassage(path);
modelAndView.addObject("list", flightMsgs);
modelAndView.setViewName("DateCompare");
return modelAndView;
}
}
... ...
package com.tianbo.controller;
import java.text.SimpleDateFormat;
import java.util.Date;
import java.util.List;
import java.util.UUID;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpSession;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.ui.ModelMap;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.ResponseBody;
import com.tianbo.model.Arrivedmaster;
import com.tianbo.model.Originmanifestmaster;
import com.tianbo.model.Originmanifestsecondary;
import com.tianbo.model.Preparemaster;
import com.tianbo.service.DataService;
import com.tianbo.service.imp.ArriveService;
import com.tianbo.service.imp.OriginmaniService;
import com.tianbo.service.imp.PreService;
import com.tianbo.util.DateUtils;
import com.tianbo.util.json.AjaxJson;
/**
* 数据转预配Controller
* @author Promise
*
*/
@Controller
@RequestMapping("/Data")
public class DataController {
@Autowired
private DataService dataService;
@RequestMapping(value = "todata")
public String toTransForm() {
return "updateform";
}
@RequestMapping(value = "toT")
public String toT() {
return "updateT";
}
@RequestMapping(value = "updateMain", method = RequestMethod.POST)
@ResponseBody
public AjaxJson updateMain(HttpSession session,ModelMap modelMap,
@RequestParam String flightno,
@RequestParam String flightdate
)
{
String message = null;
AjaxJson j = new AjaxJson();
try {
Originmanifestmaster mainfest = new Originmanifestmaster();
mainfest.setFlightno(flightno);
mainfest.setFlightDate(flightdate);
dataService.updateMain(mainfest);
j.setSuccess(true);
message = "主单更新完毕";
} catch (Exception e) {
j.setSuccess(false);
message = "主单更新失败";
// TODO Auto-generated catch block
e.printStackTrace();
}
j.setMsg(message);
return j;
}
@RequestMapping(value = "updateSecond", method = RequestMethod.POST)
@ResponseBody
public AjaxJson updateSecond(HttpSession session,ModelMap modelMap,
@RequestParam String flightno,
@RequestParam String flightdate
)
{
String message = null;
AjaxJson j = new AjaxJson();
try {
Originmanifestmaster mainfest = new Originmanifestmaster();
mainfest.setFlightno(flightno);
mainfest.setFlightDate(flightdate);
dataService.update(mainfest);
j.setSuccess(true);
message = "分单更新完成";
} catch (Exception e) {
j.setSuccess(false);
message = "分单更新失败";
// TODO Auto-generated catch block
e.printStackTrace();
}
j.setMsg(message);
return j;
}
@RequestMapping(value = "updateMainStatus", method = RequestMethod.POST)
@ResponseBody
public AjaxJson updateMainStatus(HttpSession session,ModelMap modelMap,
@RequestParam String flightno,
@RequestParam String flightdate
)
{
String message = null;
AjaxJson j = new AjaxJson();
try {
Originmanifestmaster mainfest = new Originmanifestmaster();
mainfest.setFlightno(flightno);
mainfest.setFlightDate(flightdate);
dataService.updateMainStatus(mainfest);
j.setSuccess(true);
message = "主单状态更新完成";
} catch (Exception e) {
j.setSuccess(false);
message = "主单状态更新失败";
e.printStackTrace();
}
j.setMsg(message);
return j;
}
@RequestMapping(value = "updateStatus", method = RequestMethod.POST)
@ResponseBody
public AjaxJson updateStatus(HttpSession session,ModelMap modelMap,
@RequestParam String flightno,
@RequestParam String flightdate
)
{
String message = null;
AjaxJson j = new AjaxJson();
try {
Originmanifestmaster mainfest = new Originmanifestmaster();
mainfest.setFlightno(flightno);
mainfest.setFlightDate(flightdate);
dataService.updateStatus(mainfest);
j.setSuccess(true);
message = "分单状态更新完成";
} catch (Exception e) {
j.setSuccess(false);
message = "分单状态更新失败";
// TODO Auto-generated catch block
e.printStackTrace();
}
j.setMsg(message);
return j;
}
@RequestMapping(value = "updateAllMainStatus", method = RequestMethod.POST)
@ResponseBody
public AjaxJson updateAllMainStatus(HttpSession session,ModelMap modelMap,
@RequestParam String flightno,
@RequestParam String flightdate
)
{
String message = null;
AjaxJson j = new AjaxJson();
try {
Originmanifestmaster mainfest = new Originmanifestmaster();
mainfest.setFlightno(flightno);
mainfest.setFlightDate(flightdate);
dataService.updateAllMainStatus(mainfest);
j.setSuccess(true);
message = "主单状态全部更新完成";
} catch (Exception e) {
j.setSuccess(false);
message = "主单状态全部更新失败";
e.printStackTrace();
}
j.setMsg(message);
return j;
}
@RequestMapping(value = "updateAllStatus", method = RequestMethod.POST)
@ResponseBody
public AjaxJson updateAllStatus(HttpSession session,ModelMap modelMap,
@RequestParam String flightno,
@RequestParam String flightdate
)
{
String message = null;
AjaxJson j = new AjaxJson();
try {
Originmanifestmaster mainfest = new Originmanifestmaster();
mainfest.setFlightno(flightno);
mainfest.setFlightDate(flightdate);
dataService.updateAllStatus(mainfest);
j.setSuccess(true);
message = "分单状态全部更新完成";
} catch (Exception e) {
j.setSuccess(false);
message = "分单状态全部更新失败";
// TODO Auto-generated catch block
e.printStackTrace();
}
j.setMsg(message);
return j;
}
@RequestMapping(value = "updateT", method = RequestMethod.POST)
@ResponseBody
public AjaxJson updateT(HttpSession session,ModelMap modelMap,@RequestParam String billNo)
{
String message = null;
AjaxJson j = new AjaxJson();
try {
Originmanifestmaster mainfest = new Originmanifestmaster();
mainfest.setWaybillnomaster(billNo);
dataService.updateToT(mainfest);
j.setSuccess(true);
message = "分批标识更新完毕";
} catch (Exception e) {
j.setSuccess(false);
message = "分批标识更新失败,请检查单号或重试";
// TODO Auto-generated catch block
e.printStackTrace();
}
j.setMsg(message);
return j;
}
}
... ...
package com.tianbo.controller;
import com.tianbo.common.ModelAndPage;
import com.tianbo.service.EtlmessageService;
import com.tianbo.util.dao.Page;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.ModelAttribute;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.servlet.ModelAndView;
/**
* Created by Mr.Xu on 2017/9/14.
*/
@Controller
@RequestMapping("/messagebak")
public class ETLMessageBakController {
@Autowired
private EtlmessageService etlmessageService;
@RequestMapping("/showlist")
public ModelAndView findEtlMessage(@ModelAttribute Page page) throws Exception{
int pagelenth=10;
int start = 0;
if(page.getBegin()>=0){ start = page.getBegin(); }
if (page.getLength()>0){ pagelenth = page.getLength();}
ModelAndView modelAndView=new ModelAndView();
ModelAndPage modelAndPage=new ModelAndPage();
modelAndPage=etlmessageService.findEtlMessage(start,pagelenth);
modelAndView.addObject("modelAndPage",modelAndPage);
modelAndView.setViewName("messagebak/list");
return modelAndView;
}
@RequestMapping("list")
public String list(){return "messagebak/list";}
}
... ...
package com.tianbo.controller;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
@Controller
public class IndexController {
@RequestMapping("/")
public String index(){
return "index";
}
@RequestMapping("/index")
public String indexJSP(){
return "index";
}
}
... ...
package com.tianbo.controller;
import com.tianbo.model.TKpiCargoWaybill;
import com.tianbo.service.KPICargoBillServcie;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.servlet.ModelAndView;
/**
* 运单表
*/
@Controller
@RequestMapping("/kpi")
public class KPIController {
@Autowired
KPICargoBillServcie kpiService;
@RequestMapping("list")
public ModelAndView list(){
TKpiCargoWaybill waybill = new TKpiCargoWaybill();
return new ModelAndView("kpi/list","waybill",waybill);
}
}
... ...
package com.tianbo.controller;
import com.tianbo.util.json.ResponseModel;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.apache.shiro.SecurityUtils;
import org.apache.shiro.authc.*;
import org.apache.shiro.authz.UnauthenticatedException;
import org.apache.shiro.subject.Subject;
import org.springframework.stereotype.Controller;
import org.springframework.transaction.annotation.Transactional;
import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.ResponseBody;
import org.springframework.web.servlet.ModelAndView;
import javax.servlet.http.HttpServletRequest;
/**
* Created by mrz on 2017/8/28.
*/
@Controller
public class MainController {
protected final Logger logger = LoggerFactory.getLogger(getClass());
@RequestMapping("/login")
public String login(){
return "login";
}
@RequestMapping("/main/info")
public String index(){
return "main/info";
}
@RequestMapping("/main")
public String main(){
return "main";
}
@Transactional
@RequestMapping(value = "/doLogin", method = RequestMethod.POST)
@ResponseBody
public ResponseModel dologin(String username, String password, String captcha){
ResponseModel md = new ResponseModel(200,"",null);
String msg = "";
UsernamePasswordToken token = new UsernamePasswordToken(username,password);
token.setRememberMe(true);
Subject subject = SecurityUtils.getSubject();
logger.info("token="+token);
try {
subject.login(token);
if (subject.isAuthenticated()){
subject.getSession().setAttribute("username",username);
return md;
}
}catch (IncorrectCredentialsException e) {
msg = "登录密码错误. Password for account " + token.getPrincipal() + " was incorrect.";
md.setStatus(500);
System.out.println(msg);
} catch (ExcessiveAttemptsException e) {
msg = "登录失败次数过多";
md.setStatus(500);
System.out.println(msg);
} catch (LockedAccountException e) {
msg = "帐号已被锁定. The account for username " + token.getPrincipal() + " was locked.";
md.setStatus(500);
System.out.println(msg);
} catch (DisabledAccountException e) {
msg = "帐号已被禁用. The account for username " + token.getPrincipal() + " was disabled.";
md.setStatus(500);
System.out.println(msg);
} catch (ExpiredCredentialsException e) {
msg = "帐号已过期. the account for username " + token.getPrincipal() + " was expired.";
md.setStatus(500);
System.out.println(msg);
} catch (UnknownAccountException e) {
msg = "帐号不存在. There is no user with username of " + token.getPrincipal();
md.setStatus(500);
System.out.println(msg);
} catch (UnauthenticatedException e) {
msg = "您没有得到相应的授权!" + e.getMessage();
md.setStatus(500);
System.out.println(msg);
}
md.setMsg(msg);
return md;
}
}
... ...
package com.tianbo.controller;
import com.tianbo.model.TKpiCargoManifest;
import com.tianbo.service.ManiFestService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.servlet.ModelAndView;
/**
* 仓单表
*/
@Controller
@RequestMapping("/man")
public class ManiFestController {
@Autowired
ManiFestService maniFestService;
@RequestMapping("list")
public ModelAndView list(){
TKpiCargoManifest manifest = new TKpiCargoManifest();
return new ModelAndView("man/list","man",manifest);
}
}
... ...
package com.tianbo.controller;
import com.tianbo.common.ModelAndPage;
import com.tianbo.model.TOlapColumn;
import com.tianbo.model.TOlapDataset;
import com.tianbo.service.OlapColumnService;
import com.tianbo.service.OlapDataSetService;
import com.tianbo.util.dao.Page;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.ModelAttribute;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.servlet.ModelAndView;
import org.springframework.web.servlet.mvc.support.RedirectAttributes;
import javax.servlet.http.HttpServletRequest;
import java.math.BigDecimal;
import java.util.List;
/**
* Created by Mr.Xu on 2017/9/13.
*/
@Controller
@RequestMapping("/olapcolumn")
public class OlapColumnController {
@Autowired
private OlapColumnService olapColumnService;
@Autowired
private OlapDataSetService olapDataSetService;
@RequestMapping("showlist")
public ModelAndView findOlapColumn(@ModelAttribute Page page) throws Exception{
int pagelenth=10;
int start=0;
if(page.getBegin()>=0){start=page.getBegin();}
if(page.getLength()>0){pagelenth=page.getLength();}
ModelAndView modelAndView=new ModelAndView();
ModelAndPage modelAndPage=new ModelAndPage();
modelAndPage=olapColumnService.findOlapColumn(start,pagelenth);
List<TOlapDataset> olapDatasetList=olapDataSetService.findOlapDataSet();
modelAndView.addObject("modelAndPage",modelAndPage);
modelAndView.addObject("olapDatasetList",olapDatasetList);
modelAndView.setViewName("olapcolumn/list");
return modelAndView;
}
@RequestMapping("/selectlist")
public ModelAndView selectOlapColumn(HttpServletRequest request,BigDecimal datasetid)throws Exception{
String id=request.getParameter("datasetid");
BigDecimal bd=new BigDecimal(id);
ModelAndView modelAndView=new ModelAndView();
List<TOlapColumn> tOlapColumnList=olapColumnService.selectOlapColumn(bd);
TOlapDataset tOlapDataset=olapDataSetService.findByid(bd);
modelAndView.addObject("tOlapColumnList",tOlapColumnList);
modelAndView.addObject("tOlapDataset",tOlapDataset);
modelAndView.setViewName("olapcolumn/list");
return modelAndView;
}
@RequestMapping("/findByid")
public ModelAndView findByid(HttpServletRequest request,BigDecimal columnid) throws Exception{
ModelAndView modelAndView=new ModelAndView();
String id=request.getParameter("columnid");
BigDecimal bd=new BigDecimal(id);
TOlapColumn olapColumn=olapColumnService.findByid(bd);
List<TOlapDataset> olapDatasetList=olapDataSetService.findOlapDataSet();
modelAndView.addObject("olapDatasetList",olapDatasetList);
modelAndView.addObject("olapColumn",olapColumn);
modelAndView.setViewName("olapcolumn/edit");
return modelAndView;
}
@RequestMapping("/addColumn")
public String addOlapColumn(HttpServletRequest request,TOlapColumn olapColumn,RedirectAttributes attr){
String columnname=request.getParameter("columnname");
String datafield=request.getParameter("datafield");
String nodename=request.getParameter("nodename");
String active=request.getParameter("active");
String datasetid=request.getParameter("datasetid");
olapColumn.setActive(active);
olapColumn.setDatasetid(new BigDecimal(datasetid));
olapColumn.setNodename(nodename);
olapColumn.setColumnname(columnname);
olapColumn.setDatafield(datafield);
olapColumnService.addOlapColumn(olapColumn);
attr.addAttribute("datasetid",new BigDecimal(datasetid));
return "redirect:/olapcolumn/selectlist";
}
@RequestMapping("/deleteByPrimaryKey")
public String deleteByPrimaryKey(HttpServletRequest request,BigDecimal columnid,RedirectAttributes attr){
String id=request.getParameter("columnid");
String datasetid=request.getParameter("datasetid");
BigDecimal bd=new BigDecimal(id);
olapColumnService.deleteByPrimaryKey(bd);
attr.addAttribute("datasetid",new BigDecimal(datasetid));
return "redirect:/olapcolumn/selectlist";
}
@RequestMapping("/updateColumn")
public String updateColumn(HttpServletRequest request,TOlapColumn olapColumn,RedirectAttributes attr){
String id=request.getParameter("columnid");
BigDecimal bd=new BigDecimal(id);
String columnname=request.getParameter("columnname");
String datafield=request.getParameter("datafield");
String nodename=request.getParameter("nodename");
String datasetid=request.getParameter("datasetid");
String active=request.getParameter("active");
olapColumn.setColumnid(bd);
olapColumn.setColumnname(columnname);
olapColumn.setDatafield(datafield);
olapColumn.setNodename(nodename);
olapColumn.setDatasetid(new BigDecimal(datasetid));
olapColumn.setActive(active);
olapColumnService.updateOlapColumn(olapColumn);
attr.addAttribute("datasetid",new BigDecimal(datasetid));
return "redirect:/olapcolumn/selectlist";
}
@RequestMapping("list")
public String list(){return "olapcolumn/list";}
}
... ...
package com.tianbo.controller;
import com.tianbo.common.ModelAndPage;
import com.tianbo.model.TOlapDataset;
import com.tianbo.service.OlapColumnService;
import com.tianbo.service.OlapDataSetService;
import com.tianbo.util.dao.Page;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.ModelAttribute;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.servlet.ModelAndView;
import javax.servlet.http.HttpServletRequest;
import java.math.BigDecimal;
/**
* Created by Mr.Xu on 2017/9/12.
*/
@Controller
@RequestMapping("/olapdata")
public class OlapDataSetController {
@Autowired
private OlapDataSetService olapDataSetService;
@Autowired
private OlapColumnService olapColumnService;
@RequestMapping("/showlist")
public ModelAndView findOlapDataSet(@ModelAttribute Page page) throws Exception {
int pagelenth=10;
int start=0;
if(page.getBegin()>=0){start=page.getBegin();}
if(page.getLength()>0){pagelenth=page.getLength();}
ModelAndView modelAndView = new ModelAndView();
ModelAndPage modelAndPage=new ModelAndPage();
modelAndPage= olapDataSetService.findOlapDataSet(start,pagelenth);
modelAndView.addObject("modelAndPage", modelAndPage);
modelAndView.setViewName("olapdata/list");
return modelAndView;
}
@RequestMapping("/addDataset")
public ModelAndView addOlapDataset(HttpServletRequest request,TOlapDataset olapDataset) throws Exception {
String datasetname=request.getParameter("datasetname");
String viewname=request.getParameter("viewname");
String active=request.getParameter("active");
olapDataset.setDatasetname(datasetname);
olapDataset.setViewname(viewname);
olapDataset.setActive(active);
olapDataSetService.addOlapDataSet(olapDataset);
ModelAndView modelAndView=new ModelAndView();
modelAndView.setViewName("redirect:/olapdata/showlist");
return modelAndView;
}
@RequestMapping("/deleteDataset")
public String deleteDataset(HttpServletRequest request, BigDecimal datasetid){
String id=request.getParameter("datasetid");
BigDecimal bd=new BigDecimal(id);
int result = olapColumnService.deleteOlapColumn(bd);
if(result>0){
olapDataSetService.deleteOlapDataset(bd);
return "redirect:/olapdata/showlist";
}else {
return "500";
}
}
@RequestMapping("/findByid")
public ModelAndView findByid(HttpServletRequest request,BigDecimal datasetid)throws Exception{
ModelAndView modelAndView=new ModelAndView();
String id=request.getParameter("datasetid");
TOlapDataset olapDataset=olapDataSetService.findByid(new BigDecimal(id));
modelAndView.addObject("olapDataset",olapDataset);
modelAndView.setViewName("olapdata/edit");
return modelAndView;
}
@RequestMapping("/updateDateset")
public String updateDateset(HttpServletRequest request,TOlapDataset olapDataset){
String datasetid=request.getParameter("datasetid");
String datasetname=request.getParameter("datasetname");
String viewname=request.getParameter("viewname");
String active=request.getParameter("active");
olapDataset.setDatasetid(new BigDecimal(datasetid));
olapDataset.setDatasetname(datasetname);
olapDataset.setViewname(viewname);
olapDataset.setActive(active);
olapDataSetService.updateOlapDataset(olapDataset);
return "redirect:/olapdata/showlist";
}
@RequestMapping("list")
public String list() {
return "olapdata/list";
}
}
... ...
package com.tianbo.controller;
import com.tianbo.common.ModelAndPage;
import com.tianbo.model.TOlapDataset;
import com.tianbo.model.TOlapXmldoc;
import com.tianbo.service.OlapDataSetService;
import com.tianbo.service.OlapXmldocService;
import com.tianbo.service.OlapXmlnodeService;
import com.tianbo.util.dao.Page;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.ModelAttribute;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.servlet.ModelAndView;
import javax.servlet.http.HttpServletRequest;
import java.math.BigDecimal;
import java.util.List;
/**
* Created by Mr.Xu on 2017/9/14.
*/
@Controller
@RequestMapping("/olapxmldoc")
public class OlapXmldocController {
@Autowired
private OlapXmldocService olapXmldocService;
@Autowired
private OlapDataSetService olapDataSetService;
@Autowired
private OlapXmlnodeService olapXmlnodeService;
@RequestMapping("showlist")
public ModelAndView findXmldoc(@ModelAttribute Page page)throws Exception{
int pagelenth=10;
int start=0;
if(page.getBegin()>=0){start=page.getBegin();}
if(page.getLength()>0){pagelenth=page.getLength();}
ModelAndView modelAndView=new ModelAndView();
ModelAndPage modelAndPage=new ModelAndPage();
modelAndPage=olapXmldocService.findXmldoc(start,pagelenth);
List<TOlapDataset> olapDatasetList=olapDataSetService.findOlapDataSet();
modelAndView.addObject("modelAndPage",modelAndPage);
modelAndView.addObject("olapDatasetList",olapDatasetList);
modelAndView.setViewName("olapxmldoc/list");
return modelAndView;
}
@RequestMapping("addxmldoc")
public String addXmldoc(HttpServletRequest request,TOlapXmldoc olapXmldoc){
String doctype=request.getParameter("doctype");
String docname=request.getParameter("docname");
String datasetid=request.getParameter("datasetid");
String active=request.getParameter("active");
olapXmldoc.setDoctype(doctype);
olapXmldoc.setDocname(docname);
olapXmldoc.setDatasetid(new BigDecimal(datasetid));
olapXmldoc.setActive(active);
olapXmldocService.addXmldoc(olapXmldoc);
return "redirect:/olapxmldoc/showlist";
}
@RequestMapping("findByid")
public ModelAndView findByid(HttpServletRequest request,BigDecimal docid) throws Exception{
ModelAndView modelAndView=new ModelAndView();
String id=request.getParameter("docid");
BigDecimal bd=new BigDecimal(id);
TOlapXmldoc olapXmldoc=olapXmldocService.findByid(bd);
List<TOlapDataset> olapDatasetList=olapDataSetService.findOlapDataSet();
modelAndView.addObject("olapDatasetList",olapDatasetList);
modelAndView.addObject("olapXmldoc",olapXmldoc);
modelAndView.setViewName("olapxmldoc/edit");
return modelAndView;
}
@RequestMapping("updateXmldoc")
public String updateXmldoc(HttpServletRequest request,TOlapXmldoc olapXmldoc){
String docid=request.getParameter("docid");
String doctype=request.getParameter("doctype");
String docname=request.getParameter("docname");
String datasetid=request.getParameter("datasetid");
String active=request.getParameter("active");
olapXmldoc.setActive(active);
olapXmldoc.setDatasetid(new BigDecimal(datasetid));
olapXmldoc.setDocname(docname);
olapXmldoc.setDoctype(doctype);
olapXmldoc.setDocid(new BigDecimal(docid));
olapXmldocService.updateXmldoc(olapXmldoc);
return "redirect:/olapxmldoc/showlist";
}
@RequestMapping("deleteXmldoc")
public String updateXmldoc(HttpServletRequest request,BigDecimal docid){
String id=request.getParameter("docid");
int result=olapXmlnodeService.deleteXmlnode(new BigDecimal(id));
if(result>0){
olapXmldocService.deleteXmldoc(new BigDecimal(id));
return "redirect:/olapxmldoc/showlist";
}else{
return "500";
}
}
}
... ...
package com.tianbo.controller;
import com.tianbo.common.ModelAndPage;
import com.tianbo.model.TOlapColumn;
import com.tianbo.model.TOlapXmldoc;
import com.tianbo.model.TOlapXmlnode;
import com.tianbo.service.OlapColumnService;
import com.tianbo.service.OlapXmldocService;
import com.tianbo.service.OlapXmlnodeService;
import com.tianbo.util.dao.Page;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.ModelAttribute;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.servlet.ModelAndView;
import org.springframework.web.servlet.mvc.support.RedirectAttributes;
import javax.servlet.http.HttpServletRequest;
import java.math.BigDecimal;
import java.util.List;
/**
* Created by Mr.Xu on 2017/9/14.
*/
@Controller
@RequestMapping("/olapxmlnode")
public class OlapXmlnodeController {
@Autowired
private OlapXmlnodeService olapXmlnodeService;
@Autowired
private OlapXmldocService olapXmldocService;
@Autowired
private OlapColumnService olapColumnService;
@RequestMapping("showlist")
public ModelAndView findXmlnode(@ModelAttribute Page page)throws Exception{
int pagelenth=10;
int start=0;
if(page.getBegin()>=0){start=page.getBegin();}
if(page.getLength()>0){pagelenth=page.getLength();}
ModelAndView modelAndView=new ModelAndView();
ModelAndPage modelAndPage=new ModelAndPage();
modelAndPage=olapXmlnodeService.findXmlnode(start,pagelenth);
List<TOlapXmldoc> olapXmldocList=olapXmldocService.findXmldoc();
List<TOlapColumn> olapColumnList=olapColumnService.findOlapColumn();
modelAndView.addObject("olapXmldocList",olapXmldocList);
modelAndView.addObject("olapColumnList",olapColumnList);
modelAndView.addObject("modelAndPage",modelAndPage);
modelAndView.setViewName("olapxmlnode/list");
return modelAndView;
}
@RequestMapping("addXmlnode")
public String addXmlnode(HttpServletRequest request,TOlapXmlnode olapXmlnode,RedirectAttributes attr){
String docid=request.getParameter("docid");
String columnid=request.getParameter("columnid");
olapXmlnode.setDocid(new BigDecimal(docid));
olapXmlnode.setColumnid(new BigDecimal(columnid));
olapXmlnodeService.addXmlnode(olapXmlnode);
attr.addAttribute("docid",new BigDecimal(docid));
return "redirect:/olapxmlnode/selectlist";
}
@RequestMapping("findByid")
public ModelAndView findByid(HttpServletRequest request,BigDecimal nodeid)throws Exception{
ModelAndView modelAndView=new ModelAndView();
String id=request.getParameter("nodeid");
TOlapXmlnode olapXmlnode=olapXmlnodeService.findByid(new BigDecimal(id));
List<TOlapXmldoc> olapXmldocList=olapXmldocService.findXmldoc();
List<TOlapColumn> olapColumnList=olapColumnService.findOlapColumn();
modelAndView.addObject("olapXmldocList",olapXmldocList);
modelAndView.addObject("olapColumnList",olapColumnList);
modelAndView.addObject("olapXmlnode",olapXmlnode);
modelAndView.setViewName("olapxmlnode/edit");
return modelAndView;
}
@RequestMapping("selectlist")
public ModelAndView selectXmlnode(HttpServletRequest request,BigDecimal docid)throws Exception{
ModelAndView modelAndView=new ModelAndView();
String id=request.getParameter("docid");
BigDecimal bd=new BigDecimal(id);
List<TOlapXmlnode> tOlapXmlnodeList=olapXmlnodeService.selectXmlnode(bd);
TOlapXmldoc tOlapXmldoc=olapXmldocService.findByid(bd);
List<TOlapColumn> olapColumnList=olapColumnService.findOlapColumn();
modelAndView.addObject("tOlapXmlnodeList",tOlapXmlnodeList);
modelAndView.addObject("tOlapXmldoc",tOlapXmldoc);
modelAndView.addObject("olapColumnList",olapColumnList);
modelAndView.setViewName("olapxmlnode/list");
return modelAndView;
}
@RequestMapping("updateXmlnode")
public String updateXmlnode(HttpServletRequest request,TOlapXmlnode olapXmlnode,RedirectAttributes attr){
String nodeid=request.getParameter("nodeid");
String docid=request.getParameter("docid");
String columnid=request.getParameter("columnid");
olapXmlnode.setColumnid(new BigDecimal(columnid));
olapXmlnode.setDocid(new BigDecimal(docid));
olapXmlnode.setNodeid(new BigDecimal(nodeid));
olapXmlnodeService.updateXmlnode(olapXmlnode);
attr.addAttribute("docid",new BigDecimal(docid));
return "redirect:/olapxmlnode/selectlist";
}
@RequestMapping("deleteByPrimaryKey")
public String deleteByPrimaryKey(HttpServletRequest request,BigDecimal nodeid,RedirectAttributes attr){
String id=request.getParameter("nodeid");
String docid=request.getParameter("docid");
olapXmlnodeService.deleteByPrimaryKey(new BigDecimal(id));
attr.addAttribute("docid",new BigDecimal(docid));
return "redirect:/olapxmlnode/selectlist";
}
@RequestMapping("list")
public String list(){return "olapxmlnode/list";}
}
... ...
package com.tianbo.controller;
import com.tianbo.model.Role;
import com.tianbo.model.Users;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.ModelAttribute;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.servlet.ModelAndView;
@Controller
@RequestMapping("/permission")
public class PermissionController {
@RequestMapping("list")
public ModelAndView listView(@ModelAttribute Role role){
return new ModelAndView("permission/list","role",role);
}
}
... ...
package com.tianbo.controller;
import java.text.SimpleDateFormat;
import java.util.Date;
import java.util.List;
import java.util.UUID;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpSession;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.ui.ModelMap;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.ResponseBody;
import com.tianbo.model.Arrivedmaster;
import com.tianbo.model.Originmanifestmaster;
import com.tianbo.model.Originmanifestsecondary;
import com.tianbo.model.Preparemaster;
import com.tianbo.service.imp.ArriveService;
import com.tianbo.service.imp.OriginmaniService;
import com.tianbo.service.imp.PreService;
import com.tianbo.util.DateUtils;
import com.tianbo.util.json.AjaxJson;
/**
* 数据转预配Controller
* @author Promise
*
*/
@Controller
@RequestMapping("/Mainfest")
public class PreController {
@Autowired
private OriginmaniService mainfestService;
@Autowired
private PreService preService;
@Autowired
private ArriveService arriveService;
@RequestMapping(value = "totransform")
public String toTransForm() {
return "transform";
}
@RequestMapping(value = "pre", method = RequestMethod.POST)
@ResponseBody
public AjaxJson mainfestSearch(HttpSession session,ModelMap modelMap,
@RequestParam String flightno,
@RequestParam String flightdate,
@RequestParam String tflightno,
@RequestParam String tflightdate,
@RequestParam String destinationStation
)
{
String message = null;
AjaxJson j = new AjaxJson();
try {
Originmanifestmaster mainfest = new Originmanifestmaster();
mainfest.setFlightno(flightno);
mainfest.setFlightDate(flightdate);
SimpleDateFormat df = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
long flag = 18000000;
List<Originmanifestmaster> list = mainfestService.getList(mainfest);
if(list.size()!=0||!list.isEmpty()){
for (Originmanifestmaster originmanifestmaster : list) {
Preparemaster preparemaster = new Preparemaster();
preparemaster.setAutoid(UUID.randomUUID().toString()); //GUID
preparemaster.setWaybillnomaster(originmanifestmaster.getWaybillnomaster());//主单号
preparemaster.setCarrier(tflightno.substring(0, 2));//承运人
preparemaster.setFlightno(tflightno.substring(2));
preparemaster.setOriginatingstation(originmanifestmaster.getOriginatingstationBill());
preparemaster.setFlightdate(DateUtils.stringToDate(tflightdate, "yyyy-MM-dd"));
preparemaster.setCreatedate(DateUtils.DateToString(new Date(), "yyyy-MM-dd HH:mm:ss"));
preparemaster.setDestinationstation(destinationStation); //目的站
preparemaster.setTotalpiece(originmanifestmaster.getManifesttotalpiece());
preparemaster.setPreparetotalpiece(originmanifestmaster.getManifesttotalpiece());
preparemaster.setTotalweight(originmanifestmaster.getManifesttotalweight());
preparemaster.setPreparetotalweight(originmanifestmaster.getManifesttotalweight());
preparemaster.setProductname(originmanifestmaster.getProductname());//货物描述
preparemaster.setShippername(originmanifestmaster.getShippername());//发货人名称
preparemaster.setShipperCode(originmanifestmaster.getShipperCode());//发货人代码
preparemaster.setShipperaddress(originmanifestmaster.getShipperaddress());//发货人地址
preparemaster.setShipperCountrycode(originmanifestmaster.getShipperCountrycode());//发货人国家代码
preparemaster.setShipperPhone(originmanifestmaster.getShipperPhone());//发货人电话
preparemaster.setConsigneename(originmanifestmaster.getConsigneename());//收货人名称
preparemaster.setCustomscode(originmanifestmaster.getCustomscode());//关区代码
preparemaster.setCustomsstatus(originmanifestmaster.getCustomsstatus());//海关状态
preparemaster.setUnloadingstation(originmanifestmaster.getDestinationstationBill());//卸货地
Date date = new Date();
long dateParam =date.getTime()+flag;
String stowagedate =df.format(dateParam);
preparemaster.setStowagedate(stowagedate);
preparemaster.setPaymode(originmanifestmaster.getPaymode());//付费方式
preparemaster.setConsigneeCode(originmanifestmaster.getConsigneeCode());//收货人代码
preparemaster.setConsigneeaddress(originmanifestmaster.getConsigneeaddress());//收货人地址
preparemaster.setConsigneeCountrycode(originmanifestmaster.getConsigneeCountrycode());//收货人国家代码
preparemaster.setConsigneePhone(originmanifestmaster.getConsigneePhone());//收货人电话
preparemaster.setStatus("01");
preService.insert(preparemaster);
}
j.setSuccess(true);
message = "预配舱单转运完成";
}else {
j.setSuccess(true);
message = "未查询到原始舱单数据";
}
} catch (Exception e) {
j.setSuccess(false);
message = "预配舱单转运失败";
// TODO Auto-generated catch block
e.printStackTrace();
}
j.setMsg(message);
return j;
}
@RequestMapping(value = "arr", method = RequestMethod.POST)
@ResponseBody
public AjaxJson arrivefestSearch(HttpSession session,ModelMap modelMap,
@RequestParam String flightno,
@RequestParam String flightdate,
@RequestParam String tflightno,
@RequestParam String tflightdate,
@RequestParam String destinationStation
)
{
String message = null;
AjaxJson j = new AjaxJson();
try {
Originmanifestmaster mainfest = new Originmanifestmaster();
mainfest.setFlightno(flightno);
mainfest.setFlightDate(flightdate);
List<Originmanifestmaster> list = mainfestService.getList(mainfest);
if(list.size()!=0||!list.isEmpty()){
for (Originmanifestmaster originmanifestmaster : list) {
Arrivedmaster arrivemaster = new Arrivedmaster();
arrivemaster.setAutoid(UUID.randomUUID().toString()); //GUID
arrivemaster.setWaybillnomaster(originmanifestmaster.getWaybillnomaster());
arrivemaster.setArrivedtotalpiece(originmanifestmaster.getManifesttotalpiece());
arrivemaster.setArrivedtotalweight(originmanifestmaster.getManifesttotalweight());
arrivemaster.setCustomscode(originmanifestmaster.getCustomscode());
arrivemaster.setArriveddate(DateUtils.DateToString(new Date(), "yyyy-MM-dd HH:mm:ss"));
arrivemaster.setCarrier(tflightno.substring(0, 2));//承运人
arrivemaster.setFlightno(tflightno.substring(2));
arrivemaster.setFlightdate(DateUtils.stringToDate(tflightdate, "yyyy-MM-dd"));
arrivemaster.setCreatedate(DateUtils.DateToString(new Date(), "yyyy-MM-dd HH:mm:ss"));
arrivemaster.setDestinationstation(originmanifestmaster.getDestinationstationBill()); //目的站
arrivemaster.setProductname(originmanifestmaster.getProductname());//货物描述
arrivemaster.setStatus("17");
arriveService.insert(arrivemaster);
}
j.setSuccess(true);
message = "运抵转运完成";
}else {
j.setSuccess(true);
message = "未查询到原始舱单数据";
}
} catch (Exception e) {
j.setSuccess(false);
message = "预配舱单转运失败";
// TODO Auto-generated catch block
e.printStackTrace();
}
j.setMsg(message);
return j;
}
@RequestMapping(value = "Transit", method = RequestMethod.POST)
@ResponseBody
public AjaxJson transitfestSearch(HttpSession session,ModelMap modelMap,
@RequestParam String flightno,
@RequestParam String flightdate,
@RequestParam String tflightno
)
{
String message = null;
AjaxJson j = new AjaxJson();
try {
Originmanifestmaster mainfest = new Originmanifestmaster();
mainfest.setFlightno(flightno);
mainfest.setFlightDate(flightdate);
mainfest.setPreCarrier(tflightno.substring(0,2));
mainfest.setPreFlightno(tflightno.substring(2));
List<Originmanifestmaster> list = mainfestService.getList(mainfest);
if(list.size()!=0||!list.isEmpty()){
mainfestService.insertTransit(mainfest);
j.setSuccess(true);
message = "国际转运申请完成";
}else {
j.setSuccess(true);
message = "未查询到原始舱单数据";
}
} catch (Exception e) {
j.setSuccess(false);
message = "国际转运申请失败,详情请联系管理员";
// TODO Auto-generated catch block
e.printStackTrace();
}
j.setMsg(message);
return j;
}
}
... ...
package com.tianbo.controller;
import com.tianbo.controller.base.BaseController;
import com.tianbo.model.Role;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.servlet.ModelAndView;
@Controller
@RequestMapping("/role")
public class RoleController {
@RequestMapping("list")
public String listView(){
return "role/list";
}
@RequestMapping("add")
public ModelAndView add(){
Role role = new Role();
return new ModelAndView("role/add","role",role) ;
}
}
... ...
package com.tianbo.controller;
import com.tianbo.common.ModelAndPage;
import com.tianbo.model.Users;
import com.tianbo.model.UsersExample;
import com.tianbo.service.UserService;
import com.tianbo.util.dao.Page;
import com.tianbo.util.tools.MD5Tools;
import org.apache.shiro.SecurityUtils;
import org.apache.shiro.authz.annotation.RequiresPermissions;
import org.apache.shiro.authz.annotation.RequiresRoles;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.*;
import org.springframework.web.servlet.ModelAndView;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import java.math.BigDecimal;
import java.util.Date;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
/**
* Created by mrz on 2017/8/23.
*/
@Controller
@RequestMapping("/user")
public class UserController {
//service类
@Autowired
private UserService userService;
@RequestMapping("add")
@RequiresRoles("admin")
public ModelAndView addUserV(){
Users newUser = new Users();
return new ModelAndView("user/add","user",newUser);
}
@RequestMapping("/edit")
@RequiresRoles("admin")
@RequiresPermissions({"user:edit","user:find"})
public ModelAndView userId(@ModelAttribute Users user){
String username = (String) SecurityUtils.getSubject().getSession().getAttribute("username");
//这里需要判断下,当前用户是可以编辑自己的资料的,或者再起一个ACTION,单独判断权限
return new ModelAndView("user/edit","user",user);
}
@RequiresRoles("admin")
@RequestMapping("list")
public String list(){
return "user/list";
}
}
... ...
package com.tianbo.controller.base;
public class BaseController {
public Integer defaultDataStart = 0;
public Integer defaultPerPage = 20;
public Boolean checkPropertyNull(String property){
if(property!=null && property!=""){
return Boolean.TRUE;
}else{
return Boolean.FALSE;
}
}
}
... ...
package com.tianbo.controller.billNo;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import javax.servlet.http.HttpServletRequest;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.ui.ModelMap;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;
import com.tianbo.model.Sendlog;
import com.tianbo.service.SendLogService;
import com.tianbo.util.json.JsonConversion;
@Controller
public class BillController {
@Autowired
private SendLogService sendLogService;
@RequestMapping(value = "searchArr")
public String searchArr() {
return "searchArr";
}
@RequestMapping(value = "toBill")
public String toTransForm(ModelMap model,HttpServletRequest request) {
String parameter = request.getParameter("billNo");
String parameter2 = request.getParameter("billNoSecond");
model.put("bill", parameter);
model.put("billNoSecond", parameter2);
return "toBill";
}
/**
* 获取运抵回执
*/
@ResponseBody
@RequestMapping(value = "getSendLog")
public String getList(HttpServletRequest request){
String billNo = request.getParameter("billNo");
List<Sendlog> sendLog = sendLogService.getSendLog(billNo);
Map<String,Object> map = new HashMap<>();
if(!sendLog.isEmpty()){
for (Sendlog sendlog : sendLog) {
sendlog.setFlightno(sendlog.getCarrier()+sendlog.getFlightno());
sendlog.setFlightdate(sendlog.getFlightdate().substring(0, 10));
}
map.put("code", 0);
map.put("msg", "success");
map.put("data", sendLog);
}else {
map.put("code", -1);
map.put("msg", "无此单运抵回执");
map.put("data", "");
}
return JsonConversion.writeMapJSON(map);
}
@ResponseBody
@RequestMapping(value = "getSendLogSecond")
public String getSendLogSecond(HttpServletRequest request){
String billNoSecond = request.getParameter("billNoSecond");
List<Sendlog> sendLogsecond = sendLogService.getSendLogSecond(billNoSecond);
Map<String,Object> map = new HashMap<>();
if(!sendLogsecond.isEmpty()){
for (Sendlog sendlog : sendLogsecond) {
sendlog.setFlightno(sendlog.getCarrier()+sendlog.getFlightno());
sendlog.setFlightdate(sendlog.getFlightdate().substring(0, 10));
}
map.put("code", 0);
map.put("msg", "success");
map.put("data", sendLogsecond);
}else {
map.put("code", -1);
map.put("msg", "无此单运抵回执");
map.put("data", "");
}
return JsonConversion.writeMapJSON(map);
}
@ResponseBody
@RequestMapping(value = "getSendLogSecondByMain")
public String getSendLogSecondByMain(HttpServletRequest request){
String billNo= request.getParameter("billNo");
List<Sendlog> sendLogsecond = sendLogService.getSendLogSecondByMain(billNo);
for (Sendlog sendlog : sendLogsecond) {
if(!sendlog.getReceiption().contains("发送运抵报")){
sendlog.setCustomscode("");
sendlog.setWaybillnosecondary("");
}
}
Map<String,Object> map = new HashMap<>();
if(!sendLogsecond.isEmpty()){
for (Sendlog sendlog : sendLogsecond) {
sendlog.setFlightno(sendlog.getCarrier()+sendlog.getFlightno());
sendlog.setFlightdate(sendlog.getFlightdate().substring(0, 10));
}
map.put("code", 0);
map.put("msg", "success");
map.put("data", sendLogsecond);
}else {
map.put("code", -1);
map.put("msg", "无此单运抵回执");
map.put("data", "");
}
return JsonConversion.writeMapJSON(map);
}
}
... ...
package com.tianbo.controller;
import java.io.*;
import java.awt.*;
import java.awt.event.*;
import javax.swing.*;
class Win extends JFrame implements ActionListener//接口设置监听器
{
FileReader r_file;//字符文件输入流
FileWriter w_file;//字符文件输出流
BufferedReader buf_reader;//与FileReader类配合使用,将字符输入到缓冲区,使数据处理速度大大加快,提高读写的效率
BufferedWriter buf_writer;
JTextArea txt;
JButton btn1,btn2;
Win()
{
setSize(400,400);
setVisible(true);
txt = new JTextArea(10,10);
btn1 = new JButton("Read");
btn2 = new JButton("Write");
btn1.addActionListener(this);//建立监听器和事件源(按钮)之间的联系
btn2.addActionListener(this);
JPanel p = new JPanel();
add(txt,"Center");
add(p,"South");
p.setLayout(new FlowLayout());//设置窗体为浮动窗体
p.add(btn1);
p.add(btn2);
validate();//使窗体中的组件为可见
setDefaultCloseOperation(EXIT_ON_CLOSE);//设置关闭窗体,退出窗体
}
public void actionPerformed(ActionEvent e)
{
//当单击按钮对象btn时,按钮对象会产生一个ActionEvent事件,事件监听器监听到这个事件,把它作为实现ActionListener接口的actionPerformed方法的参数,在actionPerformed方法中处理动作事件。
if(e.getSource()==btn1)
{
readFile();
}
if(e.getSource()==btn2)
{
writeFile();
}
}
//读取文件
public void readFile()
{
String s;
try
{
File f=new File("C:\\A.txt");
r_file = new FileReader(f);//将文件f里面的内容给字符文件输入流
buf_reader = new BufferedReader(r_file);
}
catch(IOException ef)
{
System.out.print(ef);
}
try
{
int count =0;
double countK = 0;
String A = null;
while ((s = buf_reader.readLine())!=null)
{
String flag = s.substring(s.indexOf("/")+1,s.indexOf("K", s.indexOf("K")+1));
if(flag.contains("D")){
A=s.substring(s.indexOf("D")+1, s.indexOf("K", s.indexOf("K")+1));
}else if(flag.contains("S")){
A =s.substring(s.indexOf("S")+1, s.indexOf("K", s.indexOf("K")+1));
}
txt.append(s+'\n');
String K =s.substring(s.indexOf("K", s.indexOf("K")+1)+1,s.indexOf("M"));
count += Integer.parseInt(A);
countK += Double.parseDouble(K);
}
txt.append("总件数"+count);
txt.append("总重量"+countK);
}
catch(IOException er)
{
System.out.print(er);
}
}
public void writeFile()
{
try
{
w_file = new FileWriter("C:\\x.txt");
buf_writer = new BufferedWriter(w_file);
String str = txt.getText();
buf_writer.write(str,0,str.length());
buf_writer.flush();//一般情况下,writer方法向输出流写数据时,先把数据存放在缓冲区,这时缓冲区的数据不会自动写入输出流,只有当缓冲区满时,才会一次性将缓冲区的数据写入输出流,即写入文件。为了把尚未填满的缓冲区中的数据送出去,这时就要使用flush方法。
}
catch(IOException ew)
{
System.out.print(ew);
}
}
}
public class e81
{
public static void main(String args[])
{
Win w = new Win();
}
}
\ No newline at end of file
... ...
/**
* Copyright &copy; 2015-2020 <a href="--版权信息--">JeePlus</a> All rights reserved.
*/
package com.tianbo.controller.json;
import java.util.HashMap;
import java.util.LinkedHashMap;
import java.util.List;
import java.util.Map;
import com.fasterxml.jackson.annotation.JsonIgnore;
import com.tianbo.model.Sendlog;
/**
* $.ajax后需要接受的JSON
*
* @author
*
*/
public class AjaxJson {
private boolean success = true;// 是否成功
private String errorCode = "-1";//错误代码
private String msg = "操作成功";// 提示信息
//private LinkedHashMap<String, Object> body = new LinkedHashMap();//封装json的map
Map<String,Object> body = new HashMap();
public void setBody(List<Sendlog> sendLog){
this.body = (Map<String, Object>) sendLog;
}
public Map<String,Object> getBody() {
return body;
}
/*public LinkedHashMap<String, Object> getBody() {
return body;
}
public void setBody(LinkedHashMap<String, Object> body) {
this.body = body;
}*/
public void put(String key, Object value){//向json中添加属性,在js中访问,请调用data.map.key
body.put(key, value);
}
public void remove(String key){
body.remove(key);
}
public String getMsg() {
return msg;
}
public void setMsg(String msg) {//向json中添加属性,在js中访问,请调用data.msg
this.msg = msg;
}
public boolean isSuccess() {
return success;
}
public void setSuccess(boolean success) {
this.success = success;
}
public void setErrorCode(String errorCode) {
this.errorCode = errorCode;
}
public String getErrorCode() {
return errorCode;
}
}
... ...
package com.tianbo.controller.json;
import com.tianbo.common.ModelAndPage;
import com.tianbo.controller.base.BaseController;
import com.tianbo.model.TKpiCargoWaybill;
import com.tianbo.model.TKpiCargoWaybillExample;
import com.tianbo.model.TKpiCargoWaybillExample.Criteria;
import com.tianbo.service.KPICargoBillServcie;
import com.tianbo.util.dao.Page;
import com.tianbo.util.dao.Totals;
import org.apache.shiro.authz.annotation.RequiresRoles;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.*;
import java.math.BigDecimal;
import java.util.List;
@Controller
@RequestMapping("/kpi")
public class KPIJsonController extends BaseController{
@Autowired
KPICargoBillServcie kpiService;
/**
* 查找所用用户控制器方法
* @return
* @throws Exception
*/
@RequestMapping(value = "list.json",method = RequestMethod.POST)
@RequiresRoles("admin")
@ResponseBody
public ModelAndPage kpiList(@ModelAttribute Page frontPage, @ModelAttribute TKpiCargoWaybill kpi) throws Exception{
if(frontPage.getBegin()>=0){
defaultDataStart = frontPage.getBegin();
}
if (frontPage.getLength()>0){
defaultPerPage = frontPage.getLength();
}
//example
//调用mapper类中的selectByExample方法,如果传入类型为null,则表示无条件查找
TKpiCargoWaybillExample example = new TKpiCargoWaybillExample();
Criteria criteria = example.createCriteria();
Criteria criteria2= example.createCriteria();
Criteria criteria3= example.createCriteria();
Criteria criteria4= example.createCriteria();
//根据国内国际搜索
if (checkPropertyNull(kpi.getDomint())){
criteria.andDomintEqualTo(kpi.getDomint());
criteria2.andDomintEqualTo(kpi.getDomint());
criteria3.andDomintEqualTo(kpi.getDomint());
criteria4.andDomintEqualTo(kpi.getDomint());
}
//根据运单前缀,前缀有主单的情况是三位前缀,分单的情况是主单号
if(checkPropertyNull(kpi.getWaybillpre())){
criteria.andWaybillpreEqualTo(kpi.getWaybillpre());
criteria2.andWaybillpreEqualTo(kpi.getWaybillpre());
criteria3.andWaybillpreEqualTo(kpi.getWaybillpre());
criteria4.andWaybillpreEqualTo(kpi.getWaybillpre());
}
//根据运单类型
if(checkPropertyNull(kpi.getWaybilltype())){
criteria.andWaybilltypeEqualTo(kpi.getWaybilltype());
criteria2.andWaybilltypeEqualTo(kpi.getWaybilltype());
criteria3.andWaybilltypeEqualTo(kpi.getWaybilltype());
criteria4.andWaybilltypeEqualTo(kpi.getWaybilltype());
}
//根据代理人id
if(checkPropertyNull(kpi.getAgentid())){
criteria.andAgentidEqualTo(kpi.getAgentid());
criteria2.andAgentidEqualTo(kpi.getAgentid());
criteria3.andAgentidEqualTo(kpi.getAgentid());
criteria4.andAgentidEqualTo(kpi.getAgentid());
}
//根据货主
if(checkPropertyNull(kpi.getShprname())){
criteria.andShprnameEqualTo(kpi.getShprname());
criteria2.andAgentidEqualTo(kpi.getAgentid());
criteria3.andAgentidEqualTo(kpi.getAgentid());
criteria4.andAgentidEqualTo(kpi.getAgentid());
}
//根据货物id
if(checkPropertyNull(kpi.getProductid())){
criteria.andProductidEqualTo(kpi.getProductid());
criteria2.andAgentidEqualTo(kpi.getAgentid());
criteria3.andAgentidEqualTo(kpi.getAgentid());
criteria4.andAgentidEqualTo(kpi.getAgentid());
}
//根据货物名称
if(checkPropertyNull(kpi.getProductname())){
criteria.andProductnameEqualTo(kpi.getProductname());
criteria2.andProductnameEqualTo(kpi.getProductname());
criteria3.andProductnameEqualTo(kpi.getProductname());
criteria4.andProductnameEqualTo(kpi.getProductname());
}
//根据进口
if(checkPropertyNull(kpi.getImp())){
criteria.andImpEqualTo(kpi.getImp());
criteria2.andImpEqualTo(kpi.getImp());
criteria3.andImpEqualTo(kpi.getImp());
criteria4.andImpEqualTo(kpi.getImp());
}
//根据出口
if(checkPropertyNull(kpi.getExp())){
criteria.andExpEqualTo(kpi.getExp());
criteria2.andExpEqualTo(kpi.getExp());
criteria3.andExpEqualTo(kpi.getExp());
criteria4.andExpEqualTo(kpi.getExp());
}
//根据时间段-年
if(kpi.getCuryear()!=null&&kpi.getEndyear()!=null){
criteria.andCuryearBetween(kpi.getCuryear(),kpi.getEndyear());
criteria2.andCuryearBetween(kpi.getCuryear(),kpi.getEndyear());
criteria3.andCuryearBetween(kpi.getCuryear(),kpi.getEndyear());
criteria4.andCuryearBetween(kpi.getCuryear(),kpi.getEndyear());
}
//根据时间段-月
if(kpi.getCurmonth()!=null&&kpi.getEndmonth()!=null){
criteria.andCurmonthBetween(kpi.getCurmonth(),kpi.getEndmonth());
criteria2.andCurmonthBetween(kpi.getCurmonth(),kpi.getEndmonth());
criteria3.andCurmonthBetween(kpi.getCurmonth(),kpi.getEndmonth());
criteria4.andCurmonthBetween(kpi.getCurmonth(),kpi.getEndmonth());
}
//根据时间段-日
if(kpi.getCurweek()!=null&&kpi.getEndweek()!=null){
criteria.andCurweekBetween(kpi.getCurweek(),kpi.getEndweek());
criteria2.andCurweekBetween(kpi.getCurweek(),kpi.getEndweek());
criteria3.andCurweekBetween(kpi.getCurweek(),kpi.getEndweek());
criteria4.andCurweekBetween(kpi.getCurweek(),kpi.getEndweek());
}
//根据承运人搜索
if (checkPropertyNull(kpi.getAirline1())){
String carrier = kpi.getAirline1();
criteria.andAirline1EqualTo(carrier);
criteria2.andAirline2EqualTo(carrier);
criteria3.andAirline3EqualTo(carrier);
criteria4.andAirline4EqualTo(carrier);
example.or(criteria2);
example.or(criteria3);
example.or(criteria4);
}
//example.setOrderByClause("user_id"); //设置order 字段
//没加入分页前的搜索总数据数
int count = kpiService.countByExample(example);
BigDecimal weight = kpiService.sumWeightByExample(example);
BigDecimal pcs= kpiService.sumPcsByExample(example);
BigDecimal vol= kpiService.sumVolByExample(example);
BigDecimal hbillqty= kpiService.sumHbillqtyByExample(example);
Totals totals = new Totals(weight,pcs,vol,hbillqty);
Page page = new Page(defaultDataStart,defaultPerPage);
page.setCount(count);
example.setPage(page); //oracle 用这个
List<TKpiCargoWaybill> kpilist = kpiService.selectByExample(example);
ModelAndPage<TKpiCargoWaybill> modelAndPage = new ModelAndPage(kpilist,page,totals);
return modelAndPage;
}
}
... ...
package com.tianbo.controller.json;
import com.tianbo.common.ModelAndPage;
import com.tianbo.controller.base.BaseController;
import com.tianbo.model.TKpiCargoManifest;
import com.tianbo.model.TKpiCargoManifestExample;
import com.tianbo.model.TKpiCargoManifestExample.Criteria;
import com.tianbo.service.ManiFestService;
import com.tianbo.util.dao.Page;
import com.tianbo.util.dao.Totals;
import org.apache.shiro.authz.annotation.RequiresRoles;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.ModelAttribute;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.ResponseBody;
import org.springframework.web.servlet.ModelAndView;
import java.math.BigDecimal;
import java.util.List;
@Controller
@RequestMapping("/man")
public class ManiFestJsonController extends BaseController{
@Autowired
ManiFestService maniFestService;
@RequestMapping(value = "list.json",method = RequestMethod.POST)
@RequiresRoles("admin")
@ResponseBody
public ModelAndPage<TKpiCargoManifest> maniList(@ModelAttribute TKpiCargoManifest manifest, @ModelAttribute Page frontPage){
if(frontPage.getBegin()>=0){
defaultDataStart = frontPage.getBegin();
}
if (frontPage.getLength()>0){
defaultPerPage = frontPage.getLength();
}
TKpiCargoManifestExample example = new TKpiCargoManifestExample();
Criteria criteria = example.createCriteria();
//根据时间段-年
if(manifest.getCuryear()!=null&&manifest.getEndyear()!=null){
criteria.andCuryearBetween(manifest.getCuryear(),manifest.getEndyear());
}
//根据时间段-月
if(manifest.getCurmonth()!=null&&manifest.getEndmonth()!=null){
criteria.andCurmonthBetween(manifest.getCurmonth(),manifest.getEndmonth());
}
//根据时间段-日
if(manifest.getCurweek()!=null&&manifest.getEndweek()!=null){
criteria.andCurweekBetween(manifest.getCurweek(),manifest.getEndweek());
}
//根据机号
if(checkPropertyNull(manifest.getPlaneno())){
criteria.andPlanenoEqualTo(manifest.getPlaneno());
}
//根据航班号
if(checkPropertyNull(manifest.getFlightno())){
criteria.andFlightnoEqualTo(manifest.getFlightno());
}
//根据机型
if(checkPropertyNull(manifest.getPlanetype())){
criteria.andPlanetypeEqualTo(manifest.getPlanetype());
}
//根据航空公司
if(checkPropertyNull(manifest.getAircorpid())){
criteria.andAircorpidEqualTo(manifest.getAircorpid());
}
//进出港
if(checkPropertyNull(manifest.getExpimp())){
criteria.andExpimpEqualTo(manifest.getExpimp());
}
//国内国际
if(checkPropertyNull(manifest.getDomint())){
criteria.andDomintEqualTo(manifest.getDomint());
}
//运单类型
if(checkPropertyNull(manifest.getWaybilltype())){
criteria.andWaybilltypeEqualTo(manifest.getWaybilltype());
}
//营业点
if(checkPropertyNull(manifest.getOperdepartid())){
criteria.andOperdepartidEqualTo(manifest.getOperdepartid());
}
int count = maniFestService.countByExample(example);
BigDecimal weight = maniFestService.sumWeightByExample(example);
BigDecimal pcs= maniFestService.sumPcsByExample(example);
BigDecimal vol= maniFestService.sumVolByExample(example);
Totals totals = new Totals(weight,pcs,vol);
Page page = new Page(defaultDataStart,defaultPerPage);
page.setCount(count);
example.setPage(page); //oracle 用这个
List<TKpiCargoManifest> maniList = maniFestService.selectByExample(example);
ModelAndPage<TKpiCargoManifest> modelAndPage = new ModelAndPage<TKpiCargoManifest>(maniList,page,totals);
return modelAndPage;
}
}
... ...
package com.tianbo.controller.json;
import com.tianbo.common.ModelAndPage;
import com.tianbo.model.*;
import com.tianbo.service.PermissionService;
import com.tianbo.service.RolePermissionService;
import com.tianbo.util.dao.Page;
import com.tianbo.util.json.ResponseModel;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.*;
import javax.servlet.http.HttpServletRequest;
import java.math.BigDecimal;
import java.util.List;
@Controller
@RequestMapping("/permission")
public class PermissionJsonContorller {
//service类
@Autowired
private PermissionService permissionService;
@Autowired
private RolePermissionService rolePermissionService;
@RequestMapping("list.json")
@ResponseBody
public ModelAndPage Permissionlist(){ //所有权限列表
PermissionExample example = new PermissionExample();
//调用service方法得到用户列表
List<Permission> pms = permissionService.selectByExample(example);
ModelAndPage modelAndPage = new ModelAndPage(pms,new Page());
return modelAndPage;
}
@RequestMapping(value = "listByRole.json",method = RequestMethod.POST)
@ResponseBody
public ModelAndPage listByRole(@RequestBody RolePermission rolePermission){ //角色权限列表
BigDecimal testID = new BigDecimal(1);
RolePermissionExample example = new RolePermissionExample();
example.createCriteria().andRoleIdEqualTo(testID);
//调用service方法得到用户列表
List<RolePermission> rp = rolePermissionService.selectByExample(example);
ModelAndPage modelAndPage = new ModelAndPage(rp,new Page());
return modelAndPage;
}
@RequestMapping("update.json")
@ResponseBody
public ResponseModel insertByroleID(@RequestBody RolePermission rolePermission){
BigDecimal roleId = rolePermission.getRoleId();
//先删除以前的权限绑定。
//再插入新的权限绑定.
RolePermissionExample delExample = new RolePermissionExample();
delExample.createCriteria().andRoleIdEqualTo(roleId);
int delSuccess = rolePermissionService.deleteByExample(delExample);
if (delSuccess>0){
//循环取出提交的已选择的Permission id列表,再插入
for(Integer PmsId:rolePermission.getPmList()){
RolePermission rolePermission1 = new RolePermission();
rolePermission1.setRoleId(roleId);
rolePermission1.setPermissionId(new BigDecimal(PmsId));
int i = rolePermissionService.insert(rolePermission1);
if (i<=0){
return new ResponseModel(500,"权限更新失败");
}
}
}else {
return new ResponseModel(500,"权限更新失败");
}
return new ResponseModel(200,"权限更新成功");
}
@RequestMapping("edit.json")
@ResponseBody
public ModelAndPage edit(){
PermissionExample example = new PermissionExample();
//调用service方法得到用户列表
List<Permission> pms = permissionService.selectByExample(example);
ModelAndPage modelAndPage = new ModelAndPage(pms,new Page());
return modelAndPage;
}
}
... ...
/**
* Copyright &copy; 2015-2020 <a href="--版权信息--">JeePlus</a> All rights reserved.
*/
package com.tianbo.controller.json;
import java.io.IOException;
import java.io.PrintWriter;
import javax.servlet.http.HttpServletResponse;
public class PrintJSON {
public static void write(HttpServletResponse response,String content) {
response.reset();
response.setContentType("application/json");
response.setHeader("Cache-Control", "no-store");
response.setCharacterEncoding("UTF-8");
try {
PrintWriter pw=response.getWriter();
pw.write(content);
pw.flush();
} catch (IOException e) {
e.printStackTrace();
}
}
}
... ...
package com.tianbo.controller.json;
import com.tianbo.common.ModelAndPage;
import com.tianbo.controller.base.BaseController;
import com.tianbo.model.Role;
import com.tianbo.model.RoleExample;
import com.tianbo.service.RoleService;
import com.tianbo.util.dao.Page;
import com.tianbo.util.json.ResponseModel;
import com.tianbo.util.tools.MD5Tools;
import org.apache.shiro.authz.annotation.RequiresRoles;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.*;
import java.util.Date;
import java.util.List;
@Controller
@RequestMapping("/role")
public class RoleJsonController extends BaseController{
//service类
@Autowired
private RoleService roleService;
@RequestMapping("list.json")
@RequiresRoles("admin")
@ResponseBody
public ModelAndPage list(@ModelAttribute Page frontPage, @ModelAttribute Role role) throws Exception{
RoleExample example = new RoleExample();
example.setOrderByClause("role_id");
//调用service方法得到用户列表
List<Role> roles = roleService.selectByExample(example);
ModelAndPage modelAndPage = new ModelAndPage(roles,new Page());
return modelAndPage;
}
@RequestMapping("roleExamlpe.json")
@ResponseBody
public Role example(){
return new Role();
}
@RequestMapping(value = "add.json",method = RequestMethod.POST)
@RequiresRoles("admin")
@ResponseBody
public ResponseModel add(@RequestBody Role role){
ResponseModel responseModel = new ResponseModel();
if (checkRole(role)){
int i = roleService.insert(role);
if(i>0){
responseModel.setStatus(200);
responseModel.setMsg("添加角色成功");
}else {
responseModel.setStatus(500);
responseModel.setMsg("添加角色失败");
}
}else {
responseModel.setStatus(500);
responseModel.setMsg("添加角色失败,已存在相同名称的角色");
}
return responseModel;
}
private Boolean checkRole( Role role){
if (roleService.checkRole(role)){
return Boolean.FALSE; //存在用户,返回false
}else {
return Boolean.TRUE; //不存在用户,返回true,可以添加用户
}
}
}
... ...
package com.tianbo.controller.json;
import com.tianbo.common.ModelAndPage;
import com.tianbo.controller.base.BaseController;
import com.tianbo.model.Users;
import com.tianbo.model.UsersExample;
import com.tianbo.service.UserService;
import com.tianbo.util.dao.Page;
import com.tianbo.util.json.ResponseModel;
import com.tianbo.util.tools.MD5Tools;
import org.apache.shiro.authz.annotation.RequiresPermissions;
import org.apache.shiro.authz.annotation.RequiresRoles;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.*;
import org.springframework.web.servlet.ModelAndView;
import java.text.SimpleDateFormat;
import java.util.Date;
/**
* Created by mrz on 2017/8/23.
*/
@Controller
@RequestMapping("/user")
public class UserJsonController extends BaseController{
//service类
@Autowired
private UserService userService;
@RequestMapping("userExample.json")
@RequiresRoles("admin")
@ResponseBody
public Users userExample() {
Users users = new Users();
return users;
}
@RequestMapping("userById.json")
@RequiresRoles("admin")
@ResponseBody
public Users userList(@ModelAttribute Users user) throws Exception{
Users users = userService.selectByUserId(user.getUserId());
return users;
}
/**
* 查找所用用户控制器方法
* @return
* @throws Exception
*/
@RequestMapping("list.json")
@RequiresRoles("admin")
@ResponseBody
public ModelAndPage userList(@ModelAttribute Page frontPage,@ModelAttribute Users user) throws Exception{
if(frontPage.getBegin()>=0){ defaultDataStart = frontPage.getBegin();}
if (frontPage.getLength()>0){ defaultPerPage = frontPage.getLength();}
//调用service方法得到用户列表
ModelAndPage users = userService.userList(defaultDataStart,defaultPerPage,user);
return users;
}
@RequestMapping(value = "baseUpdate.json",method = RequestMethod.POST)
@RequiresRoles("admin")
@RequiresPermissions("user:edit")
@ResponseBody
public ResponseModel baseUpdate(@RequestBody Users user){
user.setUpdatetime(new Date());
int n = userService.updateByPrimaryKey(user);
ResponseModel responseModel = new ResponseModel();
if (n>0){
responseModel.setStatus(200);
responseModel.setMsg("用户资料更新成功");
return responseModel;
}else {
responseModel.setStatus(500);
responseModel.setMsg("用户资料更新失败");
return responseModel;
}
}
@RequestMapping(value = "add.json",method = RequestMethod.POST)
@RequiresRoles("admin")
@ResponseBody
public ResponseModel add(@RequestBody Users user){
ResponseModel responseModel = new ResponseModel();
if(checkUser(user)){
String userPW = user.getPassword();
String PWMD5 = MD5Tools.MD5(userPW);
user.setPassword(PWMD5);
user.setCreattime(new Date());
int n = userService.insert(user);
if (n>0){
responseModel.setStatus(200);
responseModel.setMsg("用户添加成功");
}else {
}
}else {
responseModel.setStatus(500);
responseModel.setMsg("用户添加失败,已存在用户");
}
return responseModel;
}
@RequestMapping(value = "del.json",method = RequestMethod.POST)
@RequiresRoles("admin")
@ResponseBody
public ResponseModel del(@ModelAttribute Users user){
ResponseModel responseModel = new ResponseModel();
int n = userService.deleteByPrimaryKey(user.getUserId());
if (n>0){
responseModel.setStatus(200);
responseModel.setMsg("用户删除成功");
}else {
responseModel.setStatus(500);
responseModel.setMsg("用户删除失败");
}
return responseModel;
}
private Boolean checkUser( Users user){
if (userService.checkUser(user)){
return Boolean.FALSE; //存在用户,返回false
}else {
return Boolean.TRUE; //不存在用户,返回true,可以添加用户
}
}
}
... ...
package com.tianbo.controller;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;
import com.tianbo.common.sendFile;
import com.tianbo.util.PropertiesUtils;
import com.tianbo.util.json.ResponseModel;
@Controller
public class sendController {
@RequestMapping("/move")
@ResponseBody
public ResponseModel moveTo(String fileName) {
String path = PropertiesUtils.readProperty("targetPath");
new sendFile().move(fileName,path);
ResponseModel model = new ResponseModel();
model.setStatus(1);
return model;
}
}
... ...
package com.tianbo.controller.tally;
import java.util.HashMap;
import java.util.Map;
import javax.servlet.http.HttpServletRequest;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.ui.ModelMap;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.ResponseBody;
import com.tianbo.model.Originmanifestsecondary;
import com.tianbo.model.Tallymaster;
import com.tianbo.service.OriginmanifestsecondaryService;
import com.tianbo.service.TallymasterSecondService;
import com.tianbo.service.TallymasterService;
import com.tianbo.util.DateUtils;
import com.tianbo.util.json.JsonConversion;
@Controller
@RequestMapping(value = "tally")
public class TallyController {
@Autowired
private TallymasterService tallymasterService;
@Autowired
private TallymasterSecondService tallymasterSecondService;
@Autowired
private OriginmanifestsecondaryService originmanifestsecondaryService;
/**
* 到totally页面
* @return
*/
@RequestMapping(value = "totally")
public String searchArr() {
return "totally";
}
/**
* 分批标识修改页面
* @param model
* @param request
* @return
*/
@RequestMapping(value = "toBatch")
public String toBatch(ModelMap model,HttpServletRequest request) {
String waybillnomaster = request.getParameter("waybillnomaster");
model.put("waybillnomaster", waybillnomaster);
return "batch";
}
@ResponseBody
@RequestMapping(value = "insert")
public String toTransForm(ModelMap model,HttpServletRequest request) {
Map<String,Object> map = new HashMap<>();
String waybillnomaster = request.getParameter("waybillnomaster");
String flightno = request.getParameter("flightno");
String flightdate = request.getParameter("flightdate");
Tallymaster tallymaster = new Tallymaster();
tallymaster.setWaybillnomaster(waybillnomaster);
if(flightno!=null){
tallymaster.setFlightno(flightno);
}
if(flightdate!=null){
tallymaster.setFlightdate(DateUtils.stringToDate(flightdate, "yyyy-mm-dd"));
}
boolean AUTOID = tallymasterService.checkAUTOID(tallymaster);
Originmanifestsecondary Originmanifestsecondary = new Originmanifestsecondary();
Originmanifestsecondary.setWaybillnomaster(waybillnomaster);
boolean ORIGINMANIFESTSECONDARY = originmanifestsecondaryService.check(Originmanifestsecondary);
if(!AUTOID && ORIGINMANIFESTSECONDARY){
map.put("code", 0);
map.put("msg", "无此单号理货主单数据");
}else if(!ORIGINMANIFESTSECONDARY && AUTOID){
map.put("code", 0);
map.put("msg", "无此单号原始分单数据");
}else if(!AUTOID && !ORIGINMANIFESTSECONDARY){
map.put("code", 0);
map.put("msg", "无此单号原始分单数据与理货主单数据");
}else {
try {
tallymasterSecondService.insert(tallymaster);
map.put("code", 1);
map.put("msg", "原始分单数据已转理货分单");
} catch (Exception e) {
e.printStackTrace();
map.put("code", -1);
map.put("msg", "转换异常,请重试");
}
}
return JsonConversion.writeMapJSON(map);
}
}
... ...
package com.tianbo.mapper;
import java.util.List;
import org.apache.ibatis.annotations.Param;
import com.tianbo.model.Arrivedmaster;
import com.tianbo.model.ArrivedmasterExample;
public interface ArrivedmasterMapper {
int countByExample(ArrivedmasterExample example);
int deleteByExample(ArrivedmasterExample example);
int insert(Arrivedmaster record);
int insertSelective(Arrivedmaster record);
List<Arrivedmaster> selectByExample(ArrivedmasterExample example);
int updateByExampleSelective(@Param("record") Arrivedmaster record, @Param("example") ArrivedmasterExample example);
int updateByExample(@Param("record") Arrivedmaster record, @Param("example") ArrivedmasterExample example);
}
\ No newline at end of file
... ...
package com.tianbo.mapper;
import com.tianbo.model.MessageBak;
import com.tianbo.model.MessageBakExample;
import java.util.List;
import org.apache.ibatis.annotations.Param;
import org.springframework.stereotype.Component;
public interface MessageBakMapper {
int countByExample(MessageBakExample example);
int deleteByExample(MessageBakExample example);
int deleteByPrimaryKey(Short fid);
int insert(MessageBak record);
int insertSelective(MessageBak record);
List<MessageBak> selectByExampleWithBLOBs(MessageBakExample example);
List<MessageBak> selectByExample(MessageBakExample example);
MessageBak selectByPrimaryKey(Short fid);
int updateByExampleSelective(@Param("record") MessageBak record, @Param("example") MessageBakExample example);
int updateByExampleWithBLOBs(@Param("record") MessageBak record, @Param("example") MessageBakExample example);
int updateByExample(@Param("record") MessageBak record, @Param("example") MessageBakExample example);
int updateByPrimaryKeySelective(MessageBak record);
int updateByPrimaryKeyWithBLOBs(MessageBak record);
int updateByPrimaryKey(MessageBak record);
}
\ No newline at end of file
... ...
package com.tianbo.mapper;
import com.tianbo.model.Originmanifestmaster;
import com.tianbo.model.OriginmanifestmasterExample;
import java.util.List;
import org.apache.ibatis.annotations.Param;
public interface OriginmanifestmasterMapper {
int countByExample(OriginmanifestmasterExample example);
int deleteByExample(OriginmanifestmasterExample example);
int insert(Originmanifestmaster record);
int insertSelective(Originmanifestmaster record);
List<Originmanifestmaster> selectByExample(OriginmanifestmasterExample example);
int updateByExampleSelective(@Param("record") Originmanifestmaster record, @Param("example") OriginmanifestmasterExample example);
int updateByExample(@Param("record") Originmanifestmaster record, @Param("example") OriginmanifestmasterExample example);
List<Originmanifestmaster> getList(Originmanifestmaster mainfest);
void updateMain(Originmanifestmaster mainfest);
void updateToT(Originmanifestmaster mainfest);
void updateSecond(Originmanifestmaster mainfest);
void updateStatus(Originmanifestmaster mainfest);
void updateMainStatus(Originmanifestmaster mainfest);
void updateAllStatus(Originmanifestmaster mainfest);
void updateAllMainStatus(Originmanifestmaster mainfest);
void insertTransit(Originmanifestmaster mainfest);
}
\ No newline at end of file
... ...
package com.tianbo.mapper;
import java.util.List;
import org.apache.ibatis.annotations.Param;
import com.tianbo.model.Originmanifestsecondary;
import com.tianbo.model.OriginmanifestsecondaryExample;
public interface OriginmanifestsecondaryMapper {
int countByExample(OriginmanifestsecondaryExample example);
int deleteByExample(OriginmanifestsecondaryExample example);
int insert(Originmanifestsecondary record);
int insertSelective(Originmanifestsecondary record);
List<Originmanifestsecondary> getList(Originmanifestsecondary example);
List<Originmanifestsecondary> selectByExample(OriginmanifestsecondaryExample example);
int updateByExampleSelective(@Param("record") Originmanifestsecondary record, @Param("example") OriginmanifestsecondaryExample example);
int updateByExample(@Param("record") Originmanifestsecondary record, @Param("example") OriginmanifestsecondaryExample example);
}
\ No newline at end of file
... ...
package com.tianbo.mapper;
import com.tianbo.model.Permission;
import com.tianbo.model.PermissionExample;
import java.math.BigDecimal;
import java.util.List;
import org.apache.ibatis.annotations.Param;
public interface PermissionMapper {
int countByExample(PermissionExample example);
int deleteByExample(PermissionExample example);
int deleteByPrimaryKey(BigDecimal permissionId);
int insert(Permission record);
int insertSelective(Permission record);
List<Permission> selectByExample(PermissionExample example);
Permission selectByPrimaryKey(BigDecimal permissionId);
int updateByExampleSelective(@Param("record") Permission record, @Param("example") PermissionExample example);
int updateByExample(@Param("record") Permission record, @Param("example") PermissionExample example);
int updateByPrimaryKeySelective(Permission record);
int updateByPrimaryKey(Permission record);
}
\ No newline at end of file
... ...
package com.tianbo.mapper;
import java.util.List;
import org.apache.ibatis.annotations.Param;
import com.tianbo.model.Preparemaster;
import com.tianbo.model.PreparemasterExample;
public interface PreparemasterMapper {
int countByExample(PreparemasterExample example);
int deleteByExample(PreparemasterExample example);
int insert(Preparemaster record);
int insertSelective(Preparemaster record);
List<Preparemaster> selectByExample(PreparemasterExample example);
int updateByExampleSelective(@Param("record") Preparemaster record, @Param("example") PreparemasterExample example);
int updateByExample(@Param("record") Preparemaster record, @Param("example") PreparemasterExample example);
}
\ No newline at end of file
... ...
package com.tianbo.mapper;
import com.tianbo.model.Role;
import com.tianbo.model.RoleExample;
import java.math.BigDecimal;
import java.util.List;
import org.apache.ibatis.annotations.Param;
public interface RoleMapper {
int countByExample(RoleExample example);
int deleteByExample(RoleExample example);
int deleteByPrimaryKey(BigDecimal roleId);
int insert(Role record);
int insertSelective(Role record);
List<Role> selectByExample(RoleExample example);
Role selectByPrimaryKey(BigDecimal roleId);
int updateByExampleSelective(@Param("record") Role record, @Param("example") RoleExample example);
int updateByExample(@Param("record") Role record, @Param("example") RoleExample example);
int updateByPrimaryKeySelective(Role record);
int updateByPrimaryKey(Role record);
}
\ No newline at end of file
... ...
package com.tianbo.mapper;
import com.tianbo.model.RolePermission;
import com.tianbo.model.RolePermissionExample;
import java.math.BigDecimal;
import java.util.List;
import org.apache.ibatis.annotations.Param;
public interface RolePermissionMapper {
int countByExample(RolePermissionExample example);
int deleteByExample(RolePermissionExample example);
int deleteByPrimaryKey(BigDecimal id);
int insert(RolePermission record);
int insertSelective(RolePermission record);
List<RolePermission> selectByExample(RolePermissionExample example);
RolePermission selectByPrimaryKey(BigDecimal id);
int updateByExampleSelective(@Param("record") RolePermission record, @Param("example") RolePermissionExample example);
int updateByExample(@Param("record") RolePermission record, @Param("example") RolePermissionExample example);
int updateByPrimaryKeySelective(RolePermission record);
int updateByPrimaryKey(RolePermission record);
}
\ No newline at end of file
... ...
package com.tianbo.mapper;
import java.util.List;
import org.apache.ibatis.annotations.Param;
import com.tianbo.model.Sendlog;
import com.tianbo.model.SendlogExample;
public interface SendlogMapper {
int countByExample(SendlogExample example);
int deleteByExample(SendlogExample example);
int insert(Sendlog record);
int insertSelective(Sendlog record);
List<Sendlog> selectByExample(SendlogExample example);
int updateByExampleSelective(@Param("record") Sendlog record, @Param("example") SendlogExample example);
int updateByExample(@Param("record") Sendlog record, @Param("example") SendlogExample example);
List<Sendlog> getSendLog(String billNo);
List<Sendlog> getSendLogSecond(String billNoSecond);
List<Sendlog> getSendLogSecondByMain(String billNo);
}
\ No newline at end of file
... ...
package com.tianbo.mapper;
import com.tianbo.model.TEtlMessage;
import com.tianbo.model.TEtlMessageExample;
import java.math.BigDecimal;
import java.util.List;
import org.apache.ibatis.annotations.Param;
public interface TEtlMessageMapper {
int countByExample(TEtlMessageExample example);
int deleteByExample(TEtlMessageExample example);
int deleteByPrimaryKey(BigDecimal fid);
int insert(TEtlMessage record);
int insertSelective(TEtlMessage record);
List<TEtlMessage> selectByExampleWithBLOBs(TEtlMessageExample example);
List<TEtlMessage> selectByExample(TEtlMessageExample example);
TEtlMessage selectByPrimaryKey(BigDecimal fid);
int updateByExampleSelective(@Param("record") TEtlMessage record, @Param("example") TEtlMessageExample example);
int updateByExampleWithBLOBs(@Param("record") TEtlMessage record, @Param("example") TEtlMessageExample example);
int updateByExample(@Param("record") TEtlMessage record, @Param("example") TEtlMessageExample example);
int updateByPrimaryKeySelective(TEtlMessage record);
int updateByPrimaryKeyWithBLOBs(TEtlMessage record);
int updateByPrimaryKey(TEtlMessage record);
}
\ No newline at end of file
... ...
package com.tianbo.mapper;
import com.tianbo.model.TKpiCargoManifest;
import com.tianbo.model.TKpiCargoManifestExample;
import java.math.BigDecimal;
import java.util.List;
import org.apache.ibatis.annotations.Param;
public interface TKpiCargoManifestMapper {
int countByExample(TKpiCargoManifestExample example);
int deleteByExample(TKpiCargoManifestExample example);
int deleteByPrimaryKey(BigDecimal fid);
int insert(TKpiCargoManifest record);
int insertSelective(TKpiCargoManifest record);
List<TKpiCargoManifest> selectByExample(TKpiCargoManifestExample example);
TKpiCargoManifest selectByPrimaryKey(BigDecimal fid);
int updateByExampleSelective(@Param("record") TKpiCargoManifest record, @Param("example") TKpiCargoManifestExample example);
int updateByExample(@Param("record") TKpiCargoManifest record, @Param("example") TKpiCargoManifestExample example);
int updateByPrimaryKeySelective(TKpiCargoManifest record);
int updateByPrimaryKey(TKpiCargoManifest record);
BigDecimal sumWeightByExample(TKpiCargoManifestExample example);
BigDecimal sumPcsByExample(TKpiCargoManifestExample example);
BigDecimal sumVolByExample(TKpiCargoManifestExample example);
}
\ No newline at end of file
... ...
package com.tianbo.mapper;
import com.tianbo.model.TKpiCargoWaybill;
import com.tianbo.model.TKpiCargoWaybillExample;
import java.math.BigDecimal;
import java.util.List;
import org.apache.ibatis.annotations.Param;
public interface TKpiCargoWaybillMapper {
int countByExample(TKpiCargoWaybillExample example);
int deleteByExample(TKpiCargoWaybillExample example);
int deleteByPrimaryKey(BigDecimal fid);
int insert(TKpiCargoWaybill record);
int insertSelective(TKpiCargoWaybill record);
List<TKpiCargoWaybill> selectByExample(TKpiCargoWaybillExample example);
TKpiCargoWaybill selectByPrimaryKey(BigDecimal fid);
int updateByExampleSelective(@Param("record") TKpiCargoWaybill record, @Param("example") TKpiCargoWaybillExample example);
int updateByExample(@Param("record") TKpiCargoWaybill record, @Param("example") TKpiCargoWaybillExample example);
int updateByPrimaryKeySelective(TKpiCargoWaybill record);
int updateByPrimaryKey(TKpiCargoWaybill record);
BigDecimal sumWeightByExample(TKpiCargoWaybillExample example);
BigDecimal sumPcsByExample(TKpiCargoWaybillExample example);
BigDecimal sumVolByExample(TKpiCargoWaybillExample example);
BigDecimal sumHbillqtyByExample(TKpiCargoWaybillExample example);
}
\ No newline at end of file
... ...
package com.tianbo.mapper;
import com.tianbo.model.TOlapColumn;
import com.tianbo.model.TOlapColumnExample;
import java.math.BigDecimal;
import java.util.List;
import org.apache.ibatis.annotations.Param;
public interface TOlapColumnMapper {
int countByExample(TOlapColumnExample example);
int deleteByExample(TOlapColumnExample example);
int deleteByPrimaryKey(BigDecimal columnid);
int insert(TOlapColumn record);
int insertSelective(TOlapColumn record);
List<TOlapColumn> selectByExample(TOlapColumnExample example);
TOlapColumn selectByPrimaryKey(BigDecimal columnid);
int updateByExampleSelective(@Param("record") TOlapColumn record, @Param("example") TOlapColumnExample example);
int updateByExample(@Param("record") TOlapColumn record, @Param("example") TOlapColumnExample example);
int updateByPrimaryKeySelective(TOlapColumn record);
int updateByPrimaryKey(TOlapColumn record);
}
\ No newline at end of file
... ...
package com.tianbo.mapper;
import com.tianbo.model.TOlapDataset;
import com.tianbo.model.TOlapDatasetExample;
import java.math.BigDecimal;
import java.util.List;
import org.apache.ibatis.annotations.Param;
public interface TOlapDatasetMapper {
int countByExample(TOlapDatasetExample example);
int deleteByExample(TOlapDatasetExample example);
int deleteByPrimaryKey(BigDecimal datasetid);
int insert(TOlapDataset record);
int insertSelective(TOlapDataset record);
List<TOlapDataset> selectByExample(TOlapDatasetExample example);
TOlapDataset selectByPrimaryKey(BigDecimal datasetid);
int updateByExampleSelective(@Param("record") TOlapDataset record, @Param("example") TOlapDatasetExample example);
int updateByExample(@Param("record") TOlapDataset record, @Param("example") TOlapDatasetExample example);
int updateByPrimaryKeySelective(TOlapDataset record);
int updateByPrimaryKey(TOlapDataset record);
}
\ No newline at end of file
... ...
package com.tianbo.mapper;
import com.tianbo.model.TOlapXmldoc;
import com.tianbo.model.TOlapXmldocExample;
import java.math.BigDecimal;
import java.util.List;
import org.apache.ibatis.annotations.Param;
public interface TOlapXmldocMapper {
int countByExample(TOlapXmldocExample example);
int deleteByExample(TOlapXmldocExample example);
int deleteByPrimaryKey(BigDecimal docid);
int insert(TOlapXmldoc record);
int insertSelective(TOlapXmldoc record);
List<TOlapXmldoc> selectByExample(TOlapXmldocExample example);
TOlapXmldoc selectByPrimaryKey(BigDecimal docid);
int updateByExampleSelective(@Param("record") TOlapXmldoc record, @Param("example") TOlapXmldocExample example);
int updateByExample(@Param("record") TOlapXmldoc record, @Param("example") TOlapXmldocExample example);
int updateByPrimaryKeySelective(TOlapXmldoc record);
int updateByPrimaryKey(TOlapXmldoc record);
}
\ No newline at end of file
... ...
package com.tianbo.mapper;
import com.tianbo.model.TOlapXmlnode;
import com.tianbo.model.TOlapXmlnodeExample;
import java.math.BigDecimal;
import java.util.List;
import org.apache.ibatis.annotations.Param;
public interface TOlapXmlnodeMapper {
int countByExample(TOlapXmlnodeExample example);
int deleteByExample(TOlapXmlnodeExample example);
int deleteByPrimaryKey(BigDecimal nodeid);
int insert(TOlapXmlnode record);
int insertSelective(TOlapXmlnode record);
List<TOlapXmlnode> selectByExample(TOlapXmlnodeExample example);
TOlapXmlnode selectByPrimaryKey(BigDecimal nodeid);
int updateByExampleSelective(@Param("record") TOlapXmlnode record, @Param("example") TOlapXmlnodeExample example);
int updateByExample(@Param("record") TOlapXmlnode record, @Param("example") TOlapXmlnodeExample example);
int updateByPrimaryKeySelective(TOlapXmlnode record);
int updateByPrimaryKey(TOlapXmlnode record);
}
\ No newline at end of file
... ...
package com.tianbo.mapper;
import com.tianbo.model.Tallymaster;
import com.tianbo.model.TallymasterExample;
import java.util.List;
import org.apache.ibatis.annotations.Param;
public interface TallymasterMapper {
int countByExample(TallymasterExample example);
int deleteByExample(TallymasterExample example);
int insert(Tallymaster record);
int insertSelective(Tallymaster record);
List<Tallymaster> selectByExample(TallymasterExample example);
int updateByExampleSelective(@Param("record") Tallymaster record, @Param("example") TallymasterExample example);
int updateByExample(@Param("record") Tallymaster record, @Param("example") TallymasterExample example);
}
\ No newline at end of file
... ...
package com.tianbo.mapper;
import com.tianbo.model.Tallymaster;
import com.tianbo.model.Tallysecondary;
import com.tianbo.model.TallysecondaryExample;
import java.util.List;
import org.apache.ibatis.annotations.Param;
public interface TallysecondaryMapper {
int countByExample(TallysecondaryExample example);
int deleteByExample(TallysecondaryExample example);
int insert(Tallysecondary record);
int insertSelective(Tallysecondary record);
void insertTallySecond(Tallymaster tallymaster);
List<Tallysecondary> selectByExample(TallysecondaryExample example);
int updateByExampleSelective(@Param("record") Tallysecondary record, @Param("example") TallysecondaryExample example);
int updateByExample(@Param("record") Tallysecondary record, @Param("example") TallysecondaryExample example);
}
\ No newline at end of file
... ...
package com.tianbo.mapper;
import com.tianbo.model.UserRole;
import com.tianbo.model.UserRoleExample;
import java.math.BigDecimal;
import java.util.List;
import org.apache.ibatis.annotations.Param;
public interface UserRoleMapper {
int countByExample(UserRoleExample example);
int deleteByExample(UserRoleExample example);
int deleteByPrimaryKey(BigDecimal id);
int insert(UserRole record);
int insertSelective(UserRole record);
List<UserRole> selectByExample(UserRoleExample example);
UserRole selectByPrimaryKey(BigDecimal id);
int updateByExampleSelective(@Param("record") UserRole record, @Param("example") UserRoleExample example);
int updateByExample(@Param("record") UserRole record, @Param("example") UserRoleExample example);
int updateByPrimaryKeySelective(UserRole record);
int updateByPrimaryKey(UserRole record);
}
\ No newline at end of file
... ...
package com.tianbo.mapper;
import com.tianbo.model.Users;
import com.tianbo.model.UsersExample;
import java.math.BigDecimal;
import java.util.List;
import org.apache.ibatis.annotations.Param;
public interface UsersMapper {
int countByExample(UsersExample example);
int deleteByExample(UsersExample example);
int deleteByPrimaryKey(BigDecimal userId);
int insert(Users record);
int insertSelective(Users record);
List<Users> selectByExample(UsersExample example);
Users selectByPrimaryKey(BigDecimal userId);
int updateByExampleSelective(@Param("record") Users record, @Param("example") UsersExample example);
int updateByExample(@Param("record") Users record, @Param("example") UsersExample example);
int updateByPrimaryKeySelective(Users record);
int updateByPrimaryKey(Users record);
}
\ No newline at end of file
... ...
package com.tianbo.model;
import java.util.Date;
public class Arrivedmaster {
private String autoid;
private String waybillnomaster;
private String tcdName;
private String tcdTypecode;
private String flightno;
private Date flightdate;
private String carrier;
private String originatingstation;
private String oName;
private String destinationstation;
private String fdName;
private String arrivedtotalpiece;
private String totalpiecequantity;
private String arrivedtotalweight;
private String grossweightmeasureuc;
private String totalgrossweightmeasure;
private String totalgrossweightmeasureuc;
private String chargeableweightmeasure;
private String chargeableweightmeasureuc;
private String arriveddate;
private String transportsplitdescription;
private String customscode;
private String productname;
private String status;
private String receiptinformation;
private String createdate;
public String getAutoid() {
return autoid;
}
public void setAutoid(String autoid) {
this.autoid = autoid == null ? null : autoid.trim();
}
public String getWaybillnomaster() {
return waybillnomaster;
}
public void setWaybillnomaster(String waybillnomaster) {
this.waybillnomaster = waybillnomaster == null ? null : waybillnomaster.trim();
}
public String getTcdName() {
return tcdName;
}
public void setTcdName(String tcdName) {
this.tcdName = tcdName == null ? null : tcdName.trim();
}
public String getTcdTypecode() {
return tcdTypecode;
}
public void setTcdTypecode(String tcdTypecode) {
this.tcdTypecode = tcdTypecode == null ? null : tcdTypecode.trim();
}
public String getFlightno() {
return flightno;
}
public void setFlightno(String flightno) {
this.flightno = flightno == null ? null : flightno.trim();
}
public Date getFlightdate() {
return flightdate;
}
public void setFlightdate(Date flightdate) {
this.flightdate = flightdate;
}
public String getCarrier() {
return carrier;
}
public void setCarrier(String carrier) {
this.carrier = carrier == null ? null : carrier.trim();
}
public String getOriginatingstation() {
return originatingstation;
}
public void setOriginatingstation(String originatingstation) {
this.originatingstation = originatingstation == null ? null : originatingstation.trim();
}
public String getoName() {
return oName;
}
public void setoName(String oName) {
this.oName = oName == null ? null : oName.trim();
}
public String getDestinationstation() {
return destinationstation;
}
public void setDestinationstation(String destinationstation) {
this.destinationstation = destinationstation == null ? null : destinationstation.trim();
}
public String getFdName() {
return fdName;
}
public void setFdName(String fdName) {
this.fdName = fdName == null ? null : fdName.trim();
}
public String getArrivedtotalpiece() {
return arrivedtotalpiece;
}
public void setArrivedtotalpiece(String arrivedtotalpiece) {
this.arrivedtotalpiece = arrivedtotalpiece == null ? null : arrivedtotalpiece.trim();
}
public String getTotalpiecequantity() {
return totalpiecequantity;
}
public void setTotalpiecequantity(String totalpiecequantity) {
this.totalpiecequantity = totalpiecequantity == null ? null : totalpiecequantity.trim();
}
public String getArrivedtotalweight() {
return arrivedtotalweight;
}
public void setArrivedtotalweight(String arrivedtotalweight) {
this.arrivedtotalweight = arrivedtotalweight == null ? null : arrivedtotalweight.trim();
}
public String getGrossweightmeasureuc() {
return grossweightmeasureuc;
}
public void setGrossweightmeasureuc(String grossweightmeasureuc) {
this.grossweightmeasureuc = grossweightmeasureuc == null ? null : grossweightmeasureuc.trim();
}
public String getTotalgrossweightmeasure() {
return totalgrossweightmeasure;
}
public void setTotalgrossweightmeasure(String totalgrossweightmeasure) {
this.totalgrossweightmeasure = totalgrossweightmeasure == null ? null : totalgrossweightmeasure.trim();
}
public String getTotalgrossweightmeasureuc() {
return totalgrossweightmeasureuc;
}
public void setTotalgrossweightmeasureuc(String totalgrossweightmeasureuc) {
this.totalgrossweightmeasureuc = totalgrossweightmeasureuc == null ? null : totalgrossweightmeasureuc.trim();
}
public String getChargeableweightmeasure() {
return chargeableweightmeasure;
}
public void setChargeableweightmeasure(String chargeableweightmeasure) {
this.chargeableweightmeasure = chargeableweightmeasure == null ? null : chargeableweightmeasure.trim();
}
public String getChargeableweightmeasureuc() {
return chargeableweightmeasureuc;
}
public void setChargeableweightmeasureuc(String chargeableweightmeasureuc) {
this.chargeableweightmeasureuc = chargeableweightmeasureuc == null ? null : chargeableweightmeasureuc.trim();
}
public String getArriveddate() {
return arriveddate;
}
public void setArriveddate(String arriveddate) {
this.arriveddate = arriveddate;
}
public String getTransportsplitdescription() {
return transportsplitdescription;
}
public void setTransportsplitdescription(String transportsplitdescription) {
this.transportsplitdescription = transportsplitdescription == null ? null : transportsplitdescription.trim();
}
public String getCustomscode() {
return customscode;
}
public void setCustomscode(String customscode) {
this.customscode = customscode == null ? null : customscode.trim();
}
public String getProductname() {
return productname;
}
public void setProductname(String productname) {
this.productname = productname == null ? null : productname.trim();
}
public String getStatus() {
return status;
}
public void setStatus(String status) {
this.status = status == null ? null : status.trim();
}
public String getReceiptinformation() {
return receiptinformation;
}
public void setReceiptinformation(String receiptinformation) {
this.receiptinformation = receiptinformation == null ? null : receiptinformation.trim();
}
public String getCreatedate() {
return createdate;
}
public void setCreatedate(String createdate) {
this.createdate = createdate;
}
}
\ No newline at end of file
... ...