Commit 2bccf2fa authored by 竹天卫's avatar 竹天卫

校核计算 测试完成 加上校验版本

parent 03f25c1d
...@@ -25,7 +25,7 @@ import org.springframework.web.filter.OncePerRequestFilter; ...@@ -25,7 +25,7 @@ import org.springframework.web.filter.OncePerRequestFilter;
@Component @Component
public class TokenFilter extends OncePerRequestFilter { public class TokenFilter extends OncePerRequestFilter {
private static final Logger log = LoggerFactory.getLogger("WeiXinService"); private static final Logger log = LoggerFactory.getLogger("TokenFilter");
public static final String TOKEN_KEY = "Authorization"; public static final String TOKEN_KEY = "Authorization";
......
...@@ -265,8 +265,10 @@ public class EntrustServiceImpl extends ServiceImpl<EntrustMapper, Entrust> impl ...@@ -265,8 +265,10 @@ public class EntrustServiceImpl extends ServiceImpl<EntrustMapper, Entrust> impl
for (String teamId : teamIdS) { for (String teamId : teamIdS) {
Team team = teamMapper.selectById(Integer.valueOf(teamId)); Team team = teamMapper.selectById(Integer.valueOf(teamId));
if (team != null) { if (team != null) {
charge = charge.compareTo(BigDecimal.ZERO) == 0 ? team.getCharge() : (charge.add(team.getCharge())); if(!teamNameList.contains(teamId)){
teamNameList.add(team.getName()); charge = charge.compareTo(BigDecimal.ZERO) == 0 ? team.getCharge() : (charge.add(team.getCharge()));
teamNameList.add(team.getName());
}
} }
} }
//选择Mg必须选择Ca;选择Al必须选择Fe //选择Mg必须选择Ca;选择Al必须选择Fe
...@@ -2079,23 +2081,23 @@ public class EntrustServiceImpl extends ServiceImpl<EntrustMapper, Entrust> impl ...@@ -2079,23 +2081,23 @@ public class EntrustServiceImpl extends ServiceImpl<EntrustMapper, Entrust> impl
} }
} }
//计算平行样的平均值 最大误差值 //计算平行样的平均值 最大误差值
Map<String,Map<String,String>> mapResult = CheckCountUtil.countParallelAvgError(groupMap); Map<String,Map<String,String>> mapResult = CheckCountUtil.countParallelAvgError(groupMap);
if(mapResult != null){ if(mapResult != null){
Map<String,String> countResults= mapResult.get("countResults"); Map<String,String> countResults= mapResult.get("countResults");
JSONArray countResults_jsonArray = commonService.mapToJSONArray(countResults); JSONArray countResults_jsonArray = commonService.mapToJSONArray(countResults);
String countResults_String = JSON.toJSON(countResults_jsonArray).toString(); String countResults_String = JSON.toJSON(countResults_jsonArray).toString();
System.out.println(countResults_String); System.out.println(countResults_String);
Map<String,String> countError= mapResult.get("countError"); Map<String,String> countError= mapResult.get("countError");
JSONArray countError_jsonArray = commonService.mapToJSONArray(countError); JSONArray countError_jsonArray = commonService.mapToJSONArray(countError);
String countError_String = JSON.toJSON(countError_jsonArray).toString(); String countError_String = JSON.toJSON(countError_jsonArray).toString();
System.out.println(countError_String); System.out.println(countError_String);
check.setCountResults(countResults_String); check.setCountResults(countResults_String);
check.setCountError(countError_String); check.setCountError(countError_String);
sampleCheckMapper.updateById(check); sampleCheckMapper.updateById(check);
countResultMap.put("countResults", countResults_String); countResultMap.put("countResults", countResults_String);
countResultMap.put("countError", countError_String); countResultMap.put("countError", countError_String);
}
} }
}
Boolean ret = true; //全部校核计算完成 Boolean ret = true; //全部校核计算完成
List<SampleCheckGroupVo> sampleCheckGroupVoList = distributionMapper.getSampleCheckGroupList( query.getSampleList().get(0).getSmapleId()); List<SampleCheckGroupVo> sampleCheckGroupVoList = distributionMapper.getSampleCheckGroupList( query.getSampleList().get(0).getSmapleId());
for(SampleCheckGroupVo groupVo : sampleCheckGroupVoList){ for(SampleCheckGroupVo groupVo : sampleCheckGroupVoList){
...@@ -2722,7 +2724,7 @@ public class EntrustServiceImpl extends ServiceImpl<EntrustMapper, Entrust> impl ...@@ -2722,7 +2724,7 @@ public class EntrustServiceImpl extends ServiceImpl<EntrustMapper, Entrust> impl
} else if (j == 10) { } else if (j == 10) {
obj = checkMethodStr; obj = checkMethodStr;
} else { } else {
obj = m.get(headers[j]).toString(); obj = m.get(headers[j])!= null? m.get(headers[j]).toString() : "" ;
//如果序号带小数点 去除.0,保留整数 //如果序号带小数点 去除.0,保留整数
if (j == 0) { if (j == 0) {
obj = obj.split("\\.")[0]; obj = obj.split("\\.")[0];
......
...@@ -47,7 +47,7 @@ public class WeiXinService { ...@@ -47,7 +47,7 @@ public class WeiXinService {
System.out.println("==================code==================="); System.out.println("==================code===================");
System.out.println(code); System.out.println(code);
try { try {
String accessToken = null; /*String accessToken = null;
if (type.equals("PC")) { if (type.equals("PC")) {
accessToken = getAccessToken(); accessToken = getAccessToken();
} else if (type.equals("APP")) { } else if (type.equals("APP")) {
...@@ -64,10 +64,10 @@ public class WeiXinService { ...@@ -64,10 +64,10 @@ public class WeiXinService {
String UserId = jsonObject.getString("UserId"); String UserId = jsonObject.getString("UserId");
System.out.println("==================UserId==================="); System.out.println("==================UserId===================");
System.out.println(UserId); System.out.println(UserId);
JSONObject userJson = getUser(accessToken, UserId); JSONObject userJson = getUser(accessToken, UserId);*/
QueryWrapper<SysUser> wrapper = new QueryWrapper<>(); QueryWrapper<SysUser> wrapper = new QueryWrapper<>();
wrapper.eq("phone", userJson.get("mobile")); // wrapper.eq("phone", userJson.get("mobile"));
// wrapper.eq("phone", code); //暂时用手机号代替code wrapper.eq("phone", code); //暂时用手机号代替code
SysUser sysUser = userService.getOne(wrapper); SysUser sysUser = userService.getOne(wrapper);
if (sysUser == null) { if (sysUser == null) {
return BaseResponse.errorMsg("非系统用户不允许登录!"); return BaseResponse.errorMsg("非系统用户不允许登录!");
...@@ -83,8 +83,8 @@ public class WeiXinService { ...@@ -83,8 +83,8 @@ public class WeiXinService {
sysUser.getName(), sysUser.getPhone()); sysUser.getName(), sysUser.getPhone());
System.out.println(token); System.out.println(token);
redisUtil.setString(sysUser.getId().toString(), token, 3600); redisUtil.setString(sysUser.getId().toString(), token, 3600);
sysUser.setWxId(UserId); // sysUser.setWxId(UserId);
userService.updateById(sysUser); // userService.updateById(sysUser);
return BaseResponse.okData(token); return BaseResponse.okData(token);
} catch (Exception e) { } catch (Exception e) {
return BaseResponse.errorMsg(e.getMessage()); return BaseResponse.errorMsg(e.getMessage());
......
...@@ -10,22 +10,22 @@ package cn.wise.sc.cement.business.util.weixin; ...@@ -10,22 +10,22 @@ package cn.wise.sc.cement.business.util.weixin;
public interface Global { public interface Global {
//企业ID
public final static String corpId = "ww348f91b2573c1867";
//企业应用的id,整型。可在应用的设置页面查看 //企业应用的id,整型。可在应用的设置页面查看
public final static int agentId = 1000002; public final static int agentId = 1000002;
public final static int agentIdPC = 1000003; public final static int agentIdPC = 1000003;
//企业ID
public final static String corpId = "ww348f91b2573c1867";
//应用的凭证密钥 //应用的凭证密钥
public final static String agentSecret = "gFa_7XvXtCaoeAYERzjRwwz_OTJkJfgBb8weOKjmI3o"; public final static String agentSecret = "gFa_7XvXtCaoeAYERzjRwwz_OTJkJfgBb8weOKjmI3o";
public final static String agentSecretPC = "itCLYcwl9ggA9VfZam_iz96Ikp9StDFfVr4Adb0yY7A";
//编译后的回调地址 //编译后的回调地址
public final static String backUrl = "https%3a%2f%2fprogram.oxogroup.com%2flab-system"; public final static String backUrl = "https%3a%2f%2fprogram.oxogroup.com%2flab-system";
//实验室管理系统链接 //实验室管理系统链接
public final static String systemUrl = "<a href=\"https://open.weixin.qq.com/connect/oauth2/authorize?appid="+corpId+"&redirect_uri="+backUrl+"%2f&response_type=code&scope=snsapi_base&state=#wechat_redirect\">天津院实验室管理系统" + "</a>,"; public final static String systemUrl =
"<a href=\"https://open.weixin.qq.com/connect/oauth2/authorize?appid="+corpId+"&redirect_uri="+backUrl+"%2f&response_type=code&scope=snsapi_base&state=#wechat_redirect\">天津院实验室管理系统" + "</a>,";
//应用的凭证密钥PC
public final static String agentSecretPC = "itCLYcwl9ggA9VfZam_iz96Ikp9StDFfVr4Adb0yY7A";
/** /**
* 微信公众平台,获取AccessToken的接口地址,Https请求方式:GET * 微信公众平台,获取AccessToken的接口地址,Https请求方式:GET
......
...@@ -7,8 +7,8 @@ spring: ...@@ -7,8 +7,8 @@ spring:
active: dev active: dev
datasource: datasource:
# 192.168.110.85 admin!@#123 # 192.168.110.85 admin!@#123
# url: jdbc:mysql://192.168.110.85:3306/sinoma_tcdri?serverTimezone=Asia/Shanghai&useUnicode=true&characterEncoding=UTF-8&useSSL=false url: jdbc:mysql://192.168.110.85:3306/sinoma_tcdri?serverTimezone=Asia/Shanghai&useUnicode=true&characterEncoding=UTF-8&useSSL=false
url: jdbc:mysql://81.68.92.175:3306/sinoma_tcdri?serverTimezone=Asia/Shanghai&useUnicode=true&characterEncoding=UTF-8&useSSL=false # url: jdbc:mysql://81.68.92.175:3306/sinoma_tcdri?serverTimezone=Asia/Shanghai&useUnicode=true&characterEncoding=UTF-8&useSSL=false
username: root username: root
password: admin!@#123 password: admin!@#123
driverClassName: com.mysql.cj.jdbc.Driver driverClassName: com.mysql.cj.jdbc.Driver
......
...@@ -4,7 +4,7 @@ fastdfs.charset=UTF-8 ...@@ -4,7 +4,7 @@ fastdfs.charset=UTF-8
fastdfs.http.tracker_http_port=8888 fastdfs.http.tracker_http_port=8888
fastdfs.http.anti_steal_token=no fastdfs.http.anti_steal_token=no
fastdfs.http.secret_key=FastDFS1234567890 fastdfs.http.secret_key=FastDFS1234567890
fastdfs.tracker_servers=192.168.110.85:22122 fastdfs.tracker_servers=localhost:22122
#fastdfs.tracker_servers=localhost:22122 #fastdfs.tracker_servers=localhost:22122
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