Commit 51dc5098 by wangweidong

土工平台修改

parent 11fd0bcf
...@@ -2,16 +2,15 @@ package com.patzn.cloud.service.lims.common; ...@@ -2,16 +2,15 @@ package com.patzn.cloud.service.lims.common;
import com.google.common.collect.Lists; import com.google.common.collect.Lists;
import org.apache.poi.ooxml.POIXMLDocumentPart;
import org.apache.poi.ss.usermodel.CellType; import org.apache.poi.ss.usermodel.CellType;
import org.apache.poi.ss.usermodel.PictureData;
import org.apache.poi.ss.usermodel.Workbook; import org.apache.poi.ss.usermodel.Workbook;
import org.apache.poi.ss.util.CellRangeAddress; import org.apache.poi.ss.util.CellRangeAddress;
import org.apache.poi.xssf.usermodel.*; import org.apache.poi.xssf.usermodel.*;
import org.openxmlformats.schemas.drawingml.x2006.spreadsheetDrawing.CTMarker;
import java.io.*; import java.io.*;
import java.util.HashMap; import java.util.*;
import java.util.Iterator;
import java.util.List;
import java.util.Map;
public class POIUtil { public class POIUtil {
public static void copyCellStyle(XSSFCellStyle fromStyle, XSSFCellStyle toStyle) { public static void copyCellStyle(XSSFCellStyle fromStyle, XSSFCellStyle toStyle) {
...@@ -40,6 +39,8 @@ public class POIUtil { ...@@ -40,6 +39,8 @@ public class POIUtil {
CellType cellType = fromCell.getCellType(); CellType cellType = fromCell.getCellType();
toCell.setCellType(cellType); toCell.setCellType(cellType);
if (fromCell == null || fromCell.equals(null) || fromCell.getCellType() == CellType.BLANK) { if (fromCell == null || fromCell.equals(null) || fromCell.getCellType() == CellType.BLANK) {
toCell.setCellValue(""); toCell.setCellValue("");
} else { } else {
...@@ -94,27 +95,27 @@ public class POIUtil { ...@@ -94,27 +95,27 @@ public class POIUtil {
File file1 = new File("D://excel//封面.xlsx"); File file1 = new File("D://excel//封面.xlsx");
File file2 = new File("D://excel//检测报告(力学试验)三轴.xlsx"); File file2 = new File("D://excel//检测报告(力学试验)三轴.xlsx");
File file3 = new File("D://excel//检测报告(力学试验)手动十字板.xlsx"); // File file3 = new File("D://excel//检测报告(力学试验)手动十字板.xlsx");
File file4 = new File("D://excel//检测报告(力学试验)休止角.xlsx"); // File file4 = new File("D://excel//检测报告(力学试验)休止角.xlsx");
File file5 = new File("D://excel//检测报告(力学试验)袖珍贯入仪.xlsx"); // File file5 = new File("D://excel//检测报告(力学试验)袖珍贯入仪.xlsx");
File file6 = new File("D://excel//检测报告(力学试验)直剪.xlsx"); // File file6 = new File("D://excel//检测报告(力学试验)直剪.xlsx");
try { try {
XSSFWorkbook workbook1 = new XSSFWorkbook(file1); XSSFWorkbook workbook1 = new XSSFWorkbook(file1);
XSSFWorkbook workbook2 = new XSSFWorkbook(file2); XSSFWorkbook workbook2 = new XSSFWorkbook(file2);
XSSFWorkbook workbook3 = new XSSFWorkbook(file3); // XSSFWorkbook workbook3 = new XSSFWorkbook(file3);
XSSFWorkbook workbook4 = new XSSFWorkbook(file4); // XSSFWorkbook workbook4 = new XSSFWorkbook(file4);
XSSFWorkbook workbook5 = new XSSFWorkbook(file5); // XSSFWorkbook workbook5 = new XSSFWorkbook(file5);
XSSFWorkbook workbook6 = new XSSFWorkbook(file6); // XSSFWorkbook workbook6 = new XSSFWorkbook(file6);
workbooks.add(workbook1); workbooks.add(workbook1);
workbooks.add(workbook2); workbooks.add(workbook2);
workbooks.add(workbook3); // workbooks.add(workbook3);
workbooks.add(workbook4); // workbooks.add(workbook4);
workbooks.add(workbook5); // workbooks.add(workbook5);
workbooks.add(workbook6); // workbooks.add(workbook6);
...@@ -135,6 +136,8 @@ public class POIUtil { ...@@ -135,6 +136,8 @@ public class POIUtil {
if (!fromExcel.isSheetHidden(i)){ if (!fromExcel.isSheetHidden(i)){
XSSFSheet oldSheet = fromExcel.getSheetAt(i); XSSFSheet oldSheet = fromExcel.getSheetAt(i);
XSSFSheet newSheet = newExcelCreat.createSheet(oldSheet.getSheetName()); XSSFSheet newSheet = newExcelCreat.createSheet(oldSheet.getSheetName());
copyPicture(newExcelCreat,oldSheet,newSheet);
copySheet(newExcelCreat, oldSheet, newSheet); copySheet(newExcelCreat, oldSheet, newSheet);
} }
...@@ -146,11 +149,11 @@ public class POIUtil { ...@@ -146,11 +149,11 @@ public class POIUtil {
int sheetNs = newExcelCreat.getNumberOfSheets(); int sheetNs = newExcelCreat.getNumberOfSheets();
for (int i = 0; i < sheetNs; i++) { // for (int i = 0; i < sheetNs; i++) {
if (!newExcelCreat.isSheetHidden(i)){ // if (!newExcelCreat.isSheetHidden(i)){
HSSFWorkbookUtil.insertImageByRowColFile(newExcelCreat,newExcelCreat.getSheetAt(i),0,0, new File("D://excel//图片1.png")); // HSSFWorkbookUtil.insertImageByRowColFile(newExcelCreat,newExcelCreat.getSheetAt(i),0,0, new File("D://excel//图片1.png"));
} // }
} // }
String allFileName = "d:/excel/0.xlsx"; String allFileName = "d:/excel/0.xlsx";
fileOut = new FileOutputStream(allFileName); fileOut = new FileOutputStream(allFileName);
...@@ -180,9 +183,98 @@ public class POIUtil { ...@@ -180,9 +183,98 @@ public class POIUtil {
return null; return null;
} }
public static void main(String[] args) {
hc(Lists.newArrayList(),"1212"); public static Map<String, PictureData> getSheetPictrues07(int sheetNum,
XSSFSheet sheet, XSSFWorkbook workbook) {
Map<String, PictureData> sheetIndexPicMap = new HashMap<>();
for (POIXMLDocumentPart dr : sheet.getRelations()) {
if (dr instanceof XSSFDrawing) {
XSSFDrawing drawing = (XSSFDrawing) dr;
List<XSSFShape> shapes = drawing.getShapes();
for (XSSFShape shape : shapes) {
XSSFPicture pic = (XSSFPicture) shape;
XSSFClientAnchor anchor = pic.getPreferredSize();
CTMarker ctMarker = anchor.getFrom();
String picIndex = String.valueOf(sheetNum) + "_"
+ ctMarker.getRow() + "_" + ctMarker.getCol();
sheetIndexPicMap.put(picIndex, pic.getPictureData());
}
} }
}
return sheetIndexPicMap;
}
public static void printImg(List<Map<String, PictureData>> sheetList) throws IOException {
for (Map<String, PictureData> map : sheetList) {
Object key[] = map.keySet().toArray();
for (int i = 0; i < map.size(); i++) {
// 获取图片流
PictureData pic = map.get(key[i]);
// 获取图片索引
String picName = key[i].toString();
// 获取图片格式
String ext = pic.suggestFileExtension();
byte[] data = pic.getData();
FileOutputStream out = new FileOutputStream("D:\\excel\\" + picName + "." + ext);
out.write(data);
out.close();
}
}
}
// public static void main(String[] args) {
// hc(Lists.newArrayList(),"1212");
//// File file2 = new File("D://excel//检测报告(力学试验)三轴.xlsx");
//// try {
//// XSSFWorkbook workbook = new XSSFWorkbook(file2);
//// Map<String, Object> map = getPicturesFromXSSFSheet(workbook.getSheetAt(0));
//// System.out.println(map);
//// }catch (Exception e){
////
//// }
//
//
// }
/**
* 获取图片和位置 (xlsx)
*/
public static Map<String, Object> getPicturesFromXSSFSheet (XSSFSheet sheet) throws IOException {
Map<String, Object> map = new HashMap<String, Object>();
List<POIXMLDocumentPart> list = sheet.getRelations();
for (POIXMLDocumentPart part : list) {
if (part instanceof XSSFDrawing) {
XSSFDrawing drawing = (XSSFDrawing) part;
List<XSSFShape> shapes = drawing.getShapes();
for (XSSFShape shape : shapes) {
XSSFPicture picture = (XSSFPicture) shape;
XSSFClientAnchor anchor = picture.getPreferredSize();
map.put("pictureAnchor", anchor);
map.put("pictureByteArray", picture.getPictureData().getData());
map.put("pictureType", picture.getPictureData().getPictureType());
}
}
}
return map;
}
public static void copyPicture(XSSFWorkbook workbook,XSSFSheet sourceSheet,XSSFSheet targetSheet) throws IOException {
XSSFDrawing drawing=targetSheet.createDrawingPatriarch();
Map<String, Object> sourceSheetPicture=getPicturesFromXSSFSheet(sourceSheet);
drawing.createPicture((XSSFClientAnchor) sourceSheetPicture.get("pictureAnchor"),
workbook.addPicture((byte[])sourceSheetPicture.get("pictureByteArray"),
Integer.parseInt(sourceSheetPicture.get("pictureType").toString())));
}
} }
\ No newline at end of file
...@@ -3,6 +3,7 @@ import com.patzn.cloud.commons.controller.Account; ...@@ -3,6 +3,7 @@ import com.patzn.cloud.commons.controller.Account;
import com.patzn.cloud.mq.MqMsg; import com.patzn.cloud.mq.MqMsg;
import com.patzn.cloud.mq.MqProperties; import com.patzn.cloud.mq.MqProperties;
import com.patzn.cloud.service.lims.common.service.ILmsMsgService; import com.patzn.cloud.service.lims.common.service.ILmsMsgService;
import org.apache.commons.lang3.StringUtils;
import org.slf4j.Logger; import org.slf4j.Logger;
import org.slf4j.LoggerFactory; import org.slf4j.LoggerFactory;
import org.springframework.amqp.AmqpException; import org.springframework.amqp.AmqpException;
...@@ -53,32 +54,27 @@ public class LmsMsgService implements ILmsMsgService { ...@@ -53,32 +54,27 @@ public class LmsMsgService implements ILmsMsgService {
private MqMsg getMqMsg(String uri, String msgType, String content, String title, Account account, List<Long> toUserId, int businessType, String groupAlias) { private MqMsg getMqMsg(String uri, String msgType, String content, String title, Account account, List<Long> toUserId, int businessType, String groupAlias) {
MqMsg mqMsg = new MqMsg(); MqMsg mqMsg = new MqMsg();
// mqMsg.setUid(account.getUserId()); mqMsg.setUid(account.getUserId());
// // 消息类型 // 消息类型
// mqMsg.setMsgType(msgType); mqMsg.setMsgType(msgType);
// if (StringUtils.isNotEmpty(msgType) && StringUtils.isEmpty(uri)) { // 路由
// // 不是空的并且路由是空的,需要根据 msgType 查询标签的路由 mqMsg.setUri(uri);
// mqMsg.setUri(EnvMessageTypeEnum.getByValue(msgType)); // 企业ID
// } else { mqMsg.setCompanyId(account.getCompanyId());
// // 路由 // 发送人
// mqMsg.setUri(uri); mqMsg.setSender(account.getUserName());
// } // 标题
// // 企业ID mqMsg.setTitle(title);
// mqMsg.setCompanyId(account.getCompanyId()); // 内容
// // 发送人 mqMsg.setContent(content);
// mqMsg.setSender(account.getUserName()); // 类型
// // 标题 mqMsg.setType(1);
// mqMsg.setTitle(title); // 服务名称
// // 内容 mqMsg.setService(service);
// mqMsg.setContent(content); // 接收人集合
// // 类型 mqMsg.setReceiverIds(toUserId);
// mqMsg.setType(1); mqMsg.setBusinessType(businessType);
// // 服务名称 mqMsg.setBusiness(groupAlias);
// mqMsg.setService(service);
// // 接收人集合
// mqMsg.setReceiverIds(toUserId);
// mqMsg.setBusinessType(businessType);
// mqMsg.setBusiness(groupAlias);
return mqMsg; return mqMsg;
} }
......
...@@ -52,11 +52,11 @@ public class RabbitMQConfig extends MqAutoConfiguration { ...@@ -52,11 +52,11 @@ public class RabbitMQConfig extends MqAutoConfiguration {
return new Queue(mqProperties.getTopic().getEquipCheckMsg()); return new Queue(mqProperties.getTopic().getEquipCheckMsg());
} }
// /** /**
// * 初始化计量队列 * 初始化计量队列
// */ */
// @Bean @Bean
// public Queue meterQueue() { public Queue soilQueue() {
// return new Queue(mqProperties.getTopic().getMeterWorkMsg()); return new Queue(mqProperties.getTopic().getSoilWorkMsg());
// } }
} }
...@@ -3,6 +3,7 @@ package com.patzn.cloud.service.lims.soil.controller; ...@@ -3,6 +3,7 @@ package com.patzn.cloud.service.lims.soil.controller;
import com.patzn.cloud.service.soil.entity.SoilAloneInOutStock; import com.patzn.cloud.service.soil.entity.SoilAloneInOutStock;
import com.patzn.cloud.service.soil.entity.SoilAloneSample; import com.patzn.cloud.service.soil.entity.SoilAloneSample;
import com.patzn.cloud.service.soil.enums.SoilAloneStatusEnum; import com.patzn.cloud.service.soil.enums.SoilAloneStatusEnum;
import com.patzn.cloud.service.soil.vo.SoilAloneSampleVO;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.DeleteMapping; import org.springframework.web.bind.annotation.DeleteMapping;
import org.springframework.web.bind.annotation.GetMapping; import org.springframework.web.bind.annotation.GetMapping;
...@@ -24,6 +25,7 @@ import io.swagger.annotations.ApiImplicitParam; ...@@ -24,6 +25,7 @@ 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 java.util.ArrayList;
import java.util.List; import java.util.List;
/** /**
...@@ -48,13 +50,33 @@ public class SoilAloneSampleController extends ServiceController { ...@@ -48,13 +50,33 @@ public class SoilAloneSampleController extends ServiceController {
@ApiImplicitParam(name = RestConstants.PAGE_SORD, value = "排序方式", paramType = "query", dataTypeClass = String.class), @ApiImplicitParam(name = RestConstants.PAGE_SORD, value = "排序方式", paramType = "query", dataTypeClass = String.class),
}) })
@PostMapping("/page") @PostMapping("/page")
public RestResult<Page<SoilAloneSample>> getPage(SoilAloneSample soilAloneSample) { public RestResult<Page<SoilAloneSample>> getPage(SoilAloneSampleVO soilAloneSample) {
soilAloneSample.setStatus(SoilAloneStatusEnum.DRAFT); soilAloneSample.setStatus(SoilAloneStatusEnum.DRAFT);
return success(soilAloneSampleService.page(getPage(), soilAloneSample)); return success(soilAloneSampleService.page(getPage(), soilAloneSample));
} }
@ApiOperation("登记历史分页列表")
@ApiImplicitParams({
@ApiImplicitParam(name = RestConstants.PAGE_PAGE, value = "请求数据的页码", required = true, paramType = "query", dataTypeClass = Integer.class),
@ApiImplicitParam(name = RestConstants.PAGE_ROWS, value = "每页条数", required = true, paramType = "query", dataTypeClass = Integer.class),
@ApiImplicitParam(name = RestConstants.PAGE_SIDX, value = "排序字段", paramType = "query", dataTypeClass = String.class),
@ApiImplicitParam(name = RestConstants.PAGE_SORD, value = "排序方式", paramType = "query", dataTypeClass = String.class),
})
@PostMapping("/page_register_his")
public RestResult<Page<SoilAloneSample>> getPageRegisterHis(SoilAloneSampleVO soilAloneSample) {
List<SoilAloneStatusEnum> statusList = new ArrayList<>();
statusList.add(SoilAloneStatusEnum.WAIT_STORAGE);
statusList.add(SoilAloneStatusEnum.WAIT_DELIVERY);
statusList.add(SoilAloneStatusEnum.DELIVERY_OK);
soilAloneSample.setStatusList(statusList);
return success(soilAloneSampleService.page(getPage(), soilAloneSample));
}
@ApiOperation("待入库分页列表") @ApiOperation("待入库分页列表")
@ApiImplicitParams({ @ApiImplicitParams({
@ApiImplicitParam(name = RestConstants.PAGE_PAGE, value = "请求数据的页码", required = true, paramType = "query", dataTypeClass = Integer.class), @ApiImplicitParam(name = RestConstants.PAGE_PAGE, value = "请求数据的页码", required = true, paramType = "query", dataTypeClass = Integer.class),
...@@ -63,12 +85,31 @@ public class SoilAloneSampleController extends ServiceController { ...@@ -63,12 +85,31 @@ public class SoilAloneSampleController extends ServiceController {
@ApiImplicitParam(name = RestConstants.PAGE_SORD, value = "排序方式", paramType = "query", dataTypeClass = String.class), @ApiImplicitParam(name = RestConstants.PAGE_SORD, value = "排序方式", paramType = "query", dataTypeClass = String.class),
}) })
@PostMapping("/page_wait_storage") @PostMapping("/page_wait_storage")
public RestResult<Page<SoilAloneSample>> getPageWaitStorage(SoilAloneSample soilAloneSample) { public RestResult<Page<SoilAloneSample>> getPageWaitStorage(SoilAloneSampleVO soilAloneSample) {
soilAloneSample.setStatus(SoilAloneStatusEnum.WAIT_STORAGE); soilAloneSample.setStatus(SoilAloneStatusEnum.WAIT_STORAGE);
return success(soilAloneSampleService.page(getPage(), soilAloneSample)); return success(soilAloneSampleService.page(getPage(), soilAloneSample));
} }
@ApiOperation("入库历史分页列表")
@ApiImplicitParams({
@ApiImplicitParam(name = RestConstants.PAGE_PAGE, value = "请求数据的页码", required = true, paramType = "query", dataTypeClass = Integer.class),
@ApiImplicitParam(name = RestConstants.PAGE_ROWS, value = "每页条数", required = true, paramType = "query", dataTypeClass = Integer.class),
@ApiImplicitParam(name = RestConstants.PAGE_SIDX, value = "排序字段", paramType = "query", dataTypeClass = String.class),
@ApiImplicitParam(name = RestConstants.PAGE_SORD, value = "排序方式", paramType = "query", dataTypeClass = String.class),
})
@PostMapping("/page_wait_storage_his")
public RestResult<Page<SoilAloneSample>> getPageWaitStorageHis(SoilAloneSampleVO soilAloneSample) {
List<SoilAloneStatusEnum> statusList = new ArrayList<>();
statusList.add(SoilAloneStatusEnum.WAIT_DELIVERY);
statusList.add(SoilAloneStatusEnum.DELIVERY_OK);
soilAloneSample.setStatusList(statusList);
return success(soilAloneSampleService.page(getPage(), soilAloneSample));
}
@ApiOperation("待出库分页列表") @ApiOperation("待出库分页列表")
@ApiImplicitParams({ @ApiImplicitParams({
@ApiImplicitParam(name = RestConstants.PAGE_PAGE, value = "请求数据的页码", required = true, paramType = "query", dataTypeClass = Integer.class), @ApiImplicitParam(name = RestConstants.PAGE_PAGE, value = "请求数据的页码", required = true, paramType = "query", dataTypeClass = Integer.class),
...@@ -77,12 +118,43 @@ public class SoilAloneSampleController extends ServiceController { ...@@ -77,12 +118,43 @@ public class SoilAloneSampleController extends ServiceController {
@ApiImplicitParam(name = RestConstants.PAGE_SORD, value = "排序方式", paramType = "query", dataTypeClass = String.class), @ApiImplicitParam(name = RestConstants.PAGE_SORD, value = "排序方式", paramType = "query", dataTypeClass = String.class),
}) })
@PostMapping("/page_wait_delivery") @PostMapping("/page_wait_delivery")
public RestResult<Page<SoilAloneSample>> getPageWaitDelivery(SoilAloneSample soilAloneSample) { public RestResult<Page<SoilAloneSample>> getPageWaitDelivery(SoilAloneSampleVO soilAloneSample) {
soilAloneSample.setStatus(SoilAloneStatusEnum.WAIT_DELIVERY); soilAloneSample.setStatus(SoilAloneStatusEnum.WAIT_DELIVERY);
return success(soilAloneSampleService.page(getPage(), soilAloneSample)); return success(soilAloneSampleService.page(getPage(), soilAloneSample));
} }
@ApiOperation("出库历史分页列表")
@ApiImplicitParams({
@ApiImplicitParam(name = RestConstants.PAGE_PAGE, value = "请求数据的页码", required = true, paramType = "query", dataTypeClass = Integer.class),
@ApiImplicitParam(name = RestConstants.PAGE_ROWS, value = "每页条数", required = true, paramType = "query", dataTypeClass = Integer.class),
@ApiImplicitParam(name = RestConstants.PAGE_SIDX, value = "排序字段", paramType = "query", dataTypeClass = String.class),
@ApiImplicitParam(name = RestConstants.PAGE_SORD, value = "排序方式", paramType = "query", dataTypeClass = String.class),
})
@PostMapping("/page_wait_delivery_his")
public RestResult<Page<SoilAloneSample>> getPageWaitDeliveryHis(SoilAloneSampleVO soilAloneSample) {
soilAloneSample.setStatus(SoilAloneStatusEnum.DELIVERY_OK);
return success(soilAloneSampleService.page(getPage(), soilAloneSample));
}
@ApiOperation("库房样品管理分页列表")
@ApiImplicitParams({
@ApiImplicitParam(name = RestConstants.PAGE_PAGE, value = "请求数据的页码", required = true, paramType = "query", dataTypeClass = Integer.class),
@ApiImplicitParam(name = RestConstants.PAGE_ROWS, value = "每页条数", required = true, paramType = "query", dataTypeClass = Integer.class),
@ApiImplicitParam(name = RestConstants.PAGE_SIDX, value = "排序字段", paramType = "query", dataTypeClass = String.class),
@ApiImplicitParam(name = RestConstants.PAGE_SORD, value = "排序方式", paramType = "query", dataTypeClass = String.class),
})
@PostMapping("/page_storehouse_sample")
public RestResult<Page<SoilAloneSampleVO>> getPageStorehouseSample(SoilAloneSampleVO soilAloneSample) {
return success(soilAloneSampleService.pageVO(getPage(), soilAloneSample));
}
@ApiOperation("查询 id 信息") @ApiOperation("查询 id 信息")
@ApiImplicitParams({ @ApiImplicitParams({
@ApiImplicitParam(name = "id", value = "主键", required = true, paramType = "path", dataTypeClass = Long.class), @ApiImplicitParam(name = "id", value = "主键", required = true, paramType = "path", dataTypeClass = Long.class),
...@@ -129,6 +201,15 @@ public class SoilAloneSampleController extends ServiceController { ...@@ -129,6 +201,15 @@ public class SoilAloneSampleController extends ServiceController {
@ApiOperation("批量修改存放架位")
@PostMapping("/bath_change_storehouse")
public RestResult<Boolean> bathChangeStorehouse(@RequestParam("ids") Long [] ids, SoilAloneInOutStock aloneInOutStock) {
return success(soilAloneSampleService.bathChangeStorehouse(ids,aloneInOutStock,getAccount()));
}
@ApiOperation("添加") @ApiOperation("添加")
@PostMapping("/") @PostMapping("/")
......
...@@ -608,4 +608,20 @@ public class SoilExperimentController extends ServiceController { ...@@ -608,4 +608,20 @@ public class SoilExperimentController extends ServiceController {
return success(soilExperimentService.saveExcelExpReport(expName,entrustId,ids,templateId,getAccount())); return success(soilExperimentService.saveExcelExpReport(expName,entrustId,ids,templateId,getAccount()));
} }
@ApiOperation(value = "试验项目查询分页列表", notes = "试验项目查询分页列表")
@ApiImplicitParams({
@ApiImplicitParam(name = RestConstants.PAGE_PAGE, value = "请求数据的页码", required = true, paramType = "query", dataType = "int"),
@ApiImplicitParam(name = RestConstants.PAGE_ROWS, value = "每页条数", required = true, paramType = "query", dataType = "int"),
@ApiImplicitParam(name = RestConstants.PAGE_SIDX, value = "排序字段", paramType = "query", dataType = "String"),
@ApiImplicitParam(name = RestConstants.PAGE_SORD, value = "排序方式", paramType = "query", dataType = "String"),
})
@PostMapping("/list_experiment_progress")
public RestResult<Page<SoilExperimentVO>> listExperimentProgress(SoilExperimentVO vo) {
return success(soilExperimentService.listExperimentProgress(getPage(),vo));
}
} }
package com.patzn.cloud.service.lims.soil.mapper; package com.patzn.cloud.service.lims.soil.mapper;
import com.baomidou.mybatisplus.plugins.Page;
import com.patzn.cloud.commons.mapper.BatchMapper; import com.patzn.cloud.commons.mapper.BatchMapper;
import com.patzn.cloud.service.soil.entity.SoilAloneSample; import com.patzn.cloud.service.soil.entity.SoilAloneSample;
import com.patzn.cloud.service.soil.vo.SoilAloneSampleVO;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.session.RowBounds;
import java.util.List;
/** /**
* <p> * <p>
...@@ -13,4 +19,5 @@ import com.patzn.cloud.service.soil.entity.SoilAloneSample; ...@@ -13,4 +19,5 @@ import com.patzn.cloud.service.soil.entity.SoilAloneSample;
*/ */
public interface SoilAloneSampleMapper extends BatchMapper<SoilAloneSample> { public interface SoilAloneSampleMapper extends BatchMapper<SoilAloneSample> {
List<SoilAloneSampleVO> selectVOList(RowBounds rowBounds, @Param("vo") SoilAloneSampleVO soilAloneSample);
} }
...@@ -38,4 +38,6 @@ public interface SoilExperimentMapper extends BaseMapper<SoilExperiment> { ...@@ -38,4 +38,6 @@ public interface SoilExperimentMapper extends BaseMapper<SoilExperiment> {
List<SoilExperimentVO> selectListVOByIds(@Param("ids")Long [] expIds); List<SoilExperimentVO> selectListVOByIds(@Param("ids")Long [] expIds);
List<SoilEntrustItemNumVO> listEntrustItemNum(@Param("sampleIds") List<Long> sampleIds, @Param("vo") SoilExperimentVO vo); List<SoilEntrustItemNumVO> listEntrustItemNum(@Param("sampleIds") List<Long> sampleIds, @Param("vo") SoilExperimentVO vo);
List<SoilExperimentVO> listExperimentProgress(RowBounds rowBounds, @Param("vo")SoilExperimentVO vo);
} }
...@@ -5,6 +5,7 @@ import com.patzn.cloud.commons.controller.Account; ...@@ -5,6 +5,7 @@ import com.patzn.cloud.commons.controller.Account;
import com.patzn.cloud.commons.service.IBaseService; import com.patzn.cloud.commons.service.IBaseService;
import com.patzn.cloud.service.soil.entity.SoilAloneInOutStock; import com.patzn.cloud.service.soil.entity.SoilAloneInOutStock;
import com.patzn.cloud.service.soil.entity.SoilAloneSample; import com.patzn.cloud.service.soil.entity.SoilAloneSample;
import com.patzn.cloud.service.soil.vo.SoilAloneSampleVO;
import java.util.List; import java.util.List;
...@@ -16,7 +17,7 @@ import java.util.List; ...@@ -16,7 +17,7 @@ import java.util.List;
*/ */
public interface ISoilAloneSampleService extends IBaseService<SoilAloneSample> { public interface ISoilAloneSampleService extends IBaseService<SoilAloneSample> {
Page<SoilAloneSample> page(Page<SoilAloneSample> page, SoilAloneSample soilAloneSample); Page<SoilAloneSample> page(Page<SoilAloneSample> page, SoilAloneSampleVO soilAloneSample);
boolean removeByIds(List<Long> ids); boolean removeByIds(List<Long> ids);
...@@ -25,4 +26,8 @@ public interface ISoilAloneSampleService extends IBaseService<SoilAloneSample> { ...@@ -25,4 +26,8 @@ public interface ISoilAloneSampleService extends IBaseService<SoilAloneSample> {
boolean inStorageSubmit(Long[] ids, SoilAloneInOutStock aloneInOutStock, Account account); boolean inStorageSubmit(Long[] ids, SoilAloneInOutStock aloneInOutStock, Account account);
boolean outStorageSubmit(Long[] ids, SoilAloneInOutStock aloneInOutStock, Account account); boolean outStorageSubmit(Long[] ids, SoilAloneInOutStock aloneInOutStock, Account account);
Page<SoilAloneSampleVO> pageVO(Page<SoilAloneSampleVO> page, SoilAloneSampleVO soilAloneSample);
boolean bathChangeStorehouse(Long[] ids, SoilAloneInOutStock aloneInOutStock, Account account);
} }
...@@ -87,4 +87,5 @@ public interface ISoilExperimentService extends IBaseService<SoilExperiment> { ...@@ -87,4 +87,5 @@ public interface ISoilExperimentService extends IBaseService<SoilExperiment> {
Page<LmsUserRelGroupVO> pageGroupUser(Page<LmsUserRelGroupVO> page, LmsUserRelGroup soilExperiment); Page<LmsUserRelGroupVO> pageGroupUser(Page<LmsUserRelGroupVO> page, LmsUserRelGroup soilExperiment);
Page<SoilExperimentVO> listExperimentProgress(Page<SoilExperimentVO> page, SoilExperimentVO vo);
} }
package com.patzn.cloud.service.lims.soil.service.impl; package com.patzn.cloud.service.lims.soil.service.impl;
import com.baomidou.mybatisplus.mapper.Condition; import com.baomidou.mybatisplus.mapper.Condition;
import com.baomidou.mybatisplus.toolkit.CollectionUtils;
import com.patzn.cloud.commons.api.RestAssert; import com.patzn.cloud.commons.api.RestAssert;
import com.patzn.cloud.commons.controller.Account; import com.patzn.cloud.commons.controller.Account;
import com.patzn.cloud.service.lims.soil.mapper.SoilAloneSampleMapper; import com.patzn.cloud.service.lims.soil.mapper.SoilAloneSampleMapper;
...@@ -10,6 +11,7 @@ import com.patzn.cloud.commons.service.impl.BaseServiceImpl; ...@@ -10,6 +11,7 @@ import com.patzn.cloud.commons.service.impl.BaseServiceImpl;
import com.patzn.cloud.service.soil.entity.SoilAloneInOutStock; import com.patzn.cloud.service.soil.entity.SoilAloneInOutStock;
import com.patzn.cloud.service.soil.entity.SoilAloneSample; import com.patzn.cloud.service.soil.entity.SoilAloneSample;
import com.patzn.cloud.service.soil.enums.SoilAloneStatusEnum; import com.patzn.cloud.service.soil.enums.SoilAloneStatusEnum;
import com.patzn.cloud.service.soil.vo.SoilAloneSampleVO;
import org.apache.commons.lang3.ArrayUtils; import org.apache.commons.lang3.ArrayUtils;
import org.apache.commons.lang3.StringUtils; import org.apache.commons.lang3.StringUtils;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
...@@ -37,9 +39,13 @@ public class SoilAloneSampleServiceImpl extends BaseServiceImpl<SoilAloneSampleM ...@@ -37,9 +39,13 @@ public class SoilAloneSampleServiceImpl extends BaseServiceImpl<SoilAloneSampleM
@Override @Override
public Page<SoilAloneSample> page(Page<SoilAloneSample> page, SoilAloneSample soilAloneSample) { public Page<SoilAloneSample> page(Page<SoilAloneSample> page, SoilAloneSampleVO soilAloneSample) {
Wrapper wrapper = new EntityWrapper<>(soilAloneSample); SoilAloneSample sample = soilAloneSample.convert(SoilAloneSample.class);
Wrapper wrapper = new EntityWrapper<>(sample);
if (CollectionUtils.isNotEmpty(soilAloneSample.getStatusList())){
wrapper.in("status",soilAloneSample.getStatusList());
}
return this.page(page, wrapper); return this.page(page, wrapper);
} }
...@@ -119,4 +125,20 @@ public class SoilAloneSampleServiceImpl extends BaseServiceImpl<SoilAloneSampleM ...@@ -119,4 +125,20 @@ public class SoilAloneSampleServiceImpl extends BaseServiceImpl<SoilAloneSampleM
} }
return false; return false;
} }
@Override
public Page<SoilAloneSampleVO> pageVO(Page<SoilAloneSampleVO> page, SoilAloneSampleVO soilAloneSample) {
return page.setRecords(baseMapper.selectVOList(page,soilAloneSample));
}
@Override
public boolean bathChangeStorehouse(Long[] ids, SoilAloneInOutStock aloneInOutStock, Account account) {
RestAssert.fail(ArrayUtils.isEmpty(ids),"请选择要修改存放架位的样品");
if (null == aloneInOutStock) {
RestAssert.fail("请填写存放架位信息!");
}
RestAssert.fail(StringUtils.isBlank(aloneInOutStock.getStorehouse()),"请填写库房号");
RestAssert.fail(StringUtils.isBlank(aloneInOutStock.getShelfCode()),"请填写货架号");
return soilAloneInOutStockService.update(aloneInOutStock,Condition.create().in("alone_sample_id",ids));
}
} }
...@@ -27,6 +27,7 @@ import com.patzn.cloud.service.lims.base.vo.LmsUserRelGroupVO; ...@@ -27,6 +27,7 @@ import com.patzn.cloud.service.lims.base.vo.LmsUserRelGroupVO;
import com.patzn.cloud.service.lims.collect.core.CollectDataType; import com.patzn.cloud.service.lims.collect.core.CollectDataType;
import com.patzn.cloud.service.lims.common.*; import com.patzn.cloud.service.lims.common.*;
import com.patzn.cloud.service.lims.common.service.IExportService; import com.patzn.cloud.service.lims.common.service.IExportService;
import com.patzn.cloud.service.lims.common.service.ILmsMsgService;
import com.patzn.cloud.service.lims.soil.service.*; import com.patzn.cloud.service.lims.soil.service.*;
import com.patzn.cloud.service.meter.entity.MeterEntrust; import com.patzn.cloud.service.meter.entity.MeterEntrust;
import com.patzn.cloud.service.soil.entity.*; import com.patzn.cloud.service.soil.entity.*;
...@@ -128,6 +129,8 @@ public class SoilExperimentServiceImpl extends BaseServiceImpl<SoilExperimentMap ...@@ -128,6 +129,8 @@ public class SoilExperimentServiceImpl extends BaseServiceImpl<SoilExperimentMap
@Autowired @Autowired
private ISoilDataGdsDetailService soilDataGdsDetailService; private ISoilDataGdsDetailService soilDataGdsDetailService;
@Autowired
private ILmsMsgService lmsMsgService;
@Autowired @Autowired
private ISoilDataGdsService soilDataGdsService; private ISoilDataGdsService soilDataGdsService;
...@@ -189,6 +192,8 @@ public class SoilExperimentServiceImpl extends BaseServiceImpl<SoilExperimentMap ...@@ -189,6 +192,8 @@ public class SoilExperimentServiceImpl extends BaseServiceImpl<SoilExperimentMap
if (update(experiment,Condition.create().in("id",ids))){ if (update(experiment,Condition.create().in("id",ids))){
soilExperimentOperationService.recordAllotInfo(ids,account); soilExperimentOperationService.recordAllotInfo(ids,account);
soilExperimentRecordService.record(ids,SoilExpStatusEnum.ALLOT,SoilExpStatusEnum.TEST,0,account,"试验项目分配给:"+user); soilExperimentRecordService.record(ids,SoilExpStatusEnum.ALLOT,SoilExpStatusEnum.TEST,0,account,"试验项目分配给:"+user);
lmsMsgService.sendMsg("/soil/test/do_test","试验项目已分配请及时进行检测","新的试验检测工作",account,Lists.newArrayList(userId));
} }
return true; return true;
} }
...@@ -980,6 +985,13 @@ public class SoilExperimentServiceImpl extends BaseServiceImpl<SoilExperimentMap ...@@ -980,6 +985,13 @@ public class SoilExperimentServiceImpl extends BaseServiceImpl<SoilExperimentMap
@Override @Override
public Page<SoilExperimentVO> listExperimentProgress(Page<SoilExperimentVO> page, SoilExperimentVO vo) {
return page.setRecords(baseMapper.listExperimentProgress(page,vo));
}
@Override
public Page<SoilExperimentVO> pageBySampleIds(Page<SoilExperimentVO> page, Long[] sampleIds, SoilExperimentVO vo) { public Page<SoilExperimentVO> pageBySampleIds(Page<SoilExperimentVO> page, Long[] sampleIds, SoilExperimentVO vo) {
return page.setRecords(initOriginalRecord(baseMapper.selectListBySampleIds(page,sampleIds,vo))); return page.setRecords(initOriginalRecord(baseMapper.selectListBySampleIds(page,sampleIds,vo)));
} }
......
...@@ -25,11 +25,10 @@ spring: ...@@ -25,11 +25,10 @@ spring:
health-check-interval: 5s health-check-interval: 5s
# host: localhost # host: localhost
rabbitmq: rabbitmq:
host: 121.36.130.208 host: 124.70.150.247
port: 5672 port: 5672
username: mqbase username: mqbase
password: mqb123#@$5 password: mqb123#@$5
publisher-confirms: true
virtual-host: / virtual-host: /
topic: topic:
push-msg: dev.topic.push.msg push-msg: dev.topic.push.msg
...@@ -39,6 +38,7 @@ spring: ...@@ -39,6 +38,7 @@ spring:
report-make-msg: dev.topic.report.make.msg report-make-msg: dev.topic.report.make.msg
soil-work-msg: dev.topic.soil.work.msg soil-work-msg: dev.topic.soil.work.msg
### jobs ### jobs
jobs: jobs:
admin-address: http://api.dev.patzn.com:7000/print admin-address: http://api.dev.patzn.com:7000/print
......
...@@ -2,4 +2,23 @@ ...@@ -2,4 +2,23 @@
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd"> <!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.patzn.cloud.service.lims.soil.mapper.SoilAloneSampleMapper"> <mapper namespace="com.patzn.cloud.service.lims.soil.mapper.SoilAloneSampleMapper">
<select id="selectVOList" resultType="com.patzn.cloud.service.soil.vo.SoilAloneSampleVO">
SELECT
s.id,s.receiver,s.receive_time,s.project_name,s.project_leader,s.borehole_name,s.cases_num,s.registrant,s.regist_time,
o.storehouse,o.shelf_code,o.instock_time,o.keep_limit_time
FROM
soil_alone_sample s
JOIN soil_alone_in_out_stock o ON s.ID = o.alone_sample_id
WHERE s.deleted = 0
<if test="vo.boreholeName">
AND s.borehole_name LIKE CONCAT('%',#{vo.boreholeName},'%')
</if>
<if test="vo.storehouse">
AND o.storehouse LIKE CONCAT('%',#{vo.storehouse},'%')
</if>
</select>
</mapper> </mapper>
...@@ -93,6 +93,10 @@ ...@@ -93,6 +93,10 @@
GROUP BY t.short_name GROUP BY t.short_name
</select> </select>
<select id="selectTestByExp" resultType="com.patzn.cloud.service.soil.vo.SoilExperimentVO"> <select id="selectTestByExp" resultType="com.patzn.cloud.service.soil.vo.SoilExperimentVO">
SELECT t.name FROM soil_experiment t SELECT t.name FROM soil_experiment t
JOIN soil_sample s ON t.sample_id = s.id JOIN soil_sample s ON t.sample_id = s.id
...@@ -180,6 +184,54 @@ ...@@ -180,6 +184,54 @@
</select> </select>
<select id="listExperimentProgress" resultType="com.patzn.cloud.service.soil.vo.SoilExperimentVO">
SELECT
t.id,
t.NAME,
e.borehole_name,
s.sample_code,
s.sample_depth,
s.site_no ,
t.ctime,
t.uid,
o.alloter,
o.allot_time,
o.test_ender,
o.test_end_time,
o.checker,
o.check_time,
o.auditor,
o.audit_time
FROM
soil_experiment t
JOIN soil_sample s ON t.sample_id = s.id
JOIN soil_entrust e ON s.entrust_id = e.id
JOIN soil_experiment_operation o ON t.id = o.experiment_id
WHERE
t.deleted = 0
AND s.deleted = 0
AND e.deleted = 0
<if test="null!=vo.sampleCode">
AND s.sample_code LIKE CONCAT('%',#{vo.sampleCode},'%')
</if>
<if test="null!=vo.siteNo">
AND s.site_no LIKE CONCAT('%',#{vo.siteNo},'%')
</if>
<if test="null!=vo.name">
AND t.name LIKE CONCAT('%',#{vo.name},'%')
</if>
<if test="null!=vo.boreholeName">
AND e.borehole_name LIKE CONCAT('%',#{vo.boreholeName},'%')
</if>
</select>
<select id="selectOriginalExpList" resultType="com.patzn.cloud.service.soil.vo.SoilExperimentVO"> <select id="selectOriginalExpList" resultType="com.patzn.cloud.service.soil.vo.SoilExperimentVO">
WITH o AS ( WITH o AS (
......
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