Commit 0ada32d0 authored by 竹天卫's avatar 竹天卫

委托管理 校核计算功能 完成到KH 检测项

parent ba9b09a9
...@@ -25,7 +25,7 @@ import static com.google.common.collect.Lists.newArrayList; ...@@ -25,7 +25,7 @@ import static com.google.common.collect.Lists.newArrayList;
public class Swagger2Configuration { public class Swagger2Configuration {
//api接口包扫描路径 //api接口包扫描路径
public static final String SWAGGER_SCAN_BASE_PACKAGE = "cn.wise.sc.cement"; public static final String SWAGGER_SCAN_BASE_PACKAGE = "cn.wise.sc.cement.business.controller";
public static final String VERSION = "1.0.0"; public static final String VERSION = "1.0.0";
...@@ -33,8 +33,12 @@ public class Swagger2Configuration { ...@@ -33,8 +33,12 @@ public class Swagger2Configuration {
public Docket docket() { public Docket docket() {
return new Docket(DocumentationType.SWAGGER_2).groupName("swagger接口文档") return new Docket(DocumentationType.SWAGGER_2).groupName("swagger接口文档")
.apiInfo(new ApiInfoBuilder().title("swagger接口文档") .apiInfo(new ApiInfoBuilder().title("swagger接口文档")
.contact(new Contact("Wisenergy", "http://www.wisenergy.cn/", "service@wisenergy.cn")).version("1.0").build()) .contact(new Contact("Wisenergy", "http://www.wisenergy.cn/", "service@wisenergy.cn"))
.select().paths(PathSelectors.any()).build() .description("天津院项目")
.version(VERSION).build())
.select()
.apis(RequestHandlerSelectors.basePackage(SWAGGER_SCAN_BASE_PACKAGE))
.paths(PathSelectors.any()).build()
.securitySchemes(newArrayList(apiKey())) .securitySchemes(newArrayList(apiKey()))
.securityContexts(newArrayList(securityContext())) .securityContexts(newArrayList(securityContext()))
.enableUrlTemplating(false) .enableUrlTemplating(false)
...@@ -60,9 +64,6 @@ public class Swagger2Configuration { ...@@ -60,9 +64,6 @@ public class Swagger2Configuration {
return newArrayList(new SecurityReference("BearerToken", authorizationScopes)); return newArrayList(new SecurityReference("BearerToken", authorizationScopes));
} }
@Value("${swagger.basic.username}") @Value("${swagger.basic.username}")
private String username; private String username;
@Value("${swagger.basic.password}") @Value("${swagger.basic.password}")
......
...@@ -60,7 +60,7 @@ public class EntityEnclosureController { ...@@ -60,7 +60,7 @@ public class EntityEnclosureController {
fileName = file.getOriginalFilename().substring(0,file.getOriginalFilename().lastIndexOf(".")); fileName = file.getOriginalFilename().substring(0,file.getOriginalFilename().lastIndexOf("."));
extName = file.getOriginalFilename().substring(file.getOriginalFilename().lastIndexOf(".")); extName = file.getOriginalFilename().substring(file.getOriginalFilename().lastIndexOf("."));
}else { }else {
return BaseResponse.errorMsg("该账号已在其他地方登陆"); return BaseResponse.errorMsg("登录信息失效");
} }
String picUrl = filePath; String picUrl = filePath;
map.put("fileUrl",picUrl); map.put("fileUrl",picUrl);
...@@ -90,7 +90,7 @@ public class EntityEnclosureController { ...@@ -90,7 +90,7 @@ public class EntityEnclosureController {
fileName = file.getOriginalFilename().substring(0,file.getOriginalFilename().lastIndexOf(".")); fileName = file.getOriginalFilename().substring(0,file.getOriginalFilename().lastIndexOf("."));
extName = file.getOriginalFilename().substring(file.getOriginalFilename().lastIndexOf(".")); extName = file.getOriginalFilename().substring(file.getOriginalFilename().lastIndexOf("."));
}else { }else {
return BaseResponse.errorMsg("该账号已在其他地方登陆"); return BaseResponse.errorMsg("登录信息失效");
} }
String picUrl = filePath; String picUrl = filePath;
map.put("fileUrl",picUrl); map.put("fileUrl",picUrl);
...@@ -135,7 +135,7 @@ public class EntityEnclosureController { ...@@ -135,7 +135,7 @@ public class EntityEnclosureController {
return BaseResponse.errorMsg("没有文件"); return BaseResponse.errorMsg("没有文件");
} }
}else { }else {
return BaseResponse.errorMsg("该账号已在其他地方登陆"); return BaseResponse.errorMsg("登录信息失效");
} }
return BaseResponse.okData(map); return BaseResponse.okData(map);
}catch (Exception e){ }catch (Exception e){
...@@ -159,7 +159,7 @@ public class EntityEnclosureController { ...@@ -159,7 +159,7 @@ public class EntityEnclosureController {
out.write(by); out.write(by);
out.close(); out.close();
}else { }else {
return BaseResponse.errorMsg("该账号已在其他地方登陆"); return BaseResponse.errorMsg("登录信息失效");
} }
return BaseResponse.okMsg("成功"); return BaseResponse.okMsg("成功");
}catch (Exception e){ }catch (Exception e){
...@@ -209,7 +209,7 @@ public class EntityEnclosureController { ...@@ -209,7 +209,7 @@ public class EntityEnclosureController {
} }
} }
}else { }else {
return BaseResponse.errorMsg("该账号已在其他地方登陆"); return BaseResponse.errorMsg("登录信息失效");
} }
return BaseResponse.okMsg("成功"); return BaseResponse.okMsg("成功");
......
...@@ -12,11 +12,15 @@ import io.swagger.annotations.Api; ...@@ -12,11 +12,15 @@ import io.swagger.annotations.Api;
import io.swagger.annotations.ApiImplicitParam; import io.swagger.annotations.ApiImplicitParam;
import io.swagger.annotations.ApiImplicitParams; import io.swagger.annotations.ApiImplicitParams;
import io.swagger.annotations.ApiOperation; import io.swagger.annotations.ApiOperation;
import io.swagger.models.auth.In;
import org.slf4j.Logger; import org.slf4j.Logger;
import org.slf4j.LoggerFactory; import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*; import org.springframework.web.bind.annotation.*;
import java.util.List;
import java.util.Map;
/** /**
* <p> * <p>
* 前端控制器 * 前端控制器
...@@ -59,13 +63,13 @@ public class EntrustController { ...@@ -59,13 +63,13 @@ public class EntrustController {
return BaseResponse.errorMsg("失败!"); return BaseResponse.errorMsg("失败!");
} }
@ApiOperation(value = "置顶") @ApiOperation(value = "置顶取消置顶 (createTime = updateTime显示置顶,否则显示取消置顶)")
@PostMapping("/setTopping") @PostMapping("/setTopping")
public BaseResponse setTopping(Integer id) { public BaseResponse setTopping(Integer id) {
try { try {
return entrustService.setTopping(id); return entrustService.setTopping(id);
}catch (Exception e) { }catch (Exception e) {
log.debug("置顶{}",e); log.debug("置顶取消置顶{}",e);
} }
return BaseResponse.errorMsg("失败!"); return BaseResponse.errorMsg("失败!");
} }
...@@ -151,9 +155,8 @@ public class EntrustController { ...@@ -151,9 +155,8 @@ public class EntrustController {
} }
@ApiOperation(value = "接受样品处理任务") @ApiOperation(value = "接受样品处理任务")
@ApiImplicitParam(name = "ids", value = "样品处理表id集合", required = true, allowMultiple=true, dataType="Integer", paramType = "query")
@PostMapping("/acceptHandle") @PostMapping("/acceptHandle")
public BaseResponse acceptHandle(Integer[] ids) { public BaseResponse acceptHandle(@RequestBody Integer[] ids) {
try { try {
return entrustService.acceptHandle(ids); return entrustService.acceptHandle(ids);
}catch (Exception e) { }catch (Exception e) {
...@@ -196,9 +199,8 @@ public class EntrustController { ...@@ -196,9 +199,8 @@ public class EntrustController {
} }
@ApiOperation(value = "完成样品处理任务") @ApiOperation(value = "完成样品处理任务")
@ApiImplicitParam(name = "ids", value = "样品处理表id集合", required = true, allowMultiple=true, dataType="Integer", paramType = "query")
@PostMapping("/finishHandle") @PostMapping("/finishHandle")
public BaseResponse finishHandle(Integer[] ids) { public BaseResponse finishHandle(@RequestBody Integer[] ids) {
try { try {
return entrustService.finishHandle(ids); return entrustService.finishHandle(ids);
}catch (Exception e) { }catch (Exception e) {
...@@ -247,9 +249,8 @@ public class EntrustController { ...@@ -247,9 +249,8 @@ public class EntrustController {
@ApiOperation(value = "接受检测项目任务") @ApiOperation(value = "接受检测项目任务")
@ApiImplicitParam(name = "ids", value = "任务派发表id集合", required = true, allowMultiple=true, dataType="Integer", paramType = "query")
@PostMapping("/acceptDistribution") @PostMapping("/acceptDistribution")
public BaseResponse acceptDistribution(Integer[] ids) { public BaseResponse acceptDistribution(@RequestBody Integer[] ids) {
try { try {
return entrustService.acceptDistribution(ids); return entrustService.acceptDistribution(ids);
}catch (Exception e) { }catch (Exception e) {
...@@ -271,9 +272,8 @@ public class EntrustController { ...@@ -271,9 +272,8 @@ public class EntrustController {
@ApiOperation(value = "完成检测项目任务") @ApiOperation(value = "完成检测项目任务")
@ApiImplicitParam(name = "ids", value = "任务派发表id集合", required = true, allowMultiple=true, dataType="Integer", paramType = "query")
@PostMapping("/finishDistribution") @PostMapping("/finishDistribution")
public BaseResponse finishDistribution(Integer[] ids) { public BaseResponse finishDistribution(@RequestBody Integer[] ids) {
try { try {
return entrustService.finishDistribution(ids); return entrustService.finishDistribution(ids);
}catch (Exception e) { }catch (Exception e) {
...@@ -336,9 +336,23 @@ public class EntrustController { ...@@ -336,9 +336,23 @@ public class EntrustController {
return BaseResponse.errorMsg("失败!"); return BaseResponse.errorMsg("失败!");
} }
@ApiOperation(value = "校核计算")
@PostMapping("/checkCount")
public BaseResponse checkCount(Integer teamGroupId, @RequestBody Map<String, Object> mainResult) {
try {
return entrustService.checkCount(teamGroupId, mainResult);
}catch (Exception e) {
log.debug("校核计算{}",e);
}
return BaseResponse.errorMsg("失败!");
}
@ApiOperation(value = "数据校核") @ApiOperation(value = "数据校核")
@PostMapping("/check") @PostMapping("/check")
public BaseResponse check(CheckQuery query) { public BaseResponse check(@RequestBody CheckQuery query) {
try { try {
return entrustService.check(query); return entrustService.check(query);
}catch (Exception e) { }catch (Exception e) {
......
...@@ -5,6 +5,7 @@ import cn.wise.sc.cement.business.entity.SysGroup; ...@@ -5,6 +5,7 @@ import cn.wise.sc.cement.business.entity.SysGroup;
import cn.wise.sc.cement.business.entity.TeamGroup; import cn.wise.sc.cement.business.entity.TeamGroup;
import cn.wise.sc.cement.business.model.BaseResponse; import cn.wise.sc.cement.business.model.BaseResponse;
import cn.wise.sc.cement.business.model.PageQuery; import cn.wise.sc.cement.business.model.PageQuery;
import cn.wise.sc.cement.business.model.query.TeamGroupQuery;
import cn.wise.sc.cement.business.service.ITeamGroupService; import cn.wise.sc.cement.business.service.ITeamGroupService;
import io.swagger.annotations.Api; import io.swagger.annotations.Api;
import io.swagger.annotations.ApiImplicitParam; import io.swagger.annotations.ApiImplicitParam;
...@@ -51,7 +52,7 @@ public class TeamGroupController { ...@@ -51,7 +52,7 @@ public class TeamGroupController {
@ApiOperation(value = "新增检测组") @ApiOperation(value = "新增检测组")
@PostMapping("/create") @PostMapping("/create")
public BaseResponse create(@RequestBody TeamGroup query) { public BaseResponse create(@RequestBody TeamGroupQuery query) {
try { try {
return teamGroupService.create(query); return teamGroupService.create(query);
}catch (Exception e) { }catch (Exception e) {
...@@ -62,7 +63,7 @@ public class TeamGroupController { ...@@ -62,7 +63,7 @@ public class TeamGroupController {
@ApiOperation(value = "修改检测组") @ApiOperation(value = "修改检测组")
@PostMapping("/update") @PostMapping("/update")
public BaseResponse update(@RequestBody TeamGroup query) { public BaseResponse update(@RequestBody TeamGroupQuery query) {
try { try {
return teamGroupService.update(query); return teamGroupService.update(query);
}catch (Exception e) { }catch (Exception e) {
......
...@@ -50,7 +50,7 @@ ...@@ -50,7 +50,7 @@
left join client c on c.id = e.client_id left join client c on c.id = e.client_id
left join sys_user su on su.id = e.user_id left join sys_user su on su.id = e.user_id
<include refid="where" /> <include refid="where" />
order by e.update_time desc order by e.is_urgent desc, e.update_time desc
</select> </select>
<select id="getDetail" resultType="cn.wise.sc.cement.business.model.vo.EntrustVo"> <select id="getDetail" resultType="cn.wise.sc.cement.business.model.vo.EntrustVo">
......
...@@ -18,20 +18,13 @@ public class SampleCheckQuery { ...@@ -18,20 +18,13 @@ public class SampleCheckQuery {
@ApiModelProperty("样品表d") @ApiModelProperty("样品表d")
private Integer sampleId; private Integer sampleId;
@ApiModelProperty("本所编号")
private String cementCode;
@ApiModelProperty("检测人员id") @ApiModelProperty("检测人员id")
private String userId; private String userId;
@ApiModelProperty("检测人员姓名")
private String userName;
@ApiModelProperty("检测设备表id") @ApiModelProperty("检测设备表id")
private Integer equipmentId; private Integer equipmentId;
@ApiModelProperty("检测设备名称")
private String equipmentName;
@ApiModelProperty("基本元素检测结果 json串") @ApiModelProperty("基本元素检测结果 json串")
private String baseResult; private String baseResult;
......
package cn.wise.sc.cement.business.model.query; package cn.wise.sc.cement.business.model.query;
import com.alibaba.fastjson.JSONArray;
import com.baomidou.mybatisplus.annotation.IdType; import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableId; import com.baomidou.mybatisplus.annotation.TableId;
import com.mysql.cj.xdevapi.JsonArray;
import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty; import io.swagger.annotations.ApiModelProperty;
import lombok.Data; import lombok.Data;
...@@ -10,6 +12,7 @@ import lombok.experimental.Accessors; ...@@ -10,6 +12,7 @@ import lombok.experimental.Accessors;
import java.io.Serializable; import java.io.Serializable;
import java.time.LocalDateTime; import java.time.LocalDateTime;
import java.util.Map;
/** /**
* <p> * <p>
...@@ -39,13 +42,13 @@ public class SampleCheckTeamQuery { ...@@ -39,13 +42,13 @@ public class SampleCheckTeamQuery {
{"样重m":"40","K值":1.0274,"Vsio2":3.89,................} {"样重m":"40","K值":1.0274,"Vsio2":3.89,................}
*/ */
@ApiModelProperty("主样检测结果 json串") @ApiModelProperty("主样检测结果 json串")
private String main_result; private Map<String, Object> mainResult;
@ApiModelProperty("次样检测结果json串") @ApiModelProperty("次样检测结果json串")
private String secondary_result; private JSONArray secondaryResult;
@ApiModelProperty("最终校核计算结果json串") @ApiModelProperty("最终校核计算结果json串")
private String end_result; private JSONArray endResult;
@ApiModelProperty("备注") @ApiModelProperty("备注")
private String remark; private String remark;
......
package cn.wise.sc.cement.business.model.query;
import com.alibaba.fastjson.JSONArray;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import java.math.BigDecimal;
import java.time.LocalDateTime;
/**
* @description:
* @author: qh
* @create: 2020-08-07 15:42
**/
@Data
public class TeamGroupQuery {
@ApiModelProperty("检测组id")
private Integer id;
@ApiModelProperty("检测组名称")
private String name;
@ApiModelProperty("校核元素 json串")
private JSONArray checkElement;
@ApiModelProperty("备注")
private String remark;
}
...@@ -87,6 +87,12 @@ public class EntrustVo { ...@@ -87,6 +87,12 @@ public class EntrustVo {
@ApiModelProperty(" 剩余样品处理方法(0,取回,1由本所统一处置)") @ApiModelProperty(" 剩余样品处理方法(0,取回,1由本所统一处置)")
private Integer handleMethod; private Integer handleMethod;
@ApiModelProperty("创建时间")
private LocalDateTime createTime;
@ApiModelProperty("修改时间")
private LocalDateTime updateTime;
@ApiModelProperty("备注") @ApiModelProperty("备注")
private String remark; private String remark;
......
...@@ -74,6 +74,8 @@ public interface IEntrustService extends IService<Entrust> { ...@@ -74,6 +74,8 @@ public interface IEntrustService extends IService<Entrust> {
BaseResponse<List<SampleDistribution>> getEnclosureList(Integer sampleId, Integer teamGroupId, Integer userId); BaseResponse<List<SampleDistribution>> getEnclosureList(Integer sampleId, Integer teamGroupId, Integer userId);
BaseResponse<Map<String, Object>> checkCount(Integer teamGroupId, Map<String, Object> mainResult);
BaseResponse<String> check(CheckQuery query); BaseResponse<String> check(CheckQuery query);
......
...@@ -3,6 +3,7 @@ package cn.wise.sc.cement.business.service; ...@@ -3,6 +3,7 @@ package cn.wise.sc.cement.business.service;
import cn.wise.sc.cement.business.entity.TeamGroup; import cn.wise.sc.cement.business.entity.TeamGroup;
import cn.wise.sc.cement.business.model.BaseResponse; import cn.wise.sc.cement.business.model.BaseResponse;
import cn.wise.sc.cement.business.model.PageQuery; import cn.wise.sc.cement.business.model.PageQuery;
import cn.wise.sc.cement.business.model.query.TeamGroupQuery;
import com.baomidou.mybatisplus.core.metadata.IPage; import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.service.IService; import com.baomidou.mybatisplus.extension.service.IService;
...@@ -18,9 +19,9 @@ public interface ITeamGroupService extends IService<TeamGroup> { ...@@ -18,9 +19,9 @@ public interface ITeamGroupService extends IService<TeamGroup> {
BaseResponse<IPage<TeamGroup>> getPage(PageQuery pageQuery, String name); BaseResponse<IPage<TeamGroup>> getPage(PageQuery pageQuery, String name);
BaseResponse<TeamGroup> create(TeamGroup query); BaseResponse<TeamGroup> create(TeamGroupQuery query);
BaseResponse<TeamGroup> update(TeamGroup query); BaseResponse<TeamGroup> update(TeamGroupQuery query);
......
...@@ -3,20 +3,26 @@ package cn.wise.sc.cement.business.service.impl; ...@@ -3,20 +3,26 @@ package cn.wise.sc.cement.business.service.impl;
import cn.wise.sc.cement.business.entity.EntityEnclosure; import cn.wise.sc.cement.business.entity.EntityEnclosure;
import cn.wise.sc.cement.business.entity.TeamGroup;
import cn.wise.sc.cement.business.mapper.EntityEnclosureMapper; import cn.wise.sc.cement.business.mapper.EntityEnclosureMapper;
import cn.wise.sc.cement.business.mapper.TeamGroupMapper;
import cn.wise.sc.cement.business.mapper.TeamMapper;
import cn.wise.sc.cement.business.model.BaseResponse;
import cn.wise.sc.cement.business.model.query.EnclosureQuery; import cn.wise.sc.cement.business.model.query.EnclosureQuery;
import cn.wise.sc.cement.business.service.IEntityEnclosureService; import cn.wise.sc.cement.business.service.IEntityEnclosureService;
import cn.wise.sc.cement.business.util.CheckCountUtil;
import com.alibaba.fastjson.JSONArray;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import io.swagger.models.auth.In; import io.swagger.models.auth.In;
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 javax.annotation.Resource; import javax.annotation.Resource;
import java.math.BigDecimal;
import java.math.BigInteger;
import java.text.SimpleDateFormat; import java.text.SimpleDateFormat;
import java.time.LocalDateTime; import java.time.LocalDateTime;
import java.util.ArrayList; import java.util.*;
import java.util.Date;
import java.util.List;
@Service @Service
public class CommonServiceImpl { public class CommonServiceImpl {
...@@ -25,6 +31,8 @@ public class CommonServiceImpl { ...@@ -25,6 +31,8 @@ public class CommonServiceImpl {
private EntityEnclosureMapper entityEnclosureMapper; private EntityEnclosureMapper entityEnclosureMapper;
@Autowired @Autowired
private IEntityEnclosureService entityEnclosureService; private IEntityEnclosureService entityEnclosureService;
@Resource
private TeamMapper teamMapper;
/** /**
* 生成编号 * 生成编号
...@@ -151,6 +159,35 @@ public class CommonServiceImpl { ...@@ -151,6 +159,35 @@ public class CommonServiceImpl {
public Map<String, Object> checkCount(Integer teamGroupId, Map<String, Object> resultMap ){
List<String> checkResutlList = teamMapper.getByGroup(teamGroupId);
//100倍
BigDecimal param100 = new BigDecimal(100.00);
Map<String, Object> countMap = new HashMap<>();
for(String name : checkResutlList){
if(name.equals("L.O.I")){
countMap.put("L.O.I",CheckCountUtil.checkCount(name,resultMap));
}else if(name.equals("SiO2")){
countMap.put("SiO2",CheckCountUtil.checkCount(name,resultMap));
}
}
//合量
BigDecimal countHL = CheckCountUtil.countHL(countMap);
countMap.put("合量", countHL);
//KH
BigDecimal countKH = CheckCountUtil.countKH(countMap);
countMap.put("KH", countKH);
return countMap;
}
......
...@@ -162,7 +162,7 @@ public class EntrustServiceImpl extends ServiceImpl<EntrustMapper, Entrust> impl ...@@ -162,7 +162,7 @@ public class EntrustServiceImpl extends ServiceImpl<EntrustMapper, Entrust> impl
} }
/** /**
* 置顶 * 置顶取消置顶
* @param id 委托表id * @param id 委托表id
* @return * @return
*/ */
...@@ -174,9 +174,16 @@ public class EntrustServiceImpl extends ServiceImpl<EntrustMapper, Entrust> impl ...@@ -174,9 +174,16 @@ public class EntrustServiceImpl extends ServiceImpl<EntrustMapper, Entrust> impl
if(entrust == null){ if(entrust == null){
return BaseResponse.errorMsg("数据错误"); return BaseResponse.errorMsg("数据错误");
} }
entrust.setUpdateTime(LocalDateTime.now()); String msg = "";
if(entrust.getCreateTime().isEqual(entrust.getUpdateTime())){
entrust.setUpdateTime(LocalDateTime.now());
msg = "置顶成功";
}else{
entrust.setUpdateTime(entrust.getCreateTime());
msg = "取消置顶成功";
}
entrustMapper.updateById(entrust); entrustMapper.updateById(entrust);
return BaseResponse.okMsg("置顶成功"); return BaseResponse.okMsg(msg);
} }
...@@ -478,7 +485,6 @@ public class EntrustServiceImpl extends ServiceImpl<EntrustMapper, Entrust> impl ...@@ -478,7 +485,6 @@ public class EntrustServiceImpl extends ServiceImpl<EntrustMapper, Entrust> impl
} }
if(query.getSampleHandleQueryList() != null && query.getSampleHandleQueryList().size()>0){ if(query.getSampleHandleQueryList() != null && query.getSampleHandleQueryList().size()>0){
List<SampleHandleQuery> sampleHandleQueryList = query.getSampleHandleQueryList(); List<SampleHandleQuery> sampleHandleQueryList = query.getSampleHandleQueryList();
List<SampleHandle> sampleHandleList = new ArrayList<>();
for(SampleHandleQuery sampleHandleQuery : sampleHandleQueryList){ for(SampleHandleQuery sampleHandleQuery : sampleHandleQueryList){
//样品处理表 //样品处理表
SampleHandle sampleHandle = new SampleHandle(); SampleHandle sampleHandle = new SampleHandle();
...@@ -496,7 +502,7 @@ public class EntrustServiceImpl extends ServiceImpl<EntrustMapper, Entrust> impl ...@@ -496,7 +502,7 @@ public class EntrustServiceImpl extends ServiceImpl<EntrustMapper, Entrust> impl
} }
BeanUtils.copyProperties(sampleHandleQuery, sampleHandle); BeanUtils.copyProperties(sampleHandleQuery, sampleHandle);
sampleHandle.setStatus(0).setCreateTime(LocalDateTime.now()); sampleHandle.setStatus(0).setCreateTime(LocalDateTime.now());
sampleHandleList.add(sampleHandle); sampleHandleMapper.insert(sampleHandle);
//样品处理项附件表 //样品处理项附件表
if(sampleHandle.getContent() != null){ if(sampleHandle.getContent() != null){
String[] handIdS = sampleHandle.getContent().split("、"); String[] handIdS = sampleHandle.getContent().split("、");
...@@ -518,7 +524,6 @@ public class EntrustServiceImpl extends ServiceImpl<EntrustMapper, Entrust> impl ...@@ -518,7 +524,6 @@ public class EntrustServiceImpl extends ServiceImpl<EntrustMapper, Entrust> impl
sampleHandleEnclosureService.saveBatch(sampleHandleEnclosureList); sampleHandleEnclosureService.saveBatch(sampleHandleEnclosureList);
} }
} }
sampleHandleService.saveBatch(sampleHandleList);
} }
//该委托单下的样品改为已领用状态 //该委托单下的样品改为已领用状态
/*QueryWrapper<Sample> sampleWrapper = new QueryWrapper<>(); /*QueryWrapper<Sample> sampleWrapper = new QueryWrapper<>();
...@@ -606,9 +611,32 @@ public class EntrustServiceImpl extends ServiceImpl<EntrustMapper, Entrust> impl ...@@ -606,9 +611,32 @@ public class EntrustServiceImpl extends ServiceImpl<EntrustMapper, Entrust> impl
Map<String, Object> params = new HashMap<>(); Map<String, Object> params = new HashMap<>();
params.put("id", id); params.put("id", id);
params.put("userId", loginUser.getId()); params.put("userId", loginUser.getId());
List<SampleHandleVo> SampleHandleList = sampleHandleMapper.getSampleHandleList(params); List<SampleHandleVo> sampleHandleList = sampleHandleMapper.getSampleHandleList(params);
Integer handleStatus = null;
if(sampleHandleList != null && sampleHandleList.size()>0){
for(SampleHandleVo shVo : sampleHandleList){
if(handleStatus != null && handleStatus != shVo.getStatus()){
return BaseResponse.errorMsg("接受或完成的状态信息错误");
}
handleStatus = shVo.getStatus()==1?1:(shVo.getStatus()==2?2:0);
String contentName = "";
if(shVo.getContent() != null){
String[] handIdS = shVo.getContent().split("、");
List<SampleHandleEnclosure> sampleHandleEnclosureList = new ArrayList<>();
for(String handleId : handIdS){
Handle handle = handleMapper.selectById(Integer.valueOf(handleId));
if(handle == null){
return BaseResponse.errorMsg("选择的处理项信息有误");
}
contentName = contentName.equals("")?handle.getName():contentName+"、"+handle.getName();
}
}
shVo.setContentName(contentName);
}
}
entrust.setIsHandle(handleStatus); //0显示接受按钮,1显示完成按钮(可以上传附件),2和null不显示按钮
map.put("entrust", entrust); map.put("entrust", entrust);
map.put("SampleHandleList", SampleHandleList); map.put("sampleHandleList", sampleHandleList);
return BaseResponse.okData(map); return BaseResponse.okData(map);
} }
...@@ -1029,7 +1057,7 @@ public class EntrustServiceImpl extends ServiceImpl<EntrustMapper, Entrust> impl ...@@ -1029,7 +1057,7 @@ public class EntrustServiceImpl extends ServiceImpl<EntrustMapper, Entrust> impl
*/ */
@Transactional @Transactional
@Override @Override
public BaseResponse<String> finishDistribution(Integer[] ids){ public BaseResponse<String> finishDistribution(Integer[]ids){
LoginUser loginUser = userService.getLoginUser(); LoginUser loginUser = userService.getLoginUser();
if(loginUser == null){ if(loginUser == null){
return BaseResponse.errorMsg("请登录账号"); return BaseResponse.errorMsg("请登录账号");
...@@ -1234,7 +1262,6 @@ public class EntrustServiceImpl extends ServiceImpl<EntrustMapper, Entrust> impl ...@@ -1234,7 +1262,6 @@ public class EntrustServiceImpl extends ServiceImpl<EntrustMapper, Entrust> impl
return BaseResponse.okData(sampleCheckVoList); return BaseResponse.okData(sampleCheckVoList);
} }
//
/** /**
* 根据样品id,检测组id,检测人id 查询任务检测附件信息 * 根据样品id,检测组id,检测人id 查询任务检测附件信息
...@@ -1253,12 +1280,20 @@ public class EntrustServiceImpl extends ServiceImpl<EntrustMapper, Entrust> impl ...@@ -1253,12 +1280,20 @@ public class EntrustServiceImpl extends ServiceImpl<EntrustMapper, Entrust> impl
} }
//校核计算 /**
public BaseResponse<String> checkCount(CheckQuery query){ * 校核计算
* @param teamGroupId
* @param mainResult
* @return
*/
public BaseResponse<Map<String, Object>> checkCount(Integer teamGroupId, Map<String, Object> mainResult){
Map<String, Object> map = commonService.checkCount(teamGroupId, mainResult);
return BaseResponse.okData(map);
}
return null;
}
//校核保存 //校核保存
...@@ -1306,7 +1341,6 @@ public class EntrustServiceImpl extends ServiceImpl<EntrustMapper, Entrust> impl ...@@ -1306,7 +1341,6 @@ public class EntrustServiceImpl extends ServiceImpl<EntrustMapper, Entrust> impl
check.setSampleId(checkQuery.getSampleId()) check.setSampleId(checkQuery.getSampleId())
.setUserId(loginUser.getId()) .setUserId(loginUser.getId())
.setEquipmentId(checkQuery.getEquipmentId()) .setEquipmentId(checkQuery.getEquipmentId())
.setEquipmentName(checkQuery.getEquipmentName())
.setCreateTime(LocalDateTime.now()); .setCreateTime(LocalDateTime.now());
sampleCheckService.save(check); sampleCheckService.save(check);
String testItems = ""; String testItems = "";
......
...@@ -7,13 +7,17 @@ import cn.wise.sc.cement.business.mapper.TeamGroupMapper; ...@@ -7,13 +7,17 @@ import cn.wise.sc.cement.business.mapper.TeamGroupMapper;
import cn.wise.sc.cement.business.mapper.TeamMapper; import cn.wise.sc.cement.business.mapper.TeamMapper;
import cn.wise.sc.cement.business.model.BaseResponse; import cn.wise.sc.cement.business.model.BaseResponse;
import cn.wise.sc.cement.business.model.PageQuery; import cn.wise.sc.cement.business.model.PageQuery;
import cn.wise.sc.cement.business.model.query.TeamGroupQuery;
import cn.wise.sc.cement.business.model.vo.GroupVo; import cn.wise.sc.cement.business.model.vo.GroupVo;
import cn.wise.sc.cement.business.service.ITeamGroupService; import cn.wise.sc.cement.business.service.ITeamGroupService;
import com.alibaba.fastjson.JSON;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.metadata.IPage; import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page; import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import org.apache.commons.lang3.StringUtils; import org.apache.commons.lang3.StringUtils;
import org.springframework.beans.BeanUtils;
import org.springframework.context.annotation.Bean;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional; import org.springframework.transaction.annotation.Transactional;
...@@ -58,7 +62,7 @@ public class TeamGroupServiceImpl extends ServiceImpl<TeamGroupMapper, TeamGroup ...@@ -58,7 +62,7 @@ public class TeamGroupServiceImpl extends ServiceImpl<TeamGroupMapper, TeamGroup
*/ */
@Override @Override
@Transactional @Transactional
public BaseResponse<TeamGroup> create(TeamGroup query) { public BaseResponse<TeamGroup> create(TeamGroupQuery query) {
if (StringUtils.isEmpty(query.getName())) { if (StringUtils.isEmpty(query.getName())) {
return BaseResponse.errorMsg("检测项组名称不能为空!"); return BaseResponse.errorMsg("检测项组名称不能为空!");
} }
...@@ -68,9 +72,17 @@ public class TeamGroupServiceImpl extends ServiceImpl<TeamGroupMapper, TeamGroup ...@@ -68,9 +72,17 @@ public class TeamGroupServiceImpl extends ServiceImpl<TeamGroupMapper, TeamGroup
if (count > 0) { if (count > 0) {
return BaseResponse.errorMsg(query.getName() + "已存在"); return BaseResponse.errorMsg(query.getName() + "已存在");
} }
query.setCreateTime(LocalDateTime.now()); TeamGroup teamGroup = new TeamGroup();
teamGroupMapper.insert(query); BeanUtils.copyProperties(query, teamGroup);
return BaseResponse.okData(query); if(query.getCheckElement() != null && query.getCheckElement().size()>0){
String checkElement = JSON.toJSON(query.getCheckElement()).toString();
teamGroup.setCheckElement(checkElement);
}else{
teamGroup.setCheckElement(null);
}
teamGroup.setCreateTime(LocalDateTime.now());
teamGroupMapper.insert(teamGroup);
return BaseResponse.okData(teamGroup);
} }
/** /**
...@@ -80,7 +92,7 @@ public class TeamGroupServiceImpl extends ServiceImpl<TeamGroupMapper, TeamGroup ...@@ -80,7 +92,7 @@ public class TeamGroupServiceImpl extends ServiceImpl<TeamGroupMapper, TeamGroup
*/ */
@Override @Override
@Transactional @Transactional
public BaseResponse<TeamGroup> update(TeamGroup query) { public BaseResponse<TeamGroup> update(TeamGroupQuery query) {
if (StringUtils.isEmpty(query.getName())) { if (StringUtils.isEmpty(query.getName())) {
return BaseResponse.errorMsg("检测项组名称不能为空!"); return BaseResponse.errorMsg("检测项组名称不能为空!");
} }
...@@ -91,8 +103,18 @@ public class TeamGroupServiceImpl extends ServiceImpl<TeamGroupMapper, TeamGroup ...@@ -91,8 +103,18 @@ public class TeamGroupServiceImpl extends ServiceImpl<TeamGroupMapper, TeamGroup
if (count > 0) { if (count > 0) {
return BaseResponse.errorMsg(query.getName() + "已存在"); return BaseResponse.errorMsg(query.getName() + "已存在");
} }
teamGroupMapper.updateById(query); TeamGroup teamGroup = teamGroupMapper.selectById(query.getId());
return BaseResponse.okData(query); if(teamGroup == null){
return BaseResponse.errorMsg("数据错误!");
}
if(query.getCheckElement() != null && query.getCheckElement().size()>0){
String checkElement = JSON.toJSON(query.getCheckElement()).toString();
teamGroup.setCheckElement(checkElement);
}else{
teamGroup.setCheckElement(null);
}
teamGroupMapper.updateById(teamGroup);
return BaseResponse.okData(teamGroup);
} }
......
...@@ -62,8 +62,8 @@ public class UserServiceImpl extends ServiceImpl<SysUserMapper, SysUser> impleme ...@@ -62,8 +62,8 @@ public class UserServiceImpl extends ServiceImpl<SysUserMapper, SysUser> impleme
public LoginUser getLoginUser() { public LoginUser getLoginUser() {
try { try {
String token = request.getHeader("Authorization"); String token = request.getHeader("Authorization");
System.out.println("==================Authorization==================="); // System.out.println("==================Authorization===================");
System.out.println(token); // System.out.println(token);
Map map = JwtUtil.parserToken(token); Map map = JwtUtil.parserToken(token);
Object obj = redisUtil.getString(map.get("id").toString()); Object obj = redisUtil.getString(map.get("id").toString());
BusinessExceptionEnum.CACHE_NOT_FOUND.assertNotNull(obj); BusinessExceptionEnum.CACHE_NOT_FOUND.assertNotNull(obj);
......
...@@ -46,19 +46,20 @@ public class WeiXinService { ...@@ -46,19 +46,20 @@ public class WeiXinService {
System.out.println("==================code==================="); System.out.println("==================code===================");
System.out.println(code); System.out.println(code);
try { try {
String accessToken = getAccessToken(); // String accessToken = getAccessToken();
String param = "access_token=%s&code=%s"; // String param = "access_token=%s&code=%s";
param = String.format(param, accessToken, code); // param = String.format(param, accessToken, code);
JSONObject jsonObject = WeixinInterfaceUtil.doGet(Global.USERINFOURL, param); // JSONObject jsonObject = WeixinInterfaceUtil.doGet(Global.USERINFOURL, param);
if(jsonObject.get("errcode").toString().equals("40029")){ // if(jsonObject.get("errcode").toString().equals("40029")){
return BaseResponse.errorMsg("code失效!"); // return BaseResponse.errorMsg("code失效!");
} // }
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
SysUser sysUser = userService.getOne(wrapper); SysUser sysUser = userService.getOne(wrapper);
if(sysUser == null){ if(sysUser == null){
return BaseResponse.errorMsg("非系统用户不允许登录!"); return BaseResponse.errorMsg("非系统用户不允许登录!");
......
package cn.wise.sc.cement.business.util;
import org.apache.poi.hssf.usermodel.HSSFWorkbook;
import org.apache.poi.ss.formula.functions.T;
import org.apache.poi.ss.usermodel.*;
import javax.servlet.http.HttpServletResponse;
import java.io.*;
import java.math.BigDecimal;
import java.math.BigInteger;
import java.util.ArrayList;
import java.util.List;
import java.util.Map;
/**
* excel工具类
*
* @author zhutianwei
*
*/
public class CheckCountUtil {
//倍数
public final static BigDecimal param10 = new BigDecimal(10.00);
public final static BigDecimal param100 = new BigDecimal(100.00);
public final static BigDecimal param1000 = new BigDecimal(1000.00);
//object 转成 BigDecimal
public static BigDecimal getBigDecimal(Object value ) {
BigDecimal ret = null;
if( value != null ) {
if( value instanceof BigDecimal ) {
ret = (BigDecimal) value;
} else if( value instanceof String ) {
ret = new BigDecimal( (String) value );
} else if( value instanceof BigInteger) {
ret = new BigDecimal( (BigInteger) value );
} else if( value instanceof Number ) {
ret = new BigDecimal( ((Number)value).doubleValue() );
} else {
throw new ClassCastException("Not possible to coerce ["+value+"] from class "+value.getClass()+" into a BigDecimal.");
}
}
return ret;
}
/**
* 检测项名称
* @param name
* @return
*/
//加 add 减 subtract 乘 multiply 除 divide
public static BigDecimal checkCount(String name, Map<String, Object> resultMap) {
BigDecimal endResult = null;
if(name.equals("L.O.I")){
//样重m1—保留4位⼩数
BigDecimal m1 = getBigDecimal(resultMap.get("样重m1")).setScale(4,BigDecimal.ROUND_HALF_UP);
//空堝重m2—保留4位⼩数
BigDecimal m2 = getBigDecimal(resultMap.get("空堝重m2")).setScale(4,BigDecimal.ROUND_HALF_UP);
//烧后重m3—保留4位⼩数
BigDecimal m3 = getBigDecimal(resultMap.get("烧后重m3")).setScale(4,BigDecimal.ROUND_HALF_UP);
//计算的核心公式结果
BigDecimal countResult = (m1.add(m2).subtract(m3)).divide(m1);
BigDecimal result1 = countResult.multiply(param100.multiply(param100));
int resultInt1 = result1.setScale( 0, BigDecimal.ROUND_DOWN ).intValue();
if((resultInt1&1) == 1){ //如果结果为奇数
endResult = countResult.multiply(param100).setScale(2,BigDecimal.ROUND_HALF_UP);
}else{
endResult = countResult.multiply(param100).subtract(new BigDecimal(0.0000000001)).setScale(2,BigDecimal.ROUND_HALF_UP);
}
}else if(name.equals("SiO2")){
//毫升数
BigDecimal VSiO2 = getBigDecimal(resultMap.get("VSiO2"));
//滴定度
BigDecimal TSiO2 = getBigDecimal(resultMap.get("TSiO2"));
//样m
BigDecimal m = getBigDecimal(resultMap.get("样重m"));
//计算的核心公式结果
BigDecimal countResult = VSiO2.multiply(TSiO2).divide(m);
BigDecimal result1 = countResult.multiply(param100);
int resultInt1 = result1.setScale( 0, BigDecimal.ROUND_DOWN ).intValue();
if((resultInt1&1) == 1){ //如果结果为奇数
endResult = countResult.setScale(2,BigDecimal.ROUND_HALF_UP);
}else{
endResult = countResult.subtract(new BigDecimal(0.0000000001)).setScale(2,BigDecimal.ROUND_HALF_UP);
}
}else if(name.equals("Al2O3+TiO2")){
BigDecimal TAl2O3 = getBigDecimal(resultMap.get("TAl2O3"));
BigDecimal VAl2O3 = getBigDecimal(resultMap.get("VAl2O3"));
BigDecimal K = getBigDecimal(resultMap.get("K"));
BigDecimal VCuSO4_I = getBigDecimal(resultMap.get("VCuSO4(I)"));
BigDecimal m = getBigDecimal(resultMap.get("样重m"));
//计算的核心公式结果
BigDecimal countResult = TAl2O3.multiply(VAl2O3.subtract(K.multiply(VCuSO4_I))).divide(m);
BigDecimal result1 = countResult.multiply(param100);
int resultInt1 = result1.setScale( 0, BigDecimal.ROUND_DOWN ).intValue();
if((resultInt1&1) == 1){ //如果结果为奇数
endResult = countResult.setScale(2,BigDecimal.ROUND_HALF_UP);
}else{
endResult = countResult.subtract(new BigDecimal(0.0000000001)).setScale(2,BigDecimal.ROUND_HALF_UP);
}
}else if(name.equals("Al2O3")){
BigDecimal TAl2O3 = getBigDecimal(resultMap.get("TAl2O3"));
BigDecimal VAl2O3 = getBigDecimal(resultMap.get("VAl2O3"));
BigDecimal K = getBigDecimal(resultMap.get("K"));
BigDecimal VCuSO4_I = getBigDecimal(resultMap.get("VCuSO4(I)"));
BigDecimal m = getBigDecimal(resultMap.get("样重m"));
BigDecimal VCuSO4_II = getBigDecimal(resultMap.get("VCuSO4(II)"));
//计算的核心公式结果
BigDecimal countResult = TAl2O3.multiply(VAl2O3.subtract(K.multiply(VCuSO4_I.add(VCuSO4_II)))).divide(m);
BigDecimal result1 = countResult.multiply(param100);
int resultInt1 = result1.setScale( 0, BigDecimal.ROUND_DOWN ).intValue();
if((resultInt1&1) == 1){ //如果结果为奇数
endResult = countResult.setScale(2,BigDecimal.ROUND_HALF_UP);
}else{
endResult = countResult.subtract(new BigDecimal(0.0000000001)).setScale(2,BigDecimal.ROUND_HALF_UP);
}
}else if(name.equals("Fe2O3")){
BigDecimal TFe2O3 = getBigDecimal(resultMap.get("TFe2O3"));
BigDecimal VF2O3 = getBigDecimal(resultMap.get("VF2O3"));
BigDecimal m = getBigDecimal(resultMap.get("样重m"));
//计算的核心公式结果
BigDecimal countResult = TFe2O3.multiply(VF2O3).divide(m);
BigDecimal result1 = countResult.multiply(param100);
int resultInt1 = result1.setScale( 0, BigDecimal.ROUND_DOWN ).intValue();
if((resultInt1&1) == 1){ //如果结果为奇数
endResult = countResult.setScale(2,BigDecimal.ROUND_HALF_UP);
}else{
endResult = countResult.subtract(new BigDecimal(0.0000000001)).setScale(2,BigDecimal.ROUND_HALF_UP);
}
}else if(name.equals("Cl")){
BigDecimal T = getBigDecimal(resultMap.get("T"));
BigDecimal V2 = getBigDecimal(resultMap.get("V2 "));
BigDecimal V1 = getBigDecimal(resultMap.get("V1 "));
BigDecimal mCl = getBigDecimal(resultMap.get("样重Cl"));
//计算的核心公式结果
BigDecimal countResult = T.multiply(V2.subtract(V1)).divide(mCl).divide(param10);
BigDecimal result1 = countResult.multiply(param1000);
int resultInt1 = result1.setScale( 0, BigDecimal.ROUND_DOWN ).intValue();
if((resultInt1&1) == 1){ //如果结果为奇数
endResult = countResult.setScale(3,BigDecimal.ROUND_HALF_UP);
}else{
endResult = countResult.subtract(new BigDecimal(0.00000000001)).setScale(3,BigDecimal.ROUND_HALF_UP);
}
}else if(name.equals("CaO")){
BigDecimal TCaO = getBigDecimal(resultMap.get("TCaO"));
BigDecimal VCaO = getBigDecimal(resultMap.get("VCaO"));
BigDecimal m = getBigDecimal(resultMap.get("样重m"));
//计算的核心公式结果
BigDecimal countResult = TCaO.multiply(VCaO).divide(m);
BigDecimal result1 = countResult.multiply(param100);
int resultInt1 = result1.setScale( 0, BigDecimal.ROUND_DOWN ).intValue();
if((resultInt1&1) == 1){ //如果结果为奇数
endResult = countResult.setScale(2,BigDecimal.ROUND_HALF_UP);
}else{
endResult = countResult.subtract(new BigDecimal(0.00000000001)).setScale(2,BigDecimal.ROUND_HALF_UP);
}
}
return endResult;
}
/**
* 求合量 L.O.I+SiO2+Al2O3+Fe2O3+CaO+MgO+TiO2+K2O+Na2O+MnO+SO3
* @param countMap
* @return
*/
public static BigDecimal countHL(Map<String, Object> countMap) {
List<String> list = new ArrayList<>();
list.add(countMap.get("L.O.I").toString());
list.add(countMap.get("SiO2").toString());
list.add(countMap.get("Al2O3").toString());
list.add(countMap.get("Fe2O3").toString());
list.add(countMap.get("CaO").toString());
list.add(countMap.get("MgO").toString());
list.add(countMap.get("TiO2").toString());
list.add(countMap.get("K2O").toString());
list.add(countMap.get("Na2O").toString());
list.add(countMap.get("MnO").toString());
list.add(countMap.get("SO3").toString());
BigDecimal count=new BigDecimal(0);
for(String s:list) {
count = count.add(new BigDecimal(s));
}
return count;
}
/**
* 求KH (CaO - 1.65*{Al2O3+TiO2} * Fe2O3) / 2.8 / SiO2
* @param countMap
* @return
*/
public static BigDecimal countKH(Map<String, Object> countMap) {
BigDecimal CaO = getBigDecimal(countMap.get("Cao"));
BigDecimal Al2O3_TiO2= getBigDecimal(countMap.get("Al2O3+TiO2"));
BigDecimal Fe2O3 = getBigDecimal(countMap.get("Fe2O3"));
BigDecimal SiO2 = getBigDecimal(countMap.get("SiO2"));
BigDecimal KH =
CaO.subtract(new BigDecimal(1.65).multiply(Al2O3_TiO2).multiply(Fe2O3)).divide(new BigDecimal(2.8)).divide(SiO2);
return KH;
}
}
//计算多个值的和
/*List<String> list=new ArrayList<>();
list.add("123.0");
list.add("12.0");
list.add("3.0");
BigDecimal count=new BigDecimal(0);
for(String s:list) {
count = count.add(new BigDecimal(s));
}
System.out.println(count);
*/
...@@ -21,6 +21,10 @@ spring: ...@@ -21,6 +21,10 @@ spring:
port: 6379 port: 6379
host: localhost host: localhost
# password: Wise_@123456 # password: Wise_@123456
servlet:
multipart:
max-file-size: 100MB
max-request-size: 100MB
# 设置swagger用户名密码 # 设置swagger用户名密码
swagger: swagger:
basic: basic:
......
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