app收样新需求
This commit is contained in:
parent
69bffc0d6a
commit
ce1d9dddbc
|
|
@ -37,7 +37,6 @@ public class CertificateAppController {
|
|||
@PostMapping(value = "getList")
|
||||
@DecryptAndVerify(decryptedClass = SamplesManageAppVo.class)
|
||||
@LogAnnotation(operModul = "app合格证管理", operation = "查询列表", operDesc = "业务级事件",operType="查询")
|
||||
// @PreAuthorize("@pms.hasPermission('sys:samples:query')" )
|
||||
public ServerResponse getList(EncryptedReq<SamplesManageAppVo> data) {
|
||||
PageHelper.startPage(data.getData().getPage(), data.getData().getLimit());
|
||||
try {
|
||||
|
|
@ -56,7 +55,6 @@ public class CertificateAppController {
|
|||
@PostMapping("delSamplesList")
|
||||
@DecryptAndVerify(decryptedClass = SamplesManageAppVo.class)
|
||||
@LogAnnotation(operModul = "收样管理", operation = "删除收样列表数据", operDesc = "业务级事件", operType = "删除")
|
||||
// @PreAuthorize("@pms.hasPermission('sys:samples:add')")
|
||||
public ServerResponse delSamplesList(EncryptedReq<SamplesManageAppVo> vo) {
|
||||
try {
|
||||
return service.delSamplesList(vo.getData());
|
||||
|
|
@ -72,7 +70,6 @@ public class CertificateAppController {
|
|||
@PostMapping("delSamplesDetails")
|
||||
@DecryptAndVerify(decryptedClass = SamplesManageAppVo.class)
|
||||
@LogAnnotation(operModul = "收样管理", operation = "删除收样详情数据", operDesc = "业务级事件", operType = "删除")
|
||||
// @PreAuthorize("@pms.hasPermission('sys:samples:add')")
|
||||
public ServerResponse delSamplesDetails(EncryptedReq<SamplesManageAppVo> vo) {
|
||||
try {
|
||||
return service.delSamplesDetails(vo.getData());
|
||||
|
|
@ -88,7 +85,6 @@ public class CertificateAppController {
|
|||
@PostMapping("updateSamplesList")
|
||||
@DecryptAndVerify(decryptedClass = SamplesManageAppVo.class)
|
||||
@LogAnnotation(operModul = "收样管理", operation = "修改收样信息", operDesc = "业务级事件", operType = "删除")
|
||||
// @PreAuthorize("@pms.hasPermission('sys:samples:add')")
|
||||
public ServerResponse updateSamplesList(EncryptedReq<SamplesManageAppVo> vo) {
|
||||
try {
|
||||
return service.updateSamplesList(vo.getData());
|
||||
|
|
@ -101,7 +97,6 @@ public class CertificateAppController {
|
|||
@PostMapping(value = "getDetailsList")
|
||||
@DecryptAndVerify(decryptedClass = SamplesManageAppVo.class)
|
||||
@LogAnnotation(operModul = "app合格证管理", operation = "详情", operDesc = "业务级事件",operType="查询")
|
||||
// @PreAuthorize("@pms.hasPermission('sys:samples:query')" )
|
||||
public ServerResponse getDetailsList(EncryptedReq<SamplesManageAppVo> data) {
|
||||
PageHelper.startPage(data.getData().getPage(), data.getData().getLimit());
|
||||
try {
|
||||
|
|
@ -117,7 +112,6 @@ public class CertificateAppController {
|
|||
@PostMapping(value = "getSampleLabelData")
|
||||
@DecryptAndVerify(decryptedClass = SamplesManageAppVo.class)
|
||||
@LogAnnotation(operModul = "app收样管理", operation = "收样标签", operDesc = "业务级事件",operType="查询")
|
||||
// @PreAuthorize("@pms.hasPermission('sys:samples:query')" )
|
||||
public ServerResponse getSampleLabelData(EncryptedReq<SamplesManageAppVo> data) {
|
||||
try {
|
||||
SamplesManageAppVo list = service.getSampleLabelData(data.getData());
|
||||
|
|
@ -134,7 +128,6 @@ public class CertificateAppController {
|
|||
@PostMapping("addSamples")
|
||||
@DecryptAndVerify(decryptedClass = SamplesManageAppVo.class)
|
||||
@LogAnnotation(operModul = "收样管理", operation = "新增收样数据", operDesc = "业务级事件", operType = "新增")
|
||||
// @PreAuthorize("@pms.hasPermission('sys:samples:add')")
|
||||
public ServerResponse addSamples(EncryptedReq<SamplesManageAppVo> vo) {
|
||||
try {
|
||||
return service.addSamples(vo.getData());
|
||||
|
|
@ -150,7 +143,6 @@ public class CertificateAppController {
|
|||
@PostMapping("dispatchWork")
|
||||
@DecryptAndVerify(decryptedClass = SamplesManageAppVo.class)
|
||||
@LogAnnotation(operModul = "收样管理", operation = "派工", operDesc = "业务级事件", operType = "新增")
|
||||
// @PreAuthorize("@pms.hasPermission('sys:samples:dispatch')")
|
||||
public ServerResponse dispatchWork(EncryptedReq<SamplesManageAppVo> vo) {
|
||||
try {
|
||||
return service.dispatchWork(vo.getData());
|
||||
|
|
@ -163,7 +155,6 @@ public class CertificateAppController {
|
|||
@PostMapping(value = "getAuthority")
|
||||
@DecryptAndVerify(decryptedClass = SamplesManageAppVo.class)
|
||||
@LogAnnotation(operModul = "收样管理", operation = "查询是否具有派工/收样权限", operDesc = "业务级事件",operType="查询")
|
||||
// @PreAuthorize("@pms.hasPermission('sys:samples:query')" )
|
||||
public ServerResponse getAuthority(EncryptedReq<SamplesManageAppVo> data) {
|
||||
try {
|
||||
Boolean res = service.getAuthority(data.getData());
|
||||
|
|
|
|||
|
|
@ -37,9 +37,8 @@ public class ExamineAppController {
|
|||
private ExamineAppService service;
|
||||
|
||||
@PostMapping(value = "getList")
|
||||
@DecryptAndVerify(decryptedClass = ParamsAppDto.class)//加解密统一管理
|
||||
@DecryptAndVerify(decryptedClass = ParamsAppDto.class)
|
||||
@LogAnnotation(operModul = "审查管理", operation = "查询列表", operDesc = "系统级事件", operType = "查询")
|
||||
// @PreAuthorize("@pms.hasPermission('sys:examine:query')" )
|
||||
public ServerResponse getList(EncryptedReq<ParamsAppDto> data) {
|
||||
PageHelper.startPage(data.getData().getPage(), data.getData().getLimit());
|
||||
List<ExperimentalAppVo> list = service.getList(data.getData());
|
||||
|
|
@ -48,7 +47,7 @@ public class ExamineAppController {
|
|||
}
|
||||
|
||||
@PostMapping(value = "getDetailList")
|
||||
@DecryptAndVerify(decryptedClass = ParamsAppDto.class)//加解密统一管理
|
||||
@DecryptAndVerify(decryptedClass = ParamsAppDto.class)
|
||||
@LogAnnotation(operModul = "审查管理", operation = "查询审查详情列表", operDesc = "系统级事件", operType = "查询")
|
||||
public ServerResponse getDetailList(EncryptedReq<ParamsAppDto> data) {
|
||||
PageHelper.startPage(data.getData().getPage(), data.getData().getLimit());
|
||||
|
|
@ -58,8 +57,7 @@ public class ExamineAppController {
|
|||
}
|
||||
|
||||
@PostMapping(value = "checkData")
|
||||
@DecryptAndVerify(decryptedClass = AuditHistoryVo.class)//加解密统一管理
|
||||
// @PreAuthorize("@pms.hasPermission('sys:examine:checkData')" )
|
||||
@DecryptAndVerify(decryptedClass = AuditHistoryVo.class)
|
||||
@LogAnnotation(operModul = "审查管理", operation = "试验审查", operDesc = "系统级事件", operType = "审查")
|
||||
public ServerResponse checkData(EncryptedReq<AuditHistoryVo> dto) {
|
||||
return service.checkData(dto.getData());
|
||||
|
|
|
|||
|
|
@ -36,7 +36,6 @@ public class ExperimentalAppController {
|
|||
@PostMapping(value = "getList")
|
||||
@DecryptAndVerify(decryptedClass = ParamsAppDto.class)
|
||||
@LogAnnotation(operModul = "app试验管理", operation = "查询列表", operDesc = "业务级事件", operType = "查询")
|
||||
// @PreAuthorize("@pms.hasPermission('sys:experimental:query')" )
|
||||
public ServerResponse getList(EncryptedReq<ParamsAppDto> data) {
|
||||
PageHelper.startPage(data.getData().getPage(), data.getData().getLimit());
|
||||
try {
|
||||
|
|
@ -50,9 +49,8 @@ public class ExperimentalAppController {
|
|||
}
|
||||
|
||||
@PostMapping(value = "getDetailList")
|
||||
@DecryptAndVerify(decryptedClass = ParamsAppDto.class)//加解密统一管理
|
||||
@DecryptAndVerify(decryptedClass = ParamsAppDto.class)
|
||||
@LogAnnotation(operModul = "试验详情管理", operation = "查询试验详情列表", operDesc = "业务级事件", operType = "查询")
|
||||
// @PreAuthorize("@pms.hasPermission('sys:experimentalTest:query')")
|
||||
public ServerResponse getDetailList(EncryptedReq<ParamsAppDto> data) {
|
||||
PageHelper.startPage(data.getData().getPage(), data.getData().getLimit());
|
||||
try {
|
||||
|
|
@ -80,29 +78,19 @@ public class ExperimentalAppController {
|
|||
}
|
||||
|
||||
@PostMapping(value = "addTestData")
|
||||
@DecryptAndVerify(decryptedClass = TestAppVo.class)//加解密统一管理
|
||||
@DecryptAndVerify(decryptedClass = TestAppVo.class)
|
||||
@LogAnnotation(operModul = "试验详情管理", operation = "新增试验数据", operDesc = "业务级事件", operType = "新增")
|
||||
// @PreAuthorize("@pms.hasPermission('sys:experimentalTest:add')")
|
||||
public ServerResponse addTestData(EncryptedReq<TestAppVo> data) {
|
||||
return service.addTestData(data.getData());
|
||||
}
|
||||
|
||||
@PostMapping(value = "editTestData")
|
||||
@DecryptAndVerify(decryptedClass = TestAppVo.class)//加解密统一管理
|
||||
@DecryptAndVerify(decryptedClass = TestAppVo.class)
|
||||
@LogAnnotation(operModul = "试验详情管理", operation = "修改试验数据", operDesc = "业务级事件", operType = "修改")
|
||||
// @PreAuthorize("@pms.hasPermission('sys:experimentalTest:edit')")
|
||||
public ServerResponse editTestData(EncryptedReq<TestAppVo> data) {
|
||||
return service.editTestData(data.getData());
|
||||
}
|
||||
|
||||
// @PostMapping(value = "delTestData")
|
||||
// @DecryptAndVerify(decryptedClass = ParamsAppDto.class)//加解密统一管理
|
||||
// @LogAnnotation(operModul = "试验详情管理", operation = "删除试验数据", operDesc = "业务级事件", operType = "删除")
|
||||
// // @PreAuthorize("@pms.hasPermission('sys:experimentalTest:del')")
|
||||
// public ServerResponse delTestData(EncryptedReq<ParamsAppDto> data) {
|
||||
// return service.delTestData(data.getData());
|
||||
// }
|
||||
//
|
||||
/**
|
||||
* 试验数据详情
|
||||
*/
|
||||
|
|
@ -115,7 +103,6 @@ public class ExperimentalAppController {
|
|||
@PostMapping(value = "commitCheckTestData")
|
||||
@DecryptAndVerify(decryptedClass = ParamsAppDto.class)
|
||||
@LogAnnotation(operModul = "试验管理", operation = "提交审查数据", operDesc = "业务级事件", operType = "提交审查")
|
||||
// @PreAuthorize("@pms.hasPermission('sys:experimentalTest:commitCheck')")
|
||||
public ServerResponse commitCheckTestData(EncryptedReq<ParamsAppDto> data) {
|
||||
return service.commitCheckTestData(data.getData());
|
||||
}
|
||||
|
|
|
|||
|
|
@ -23,7 +23,6 @@ import org.apache.poi.xssf.usermodel.XSSFWorkbook;
|
|||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.beans.factory.annotation.Value;
|
||||
import org.springframework.web.bind.annotation.PostMapping;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
|
|
@ -63,7 +62,6 @@ public class PrimaryDataAppController {
|
|||
@PostMapping(value = "getList")
|
||||
@DecryptAndVerify(decryptedClass = ParamsAppDto.class)
|
||||
@LogAnnotation(operModul = "原始记录管理", operation = "查询原始记录列表", operDesc = "系统级事件",operType="查询")
|
||||
// @PreAuthorize("@pms.hasPermission('primaryData:primary:query')" )
|
||||
public ServerResponse listPrimaryDatas(EncryptedReq<ParamsAppDto> data) {
|
||||
PageHelper.startPage(data.getData().getPage(), data.getData().getLimit());
|
||||
try {
|
||||
|
|
@ -79,7 +77,6 @@ public class PrimaryDataAppController {
|
|||
@PostMapping(value = "getDetailList")
|
||||
@DecryptAndVerify(decryptedClass = ParamsAppDto.class)
|
||||
@LogAnnotation(operModul = "原始记录管理", operation = "查询原始记录详情", operDesc = "系统级事件", operType = "查询")
|
||||
// @PreAuthorize("@pms.hasPermission('sys:experimentalTest:query')")
|
||||
public ServerResponse getDetailList(EncryptedReq<ParamsAppDto> data) {
|
||||
PageHelper.startPage(data.getData().getPage(), data.getData().getLimit());
|
||||
try {
|
||||
|
|
|
|||
|
|
@ -3,10 +3,16 @@ package com.bonus.aqgqj.app.controller;
|
|||
import com.bonus.aqgqj.annotation.DecryptAndVerify;
|
||||
import com.bonus.aqgqj.annotation.LogAnnotation;
|
||||
import com.bonus.aqgqj.app.entity.SamplesManageAppVo;
|
||||
import com.bonus.aqgqj.app.entity.dto.ParamsAppDto;
|
||||
import com.bonus.aqgqj.app.service.SamplesManageAppService;
|
||||
import com.bonus.aqgqj.basis.entity.dto.ParamsDto;
|
||||
import com.bonus.aqgqj.basis.entity.dto.SamplesManageDto;
|
||||
import com.bonus.aqgqj.basis.entity.vo.ContractsVo;
|
||||
import com.bonus.aqgqj.system.vo.EncryptedReq;
|
||||
import com.bonus.aqgqj.utils.ServerResponse;
|
||||
import com.bonus.aqgqj.utils.WordUtils;
|
||||
import com.fasterxml.jackson.core.type.TypeReference;
|
||||
import com.fasterxml.jackson.databind.ObjectMapper;
|
||||
import com.github.pagehelper.PageHelper;
|
||||
import com.github.pagehelper.PageInfo;
|
||||
import io.swagger.annotations.Api;
|
||||
|
|
@ -17,7 +23,10 @@ import org.springframework.web.bind.annotation.PostMapping;
|
|||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
|
||||
import java.util.List;
|
||||
import javax.servlet.http.HttpServletRequest;
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
import java.io.IOException;
|
||||
import java.util.*;
|
||||
|
||||
|
||||
/**
|
||||
|
|
@ -37,7 +46,6 @@ public class SamplesManageAppController {
|
|||
@PostMapping(value = "getList")
|
||||
@DecryptAndVerify(decryptedClass = SamplesManageAppVo.class)
|
||||
@LogAnnotation(operModul = "app收样管理", operation = "查询列表", operDesc = "业务级事件",operType="查询")
|
||||
// @PreAuthorize("@pms.hasPermission('sys:samples:query')" )
|
||||
public ServerResponse getList(EncryptedReq<SamplesManageAppVo> data) {
|
||||
PageHelper.startPage(data.getData().getPage(), data.getData().getLimit());
|
||||
try {
|
||||
|
|
@ -56,7 +64,6 @@ public class SamplesManageAppController {
|
|||
@PostMapping("delSamplesList")
|
||||
@DecryptAndVerify(decryptedClass = SamplesManageAppVo.class)
|
||||
@LogAnnotation(operModul = "收样管理", operation = "删除收样列表数据", operDesc = "业务级事件", operType = "删除")
|
||||
// @PreAuthorize("@pms.hasPermission('sys:samples:add')")
|
||||
public ServerResponse delSamplesList(EncryptedReq<SamplesManageAppVo> vo) {
|
||||
try {
|
||||
return samplesManageAppService.delSamplesList(vo.getData());
|
||||
|
|
@ -72,7 +79,6 @@ public class SamplesManageAppController {
|
|||
@PostMapping("delSamplesDetails")
|
||||
@DecryptAndVerify(decryptedClass = SamplesManageAppVo.class)
|
||||
@LogAnnotation(operModul = "收样管理", operation = "删除收样详情数据", operDesc = "业务级事件", operType = "删除")
|
||||
// @PreAuthorize("@pms.hasPermission('sys:samples:add')")
|
||||
public ServerResponse delSamplesDetails(EncryptedReq<SamplesManageAppVo> vo) {
|
||||
try {
|
||||
return samplesManageAppService.delSamplesDetails(vo.getData());
|
||||
|
|
@ -88,7 +94,6 @@ public class SamplesManageAppController {
|
|||
@PostMapping("updateSamplesList")
|
||||
@DecryptAndVerify(decryptedClass = SamplesManageAppVo.class)
|
||||
@LogAnnotation(operModul = "收样管理", operation = "修改收样信息", operDesc = "业务级事件", operType = "删除")
|
||||
// @PreAuthorize("@pms.hasPermission('sys:samples:add')")
|
||||
public ServerResponse updateSamplesList(EncryptedReq<SamplesManageAppVo> vo) {
|
||||
try {
|
||||
return samplesManageAppService.updateSamplesList(vo.getData());
|
||||
|
|
@ -101,7 +106,6 @@ public class SamplesManageAppController {
|
|||
@PostMapping(value = "getDetailsList")
|
||||
@DecryptAndVerify(decryptedClass = SamplesManageAppVo.class)
|
||||
@LogAnnotation(operModul = "app收样管理", operation = "收样管理详情", operDesc = "业务级事件",operType="查询")
|
||||
// @PreAuthorize("@pms.hasPermission('sys:samples:query')" )
|
||||
public ServerResponse getDetailsList(EncryptedReq<SamplesManageAppVo> data) {
|
||||
PageHelper.startPage(data.getData().getPage(), data.getData().getLimit());
|
||||
try {
|
||||
|
|
@ -117,7 +121,6 @@ public class SamplesManageAppController {
|
|||
@PostMapping(value = "getSampleLabelData")
|
||||
@DecryptAndVerify(decryptedClass = SamplesManageAppVo.class)
|
||||
@LogAnnotation(operModul = "app收样管理", operation = "收样标签", operDesc = "业务级事件",operType="查询")
|
||||
// @PreAuthorize("@pms.hasPermission('sys:samples:query')" )
|
||||
public ServerResponse getSampleLabelData(EncryptedReq<SamplesManageAppVo> data) {
|
||||
try {
|
||||
SamplesManageAppVo list = samplesManageAppService.getSampleLabelData(data.getData());
|
||||
|
|
@ -134,7 +137,6 @@ public class SamplesManageAppController {
|
|||
@PostMapping("addSamples")
|
||||
@DecryptAndVerify(decryptedClass = SamplesManageAppVo.class)
|
||||
@LogAnnotation(operModul = "收样管理", operation = "新增收样数据", operDesc = "业务级事件", operType = "新增")
|
||||
// @PreAuthorize("@pms.hasPermission('sys:samples:add')")
|
||||
public ServerResponse addSamples(EncryptedReq<SamplesManageAppVo> vo) {
|
||||
try {
|
||||
return samplesManageAppService.addSamples(vo.getData());
|
||||
|
|
@ -150,7 +152,6 @@ public class SamplesManageAppController {
|
|||
@PostMapping("dispatchWork")
|
||||
@DecryptAndVerify(decryptedClass = SamplesManageAppVo.class)
|
||||
@LogAnnotation(operModul = "收样管理", operation = "派工", operDesc = "业务级事件", operType = "新增")
|
||||
// @PreAuthorize("@pms.hasPermission('sys:samples:dispatch')")
|
||||
public ServerResponse dispatchWork(EncryptedReq<SamplesManageAppVo> vo) {
|
||||
try {
|
||||
return samplesManageAppService.dispatchWork(vo.getData());
|
||||
|
|
@ -163,7 +164,6 @@ public class SamplesManageAppController {
|
|||
@PostMapping(value = "getAuthority")
|
||||
@DecryptAndVerify(decryptedClass = SamplesManageAppVo.class)
|
||||
@LogAnnotation(operModul = "收样管理", operation = "查询是否具有派工/收样权限", operDesc = "业务级事件",operType="查询")
|
||||
// @PreAuthorize("@pms.hasPermission('sys:samples:query')" )
|
||||
public ServerResponse getAuthority(EncryptedReq<SamplesManageAppVo> data) {
|
||||
try {
|
||||
Boolean res = samplesManageAppService.getAuthority(data.getData());
|
||||
|
|
@ -174,4 +174,84 @@ public class SamplesManageAppController {
|
|||
return ServerResponse.createErroe("操作失败");
|
||||
}
|
||||
|
||||
@PostMapping(value = "getAmount")
|
||||
@DecryptAndVerify(decryptedClass = SamplesManageAppVo.class)
|
||||
@LogAnnotation(operModul = "收样管理", operation = "根据设备类型获取金额", operDesc = "业务级事件",operType="查询")
|
||||
public ServerResponse getAmount(EncryptedReq<SamplesManageAppVo> data) {
|
||||
try {
|
||||
String amountAll = samplesManageAppService.getAmount(data.getData());
|
||||
return ServerResponse.createSuccess(amountAll);
|
||||
}catch (Exception e){
|
||||
log.error(e.toString(),e);
|
||||
}
|
||||
return ServerResponse.createErroe("查询失败");
|
||||
}
|
||||
|
||||
/**
|
||||
* 是否审核前
|
||||
* @param data
|
||||
* @return
|
||||
*/
|
||||
@PostMapping(value = "getFlag")
|
||||
@DecryptAndVerify(decryptedClass = SamplesManageAppVo.class)
|
||||
public ServerResponse getFlag(EncryptedReq<SamplesManageAppVo> data) {
|
||||
return samplesManageAppService.getFlag(data.getData());
|
||||
}
|
||||
|
||||
/**
|
||||
* 收样管理-下载委托书
|
||||
*
|
||||
* @param request
|
||||
* @param response
|
||||
* @param dto
|
||||
* @return void
|
||||
* @author cwchen
|
||||
* @date 2024/9/2 10:46
|
||||
*/
|
||||
@PostMapping(value = "downloadEntrustContract")
|
||||
@DecryptAndVerify(decryptedClass = ParamsDto.class)
|
||||
public ServerResponse exportExcel(HttpServletRequest request, HttpServletResponse response, EncryptedReq<ParamsDto> dto) {
|
||||
Map<String, Object> data = new HashMap<>(16);
|
||||
try {
|
||||
// 委托书基本信息
|
||||
ContractsVo.BasicInfoVo basicInfoVo = samplesManageAppService.getBasicInfo(dto);
|
||||
ObjectMapper mapper = new ObjectMapper();
|
||||
data = mapper.convertValue(basicInfoVo, new TypeReference<Map<String, Object>>() {});
|
||||
List<ContractsVo> list = samplesDevList(dto.getData());
|
||||
data.put("sampleDevList", list);
|
||||
String fileUrl = WordUtils.exportMillCertificateWordApp(request, response, data, basicInfoVo.getBatchCode(), "contract.ftl");
|
||||
return ServerResponse.createSuccess("下载成功", fileUrl);
|
||||
} catch (IOException e) {
|
||||
log.error(e.toString(), e);
|
||||
}
|
||||
return ServerResponse.createErroe("下载失败");
|
||||
}
|
||||
|
||||
public List<ContractsVo> samplesDevList(ParamsDto dto) {
|
||||
List<ContractsVo> list = new ArrayList<>();
|
||||
list = samplesManageAppService.getSamplesDevList(dto);
|
||||
for (int i = 0; i < list.size(); i++) {
|
||||
list.get(i).setPre("0");
|
||||
list.get(i).setNow("0");
|
||||
list.get(i).setNext("0");
|
||||
if (i < list.size() - 1) {
|
||||
//当前和下一个相同就合并,将now设置为1
|
||||
if (Objects.equals(list.get(i).getConfigId(),list.get(i + 1).getConfigId())) {
|
||||
list.get(i).setNow("1");
|
||||
}
|
||||
}
|
||||
}
|
||||
for(int i=0;i<list.size();i++){
|
||||
//保存他的前一个元素是否需要合并
|
||||
if(i>0){
|
||||
list.get(i).setPre(list.get(i-1).getNow());
|
||||
}
|
||||
//保存他的后一个元素是否需要合并
|
||||
if(i<list.size()-1){
|
||||
list.get(i).setNext(list.get(i+1).getNow());
|
||||
}
|
||||
}
|
||||
return list;
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
|||
|
|
@ -59,7 +59,6 @@ public class TestReportManageAppController {
|
|||
@PostMapping(value = "getList")
|
||||
@DecryptAndVerify(decryptedClass = TestReportManageAppVo.class)
|
||||
@LogAnnotation(operModul = "检测报告管理-检测报告管理", operation = "查询用列表", operDesc = "业务级事件",operType="查询")
|
||||
// @PreAuthorize("@pms.hasPermission('sys:testReport:query')" )
|
||||
public ServerResponse listUsers(EncryptedReq<TestReportManageAppVo> data) {
|
||||
PageHelper.startPage(data.getData().getPage(), data.getData().getLimit());
|
||||
try {
|
||||
|
|
@ -75,7 +74,6 @@ public class TestReportManageAppController {
|
|||
@PostMapping(value = "getDetailsList")
|
||||
@DecryptAndVerify(decryptedClass = TestReportManageAppVo.class)
|
||||
@LogAnnotation(operModul = "检测报告管理-检测报告管理详情", operation = "查询用列表", operDesc = "业务级事件",operType="查询")
|
||||
// @PreAuthorize("@pms.hasPermission('sys:testReport:query')" )
|
||||
public ServerResponse getDetailsList(EncryptedReq<TestReportManageAppVo> data) {
|
||||
PageHelper.startPage(data.getData().getPage(), data.getData().getLimit());
|
||||
try {
|
||||
|
|
|
|||
|
|
@ -464,4 +464,11 @@ public interface ExperimentalAppMapper {
|
|||
* @return int
|
||||
*/
|
||||
int isAllSubmit(Long id);
|
||||
|
||||
/**
|
||||
* 判断提交审查数据中是否存在新增试验设备
|
||||
* @param sampleId
|
||||
* @return int
|
||||
*/
|
||||
Integer getNotFilledDevs(Long sampleId);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,8 +1,12 @@
|
|||
package com.bonus.aqgqj.app.dao;
|
||||
|
||||
import com.bonus.aqgqj.app.entity.SamplesManageAppVo;
|
||||
import com.bonus.aqgqj.basis.entity.dto.ParamsDto;
|
||||
import com.bonus.aqgqj.basis.entity.dto.SamplesManageDto;
|
||||
import com.bonus.aqgqj.basis.entity.vo.ConfigItemsVo;
|
||||
import com.bonus.aqgqj.basis.entity.vo.ContractsVo;
|
||||
import org.apache.ibatis.annotations.Mapper;
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
|
|
@ -149,4 +153,61 @@ public interface SamplesManageAppDao {
|
|||
* @return
|
||||
*/
|
||||
int getCountById(Integer id);
|
||||
|
||||
/**
|
||||
* 根据设备类型获取金额
|
||||
* @param data
|
||||
* @return
|
||||
*/
|
||||
String getAmount(SamplesManageAppVo data);
|
||||
|
||||
/**
|
||||
* 是否审核前
|
||||
* @param data
|
||||
* @return
|
||||
*/
|
||||
SamplesManageAppVo getFlag(SamplesManageAppVo data);
|
||||
|
||||
/**
|
||||
* 根据收样id查询设备类型总金额
|
||||
* @param id
|
||||
* @return
|
||||
*/
|
||||
String getAmountAll(Integer id);
|
||||
|
||||
/**
|
||||
* 委托书基本信息
|
||||
* @param data
|
||||
* @return
|
||||
*/
|
||||
ContractsVo.BasicInfoVo getBasicInfo(ParamsDto data);
|
||||
|
||||
/**
|
||||
* 获取收样信息
|
||||
* @param data
|
||||
* @return
|
||||
*/
|
||||
List<ContractsVo> getSampleList(ParamsDto data);
|
||||
|
||||
/**
|
||||
* 查询收样设备
|
||||
* @param dto
|
||||
* @return
|
||||
*/
|
||||
List<ContractsVo> getSamplesDevList(ParamsDto dto);
|
||||
|
||||
/**
|
||||
* 获取试验依据
|
||||
* @param configId
|
||||
* @return
|
||||
*/
|
||||
List<String> getExperBasisAndSampleNum(Long configId);
|
||||
|
||||
/**
|
||||
* 获取收样设备数量
|
||||
* @param dto
|
||||
* @param devCode
|
||||
* @return
|
||||
*/
|
||||
Integer getSampleNum(@Param("params") ParamsDto dto,@Param("devCode") String devCode);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -217,4 +217,20 @@ public class SamplesManageAppVo extends PageEntity {
|
|||
*/
|
||||
private String endTime;
|
||||
|
||||
/**
|
||||
* 设备数量
|
||||
*/
|
||||
private String devNum;
|
||||
|
||||
/**
|
||||
* 总金额
|
||||
*/
|
||||
private String totalAmount;
|
||||
|
||||
/**
|
||||
* 试验状态 0:未试验 1:已试验
|
||||
*/
|
||||
private Integer experStatus;
|
||||
|
||||
|
||||
}
|
||||
|
|
|
|||
|
|
@ -233,6 +233,11 @@ public class TestAppVo {
|
|||
|
||||
private String allMoney;
|
||||
|
||||
/**
|
||||
* 试验周期
|
||||
*/
|
||||
private String cycle;
|
||||
|
||||
/**
|
||||
* 查询条件限制
|
||||
*/
|
||||
|
|
|
|||
|
|
@ -64,16 +64,6 @@ public interface ExperimentalAppService {
|
|||
*/
|
||||
ServerResponse editTestData(TestAppVo data);
|
||||
|
||||
// /**
|
||||
// * 删除试验数据
|
||||
// *
|
||||
// * @param data
|
||||
// * @return ServerResponse
|
||||
// * @author cwchen
|
||||
// * @date 2024/7/21 20:06
|
||||
// */
|
||||
// ServerResponse delTestData(ParamsAppDto data);
|
||||
|
||||
/**
|
||||
* 试验数据详情
|
||||
*
|
||||
|
|
|
|||
|
|
@ -1,6 +1,9 @@
|
|||
package com.bonus.aqgqj.app.service;
|
||||
|
||||
import com.bonus.aqgqj.app.entity.SamplesManageAppVo;
|
||||
import com.bonus.aqgqj.basis.entity.dto.ParamsDto;
|
||||
import com.bonus.aqgqj.basis.entity.vo.ContractsVo;
|
||||
import com.bonus.aqgqj.system.vo.EncryptedReq;
|
||||
import com.bonus.aqgqj.utils.ServerResponse;
|
||||
|
||||
import java.util.List;
|
||||
|
|
@ -72,4 +75,32 @@ public interface SamplesManageAppService {
|
|||
* @return
|
||||
*/
|
||||
ServerResponse delSamplesDetails(SamplesManageAppVo data);
|
||||
|
||||
/**
|
||||
* 获取总金额
|
||||
* @param data
|
||||
* @return
|
||||
*/
|
||||
String getAmount(SamplesManageAppVo data);
|
||||
|
||||
/**
|
||||
* 是否审核前
|
||||
* @param data
|
||||
* @return
|
||||
*/
|
||||
ServerResponse getFlag(SamplesManageAppVo data);
|
||||
|
||||
/**
|
||||
* 委托书基本信息
|
||||
* @param dto
|
||||
* @return
|
||||
*/
|
||||
ContractsVo.BasicInfoVo getBasicInfo(EncryptedReq<ParamsDto> dto);
|
||||
|
||||
/**
|
||||
* 查询收样设备
|
||||
* @param dto
|
||||
* @return
|
||||
*/
|
||||
List<ContractsVo> getSamplesDevList(ParamsDto dto);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -53,17 +53,6 @@ public class ExamineAppServiceImpl implements ExamineAppService {
|
|||
List<ExperimentalAppVo> list = new ArrayList<>();
|
||||
try {
|
||||
list = mapper.getList(dto);
|
||||
// if (list.size() > 0) {
|
||||
// //查询详情里需要审核的id
|
||||
// for (int i = 0; i < list.size(); i++) {
|
||||
// ExperimentalAppVo experimentalAppVo = list.get(i);
|
||||
// if ("待重新审阅".equals(experimentalAppVo.getAudtiStatus())) {
|
||||
// experimentalAppVo.setAudtiStatus("待审阅");
|
||||
// }
|
||||
// List<ExperimentalAppVo> list1 = mapper.getDetailIdBySampleId(experimentalAppVo.getId(),experimentalAppVo.getAudtiStatus());
|
||||
// list.get(i).setIds(list1.get(0).getIds());
|
||||
// }
|
||||
// }
|
||||
} catch (Exception e) {
|
||||
log.error(e.toString(), e);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -295,29 +295,6 @@ public class ExperimentalAppServiceImpl implements ExperimentalAppService {
|
|||
return ServerResponse.createBySuccessMsg("操作成功");
|
||||
}
|
||||
|
||||
// @Override
|
||||
// @Transactional(rollbackFor = Exception.class)
|
||||
// public ServerResponse delTestData(ParamsAppDto dto) {
|
||||
// try {
|
||||
// // 删除试验依据、试验样品设备、设备试验项信息、设备试验项数据、试验项、试验项内容、试验信息
|
||||
// List<Long> experDevIds = mapper.getExperDevIds(dto.getId());
|
||||
// List<Long> experDevItemsIds = mapper.getExperDevItems(experDevIds);
|
||||
// List<Long> experItemsIds = mapper.getExperItemsIds(dto.getId());
|
||||
// mapper.delConfigBasis(dto.getId());
|
||||
// mapper.delExperDev(dto.getId());
|
||||
// mapper.delExperDevItems(experDevIds);
|
||||
// mapper.delExperDevItem(experDevItemsIds);
|
||||
// mapper.delExperItems(dto.getId());
|
||||
// mapper.delExperItem(experItemsIds);
|
||||
// mapper.delExper(dto.getId());
|
||||
// } catch (Exception e) {
|
||||
// log.error(e.toString(), e);
|
||||
// TransactionAspectSupport.currentTransactionStatus().setRollbackOnly();
|
||||
// return ServerResponse.createByErrorMsg(HttpStatus.ERROR, "操作失败");
|
||||
// }
|
||||
// return ServerResponse.createBySuccessMsg("操作成功");
|
||||
// }
|
||||
|
||||
@Override
|
||||
public ServerResponse viewTestData(ParamsAppDto dto) {
|
||||
TestAppVo testAppVo = new TestAppVo();
|
||||
|
|
@ -362,33 +339,6 @@ public class ExperimentalAppServiceImpl implements ExperimentalAppService {
|
|||
}
|
||||
}
|
||||
|
||||
// @Override
|
||||
// @Transactional(rollbackFor = Exception.class)
|
||||
// public ServerResponse commitCheckTestData(ParamsAppDto dto) {
|
||||
// try {
|
||||
// if (dto.getId() == null || dto.getIds() == null || dto.getIds().length == 0) {
|
||||
// return ServerResponse.createByErrorMsg(HttpStatus.ERROR, "未提交审查数据");
|
||||
// }
|
||||
// if (!SystemUtils.isExperimentalTeam()) {
|
||||
// return ServerResponse.createByErrorMsg(HttpStatus.ERROR, "非试验班组,无法提交审查数据");
|
||||
// }
|
||||
// List<Long> list = Arrays.asList(dto.getIds());
|
||||
// //先更新tb_exper表中数据为待审阅
|
||||
// mapper.updateExperStatus(list);
|
||||
// //在查询tb_exper中是否全部为待审阅
|
||||
// int res = mapper.isAllSubmit(dto.getId());
|
||||
// if (res<=0){
|
||||
// //如果全部为待审阅,更新收样表中的状态为待审阅
|
||||
// mapper.updateSampleStatus(dto.getId());
|
||||
// }
|
||||
// } catch (Exception e) {
|
||||
// log.error(e.toString(), e);
|
||||
// TransactionAspectSupport.currentTransactionStatus().setRollbackOnly();
|
||||
// return ServerResponse.createByErrorMsg(HttpStatus.ERROR, "操作失败");
|
||||
// }
|
||||
// return ServerResponse.createBySuccessMsg("操作成功");
|
||||
// }
|
||||
|
||||
@Override
|
||||
@Transactional(rollbackFor = Exception.class)
|
||||
public ServerResponse commitCheckTestData(ParamsAppDto dto) {
|
||||
|
|
@ -406,6 +356,12 @@ public class ExperimentalAppServiceImpl implements ExperimentalAppService {
|
|||
if (result > 0) {
|
||||
return ServerResponse.createByErrorMsg(HttpStatus.ERROR, "提交数据中存在待试验项或处于审核流程或已试验结束");
|
||||
}
|
||||
for (Long sampleId : list) {
|
||||
Integer notFilledDevsNum = mapper.getNotFilledDevs(sampleId);
|
||||
if(notFilledDevsNum > 0){
|
||||
return ServerResponse.createByErrorMsg(HttpStatus.ERROR, "提交的数据中已添加新的试验设备,请先填写试验信息");
|
||||
}
|
||||
}
|
||||
// 更新收样表中的状态为待审阅
|
||||
mapper.updateSampleStatus(list);
|
||||
// 更新试验表中数据为待审阅
|
||||
|
|
|
|||
|
|
@ -5,15 +5,24 @@ import com.alibaba.fastjson.JSONObject;
|
|||
import com.bonus.aqgqj.app.dao.SamplesManageAppDao;
|
||||
import com.bonus.aqgqj.app.entity.SamplesManageAppVo;
|
||||
import com.bonus.aqgqj.app.service.SamplesManageAppService;
|
||||
import com.bonus.aqgqj.basis.entity.dto.ParamsDto;
|
||||
import com.bonus.aqgqj.basis.entity.dto.SamplesManageDto;
|
||||
import com.bonus.aqgqj.basis.entity.vo.ConfigItemsVo;
|
||||
import com.bonus.aqgqj.basis.entity.vo.ContractsVo;
|
||||
import com.bonus.aqgqj.basis.service.SamplesManageService;
|
||||
import com.bonus.aqgqj.system.vo.EncryptedReq;
|
||||
import com.bonus.aqgqj.utils.*;
|
||||
import com.bonus.aqgqj.webResult.StringUtils;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.apache.commons.collections4.CollectionUtils;
|
||||
import org.springframework.stereotype.Service;
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
import java.util.List;
|
||||
import java.text.SimpleDateFormat;
|
||||
import java.util.*;
|
||||
import java.util.stream.Collectors;
|
||||
import java.util.stream.IntStream;
|
||||
|
||||
/**
|
||||
* @description 收样管理
|
||||
|
|
@ -37,8 +46,12 @@ public class SamplesManageAppServiceImpl implements SamplesManageAppService {
|
|||
public List<SamplesManageAppVo> list(SamplesManageAppVo bean) {
|
||||
List<SamplesManageAppVo> list = samplesManageAppDao.list(bean);
|
||||
for (SamplesManageAppVo dto : list){
|
||||
//查询该收样数据下所有的设备类型,用、分隔
|
||||
String sampleTools = samplesManageAppDao.getSampleTools(dto.getId());
|
||||
dto.setSampleTools(sampleTools);
|
||||
//查询金额
|
||||
String totalAmount = samplesManageAppDao.getAmountAll(dto.getId());
|
||||
dto.setTotalAmount(totalAmount);
|
||||
}
|
||||
return list;
|
||||
}
|
||||
|
|
@ -55,6 +68,7 @@ public class SamplesManageAppServiceImpl implements SamplesManageAppService {
|
|||
@Override
|
||||
@Transactional(rollbackFor = Exception.class)
|
||||
public ServerResponse addSamples(SamplesManageAppVo data) {
|
||||
SimpleDateFormat outputFormat = new SimpleDateFormat("yyyyMMddHHmmss");
|
||||
JSONArray jsonArray = JSONObject.parseArray(data.getParamsList());
|
||||
List<SamplesManageAppVo> SamplesManageAppVos = jsonArray.toJavaList(SamplesManageAppVo.class);
|
||||
if (SamplesManageAppVos.size() > 0){
|
||||
|
|
@ -108,13 +122,6 @@ public class SamplesManageAppServiceImpl implements SamplesManageAppService {
|
|||
//获取单位id
|
||||
Integer customId = data.get(0).getCustomId();
|
||||
for (SamplesManageAppVo dto : data){
|
||||
//查询设备编号是否重复
|
||||
// if (StringHelper.isNotEmpty(dto.getDevCode())){
|
||||
// if (samplesManageAppDao.getCountByDevCode(dto.getDevCode(),dto.getSampleTools())>0){
|
||||
// throw new RuntimeException(dto.getSampleTools() +"设备编号:"+ dto.getDevCode() +"已存在");
|
||||
// }
|
||||
// }
|
||||
|
||||
//判断是否含有不是该单位下部门的数据
|
||||
if (customId!=null && dto.getDepartmentId()!=null){
|
||||
int res=samplesManageAppDao.getCountByDepartmentId(dto.getDepartmentId(),customId);
|
||||
|
|
@ -133,6 +140,7 @@ public class SamplesManageAppServiceImpl implements SamplesManageAppService {
|
|||
dto.setCustomerCode(customerCode);
|
||||
dto.setId(data.get(0).getId());
|
||||
dto.setCreateBy(data.get(0).getCreateBy());
|
||||
dto.setDevCode(DateTimeHelper.getNowDMS() +"-" + dto.getDevCode());
|
||||
int res= samplesManageAppDao.addSamplesDevice(dto);
|
||||
if (res<=0){
|
||||
throw new RuntimeException("收样设备信息表添加失败");
|
||||
|
|
@ -243,6 +251,140 @@ public class SamplesManageAppServiceImpl implements SamplesManageAppService {
|
|||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getAmount(SamplesManageAppVo data) {
|
||||
return samplesManageAppDao.getAmount(data);
|
||||
}
|
||||
|
||||
@Override
|
||||
public ServerResponse getFlag(SamplesManageAppVo data) {
|
||||
try{
|
||||
SamplesManageAppVo vo= samplesManageAppDao.getFlag(data);
|
||||
if(vo==null){
|
||||
return ServerResponse.createErroe("该数据已提交审阅,不可操作");
|
||||
}
|
||||
return ServerResponse.createSuccess("查询成功");
|
||||
}catch (Exception e){
|
||||
return ServerResponse.createErroe("查询失败");
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public ContractsVo.BasicInfoVo getBasicInfo(EncryptedReq<ParamsDto> dto) {
|
||||
ContractsVo.BasicInfoVo vo = new ContractsVo.BasicInfoVo();
|
||||
try {
|
||||
vo = samplesManageAppDao.getBasicInfo(dto.getData());
|
||||
List<ContractsVo> idsList = samplesManageAppDao.getSampleList(dto.getData());
|
||||
vo.setNumber(setNumber(idsList,dto.getData()));
|
||||
} catch (Exception e) {
|
||||
log.error(e.toString(),e);
|
||||
}
|
||||
return vo;
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<ContractsVo> getSamplesDevList(ParamsDto dto) {
|
||||
List<ContractsVo> list = new ArrayList<>();
|
||||
try {
|
||||
list = samplesManageAppDao.getSamplesDevList(dto);
|
||||
if (CollectionUtils.isNotEmpty(list)) {
|
||||
Map<Long, List<ContractsVo>> groupedItems = list.stream().collect(Collectors.groupingBy(ContractsVo::getConfigId));
|
||||
Map<Long, List<ContractsVo>> sortedMap = groupedItems.entrySet().stream()
|
||||
.sorted(Map.Entry.comparingByKey())
|
||||
.collect(Collectors.toMap(
|
||||
Map.Entry::getKey,
|
||||
Map.Entry::getValue,
|
||||
// 解决可能存在的键冲突问题,默认保留第一个值
|
||||
(oldValue, newValue) -> oldValue,
|
||||
// 提供一个新的TreeMap实例作为收集器,用于保持排序
|
||||
() -> new TreeMap<>()
|
||||
));
|
||||
Integer index = 1;
|
||||
for (Map.Entry<Long, List<ContractsVo>> entry : sortedMap.entrySet()) {
|
||||
List<ContractsVo> groupList = entry.getValue();
|
||||
for (ContractsVo vo : groupList) {
|
||||
vo.setIndex(index);
|
||||
}
|
||||
index++;
|
||||
}
|
||||
for (int i = 0; i < list.size(); i++) {
|
||||
ContractsVo vo = list.get(i);
|
||||
List<String> experBasisList = samplesManageAppDao.getExperBasisAndSampleNum(vo.getConfigId());
|
||||
Integer sampleDevNum = samplesManageAppDao.getSampleNum(dto, vo.getDevCode());
|
||||
vo.setTestYj(handleData(experBasisList));
|
||||
vo.setNum(String.valueOf(sampleDevNum));
|
||||
vo.setSampleCode(handleSampleCode(vo.getConfigId(), vo.getSampleDate(), sortedMap));
|
||||
}
|
||||
} else {
|
||||
ContractsVo vo = new ContractsVo();
|
||||
vo.setName("/");
|
||||
vo.setModel("/");
|
||||
vo.setSampleCode("/");
|
||||
vo.setNum("/");
|
||||
vo.setTestItem("/");
|
||||
vo.setTestYj("/");
|
||||
vo.setRemark("/");
|
||||
list.add(vo);
|
||||
}
|
||||
} catch (Exception e) {
|
||||
log.error(e.toString(), e);
|
||||
}
|
||||
return list;
|
||||
}
|
||||
|
||||
public String handleData(List<String> list) {
|
||||
if (CollectionUtils.isEmpty(list)) {
|
||||
return "";
|
||||
} else {
|
||||
StringBuffer sb = new StringBuffer();
|
||||
if (list.size() == 1) {
|
||||
return sb.append(list.get(0)).toString();
|
||||
} else {
|
||||
for (int i = 0; i < list.size(); i++) {
|
||||
String val = list.get(i);
|
||||
if (i == list.size() - 1) {
|
||||
sb.append(val);
|
||||
} else {
|
||||
sb.append(val).append("<w:br/>");
|
||||
}
|
||||
}
|
||||
}
|
||||
return sb.toString();
|
||||
}
|
||||
}
|
||||
|
||||
public String handleSampleCode(Long configId, String val, Map<Long, List<ContractsVo>> groupItems) {
|
||||
if (StringUtils.isEmpty(val)) {
|
||||
return "";
|
||||
} else {
|
||||
String date = val.replaceAll("-", "");
|
||||
for (Map.Entry<Long, List<ContractsVo>> entry : groupItems.entrySet()) {
|
||||
List<ContractsVo> groupList = entry.getValue();
|
||||
Integer index = groupList.get(0).getIndex();
|
||||
if (Objects.equals(configId, entry.getKey())) {
|
||||
if (index < 10) {
|
||||
return date + "-" + "0" + index;
|
||||
} else {
|
||||
return date + "-" + index;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
return "";
|
||||
}
|
||||
|
||||
public String setNumber(List<ContractsVo> idsList,ParamsDto dto){
|
||||
ContractsVo vo = idsList.get(0);
|
||||
OptionalInt index = IntStream.range(0, idsList.size())
|
||||
.filter(i -> Objects.equals(idsList.get(i).getId(),dto.getId()))
|
||||
.findFirst();
|
||||
if(index!=null){
|
||||
int indexAsInt = index.getAsInt();
|
||||
return vo.getSampleDate().replaceAll("-","") + (indexAsInt+1);
|
||||
}
|
||||
return vo.getSampleDate().replaceAll("-","");
|
||||
}
|
||||
|
||||
@Override
|
||||
@Transactional(rollbackFor = Exception.class)
|
||||
public ServerResponse dispatchWork(SamplesManageAppVo data) {
|
||||
|
|
|
|||
|
|
@ -663,8 +663,10 @@ public class TestReportManageAppServiceImpl implements TestReportManageAppServic
|
|||
* @param sheet 创建的sheet页
|
||||
*/
|
||||
public static void addMergedRegion(int startRow,int endRow,int startCol,int endCol,Sheet sheet){
|
||||
CellRangeAddress cra = new CellRangeAddress(startRow,endRow,startCol,endCol);
|
||||
sheet.addMergedRegion(cra);
|
||||
if(startCol!=endCol){
|
||||
CellRangeAddress cra = new CellRangeAddress(startRow,endRow,startCol,endCol);
|
||||
sheet.addMergedRegion(cra);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
|
|||
|
|
@ -43,6 +43,10 @@ public class ContractsVo {
|
|||
|
||||
@Data
|
||||
public static class BasicInfoVo{
|
||||
/**
|
||||
* 收样批次
|
||||
*/
|
||||
private String batchCode;
|
||||
/***/
|
||||
private String code = "ML/JL-09-01";
|
||||
/**编号*/
|
||||
|
|
|
|||
|
|
@ -89,6 +89,38 @@ public class WordUtils {
|
|||
return f;
|
||||
}
|
||||
|
||||
public static String exportMillCertificateWordApp(HttpServletRequest request, HttpServletResponse response, Map map, String batchCode, String ftlFile) throws IOException {
|
||||
Template freemarkerTemplate = configuration.getTemplate(ftlFile);
|
||||
String filePath = createDocApp(map, freemarkerTemplate,batchCode);
|
||||
return "statics/"+filePath;
|
||||
}
|
||||
|
||||
private static String createDocApp(Map<?, ?> dataMap, Template template,String batchCode) {
|
||||
String fileName = batchCode+"_委托书.doc";
|
||||
File f = new File(SystemUtils.getUploadPath()+ fileName);
|
||||
if (!f.getParentFile().exists()){
|
||||
f.getParentFile().mkdirs();
|
||||
}
|
||||
try {
|
||||
// 使用OutputStreamWriter确保写入文件时使用正确的编码
|
||||
Writer w = new OutputStreamWriter(new FileOutputStream(f), "utf-8");
|
||||
template.process(dataMap, w);
|
||||
w.close();
|
||||
|
||||
// 这里可以保留文件,或者根据需要在方法结束时删除
|
||||
// 例如,如果你确定不再需要这个文件,可以调用 FileUtils.deleteQuietly(f);
|
||||
|
||||
return fileName;
|
||||
} catch (Exception ex) {
|
||||
ex.printStackTrace();
|
||||
// 可以在这里处理异常,例如删除已创建的文件等
|
||||
if (f.exists()) {
|
||||
f.delete();
|
||||
}
|
||||
throw new RuntimeException(ex);
|
||||
}
|
||||
}
|
||||
|
||||
public static void exportMillCertificateWord2(HttpServletRequest request, HttpServletResponse response, Map map, String title, String ftlFile, String path) throws IOException {
|
||||
Template freemarkerTemplate = configuration.getTemplate(ftlFile);
|
||||
File file = null;
|
||||
|
|
|
|||
|
|
@ -336,6 +336,7 @@
|
|||
<if test="roleCode == 'experimentalTeamMember' and teamId == null">
|
||||
AND ts.team_id = -1
|
||||
</if>
|
||||
ORDER BY ts.id desc
|
||||
</select>
|
||||
<!--试验详情列表-->
|
||||
<select id="getDetailList" resultType="com.bonus.aqgqj.app.entity.ExperimentalDetailAppVo">
|
||||
|
|
@ -391,10 +392,12 @@
|
|||
a.dev_module AS devModule,
|
||||
a.exper_local_code AS experLocalCode,
|
||||
a.exper_local AS experLocal,
|
||||
a.cycle,
|
||||
ts.id AS sampleId
|
||||
FROM tb_sample ts
|
||||
LEFT JOIN (
|
||||
SELECT tsd.dev_type_code,
|
||||
ANY_VALUE(tsc.times) as cycle,
|
||||
ANY_VALUE(tsc.dev_type_name) AS dev_type_name,
|
||||
ANY_VALUE(tsc.dev_module) AS dev_module,
|
||||
ANY_VALUE(tsc.exper_local_code) AS exper_local_code,
|
||||
|
|
@ -632,4 +635,10 @@
|
|||
WHERE a.experId is null
|
||||
or (a.`status`!=0 and a.auditStatus>1)) b
|
||||
</select>
|
||||
<select id="getNotFilledDevs" resultType="java.lang.Integer">
|
||||
SELECT COUNT(*)
|
||||
FROM tb_sample_device tsd
|
||||
LEFT JOIN tb_exper_dev ted ON tsd.id = ted.dev_id
|
||||
WHERE tsd.sample_id = #{sampleId} AND tsd.del_falg = 0 AND ted.id IS NULL
|
||||
</select>
|
||||
</mapper>
|
||||
|
|
|
|||
|
|
@ -115,6 +115,7 @@
|
|||
)
|
||||
</if>
|
||||
GROUP BY ts.id
|
||||
ORDER BY tsd.create_time desc
|
||||
</select>
|
||||
<select id="getSampleTools" resultType="java.lang.String">
|
||||
SELECT GROUP_CONCAT(aa.dev_type_name SEPARATOR '、') AS sampleTools
|
||||
|
|
@ -134,17 +135,24 @@
|
|||
tsd.dev_code as devCode,
|
||||
tsd.customer_code as customerCode,
|
||||
tt.team_name as teamName,
|
||||
CASE
|
||||
WHEN ted.id IS NULL THEN
|
||||
'0'
|
||||
ELSE
|
||||
'1'
|
||||
END AS experStatus,
|
||||
tsd.is_print as isPrint
|
||||
from
|
||||
tb_sample_device tsd
|
||||
LEFT JOIN tb_sample ts on tsd.sample_id=ts.id
|
||||
LEFT JOIN tb_custom tc on tsd.department_id=tc.id and tc.del_flag=0
|
||||
LEFT JOIN tb_team tt on tt.id=ts.team_id and tt.del_flag=0
|
||||
LEFT JOIN tb_exper_dev ted on ted.dev_id=tsd.id
|
||||
where tsd.del_falg = 0
|
||||
and tsd.sample_id = #{id}
|
||||
<if test="keyWord != null and keyWord != ''">
|
||||
AND (
|
||||
tsd.dev_type_name like concat('%',#{sampleTools}, '%') OR
|
||||
tsd.dev_type_name like concat('%',#{keyWord}, '%') OR
|
||||
tsd.dev_code like concat('%', #{keyWord}, '%') OR
|
||||
tsd.customer_code like concat('%', #{keyWord}, '%') OR
|
||||
tsd.dev_module like concat('%', #{keyWord}, '%') OR
|
||||
|
|
@ -236,4 +244,73 @@
|
|||
FROM tb_sample_device
|
||||
WHERE sample_id IN (SELECT tsd.sample_id FROM tb_sample_device tsd WHERE tsd.id = #{id}) and del_falg=0
|
||||
</select>
|
||||
<select id="getAmount" resultType="java.lang.String">
|
||||
select sum(tci.amount) as totalAmount
|
||||
from tb_exper_config_info teci
|
||||
left join tb_exper_config tec on teci.config_id = tec.id
|
||||
left join tb_config_items tci on teci.item_id = tci.id
|
||||
where tec.dev_type_name like concat('%',#{sampleTools}, '%') and tec.del_flag = 0
|
||||
</select>
|
||||
<select id="getFlag" resultType="com.bonus.aqgqj.app.entity.SamplesManageAppVo">
|
||||
select id
|
||||
from tb_sample ts
|
||||
where ts.id = #{id} and ts.del_flag = 0 and ((audti_status = 0 and process_status is null) or (audti_status = 0 and process_status = 0 )
|
||||
or (audti_status = 2 and process_status = 1 ) or (audti_status = 2 and process_status = 2 ) or (audti_status = 2 and process_status = 3 ))
|
||||
</select>
|
||||
<select id="getAmountAll" resultType="java.lang.String">
|
||||
SELECT
|
||||
SUM(IFNULL(tci.amount,0)) AS totalAmount
|
||||
FROM
|
||||
tb_exper_config_info teci
|
||||
LEFT JOIN tb_exper_config tec ON teci.config_id = tec.id
|
||||
LEFT JOIN tb_config_items tci ON teci.item_id = tci.id
|
||||
LEFT JOIN tb_sample_device tsd ON tec.dev_type_name = tsd.dev_type_name
|
||||
WHERE
|
||||
tsd.sample_id = #{id}
|
||||
AND tec.del_flag = 0
|
||||
</select>
|
||||
<select id="getBasicInfo" resultType="com.bonus.aqgqj.basis.entity.vo.ContractsVo$BasicInfoVo">
|
||||
SELECT ts.batch_code AS batchCode,
|
||||
tc.custom_name AS client,
|
||||
tc.custom_user AS contacts,
|
||||
tc.custom_phone AS contactsPhone
|
||||
FROM tb_sample ts
|
||||
LEFT JOIN tb_custom tc ON ts.custom_id = tc.id
|
||||
WHERE ts.id = #{id}
|
||||
</select>
|
||||
<select id="getSampleList" resultType="com.bonus.aqgqj.basis.entity.vo.ContractsVo">
|
||||
SELECT id,sample_date AS sampleDate
|
||||
FROM tb_sample
|
||||
WHERE del_flag = 0 AND sample_date = (SELECT sample_date FROM tb_sample WHERE id = #{id})
|
||||
ORDER BY id
|
||||
</select>
|
||||
<select id="getSamplesDevList" resultType="com.bonus.aqgqj.basis.entity.vo.ContractsVo">
|
||||
SELECT *
|
||||
FROM (SELECT ANY_VALUE(tsd.dev_type_code) AS devCode,
|
||||
ANY_VALUE(tsd.dev_type_name) AS name,
|
||||
ANY_VALUE(DATE_FORMAT(ts.sample_date, '%Y-%m-%d')) AS sampleDate,
|
||||
ANY_VALUE(tec.dev_module) AS model,
|
||||
ANY_VALUE(tec.id) AS configId,
|
||||
ANY_VALUE(tci.exper_type_name) AS testItem,
|
||||
ANY_VALUE(tci.id) AS itemId,
|
||||
'' AS remark
|
||||
FROM tb_sample_device tsd
|
||||
LEFT JOIN tb_sample ts ON ts.id = tsd.sample_id AND ts.del_flag = 0
|
||||
LEFT JOIN tb_exper_config tec ON tsd.dev_type_code = tec.dev_type_code AND tec.del_flag = 0
|
||||
LEFT JOIN tb_exper_config_info teci ON tec.id = teci.config_id
|
||||
INNER JOIN tb_config_items tci ON teci.item_id = tci.id
|
||||
WHERE tsd.sample_id = #{id}
|
||||
AND tsd.del_falg = 0
|
||||
GROUP BY tsd.dev_type_code, tci.id) a
|
||||
ORDER BY a.configId
|
||||
</select>
|
||||
<select id="getExperBasisAndSampleNum" resultType="java.lang.String">
|
||||
SELECT basis_name FROM tb_exper_basis WHERE config_id = #{configId}
|
||||
</select>
|
||||
<select id="getSampleNum" resultType="java.lang.Integer">
|
||||
SELECT COUNT(tsd.id) AS num
|
||||
FROM tb_sample_device tsd
|
||||
LEFT JOIN tb_sample ts ON ts.id = tsd.sample_id AND ts.del_flag = 0
|
||||
WHERE tsd.sample_id = #{params.id} AND tsd.dev_type_code = #{devCode} AND tsd.del_falg = 0
|
||||
</select>
|
||||
</mapper>
|
||||
Loading…
Reference in New Issue