Commit 63b091da authored by zhoumaotao's avatar zhoumaotao

初始创建

parent 5a873993
Pipeline #212 failed with stages
.idea/
target/
# Compiled class file
*.class
# Log file
*.log
# Package Files #
*.war
*.nar
*.ear
*.zip
*.tar.gz
*.rar
*.iml
# virtual machine crash logs, see http://www.java.com/en/download/help/error_hotspot.xml
hs_err_pid*
<?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.gavel.manufacturing</groupId>
<artifactId>sungrowpower</artifactId>
<version>1.0.0</version>
<packaging>war</packaging>
<name>mcs</name>
<description>阳光电源车间叫料系统</description>
<parent>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-parent</artifactId>
<version>2.1.3.RELEASE</version>
<relativePath/> <!-- lookup parent from repository -->
</parent>
<properties>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding>
<java.version>1.8</java.version>
<mysql.version>8.0.24</mysql.version>
<pom.package>war</pom.package>
<pom.packageName>mcs</pom.packageName>
</properties>
<dependencies>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-web</artifactId>
<exclusions>
<exclusion>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-tomcat</artifactId>
</exclusion>
</exclusions>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-jdbc</artifactId>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-cache</artifactId>
</dependency>
<dependency>
<groupId>org.webjars</groupId>
<artifactId>webjars-locator</artifactId>
<version>0.32-1</version>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-test</artifactId>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-data-redis</artifactId>
</dependency>
<dependency>
<groupId>javax.servlet</groupId>
<artifactId>javax.servlet-api</artifactId>
</dependency>
<dependency>
<groupId>mysql</groupId>
<artifactId>mysql-connector-java</artifactId>
</dependency>
<dependency>
<groupId>com.gavel.platform</groupId>
<artifactId>gavel-persistence</artifactId>
<version>1.0.0</version>
</dependency>
<dependency>
<groupId>com.gavel.platform</groupId>
<artifactId>gavel-common</artifactId>
<version>1.0.0</version>
</dependency>
<dependency>
<groupId>com.gavel.platform</groupId>
<artifactId>gavel-kzzx</artifactId>
<version>1.0.0</version>
</dependency>
<dependency>
<groupId>com.gavel.platform</groupId>
<artifactId>gavel-framework</artifactId>
<version>1.0.0</version>
</dependency>
<dependency>
<groupId>com.gavel.platform</groupId>
<artifactId>gavel-timer</artifactId>
<version>1.0.0</version>
</dependency>
<dependency>
<groupId>com.gavel.platform</groupId>
<artifactId>gavel-monitor</artifactId>
<version>1.0.0</version>
</dependency>
<dependency>
<groupId>com.gavel.webjars</groupId>
<artifactId>gavel-webjars</artifactId>
<version>1.0.0</version>
</dependency>
<dependency>
<groupId>com.gavel.platform</groupId>
<artifactId>gavel-websocket</artifactId>
<version>1.0.0</version>
</dependency>
<dependency>
<groupId>commons-fileupload</groupId>
<artifactId>commons-fileupload</artifactId>
<version>1.3.1</version>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-websocket</artifactId>
</dependency>
<dependency>
<groupId>com.rabbitmq</groupId>
<artifactId>amqp-client</artifactId>
<version>3.4.1</version>
</dependency>
<dependency>
<groupId>com.netflix.feign</groupId>
<artifactId>feign-core</artifactId>
<version>8.18.0</version>
</dependency>
<dependency>
<groupId>com.netflix.feign</groupId>
<artifactId>feign-gson</artifactId>
<version>8.18.0</version>
</dependency>
</dependencies>
<profiles>
<profile>
<!-- 开发环境 -->
<id>jar</id>
<activation>
<activeByDefault>true</activeByDefault>
</activation>
<properties>
<pom.package>jar</pom.package>
<pom.packageName>${project.artifactId}-${project.version}</pom.packageName>
<pom.profiles.active>dev</pom.profiles.active>
</properties>
<dependencies>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-tomcat</artifactId>
</dependency>
</dependencies>
</profile>
<profile>
<id>war</id>
<properties>
<pom.package>war</pom.package>
<pom.packageName>${project.artifactId}</pom.packageName>
<pom.profiles.active>linux</pom.profiles.active>
</properties>
<dependencies>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-tomcat</artifactId>
<scope>provided</scope>
</dependency>
</dependencies>
</profile>
</profiles>
<build>
<finalName>mcs</finalName>
<resources>
<resource>
<directory>src/main/java</directory>
<includes>
<include>**/*.xml</include>
</includes>
<filtering>false</filtering>
</resource>
<resource>
<directory>src/main/resources</directory>
<includes>
<include>**/*</include>
</includes>
<filtering>false</filtering>
</resource>
</resources>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
<configuration>
<source>1.8</source>
<target>1.8</target>
<encoding>utf-8</encoding>
</configuration>
</plugin>
</plugins>
</build>
</project>
package com.gavel.agv.controller;
import com.gavel.common.BaseURL;
import com.gavel.common.base.BaseEditJSON;
import com.gavel.common.base.controller.BaseController;
import com.gavel.common.converter.DataConvert;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.ResponseBody;
import com.gavel.persistence.sql.RecordSet;
import com.gavel.common.annotation.ResourcePermissions;
import com.gavel.common.SystemOperation;
import com.alibaba.fastjson.JSONObject;
import com.gavel.common.utils.ThreadContext;
import com.gavel.agv.service.AgvService;
import com.gavel.agv.vo.AgvCondition;
import com.gavel.agv.vo.AgvVO;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
@Controller
@RequestMapping("agv/agv")
public class AgvController extends BaseController {
@Autowired
private AgvService agvService;
@ResourcePermissions()
@RequestMapping("/index")
public String index() {
return "agv/agv/index";
}
@ResourcePermissions({SystemOperation.BottonResource.ADD})
@RequestMapping("/add")
public String add() {
return "agv/agv/edit";
}
@ResourcePermissions({SystemOperation.BottonResource.EDIT})
@RequestMapping("/edit")
public String edit() {
return "agv/agv/edit";
}
@RequestMapping(value = BaseURL.GET, method = RequestMethod.POST)
@ResponseBody
public Object get(@RequestBody JSONObject param) {
AgvCondition condition = DataConvert.getCondition(param, AgvCondition.class);
RecordSet<AgvVO> records = agvService.query(condition);
if ( records.getRecords()!=null && records.getRecords().size()>=1 ){
return buildReturnData(AgvVO.class, records.getRecords().get(0));
}
return buildReturnData(AgvVO.class, null);
}
@RequestMapping(value = BaseURL.QUERY, method = RequestMethod.POST)
@ResponseBody
public Object query(@RequestBody JSONObject param) {
AgvCondition condition = DataConvert.getCondition(param, AgvCondition.class);
RecordSet<AgvVO> records = agvService.query(condition);
return buildReturnData(records, AgvVO.class);
}
@ResourcePermissions(SystemOperation.BottonResource.ADD)
@RequestMapping(value = BaseURL.ADD, method = RequestMethod.POST)
@ResponseBody
public Object insert(@RequestBody JSONObject param) {
BaseEditJSON editJson = BaseEditJSON.parseJSON(param);
agvService.insert(editJson);
return ThreadContext.getReturnData();
}
@ResourcePermissions(SystemOperation.BottonResource.EDIT)
@RequestMapping(value = BaseURL.UPDATE, method = RequestMethod.POST)
@ResponseBody
public Object update(@RequestBody JSONObject param) {
BaseEditJSON editJson = BaseEditJSON.parseJSON(param);
agvService.update(editJson);
return ThreadContext.getReturnData();
}
@ResourcePermissions(SystemOperation.BottonResource.DELETE)
@RequestMapping(value = BaseURL.DELETE, method = RequestMethod.POST)
@ResponseBody
public Object delete(@RequestBody JSONObject param) {
BaseEditJSON editJson = BaseEditJSON.parseJSON(param);
agvService.delete(editJson);
return ThreadContext.getReturnData();
}
@ResourcePermissions(SystemOperation.BottonResource.EXPORT)
@RequestMapping(value = BaseURL.EXPORT, method = RequestMethod.POST)
@ResponseBody
public void export(HttpServletRequest request,HttpServletResponse response, @RequestBody JSONObject param) throws Exception {
AgvCondition condition = DataConvert.getCondition(param, AgvCondition.class);
RecordSet<AgvVO> records = agvService.query(condition);
doExport(request, response, param, records.getRecords());
}
}
package com.gavel.agv.controller;
import com.gavel.agv.vo.AgvtaskInfo;
import com.gavel.common.BaseURL;
import com.gavel.common.base.BaseEditJSON;
import com.gavel.common.base.controller.BaseController;
import com.gavel.common.converter.DataConvert;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.ResponseBody;
import com.gavel.persistence.sql.RecordSet;
import com.gavel.common.annotation.ResourcePermissions;
import com.gavel.common.SystemOperation;
import com.alibaba.fastjson.JSONObject;
import com.gavel.common.utils.ThreadContext;
import com.gavel.agv.service.AgvtaskService;
import com.gavel.agv.vo.AgvtaskCondition;
import com.gavel.agv.vo.AgvtaskVO;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import java.util.List;
@Controller
@RequestMapping("agv/agvtask")
public class AgvtaskController extends BaseController {
@Autowired
private AgvtaskService agvtaskService;
@ResourcePermissions()
@RequestMapping("/index")
public String index() {
return "agv/agvtask/index";
}
@ResourcePermissions({SystemOperation.BottonResource.ADD})
@RequestMapping("/add")
public String add() {
return "agv/agvtask/edit";
}
@ResourcePermissions({SystemOperation.BottonResource.EDIT})
@RequestMapping("/edit")
public String edit() {
return "agv/agvtask/edit";
}
@RequestMapping(value = BaseURL.GET, method = RequestMethod.POST)
@ResponseBody
public Object get(@RequestBody JSONObject param) {
AgvtaskCondition condition = DataConvert.getCondition(param, AgvtaskCondition.class);
RecordSet<AgvtaskVO> records = agvtaskService.query(condition);
if ( records.getRecords()!=null && records.getRecords().size()>=1 ){
return buildReturnData(AgvtaskVO.class, records.getRecords().get(0));
}
return buildReturnData(AgvtaskVO.class, null);
}
@RequestMapping(value = BaseURL.QUERY, method = RequestMethod.POST)
@ResponseBody
public Object query(@RequestBody JSONObject param) {
AgvtaskCondition condition = DataConvert.getCondition(param, AgvtaskCondition.class);
RecordSet<AgvtaskVO> records = agvtaskService.query(condition);
return buildReturnData(records, AgvtaskVO.class);
}
@RequestMapping(value = "queryAgvTasks", method = RequestMethod.POST)
@ResponseBody
public Object queryTasks(@RequestBody JSONObject param) {
AgvtaskCondition condition = DataConvert.getCondition(param, AgvtaskCondition.class);
AgvtaskInfo records = agvtaskService.queryAgvTasks(condition);
return buildReturnData(AgvtaskInfo.class,records);
}
@ResourcePermissions(SystemOperation.BottonResource.ADD)
@RequestMapping(value = BaseURL.ADD, method = RequestMethod.POST)
@ResponseBody
public Object insert(@RequestBody JSONObject param) {
BaseEditJSON editJson = BaseEditJSON.parseJSON(param);
agvtaskService.insert(editJson);
return ThreadContext.getReturnData();
}
@ResourcePermissions(SystemOperation.BottonResource.EDIT)
@RequestMapping(value = BaseURL.UPDATE, method = RequestMethod.POST)
@ResponseBody
public Object update(@RequestBody JSONObject param) {
BaseEditJSON editJson = BaseEditJSON.parseJSON(param);
agvtaskService.update(editJson);
return ThreadContext.getReturnData();
}
@ResourcePermissions(SystemOperation.BottonResource.DELETE)
@RequestMapping(value = BaseURL.DELETE, method = RequestMethod.POST)
@ResponseBody
public Object delete(@RequestBody JSONObject param) {
BaseEditJSON editJson = BaseEditJSON.parseJSON(param);
agvtaskService.delete(editJson);
return ThreadContext.getReturnData();
}
@ResourcePermissions(SystemOperation.BottonResource.EXPORT)
@RequestMapping(value = BaseURL.EXPORT, method = RequestMethod.POST)
@ResponseBody
public void export(HttpServletRequest request,HttpServletResponse response, @RequestBody JSONObject param) throws Exception {
AgvtaskCondition condition = DataConvert.getCondition(param, AgvtaskCondition.class);
RecordSet<AgvtaskVO> records = agvtaskService.query(condition);
doExport(request, response, param, records.getRecords());
}
}
package com.gavel.agv.controller;
import com.gavel.common.BaseURL;
import com.gavel.common.base.BaseEditJSON;
import com.gavel.common.base.controller.BaseController;
import com.gavel.common.converter.DataConvert;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.ResponseBody;
import com.gavel.persistence.sql.RecordSet;
import com.gavel.common.annotation.ResourcePermissions;
import com.gavel.common.SystemOperation;
import com.alibaba.fastjson.JSONObject;
import com.gavel.common.utils.ThreadContext;
import com.gavel.agv.service.AgvwarnService;
import com.gavel.agv.vo.AgvwarnCondition;
import com.gavel.agv.vo.AgvwarnVO;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
@Controller
@RequestMapping("agv/agvwarn")
public class AgvwarnController extends BaseController {
@Autowired
private AgvwarnService agvwarnService;
@ResourcePermissions()
@RequestMapping("/index")
public String index() {
return "agv/agvwarn/index";
}
@ResourcePermissions({SystemOperation.BottonResource.ADD})
@RequestMapping("/add")
public String add() {
return "agv/agvwarn/edit";
}
@ResourcePermissions({SystemOperation.BottonResource.EDIT})
@RequestMapping("/edit")
public String edit() {
return "agv/agvwarn/edit";
}
@RequestMapping(value = BaseURL.GET, method = RequestMethod.POST)
@ResponseBody
public Object get(@RequestBody JSONObject param) {
AgvwarnCondition condition = DataConvert.getCondition(param, AgvwarnCondition.class);
RecordSet<AgvwarnVO> records = agvwarnService.query(condition);
if ( records.getRecords()!=null && records.getRecords().size()>=1 ){
return buildReturnData(AgvwarnVO.class, records.getRecords().get(0));
}
return buildReturnData(AgvwarnVO.class, null);
}
@RequestMapping(value = BaseURL.QUERY, method = RequestMethod.POST)
@ResponseBody
public Object query(@RequestBody JSONObject param) {
AgvwarnCondition condition = DataConvert.getCondition(param, AgvwarnCondition.class);
RecordSet<AgvwarnVO> records = agvwarnService.query(condition);
return buildReturnData(records, AgvwarnVO.class);
}
@ResourcePermissions(SystemOperation.BottonResource.ADD)
@RequestMapping(value = BaseURL.ADD, method = RequestMethod.POST)
@ResponseBody
public Object insert(@RequestBody JSONObject param) {
BaseEditJSON editJson = BaseEditJSON.parseJSON(param);
agvwarnService.insert(editJson);
return ThreadContext.getReturnData();
}
@ResourcePermissions(SystemOperation.BottonResource.EDIT)
@RequestMapping(value = BaseURL.UPDATE, method = RequestMethod.POST)
@ResponseBody
public Object update(@RequestBody JSONObject param) {
BaseEditJSON editJson = BaseEditJSON.parseJSON(param);
agvwarnService.update(editJson);
return ThreadContext.getReturnData();
}
@ResourcePermissions(SystemOperation.BottonResource.DELETE)
@RequestMapping(value = BaseURL.DELETE, method = RequestMethod.POST)
@ResponseBody
public Object delete(@RequestBody JSONObject param) {
BaseEditJSON editJson = BaseEditJSON.parseJSON(param);
agvwarnService.delete(editJson);
return ThreadContext.getReturnData();
}
@ResourcePermissions(SystemOperation.BottonResource.EXPORT)
@RequestMapping(value = BaseURL.EXPORT, method = RequestMethod.POST)
@ResponseBody
public void export(HttpServletRequest request,HttpServletResponse response, @RequestBody JSONObject param) throws Exception {
AgvwarnCondition condition = DataConvert.getCondition(param, AgvwarnCondition.class);
RecordSet<AgvwarnVO> records = agvwarnService.query(condition);
doExport(request, response, param, records.getRecords());
}
}
package com.gavel.agv.controller;
import com.gavel.agv.utils.TaskModelEnum;
import com.gavel.common.BaseURL;
import com.gavel.common.base.BaseEditJSON;
import com.gavel.common.base.controller.BaseController;
import com.gavel.common.converter.DataConvert;
import com.gavel.mcs.utils.EpTaskEnum;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.ResponseBody;
import com.gavel.persistence.sql.RecordSet;
import com.gavel.common.annotation.ResourcePermissions;
import com.gavel.common.SystemOperation;
import com.alibaba.fastjson.JSONObject;
import com.gavel.common.utils.ThreadContext;
import com.gavel.agv.service.EptaskService;
import com.gavel.agv.vo.EptaskCondition;
import com.gavel.agv.vo.EptaskVO;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
@Controller
@RequestMapping("agv/eptask")
public class EptaskController extends BaseController {
@Autowired
private EptaskService eptaskService;
@ResourcePermissions()
@RequestMapping("/index")
public String index() {
return "agv/eptask/index";
}
@ResourcePermissions({SystemOperation.BottonResource.ADD})
@RequestMapping("/add")
public String add() {
return "agv/eptask/edit";
}
@ResourcePermissions({SystemOperation.BottonResource.EDIT})
@RequestMapping("/edit")
public String edit() {
return "agv/eptask/edit";
}
@RequestMapping(value = BaseURL.GET, method = RequestMethod.POST)
@ResponseBody
public Object get(@RequestBody JSONObject param) {
EptaskCondition condition = DataConvert.getCondition(param, EptaskCondition.class);
RecordSet<EptaskVO> records = eptaskService.query(condition);
if ( records.getRecords()!=null && records.getRecords().size()>=1 ){
return buildReturnData(EptaskVO.class, records.getRecords().get(0));
}
return buildReturnData(EptaskVO.class, null);
}
@RequestMapping(value = BaseURL.QUERY, method = RequestMethod.POST)
@ResponseBody
public Object query(@RequestBody JSONObject param) {
EptaskCondition condition = DataConvert.getCondition(param, EptaskCondition.class);
RecordSet<EptaskVO> records = eptaskService.query(condition);
return buildReturnData(records, EptaskVO.class);
}
@ResourcePermissions(SystemOperation.BottonResource.ADD)
@RequestMapping(value = BaseURL.ADD, method = RequestMethod.POST)
@ResponseBody
public Object insert(@RequestBody JSONObject param) {
BaseEditJSON editJson = BaseEditJSON.parseJSON(param);
eptaskService.insert(editJson);
return ThreadContext.getReturnData();
}
@ResourcePermissions(SystemOperation.BottonResource.EDIT)
@RequestMapping(value = BaseURL.UPDATE, method = RequestMethod.POST)
@ResponseBody
public Object update(@RequestBody JSONObject param) {
BaseEditJSON editJson = BaseEditJSON.parseJSON(param);
eptaskService.update(editJson);
return ThreadContext.getReturnData();
}
@ResourcePermissions(SystemOperation.BottonResource.DELETE)
@RequestMapping(value = BaseURL.DELETE, method = RequestMethod.POST)
@ResponseBody
public Object delete(@RequestBody JSONObject param) {
BaseEditJSON editJson = BaseEditJSON.parseJSON(param);
eptaskService.delete(editJson);
return ThreadContext.getReturnData();
}
@ResourcePermissions(SystemOperation.BottonResource.EXPORT)
@RequestMapping(value = BaseURL.EXPORT, method = RequestMethod.POST)
@ResponseBody
public void export(HttpServletRequest request,HttpServletResponse response, @RequestBody JSONObject param) throws Exception {
EptaskCondition condition = DataConvert.getCondition(param, EptaskCondition.class);
RecordSet<EptaskVO> records = eptaskService.query(condition);
doExport(request, response, param, records.getRecords());
}
@RequestMapping(value = "/init/type", method = RequestMethod.POST)
@ResponseBody
public Object initType() {
return buildReturnData(EpTaskEnum.toList2());
}
@RequestMapping(value = "/init/taskType", method = RequestMethod.POST)
@ResponseBody
public Object initTaskType() {
return buildReturnData(TaskModelEnum.toList());
}
}
package com.gavel.agv.dao;
import com.gavel.common.base.dao.BaseDao;
import com.gavel.persistence.sql.RecordSet;
import com.gavel.agv.vo.AgvCondition;
import com.gavel.agv.vo.AgvVO;
public interface AgvDao extends BaseDao {
public RecordSet<AgvVO> query(AgvCondition condition);
}
package com.gavel.agv.dao;
import com.gavel.agv.persistent.Agvtask;
import com.gavel.common.base.dao.BaseDao;
import com.gavel.persistence.sql.RecordSet;
import com.gavel.agv.vo.AgvtaskCondition;
import com.gavel.agv.vo.AgvtaskVO;
import java.util.List;
public interface AgvtaskDao extends BaseDao {
public RecordSet<AgvtaskVO> query(AgvtaskCondition condition);
public AgvtaskVO working(AgvtaskCondition condition);
public Agvtask loadTask(String taskCode);
public AgvtaskVO queryByWbcode(String usercallcode);
public List<AgvtaskVO> queryAgvTasks(AgvtaskCondition condition);
}
package com.gavel.agv.dao;
import com.gavel.common.base.dao.BaseDao;
import com.gavel.persistence.sql.RecordSet;
import com.gavel.agv.vo.AgvwarnCondition;
import com.gavel.agv.vo.AgvwarnVO;
public interface AgvwarnDao extends BaseDao {
public RecordSet<AgvwarnVO> query(AgvwarnCondition condition);
}
package com.gavel.agv.dao;
import com.gavel.agv.persistent.Eptask;
import com.gavel.common.base.dao.BaseDao;
import com.gavel.persistence.sql.RecordSet;
import com.gavel.agv.vo.EptaskCondition;
import com.gavel.agv.vo.EptaskVO;
public interface EptaskDao extends BaseDao {
public RecordSet<EptaskVO> query(EptaskCondition condition);
public Eptask findExecutingTask(String wbCode, String type);
}
package com.gavel.agv.dao.impl;
import com.gavel.common.base.dao.impl.BaseDaoImpl;
import com.gavel.common.utils.StringUtils;
import com.gavel.persistence.sql.RecordSet;
import com.gavel.persistence.sql.SqlMap;
import com.gavel.persistence.sql.SqlUtil;
import org.springframework.stereotype.Repository;
import com.gavel.agv.dao.AgvDao;
import com.gavel.agv.vo.AgvCondition;
import com.gavel.agv.vo.AgvVO;
@Repository("agvDao")
public class AgvDaoImpl extends BaseDaoImpl implements AgvDao {
public RecordSet<AgvVO> query(AgvCondition condition) {
SqlMap sqlMap = new SqlMap();
sqlMap.setPageNo(condition.getPageNo());
sqlMap.setRowCount(condition.getPageSize());
sqlMap.append("select AGV_ID, AGV_ROBOTCODE, AGV_ROBOTDIR, AGV_ROBOTIP, AGV_BATTERY, ");
sqlMap.append(" AGV_POSX, AGV_POSY, AGV_MAPCODE, AGV_SPEED, AGV_STATUS, ");
sqlMap.append(" AGV_EXCLTYPE, AGV_STOP, AGV_PODCODE, AGV_PODDIR, AGV_PATH, ");
sqlMap.append(" AGV_WARNCONTENT, AGVSTATUS_CODE, AGVSTATUS_CHINESE, AGVSTATUS_ENGLISH ");
sqlMap.append("from AGV ");
sqlMap.append(" left join AGVSTATUS on AGVSTATUS_CODE = AGV_STATUS ");
sqlMap.append("where 1 = 1 ");
if (StringUtils.isNotEmpty(condition.getId())) {
sqlMap.append(" and " + SqlUtil.getWhereSql("AGV_ID", condition.getId()));
sqlMap.setParamValue("AGV_ID", condition.getId());
}
if (StringUtils.isNotEmpty(condition.getRobotcode())) {
sqlMap.append(" and " + SqlUtil.getWhereSql("AGV_ROBOTCODE", condition.getRobotcode()));
sqlMap.setParamValue("AGV_ROBOTCODE", condition.getRobotcode());
}
sqlMap.query(AgvVO.class);
return sqlMap.getRecordSet();
}
}
This diff is collapsed.
package com.gavel.agv.dao.impl;
import com.gavel.common.base.dao.impl.BaseDaoImpl;
import com.gavel.common.utils.StringUtils;
import com.gavel.persistence.sql.RecordSet;
import com.gavel.persistence.sql.SqlMap;
import com.gavel.persistence.sql.SqlUtil;
import org.springframework.stereotype.Repository;
import com.gavel.agv.dao.AgvwarnDao;
import com.gavel.agv.vo.AgvwarnCondition;
import com.gavel.agv.vo.AgvwarnVO;
@Repository("agvwarnDao")
public class AgvwarnDaoImpl extends BaseDaoImpl implements AgvwarnDao {
public RecordSet<AgvwarnVO> query(AgvwarnCondition condition){
SqlMap sqlMap = new SqlMap();
sqlMap.setPageNo(condition.getPageNo());
sqlMap.setRowCount(condition.getPageSize());
sqlMap.append("select AGVWARN_ID, AGVWARN_REQCODE, AGVWARN_REQTIME, AGVWARN_CLIENTCODE, AGVWARN_TOKENCODE, ");
sqlMap.append(" AGVWARN_ROBOTCODE, AGVWARN_BEGINTIME, AGVWARN_WARNCONTENT, AGVWARN_TASKCODE ");
sqlMap.append("from AGVWARN ");
sqlMap.append("where 1 = 1 ");
if (StringUtils.isNotEmpty(condition.getId())){
sqlMap.append(" and " + SqlUtil.getWhereSql("AGVWARN_ID", condition.getId()));
sqlMap.setParamValue("AGVWARN_ID", condition.getId());
}
if (StringUtils.isNotEmpty(condition.getTaskcode())) {
sqlMap.append(" and " + SqlUtil.getWhereSql("AGVWARN_TASKCODE", condition.getTaskcode()));
sqlMap.setParamValue("AGVWARN_TASKCODE", condition.getTaskcode());
}
if (StringUtils.isNotEmpty(condition.getRobotcode())) {
sqlMap.append(" and " + SqlUtil.getWhereSql("AGVWARN_ROBOTCODE", condition.getRobotcode()));
sqlMap.setParamValue("AGVWARN_ROBOTCODE", condition.getRobotcode());
}
sqlMap.query(AgvwarnVO.class);
return sqlMap.getRecordSet();
}
}
package com.gavel.agv.dao.impl;
import com.gavel.agv.persistent.Eptask;
import com.gavel.common.base.dao.impl.BaseDaoImpl;
import com.gavel.common.utils.StringUtils;
import com.gavel.persistence.sql.RecordSet;
import com.gavel.persistence.sql.SqlMap;
import com.gavel.persistence.sql.SqlUtil;
import org.springframework.stereotype.Repository;
import com.gavel.agv.dao.EptaskDao;
import com.gavel.agv.vo.EptaskCondition;
import com.gavel.agv.vo.EptaskVO;
@Repository("eptaskDao")
public class EptaskDaoImpl extends BaseDaoImpl implements EptaskDao {
public RecordSet<EptaskVO> query(EptaskCondition condition) {
SqlMap sqlMap = new SqlMap();
sqlMap.setPageNo(condition.getPageNo());
sqlMap.setRowCount(condition.getPageSize());
sqlMap.append("select EPTASK_ID, EPTASK_TASKCODE, EPTASK_TASKTYP, EPTASK_SCENETYP, EPTASK_WBCODE, ");
sqlMap.append(" EPTASK_PODCODE, EPTASK_SRCMAPDATA, EPTASK_MATERIAL, EPTASK_PRIORITY, EPTASK_AGVCODE, ");
sqlMap.append(" EPTASK_CREATE_DATE, EPTASK_TASKSTATUS, EPTASK_CXID, EPTASK_CALLERID, EPTASK_CALLDATE, ");
sqlMap.append(" EPTASK_SENDERID, EPTASK_SENDDATE, EPTASK_START_DATE, EPTASK_GETTO_DATE, EPTASK_END_DATE, ");
sqlMap.append(" EPTASK_CANCEL_DATE, EPTASK_DATA, TASKSTATUS_DESCZH, EPTASK_CKID, EPTASK_TYPE,EPTASK_BZ, ");
sqlMap.append(" CK_CODE, CK_NAME,GW_NAME,POD_BERTHCODE, EPTASK_ORDERNUM,EPTASK_WAYS,EPTASK_DESTMAPDATA,");
sqlMap.append(" caller.USERS_USERNAME as CALLERNAME, sender.USERS_USERNAME as SENDERNAME ");
sqlMap.append("from EPTASK ");
sqlMap.append(" left join USERS caller on caller.USERS_ID = EPTASK_CALLERID ");
sqlMap.append(" left join USERS sender on sender.USERS_ID = EPTASK_SENDERID ");
sqlMap.append(" left join TASKSTATUS on TASKSTATUS_CODE = EPTASK_TASKSTATUS ");
sqlMap.append(" left join CK on CK_CODE = EPTASK_CKID ");
sqlMap.append(" left join GW on GW_MAPDATACODE = EPTASK_WBCODE ");
sqlMap.append(" left join POD on POD_PODCODE = EPTASK_PODCODE ");
sqlMap.append("where 1 = 1 ");
if (StringUtils.isNotEmpty(condition.getId())) {
sqlMap.append(" and " + SqlUtil.getWhereSql("EPTASK_ID", condition.getId()));
sqlMap.setParamValue("EPTASK_ID", condition.getId());
}
if (StringUtils.isNotEmpty(condition.getTaskCode())) {
sqlMap.append(" and " + SqlUtil.getWhereSql("EPTASK_TASKCODE", condition.getTaskCode()));
sqlMap.setParamValue("EPTASK_TASKCODE", condition.getTaskCode());
}
if (StringUtils.isNotEmpty(condition.getWbCode())) {
sqlMap.append(" and " + SqlUtil.getWhereSql("EPTASK_WBCODE", condition.getWbCode()));
sqlMap.setParamValue("EPTASK_WBCODE", condition.getWbCode());
}
if (StringUtils.isNotEmpty(condition.getTaskStatus())) {
sqlMap.append(" and " + SqlUtil.getWhereSql("EPTASK_TASKSTATUS", condition.getTaskStatus()));
sqlMap.setParamValue("EPTASK_TASKSTATUS", condition.getTaskStatus());
}
if (StringUtils.isNotEmpty(condition.getType())) {
sqlMap.append(" and " + SqlUtil.getWhereSql("EPTASK_TYPE", condition.getType()));
sqlMap.setParamValue("EPTASK_TYPE", condition.getType());
}
if(condition.getTaskStatusList() !=null && condition.getTaskStatusList().length>0){
sqlMap.append(" and " + SqlUtil.getWhereEqualSql("EPTASK_TASKSTATUS", condition.getTaskStatusList()));
}
sqlMap.append(" order by EPTASK_CREATE_DATE desc");
sqlMap.query(EptaskVO.class);
return sqlMap.getRecordSet();
}
@Override
public Eptask findExecutingTask(String wbCode, String type) {
SqlMap sqlMap = new SqlMap();
sqlMap.append("select EPTASK_ID, EPTASK_TASKCODE, EPTASK_TASKTYP, EPTASK_SCENETYP, EPTASK_WBCODE, ");
sqlMap.append(" EPTASK_PODCODE, EPTASK_SRCMAPDATA, EPTASK_MATERIAL, EPTASK_PRIORITY, EPTASK_AGVCODE, ");
sqlMap.append(" EPTASK_CREATE_DATE, EPTASK_TASKSTATUS, EPTASK_CXID, EPTASK_CALLERID, EPTASK_CALLDATE, ");
sqlMap.append(" EPTASK_SENDERID, EPTASK_SENDDATE, EPTASK_START_DATE, EPTASK_GETTO_DATE, EPTASK_END_DATE, ");
sqlMap.append(" EPTASK_CANCEL_DATE, EPTASK_DATA, EPTASK_CKID, EPTASK_TYPE, EPTASK_ORDERNUM,EPTASK_WAYS ");
sqlMap.append("from EPTASK ");
sqlMap.append("where EPTASK_TASKSTATUS not in ('5', '9') and EPTASK_TYPE = :EPTASK_TYPE and EPTASK_WBCODE = :EPTASK_WBCODE ");
sqlMap.setParamValue("EPTASK_TYPE", type);
sqlMap.setParamValue("EPTASK_WBCODE", wbCode);
return sqlMap.queryEntity(Eptask.class);
}
}
package com.gavel.agv.persistent;
import com.gavel.common.base.entity.BaseEntity;
import com.gavel.common.utils.CodeStrategy;
import com.gavel.persistence.annotation.FieldMeta;
import com.gavel.persistence.annotation.TableMeta;
@TableMeta(id = "AGV", name = "AGV")
public class Agv extends BaseEntity {
private static final long serialVersionUID = 1L;
@FieldMeta(fieldName = "AGV_ID", caption = "ID", primaryKey = true, notEmpty = true, codeStrategy = CodeStrategy.UUID)
private String id;
@FieldMeta(fieldName = "AGV_ROBOTCODE", caption = "机器人编号")
private String robotcode;
@FieldMeta(fieldName = "AGV_ROBOTDIR", caption = "机器人方向")
private String robotdir;
@FieldMeta(fieldName = "AGV_ROBOTIP", caption = "机器人 IP")
private String robotip;
@FieldMeta(fieldName = "AGV_BATTERY", caption = "机器人电量, 范围: 0-100")
private String battery;
@FieldMeta(fieldName = "AGV_POSX", caption = "机器人 x 坐标,单位:毫米")
private String posx;
@FieldMeta(fieldName = "AGV_POSY", caption = "机器人 y 坐标,单位:毫米")
private String posy;
@FieldMeta(fieldName = "AGV_MAPCODE", caption = "机器人所在地图")
private String mapcode;
@FieldMeta(fieldName = "AGV_SPEED", caption = "机器人当前速度")
private String speed;
@FieldMeta(fieldName = "AGV_STATUS", caption = "机器人状态")
private String status;
@FieldMeta(fieldName = "AGV_EXCLTYPE", caption = "是否已被排除")
private String excltype;
@FieldMeta(fieldName = "AGV_STOP", caption = "是否暂停 0-否 1-是")
private String stop;
@FieldMeta(fieldName = "AGV_PODCODE", caption = "背货架的编号")
private String podcode;
@FieldMeta(fieldName = "AGV_PODDIR", caption = "背货架的方向")
private String poddir;
@FieldMeta(fieldName = "AGV_PATH", caption = "执行路径")
private String path;
@FieldMeta(fieldName = "AGV_WARNCONTENT", caption = "告警信息")
private String warncontent;
public String getId() {
return id;
}
public void setId(String id) {
this.id = id;
}
public String getRobotcode() {
return robotcode;
}
public void setRobotcode(String robotcode) {
this.robotcode = robotcode;
}
public String getRobotdir() {
return robotdir;
}
public void setRobotdir(String robotdir) {
this.robotdir = robotdir;
}
public String getRobotip() {
return robotip;
}
public void setRobotip(String robotip) {
this.robotip = robotip;
}
public String getBattery() {
return battery;
}
public void setBattery(String battery) {
this.battery = battery;
}
public String getPosx() {
return posx;
}
public void setPosx(String posx) {
this.posx = posx;
}
public String getPosy() {
return posy;
}
public void setPosy(String posy) {
this.posy = posy;
}
public String getMapcode() {
return mapcode;
}
public void setMapcode(String mapcode) {
this.mapcode = mapcode;
}
public String getSpeed() {
return speed;
}
public void setSpeed(String speed) {
this.speed = speed;
}
public String getStatus() {
return status;
}
public void setStatus(String status) {
this.status = status;
}
public String getExcltype() {
return excltype;
}
public void setExcltype(String excltype) {
this.excltype = excltype;
}
public String getStop() {
return stop;
}
public void setStop(String stop) {
this.stop = stop;
}
public String getPodcode() {
return podcode;
}
public void setPodcode(String podcode) {
this.podcode = podcode;
}
public String getPoddir() {
return poddir;
}
public void setPoddir(String poddir) {
this.poddir = poddir;
}
public String getPath() {
return path;
}
public void setPath(String path) {
this.path = path;
}
public String getWarncontent() {
return warncontent;
}
public void setWarncontent(String warncontent) {
this.warncontent = warncontent;
}
}
package com.gavel.agv.persistent;
import com.gavel.common.base.entity.BaseEntity;
import com.gavel.common.utils.CodeStrategy;
import com.gavel.persistence.annotation.FieldMeta;
import com.gavel.persistence.annotation.TableMeta;
import java.util.Date;
@TableMeta(id = "AGVTASK", name = "AGVTASK")
public class Agvtask extends BaseEntity {
private static final long serialVersionUID = 1L;
@FieldMeta(fieldName = "AGVTASK_ID", caption = "ID", primaryKey = true, notEmpty = true, codeStrategy = CodeStrategy.UUID)
private String id;
@FieldMeta(fieldName = "AGVTASK_TASKTYP", caption = "任务类型")
private String tasktyp;
@FieldMeta(fieldName = "AGVTASK_SCENETYP", caption = "任务场景类型")
private String scenetyp;
@FieldMeta(fieldName = "AGVTASK_CTNRTYP", caption = "容器类型(叉车专用)")
private String ctnrtyp;
@FieldMeta(fieldName = "AGVTASK_CTNRCODE", caption = "容器编号(叉车专用)")
private String ctnrcode;
@FieldMeta(fieldName = "AGVTASK_WBCODE", caption = "工作位,一般为机台或工作台位置")
private String wbcode;
@FieldMeta(fieldName = "AGVTASK_POSITIONCODEPATH", caption = "列表长度 小于 50")
private String positionCodePath;
@FieldMeta(fieldName = "AGVTASK_PODCODE", caption = "货架编号,不指定货架可以为空")
private String podcode;
@FieldMeta(fieldName = "AGVTASK_PODDIR", caption = "指定方向")
private String poddir;
@FieldMeta(fieldName = "AGVTASK_PODTYP", caption = "货架类型")
private String podtyp;
@FieldMeta(fieldName = "AGVTASK_MATERIALLOT", caption = "物料批次或货架上的物料唯一编码")
private String materiallot;
@FieldMeta(fieldName = "AGVTASK_PRIORITY", caption = "优先级,从(1~127)级,最大优先级最高")
private String priority;
@FieldMeta(fieldName = "AGVTASK_TASKCODE", caption = "任务单号")
private String taskCode;
@FieldMeta(fieldName = "AGVTASK_AGVCODE", caption = "AGV 编号")
private String agvCode;
@FieldMeta(fieldName = "AGVTASK_CREATE_DATE", caption = "创建时间")
private Date createDate;
@FieldMeta(fieldName = "AGVTASK_TASKSTATUS", caption = "任务状态:1-已创建,2-正在执行,5-取消完成,9-已结束")
private String taskStatus;
@FieldMeta(fieldName = "AGVTASK_CJID", caption = "车间ID")
private String cjid;
@FieldMeta(fieldName = "AGVTASK_CXID", caption = "产线ID")
private String cxid;
@FieldMeta(fieldName = "AGVTASK_ZDID", caption = "站点ID")
private String zdid;
@FieldMeta(fieldName = "AGVTASK_GWID", caption = "工位ID")
private String gwid;
@FieldMeta(fieldName = "AGVTASK_CALLERID", caption = "叫料人ID")
private String callerId;
@FieldMeta(fieldName = "AGVTASK_CALLDATE", caption = "叫料时间")
private Date callDate;
@FieldMeta(fieldName = "AGVTASK_SENDERID", caption = "发料人ID")
private String senderId;
@FieldMeta(fieldName = "AGVTASK_SENDDATE", caption = "发料时间")
private Date sendDate;
@FieldMeta(fieldName = "AGVTASK_START_POINT", caption = "起点")
private String startPoint;
@FieldMeta(fieldName = "AGVTASK_END_POINT", caption = "终点")
private String endPoint;
@FieldMeta(fieldName = "AGVTASK_GETTO_DATE", caption = "到达工位时间")
private Date gettoDate;
@FieldMeta(fieldName = "AGVTASK_END_DATE", caption = "任务结束时间")
private Date endDate;
@FieldMeta(fieldName = "AGVTASK_START_DATE", caption = "任务开始时间")
private Date startDate;
@FieldMeta(fieldName = "AGVTASK_CANCEL_DATE", caption = "任务取消时间")
private Date cancelDate;
@FieldMeta(fieldName = "AGVTASK_DATA", caption = "自定义字段,不超过 2000 个字符")
private String data;
@FieldMeta(fieldName = "AGVTASK_WAYS", caption = "来源方式")
private String ways;
public String getId() {
return id;
}
public void setId(String id) {
this.id = id;
}
public String getTasktyp() {
return tasktyp;
}
public void setTasktyp(String tasktyp) {
this.tasktyp = tasktyp;
}
public String getScenetyp() {
return scenetyp;
}
public void setScenetyp(String scenetyp) {
this.scenetyp = scenetyp;
}
public String getCtnrtyp() {
return ctnrtyp;
}
public void setCtnrtyp(String ctnrtyp) {
this.ctnrtyp = ctnrtyp;
}
public String getCtnrcode() {
return ctnrcode;
}
public void setCtnrcode(String ctnrcode) {
this.ctnrcode = ctnrcode;
}
public String getWbcode() {
return wbcode;
}
public void setWbcode(String wbcode) {
this.wbcode = wbcode;
}
public String getPositionCodePath() {
return positionCodePath;
}
public void setPositionCodePath(String positionCodePath) {
this.positionCodePath = positionCodePath;
}
public String getPodcode() {
return podcode;
}
public void setPodcode(String podcode) {
this.podcode = podcode;
}
public String getPoddir() {
return poddir;
}
public void setPoddir(String poddir) {
this.poddir = poddir;
}
public String getPodtyp() {
return podtyp;
}
public void setPodtyp(String podtyp) {
this.podtyp = podtyp;
}
public String getMateriallot() {
return materiallot;
}
public void setMateriallot(String materiallot) {
this.materiallot = materiallot;
}
public String getPriority() {
return priority;
}
public void setPriority(String priority) {
this.priority = priority;
}
public String getTaskCode() {
return taskCode;
}
public void setTaskCode(String taskCode) {
this.taskCode = taskCode;
}
public String getAgvCode() {
return agvCode;
}
public void setAgvCode(String agvCode) {
this.agvCode = agvCode;
}
public Date getCreateDate() {
return createDate;
}
public void setCreateDate(Date createDate) {
this.createDate = createDate;
}
public String getTaskStatus() {
return taskStatus;
}
public void setTaskStatus(String taskStatus) {
this.taskStatus = taskStatus;
}
public String getCjid() {
return cjid;
}
public void setCjid(String cjid) {
this.cjid = cjid;
}
public String getCxid() {
return cxid;
}
public void setCxid(String cxid) {
this.cxid = cxid;
}
public String getZdid() {
return zdid;
}
public void setZdid(String zdid) {
this.zdid = zdid;
}
public String getCallerId() {
return callerId;
}
public void setCallerId(String callerId) {
this.callerId = callerId;
}
public Date getCallDate() {
return callDate;
}
public void setCallDate(Date callDate) {
this.callDate = callDate;
}
public String getSenderId() {
return senderId;
}
public void setSenderId(String senderId) {
this.senderId = senderId;
}
public Date getSendDate() {
return sendDate;
}
public void setSendDate(Date sendDate) {
this.sendDate = sendDate;
}
public String getStartPoint() {
return startPoint;
}
public void setStartPoint(String startPoint) {
this.startPoint = startPoint;
}
public String getEndPoint() {
return endPoint;
}
public void setEndPoint(String endPoint) {
this.endPoint = endPoint;
}
public Date getGettoDate() {
return gettoDate;
}
public void setGettoDate(Date gettoDate) {
this.gettoDate = gettoDate;
}
public Date getEndDate() {
return endDate;
}
public void setEndDate(Date endDate) {
this.endDate = endDate;
}
public Date getStartDate() {
return startDate;
}
public void setStartDate(Date startDate) {
this.startDate = startDate;
}
public Date getCancelDate() {
return cancelDate;
}
public void setCancelDate(Date cancelDate) {
this.cancelDate = cancelDate;
}
public String getData() {
return data;
}
public void setData(String data) {
this.data = data;
}
public String getGwid() {
return gwid;
}
public void setGwid(String gwid) {
this.gwid = gwid;
}
public String getWays() {
return ways;
}
public void setWays(String ways) {
this.ways = ways;
}
}
package com.gavel.agv.persistent;
import com.gavel.common.base.entity.BaseEntity;
import com.gavel.common.utils.CodeStrategy;
import com.gavel.persistence.annotation.FieldMeta;
import com.gavel.persistence.annotation.TableMeta;
@TableMeta(id = "AGVWARN", name = "AGVWARN")
public class Agvwarn extends BaseEntity {
private static final long serialVersionUID = 1L;
@FieldMeta(fieldName = "AGVWARN_ID", caption = "ID", primaryKey = true, notEmpty = true, codeStrategy = CodeStrategy.UUID)
private String id;
@FieldMeta(fieldName = "AGVWARN_REQCODE", caption = "请求编号")
private String reqcode;
@FieldMeta(fieldName = "AGVWARN_REQTIME", caption = "请求时间戳")
private String reqtime;
@FieldMeta(fieldName = "AGVWARN_CLIENTCODE", caption = "客户端编号")
private String clientcode;
@FieldMeta(fieldName = "AGVWARN_TOKENCODE", caption = "令牌号")
private String tokencode;
@FieldMeta(fieldName = "AGVWARN_ROBOTCODE", caption = "车号")
private String robotcode;
@FieldMeta(fieldName = "AGVWARN_BEGINTIME", caption = "告警开始时间")
private String begintime;
@FieldMeta(fieldName = "AGVWARN_WARNCONTENT", caption = "告警内容")
private String warncontent;
@FieldMeta(fieldName = "AGVWARN_TASKCODE", caption = "任务号")
private String taskcode;
public String getId() {
return id;
}
public void setId(String id) {
this.id = id;
}
public String getReqcode() {
return reqcode;
}
public void setReqcode(String reqcode) {
this.reqcode = reqcode;
}
public String getReqtime() {
return reqtime;
}
public void setReqtime(String reqtime) {
this.reqtime = reqtime;
}
public String getClientcode() {
return clientcode;
}
public void setClientcode(String clientcode) {
this.clientcode = clientcode;
}
public String getTokencode() {
return tokencode;
}
public void setTokencode(String tokencode) {
this.tokencode = tokencode;
}
public String getRobotcode() {
return robotcode;
}
public void setRobotcode(String robotcode) {
this.robotcode = robotcode;
}
public String getBegintime() {
return begintime;
}
public void setBegintime(String begintime) {
this.begintime = begintime;
}
public String getWarncontent() {
return warncontent;
}
public void setWarncontent(String warncontent) {
this.warncontent = warncontent;
}
public String getTaskcode() {
return taskcode;
}
public void setTaskcode(String taskcode) {
this.taskcode = taskcode;
}
}
package com.gavel.agv.persistent;
import java.util.Date;
import com.gavel.common.base.entity.BaseEntity;
import com.gavel.common.utils.CodeStrategy;
import com.gavel.persistence.annotation.FieldMeta;
import com.gavel.persistence.annotation.TableMeta;
@TableMeta(id = "EPTASK", name = "EPTASK")
public class Eptask extends BaseEntity {
private static final long serialVersionUID = 1L;
@FieldMeta(fieldName = "EPTASK_ID", caption = "ID", primaryKey = true, notEmpty = true, codeStrategy = CodeStrategy.UUID)
private String id;
@FieldMeta(fieldName = "EPTASK_TASKCODE", caption = "任务单号")
private String taskCode;
@FieldMeta(fieldName = "EPTASK_TASKTYP", caption = "任务类型")
private String taskTyp;
@FieldMeta(fieldName = "EPTASK_SCENETYP", caption = "任务场景类型")
private String sceneTyp;
@FieldMeta(fieldName = "EPTASK_WBCODE", caption = "工作位,一般为机台或工作台位置")
private String wbCode;
@FieldMeta(fieldName = "EPTASK_PODCODE", caption = "货架编号")
private String podCode;
@FieldMeta(fieldName = "EPTASK_SRCMAPDATA", caption = "货架来源地码")
private String srcMapdata;
@FieldMeta(fieldName = "EPTASK_DESTMAPDATA", caption = "货架目标地码")
private String destMapdata;
@FieldMeta(fieldName = "EPTASK_MATERIAL", caption = "物料")
private String material;
@FieldMeta(fieldName = "EPTASK_PRIORITY", caption = "优先级,从(1~127)级,最大优先级最高")
private String priority;
@FieldMeta(fieldName = "EPTASK_AGVCODE", caption = "AGV编号")
private String agvCode;
@FieldMeta(fieldName = "EPTASK_CREATE_DATE", caption = "创建时间")
private Date createDate;
@FieldMeta(fieldName = "EPTASK_TASKSTATUS", caption = "任务状态:1-已创建,2-正在执行,5-取消完成,9-已结束")
private String taskStatus;
@FieldMeta(fieldName = "EPTASK_CXID", caption = "产线ID")
private String cxId;
@FieldMeta(fieldName = "EPTASK_CALLERID", caption = "叫料人ID")
private String callerId;
@FieldMeta(fieldName = "EPTASK_CALLDATE", caption = "叫料时间")
private Date callDate;
@FieldMeta(fieldName = "EPTASK_SENDERID", caption = "发料人ID")
private String senderId;
@FieldMeta(fieldName = "EPTASK_SENDDATE", caption = "发料时间")
private Date sendDate;
@FieldMeta(fieldName = "EPTASK_START_DATE", caption = "任务开始时间")
private Date startDate;
@FieldMeta(fieldName = "EPTASK_GETTO_DATE", caption = "到达工位时间")
private Date gettoDate;
@FieldMeta(fieldName = "EPTASK_END_DATE", caption = "任务结束时间")
private Date endDate;
@FieldMeta(fieldName = "EPTASK_CANCEL_DATE", caption = "任务取消时间")
private Date cancelDate;
@FieldMeta(fieldName = "EPTASK_DATA", caption = "自定义字段,不超过 2000 个字符")
private String data;
@FieldMeta(fieldName = "EPTASK_CKID", caption = "目标区域")
private String ckId;
@FieldMeta(fieldName = "EPTASK_TYPE", caption = "任务分类")
private String type;
@FieldMeta(fieldName = "EPTASK_ORDERNUM", caption = "预订数量")
private Integer orderNum;
@FieldMeta(fieldName = "EPTASK_WAYS", caption = "来源方式")
private String ways;
@FieldMeta(fieldName = "EPTASK_BZ", caption = "备注")
private String bz;
public String getId() {
return id;
}
public void setId(String id) {
this.id = id;
}
public String getTaskCode() {
return taskCode;
}
public void setTaskCode(String taskCode) {
this.taskCode = taskCode;
}
public String getTaskTyp() {
return taskTyp;
}
public void setTaskTyp(String taskTyp) {
this.taskTyp = taskTyp;
}
public String getSceneTyp() {
return sceneTyp;
}
public void setSceneTyp(String sceneTyp) {
this.sceneTyp = sceneTyp;
}
public String getWbCode() {
return wbCode;
}
public void setWbCode(String wbCode) {
this.wbCode = wbCode;
}
public String getPodCode() {
return podCode;
}
public void setPodCode(String podCode) {
this.podCode = podCode;
}
public String getSrcMapdata() {
return srcMapdata;
}
public void setSrcMapdata(String srcMapdata) {
this.srcMapdata = srcMapdata;
}
public String getDestMapdata() {
return destMapdata;
}
public void setDestMapdata(String destMapdata) {
this.destMapdata = destMapdata;
}
public String getMaterial() {
return material;
}
public void setMaterial(String material) {
this.material = material;
}
public String getPriority() {
return priority;
}
public void setPriority(String priority) {
this.priority = priority;
}
public String getAgvCode() {
return agvCode;
}
public void setAgvCode(String agvCode) {
this.agvCode = agvCode;
}
public Date getCreateDate() {
return createDate;
}
public void setCreateDate(Date createDate) {
this.createDate = createDate;
}
public String getTaskStatus() {
return taskStatus;
}
public void setTaskStatus(String taskStatus) {
this.taskStatus = taskStatus;
}
public String getCxId() {
return cxId;
}
public void setCxId(String cxId) {
this.cxId = cxId;
}
public String getCallerId() {
return callerId;
}
public void setCallerId(String callerId) {
this.callerId = callerId;
}
public Date getCallDate() {
return callDate;
}
public void setCallDate(Date callDate) {
this.callDate = callDate;
}
public String getSenderId() {
return senderId;
}
public void setSenderId(String senderId) {
this.senderId = senderId;
}
public Date getSendDate() {
return sendDate;
}
public void setSendDate(Date sendDate) {
this.sendDate = sendDate;
}
public Date getStartDate() {
return startDate;
}
public void setStartDate(Date startDate) {
this.startDate = startDate;
}
public Date getGettoDate() {
return gettoDate;
}
public void setGettoDate(Date gettoDate) {
this.gettoDate = gettoDate;
}
public Date getEndDate() {
return endDate;
}
public void setEndDate(Date endDate) {
this.endDate = endDate;
}
public Date getCancelDate() {
return cancelDate;
}
public void setCancelDate(Date cancelDate) {
this.cancelDate = cancelDate;
}
public String getData() {
return data;
}
public void setData(String data) {
this.data = data;
}
public String getCkId() {
return ckId;
}
public void setCkId(String ckId) {
this.ckId = ckId;
}
public String getType() {
return type;
}
public void setType(String type) {
this.type = type;
}
public Integer getOrderNum() {
return orderNum;
}
public void setOrderNum(Integer orderNum) {
this.orderNum = orderNum;
}
public String getWays() {
return ways;
}
public void setWays(String ways) {
this.ways = ways;
}
public String getBz() {
return bz;
}
public void setBz(String bz) {
this.bz = bz;
}
}
package com.gavel.agv.service;
import com.gavel.common.base.service.BaseEditService;
import com.gavel.persistence.sql.RecordSet;
import com.gavel.agv.vo.AgvCondition;
import com.gavel.agv.vo.AgvVO;
import com.gavel.mcs.model.QueryAgvStatusResp;
import java.util.List;
public interface AgvService extends BaseEditService {
public RecordSet<AgvVO> query(AgvCondition condition);
public void update(List<QueryAgvStatusResp.AgvStatus> datas, String mapCode);
}
package com.gavel.agv.service;
import com.gavel.agv.vo.AgvtaskCondition;
import com.gavel.agv.vo.AgvtaskInfo;
import com.gavel.agv.vo.AgvtaskVO;
import com.gavel.common.base.service.BaseEditService;
import com.gavel.persistence.sql.RecordSet;
public interface AgvtaskService extends BaseEditService {
public RecordSet<AgvtaskVO> query(AgvtaskCondition condition);
public AgvtaskVO working(AgvtaskCondition condition);
public AgvtaskInfo queryAgvTasks(AgvtaskCondition condition);
}
package com.gavel.agv.service;
import com.gavel.common.base.service.BaseEditService;
import com.gavel.persistence.sql.RecordSet;
import com.gavel.agv.vo.AgvwarnCondition;
import com.gavel.agv.vo.AgvwarnVO;
import com.gavel.mcs.model.AGVWarns;
import com.gavel.mcs.model.AgvTaskStatus;
public interface AgvwarnService extends BaseEditService {
public RecordSet<AgvwarnVO> query(AgvwarnCondition condition);
public void recvWarns(AGVWarns warnCallback);
public void recvAgvTaskStatus(AgvTaskStatus agvTaskStatus);
}
package com.gavel.agv.service;
import com.gavel.agv.persistent.Eptask;
import com.gavel.common.base.service.BaseEditService;
import com.gavel.persistence.sql.RecordSet;
import com.gavel.agv.vo.EptaskCondition;
import com.gavel.agv.vo.EptaskVO;
public interface EptaskService extends BaseEditService {
public RecordSet<EptaskVO> query(EptaskCondition condition);
public Eptask loadTask(String taskCode);
public Eptask loadOneTask(String wbCode);
public Eptask loadTwoTask(String wbCode);
public Eptask findExecutingTwoTask(String wbCode);
public Eptask loadExecutingOneTask(String wbCode);
public Eptask loadExecutingSixTask(String fullPoint);
public Eptask loadExecutingSevenTask(String wbcode);
public Eptask findExecutingTask(String wbCode, String type);
}
package com.gavel.agv.service.impl;
import com.alibaba.fastjson.JSON;
import com.gavel.common.base.service.impl.BaseEditServiceImpl;
import com.gavel.common.utils.StringUtils;
import com.gavel.persistence.sql.RecordSet;
import com.gavel.mcs.model.QueryAgvStatusResp;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import com.gavel.agv.dao.AgvDao;
import com.gavel.agv.persistent.Agv;
import com.gavel.agv.service.AgvService;
import com.gavel.agv.vo.AgvCondition;
import com.gavel.agv.vo.AgvVO;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
@Service("agvService")
@Transactional
public class AgvServiceImpl extends BaseEditServiceImpl implements AgvService {
@Autowired
private AgvDao agvDao;
@Override
public void initService() {
addMaster( Agv.class);
}
@Override
public RecordSet<AgvVO> query(AgvCondition condition) {
return agvDao.query(condition);
}
@Override
public void update(List<QueryAgvStatusResp.AgvStatus> datas, String mapCode) {
if ( datas==null || datas.size()==0 ) {
return;
}
Agv conditon = new Agv();
conditon.setMapcode(mapCode);
List<Agv> exists = agvDao.queryListByEntity(conditon);
Map<String, Agv> existAgvs = new HashMap<>();
if ( exists!=null ) {
for (Agv agv : exists) {
existAgvs.put(agv.getRobotcode(), agv);
}
}
for (QueryAgvStatusResp.AgvStatus item : datas) {
Agv agv = existAgvs.get(item.getRobotCode());
if ( agv==null ) {
agv = new Agv();
}
agv.setRobotcode(item.getRobotCode());
agv.setRobotdir(item.getRobotDir());
agv.setRobotip(item.getRobotIp());
agv.setBattery(item.getBattery());
agv.setPosx(item.getPosX());
agv.setPosy(item.getPosY());
agv.setMapcode(item.getMapCode());
agv.setSpeed(item.getSpeed());
agv.setStatus(item.getStatus());
agv.setExcltype(item.getExclType());
agv.setStop(item.getStop());
agv.setPodcode(item.getPodCode());
agv.setPoddir(item.getPodDir());
//agv.setPath(JSON.toJSONString(item.getPath()));
if (StringUtils.isBlank(agv.getId()) ) {
agvDao.insert(agv);
} else {
agvDao.update(agv);
}
}
}
}
package com.gavel.agv.service.impl;
import com.gavel.agv.vo.AgvtaskInfo;
import com.gavel.common.Constants;
import com.gavel.common.base.service.impl.BaseEditServiceImpl;
import com.gavel.common.business.service.CommonService;
import com.gavel.common.utils.StringUtils;
import com.gavel.jcsj.utils.JcsjParamEnum;
import com.gavel.persistence.sql.RecordSet;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import com.gavel.agv.dao.AgvtaskDao;
import com.gavel.agv.persistent.Agvtask;
import com.gavel.agv.service.AgvtaskService;
import com.gavel.agv.vo.AgvtaskCondition;
import com.gavel.agv.vo.AgvtaskVO;
import java.util.List;
@Service("agvtaskService")
@Transactional
public class AgvtaskServiceImpl extends BaseEditServiceImpl implements AgvtaskService {
@Autowired
private AgvtaskDao agvtaskDao;
@Autowired
private CommonService commonService;
@Override
public void initService() {
addMaster( Agvtask.class);
}
@Override
public RecordSet<AgvtaskVO> query(AgvtaskCondition condition) {
if (condition.getCxids() == null || condition.getCxids().length == 0) {
String[] cxidsArray = StringUtils.str2Array(commonService.getStringOptionValue(JcsjParamEnum.MCSU002.id()), Constants.StringSplit.IDSPLIT);
if (cxidsArray.length > 0)
condition.setCxids(cxidsArray);
}
if (condition.getZdids() == null || condition.getZdids().length == 0) {
String[] zdidsArray = StringUtils.str2Array(commonService.getStringOptionValue(JcsjParamEnum.MCSU003.id()), Constants.StringSplit.IDSPLIT);
if (zdidsArray.length > 0)
condition.setZdids(zdidsArray);
}
return agvtaskDao.query(condition);
}
@Override
public AgvtaskVO working(AgvtaskCondition condition) {
return agvtaskDao.working(condition);
}
@Override
public AgvtaskInfo queryAgvTasks(AgvtaskCondition condition) {
AgvtaskInfo agvtaskInfo = new AgvtaskInfo();
if (condition.getCxids() == null || condition.getCxids().length == 0) {
String[] cxidsArray = StringUtils.str2Array(commonService.getStringOptionValue(JcsjParamEnum.MCSU002.id()), Constants.StringSplit.IDSPLIT);
if (cxidsArray.length > 0)
condition.setCxids(cxidsArray);
}
if (condition.getZdids() == null || condition.getZdids().length == 0) {
String[] zdidsArray = StringUtils.str2Array(commonService.getStringOptionValue(JcsjParamEnum.MCSU003.id()), Constants.StringSplit.IDSPLIT);
if (zdidsArray.length > 0)
condition.setZdids(zdidsArray);
}
List<AgvtaskVO> listnew = agvtaskDao.queryAgvTasks(condition);
if(condition.getIds().length == listnew.size()){
agvtaskInfo.setSign("false");
}else {
agvtaskInfo.setSign("true");
agvtaskInfo.setAgvtasks(listnew);
}
return agvtaskInfo;
}
}
package com.gavel.agv.service.impl;
import com.gavel.common.base.service.impl.BaseEditServiceImpl;
import com.gavel.common.utils.StringUtils;
import com.gavel.mcs.utils.EpTaskEnum;
import com.gavel.persistence.sql.RecordSet;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import com.gavel.agv.dao.EptaskDao;
import com.gavel.agv.persistent.Eptask;
import com.gavel.agv.service.EptaskService;
import com.gavel.agv.vo.EptaskCondition;
import com.gavel.agv.vo.EptaskVO;
@Service("eptaskService")
@Transactional
public class EptaskServiceImpl extends BaseEditServiceImpl implements EptaskService {
@Autowired
private EptaskDao eptaskDao;
@Override
public void initService() {
addMaster( Eptask.class);
}
@Override
public RecordSet<EptaskVO> query(EptaskCondition condition) {
return eptaskDao.query(condition);
}
@Override
public Eptask loadTask(String taskCode) {
if (StringUtils.isBlank(taskCode)) {
return null;
}
Eptask query = new Eptask();
query.setTaskCode(taskCode);
return eptaskDao.queryByEntity(query);
}
@Override
public Eptask loadOneTask(String wbCode) {
if (StringUtils.isBlank(wbCode)) {
return null;
}
Eptask query = new Eptask();
query.setWbCode(wbCode);
query.setType(EpTaskEnum.ONE.getId());
return eptaskDao.queryByEntity(query);
}
@Override
public Eptask loadTwoTask(String wbCode) {
if (StringUtils.isBlank(wbCode)) {
return null;
}
Eptask query = new Eptask();
query.setWbCode(wbCode);
query.setType(EpTaskEnum.TWO.getId());
return eptaskDao.queryByEntity(query);
}
@Override
public Eptask findExecutingTwoTask(String wbCode) {
if ( StringUtils.isBlank(wbCode) ) {
return null;
}
return eptaskDao.findExecutingTask(wbCode, EpTaskEnum.TWO.getId());
}
@Override
public Eptask loadExecutingOneTask(String wbCode) {
if ( StringUtils.isBlank(wbCode) ) {
return null;
}
return eptaskDao.findExecutingTask(wbCode, EpTaskEnum.ONE.getId());
}
@Override
public Eptask loadExecutingSixTask(String wbCode) {
if ( StringUtils.isBlank(wbCode) ) {
return null;
}
return eptaskDao.findExecutingTask(wbCode, EpTaskEnum.SIX.getId());
}
@Override
public Eptask loadExecutingSevenTask(String wbcode) {
if ( StringUtils.isBlank(wbcode) ) {
return null;
}
return eptaskDao.findExecutingTask(wbcode, EpTaskEnum.SEVEN.getId());
}
@Override
public Eptask findExecutingTask(String wbCode, String type) {
return eptaskDao.findExecutingTask(wbCode, type);
}
}
package com.gavel.agv.utils;
import java.util.HashMap;
import java.util.Map;
import java.util.concurrent.*;
/**
*
* @Description: 简单的内存缓存工具类
*/
public class CacheManger {
//键值对集合
private final static Map<String, Entity> map = new HashMap<>();
//定时器线程池,用于清除过期缓存
private final static ScheduledExecutorService executor = Executors.newSingleThreadScheduledExecutor();
/**
* 添加缓存
*
* @param key 键
* @param data 值
*/
public synchronized static void put(String key, Object data) {
CacheManger.put(key, data, 0);
}
/**
* 添加缓存
*
* @param key 键
* @param data 值
* @param expire 过期时间,单位:毫秒, 0表示无限长
*/
public synchronized static void put(String key, Object data, long expire) {
//清除原键值对
CacheManger.remove(key);
//设置过期时间
if (expire > 0) {
Future future = executor.schedule(new Runnable() {
@Override
public void run() {
//过期后清除该键值对
synchronized (CacheManger.class) {
map.remove(key);
}
}
}, expire, TimeUnit.MILLISECONDS);
map.put(key, new Entity(data, future));
} else {
//不设置过期时间
map.put(key, new Entity(data, null));
}
}
/**
* 读取缓存
*
* @param key 键
* @return
*/
public synchronized static Object get(String key) {
Entity entity = map.get(key);
return entity == null ? null : entity.getValue();
}
/**
* 读取缓存
*
* @param key 键
* * @param clazz 值类型
* @return
*/
public synchronized static <T> T get(String key, Class<T> clazz) {
return clazz.cast(CacheManger.get(key));
}
/**
* 清除缓存
*
* @param key
* @return
*/
public synchronized static Object remove(String key) {
//清除原缓存数据
Entity entity = map.remove(key);
if (entity == null) return null;
//清除原键值对定时器
Future future = entity.getFuture();
if (future != null) future.cancel(true);
return entity.getValue();
}
/**
* 查询当前缓存的键值对数量
*
* @return
*/
public synchronized static int size() {
return map.size();
}
/**
* 缓存实体类
*/
private static class Entity {
//键值对的value
private Object value;
//定时器Future
private Future future;
public Entity(Object value, Future future) {
this.value = value;
this.future = future;
}
/**
* 获取值
*
* @return
*/
public Object getValue() {
return value;
}
/**
* 获取Future对象
*
* @return
*/
public Future getFuture() {
return future;
}
}
public static void main(String[] args) throws InterruptedException, ExecutionException {
String key = "id";
//不设置过期时间
System.out.println("***********不设置过期时间**********");
CacheManger.put(key, 123);
System.out.println("key:" + key + ", value:" + CacheManger.get(key));
System.out.println("key:" + key + ", value:" + CacheManger.remove(key));
System.out.println("key:" + key + ", value:" + CacheManger.get(key));
//设置过期时间
System.out.println("\n***********设置过期时间**********");
CacheManger.put(key, "123456", 1000);
System.out.println("key:" + key + ", value:" + CacheManger.get(key));
Thread.sleep(2000);
System.out.println("key:" + key + ", value:" + CacheManger.get(key));
/******************并发性能测试************/
System.out.println("\n***********并发性能测试************");
//创建有10个线程的线程池,将1000000次操作分10次添加到线程池
ExecutorService executorService = Executors.newFixedThreadPool(10);
Future[] futures = new Future[10];
/********添加********/
{
long start = System.currentTimeMillis();
for (int j = 0; j < 10; j++) {
futures[j] = executorService.submit(() -> {
for (int i = 0; i < 100000; i++) {
CacheManger.put(Thread.currentThread().getId() + key + i, i, 30000);
}
});
}
//等待全部线程执行完成,打印执行时间
for (Future future : futures) {
future.get();
}
System.out.printf("添加耗时:%dms\n", System.currentTimeMillis() - start);
}
/********查询********/
{
long start = System.currentTimeMillis();
for (int j = 0; j < 10; j++) {
futures[j] = executorService.submit(() -> {
for (int i = 0; i < 100000; i++) {
CacheManger.get(Thread.currentThread().getId() + key + i);
}
});
}
//等待全部线程执行完成,打印执行时间
for (Future future : futures) {
future.get();
}
System.out.printf("查询耗时:%dms\n", System.currentTimeMillis() - start);
}
System.out.println("当前缓存容量:" + CacheManger.size());
}
}
package com.gavel.agv.utils;
import com.gavel.common.utils.StringUtils;
import com.gavel.kzzx.model.GavelEnumModel;
import java.util.ArrayList;
import java.util.List;
public enum TaskModelEnum {
//模板类型
MES("S13","MES模板"),
POINT("S14","点到储位"),
AREA("S15", "点到区域");
private String id;
private String name;
TaskModelEnum(String id, String name) {
this.id = id;
this.name = name;
}
public String getId() {
return id;
}
public void setId(String id) {
this.id = id;
}
public String getName() {
return name;
}
public void setName(String name) {
this.name = name;
}
public static String getNameById(String id) {
for (TaskModelEnum e : TaskModelEnum.values()) {
if (StringUtils.equals(e.getId(), id))
return e.getName();
}
return "";
}
public static List<GavelEnumModel> toList() {
List<GavelEnumModel> list = new ArrayList<>();
for (TaskModelEnum e : TaskModelEnum.values()) {
GavelEnumModel gavelEnumModel = new GavelEnumModel();
gavelEnumModel.setId(e.getId());
gavelEnumModel.setName(e.getName());
list.add(gavelEnumModel);
}
return list;
}
}
package com.gavel.agv.utils;
import com.gavel.common.utils.StringUtils;
import com.gavel.kzzx.model.GavelEnumModel;
import java.util.ArrayList;
import java.util.List;
public enum TaskWaysEnum {
//任务类型
MES("MES", "MES叫料"),
PAD("PAD","PAD叫料");
private String id;
private String name;
TaskWaysEnum(String id, String name) {
this.id = id;
this.name = name;
}
public String getId() {
return id;
}
public void setId(String id) {
this.id = id;
}
public String getName() {
return name;
}
public void setName(String name) {
this.name = name;
}
public static String getNameById(String id) {
for (TaskWaysEnum e : TaskWaysEnum.values()) {
if (StringUtils.equals(e.getId(), id))
return e.getName();
}
return "";
}
public static List<GavelEnumModel> toList() {
List<GavelEnumModel> list = new ArrayList<>();
for (TaskWaysEnum e : TaskWaysEnum.values()) {
GavelEnumModel gavelEnumModel = new GavelEnumModel();
gavelEnumModel.setId(e.getId());
gavelEnumModel.setName(e.getName());
list.add(gavelEnumModel);
}
return list;
}
}
package com.gavel.agv.vo;
import com.gavel.common.base.entity.BaseEntity;
public class AgvCondition extends BaseEntity {
private static final long serialVersionUID = 1L;
private String id;
private String robotcode;
public String getId() {
return id;
}
public void setId(String id) {
this.id = id;
}
public String getRobotcode() {
return robotcode;
}
public void setRobotcode(String robotcode) {
this.robotcode = robotcode;
}
}
package com.gavel.agv.vo;
import com.gavel.agv.persistent.Agv;
import com.gavel.persistence.annotation.FieldMeta;
public class AgvVO extends Agv {
private static final long serialVersionUID = 1L;
@FieldMeta(fieldName = "AGVSTATUS_CODE", caption = "状态码", primaryKey = true, notEmpty = true)
private String code;
@FieldMeta(fieldName = "AGVSTATUS_CHINESE", caption = "中文描述")
private String chinese;
@FieldMeta(fieldName = "AGVSTATUS_ENGLISH", caption = "英文描述")
private String english;
public String getCode() {
return code;
}
public void setCode(String code) {
this.code = code;
}
public String getChinese() {
return chinese;
}
public void setChinese(String chinese) {
this.chinese = chinese;
}
public String getEnglish() {
return english;
}
public void setEnglish(String english) {
this.english = english;
}
/*---------AutoBegin-----------*/
/*---------AutoEnd-------------*/
}
package com.gavel.agv.vo;
import com.gavel.common.base.entity.BaseEntity;
public class AgvtaskCondition extends BaseEntity {
private static final long serialVersionUID = 1L;
private String id;
private String[] ids;
private String wbcode;
private String taskCode;
private String taskStatus;
private String cjid;
private String cxid;
private String zdid;
private String gwmc;
private String online;
private String[] cxids;
private String[] zdids;
public String getId() {
return id;
}
public void setId(String id) {
this.id = id;
}
public String[] getIds() {
return ids;
}
public void setIds(String[] ids) {
this.ids = ids;
}
public String getWbcode() {
return wbcode;
}
public void setWbcode(String wbcode) {
this.wbcode = wbcode;
}
public String getTaskCode() {
return taskCode;
}
public void setTaskCode(String taskCode) {
this.taskCode = taskCode;
}
public String getTaskStatus() {
return taskStatus;
}
public void setTaskStatus(String taskStatus) {
this.taskStatus = taskStatus;
}
public String getCjid() {
return cjid;
}
public void setCjid(String cjid) {
this.cjid = cjid;
}
public String getCxid() {
return cxid;
}
public void setCxid(String cxid) {
this.cxid = cxid;
}
public String getGwmc() {
return gwmc;
}
public void setGwmc(String gwmc) {
this.gwmc = gwmc;
}
public String getZdid() {
return zdid;
}
public void setZdid(String zdid) {
this.zdid = zdid;
}
public String getOnline() {
return online;
}
public void setOnline(String online) {
this.online = online;
}
public String[] getCxids() {
return cxids;
}
public void setCxids(String[] cxids) {
this.cxids = cxids;
}
public String[] getZdids() {
return zdids;
}
public void setZdids(String[] zdids) {
this.zdids = zdids;
}
}
package com.gavel.agv.vo;
import com.gavel.common.base.entity.BaseEntity;
import java.util.ArrayList;
import java.util.List;
public class AgvtaskInfo extends BaseEntity {
private String sign;
private List<AgvtaskVO> agvtasks = new ArrayList<AgvtaskVO>();
public String getSign() {
return sign;
}
public void setSign(String sign) {
this.sign = sign;
}
public List<AgvtaskVO> getAgvtasks() {
return agvtasks;
}
public void setAgvtasks(List<AgvtaskVO> agvtasks) {
this.agvtasks = agvtasks;
}
}
package com.gavel.agv.vo;
import com.gavel.agv.persistent.Agvtask;
import com.gavel.persistence.annotation.FieldMeta;
public class AgvtaskVO extends Agvtask {
private static final long serialVersionUID = 1L;
@FieldMeta(fieldName = "CALLERNAME", caption = "叫料人")
private String callerName;
@FieldMeta(fieldName = "SENDERNAME", caption = "发料人")
private String senderName;
@FieldMeta(fieldName = "TASKSTATUS_DESCZH", caption = "中文描述")
private String desczh;
@FieldMeta(fieldName = "BM_NAME", caption = "车间名称")
private String cjmc;
@FieldMeta(fieldName = "CX_CXMC", caption = "产线名称")
private String cxmc;
@FieldMeta(fieldName = "ZD_ZDMC", caption = "站点名称")
private String zdmc;
@FieldMeta(fieldName = "QLK", caption = "取料口")
private String qlk;
@FieldMeta(fieldName = "GW_NAME", caption = "工位名称")
private String gwmc;
public String getCallerName() {
return callerName;
}
public void setCallerName(String callerName) {
this.callerName = callerName;
}
public String getSenderName() {
return senderName;
}
public void setSenderName(String senderName) {
this.senderName = senderName;
}
public String getDesczh() {
return desczh;
}
public void setDesczh(String desczh) {
this.desczh = desczh;
}
public String getCjmc() {
return cjmc;
}
public void setCjmc(String cjmc) {
this.cjmc = cjmc;
}
public String getCxmc() {
return cxmc;
}
public void setCxmc(String cxmc) {
this.cxmc = cxmc;
}
public String getZdmc() {
return zdmc;
}
public void setZdmc(String zdmc) {
this.zdmc = zdmc;
}
public String getQlk() {
return qlk;
}
public void setQlk(String qlk) {
this.qlk = qlk;
}
public String getGwmc() {
return gwmc;
}
public void setGwmc(String gwmc) {
this.gwmc = gwmc;
}
}
package com.gavel.agv.vo;
import com.gavel.common.base.entity.BaseEntity;
public class AgvwarnCondition extends BaseEntity {
private static final long serialVersionUID = 1L;
private String id;
private String robotcode;
private String taskcode;
public String getId() {
return id;
}
public void setId(String id) {
this.id = id;
}
public String getRobotcode() {
return robotcode;
}
public void setRobotcode(String robotcode) {
this.robotcode = robotcode;
}
public String getTaskcode() {
return taskcode;
}
public void setTaskcode(String taskcode) {
this.taskcode = taskcode;
}
}
package com.gavel.agv.vo;
import com.gavel.agv.persistent.Agvwarn;
public class AgvwarnVO extends Agvwarn {
private static final long serialVersionUID = 1L;
/*---------AutoBegin-----------*/
/*---------AutoEnd-------------*/
}
package com.gavel.agv.vo;
import com.gavel.common.base.entity.BaseEntity;
public class EptaskCondition extends BaseEntity {
private static final long serialVersionUID = 1L;
private String id;
private String taskCode;//任务单号
private String taskStatus;//任务状态
private String type;//任务类型
private String wbCode; //工位
private String[] taskStatusList;//多个任务状态
public String getId() {
return id;
}
public void setId(String id) {
this.id = id;
}
public String getWbCode() {
return wbCode;
}
public void setWbCode(String wbCode) {
this.wbCode = wbCode;
}
public String getTaskCode() {
return taskCode;
}
public void setTaskCode(String taskCode) {
this.taskCode = taskCode;
}
public String getTaskStatus() {
return taskStatus;
}
public void setTaskStatus(String taskStatus) {
this.taskStatus = taskStatus;
}
public String getType() {
return type;
}
public void setType(String type) {
this.type = type;
}
public String[] getTaskStatusList() {
return taskStatusList;
}
public void setTaskStatusList(String[] taskStatusList) {
this.taskStatusList = taskStatusList;
}
}
package com.gavel.agv.vo;
import com.gavel.agv.persistent.Eptask;
import com.gavel.persistence.annotation.FieldMeta;
public class EptaskVO extends Eptask {
@FieldMeta(fieldName = "CALLERNAME", caption = "叫料人")
private String callerName;
@FieldMeta(fieldName = "SENDERNAME", caption = "发料人")
private String senderName;
@FieldMeta(fieldName = "TASKSTATUS_DESCZH", caption = "任务状态")
private String desczh;
@FieldMeta(fieldName = "CK_CODE", caption = "区域编码")
private String ckCode;
@FieldMeta(fieldName = "CK_NAME", caption = "区域名称")
private String ckName;
@FieldMeta(fieldName = "GW_NAME", caption = "工位名称")
private String gwName;
@FieldMeta(fieldName = "POD_BERTHCODE", caption = "货架位置")
private String podBerthCode;
public String getCallerName() {
return callerName;
}
public void setCallerName(String callerName) {
this.callerName = callerName;
}
public String getSenderName() {
return senderName;
}
public void setSenderName(String senderName) {
this.senderName = senderName;
}
public String getDesczh() {
return desczh;
}
public void setDesczh(String desczh) {
this.desczh = desczh;
}
public String getCkCode() {
return ckCode;
}
public void setCkCode(String ckCode) {
this.ckCode = ckCode;
}
public String getCkName() {
return ckName;
}
public void setCkName(String ckName) {
this.ckName = ckName;
}
public String getGwName() {
return gwName;
}
public void setGwName(String gwName) {
this.gwName = gwName;
}
public String getPodBerthCode() {
return podBerthCode;
}
public void setPodBerthCode(String podBerthCode) {
this.podBerthCode = podBerthCode;
}
}
package com.gavel.druid;
import com.alibaba.druid.pool.DruidDataSource;
import com.alibaba.druid.pool.DruidDataSourceFactory;
import com.gavel.druid.model.Model;
import com.gavel.jcsj.persistent.Wlsn;
import java.io.InputStream;
import java.sql.Connection;
import java.sql.PreparedStatement;
import java.sql.ResultSet;
import java.sql.SQLException;
import java.util.ArrayList;
import java.util.List;
import java.util.Properties;
public class DruidUtil {
private static DruidDataSource druidDataSource;
// 注册驱动
static {
try {
InputStream resource = DruidUtil.class.getClassLoader().getResourceAsStream("druid.properties");
Properties properties = new Properties();
properties.load(resource);
druidDataSource = (DruidDataSource) DruidDataSourceFactory.createDataSource(properties);
} catch (Exception e) {
e.printStackTrace();
}
}
public static Connection getConnect(){
try {
return druidDataSource.getConnection();
} catch (SQLException e) {
throw new RuntimeException(e);
}
}
public static void close(Connection conn, PreparedStatement statement) {
try {
conn.close();
} catch (SQLException e) {
e.printStackTrace();
}
try {
statement.close();
} catch (SQLException e) {
e.printStackTrace();
}
}
public static void close(Connection conn, PreparedStatement statement, ResultSet resultSet) {
close(conn, statement);
try {
resultSet.close();
} catch (SQLException e) {
e.printStackTrace();
}
}
public static Wlsn queryWlsn(String param) throws SQLException {
Connection connection = DruidUtil.getConnect();
String sql = "select t.product_code,t.product_name,t.sn from intermes.VW_DATA_PLAN_SN_INFO t where t.product_series='组串式' and t.sn = ?";
PreparedStatement statement = connection.prepareStatement(sql);
statement.setString(1,param);
ResultSet resultSet = statement.executeQuery();
Wlsn wlsn = new Wlsn();
while (resultSet.next()) {
String code = resultSet.getString("PRODUCT_CODE");
String name = resultSet.getString("PRODUCT_NAME");
String sn = resultSet.getString("SN");
wlsn.setProduct_code(code);
wlsn.setProduct_name(name);
wlsn.setSn(sn);
}
DruidUtil.close(connection,statement,resultSet);
return wlsn;
}
public static List<Model> queryAll(Connection connection, String sql,String param) throws SQLException {
PreparedStatement statement = connection.prepareStatement(sql);
statement.setString(1,param);
ResultSet resultSet = statement.executeQuery();
List<Model> list = new ArrayList<>();
while (resultSet.next()) {
String code = resultSet.getString("PRODUCT_CODE");
String name = resultSet.getString("PRODUCT_NAME");
String sn = resultSet.getString("SN");
list.add(new Model(code, name, sn));
}
DruidUtil.close(connection,statement,resultSet);
return list;
}
// 测试方法
public static void main(String[] args) throws SQLException {
/* Connection connection = DruidUtil.getConnect();
String sql = "select t.product_code,t.product_name,t.sn from intermes.VW_DATA_PLAN_SN_INFO t where t.product_series='组串式' and t.sn = ? ";
List<Model> list = queryAll(connection,sql,"A1906280235");
for (Model model : list) {
System.out.println(model);
}*/
/* Wlsn wlsn = DruidUtil.queryWlsn("A1906280235");
System.out.println(wlsn);*/
}
}
package com.gavel.druid.model;
public class Model {
private String product_code;
private String product_name;
private String sn;
public Model(String product_code, String product_name, String sn) {
this.product_code = product_code;
this.product_name = product_name;
this.sn = sn;
}
public String getProduct_code() {
return product_code;
}
public void setProduct_code(String product_code) {
this.product_code = product_code;
}
public String getProduct_name() {
return product_name;
}
public void setProduct_name(String product_name) {
this.product_name = product_name;
}
public String getSn() {
return sn;
}
public void setSn(String sn) {
this.sn = sn;
}
@Override
public String toString() {
return "Model{" +
"product_code='" + product_code + '\'' +
", product_name='" + product_name + '\'' +
", sn='" + sn + '\'' +
'}';
}
}
package com.gavel.jcsj.controller;
import com.gavel.common.BaseURL;
import com.gavel.common.base.BaseEditJSON;
import com.gavel.common.base.controller.BaseController;
import com.gavel.common.converter.DataConvert;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.ResponseBody;
import com.gavel.persistence.sql.RecordSet;
import com.gavel.common.annotation.ResourcePermissions;
import com.gavel.common.SystemOperation;
import com.alibaba.fastjson.JSONObject;
import com.gavel.common.utils.ThreadContext;
import com.gavel.jcsj.service.AgingroomService;
import com.gavel.jcsj.vo.AgingroomCondition;
import com.gavel.jcsj.vo.AgingroomVO;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
@Controller
@RequestMapping("jcsj/agingroom")
public class AgingroomController extends BaseController {
@Autowired
private AgingroomService agingroomService;
@ResourcePermissions()
@RequestMapping("/index")
public String index() {
return "jcsj/agingroom/index";
}
@ResourcePermissions({SystemOperation.BottonResource.ADD})
@RequestMapping("/add")
public String add() {
return "jcsj/agingroom/edit";
}
@ResourcePermissions({SystemOperation.BottonResource.EDIT})
@RequestMapping("/edit")
public String edit() {
return "jcsj/agingroom/edit";
}
@RequestMapping(value = BaseURL.GET, method = RequestMethod.POST)
@ResponseBody
public Object get(@RequestBody JSONObject param) {
AgingroomCondition condition = DataConvert.getCondition(param, AgingroomCondition.class);
RecordSet<AgingroomVO> records = agingroomService.query(condition);
if ( records.getRecords()!=null && records.getRecords().size()>=1 ){
return buildReturnData(AgingroomVO.class, records.getRecords().get(0));
}
return buildReturnData(AgingroomVO.class, null);
}
@RequestMapping(value = BaseURL.QUERY, method = RequestMethod.POST)
@ResponseBody
public Object query(@RequestBody JSONObject param) {
AgingroomCondition condition = DataConvert.getCondition(param, AgingroomCondition.class);
RecordSet<AgingroomVO> records = agingroomService.query(condition);
return buildReturnData(records, AgingroomVO.class);
}
@ResourcePermissions(SystemOperation.BottonResource.ADD)
@RequestMapping(value = BaseURL.ADD, method = RequestMethod.POST)
@ResponseBody
public Object insert(@RequestBody JSONObject param) {
BaseEditJSON editJson = BaseEditJSON.parseJSON(param);
agingroomService.insert(editJson);
return ThreadContext.getReturnData();
}
@ResourcePermissions(SystemOperation.BottonResource.EDIT)
@RequestMapping(value = BaseURL.UPDATE, method = RequestMethod.POST)
@ResponseBody
public Object update(@RequestBody JSONObject param) {
BaseEditJSON editJson = BaseEditJSON.parseJSON(param);
agingroomService.update(editJson);
return ThreadContext.getReturnData();
}
@ResourcePermissions(SystemOperation.BottonResource.DELETE)
@RequestMapping(value = BaseURL.DELETE, method = RequestMethod.POST)
@ResponseBody
public Object delete(@RequestBody JSONObject param) {
BaseEditJSON editJson = BaseEditJSON.parseJSON(param);
agingroomService.delete(editJson);
return ThreadContext.getReturnData();
}
@ResourcePermissions(SystemOperation.BottonResource.EXPORT)
@RequestMapping(value = BaseURL.EXPORT, method = RequestMethod.POST)
@ResponseBody
public void export(HttpServletRequest request,HttpServletResponse response, @RequestBody JSONObject param) throws Exception {
AgingroomCondition condition = DataConvert.getCondition(param, AgingroomCondition.class);
RecordSet<AgingroomVO> records = agingroomService.query(condition);
doExport(request, response, param, records.getRecords());
}
}
package com.gavel.jcsj.controller;
import com.gavel.common.BaseURL;
import com.gavel.common.base.BaseEditJSON;
import com.gavel.common.base.controller.BaseController;
import com.gavel.common.converter.DataConvert;
import com.gavel.jcsj.persistent.Agvstatus;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.ResponseBody;
import com.gavel.persistence.sql.RecordSet;
import com.gavel.common.annotation.ResourcePermissions;
import com.gavel.common.SystemOperation;
import com.alibaba.fastjson.JSONObject;
import com.gavel.common.utils.ThreadContext;
import com.gavel.jcsj.service.AgvstatusService;
import com.gavel.jcsj.vo.AgvstatusCondition;
import com.gavel.jcsj.vo.AgvstatusVO;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
@Controller
@RequestMapping("jcsj/agvstatus")
public class AgvstatusController extends BaseController {
@Autowired
private AgvstatusService agvstatusService;
@ResourcePermissions()
@RequestMapping("/index")
public String index() {
return "jcsj/agvstatus/index";
}
@ResourcePermissions({SystemOperation.BottonResource.ADD})
@RequestMapping("/add")
public String add() {
return "jcsj/agvstatus/edit";
}
@ResourcePermissions({SystemOperation.BottonResource.EDIT})
@RequestMapping("/edit")
public String edit() {
return "jcsj/agvstatus/edit";
}
@RequestMapping(value = BaseURL.GET, method = RequestMethod.POST)
@ResponseBody
public Object get(@RequestBody JSONObject param) {
AgvstatusCondition condition = DataConvert.getCondition(param, AgvstatusCondition.class);
RecordSet<AgvstatusVO> records = agvstatusService.query(condition);
if ( records.getRecords()!=null && records.getRecords().size()>=1 ){
return buildReturnData(AgvstatusVO.class, records.getRecords().get(0));
}
return buildReturnData(AgvstatusVO.class, null);
}
@RequestMapping(value = BaseURL.QUERY, method = RequestMethod.POST)
@ResponseBody
public Object query(@RequestBody JSONObject param) {
AgvstatusCondition condition = DataConvert.getCondition(param, AgvstatusCondition.class);
RecordSet<AgvstatusVO> records = agvstatusService.query(condition);
return buildReturnData(records, AgvstatusVO.class);
}
@ResourcePermissions(SystemOperation.BottonResource.ADD)
@RequestMapping(value = BaseURL.ADD, method = RequestMethod.POST)
@ResponseBody
public Object insert(@RequestBody JSONObject param) {
BaseEditJSON editJson = BaseEditJSON.parseJSON(param);
agvstatusService.insert(editJson);
return ThreadContext.getReturnData();
}
@ResourcePermissions(SystemOperation.BottonResource.EDIT)
@RequestMapping(value = BaseURL.UPDATE, method = RequestMethod.POST)
@ResponseBody
public Object update(@RequestBody JSONObject param) {
BaseEditJSON editJson = BaseEditJSON.parseJSON(param);
agvstatusService.update(editJson);
return ThreadContext.getReturnData();
}
@ResourcePermissions(SystemOperation.BottonResource.DELETE)
@RequestMapping(value = BaseURL.DELETE, method = RequestMethod.POST)
@ResponseBody
public Object delete(@RequestBody JSONObject param) {
Agvstatus agvstatus = DataConvert.getData(param,Agvstatus.class);
agvstatusService.delete(agvstatus);
return ThreadContext.getReturnData();
}
@ResourcePermissions(SystemOperation.BottonResource.EXPORT)
@RequestMapping(value = BaseURL.EXPORT, method = RequestMethod.POST)
@ResponseBody
public void export(HttpServletRequest request,HttpServletResponse response, @RequestBody JSONObject param) throws Exception {
AgvstatusCondition condition = DataConvert.getCondition(param, AgvstatusCondition.class);
RecordSet<AgvstatusVO> records = agvstatusService.query(condition);
doExport(request, response, param, records.getRecords());
}
}
package com.gavel.jcsj.controller;
import com.gavel.common.BaseURL;
import com.gavel.common.base.BaseEditJSON;
import com.gavel.common.base.controller.BaseController;
import com.gavel.common.converter.DataConvert;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.ResponseBody;
import com.gavel.persistence.sql.RecordSet;
import com.gavel.common.annotation.ResourcePermissions;
import com.gavel.common.SystemOperation;
import com.alibaba.fastjson.JSONObject;
import com.gavel.common.utils.ThreadContext;
import com.gavel.jcsj.service.ApilogService;
import com.gavel.jcsj.vo.ApilogCondition;
import com.gavel.jcsj.vo.ApilogVO;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
@Controller
@RequestMapping("jcsj/apilog")
public class ApilogController extends BaseController {
@Autowired
private ApilogService apilogService;
@ResourcePermissions()
@RequestMapping("/index")
public String index() {
return "jcsj/apilog/index";
}
@ResourcePermissions({SystemOperation.BottonResource.ADD})
@RequestMapping("/add")
public String add() {
return "jcsj/apilog/edit";
}
@ResourcePermissions({SystemOperation.BottonResource.EDIT})
@RequestMapping("/edit")
public String edit() {
return "jcsj/apilog/edit";
}
@RequestMapping(value = BaseURL.GET, method = RequestMethod.POST)
@ResponseBody
public Object get(@RequestBody JSONObject param) {
ApilogCondition condition = DataConvert.getCondition(param, ApilogCondition.class);
RecordSet<ApilogVO> records = apilogService.query(condition);
if ( records.getRecords()!=null && records.getRecords().size()>=1 ){
return buildReturnData(ApilogVO.class, records.getRecords().get(0));
}
return buildReturnData(ApilogVO.class, null);
}
@RequestMapping(value = BaseURL.QUERY, method = RequestMethod.POST)
@ResponseBody
public Object query(@RequestBody JSONObject param) {
ApilogCondition condition = DataConvert.getCondition(param, ApilogCondition.class);
RecordSet<ApilogVO> records = apilogService.query(condition);
return buildReturnData(records, ApilogVO.class);
}
@ResourcePermissions(SystemOperation.BottonResource.ADD)
@RequestMapping(value = BaseURL.ADD, method = RequestMethod.POST)
@ResponseBody
public Object insert(@RequestBody JSONObject param) {
BaseEditJSON editJson = BaseEditJSON.parseJSON(param);
apilogService.insert(editJson);
return ThreadContext.getReturnData();
}
@ResourcePermissions(SystemOperation.BottonResource.EDIT)
@RequestMapping(value = BaseURL.UPDATE, method = RequestMethod.POST)
@ResponseBody
public Object update(@RequestBody JSONObject param) {
BaseEditJSON editJson = BaseEditJSON.parseJSON(param);
apilogService.update(editJson);
return ThreadContext.getReturnData();
}
@ResourcePermissions(SystemOperation.BottonResource.DELETE)
@RequestMapping(value = BaseURL.DELETE, method = RequestMethod.POST)
@ResponseBody
public Object delete(@RequestBody JSONObject param) {
BaseEditJSON editJson = BaseEditJSON.parseJSON(param);
apilogService.delete(editJson);
return ThreadContext.getReturnData();
}
@ResourcePermissions(SystemOperation.BottonResource.EXPORT)
@RequestMapping(value = BaseURL.EXPORT, method = RequestMethod.POST)
@ResponseBody
public void export(HttpServletRequest request,HttpServletResponse response, @RequestBody JSONObject param) throws Exception {
ApilogCondition condition = DataConvert.getCondition(param, ApilogCondition.class);
RecordSet<ApilogVO> records = apilogService.query(condition);
doExport(request, response, param, records.getRecords());
}
}
package com.gavel.jcsj.controller;
import com.gavel.common.BaseURL;
import com.gavel.common.base.BaseEditJSON;
import com.gavel.common.base.controller.BaseController;
import com.gavel.common.converter.DataConvert;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.ResponseBody;
import com.gavel.persistence.sql.RecordSet;
import com.gavel.common.annotation.ResourcePermissions;
import com.gavel.common.SystemOperation;
import com.alibaba.fastjson.JSONObject;
import com.gavel.common.utils.ThreadContext;
import com.gavel.jcsj.service.AppverService;
import com.gavel.jcsj.vo.AppverCondition;
import com.gavel.jcsj.vo.AppverVO;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
@Controller
@RequestMapping("jcsj/appver")
public class AppverController extends BaseController {
@Autowired
private AppverService appverService;
@ResourcePermissions()
@RequestMapping("/index")
public String index() {
return "jcsj/appver/index";
}
@ResourcePermissions({SystemOperation.BottonResource.ADD})
@RequestMapping("/add")
public String add() {
return "jcsj/appver/edit";
}
@ResourcePermissions({SystemOperation.BottonResource.EDIT})
@RequestMapping("/edit")
public String edit() {
return "jcsj/appver/edit";
}
@RequestMapping(value = BaseURL.GET, method = RequestMethod.POST)
@ResponseBody
public Object get(@RequestBody JSONObject param) {
AppverCondition condition = DataConvert.getCondition(param, AppverCondition.class);
RecordSet<AppverVO> records = appverService.query(condition);
if ( records.getRecords()!=null && records.getRecords().size()>=1 ){
return buildReturnData(AppverVO.class, records.getRecords().get(0));
}
return buildReturnData(AppverVO.class, null);
}
@RequestMapping(value = BaseURL.QUERY, method = RequestMethod.POST)
@ResponseBody
public Object query(@RequestBody JSONObject param) {
AppverCondition condition = DataConvert.getCondition(param, AppverCondition.class);
RecordSet<AppverVO> records = appverService.query(condition);
return buildReturnData(records, AppverVO.class);
}
@ResourcePermissions(SystemOperation.BottonResource.ADD)
@RequestMapping(value = BaseURL.ADD, method = RequestMethod.POST)
@ResponseBody
public Object insert(@RequestBody JSONObject param) {
BaseEditJSON editJson = BaseEditJSON.parseJSON(param);
appverService.insert(editJson);
return ThreadContext.getReturnData();
}
@ResourcePermissions(SystemOperation.BottonResource.EDIT)
@RequestMapping(value = BaseURL.UPDATE, method = RequestMethod.POST)
@ResponseBody
public Object update(@RequestBody JSONObject param) {
BaseEditJSON editJson = BaseEditJSON.parseJSON(param);
appverService.update(editJson);
return ThreadContext.getReturnData();
}
@ResourcePermissions(SystemOperation.BottonResource.DELETE)
@RequestMapping(value = BaseURL.DELETE, method = RequestMethod.POST)
@ResponseBody
public Object delete(@RequestBody JSONObject param) {
BaseEditJSON editJson = BaseEditJSON.parseJSON(param);
appverService.delete(editJson);
return ThreadContext.getReturnData();
}
@ResourcePermissions(SystemOperation.BottonResource.EXPORT)
@RequestMapping(value = BaseURL.EXPORT, method = RequestMethod.POST)
@ResponseBody
public void export(HttpServletRequest request,HttpServletResponse response, @RequestBody JSONObject param) throws Exception {
AppverCondition condition = DataConvert.getCondition(param, AppverCondition.class);
RecordSet<AppverVO> records = appverService.query(condition);
doExport(request, response, param, records.getRecords());
}
}
package com.gavel.jcsj.controller;
import com.gavel.common.BaseURL;
import com.gavel.common.base.BaseEditJSON;
import com.gavel.common.base.controller.BaseController;
import com.gavel.common.converter.DataConvert;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.ResponseBody;
import com.gavel.persistence.sql.RecordSet;
import com.gavel.common.annotation.ResourcePermissions;
import com.gavel.common.SystemOperation;
import com.alibaba.fastjson.JSONObject;
import com.gavel.common.utils.ThreadContext;
import com.gavel.jcsj.service.AreaService;
import com.gavel.jcsj.vo.AreaCondition;
import com.gavel.jcsj.vo.AreaVO;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
@Controller
@RequestMapping("jcsj/area")
public class AreaController extends BaseController {
@Autowired
private AreaService areaService;
@ResourcePermissions()
@RequestMapping("/index")
public String index() {
return "jcsj/area/index";
}
@ResourcePermissions({SystemOperation.BottonResource.ADD})
@RequestMapping("/add")
public String add() {
return "jcsj/area/edit";
}
@ResourcePermissions({SystemOperation.BottonResource.EDIT})
@RequestMapping("/edit")
public String edit() {
return "jcsj/area/edit";
}
@RequestMapping(value = BaseURL.GET, method = RequestMethod.POST)
@ResponseBody
public Object get(@RequestBody JSONObject param) {
AreaCondition condition = DataConvert.getCondition(param, AreaCondition.class);
RecordSet<AreaVO> records = areaService.query(condition);
if ( records.getRecords()!=null && records.getRecords().size()>=1 ){
return buildReturnData(AreaVO.class, records.getRecords().get(0));
}
return buildReturnData(AreaVO.class, null);
}
@RequestMapping(value = BaseURL.QUERY, method = RequestMethod.POST)
@ResponseBody
public Object query(@RequestBody JSONObject param) {
AreaCondition condition = DataConvert.getCondition(param, AreaCondition.class);
RecordSet<AreaVO> records = areaService.query(condition);
return buildReturnData(records, AreaVO.class);
}
@ResourcePermissions(SystemOperation.BottonResource.ADD)
@RequestMapping(value = BaseURL.ADD, method = RequestMethod.POST)
@ResponseBody
public Object insert(@RequestBody JSONObject param) {
BaseEditJSON editJson = BaseEditJSON.parseJSON(param);
areaService.insert(editJson);
return ThreadContext.getReturnData();
}
@ResourcePermissions(SystemOperation.BottonResource.EDIT)
@RequestMapping(value = BaseURL.UPDATE, method = RequestMethod.POST)
@ResponseBody
public Object update(@RequestBody JSONObject param) {
BaseEditJSON editJson = BaseEditJSON.parseJSON(param);
areaService.update(editJson);
return ThreadContext.getReturnData();
}
@ResourcePermissions(SystemOperation.BottonResource.DELETE)
@RequestMapping(value = BaseURL.DELETE, method = RequestMethod.POST)
@ResponseBody
public Object delete(@RequestBody JSONObject param) {
BaseEditJSON editJson = BaseEditJSON.parseJSON(param);
areaService.delete(editJson);
return ThreadContext.getReturnData();
}
@ResourcePermissions(SystemOperation.BottonResource.EXPORT)
@RequestMapping(value = BaseURL.EXPORT, method = RequestMethod.POST)
@ResponseBody
public void export(HttpServletRequest request,HttpServletResponse response, @RequestBody JSONObject param) throws Exception {
AreaCondition condition = DataConvert.getCondition(param, AreaCondition.class);
RecordSet<AreaVO> records = areaService.query(condition);
doExport(request, response, param, records.getRecords());
}
}
package com.gavel.jcsj.controller;
import com.alibaba.fastjson.JSONObject;
import com.gavel.common.BaseURL;
import com.gavel.common.SystemOperation;
import com.gavel.common.annotation.ResourcePermissions;
import com.gavel.common.base.BaseEditJSON;
import com.gavel.common.base.controller.BaseController;
import com.gavel.common.converter.DataConvert;
import com.gavel.common.utils.StringUtils;
import com.gavel.common.utils.ThreadContext;
import com.gavel.jcsj.service.BomService;
import com.gavel.jcsj.vo.*;
import com.gavel.persistence.sql.RecordSet;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.ResponseBody;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
@Controller
@RequestMapping("jcsj/bom")
public class BomController extends BaseController {
@Autowired
private BomService bomService;
@ResourcePermissions()
@RequestMapping("/index")
public String index() {
return "jcsj/bom/index";
}
@ResourcePermissions({SystemOperation.BottonResource.ADD})
@RequestMapping("/add")
public String add() {
return "jcsj/bom/edit";
}
@ResourcePermissions({SystemOperation.BottonResource.EDIT})
@RequestMapping("/edit")
public String edit() {
return "jcsj/bom/edit";
}
@RequestMapping("/qlk")
public String qlk() {
return "jcsj/bom/qlk";
}
@RequestMapping("/hcd")
public String hcd() {
return "jcsj/bom/hcd";
}
@RequestMapping(value = BaseURL.GET, method = RequestMethod.POST)
@ResponseBody
public Object get(@RequestBody JSONObject param) {
BomCondition condition = DataConvert.getCondition(param, BomCondition.class);
RecordSet<BomVO> records = bomService.query(condition);
if ( records.getRecords()!=null && records.getRecords().size()>=1 ){
return buildReturnData(BomVO.class, records.getRecords().get(0));
}
return buildReturnData(BomVO.class, null);
}
@RequestMapping(value = BaseURL.QUERY, method = RequestMethod.POST)
@ResponseBody
public Object query(@RequestBody JSONObject param) {
BomCondition condition = DataConvert.getCondition(param, BomCondition.class);
RecordSet<BomVO> records = bomService.query(condition);
return buildReturnData(records, BomVO.class);
}
@RequestMapping(value = BaseURL.QUERY_DETAIL, method = RequestMethod.POST)
@ResponseBody
public Object queryDetial(@RequestBody JSONObject param) {
BommxCondition condition = DataConvert.getCondition(param, BommxCondition.class);
RecordSet<BommxVO> records = bomService.queryDetial(condition);
return buildReturnData(records, BommxVO.class);
}
@ResourcePermissions(SystemOperation.BottonResource.ADD)
@RequestMapping(value = BaseURL.ADD, method = RequestMethod.POST)
@ResponseBody
public Object insert(@RequestBody JSONObject param) {
BaseEditJSON editJson = BaseEditJSON.parseJSON(param);
bomService.insert(editJson);
return ThreadContext.getReturnData();
}
@ResourcePermissions(SystemOperation.BottonResource.EDIT)
@RequestMapping(value = BaseURL.UPDATE, method = RequestMethod.POST)
@ResponseBody
public Object update(@RequestBody JSONObject param) {
BaseEditJSON editJson = BaseEditJSON.parseJSON(param);
bomService.update(editJson);
return ThreadContext.getReturnData();
}
@ResourcePermissions(SystemOperation.BottonResource.DELETE)
@RequestMapping(value = BaseURL.DELETE, method = RequestMethod.POST)
@ResponseBody
public Object delete(@RequestBody JSONObject param) {
BaseEditJSON editJson = BaseEditJSON.parseJSON(param);
bomService.delete(editJson);
return ThreadContext.getReturnData();
}
@ResourcePermissions(SystemOperation.BottonResource.EXPORT)
@RequestMapping(value = BaseURL.EXPORT, method = RequestMethod.POST)
@ResponseBody
public void export(HttpServletRequest request,HttpServletResponse response, @RequestBody JSONObject param) throws Exception {
BomCondition condition = DataConvert.getCondition(param, BomCondition.class);
RecordSet<BomVO> records = bomService.query(condition);
doExport(request, response, param, records.getRecords());
}
/**
* 设置取料口
*/
@RequestMapping(value = "setqlk", method = RequestMethod.POST)
@ResponseBody
public Object setqlk(@RequestBody JSONObject param) {
try{
String bomid = param.getString("bomid");
if(StringUtils.isEmpty(bomid)){
throw new RuntimeException("缺少参数: 产品ID");
}
String qlk = param.getString("qlk");
if(StringUtils.isEmpty(qlk)){
throw new RuntimeException("缺少参数: 取料口");
}
bomService.setqlk(bomid,qlk);
} catch (Exception e){
ThreadContext.getReturnData().setSuccess(false);
ThreadContext.getReturnData().setMessage(e.getMessage());
}
return ThreadContext.getReturnData();
}
/**
* 设置还车点
*/
@RequestMapping(value = "sethcd", method = RequestMethod.POST)
@ResponseBody
public Object sethcd(@RequestBody JSONObject param) {
try{
String bomid = param.getString("bomid");
if(StringUtils.isEmpty(bomid)){
throw new RuntimeException("缺少参数: 产品ID");
}
String hcd = param.getString("hcd");
if(StringUtils.isEmpty(hcd)){
throw new RuntimeException("缺少参数: 还车点");
}
bomService.sethcd(bomid,hcd);
} catch (Exception e){
ThreadContext.getReturnData().setSuccess(false);
ThreadContext.getReturnData().setMessage(e.getMessage());
}
return ThreadContext.getReturnData();
}
/**
* 取料口列表
*/
@RequestMapping(value = "pickupstation", method = RequestMethod.POST)
@ResponseBody
public Object pickupstation(@RequestBody JSONObject param) {
try {
BommxCondition condition = DataConvert.getCondition(param, BommxCondition.class);
RecordSet<GwVO> records = bomService.pickupstation(condition);
return buildReturnData(records, GwVO.class);
} catch (Exception e) {
ThreadContext.getReturnData().setSuccess(false);
ThreadContext.getReturnData().setMessage(e.getMessage());
}
return ThreadContext.getReturnData();
}
/**
* 还车点列表
*/
@RequestMapping(value = "returnstation", method = RequestMethod.POST)
@ResponseBody
public Object returnstation(@RequestBody JSONObject param) {
try {
BommxCondition condition = DataConvert.getCondition(param, BommxCondition.class);
RecordSet<GwVO> records = bomService.returnstation(condition);
return buildReturnData(records, GwVO.class);
} catch (Exception e) {
ThreadContext.getReturnData().setSuccess(false);
ThreadContext.getReturnData().setMessage(e.getMessage());
}
return ThreadContext.getReturnData();
}
}
package com.gavel.jcsj.controller;
import com.gavel.common.BaseURL;
import com.gavel.common.base.BaseEditJSON;
import com.gavel.common.base.controller.BaseController;
import com.gavel.common.converter.DataConvert;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.ResponseBody;
import com.gavel.persistence.sql.RecordSet;
import com.gavel.common.annotation.ResourcePermissions;
import com.gavel.common.SystemOperation;
import com.alibaba.fastjson.JSONObject;
import com.gavel.common.utils.ThreadContext;
import com.gavel.jcsj.service.BommxService;
import com.gavel.jcsj.vo.BommxCondition;
import com.gavel.jcsj.vo.BommxVO;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
@Controller
@RequestMapping("jcsj/bommx")
public class BommxController extends BaseController {
@Autowired
private BommxService bommxService;
@ResourcePermissions()
@RequestMapping("/index")
public String index() {
return "jcsj/bommx/index";
}
@ResourcePermissions({SystemOperation.BottonResource.ADD})
@RequestMapping("/add")
public String add() {
return "jcsj/bommx/edit";
}
@ResourcePermissions({SystemOperation.BottonResource.EDIT})
@RequestMapping("/edit")
public String edit() {
return "jcsj/bommx/edit";
}
@RequestMapping(value = BaseURL.GET, method = RequestMethod.POST)
@ResponseBody
public Object get(@RequestBody JSONObject param) {
BommxCondition condition = DataConvert.getCondition(param, BommxCondition.class);
RecordSet<BommxVO> records = bommxService.query(condition);
if ( records.getRecords()!=null && records.getRecords().size()>=1 ){
return buildReturnData(BommxVO.class, records.getRecords().get(0));
}
return buildReturnData(BommxVO.class, null);
}
@RequestMapping(value = BaseURL.QUERY, method = RequestMethod.POST)
@ResponseBody
public Object query(@RequestBody JSONObject param) {
BommxCondition condition = DataConvert.getCondition(param, BommxCondition.class);
RecordSet<BommxVO> records = bommxService.query(condition);
return buildReturnData(records, BommxVO.class);
}
@ResourcePermissions(SystemOperation.BottonResource.ADD)
@RequestMapping(value = BaseURL.ADD, method = RequestMethod.POST)
@ResponseBody
public Object insert(@RequestBody JSONObject param) {
BaseEditJSON editJson = BaseEditJSON.parseJSON(param);
bommxService.insert(editJson);
return ThreadContext.getReturnData();
}
@ResourcePermissions(SystemOperation.BottonResource.EDIT)
@RequestMapping(value = BaseURL.UPDATE, method = RequestMethod.POST)
@ResponseBody
public Object update(@RequestBody JSONObject param) {
BaseEditJSON editJson = BaseEditJSON.parseJSON(param);
bommxService.update(editJson);
return ThreadContext.getReturnData();
}
@ResourcePermissions(SystemOperation.BottonResource.DELETE)
@RequestMapping(value = BaseURL.DELETE, method = RequestMethod.POST)
@ResponseBody
public Object delete(@RequestBody JSONObject param) {
BaseEditJSON editJson = BaseEditJSON.parseJSON(param);
bommxService.delete(editJson);
return ThreadContext.getReturnData();
}
@ResourcePermissions(SystemOperation.BottonResource.EXPORT)
@RequestMapping(value = BaseURL.EXPORT, method = RequestMethod.POST)
@ResponseBody
public void export(HttpServletRequest request,HttpServletResponse response, @RequestBody JSONObject param) throws Exception {
BommxCondition condition = DataConvert.getCondition(param, BommxCondition.class);
RecordSet<BommxVO> records = bommxService.query(condition);
doExport(request, response, param, records.getRecords());
}
}
package com.gavel.jcsj.controller;
import com.gavel.common.BaseURL;
import com.gavel.common.base.BaseEditJSON;
import com.gavel.common.base.controller.BaseController;
import com.gavel.common.converter.DataConvert;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.ResponseBody;
import com.gavel.persistence.sql.RecordSet;
import com.gavel.common.annotation.ResourcePermissions;
import com.gavel.common.SystemOperation;
import com.alibaba.fastjson.JSONObject;
import com.gavel.common.utils.ThreadContext;
import com.gavel.jcsj.service.CjService;
import com.gavel.jcsj.vo.CjCondition;
import com.gavel.jcsj.vo.CjVO;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
@Controller
@RequestMapping("jcsj/cj")
public class CjController extends BaseController {
@Autowired
private CjService cjService;
@ResourcePermissions()
@RequestMapping("/index")
public String index() {
return "jcsj/cj/index";
}
@ResourcePermissions({SystemOperation.BottonResource.ADD})
@RequestMapping("/add")
public String add() {
return "jcsj/cj/edit";
}
@ResourcePermissions({SystemOperation.BottonResource.EDIT})
@RequestMapping("/edit")
public String edit() {
return "jcsj/cj/edit";
}
@RequestMapping(value = BaseURL.GET, method = RequestMethod.POST)
@ResponseBody
public Object get(@RequestBody JSONObject param) {
CjCondition condition = DataConvert.getCondition(param, CjCondition.class);
RecordSet<CjVO> records = cjService.query(condition);
if ( records.getRecords()!=null && records.getRecords().size()>=1 ){
return buildReturnData(CjVO.class, records.getRecords().get(0));
}
return buildReturnData(CjVO.class, null);
}
@RequestMapping(value = BaseURL.QUERY, method = RequestMethod.POST)
@ResponseBody
public Object query(@RequestBody JSONObject param) {
CjCondition condition = DataConvert.getCondition(param, CjCondition.class);
RecordSet<CjVO> records = cjService.query(condition);
return buildReturnData(records, CjVO.class);
}
@ResourcePermissions(SystemOperation.BottonResource.ADD)
@RequestMapping(value = BaseURL.ADD, method = RequestMethod.POST)
@ResponseBody
public Object insert(@RequestBody JSONObject param) {
BaseEditJSON editJson = BaseEditJSON.parseJSON(param);
cjService.insert(editJson);
return ThreadContext.getReturnData();
}
@ResourcePermissions(SystemOperation.BottonResource.EDIT)
@RequestMapping(value = BaseURL.UPDATE, method = RequestMethod.POST)
@ResponseBody
public Object update(@RequestBody JSONObject param) {
BaseEditJSON editJson = BaseEditJSON.parseJSON(param);
cjService.update(editJson);
return ThreadContext.getReturnData();
}
@ResourcePermissions(SystemOperation.BottonResource.DELETE)
@RequestMapping(value = BaseURL.DELETE, method = RequestMethod.POST)
@ResponseBody
public Object delete(@RequestBody JSONObject param) {
BaseEditJSON editJson = BaseEditJSON.parseJSON(param);
cjService.delete(editJson);
return ThreadContext.getReturnData();
}
@ResourcePermissions(SystemOperation.BottonResource.EXPORT)
@RequestMapping(value = BaseURL.EXPORT, method = RequestMethod.POST)
@ResponseBody
public void export(HttpServletRequest request,HttpServletResponse response, @RequestBody JSONObject param) throws Exception {
CjCondition condition = DataConvert.getCondition(param, CjCondition.class);
RecordSet<CjVO> records = cjService.query(condition);
doExport(request, response, param, records.getRecords());
}
}
package com.gavel.jcsj.controller;
import com.gavel.common.BaseURL;
import com.gavel.common.base.BaseEditJSON;
import com.gavel.common.base.controller.BaseController;
import com.gavel.common.converter.DataConvert;
import com.gavel.jcsj.persistent.Ck;
import com.gavel.jcsj.utils.CkflEnum;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.ResponseBody;
import com.gavel.persistence.sql.RecordSet;
import com.gavel.common.annotation.ResourcePermissions;
import com.gavel.common.SystemOperation;
import com.alibaba.fastjson.JSONObject;
import com.gavel.common.utils.ThreadContext;
import com.gavel.jcsj.service.CkService;
import com.gavel.jcsj.vo.CkCondition;
import com.gavel.jcsj.vo.CkVO;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import java.util.List;
@Controller
@RequestMapping("jcsj/ck")
public class CkController extends BaseController {
@Autowired
private CkService ckService;
@ResourcePermissions()
@RequestMapping("/index")
public String index() {
return "jcsj/ck/index";
}
@ResourcePermissions({SystemOperation.BottonResource.ADD})
@RequestMapping("/add")
public String add() {
return "jcsj/ck/edit";
}
@ResourcePermissions({SystemOperation.BottonResource.EDIT})
@RequestMapping("/edit")
public String edit() {
return "jcsj/ck/edit";
}
@RequestMapping(value = BaseURL.GET, method = RequestMethod.POST)
@ResponseBody
public Object get(@RequestBody JSONObject param) {
CkCondition condition = DataConvert.getCondition(param, CkCondition.class);
RecordSet<CkVO> records = ckService.query(condition);
if ( records.getRecords()!=null && records.getRecords().size()>=1 ){
return buildReturnData(CkVO.class, records.getRecords().get(0));
}
return buildReturnData(CkVO.class, null);
}
@RequestMapping(value = BaseURL.QUERY, method = RequestMethod.POST)
@ResponseBody
public Object query(@RequestBody JSONObject param) {
CkCondition condition = DataConvert.getCondition(param, CkCondition.class);
RecordSet<CkVO> records = ckService.query(condition);
return buildReturnData(records, CkVO.class);
}
@ResourcePermissions(SystemOperation.BottonResource.ADD)
@RequestMapping(value = BaseURL.ADD, method = RequestMethod.POST)
@ResponseBody
public Object insert(@RequestBody JSONObject param) {
BaseEditJSON editJson = BaseEditJSON.parseJSON(param);
ckService.insert(editJson);
return ThreadContext.getReturnData();
}
@ResourcePermissions(SystemOperation.BottonResource.EDIT)
@RequestMapping(value = BaseURL.UPDATE, method = RequestMethod.POST)
@ResponseBody
public Object update(@RequestBody JSONObject param) {
BaseEditJSON editJson = BaseEditJSON.parseJSON(param);
ckService.update(editJson);
return ThreadContext.getReturnData();
}
@ResourcePermissions(SystemOperation.BottonResource.EDIT)
@RequestMapping(value = BaseURL.SETQT, method = RequestMethod.POST)
@ResponseBody
public Object recordSetQT(@RequestBody JSONObject param) {
ckService.recordSetQT(DataConvert.getData(param, Ck.class));
return ThreadContext.getReturnData();
}
@ResourcePermissions(SystemOperation.BottonResource.DELETE)
@RequestMapping(value = BaseURL.DELETE, method = RequestMethod.POST)
@ResponseBody
public Object delete(@RequestBody JSONObject param) {
BaseEditJSON editJson = BaseEditJSON.parseJSON(param);
ckService.delete(editJson);
return ThreadContext.getReturnData();
}
@ResourcePermissions(SystemOperation.BottonResource.EXPORT)
@RequestMapping(value = BaseURL.EXPORT, method = RequestMethod.POST)
@ResponseBody
public void export(HttpServletRequest request,HttpServletResponse response, @RequestBody JSONObject param) throws Exception {
CkCondition condition = DataConvert.getCondition(param, CkCondition.class);
RecordSet<CkVO> records = ckService.query(condition);
doExport(request, response, param, records.getRecords());
}
@RequestMapping(value = "init/getKwglCk", method = RequestMethod.POST)
@ResponseBody
public Object getKwglCk(@RequestBody JSONObject param) {
List<CkVO> records = ckService.getKwglCk();
return buildReturnData(records, CkVO.class);
}
@RequestMapping(value = "/init/ckfl", method = RequestMethod.POST)
@ResponseBody
public Object intiCkfl(@RequestBody JSONObject param) {
return buildReturnData(CkflEnum.toList());
}
/**
* 仓库数据同步, 从 RCS 系统中同步数据
* @param param
* @return
*/
@RequestMapping(value = "sync", method = RequestMethod.POST)
@ResponseBody
public Object sync(@RequestBody JSONObject param) {
try {
ckService.sync();
} catch (Exception e) {
ThreadContext.getReturnData().setSuccess(false);
ThreadContext.getReturnData().setMessage(e.getMessage());
}
return ThreadContext.getReturnData();
}
}
package com.gavel.jcsj.controller;
import com.alibaba.fastjson.JSONObject;
import com.gavel.common.base.controller.BaseController;
import com.gavel.common.converter.DataConvert;
import com.gavel.jcsj.persistent.Wlfl;
import com.gavel.jcsj.service.JcsjService;
import com.gavel.jcsj.vo.CkVO;
import com.gavel.jcsj.vo.WlflVO;
import com.gavel.kzzx.utils.TybzEnum;
import com.gavel.kzzx.vo.BmCondition;
import com.gavel.kzzx.vo.BmVO;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.ResponseBody;
import java.util.List;
@Controller
@RequestMapping("jcsj/common")
public class JcsjController extends BaseController {
@Autowired
private JcsjService jcsjService;
/**
* 查询所有仓库
* @param param
* @return
*/
@RequestMapping(value ="ck/query", method = RequestMethod.POST)
@ResponseBody
public Object queryAllCk(@RequestBody JSONObject param) {
List<CkVO> ckVOList = jcsjService.queryValidCk();
return buildReturnData(ckVOList, CkVO.class);
}
//用户可操作的仓库
@RequestMapping(value ="ck/queryCkid", method = RequestMethod.POST)
@ResponseBody
public Object queryAuthCk(@RequestBody JSONObject param) {
List<CkVO> ckVOList = jcsjService.queryAuthCk();
return buildReturnData(ckVOList, CkVO.class);
}
/**
* 查询所有部门
* @param param
* @return
*/
@RequestMapping(value ="bm/query", method = RequestMethod.POST)
@ResponseBody
public Object query(@RequestBody JSONObject param) {
BmCondition bmCondition = DataConvert.getCondition(param,BmCondition.class);
List<BmVO> bmVOList = jcsjService.query(bmCondition);
return buildReturnData(bmVOList, BmVO.class);
}
@RequestMapping(value ="tybz/query", method = RequestMethod.POST)
@ResponseBody
public Object booleanQuery() {
return buildReturnData(TybzEnum.toList());
}
/**
* 查询所有物料分类
* @return
*/
@RequestMapping(value ="wlfl/query", method = RequestMethod.POST)
@ResponseBody
public Object wlflQuery() {
List<Wlfl> list = jcsjService.queryWlfl();
return buildReturnData(list, Wlfl.class);
}
/**
* 查询所有物料分类
* @return
*/
@RequestMapping(value ="wlfl/queryAll", method = RequestMethod.POST)
@ResponseBody
public Object wlflQueryAll() {
List<WlflVO> list = jcsjService.queryAllWlfl();
return buildReturnData(list, WlflVO.class);
}
}
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment