Commit c07b8ca8 authored by Administrator's avatar Administrator

上传更新任务单信息

查询任务单
生成任务单
parent 44f822c3
package com.yxproject.start.api; package com.yxproject.start.api;
import com.yxproject.start.entity.ProductionTaskListEntity;
import com.yxproject.start.entity.SysPermission; import com.yxproject.start.entity.SysPermission;
import com.yxproject.start.entity.SysRole; import com.yxproject.start.entity.SysRole;
import com.yxproject.start.entity.UserInfo; import com.yxproject.start.entity.UserInfo;
import com.yxproject.start.service.ProductionTaskListService;
import com.yxproject.start.service.UtilService;
import com.yxproject.start.utils.YXJSONResponse;
import net.sf.json.JSONArray;
import net.sf.json.JSONObject;
import net.sf.json.JSONString;
import org.apache.shiro.SecurityUtils; import org.apache.shiro.SecurityUtils;
import org.apache.shiro.authc.IncorrectCredentialsException; import org.apache.shiro.authc.IncorrectCredentialsException;
import org.apache.shiro.authc.UnknownAccountException; import org.apache.shiro.authc.UnknownAccountException;
import org.apache.shiro.authz.annotation.RequiresPermissions; import org.apache.shiro.authz.annotation.RequiresPermissions;
import org.apache.shiro.subject.Subject; import org.apache.shiro.subject.Subject;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller; import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping; import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.ResponseBody;
import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import javax.ws.rs.core.Context;
import java.text.SimpleDateFormat;
import java.util.Date;
import java.util.HashMap;
import java.util.List;
import java.util.Map; import java.util.Map;
/** /**
* @author Administrator * @author Administrator
*/ */
@Controller @Controller
public class ShiroApi { public class ShiroApi {
@Autowired
private ProductionTaskListService productionTaskListService;
@Autowired
private UtilService utilService;
@RequestMapping(value={"/","/index"}) @RequestMapping(value={"/","/index"})
public String index(Map<String,Object> map){ public String index(Map<String,Object> map){
...@@ -108,4 +130,61 @@ public class ShiroApi { ...@@ -108,4 +130,61 @@ public class ShiroApi {
public String userDel(){ public String userDel(){
return "userInfoDel"; return "userInfoDel";
} }
/**
* 查询任务单;
* @return
*/
@RequestMapping(value = "/getProductionTaskListByID",method = RequestMethod.GET)
@RequiresPermissions("userInfo.del")//权限管理;
@ResponseBody
public String getProductionTaskListByID(@RequestParam("id") String id,@Context HttpServletResponse resp){
List<ProductionTaskListEntity> productionTaskListEntity = productionTaskListService.findProductionTaskListEntityByID(id);
YXJSONResponse yxjsonResponse = new YXJSONResponse();
resp.setCharacterEncoding("UTF-8");
yxjsonResponse.outPutSuccess(productionTaskListEntity);
Map map = new HashMap();
// map.put("MakeType",productionTaskListEntity);
return yxjsonResponse.toJSONString();
}
/**
* 更新任务单;
* @return
*/
@RequestMapping(value = "/updateProductionTask",method = RequestMethod.GET)
@RequiresPermissions("userInfo.add")//权限管理;
@ResponseBody
public String updateProductionTask(@RequestParam("id") String id,@Context HttpServletResponse resp){
String map ="{\"productionTaskListId\":\"20181016001\",\"makeType\":4,\"oldMakeType\":7}";
JSONObject jsonObject = JSONObject.fromObject(map);
ProductionTaskListEntity productionTaskListEntity = (ProductionTaskListEntity)jsonObject.toBean(jsonObject, ProductionTaskListEntity.class);
YXJSONResponse yxjsonResponse = new YXJSONResponse();
resp.setCharacterEncoding("UTF-8");
int i = productionTaskListService.updateProductionTask(productionTaskListEntity);
yxjsonResponse.outPutSuccess(i+"更新成功");
return yxjsonResponse.toJSONString();
}
/**
* 生成任务单;
* @return
*/
@RequestMapping(value = "/addProductionTaskList",method = RequestMethod.GET)
@RequiresPermissions("userInfo.add")//权限管理;
@ResponseBody
public String addProductionTaskList(@RequestParam("id") String id,@Context HttpServletResponse resp){
String map ="{\"productionTaskListId\":\"20181016001\",\"makeType\":4,\"oldMakeType\":7}";
JSONObject jsonObject = JSONObject.fromObject(map);
ProductionTaskListEntity productionTaskListEntity = (ProductionTaskListEntity)jsonObject.toBean(jsonObject, ProductionTaskListEntity.class);
int production_task_list_seq = utilService.findProductionTaskListSequenceNextValue();
SimpleDateFormat simpleDateFormat = new SimpleDateFormat("yyyymmdd");
productionTaskListEntity.setProductionTaskListId(simpleDateFormat.format(new Date())+production_task_list_seq);
YXJSONResponse yxjsonResponse = new YXJSONResponse();
resp.setCharacterEncoding("UTF-8");
int i = productionTaskListService.addProductionTaskListEntity(productionTaskListEntity);
yxjsonResponse.outPutSuccess(i+"更新成功");
return yxjsonResponse.toJSONString();
}
} }
...@@ -154,6 +154,7 @@ public class UserInfoApi { ...@@ -154,6 +154,7 @@ public class UserInfoApi {
Map<String,String> map = new HashMap<>(); Map<String,String> map = new HashMap<>();
boolean flag = false; boolean flag = false;
flag = sysRoleService.addRole(sysRole); flag = sysRoleService.addRole(sysRole);
System.out.println(sysRole.getId());
if (flag){ if (flag){
map.put("resultMsg","添加成功"); map.put("resultMsg","添加成功");
...@@ -165,15 +166,7 @@ public class UserInfoApi { ...@@ -165,15 +166,7 @@ public class UserInfoApi {
} }
/**
* 查询任务单;
* @return
*/
@RequestMapping("/getProductionTaskListByID")
// @RequiresPermissions("userInfo.del")//权限管理;
public String getProductionTaskListByID(){
return productionTaskListService.findProductionTaskListEntityByID("20181016001").toString();
}
} }
...@@ -10,6 +10,7 @@ public class ProductionTaskListEntity { ...@@ -10,6 +10,7 @@ public class ProductionTaskListEntity {
private long makeType; private long makeType;
private Long oldMakeType; private Long oldMakeType;
private String workshop; private String workshop;
private String citycode;
private String submitDate; private String submitDate;
private String handoutDate; private String handoutDate;
private Long isPrint; private Long isPrint;
...@@ -52,6 +53,16 @@ public class ProductionTaskListEntity { ...@@ -52,6 +53,16 @@ public class ProductionTaskListEntity {
public void setOldMakeType(Long oldMakeType) { public void setOldMakeType(Long oldMakeType) {
this.oldMakeType = oldMakeType; this.oldMakeType = oldMakeType;
} }
@Basic
@Column(name = "CITYCODE",nullable = true, length = 8)
public String getCitycode() {
return citycode;
}
public void setCitycode(String citycode) {
this.citycode = citycode;
}
@Basic @Basic
@Column(name = "WORKSHOP", nullable = true, length = 2) @Column(name = "WORKSHOP", nullable = true, length = 2)
...@@ -191,6 +202,7 @@ public class ProductionTaskListEntity { ...@@ -191,6 +202,7 @@ public class ProductionTaskListEntity {
return makeType == that.makeType && return makeType == that.makeType &&
Objects.equals(productionTaskListId, that.productionTaskListId) && Objects.equals(productionTaskListId, that.productionTaskListId) &&
Objects.equals(oldMakeType, that.oldMakeType) && Objects.equals(oldMakeType, that.oldMakeType) &&
Objects.equals(citycode, that.citycode) &&
Objects.equals(workshop, that.workshop) && Objects.equals(workshop, that.workshop) &&
Objects.equals(submitDate, that.submitDate) && Objects.equals(submitDate, that.submitDate) &&
Objects.equals(handoutDate, that.handoutDate) && Objects.equals(handoutDate, that.handoutDate) &&
...@@ -208,6 +220,6 @@ public class ProductionTaskListEntity { ...@@ -208,6 +220,6 @@ public class ProductionTaskListEntity {
@Override @Override
public int hashCode() { public int hashCode() {
return Objects.hash(productionTaskListId, makeType, oldMakeType, workshop, submitDate, handoutDate, isPrint, downloadDate, printOut, permanentPositionDate, rollOutWorkshopDate, qualityinspectionName, qualityinspectionDate, exceptionInformation, outboundDate, putinstorageDate); return Objects.hash(productionTaskListId, makeType, oldMakeType, citycode,workshop, submitDate, handoutDate, isPrint, downloadDate, printOut, permanentPositionDate, rollOutWorkshopDate, qualityinspectionName, qualityinspectionDate, exceptionInformation, outboundDate, putinstorageDate);
} }
} }
<?xml version="1.0" encoding="UTF-8"?>
<entity-mappings xmlns="http://java.sun.com/xml/ns/persistence/orm"
version="2.0">
<entity class="com.yxproject.start.entity.ProductionTaskListEntity">
<table name="PRODUCTION_TASK_LIST" schema="DAHAI" catalog=""/>
<attributes>
<id name="productionTaskListId">
<column name="PRODUCTION_TASK_LIST_ID" length="20"/>
</id>
<basic name="makeType">
<column name="MAKE_TYPE" precision="2147483646"/>
</basic>
<basic name="oldMakeType">
<column name="OLD_MAKE_TYPE" nullable="false" precision="2147483646"/>
</basic>
<basic name="workshop">
<column name="WORKSHOP" nullable="false" length="2"/>
</basic>
<basic name="submitDate">
<column name="SUBMIT_DATE" nullable="false" length="8"/>
</basic>
<basic name="handoutDate">
<column name="HANDOUT_DATE" nullable="false" length="8"/>
</basic>
<basic name="isPrint">
<column name="IS_PRINT" nullable="false" precision="2147483646"/>
</basic>
<basic name="downloadDate">
<column name="DOWNLOAD_DATE" nullable="false" length="8"/>
</basic>
<basic name="printOut">
<column name="PRINT_OUT" nullable="false" length="8"/>
</basic>
<basic name="permanentPositionDate">
<column name="PERMANENT_POSITION_DATE" nullable="false" length="8"/>
</basic>
<basic name="rollOutWorkshopDate">
<column name="ROLL_OUT_WORKSHOP_DATE" nullable="false" length="8"/>
</basic>
<basic name="qualityinspectionName">
<column name="QUALITYINSPECTION_NAME" nullable="false" length="20"/>
</basic>
<basic name="qualityinspectionDate">
<column name="QUALITYINSPECTION_DATE" nullable="false" length="8"/>
</basic>
<basic name="exceptionInformation">
<column name="EXCEPTION_INFORMATION" nullable="false" length="120"/>
</basic>
<basic name="outboundDate">
<column name="OUTBOUND_DATE" nullable="false" length="8"/>
</basic>
<basic name="putinstorageDate">
<column name="PUTINSTORAGE_DATE" nullable="false" length="8"/>
</basic>
</attributes>
</entity>
</entity-mappings>
package com.yxproject.start.mapper; package com.yxproject.start.mapper;
import com.yxproject.start.entity.ProductionTaskListEntity; import com.yxproject.start.entity.ProductionTaskListEntity;
import net.sf.json.JSONArray;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Mapper; import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Select; import org.apache.ibatis.annotations.Select;
import org.springframework.stereotype.Repository; import org.springframework.data.repository.query.Param;
import java.util.List;
/** /**
* @author Administrator * @author Administratorid
*/ */
@Mapper @Mapper
@Repository
public interface ProductionTaskListMapper { public interface ProductionTaskListMapper {
@Select("select * from PRODUCTION_TASK_LIST where PRODUCTION_TASK_LIST_ID=#{productionTaskListId}") // @Select("select PRODUCTION_TASK_LIST_ID,MAKE_TYPE,CITYCODE from PRODUCTION_TASK_LIST where PRODUCTION_TASK_LIST_ID=#{id}")
public ProductionTaskListEntity findProductionTaskListEntity(String productionTaskListId); public List<ProductionTaskListEntity> findProductionTaskListEntity(String id);
// @Insert("Insert into DAHAI.PRODUCTION_TASK_LIST (PRODUCTION_TASK_LIST_ID,MAKE_TYPE,OLD_MAKE_TYPE,CITYCODE,WORKSHOP,SUBMIT_DATE,HANDOUT_DATE,IS_PRINT,DOWNLOAD_DATE,PRINT_OUT,PERMANENT_POSITION_DATE,ROLL_OUT_WORKSHOP_DATE,QUALITYINSPECTION_NAME,QUALITYINSPECTION_DATE,EXCEPTION_INFORMATION,OUTBOUND_DATE,PUTINSTORAGE_DATE) values ('20181016004',0,null,'410100',null,'20181016',null,null,null,null,null,null,null,null,null,null,null) ")
public int insertProductionTaskListEntity(ProductionTaskListEntity productionTaskListEntity);
public int findProductionTaskSeqNexvalue();
public int updateProductionTask(ProductionTaskListEntity productionTaskListEntity);
} }
...@@ -17,7 +17,7 @@ public interface SysPermissionMapper { ...@@ -17,7 +17,7 @@ public interface SysPermissionMapper {
* 新增权限 * 新增权限
* @param sysPermission * @param sysPermission
*/ */
@Insert("INSERT INTO sys_permission (id,available,name,parent_id,parent_ids,permission,resource_type,url)\n" + // @Insert("INSERT INTO sys_permission (id,available,name,parent_id,parent_ids,permission,resource_type,url)\n" +
"VALUES (PERMISSION_seq.nextval,0,#{name},#{parentId},#{parentIds},#{permission},#{resourceType},#{url})") // "VALUES (PERMISSION_seq.nextval,0,#{name},#{parentId},#{parentIds},#{permission},#{resourceType},#{url})")
public void addPermissionByMap(SysPermission sysPermission); public void addPermissionByMap(SysPermission sysPermission);
} }
...@@ -14,7 +14,7 @@ public interface SysRoleMapper { ...@@ -14,7 +14,7 @@ public interface SysRoleMapper {
* 添加角色 * 添加角色
* @param sysRole * @param sysRole
*/ */
@Insert({"INSERT INTO DAHAI.SYS_ROLE(ID,AVAILABLE,DESCRIPTION,ROLE)\n" + // @Insert({"INSERT INTO DAHAI.SYS_ROLE(ID,AVAILABLE,DESCRIPTION,ROLE)\n" +
"VALUES(PERMISSION_seq.nextval,0,#{description},#{role})"}) // "VALUES(PERMISSION_seq.nextval,0,#{description},#{role})"})
public void addRoleByMap(SysRole sysRole); public void addRoleByMap(SysRole sysRole);
} }
...@@ -13,9 +13,10 @@ public interface UserInfoMapper { ...@@ -13,9 +13,10 @@ public interface UserInfoMapper {
* 新增用户 * 新增用户
* @param userinfo * @param userinfo
*/ */
@Insert("INSERT INTO DAHAI.USER_INFO(ID, NAME, PASSWORD, STATE, USERNAME, SALT) " + // @Insert("INSERT INTO DAHAI.USER_INFO(ID, NAME, PASSWORD, STATE, USERNAME, SALT) " +
"VALUES(USER_INFO_seq.nextval,#{name},#{password},0,#{username},#{salt})\n") // "VALUES(USER_INFO_seq.nextval,#{name},#{password},0,#{username},#{salt})\n")
public void saveUserInfo(UserInfo userinfo); public void saveUserInfo(UserInfo userinfo);
// public int delUserInfo(int userInfoID); // public int delUserInfo(int userInfoID);
// public int updateUserInfo(UserInfo userInfo); // public int updateUserInfo(UserInfo userInfo);
public UserInfo findUserByUsername(String userName);
} }
package com.yxproject.start.mapper;
import com.yxproject.start.entity.UserInfo;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
/**
* @author zhangyusheng
*/
@Mapper
public interface UtilMapper {
/**
* 查询任务单序列值
*/
public int findProductionTaskListSequenceNextValue();
}
package com.yxproject.start.mapper2;
import com.yxproject.start.entity.UserInfo;
import org.apache.ibatis.annotations.Mapper;
import org.springframework.data.repository.CrudRepository;
import org.springframework.stereotype.Repository;
/**
* @author Administrator
*/
@Mapper
@Repository
public interface UserInfoMapper2 extends CrudRepository<UserInfo,Long> {
public UserInfo findUserByUsername(String username);
// public int addUserInfo(UserInfo userInfo);
// public int delUserInfo(int userInfoID);
// public int updateUserInfo(UserInfo userInfo);
}
...@@ -3,9 +3,13 @@ package com.yxproject.start.service; ...@@ -3,9 +3,13 @@ package com.yxproject.start.service;
import com.yxproject.start.entity.ProductionTaskListEntity; import com.yxproject.start.entity.ProductionTaskListEntity;
import java.util.List;
public interface ProductionTaskListService { public interface ProductionTaskListService {
public ProductionTaskListEntity findProductionTaskListEntityByID(String productionTaskListId); public List<ProductionTaskListEntity> findProductionTaskListEntityByID(String id);
public int updateProductionTask(ProductionTaskListEntity map);
public int addProductionTaskListEntity(ProductionTaskListEntity productionTaskListEntity);
} }
package com.yxproject.start.service;
public interface UtilService {
public int findProductionTaskListSequenceNextValue();
}
...@@ -3,9 +3,13 @@ package com.yxproject.start.service.impl; ...@@ -3,9 +3,13 @@ package com.yxproject.start.service.impl;
import com.yxproject.start.entity.ProductionTaskListEntity; import com.yxproject.start.entity.ProductionTaskListEntity;
import com.yxproject.start.mapper.ProductionTaskListMapper; import com.yxproject.start.mapper.ProductionTaskListMapper;
import com.yxproject.start.service.ProductionTaskListService; import com.yxproject.start.service.ProductionTaskListService;
import net.sf.json.JSONArray;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
import java.util.List;
import java.util.Map;
/** /**
* @author Administrator * @author Administrator
*/ */
...@@ -16,9 +20,19 @@ public class ProductionTaskListServiceImpl implements ProductionTaskListService ...@@ -16,9 +20,19 @@ public class ProductionTaskListServiceImpl implements ProductionTaskListService
public ProductionTaskListMapper productionTaskListMapper; public ProductionTaskListMapper productionTaskListMapper;
@Override @Override
public ProductionTaskListEntity findProductionTaskListEntityByID(String productionTaskListId) { public List<ProductionTaskListEntity> findProductionTaskListEntityByID(String id) {
return productionTaskListMapper.findProductionTaskListEntity(productionTaskListId); return productionTaskListMapper.findProductionTaskListEntity(id);
} }
@Override
public int updateProductionTask(ProductionTaskListEntity map) {
return productionTaskListMapper.updateProductionTask(map);
}
@Override
public int addProductionTaskListEntity(ProductionTaskListEntity productionTaskListEntity) {
return productionTaskListMapper.insertProductionTaskListEntity(productionTaskListEntity);
}
} }
package com.yxproject.start.service.impl;
import com.yxproject.start.entity.ProductionTaskListEntity;
import com.yxproject.start.mapper.ProductionTaskListMapper;
import com.yxproject.start.mapper.UtilMapper;
import com.yxproject.start.service.ProductionTaskListService;
import com.yxproject.start.service.UtilService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import java.util.List;
/**
* @author Administrator
*/
@Service
public class UtilServiceImpl implements UtilService {
@Autowired
public UtilMapper utilMapper;
@Override
public int findProductionTaskListSequenceNextValue() {
return utilMapper.findProductionTaskListSequenceNextValue();
}
}
package com.yxproject.start.utils;
import net.sf.json.JSON;
import net.sf.json.JSONArray;
import net.sf.json.JSONObject;
import org.omg.CORBA.Any;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
/**
* Created by yuzhanyang on 17/6/8.
*/
public class YXJSONResponse {
private long ServerProcessingDur = 0;
private long start_stamp;
private long ServerProcessingFinishStamp = 0;
public boolean Error = false;
public String ReturnCode = "PASS";
private String ReturnMsg = "PASS_DESC";
public JSON RespData = null;
/**
* 构造方法 设定返回值对象的开始时间戳
*/
public YXJSONResponse() {
this.start_stamp = System.currentTimeMillis();
}
/**
* 返回一个只有起止时间的空返回值对象
* @return 返回值对象
*/
public YXJSONResponse outPutSuccess() {
this.ServerProcessingFinishStamp = System.currentTimeMillis();
this.ServerProcessingDur = this.ServerProcessingFinishStamp - this.start_stamp;
this.Error = false;
return this;
}
/**
* 通过map设定返回JSON
* @param dataMap map类型的返回值
* @return 返回值对象
*/
public YXJSONResponse outPutSuccess(Map dataMap) {
this.ServerProcessingFinishStamp = System.currentTimeMillis();
this.ServerProcessingDur = this.ServerProcessingFinishStamp - this.start_stamp;
this.Error = false;
this.RespData = JSONObject.fromObject(dataMap);
return this;
}
/**
* 通过list设定返回JSON
* @param dataList list类型的返回值
* @return 返回值对象
*/
public YXJSONResponse outPutSuccess(List dataList) {
this.ServerProcessingFinishStamp = System.currentTimeMillis();
this.ServerProcessingDur = this.ServerProcessingFinishStamp - this.start_stamp;
this.Error = false;
this.RespData = JSONArray.fromObject(dataList);
return this;
}
/**
* 通过json设定返回值
* @param json json类型的返回值
* @return 返回值对象
*/
public YXJSONResponse outPutSuccessJSON(JSON json) {
this.ServerProcessingFinishStamp = System.currentTimeMillis();
this.ServerProcessingDur = this.ServerProcessingFinishStamp - this.start_stamp;
this.Error = false;
this.RespData = json;
return this;
}
/**
* 通过String设定返回值
* @param string String类型的返回值
* @return 返回值对象
*/
public YXJSONResponse outPutSuccess(String string) {
this.ServerProcessingFinishStamp = System.currentTimeMillis();
this.ServerProcessingDur = this.ServerProcessingFinishStamp - this.start_stamp;
this.Error = false;
HashMap map = new HashMap<String, Any>();
map.put("string", string);
this.RespData = JSONObject.fromObject(map);
return this;
}
/**
* 设定出错返回值
* @param returnCode 错误码
* @param returnMsg 错误信息
* @return 返回值对象
*/
public YXJSONResponse outPutError(String returnCode, String returnMsg) {
this.ServerProcessingFinishStamp = System.currentTimeMillis();
this.ServerProcessingDur = this.ServerProcessingFinishStamp - this.start_stamp;
this.ReturnCode = returnCode;
this.ReturnMsg = returnMsg;
this.Error = true;
return this;
}
private JSONObject toJSON() {
HashMap map = new HashMap<String, Any>();
map.put("ServerProcessingDur", this.ServerProcessingDur);
map.put("ServerProcessingFinishStamp", this.ServerProcessingFinishStamp);
map.put("ReturnCode", this.ReturnCode);
map.put("ReturnMsg", this.ReturnMsg);
map.put("Error", this.Error);
map.put("respData", this.RespData);
return JSONObject.fromObject(map);
}
public String toJSONString() {
return this.toJSON().toString();
}
}
#spring集成Mybatis环境 #spring集成Mybatis环境
mybatis.type-aliases-package=com.yx_project.start.entity mybatis.type-aliases-package=com.yx_project.start.entity
#加载Mybatis配置文件 #加载Mybatis配置文件
#mybatis.mapper-locations = classpath:mapper/*Mapper.xml mybatis.mapper-locations = classpath:mapper/*Mapper.xml
#mybatis.config-location = classpath:mapper/config/mybatis-config.xml mybatis.config-location = classpath:mapper/config/mybatis-config.xml
#配置调度生产库数据库 #配置调度生产库数据库
spring.datasource.driver-class-name= oracle.jdbc.driver.OracleDriver spring.datasource.driver-class-name= oracle.jdbc.driver.OracleDriver
...@@ -37,7 +37,7 @@ spring.datasource.password = dahai ...@@ -37,7 +37,7 @@ spring.datasource.password = dahai
#spring.03.datasource.username = dahai #spring.03.datasource.username = dahai
#spring.03.datasource.password = dahai #spring.03.datasource.password = dahai
#自动根据实体类生成数据库表 #自动根据实体类生成数据库表
spring.jpa.hibernate.ddl-auto= update #spring.jpa.hibernate.ddl-auto= update
spring.jpa.show-sql=true spring.jpa.show-sql=true
##jsp 支持 ##jsp 支持
...@@ -51,16 +51,16 @@ spring.thymeleaf.mode=HTML ...@@ -51,16 +51,16 @@ spring.thymeleaf.mode=HTML
spring.thymeleaf.encoding=UTF-8 spring.thymeleaf.encoding=UTF-8
#the first datasource ## 多数据源配置
jdbc.driverClassName = oracle.jdbc.driver.OracleDriver #slave.datasource.names=test,test1
jdbc.url = jdbc:oracle:thin:@192.168.10.208:1521:GTYX #slave.datasource.test.driverClassName =oracle.jdbc.driver.OracleDriver
jdbc.username = dahai #slave.datasource.test.url=jdbc:oracle:thin:@192.168.10.208:1521:GTYX
jdbc.password = dahai #slave.datasource.test.username=dahai
#slave.datasource.test.password=dahai
#the second datasource ## test1
jdbc2.driverClassName = oracle.jdbc.driver.OracleDriver #slave.datasource.test1.driverClassName =oracle.jdbc.driver.OracleDriver
jdbc2.url = jdbc:oracle:thin:@192.168.10.208:1521:GTYX #slave.datasource.test1.url=jdbc:oracle:thin:@192.168.10.208:1521:GTYX
jdbc2.username = dahai #slave.datasource.test1.username=dahai
jdbc2.password = dahai #slave.datasource.test1.password=dahai
<!--<?xml version="1.0" encoding="UTF-8" ?>--> <?xml version="1.0" encoding="UTF-8" ?>
<!--<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd" >--> <!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd" >
<!--<mapper namespace="com.yxproject.start.mapper.ProductionTaskListMapper">--> <mapper namespace="com.yxproject.start.mapper.ProductionTaskListMapper">
<!--<resultMap id="ProductionTaskListMap" type="com.yxproject.start.entity.ProductionTaskListEntity">--> <resultMap id="ProductionTaskListMap" type="com.yxproject.start.entity.ProductionTaskListEntity">
<!--<id column="PRODUCTION_TASK_LIST_ID" property="productionTaskListId" />--> <id column="PRODUCTION_TASK_LIST_ID" property="productionTaskListId" jdbcType="VARCHAR"/>
<!--<result column="MAKE_TYPE" property="makeType"/>--> <result column="MAKE_TYPE" property="makeType" jdbcType="NUMERIC"/>
<!--<result column="OLD_MAKE_TYPE" property="oldMakeType"/>--> <result column="OLD_MAKE_TYPE" property="oldMakeType" jdbcType="NUMERIC"/>
<!--<result column="WORKSHOP" property="workshop"/>--> <result column="CITYCODE" property="citycode" jdbcType="VARCHAR"/>
<!--<result column="SUBMIT_DATE" property="submitDate"/>--> <result column="WORKSHOP" property="workshop" jdbcType="VARCHAR"/>
<!--<result column="HANDOUT_DATE" property="handoutDate"/>--> <result column="SUBMIT_DATE" property="submitDate" jdbcType="VARCHAR"/>
<!--<result column="IS_PRINT" property="isPrint"/>--> <result column="HANDOUT_DATE" property="handoutDate" jdbcType="VARCHAR"/>
<!--<result column="DOWNLOAD_DATE" property="downloadDate"/>--> <result column="IS_PRINT" property="isPrint" jdbcType="NUMERIC"/>
<!--<result column="PRINT_OUT" property="printOut"/>--> <result column="DOWNLOAD_DATE" property="downloadDate" jdbcType="VARCHAR"/>
<!--<result column="PERMANENT_POSITION_DATE" property="permanentPositionDate"/>--> <result column="PRINT_OUT" property="printOut" jdbcType="VARCHAR"/>
<!--<result column="ROLL_OUT_WORKSHOP_DATE" property="rollOutWorkshopDate"/>--> <result column="PERMANENT_POSITION_DATE" property="permanentPositionDate" jdbcType="VARCHAR"/>
<!--<result column="QUALITYINSPECTION_NAME" property="qualityinspectionName"/>--> <result column="ROLL_OUT_WORKSHOP_DATE" property="rollOutWorkshopDate" jdbcType="VARCHAR"/>
<!--<result column="QUALITYINSPECTION_DATE" property="qualityinspectionDate"/>--> <result column="QUALITYINSPECTION_NAME" property="qualityinspectionName" jdbcType="VARCHAR"/>
<!--<result column="EXCEPTION_INFORMATION" property="exceptionInformation"/>--> <result column="QUALITYINSPECTION_DATE" property="qualityinspectionDate" jdbcType="VARCHAR"/>
<!--<result column="OUTBOUND_DATE" property="outboundDate"/>--> <result column="EXCEPTION_INFORMATION" property="exceptionInformation" jdbcType="VARCHAR"/>
<!--<result column="PUTINSTORAGE_DATE" property="putinstorageDate"/>--> <result column="OUTBOUND_DATE" property="outboundDate" jdbcType="VARCHAR"/>
<result column="PUTINSTORAGE_DATE" property="putinstorageDate" jdbcType="VARCHAR"/>
<!--</resultMap>--> </resultMap>
<!--<select id="findProductionTaskListEntity" resultType="com.yxproject.start.entity.ProductionTaskListEntity" parameterType="String">--> <select id="findProductionTaskListEntity" resultType="com.yxproject.start.entity.ProductionTaskListEntity" parameterType="String">
<!--select * from PRODUCTION_TASK_LIST where PRODUCTION_TASK_LIST_ID=#{productionTaskListId}--> select PRODUCTION_TASK_LIST_ID,MAKE_TYPE,OLD_MAKE_TYPE,CITYCODE,WORKSHOP,SUBMIT_DATE,HANDOUT_DATE,IS_PRINT,DOWNLOAD_DATE,PRINT_OUT,PERMANENT_POSITION_DATE,ROLL_OUT_WORKSHOP_DATE,QUALITYINSPECTION_NAME,QUALITYINSPECTION_DATE,EXCEPTION_INFORMATION,OUTBOUND_DATE,PUTINSTORAGE_DATE from PRODUCTION_TASK_LIST where PRODUCTION_TASK_LIST_ID like #{id}
<!--</select>--> </select>
<!--</mapper>-->
\ No newline at end of file <insert id="insertProductionTaskListEntity" parameterType="com.yxproject.start.entity.ProductionTaskListEntity">
Insert into DAHAI.PRODUCTION_TASK_LIST (PRODUCTION_TASK_LIST_ID,MAKE_TYPE,OLD_MAKE_TYPE,CITYCODE,WORKSHOP,SUBMIT_DATE,HANDOUT_DATE,IS_PRINT,DOWNLOAD_DATE,PRINT_OUT,PERMANENT_POSITION_DATE,ROLL_OUT_WORKSHOP_DATE,QUALITYINSPECTION_NAME,QUALITYINSPECTION_DATE,EXCEPTION_INFORMATION,OUTBOUND_DATE,PUTINSTORAGE_DATE)
values (#{productionTaskListId}
<if test="makeType != null">,#{makeType}</if>
<if test="makeType == null">,null </if>
<if test="oldMakeType != null">,#{oldMakeType}</if>
<if test="oldMakeType == null">,null </if>
<if test="citycode != null">,#{citycode}</if>
<if test="citycode == null">,null </if>
<if test="workshop != null">,#{workshop}</if>
<if test="workshop == null">,null </if>
<if test="submitDate != null">,#{submitDate}</if>
<if test="submitDate == null">,null </if>
<if test="handoutDate != null">,#{handoutDate}</if>
<if test="handoutDate == null">,null </if>
<if test="isPrint != null">,#{isPrint}</if>
<if test="isPrint == null">,null </if>
<if test="downloadDate != null">,#{downloadDate}</if>
<if test="downloadDate == null">,null </if>
<if test="printOut != null">,#{printOut}</if>
<if test="printOut == null">,null </if>
<if test="permanentPositionDate != null">,#{permanentPositionDate}</if>
<if test="permanentPositionDate == null">,null </if>
<if test="rollOutWorkshopDate != null">,#{rollOutWorkshopDate}</if>
<if test="rollOutWorkshopDate == null">,null </if>
<if test="qualityinspectionName != null">,#{qualityinspectionName}</if>
<if test="qualityinspectionName == null">,null </if>
<if test="qualityinspectionDate != null">,#{qualityinspectionDate}</if>
<if test="qualityinspectionDate == null">,null </if>
<if test="exceptionInformation != null">,#{exceptionInformation}</if>
<if test="exceptionInformation == null">,null </if>
<if test="outboundDate != null">,#{outboundDate}</if>
<if test="outboundDate == null">,null </if>
<if test="putinstorageDate != null">,#{putinstorageDate}</if>
<if test="putinstorageDate == null">,null </if>)
</insert>
<update id="updateProductionTask" parameterType="com.yxproject.start.entity.ProductionTaskListEntity">
update DAHAI.PRODUCTION_TASK_LIST set PRODUCTION_TASK_LIST_ID=#{productionTaskListId}
<if test="oldMakeType != null">,OLD_MAKE_TYPE =#{oldMakeType}</if>
<if test="makeType != null">,MAKE_TYPE =#{makeType}</if>
<if test="citycode != null">,CITYCODE =#{citycode}</if>
<if test="workshop != null">,WORKSHOP =#{workshop}</if>
<if test="submitDate != null">,SUBMIT_DATE =#{submitDate}</if>
<if test="handoutDate != null">,HANDOUT_DATE =#{handoutDate}</if>
<if test="isPrint != null">,IS_PRINT =#{isPrint}</if>
<if test="downloadDate != null">,DOWNLOAD_DATE =#{downloadDate}</if>
<if test="printOut != null">,PRINT_OUT =#{printOut}</if>
<if test="permanentPositionDate != null">,PERMANENT_POSITION_DATE =#{permanentPositionDate}</if>
<if test="rollOutWorkshopDate != null">,ROLL_OUT_WORKSHOP_DATE =#{rollOutWorkshopDate}</if>
<if test="qualityinspectionName != null">,QUALITYINSPECTION_NAME =#{qualityinspectionName}</if>
<if test="qualityinspectionDate != null">,QUALITYINSPECTION_DATE =#{qualityinspectionDate}</if>
<if test="exceptionInformation != null">,EXCEPTION_INFORMATION =#{exceptionInformation}</if>
<if test="outboundDate != null">,OUTBOUND_DATE =#{outboundDate}</if>
<if test="putinstorageDate != null">,PUTINSTORAGE_DATE =#{putinstorageDate}</if>
where PRODUCTION_TASK_LIST_ID=#{productionTaskListId}
</update>
</mapper>
\ No newline at end of file
<!--<?xml version="1.0" encoding="UTF-8" ?>--> <?xml version="1.0" encoding="UTF-8" ?>
<!--<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd" >--> <!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd" >
<!--<mapper namespace="com.yxproject.start.mapper.SysPermissionMapper">--> <mapper namespace="com.yxproject.start.mapper.SysPermissionMapper">
<!--&lt;!&ndash;<resultMap id="PermissionMap" type="com.yxproject.start.entity.SysPermission">&ndash;&gt;--> <resultMap id="PermissionMap" type="com.yxproject.start.entity.SysPermission">
<!--&lt;!&ndash;<id column="id" property="id" />&ndash;&gt;--> <id column="id" property="id" />
<!--&lt;!&ndash;<result column="name" property="name"/>&ndash;&gt;--> <result column="name" property="name"/>
<!--&lt;!&ndash;<result column="resource_type" property="resourceType"/>&ndash;&gt;--> <result column="resource_type" property="resourceType"/>
<!--&lt;!&ndash;<result column="url" property="url"/>&ndash;&gt;--> <result column="url" property="url"/>
<!--&lt;!&ndash;<result column="permission" property="permission"/>&ndash;&gt;--> <result column="permission" property="permission"/>
<!--&lt;!&ndash;<result column="parent_id" property="parentId"/>&ndash;&gt;--> <result column="parent_id" property="parentId"/>
<!--&lt;!&ndash;<result column="parent_ids" property="parentIds"/>&ndash;&gt;--> <result column="parent_ids" property="parentIds"/>
<!--&lt;!&ndash;<result column="available" property="available"/>&ndash;&gt;--> <result column="available" property="available"/>
<!--&lt;!&ndash;</resultMap>&ndash;&gt;--> </resultMap>
<!--&lt;!&ndash;<insert id="addPermissionByMap" parameterType="com.yxproject.start.entity.SysPermission">&ndash;&gt;--> <insert id="addPermissionByMap" parameterType="com.yxproject.start.entity.SysPermission">
<!--&lt;!&ndash;Insert into DAHAI.SYS_PERMISSION (ID,AVAILABLE,NAME,PARENT_ID,PARENT_IDS,PERMISSION,RESOURCE_TYPE,URL) values (PERMISSION_seq.nextval,0,#{name},#{parentId},#{parentIds},#{permission},#{resourceType},#{url})&ndash;&gt;--> Insert into DAHAI.SYS_PERMISSION (ID,AVAILABLE,NAME,PARENT_ID,PARENT_IDS,PERMISSION,RESOURCE_TYPE,URL) values (PERMISSION_seq.nextval,0,#{name},#{parentId},#{parentIds},#{permission},#{resourceType},#{url})
<!--&lt;!&ndash;</insert>&ndash;&gt;--> </insert>
<!--</mapper>--> </mapper>
\ No newline at end of file \ No newline at end of file
<!--<?xml version="1.0" encoding="UTF-8" ?>--> <?xml version="1.0" encoding="UTF-8" ?>
<!--<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd" >--> <!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd" >
<!--<mapper namespace="com.yxproject.start.mapper.UserInfoMapper">--> <mapper namespace="com.yxproject.start.mapper.UserInfoMapper">
<!--&lt;!&ndash;&lt;!&ndash;用户&ndash;&gt;&ndash;&gt;--> <!--用户-->
<!--&lt;!&ndash;<resultMap id="UserRoleMenuMap" type="com.yxproject.start.entity.UserInfo">&ndash;&gt;--> <resultMap id="UserRoleMenuMap" type="com.yxproject.start.entity.UserInfo">
<!--&lt;!&ndash;<id property="uid" column="uid"/>&ndash;&gt;--> <id property="uid" column="uid"/>
<!--&lt;!&ndash;<result column="username" property="username"/>&ndash;&gt;--> <result column="username" property="username"/>
<!--&lt;!&ndash;<result column="password" property="password"/>&ndash;&gt;--> <result column="password" property="password"/>
<!--&lt;!&ndash;<result column="state" property="state"/>&ndash;&gt;--> <result column="state" property="state"/>
<!--&lt;!&ndash;<result column="name" property="name"/>&ndash;&gt;--> <result column="name" property="name"/>
<!--&lt;!&ndash;&lt;!&ndash;角色集合&ndash;&gt;&ndash;&gt;--> <!--角色集合-->
<!--&lt;!&ndash;<collection property="roleList" ofType="com.yxproject.start.entity.SysRole">&ndash;&gt;--> <collection property="roleList" ofType="com.yxproject.start.entity.SysRole">
<!--&lt;!&ndash;<id column="id" property="rid" />&ndash;&gt;--> <id column="id" property="rid" />
<!--&lt;!&ndash;<result column="description" property="description"/>&ndash;&gt;--> <result column="description" property="description"/>
<!--&lt;!&ndash;<result column="role" property="role"/>&ndash;&gt;--> <result column="role" property="role"/>
<!--&lt;!&ndash;&lt;!&ndash;权限集合&ndash;&gt;&ndash;&gt;--> <!--权限集合-->
<!--&lt;!&ndash;<collection property="permissions" ofType="com.yxproject.start.entity.SysPermission">&ndash;&gt;--> <collection property="permissions" ofType="com.yxproject.start.entity.SysPermission">
<!--&lt;!&ndash;<id column="id" property="pid" />&ndash;&gt;--> <id column="id" property="pid" />
<!--&lt;!&ndash;<result column="name" property="pname"/>&ndash;&gt;--> <result column="name" property="pname"/>
<!--&lt;!&ndash;<result column="url" property="url"/>&ndash;&gt;--> <result column="url" property="url"/>
<!--&lt;!&ndash;</collection>&ndash;&gt;--> </collection>
<!--&lt;!&ndash;</collection>&ndash;&gt;--> </collection>
<!--&lt;!&ndash;</resultMap>&ndash;&gt;--> </resultMap>
<!--&lt;!&ndash;<select id="findUserByUsername" resultMap="UserRoleMenuMap" parameterType="string">&ndash;&gt;--> <!--<select id="findUserByUsername" resultMap="UserRoleMenuMap" parameterType="string">-->
<!--&lt;!&ndash;select user_info.uid,user_info.username,user_info.password,user_info.name,sys_role.id as rid,sys_role.role,sys_role.description,&ndash;&gt;--> <!--select user_info.uid,user_info.username,user_info.password,user_info.name,sys_role.id as rid,sys_role.role,sys_role.description,-->
<!--&lt;!&ndash;sys_permission.id as pid,sys_permission.name as pname,sys_permission.url&ndash;&gt;--> <!--sys_permission.id as pid,sys_permission.name as pname,sys_permission.url-->
<!--&lt;!&ndash;from user_info&ndash;&gt;--> <!--from user_info-->
<!--&lt;!&ndash;left join sys_user_role on user_info.uid = sys_user_role.uid&ndash;&gt;--> <!--left join sys_user_role on user_info.uid = sys_user_role.uid-->
<!--&lt;!&ndash;left join sys_role on sys_user_role.role_id= sys_role.id&ndash;&gt;--> <!--left join sys_role on sys_user_role.role_id= sys_role.id-->
<!--&lt;!&ndash;left join sys_role_permission on sys_role.id = sys_role_permission.permission_id&ndash;&gt;--> <!--left join sys_role_permission on sys_role.id = sys_role_permission.permission_id-->
<!--&lt;!&ndash;left join sys_permission on sys_role_permission.permission_id = sys_permission.id&ndash;&gt;--> <!--left join sys_permission on sys_role_permission.permission_id = sys_permission.id-->
<!--&lt;!&ndash;where username=#{username}&ndash;&gt;--> <!--where username=#{username}-->
<!--&lt;!&ndash;</select>&ndash;&gt;--> <!--</select>-->
<!--&lt;!&ndash;<insert id = "addUserInfo" parameterType = "map" statementType = "PREPARED" keyProperty = "u_id" useGeneratedKeys = "true" >&ndash;&gt;--> <insert id = "addUserInfo" parameterType = "map" statementType = "PREPARED" keyProperty = "u_id" useGeneratedKeys = "true" >
<!--&lt;!&ndash;insert into USER_INFO (`u_id`,`username`,`name`,`password`,`salt`,`state`) VALUES (USER_INFO_seq.nextval, 'admin', '管理员', 'd3c59d25033dbf980d29554025c23a75', '8d78869f470951332959580424d4bf4f', 0)&ndash;&gt;--> insert into USER_INFO (`u_id`,`username`,`name`,`password`,`salt`,`state`) VALUES (USER_INFO_seq.nextval, 'admin', '管理员', 'd3c59d25033dbf980d29554025c23a75', '8d78869f470951332959580424d4bf4f', 0)
<!--&lt;!&ndash;</insert>&ndash;&gt;--> </insert>
<!--&lt;!&ndash;<update id = "delUserInfo" parameterType = "int" >&ndash;&gt;--> <update id = "delUserInfo" parameterType = "int" >
<!--&lt;!&ndash;update user_info set STATE = 1 where u_id =#{uId}&ndash;&gt;--> update user_info set STATE = 1 where u_id =#{uId}
<!--&lt;!&ndash;</update>&ndash;&gt;--> </update>
<!--&lt;!&ndash;<update id = "updateUserInfo" parameterType = "map" >&ndash;&gt;--> <update id = "updateUserInfo" parameterType = "map" >
<!--&lt;!&ndash;update user_info set username =#{username},name =#{name},password =#{password} where u_id =#{uId}&ndash;&gt;--> update user_info set username =#{username},name =#{name},password =#{password} where u_id =#{uId}
<!--&lt;!&ndash;</update>&ndash;&gt;--> </update>
<!--&lt;!&ndash;<select id="findUserByUsername" resultMap="UserRoleMenuMap" parameterType="string">&ndash;&gt;--> <!--<select id="findUserByUsername" resultMap="UserRoleMenuMap" parameterType="string">-->
<!--&lt;!&ndash;select user_info.uid,user_info.username,user_info.password,user_info.name,sys_role.id as rid,sys_role.role,sys_role.description,&ndash;&gt;--> <!--select user_info.uid,user_info.username,user_info.password,user_info.name,sys_role.id as rid,sys_role.role,sys_role.description,-->
<!--&lt;!&ndash;sys_permission.id as pid,sys_permission.name as pname,sys_permission.url&ndash;&gt;--> <!--sys_permission.id as pid,sys_permission.name as pname,sys_permission.url-->
<!--&lt;!&ndash;from user_info&ndash;&gt;--> <!--from user_info-->
<!--&lt;!&ndash;left join sys_user_role on user_info.uid = sys_user_role.uid&ndash;&gt;--> <!--left join sys_user_role on user_info.uid = sys_user_role.uid-->
<!--&lt;!&ndash;left join sys_role on sys_user_role.role_id= sys_role.id&ndash;&gt;--> <!--left join sys_role on sys_user_role.role_id= sys_role.id-->
<!--&lt;!&ndash;left join sys_role_permission on sys_role.id = sys_role_permission.permission_id&ndash;&gt;--> <!--left join sys_role_permission on sys_role.id = sys_role_permission.permission_id-->
<!--&lt;!&ndash;left join sys_permission on sys_role_permission.permission_id = sys_permission.id&ndash;&gt;--> <!--left join sys_permission on sys_role_permission.permission_id = sys_permission.id-->
<!--&lt;!&ndash;where username=#{username}&ndash;&gt;--> <!--where username=#{username}-->
<!--&lt;!&ndash;</select>&ndash;&gt;--> <!--</select>-->
<!--&lt;!&ndash;<select id="findUserByUsername" resultType="com.yxproject.start.entity.SystemUserEntity" parameterType="String">&ndash;&gt;--> <select id="findUserByUsername" resultType="com.yxproject.start.entity.UserInfo" parameterType="String">
<!--&lt;!&ndash;select * from "SYSTEM_USER" where username=#{username}&ndash;&gt;--> select * from "SYSTEM_USER" where username=#{username}
<!--&lt;!&ndash;</select>&ndash;&gt;--> </select>
<!--</mapper>--> </mapper>
\ No newline at end of file \ No newline at end of file
<?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd" >
<mapper namespace="com.yxproject.start.mapper.UtilMapper">
<select id="findProductionTaskListSequenceNextValue" resultType="int" >
select PRODUCTION_TASK_LIST_SEQ.nextval from dual
</select>
</mapper>
\ No newline at end of file
<ehcache>
<diskStore path="java.io.tmpdir"/>
<!-- name 缓存名称 -->
<!-- maxElementsInMemory 内存中最大缓存对象数,看着自己的heap大小来搞 -->
<!-- eternal:true表示对象永不过期,此时会忽略timeToIdleSeconds和timeToLiveSeconds属性,默认为false -->
<!-- maxElementsOnDisk:硬盘中最大缓存对象数,若是0表示无穷大 -->
<!-- overflowToDisk:true表示当内存缓存的对象数目达到了maxElementsInMemory界限后,
会把溢出的对象写到硬盘缓存中。注意:如果缓存的对象要写入到硬盘中的话,则该对象必须实现了Serializable接口才行。-->
<!-- diskSpoolBufferSizeMB:磁盘缓存区大小,默认为30MB。每个Cache都应该有自己的一个缓存区。-->
<!-- diskPersistent:是否缓存虚拟机重启期数据 -->
<!-- diskExpiryThreadIntervalSeconds:磁盘失效线程运行时间间隔,默认为120秒 -->
<!--timeToIdleSeconds:设置对象在失效前的允许闲置时间(单位:秒)。当对象自从最近一次被访问后,
如果处于空闲状态的时间超过了timeToIdleSeconds属性值,这个对象就会过期,
EHCache将把它从缓存中清空。仅当eternal=false对象不是永久有效时使用,可选属性,默认值是0,也就是可闲置时间无穷大。-->
<!--timeToLiveSeconds:设置对象在失效前允许存活时间(单位:秒)。最大时间介于创建时间和失效时间之间。
如果处于缓存中的时间超过了 timeToLiveSeconds属性值,这个对象就会过期,
EHCache将把它从缓存中清除。仅当eternal=false对象不是永久有效时使用,默认是0.,也就是对象存活时间无穷大。-->
<!-- clearOnFlush:内存数量最大时是否清除 -->
<!-- memoryStoreEvictionPolicy:当达到maxElementsInMemory限制时,
Ehcache将会根据指定的策略去清理内存。可选策略有:LRU(最近最少使用,默认策略)、
FIFO(先进先出)、LFU(最少访问次数)。-->
<defaultCache
maxElementsInMemory="10000"
timeToIdleSeconds="120"
timeToLiveSeconds="120"
maxElementsOnDisk="10000000"
diskExpiryThreadIntervalSeconds="120"
memoryStoreEvictionPolicy="LRU">
<!--<persistence strategy="localTempSwap"/>-->
</defaultCache>
<!-- 设定缓存的默认数据过期策略 -->
<cache name="shiro"
maxElementsInMemory="10000"
timeToIdleSeconds="120"
timeToLiveSeconds="120"
maxElementsOnDisk="10000000"
diskExpiryThreadIntervalSeconds="120"
memoryStoreEvictionPolicy="LRU">
<!-- <persistence strategy="localTempSwap"/>-->
</cache>
<!-- shiro-activeSessionCache活跃用户session缓存策略 -->
<cache name="shiro-activeSessionCache"
maxElementsInMemory="10000"
timeToIdleSeconds="86400"
timeToLiveSeconds="86400"
maxElementsOnDisk="10000000"
diskExpiryThreadIntervalSeconds="120"
memoryStoreEvictionPolicy="LRU">
<!-- <persistence strategy="localTempSwap"/>-->
</cache>
<!-- 登录记录缓存 锁定2分钟 -->
<cache name="passwordRetryCache"
maxEntriesLocalHeap="10000"
eternal="false"
timeToIdleSeconds="120"
timeToLiveSeconds="0"
overflowToDisk="false"
statistics="false">
</cache>
</ehcache>
<!--<?xml version="1.0" encoding="UTF-8"?>--> <?xml version="1.0" encoding="UTF-8"?>
<!--<!DOCTYPE configuration--> <!DOCTYPE configuration
<!--PUBLIC "-//mybatis.org//DTD Config 3.0//EN"--> PUBLIC "-//mybatis.org//DTD Config 3.0//EN"
<!--"http://mybatis.org/dtd/mybatis-3-config.dtd">--> "http://mybatis.org/dtd/mybatis-3-config.dtd">
<!--<configuration> --> <configuration>
<!---->
<!--</configuration>--> </configuration>
\ No newline at end of file \ No newline at end of file
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