Commit 06ebe087 by Lenovo

航线论证部门调整添加操作日志

1.如果删除后部门都已论证完毕,跳转到带论证总结;
2.修改数据库配置
parent 6e69e9a8
......@@ -57,7 +57,7 @@
<filter-class>com.ejweb.core.filter.BasicVerifyFilter</filter-class>
<init-param>
<param-name>excludedPages</param-name>
<param-value>/api/user/login</param-value>
<param-value>/api/user/login;/api/call/findPhoneInfo</param-value>
</init-param>
</filter>
<filter-mapping>
......
......@@ -3,9 +3,9 @@ db.table.prefix=foc_
jdbc.type=mysql
jdbc.driver.class=com.mysql.jdbc.Driver
jdbc.url=jdbc:mysql://106.75.97.50:3306/jd_foc?useUnicode=true&characterEncoding=utf-8&useSSL=true
jdbc.username=focuser
jdbc.password=FOC@2016
jdbc.url=jdbc:mysql://106.75.105.96:5508/jd_foc?useUnicode=true&characterEncoding=utf-8&zeroDateTimeBehavior=convertToNull
jdbc.username=sms_develop
jdbc.password=Develop2018!@#
#\u521d\u59cb\u5316\u8fde\u63a5
jdbc.initialSize=0
......
......@@ -37,6 +37,6 @@
<setting name="jdbcTypeForNull" value="NULL"/>
<!--打印sql-->
<setting name="logImpl" value="STDOUT_LOGGING"/>
<!--<setting name="logImpl" value="STDOUT_LOGGING"/>-->
</settings>
</configuration>
......@@ -79,7 +79,7 @@ public class SecurityPropertyPlaceholderConfigurer extends PropertyPlaceholderCo
public static void main(String[] args) {
System.out.println(DES3Utils.encrypt("foctest", CONF_DESC_KEY));
System.out.println(DES3Utils.decrypt("35824f37e331a42e669a52e248d88ffb6474030c906ec914", CONF_DESC_KEY));
System.out.println(DES3Utils.decrypt("6f2237c231b1464c6474030c906ec914", CONF_DESC_KEY));
System.out.println(DES3Utils.decrypt("fc76fa2b2e10b3d4450d564314a97766", CONF_DESC_KEY));
System.out.println(DES3Utils.decrypt("31a63fac8317458d81c034906825749f7c58c30a773c6927", CONF_DESC_KEY));
}
}
......@@ -112,7 +112,6 @@ public class BasicVerifyFilter implements Filter {
message = "无效请求";
BaseUserBean baseUserBean = JSON.parseObject(content, BaseUserBean.class);
String userSign = baseUserBean.getUserSign();
System.out.println("userSign:" + userSign);
if (userSign != null && !"".equals(userSign) && !"undefind".equals(userSign)) {
ServletContext context = request.getServletContext();
ApplicationContext ctx = WebApplicationContextUtils.getWebApplicationContext(context);
......@@ -136,7 +135,6 @@ public class BasicVerifyFilter implements Filter {
}
}
System.out.println("userSign为空或查不到用户");
request.setAttribute("message", message);
// 跳转到验证错误页面
request.getRequestDispatcher("/WEB-INF/views/errors/401.jsp").forward(request, response);
......@@ -156,7 +154,7 @@ public class BasicVerifyFilter implements Filter {
} else {
excludedPageArray = excludedPages.split(";");
for (int i = 0, len = excludedPageArray.length; i < len; i++) {
excludedPageSet.add(excludedPageArray[0]);
excludedPageSet.add(excludedPageArray[i]);
}
isExcludedPage = true;
}
......
......@@ -3,17 +3,17 @@
*/
package com.ejweb.core.util;
import org.apache.commons.lang3.time.DateFormatUtils;
import java.sql.Timestamp;
import java.text.SimpleDateFormat;
import java.util.Arrays;
import java.util.Calendar;
import java.util.Date;
import org.apache.commons.lang3.time.DateFormatUtils;
/**
* 时间计算工具类
*
*
* @author ThinkGem
* @version 2013-11-03
*/
......@@ -64,12 +64,12 @@ public class TimeUtils {
/**
* 各常量允许的最大值
*/
private final int[] maxFields = { 59, 59, 23, Integer.MAX_VALUE - 1 };
private final int[] maxFields = {59, 59, 23, Integer.MAX_VALUE - 1};
/**
* 各常量允许的最小值
*/
private final int[] minFields = { 0, 0, 0, Integer.MIN_VALUE };
private final int[] minFields = {0, 0, 0, Integer.MIN_VALUE};
/**
* 默认的字符串格式时间分隔符
......@@ -90,11 +90,9 @@ public class TimeUtils {
/**
* 使用时、分构造一个时间
*
* @param hour
* 小时
* @param minute
* 分钟
*
* @param hour 小时
* @param minute 分钟
*/
public TimeUtils(int hour, int minute) {
this(0, hour, minute, 0);
......@@ -102,13 +100,10 @@ public class TimeUtils {
/**
* 使用时、分、秒构造一个时间
*
* @param hour
* 小时
* @param minute
* 分钟
* @param second
* 秒
*
* @param hour 小时
* @param minute 分钟
* @param second 秒
*/
public TimeUtils(int hour, int minute, int second) {
this(0, hour, minute, second);
......@@ -117,9 +112,8 @@ public class TimeUtils {
/**
* 使用一个字符串构造时间<br/>
* Time time = new Time("14:22:23");
*
* @param time
* 字符串格式的时间,默认采用“:”作为分隔符
*
* @param time 字符串格式的时间,默认采用“:”作为分隔符
*/
public TimeUtils(String time) {
this(time, null);
......@@ -128,7 +122,7 @@ public class TimeUtils {
/**
* 使用时间毫秒构建时间
*
*
* @param time
*/
public TimeUtils(long time) {
......@@ -137,7 +131,7 @@ public class TimeUtils {
/**
* 使用日期对象构造时间
*
*
* @param date
*/
public TimeUtils(Date date) {
......@@ -146,15 +140,11 @@ public class TimeUtils {
/**
* 使用天、时、分、秒构造时间,进行全字符的构造
*
* @param day
* 天
* @param hour
* 时
* @param minute
* 分
* @param second
* 秒
*
* @param day 天
* @param hour 时
* @param minute 分
* @param second 秒
*/
public TimeUtils(int day, int hour, int minute, int second) {
initialize(day, hour, minute, second);
......@@ -163,9 +153,8 @@ public class TimeUtils {
/**
* 使用一个字符串构造时间,指定分隔符<br/>
* Time time = new Time("14-22-23", "-");
*
* @param time
* 字符串格式的时间
*
* @param time 字符串格式的时间
*/
public TimeUtils(String time, String timeSeparator) {
if (timeSeparator != null) {
......@@ -176,11 +165,9 @@ public class TimeUtils {
/**
* 设置时间字段的值
*
* @param field
* 时间字段常量
* @param value
* 时间字段的值
*
* @param field 时间字段常量
* @param value 时间字段的值
*/
public void set(int field, int value) {
if (value < minFields[field]) {
......@@ -197,9 +184,8 @@ public class TimeUtils {
/**
* 获得时间字段的值
*
* @param field
* 时间字段常量
*
* @param field 时间字段常量
* @return 该时间字段的值
*/
public int get(int field) {
......@@ -211,9 +197,8 @@ public class TimeUtils {
/**
* 将时间进行“加”运算,即加上一个时间
*
* @param time
* 需要加的时间
*
* @param time 需要加的时间
* @return 运算后的时间
*/
public TimeUtils addTime(TimeUtils time) {
......@@ -229,9 +214,8 @@ public class TimeUtils {
/**
* 将时间进行“减”运算,即减去一个时间
*
* @param time
* 需要减的时间
*
* @param time 需要减的时间
* @return 运算后的时间
*/
public TimeUtils subtractTime(TimeUtils time) {
......@@ -254,7 +238,7 @@ public class TimeUtils {
/**
* 获得时间字段的分隔符
*
*
* @return
*/
public String getTimeSeparator() {
......@@ -263,9 +247,8 @@ public class TimeUtils {
/**
* 设置时间字段的分隔符(用于字符串格式的时间)
*
* @param timeSeparator
* 分隔符字符串
*
* @param timeSeparator 分隔符字符串
*/
public void setTimeSeparator(String timeSeparator) {
this.timeSeparator = timeSeparator;
......@@ -318,15 +301,16 @@ public class TimeUtils {
time + ", time format error, HH" + this.timeSeparator + "mm" + this.timeSeparator + "ss");
}
/**
* 获取今天是星期几
* @author huhy
* @time 2016年11月24日
* @param dt
* @return
*/
/**
* 获取今天是星期几
*
* @param dt
* @return
* @author huhy
* @time 2016年11月24日
*/
public static String getWeekOfDate(Date dt) {
String[] weekDays = {"星期日","星期一", "星期二", "星期三", "星期四", "星期五", "星期六"};
String[] weekDays = {"星期日", "星期一", "星期二", "星期三", "星期四", "星期五", "星期六"};
Calendar cal = Calendar.getInstance();
cal.setTime(dt);
int w = cal.get(Calendar.DAY_OF_WEEK) - 1;
......@@ -337,11 +321,11 @@ public class TimeUtils {
/**
* 获取前后日期 i为正数 向后推迟i天,负数时向前提前i天
*
* @author huhy
* @time 2016年11月24日
*
* @param i
* @return
* @author huhy
* @time 2016年11月24日
*/
public static Date getdate(int i) {
Date dat = null;
......@@ -390,4 +374,14 @@ public class TimeUtils {
return true;
}
/**
* 获取当前时间
*
* @param formatType 转换格式,如:yyyy-MM-dd HH:mm:ss
* @return
*/
public static String getTime(String formatType) {
SimpleDateFormat format = new SimpleDateFormat(formatType);
return format.format(System.currentTimeMillis());
}
}
\ No newline at end of file
......@@ -6,6 +6,7 @@ import com.ejweb.core.exception.IlleagalRecordException;
import com.ejweb.core.exception.RecordNotExistException;
import com.ejweb.core.util.IdWorker;
import com.ejweb.core.util.PlanUtil;
import com.ejweb.core.util.TimeUtils;
import com.ejweb.core.util.VerifyEmailHandler;
import com.ejweb.modules.depart.dao.DepartDao;
import com.ejweb.modules.depart.entity.DepartEntity;
......@@ -593,6 +594,9 @@ public class RouteVerifyService extends BaseService<RouteVerifyDao> {
UserEntity entity = new UserEntity();
entity.setUsercode(bean.getUserCode());
User user = userdao.getUserByUserCode(entity);
//生成两个字符串构建变量,用于生成操作记录使用
StringBuilder departAdd = new StringBuilder();
StringBuilder departRemove = new StringBuilder();
if (airlineVerifyEntity != null) {
//如果isExist为1说明部门已经存在,不需要添加,如果为-1说明已经删除,需要删除
int isExist = 0;
......@@ -608,7 +612,7 @@ public class RouteVerifyService extends BaseService<RouteVerifyDao> {
}
//如果是新加的部门,就执行新增
if (isExist == 0) {
departAdd.append(verifyDeparts.get(i).getDepartName() + ",");
routeverifyEntity.setDeportId(verifyDeparts.get(i).getDepartId());
routeverifyEntity.setVerifStatus("00");
routeverifyEntity.setId(IdWorker.getNextId());
......@@ -621,10 +625,41 @@ public class RouteVerifyService extends BaseService<RouteVerifyDao> {
}
}
for (int j = 0; j < list.size(); j++) {
departRemove.append(list.get(j).getDepartName() + ",");
routeverifyEntity.setVerifyId(bean.getVerifId());
routeverifyEntity.setDeportId(list.get(j).getDepartId());
dao.deleteRouteverify(routeverifyEntity);
}
boolean add = StringUtils.isNotEmpty(departAdd);
boolean remove = StringUtils.isNotEmpty(departRemove);
//如果有添加或者删除部门,生成操作记录
if (add || remove) {
StringBuilder remark = new StringBuilder();
remark.append(TimeUtils.getTime("yyyy-MM-dd HH:mm:ss")).append("调整了论证部门 <br/>");
if (add) {
departAdd.insert(0, "【");
departAdd.deleteCharAt(departAdd.length() - 1).append("】");
remark.append("新增了").append(departAdd).append("<br/>");
}
if (remove) {
departRemove.insert(0, "【");
departRemove.deleteCharAt(departRemove.length() - 1).append("】");
remark.append("删除了").append(departRemove).append("<br/>");
}
RecordAddBean recordAddBean = new RecordAddBean();
recordAddBean.setId(IdWorker.getNextId());
recordAddBean.setUserCode(bean.getUserCode());
recordAddBean.setRecordType("05");
recordAddBean.setVerifId(bean.getVerifId());
recordAddBean.setRemarks(remark.toString());
recordDao.insert(recordAddBean);
}
RouteVerifyBean routeVerifyBean1 = new RouteVerifyBean();
routeVerifyBean1.setVerifId(bean.getVerifId());
// 判断是否进入论证总结阶段
insertAirlineConclusion(routeVerifyBean1, bean.getUserCode());
}
}
......
......@@ -206,6 +206,7 @@ public class AirlineVerifiedAddBean extends GenericBean {
public class Deport {
private String departId;
private String departName;
public String getDepartId() {
return departId;
......@@ -215,7 +216,13 @@ public class AirlineVerifiedAddBean extends GenericBean {
this.departId = departId;
}
public String getDepartName() {
return departName;
}
public void setDepartName(String departName) {
this.departName = departName;
}
}
public String getVerifNo() {
......
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