Commit e80adf63 authored by 罗贤顺's avatar 罗贤顺

送样单、送样结果单接口修改

parent 3e78be57
......@@ -2,7 +2,9 @@ package cn.wise.sc.acquisition.business.controller;
import cn.wise.sc.acquisition.business.model.query.TSampleLaboratorysheetQuery;
import cn.wise.sc.acquisition.business.model.query.TSampleListQuery;
import cn.wise.sc.acquisition.business.service.ITSampleLaboratorysheetService;
import cn.wise.sc.acquisition.business.wrapper.page.Query;
import com.baomidou.mybatisplus.extension.api.R;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiImplicitParam;
......@@ -30,6 +32,21 @@ public class TSampleLaboratorysheetController {
@Autowired
private ITSampleLaboratorysheetService itSampleLaboratorysheetService;
/**
* 根据条件查询送验单 分页
*
* @return
*/
@ApiOperation(value = "获取送验单列表 可分页模糊查询")
@ApiImplicitParams(value = {
@ApiImplicitParam(name = "search", value = "搜索关键字", paramType = "query", dataType = "String")
})
@RequestMapping(value = "/getPage", method = RequestMethod.GET)
public R getPage(Query query, String search) {
TSampleLaboratorysheetQuery param = new TSampleLaboratorysheetQuery();
param.setSearch(search);
return itSampleLaboratorysheetService.getPage(param, query);
}
/**
* 根据样号查看分析结果
......
......@@ -122,5 +122,11 @@ public class TSampleLaboratorysheetQuery {
@ApiModelProperty("化验时间")
private LocalDateTime Hysj;
/**
* 搜索字段
*/
@ApiModelProperty("搜索字段")
private String search;
}
......@@ -2,6 +2,8 @@ package cn.wise.sc.acquisition.business.service;
import cn.wise.sc.acquisition.business.entity.TSampleLaboratorysheet;
import cn.wise.sc.acquisition.business.model.query.TSampleLaboratorysheetQuery;
import cn.wise.sc.acquisition.business.model.query.TSampleListQuery;
import cn.wise.sc.acquisition.business.wrapper.page.Query;
import com.baomidou.mybatisplus.extension.api.R;
import com.baomidou.mybatisplus.extension.service.IService;
......@@ -27,5 +29,7 @@ public interface ITSampleLaboratorysheetService extends IService<TSampleLaborato
R getImage(TSampleLaboratorysheetQuery query, final HttpServletResponse response);
R getPage(TSampleLaboratorysheetQuery tSampleLaboratorysheetQuery, Query query);
R getList();
}
......@@ -261,12 +261,12 @@ public class TProcessesBlastdesignHoleServiceImpl extends ServiceImpl<TProcesses
}
}
//查看设计爆区爆破量是否存在数据
TProcessesBlastdesignVolumeQuery tProcessesBlastdesignVolumeQuery = new TProcessesBlastdesignHoleQuery();
/* TProcessesBlastdesignVolumeQuery tProcessesBlastdesignVolumeQuery = new TProcessesBlastdesignHoleQuery();
BeanUtils.copyProperties(query, tProcessesBlastdesignVolumeQuery);
R r = itProcessesBlastdesignVolumeService.getByQuery(tProcessesBlastdesignVolumeQuery);
if (r.getData() == null) {
return R.failed("炮孔设计中->设计爆区爆破量表数据不存在,StopeName,StepName,BlastAreaName");
}
}*/
//根据炮孔编号判断炮孔是否存在
QueryWrapper<TProcessesBlastdesignHole> queryWrapper = new QueryWrapper<>();
queryWrapper.eq(StringUtils.isNotBlank(query.getBlastHoleID()), "BlastHoleID", query.getBlastHoleID());
......@@ -278,12 +278,12 @@ public class TProcessesBlastdesignHoleServiceImpl extends ServiceImpl<TProcesses
TProcessesBlastdesignHole tProcessesBlastdesignHole = new TProcessesBlastdesignHole();
BeanUtils.copyProperties(query, tProcessesBlastdesignHole);
//设置设计日期
TProcessesBlastdesignVolume volume = (TProcessesBlastdesignVolume) r.getData();
/* TProcessesBlastdesignVolume volume = (TProcessesBlastdesignVolume) r.getData();
if (volume.getDesignDate() == null) {
log.error("炮孔设计中->设计爆区爆破量表数据中设计日期为空:{}", JSON.toJSONString(volume));
return R.failed("炮孔设计中->设计爆区爆破量表数据中设计日期为空:" + JSON.toJSONString(volume));
}
tProcessesBlastdesignHole.setDesignDate(volume.getDesignDate());
tProcessesBlastdesignHole.setDesignDate(volume.getDesignDate());*/
//单孔爆破量(m3)=孔距*排距*台阶高度
calculateHoleBlastVolume(tProcessesBlastdesignHole);
//设置tag
......
......@@ -9,10 +9,15 @@ import cn.wise.sc.acquisition.business.model.query.TSampleListQuery;
import cn.wise.sc.acquisition.business.service.ITSampleLaboratorysheetService;
import cn.wise.sc.acquisition.business.service.ITSampleListService;
import cn.wise.sc.acquisition.business.util.ImageUtil;
import cn.wise.sc.acquisition.business.wrapper.page.Query;
import com.alibaba.fastjson.JSON;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.extension.api.R;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import lombok.extern.slf4j.Slf4j;
import org.apache.commons.lang3.StringUtils;
import org.springframework.beans.BeanUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
......@@ -54,6 +59,21 @@ public class TSampleLaboratorysheetServiceImpl extends ServiceImpl<TSampleLabora
//参数校验
Rcode.NOT_PARAM.assertNotNull(query);
Rcode.NOT_PARAM.assertNotEmpty(query.getYh());
Rcode.NOT_PARAM.assertNotEmpty(query.getLaboratoryID());
Rcode.NOT_PARAM.assertNotNull(query.getSysj());
Rcode.NOT_PARAM.assertNotNull(query.getHysj());
Rcode.NOT_PARAM.assertNotEmpty(query.getHyr());
Rcode.NOT_PARAM.assertNotEmpty(query.getFpcfwz());
Rcode.NOT_PARAM.assertNotNull(query.getCao());
Rcode.NOT_PARAM.assertNotNull(query.getMgO());
Rcode.NOT_PARAM.assertNotNull(query.getSiO2());
Rcode.NOT_PARAM.assertNotNull(query.getAl2O3());
Rcode.NOT_PARAM.assertNotNull(query.getFe2O3());
Rcode.NOT_PARAM.assertNotNull(query.getK2o());
Rcode.NOT_PARAM.assertNotNull(query.getNa2O());
Rcode.NOT_PARAM.assertNotNull(query.getSo3());
Rcode.NOT_PARAM.assertNotNull(query.getCl());
Rcode.NOT_PARAM.assertNotNull(query.getSsl());
//查询数据
TSampleLaboratorysheet tSampleLaboratorysheet = baseMapper.selectById(query.getYh());
if (tSampleLaboratorysheet == null) {
......@@ -107,23 +127,7 @@ public class TSampleLaboratorysheetServiceImpl extends ServiceImpl<TSampleLabora
if (temp1.getData() != null) {
return R.failed("结果分析单中->分析结果样号已存在,样号:" + query.getYh());
}
//继续判断参数
Rcode.NOT_PARAM.assertNotEmpty(query.getLaboratoryID());
Rcode.NOT_PARAM.assertNotNull(query.getSysj());
Rcode.NOT_PARAM.assertNotNull(query.getHysj());
Rcode.NOT_PARAM.assertNotEmpty(query.getHyr());
Rcode.NOT_PARAM.assertNotEmpty(query.getFpcfwz());
Rcode.NOT_PARAM.assertNotNull(query.getCao());
Rcode.NOT_PARAM.assertNotNull(query.getMgO());
Rcode.NOT_PARAM.assertNotNull(query.getSiO2());
Rcode.NOT_PARAM.assertNotNull(query.getAl2O3());
Rcode.NOT_PARAM.assertNotNull(query.getFe2O3());
Rcode.NOT_PARAM.assertNotNull(query.getK2o());
Rcode.NOT_PARAM.assertNotNull(query.getNa2O());
Rcode.NOT_PARAM.assertNotNull(query.getSo3());
Rcode.NOT_PARAM.assertNotNull(query.getCl());
Rcode.NOT_PARAM.assertNotNull(query.getSsl());
//封装
TSampleLaboratorysheet tSampleLaboratorysheet = new TSampleLaboratorysheet();
BeanUtils.copyProperties(query, tSampleLaboratorysheet);
......@@ -191,6 +195,21 @@ public class TSampleLaboratorysheetServiceImpl extends ServiceImpl<TSampleLabora
return R.failed("结果分析单中->该条数据没有图片");
}
@Override
public R getPage(TSampleLaboratorysheetQuery tSampleLaboratorysheetQuery, Query query) {
log.info(JSON.toJSONString(tSampleLaboratorysheetQuery));
//分页
Page<TSampleLaboratorysheet> page = new Page<>();
LambdaQueryWrapper<TSampleLaboratorysheet> queryWrapper = new LambdaQueryWrapper<>();
queryWrapper.select(TSampleLaboratorysheet::getSysj,TSampleLaboratorysheet::getYh);
queryWrapper.like(StringUtils.isNotBlank(tSampleLaboratorysheetQuery.getSearch()),TSampleLaboratorysheet::getSysj,tSampleLaboratorysheetQuery.getSearch())
.or()
.like(StringUtils.isNotBlank(tSampleLaboratorysheetQuery.getSearch()),TSampleLaboratorysheet::getYh,tSampleLaboratorysheetQuery.getSearch());
//查询
Page<TSampleLaboratorysheet> tSampleLaboratorysheetPage = baseMapper.selectPage(page, queryWrapper);
return R.ok(tSampleLaboratorysheetPage);
}
@Override
public R getList() {
List<TSampleLaboratorysheet> list = baseMapper.getList();
......
......@@ -4,8 +4,10 @@ import cn.wise.sc.acquisition.business.constant.Rcode;
import cn.wise.sc.acquisition.business.entity.TSampleList;
import cn.wise.sc.acquisition.business.enumation.ProjectEnum;
import cn.wise.sc.acquisition.business.mapper.TSampleListMapper;
import cn.wise.sc.acquisition.business.model.query.TSampleLaboratorysheetQuery;
import cn.wise.sc.acquisition.business.model.query.TSampleListQuery;
import cn.wise.sc.acquisition.business.service.ITProcessesBlastdesignHoleService;
import cn.wise.sc.acquisition.business.service.ITSampleLaboratorysheetService;
import cn.wise.sc.acquisition.business.service.ITSampleListService;
import cn.wise.sc.acquisition.business.util.ImageUtil;
import cn.wise.sc.acquisition.business.wrapper.page.Query;
......@@ -41,6 +43,9 @@ public class TSampleListServiceImpl extends ServiceImpl<TSampleListMapper, TSamp
@Autowired
private ITProcessesBlastdesignHoleService itProcessesBlastdesignHoleService;
@Autowired
private ITSampleLaboratorysheetService itSampleLaboratorysheetService;
@Override
public R getPage(TSampleListQuery tSampleListQuery, Query query) {
log.info(JSON.toJSONString(tSampleListQuery));
......@@ -60,7 +65,9 @@ public class TSampleListServiceImpl extends ServiceImpl<TSampleListMapper, TSamp
queryWrapper
.like(StringUtils.isNotBlank(tSampleListQuery.getSearch()), ProjectEnum.TSampleListType.YH.getLabel(), tSampleListQuery.getSearch())
.or()
.like(StringUtils.isNotBlank(tSampleListQuery.getSearch()), ProjectEnum.TSampleListType.HOLES_ID.getLabel(), tSampleListQuery.getSearch());
.like(StringUtils.isNotBlank(tSampleListQuery.getSearch()), ProjectEnum.TSampleListType.HOLES_ID.getLabel(), tSampleListQuery.getSearch())
.or()
.like(StringUtils.isNotBlank(tSampleListQuery.getSearch()), ProjectEnum.TSampleListType.SYRQ.getLabel(), tSampleListQuery.getSearch());
//查询
Page<TSampleList> tSampleListPage = baseMapper.selectPage(page, queryWrapper);
return R.ok(tSampleListPage);
......@@ -108,7 +115,7 @@ public class TSampleListServiceImpl extends ServiceImpl<TSampleListMapper, TSamp
if (update > 0) {
return R.ok("送样单中->修改成功");
} else {
log.error("送样单中->修改失败 {}",JSON.toJSONString(tSampleList));
log.error("送样单中->修改失败 {}", JSON.toJSONString(tSampleList));
return R.failed("送样单中->修改失败");
}
......@@ -146,9 +153,19 @@ public class TSampleListServiceImpl extends ServiceImpl<TSampleListMapper, TSamp
log.info(JSON.toJSONString(tSampleList));
int insert = baseMapper.insert(tSampleList);
if (insert > 0) {
R r0 = getByYh(query);
TSampleList data = (TSampleList) r0.getData();
//增加一条分析结果单
TSampleLaboratorysheetQuery tSampleLaboratorysheetQuery = new TSampleLaboratorysheetQuery();
tSampleLaboratorysheetQuery.setYh(data.getYh());
R r1 = itSampleLaboratorysheetService.insertTSampleLaboratorysheet(tSampleLaboratorysheetQuery);
if (r1.getCode() != 0) {
log.error("送样单中->增加一条结果单失败:" + JSON.toJSONString(tSampleLaboratorysheetQuery));
return R.failed(r1.getMsg());
}
return R.ok("送样单中->增加成功");
} else {
log.error("送样单中->增加失败:{}",JSON.toJSONString(tSampleList));
log.error("送样单中->增加失败:{}", JSON.toJSONString(tSampleList));
return R.failed("送样单中->增加失败");
}
......
......@@ -48,13 +48,12 @@
a.x,
a.y,
a.z,
a.StepHeight,
b.BlastVolume
a.StepHeight
FROM T_Processes_BlastDesign_Hole a
<include refid="TProcessesBlastdesignHoleJoins"/>
<where>
${ew.sqlSegment}
</where>
where 1=1
<if test="params.designDate != null and params.designDate != ''">
and Convert(varchar(10),a.DesignDate,120) <![CDATA[ = ]]> #{params.designDate}
</if>
</select>
......@@ -83,5 +82,11 @@
<select id="getBalestHoleId" resultType="java.lang.String">
select BlastHoleID from T_Processes_BlastDesign_Hole
</select>
<select id="getBalestVolume" resultType="cn.wise.sc.acquisition.business.model.vo.TProcessesBlastdesignHoleVo">
select sum(HoleBlastVolume) BlastVolume from T_Processes_BlastDesign_Hole
<where>
${ew.sqlSegment}
</where>
</select>
</mapper>
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