Commit 436a7c23 by java-李谡

修改条件评估论证bug

parent 5d944759
......@@ -29,7 +29,7 @@
</resultMap>
<sql id="Base_Column_List" >
id, verif_id, verify_status, report, form_id, form_text, depart_id, `condition`, create_by,
create_date, update_by, update_date, remarks, del_flag, is_verify, status, start_time,back_status,
create_date, update_by, update_date, remarks, del_flag, is_verify, status, start_time,end_time,back_status,
back_time,back_remarks,back_by,summary
</sql>
......@@ -110,10 +110,10 @@
<select id="findByVerifIdUserCode" resultMap="BaseResultMap">
SELECT
<include refid="Base_Column_List" />
<include refid="Base_Column_List"/>
FROM foc_route_verify frv
WHERE 1 = 1
<if test="verifId != null and verifId != ''" >
<if test="verifId != null and verifId != ''">
AND frv.verif_id = #{verifId}
</if>
AND frv.depart_id in (
......
......@@ -142,6 +142,7 @@
select id as conditionId,
`condition`,
review_type,
route_id,
is_feed as feedStatus
from foc_verify_condition
where id=#{conditionId}
......@@ -326,7 +327,7 @@
delete from foc_verify_condition
where id in
<foreach collection="list" item="item" index="index" open="(" close=")" separator=",">
${item}
#{item}
</foreach>
</delete>
......@@ -334,7 +335,7 @@
DELETE FROM foc_condition_feedback
WHERE condition_id in
<foreach collection="list" item="item" index="index" open="(" close=")" separator=",">
${item}
#{item}
</foreach>
</delete>
......
......@@ -320,7 +320,7 @@
AND a.verif_id = #{verifId}
AND f.depart_id = #{userDepartId}
AND a.depart_id= #{departId}
-- group by a.verif_id,f.depart_id
group by a.verif_id,a.depart_id
</when>
<otherwise>
WHERE
......
package com.ejweb.core.conf;
import java.io.File;
import java.io.InputStream;
import java.util.Enumeration;
import java.util.HashMap;
import java.util.Map;
import java.util.Properties;
import com.ejweb.core.security.DES3Utils;
import org.apache.commons.io.IOUtils;
import org.apache.log4j.Logger;
import org.springframework.core.io.DefaultResourceLoader;
import org.springframework.core.io.Resource;
import org.springframework.core.io.ResourceLoader;
import com.ejweb.core.security.DES3Utils;
import java.io.File;
import java.io.InputStream;
import java.util.Enumeration;
import java.util.HashMap;
import java.util.Map;
import java.util.Properties;
/**
* 全局常量表
* @author Administrator
*
* @author Administrator
*/
public class GConstants {
......@@ -33,8 +32,7 @@ public class GConstants {
public static final int BUFFER_SIZE = 8192;// 新建BYTE缓存大小,8*1024;
public static final String SEMICOLON = ";";// 分号
public static final String[] resources = new String[]{"mybatis-refresh.properties",
"jdbc.properties", "ejweb.properties"};// 越靠后越配置的值权限越高,即后面的同名变量会覆盖前面的变量
public static String[] resources = new String[]{"mybatis-refresh.properties", "jdbc.properties", "ejweb.properties"};// 越靠后越配置的值权限越高,即后面的同名变量会覆盖前面的变量
// 文件过滤,
public final static Map<String, Boolean> FILE_FILTERS = new HashMap<String, Boolean>(10);
private static final Properties P = new Properties();// 属性变
......@@ -67,7 +65,7 @@ public class GConstants {
public static final String FILE_UPLOAD_DIR = GConstants.getValue("file.upload.dir");// 文件上传地址
public static final String FILE_PREFIX_URL = GConstants.getValue("file.prefix.url");// 文件读取URL前缀
public static final String FILE_TMP_DIR = FILE_UPLOAD_DIR+"tmp";// 临时文件地址
public static final String FILE_TMP_DIR = FILE_UPLOAD_DIR + "tmp";// 临时文件地址
public static final String FILE_IMAGE_THUMBS = "thumbs";// 缩略图文件顶级路径名称 201605/thumbs/images/user/png/0d7ed36548c9ea6586363d4de5cb322c.png
public static final String FILE_IMAGE_ACTUALS = "actuals";// 原图文件顶级路径名称 201605/actuals/images/user/png/0d7ed36548c9ea6586363d4de5cb322c.png
public static final boolean FILE_ALLOW_THUMBS = GConstants.getBoolean("file.image.thumb.is.allow", true);
......@@ -77,7 +75,7 @@ public class GConstants {
public static final boolean IS_MOBILE_INTERCEPTOR = GConstants.getBoolean("is.mobile.interceptor", true);
public static final String DEFAULT_USER_ROLE_CODE = GConstants.getValue("default.user.role.code", "_USER");// 默认用户角色
// public static final String DEFAULT_USER_AVATAR = GConstants.getValue("user.default.avatar", "");// 默认用户角色
// public static final String DEFAULT_USER_AVATAR = GConstants.getValue("user.default.avatar", "");// 默认用户角色
public static final String DEFAULT_SEAT_PHOTO = GConstants.getValue("seat.default.photo", "");// 默认用户角色
public static final String DEFAULT_APP_CODE = GConstants.getValue("default.app.code", "00000");
......@@ -111,23 +109,23 @@ public class GConstants {
public static final int DEFAULT_PRE40_TIME = 40;
public static final String DEFAULT_SIGN_SEAT = "乘务调度席";
private GConstants(){
private GConstants() {
// 加载基本配置文件
// 加载基本配置文件
InputStream is = null;
ResourceLoader resourceLoader = null;
Resource resource = null;
for(String location:resources){// 加载配置文件
for (String location : resources) {// 加载配置文件
try {
resourceLoader = new DefaultResourceLoader();
resource = resourceLoader.getResource(location);
is = resource.getInputStream();
P.load(is);
LOG.debug("加载"+location+"成功");
LOG.debug("加载" + location + "成功");
} catch (Exception e) {
LOG.info("加载"+location+"失败", e);
LOG.info("加载" + location + "失败", e);
} finally {
IOUtils.closeQuietly(is);
}
......@@ -139,7 +137,7 @@ public class GConstants {
String key = (String) enu.nextElement();
String val = (String) P.get(key);
String decorded = DES3Utils.decrypt(val, CONF_DESC_KEY);
if(decorded != null){
if (decorded != null) {
P.put(key, decorded);
}
// if("is.devmode".equals(key) == false){// 测试模式不需要加密,正式才需要
......@@ -159,11 +157,11 @@ public class GConstants {
try {
// 上传文件扩展名称限制
String extensions = GConstants.getValue("file.allow.extensions");
if(extensions != null && extensions.contains(SEMICOLON)){
if(extensions.length() != 0){
if (extensions != null && extensions.contains(SEMICOLON)) {
if (extensions.length() != 0) {
String[] patternList = extensions.split(SEMICOLON);
for (String ext : patternList) {
if(ext.trim().length() != 0){
if (ext.trim().length() != 0) {
FILE_FILTERS.put(ext.trim().toLowerCase(), false);
}
}
......@@ -171,20 +169,20 @@ public class GConstants {
}
// 图片后缀文件
extensions = GConstants.getValue("file.image.extensions");
if(extensions != null && extensions.contains(SEMICOLON)){
if(extensions.length() != 0){
if (extensions != null && extensions.contains(SEMICOLON)) {
if (extensions.length() != 0) {
String[] patternList = extensions.split(SEMICOLON);
for (String ext : patternList) {
if(ext.trim().length() != 0){
if (ext.trim().length() != 0) {
FILE_FILTERS.put(ext.trim().toLowerCase(), true);
}
}
}
}
// 临时文件夹路径
if(P.getProperty("file.upload.dir") != null){
File tmp = new File(P.getProperty("file.upload.dir")+"tmp");
if(!tmp.exists())
if (P.getProperty("file.upload.dir") != null) {
File tmp = new File(P.getProperty("file.upload.dir") + "tmp");
if (!tmp.exists())
tmp.mkdirs();
}
} catch (Exception e) {
......@@ -195,32 +193,36 @@ public class GConstants {
/**
* 获取属性,以自定义属性优先,然后回去系统属性
*
* @param key
* @return
*/
public static String getValue(String key) {
if(key == null)
if (key == null)
return null;
if (P.containsKey(key)) {
return P.getProperty(key);
}
return System.getProperty(key);
}
public static String getValue(String key, String want) {
String val = getValue(key);
if(val == null)
if (val == null)
return want;
return val;
}
/**
* 解析为Boolean类型
*
* @param key
* @param want
* @return
*/
public static boolean getBoolean(String key, boolean want) {
String val = getValue(key);
if(val == null || val.length() == 0)
if (val == null || val.length() == 0)
return want;
try {
return Boolean.parseBoolean(val);
......@@ -229,15 +231,17 @@ public class GConstants {
}
return want;
}
/**
* 获取整型数据,转换数据类型
*
* @param key
* @param want
* @return
*/
public static int getIntValue(String key, int want) {
String val = getValue(key);
if(val == null || val.length() == 0)
if (val == null || val.length() == 0)
return want;
try {
return Integer.parseInt(val);
......@@ -246,15 +250,17 @@ public class GConstants {
}
return want;
}
/**
* 获取长整型数据
*
* @param key
* @param want
* @return
*/
public static long getLongValue(String key, long want) {
String val = getValue(key);
if(val == null || val.length() == 0)
if (val == null || val.length() == 0)
return want;
try {
return Long.parseLong(val);
......@@ -263,9 +269,10 @@ public class GConstants {
}
return want;
}
public static float getFloatValue(String key, float want) {
String val = getValue(key);
if(val == null || val.length() == 0)
if (val == null || val.length() == 0)
return want;
try {
return Float.parseFloat(val);
......@@ -274,9 +281,10 @@ public class GConstants {
}
return want;
}
public static double getDoubleValue(String key, double want) {
String val = getValue(key);
if(val == null || val.length() == 0)
if (val == null || val.length() == 0)
return want;
try {
return Double.parseDouble(val);
......
package com.ejweb.core.fetcher;
import com.alibaba.fastjson.JSON;
import com.alibaba.fastjson.JSONObject;
import com.ejweb.core.conf.GConstants;
import com.ejweb.core.security.GlobalUtil;
import org.apache.http.HttpEntity;
import org.apache.http.HttpResponse;
import org.apache.http.NameValuePair;
......@@ -14,7 +10,10 @@ import org.apache.http.impl.client.HttpClients;
import org.apache.http.message.BasicNameValuePair;
import org.apache.http.util.EntityUtils;
import java.util.*;
import java.util.ArrayList;
import java.util.Iterator;
import java.util.List;
import java.util.Map;
import java.util.Map.Entry;
/**
......@@ -54,37 +53,4 @@ public class HttpClientUtil {
}
return result;
}
public static void main(String[] args) {
try {
// StringBuilder url = new StringBuilder("https://ewatch.okayapps.com/faq/api/user/login");
StringBuilder url = new StringBuilder("https://ewatch.okayapps.com/faq/api/ask/detail");
String loginName = "root";
String password = "1";
JSONObject content = new JSONObject();
content.put("appCode", "10001");
content.put("versionName", "1.0");
content.put("platform", "Android");
content.put("language", "zh_CN");
content.put("appCode", "10001");
content.put("loginName", "root");
content.put("password", "admin");
content.put("userCode", "userId");
content.put("id", "93648376039909180225");
Map<String, String> params = new HashMap<String, String>();
params.put("content", JSON.toJSONString(content));
String sign = GlobalUtil.getParamsSignStr(GConstants.SIGN_PRIVATE_KEY, params.get("content"));
params.put("sign", sign);
String res = HttpClientUtil.doPost(url.toString(), params, "UTF-8");
// JSONObject object = JSON.parseObject(res);
System.out.println(res);
} catch (Exception e) {
// TODO: handle exception
e.printStackTrace();
}
}
}
\ No newline at end of file
......@@ -406,7 +406,7 @@ public class RouteVerifyService extends BaseService<RouteVerifyDao> {
return verifyConditionEntities;
}
private void insertAirlineConclusion(RouteVerifyBean routeVerifyBean, String userCode) {
public void insertAirlineConclusion(RouteVerifyBean routeVerifyBean, String userCode) {
// 查询foc_route_verify所有与传参verifId相同的数据的verifyStatus均为01时,foc_airline_conclusion插入一条数据
// 判断是否全部论证部门完成论证
......
......@@ -180,11 +180,11 @@ public class VerifyFeedbackController {
bean.setUpdateDate(new Date());
feedbackService.updateFeedback(bean);
// 提示有新的反馈
VerifyFeedbackStatusBean statusBean = new VerifyFeedbackStatusBean();
statusBean.setVerifId(bean.getVerifId());
statusBean.setStatus("1");
statusBean.setConditionId(bean.getConditionId());
feedbackService.updateStatus(statusBean);
// VerifyFeedbackStatusBean statusBean = new VerifyFeedbackStatusBean();
// statusBean.setVerifId(bean.getVerifId());
// statusBean.setStatus("1");
// statusBean.setConditionId(bean.getConditionId());
// feedbackService.updateStatus(statusBean);
return responseBean;
}
}
......
......@@ -10,6 +10,7 @@ import java.util.Map;
*/
public class ConditionDetailData {
private String conditionId;
private String routeId;
private String condition;
private String conditionDate;
private int feedStatus;
......@@ -63,4 +64,12 @@ public class ConditionDetailData {
public void setReviewType(String reviewType) {
this.reviewType = reviewType;
}
public String getRouteId() {
return routeId;
}
public void setRouteId(String routeId) {
this.routeId = routeId;
}
}
......@@ -8,8 +8,10 @@ import com.ejweb.core.base.PageEntity;
import com.ejweb.core.exception.RecordNotExistException;
import com.ejweb.modules.depart.dao.DepartDao;
import com.ejweb.modules.depart.entity.DepartEntity;
import com.ejweb.modules.route.bean.RouteVerifyBean;
import com.ejweb.modules.route.dao.RouteVerifyDao;
import com.ejweb.modules.route.entity.FullRouteVerifyEntity;
import com.ejweb.modules.route.service.RouteVerifyService;
import com.ejweb.modules.verify.bean.*;
import com.ejweb.modules.verify.dao.AirlineVerifyDao;
import com.ejweb.modules.verify.dao.ConditionDao;
......@@ -48,6 +50,8 @@ public class VerifyFeedbackService extends BaseService<VerifyFeedbackDao> {
DepartDao departDao;
@Autowired
RouteVerifyDao routeVerifyDao;
@Autowired
RouteVerifyService routeVerifyService;
public PageEntity<VerifyFeedbackEntity> findList(VerifyFeedbackBean bean) {
PageInfo<VerifyFeedbackEntity> pageInfo;
......@@ -154,7 +158,26 @@ public class VerifyFeedbackService extends BaseService<VerifyFeedbackDao> {
ConditionUpdateBean updateBean = new ConditionUpdateBean();
updateBean.setReviewType(data.getReviewType());
updateBean.setConditionId(data.getConditionId());
//设置该条件完成
conditionDao.updateConditionComplete(updateBean);
//判断该条件提出部门提出的所有条件是否都完成,如果完成,设置部门由条件可行变为条件满足
//判断是否所有部门已经反馈完
FullRouteVerifyEntity fullRouteVerifyEntity = routeVerifyDao.selectByPrimaryKey(data.getRouteId());
int count = conditionDao.getUndoneCondition(fullRouteVerifyEntity.getId());
if (count != 0) {
return true;
}
//条件可行变为条件满足
fullRouteVerifyEntity.setVerifyStatus("04");
//填写论证条件总结
fullRouteVerifyEntity.setSummary("各条件均无需复核,系统默认条件满足");
routeVerifyDao.updateByPrimaryKey(fullRouteVerifyEntity);
conditionDao.updateCompleteByRouteId(fullRouteVerifyEntity.getId());
//判断论证单所有部门论证是否完成,如果完成,进入论证总结阶段
RouteVerifyBean routeVerifyBean = new RouteVerifyBean();
routeVerifyBean.setVerifId(fullRouteVerifyEntity.getVerifId());
routeVerifyService.insertAirlineConclusion(routeVerifyBean, bean.getUserCode());
} else {
dao.updateCondition(bean);
}
......
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