Commit b5305763 authored by renchao's avatar renchao

送验单模块代码编写

parent 1900ea9b
...@@ -26,4 +26,5 @@ public interface ITSampleLaboratorysheetService extends IService<TSampleLaborato ...@@ -26,4 +26,5 @@ public interface ITSampleLaboratorysheetService extends IService<TSampleLaborato
R insertTSampleLaboratorysheet(TSampleLaboratorysheetQuery tSampleLaboratorysheetQuery); R insertTSampleLaboratorysheet(TSampleLaboratorysheetQuery tSampleLaboratorysheetQuery);
R getImage(TSampleLaboratorysheetQuery query, final HttpServletResponse response); R getImage(TSampleLaboratorysheetQuery query, final HttpServletResponse response);
} }
...@@ -16,7 +16,6 @@ import org.springframework.beans.BeanUtils; ...@@ -16,7 +16,6 @@ import org.springframework.beans.BeanUtils;
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 org.springframework.transaction.annotation.Transactional; import org.springframework.transaction.annotation.Transactional;
import org.springframework.util.Assert;
import javax.servlet.http.HttpServletResponse; import javax.servlet.http.HttpServletResponse;
...@@ -44,6 +43,7 @@ public class TSampleLaboratorysheetServiceImpl extends ServiceImpl<TSampleLabora ...@@ -44,6 +43,7 @@ public class TSampleLaboratorysheetServiceImpl extends ServiceImpl<TSampleLabora
return R.ok(tSampleLaboratorysheet); return R.ok(tSampleLaboratorysheet);
} }
@Override @Override
public R updateByYh(TSampleLaboratorysheetQuery tSampleLaboratorysheetQuery) { public R updateByYh(TSampleLaboratorysheetQuery tSampleLaboratorysheetQuery) {
log.info(JSON.toJSONString(tSampleLaboratorysheetQuery)); log.info(JSON.toJSONString(tSampleLaboratorysheetQuery));
...@@ -81,10 +81,16 @@ public class TSampleLaboratorysheetServiceImpl extends ServiceImpl<TSampleLabora ...@@ -81,10 +81,16 @@ public class TSampleLaboratorysheetServiceImpl extends ServiceImpl<TSampleLabora
//参数校验 //参数校验
Rcode.NOT_PARAM.assertNotEmpty(tSampleLaboratorysheetQuery.getYh()); Rcode.NOT_PARAM.assertNotEmpty(tSampleLaboratorysheetQuery.getYh());
//判断是否存在送样号 //判断是否存在送样号
R r = tSampleListService.getByYh(new TSampleListQuery(tSampleLaboratorysheetQuery.getYh())); R temp = tSampleListService.getByYh(new TSampleListQuery(tSampleLaboratorysheetQuery.getYh()));
if (r.getData() == null) { if (temp.getData() == null) {
return R.failed("送验单不存在,样号:" + tSampleLaboratorysheetQuery.getYh()); return R.failed("送验单不存在,样号:" + tSampleLaboratorysheetQuery.getYh());
} }
//判断是否已经存在分析结果单
R temp1 = getByYh(tSampleLaboratorysheetQuery);
if (temp1.getData() != null) {
return R.failed("分析结果样号已存在,样号:" + tSampleLaboratorysheetQuery.getYh());
}
//继续判断参数 //继续判断参数
Rcode.NOT_PARAM.assertNotEmpty(tSampleLaboratorysheetQuery.getLaboratoryID()); Rcode.NOT_PARAM.assertNotEmpty(tSampleLaboratorysheetQuery.getLaboratoryID());
Rcode.NOT_PARAM.assertNotNull(tSampleLaboratorysheetQuery.getSysj()); Rcode.NOT_PARAM.assertNotNull(tSampleLaboratorysheetQuery.getSysj());
......
...@@ -97,8 +97,14 @@ public class TSampleListServiceImpl extends ServiceImpl<TSampleListMapper, TSamp ...@@ -97,8 +97,14 @@ public class TSampleListServiceImpl extends ServiceImpl<TSampleListMapper, TSamp
public R insertSampleList(TSampleListQuery query) { public R insertSampleList(TSampleListQuery query) {
log.info(JSON.toJSONString(query)); log.info(JSON.toJSONString(query));
//参数校验 //参数校验
Rcode.NOT_PARAM.assertNotEmpty(query.getHolesID());
Rcode.NOT_PARAM.assertNotEmpty(query.getYh()); Rcode.NOT_PARAM.assertNotEmpty(query.getYh());
//判断数据是否已存在,如果存在不能添加
R r = getByYh(query);
if (r.getData() != null) {
return R.failed("送验单样号已存在,样号:" + query.getYh());
}
//继续判断参数
Rcode.NOT_PARAM.assertNotEmpty(query.getHolesID());
Rcode.NOT_PARAM.assertNotEmpty(query.getStart()); Rcode.NOT_PARAM.assertNotEmpty(query.getStart());
Rcode.NOT_PARAM.assertNotEmpty(query.getEndTo()); Rcode.NOT_PARAM.assertNotEmpty(query.getEndTo());
Rcode.NOT_PARAM.assertNotEmpty(query.getRecordName()); Rcode.NOT_PARAM.assertNotEmpty(query.getRecordName());
......
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