Commit 93706d81 by lijingjing

添加部分流程检测单位限制;

parent bbf88bca
...@@ -108,4 +108,12 @@ public class EntrustFlowUtils { ...@@ -108,4 +108,12 @@ public class EntrustFlowUtils {
} }
return statusEnum; return statusEnum;
} }
public static boolean isContains(String statusPath, String flowStatus) {
if (StringUtils.isBlank(statusPath) || StringUtils.isBlank(flowStatus)) {
return false;
}
List<String> flowList = Arrays.asList(statusPath.split("->"));
return flowList.stream().anyMatch(t -> t.equals(flowStatus));
}
} }
...@@ -208,9 +208,10 @@ public class EntrustController extends ServiceController { ...@@ -208,9 +208,10 @@ public class EntrustController 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_make") @PostMapping("/page_make")
public RestResult<Page<Entrust>> getPageMake(Entrust entrust) { public RestResult<Page<EntrustVO>> getPageMake(EntrustVO entrust) {
entrust.setStatus(EntrustStatusEnum.MAKE); entrust.setStatus(EntrustStatusEnum.MAKE);
return success(entrustService.page(getPage(), entrust)); entrust.setGroupNameList(userInfoService.getCurGroupNameList());
return success(entrustService.pageEntrustSampleMake(getPage(), entrust));
} }
...@@ -224,6 +225,7 @@ public class EntrustController extends ServiceController { ...@@ -224,6 +225,7 @@ public class EntrustController extends ServiceController {
@PostMapping("/page_make_his") @PostMapping("/page_make_his")
public RestResult<Page<EntrustVO>> getPageMakeHis(EntrustVO entrust) { public RestResult<Page<EntrustVO>> getPageMakeHis(EntrustVO entrust) {
entrust.setNotSampleStatus(EntrustSampleStatusEnum.DRAFT); entrust.setNotSampleStatus(EntrustSampleStatusEnum.DRAFT);
entrust.setGroupNameList(userInfoService.getCurGroupNameList());
return success(entrustService.pageEntrustByNotSample(getPage(), entrust)); return success(entrustService.pageEntrustByNotSample(getPage(), entrust));
} }
...@@ -400,7 +402,6 @@ public class EntrustController extends ServiceController { ...@@ -400,7 +402,6 @@ public class EntrustController extends ServiceController {
@PostMapping("/page_entrust_sample_receive") @PostMapping("/page_entrust_sample_receive")
public RestResult<Page<EntrustVO>> getPageEntrustSampleReceive(EntrustVO entrust) { public RestResult<Page<EntrustVO>> getPageEntrustSampleReceive(EntrustVO entrust) {
entrust.setPrepareStatus(EntrustSamplePrepareStatusEnum.RECEIVE); entrust.setPrepareStatus(EntrustSamplePrepareStatusEnum.RECEIVE);
// 设置用户编组
entrust.setGroupNameList(userInfoService.getCurGroupNameList()); entrust.setGroupNameList(userInfoService.getCurGroupNameList());
return success(entrustService.pageEntrustSampleReceive(getPage(), entrust)); return success(entrustService.pageEntrustSampleReceive(getPage(), entrust));
} }
...@@ -416,7 +417,6 @@ public class EntrustController extends ServiceController { ...@@ -416,7 +417,6 @@ public class EntrustController extends ServiceController {
@PostMapping("/page_entrust_sample_receive_his") @PostMapping("/page_entrust_sample_receive_his")
public RestResult<Page<EntrustVO>> getPageEntrustSampleReceiveHis(EntrustVO entrust) { public RestResult<Page<EntrustVO>> getPageEntrustSampleReceiveHis(EntrustVO entrust) {
entrust.setPrepareNotStatus(EntrustSamplePrepareStatusEnum.RECEIVE); entrust.setPrepareNotStatus(EntrustSamplePrepareStatusEnum.RECEIVE);
// 设置用户编组
entrust.setGroupNameList(userInfoService.getCurGroupNameList()); entrust.setGroupNameList(userInfoService.getCurGroupNameList());
return success(entrustService.pageEntrustSampleReceiveHis(getPage(), entrust)); return success(entrustService.pageEntrustSampleReceiveHis(getPage(), entrust));
} }
...@@ -605,6 +605,8 @@ public class EntrustController extends ServiceController { ...@@ -605,6 +605,8 @@ public class EntrustController extends ServiceController {
@PostMapping("/page_entrust_report_make") @PostMapping("/page_entrust_report_make")
public RestResult<Page<EntrustVO>> getPageReportMake(EntrustVO entrust) { public RestResult<Page<EntrustVO>> getPageReportMake(EntrustVO entrust) {
entrust.setSampleStatus(EntrustSampleStatusEnum.REPORT_MAKE); entrust.setSampleStatus(EntrustSampleStatusEnum.REPORT_MAKE);
entrust.setFlowStatus(EntrustFlowEnum.REPORT_MAKE.getName());
entrust.setGroupNameList(userInfoService.getCurGroupNameList());
return success(entrustService.pageEntrustBySample(getPage(), entrust)); return success(entrustService.pageEntrustBySample(getPage(), entrust));
} }
...@@ -633,6 +635,7 @@ public class EntrustController extends ServiceController { ...@@ -633,6 +635,7 @@ public class EntrustController extends ServiceController {
@PostMapping("/page_entrust_report_check") @PostMapping("/page_entrust_report_check")
public RestResult<Page<EntrustVO>> getPageReportCheck(EntrustVO entrust) { public RestResult<Page<EntrustVO>> getPageReportCheck(EntrustVO entrust) {
entrust.setReportStatus(EntrustReportStatusEnum.CHECK); entrust.setReportStatus(EntrustReportStatusEnum.CHECK);
entrust.setFlowStatus(EntrustFlowEnum.REPORT_CHECK.getName());
return success(entrustService.pageEntrustByReport(getPage(), entrust)); return success(entrustService.pageEntrustByReport(getPage(), entrust));
} }
...@@ -667,6 +670,7 @@ public class EntrustController extends ServiceController { ...@@ -667,6 +670,7 @@ public class EntrustController extends ServiceController {
@PostMapping("/page_entrust_report_approve") @PostMapping("/page_entrust_report_approve")
public RestResult<Page<EntrustVO>> getPageReportApprove(EntrustVO entrust) { public RestResult<Page<EntrustVO>> getPageReportApprove(EntrustVO entrust) {
entrust.setReportStatus(EntrustReportStatusEnum.ALLOW); entrust.setReportStatus(EntrustReportStatusEnum.ALLOW);
entrust.setFlowStatus(EntrustFlowEnum.REPORT_ALLOW.getName());
return success(entrustService.pageEntrustByReport(getPage(), entrust)); return success(entrustService.pageEntrustByReport(getPage(), entrust));
} }
...@@ -732,6 +736,7 @@ public class EntrustController extends ServiceController { ...@@ -732,6 +736,7 @@ public class EntrustController extends ServiceController {
@PostMapping("/page_entrust_report_issue") @PostMapping("/page_entrust_report_issue")
public RestResult<Page<EntrustVO>> getPageReportIssue(EntrustVO entrust) { public RestResult<Page<EntrustVO>> getPageReportIssue(EntrustVO entrust) {
entrust.setReportStatus(EntrustReportStatusEnum.ISSUE); entrust.setReportStatus(EntrustReportStatusEnum.ISSUE);
entrust.setFlowStatus(EntrustFlowEnum.REPORT_ISSUE.getName());
return success(entrustService.pageEntrustByReport(getPage(), entrust)); return success(entrustService.pageEntrustByReport(getPage(), entrust));
} }
......
...@@ -3,6 +3,7 @@ package com.patzn.cloud.service.lims.hmhj.controller; ...@@ -3,6 +3,7 @@ package com.patzn.cloud.service.lims.hmhj.controller;
import com.patzn.cloud.service.hmhj.entity.EntrustSampleBackup; import com.patzn.cloud.service.hmhj.entity.EntrustSampleBackup;
import com.patzn.cloud.service.hmhj.enums.EntrustSampleBackupStatusEnum; import com.patzn.cloud.service.hmhj.enums.EntrustSampleBackupStatusEnum;
import com.patzn.cloud.service.hmhj.vo.EntrustSampleBackupVO; import com.patzn.cloud.service.hmhj.vo.EntrustSampleBackupVO;
import com.patzn.cloud.service.lims.hmhj.service.impl.UserInfoServiceImpl;
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;
...@@ -40,6 +41,9 @@ public class EntrustSampleBackupController extends ServiceController { ...@@ -40,6 +41,9 @@ public class EntrustSampleBackupController extends ServiceController {
@Autowired @Autowired
private IEntrustSampleBackupService entrustSampleBackupService; private IEntrustSampleBackupService entrustSampleBackupService;
@Autowired
private UserInfoServiceImpl userInfoService;
@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),
...@@ -51,6 +55,7 @@ public class EntrustSampleBackupController extends ServiceController { ...@@ -51,6 +55,7 @@ public class EntrustSampleBackupController extends ServiceController {
public RestResult<Page<EntrustSampleBackupVO>> getPage(EntrustSampleBackupVO entrustSampleBackup) { public RestResult<Page<EntrustSampleBackupVO>> getPage(EntrustSampleBackupVO entrustSampleBackup) {
entrustSampleBackup.setStatus(EntrustSampleBackupStatusEnum.BACKUP_ING); entrustSampleBackup.setStatus(EntrustSampleBackupStatusEnum.BACKUP_ING);
entrustSampleBackup.setType("BY"); entrustSampleBackup.setType("BY");
entrustSampleBackup.setGroupNameList(userInfoService.getCurGroupNameList());
return success(entrustSampleBackupService.pageVO(getPage(), entrustSampleBackup)); return success(entrustSampleBackupService.pageVO(getPage(), entrustSampleBackup));
} }
...@@ -66,6 +71,7 @@ public class EntrustSampleBackupController extends ServiceController { ...@@ -66,6 +71,7 @@ public class EntrustSampleBackupController extends ServiceController {
public RestResult<Page<EntrustSampleBackupVO>> getPageBackupHis(EntrustSampleBackupVO entrustSampleBackup) { public RestResult<Page<EntrustSampleBackupVO>> getPageBackupHis(EntrustSampleBackupVO entrustSampleBackup) {
entrustSampleBackup.setNotStatus(EntrustSampleBackupStatusEnum.BACKUP_ING); entrustSampleBackup.setNotStatus(EntrustSampleBackupStatusEnum.BACKUP_ING);
entrustSampleBackup.setType("BY"); entrustSampleBackup.setType("BY");
entrustSampleBackup.setGroupNameList(userInfoService.getCurGroupNameList());
return success(entrustSampleBackupService.pageVO(getPage(), entrustSampleBackup)); return success(entrustSampleBackupService.pageVO(getPage(), entrustSampleBackup));
} }
...@@ -81,6 +87,7 @@ public class EntrustSampleBackupController extends ServiceController { ...@@ -81,6 +87,7 @@ public class EntrustSampleBackupController extends ServiceController {
public RestResult<Page<EntrustSampleBackupVO>> getPageManage(EntrustSampleBackupVO entrustSampleBackup) { public RestResult<Page<EntrustSampleBackupVO>> getPageManage(EntrustSampleBackupVO entrustSampleBackup) {
entrustSampleBackup.setStatus(EntrustSampleBackupStatusEnum.MANAGE_ING); entrustSampleBackup.setStatus(EntrustSampleBackupStatusEnum.MANAGE_ING);
entrustSampleBackup.setType("YP"); entrustSampleBackup.setType("YP");
entrustSampleBackup.setGroupNameList(userInfoService.getCurGroupNameList());
return success(entrustSampleBackupService.pageManage(getPage(), entrustSampleBackup)); return success(entrustSampleBackupService.pageManage(getPage(), entrustSampleBackup));
} }
...@@ -95,6 +102,7 @@ public class EntrustSampleBackupController extends ServiceController { ...@@ -95,6 +102,7 @@ public class EntrustSampleBackupController extends ServiceController {
public RestResult<Page<EntrustSampleBackupVO>> getPageManageHis(EntrustSampleBackupVO entrustSampleBackup) { public RestResult<Page<EntrustSampleBackupVO>> getPageManageHis(EntrustSampleBackupVO entrustSampleBackup) {
entrustSampleBackup.setNotStatus(EntrustSampleBackupStatusEnum.MANAGE_ING); entrustSampleBackup.setNotStatus(EntrustSampleBackupStatusEnum.MANAGE_ING);
entrustSampleBackup.setType("YP"); entrustSampleBackup.setType("YP");
entrustSampleBackup.setGroupNameList(userInfoService.getCurGroupNameList());
return success(entrustSampleBackupService.pageVO(getPage(), entrustSampleBackup)); return success(entrustSampleBackupService.pageVO(getPage(), entrustSampleBackup));
} }
// ========================================= // =========================================
...@@ -111,6 +119,7 @@ public class EntrustSampleBackupController extends ServiceController { ...@@ -111,6 +119,7 @@ public class EntrustSampleBackupController extends ServiceController {
@PostMapping("/page_handle") @PostMapping("/page_handle")
public RestResult<Page<EntrustSampleBackupVO>> getPageHandle(EntrustSampleBackupVO entrustSampleBackup) { public RestResult<Page<EntrustSampleBackupVO>> getPageHandle(EntrustSampleBackupVO entrustSampleBackup) {
entrustSampleBackup.setStatus(EntrustSampleBackupStatusEnum.HANDLE); entrustSampleBackup.setStatus(EntrustSampleBackupStatusEnum.HANDLE);
entrustSampleBackup.setGroupNameList(userInfoService.getCurGroupNameList());
return success(entrustSampleBackupService.pageVO(getPage(), entrustSampleBackup)); return success(entrustSampleBackupService.pageVO(getPage(), entrustSampleBackup));
} }
...@@ -125,6 +134,7 @@ public class EntrustSampleBackupController extends ServiceController { ...@@ -125,6 +134,7 @@ public class EntrustSampleBackupController extends ServiceController {
@PostMapping("/page_handle_his") @PostMapping("/page_handle_his")
public RestResult<Page<EntrustSampleBackupVO>> getPageHandleHis(EntrustSampleBackupVO entrustSampleBackup) { public RestResult<Page<EntrustSampleBackupVO>> getPageHandleHis(EntrustSampleBackupVO entrustSampleBackup) {
entrustSampleBackup.setStatus(EntrustSampleBackupStatusEnum.HANDLE_OK); entrustSampleBackup.setStatus(EntrustSampleBackupStatusEnum.HANDLE_OK);
entrustSampleBackup.setGroupNameList(userInfoService.getCurGroupNameList());
return success(entrustSampleBackupService.pageVO(getPage(), entrustSampleBackup)); return success(entrustSampleBackupService.pageVO(getPage(), entrustSampleBackup));
} }
......
...@@ -94,6 +94,8 @@ public class EntrustSampleController extends ServiceController { ...@@ -94,6 +94,8 @@ public class EntrustSampleController extends ServiceController {
@PostMapping("/page_report_make") @PostMapping("/page_report_make")
public RestResult<Page<EntrustSampleVO>> getPageReportMake(EntrustSampleVO entrustSample) { public RestResult<Page<EntrustSampleVO>> getPageReportMake(EntrustSampleVO entrustSample) {
entrustSample.setStatus(EntrustSampleStatusEnum.REPORT_MAKE); entrustSample.setStatus(EntrustSampleStatusEnum.REPORT_MAKE);
// 只显示试样
entrustSample.setType(0);
return success(entrustSampleService.pageVOForMake(getPage(), entrustSample)); return success(entrustSampleService.pageVOForMake(getPage(), entrustSample));
} }
...@@ -113,6 +115,7 @@ public class EntrustSampleController extends ServiceController { ...@@ -113,6 +115,7 @@ public class EntrustSampleController extends ServiceController {
EntrustSampleStatusEnum.REPORT_SEND, EntrustSampleStatusEnum.REPORT_SEND,
EntrustSampleStatusEnum.END EntrustSampleStatusEnum.END
)); ));
entrustSample.setType(0);
return success(entrustSampleService.pageVOForMakeHis(getPage(), entrustSample)); return success(entrustSampleService.pageVOForMakeHis(getPage(), entrustSample));
} }
......
...@@ -16,6 +16,7 @@ import com.patzn.cloud.service.hmhj.vo.TesterWorkloadStatsVO; ...@@ -16,6 +16,7 @@ import com.patzn.cloud.service.hmhj.vo.TesterWorkloadStatsVO;
import com.patzn.cloud.service.lims.base.entity.LmsUserRelGroup; import com.patzn.cloud.service.lims.base.entity.LmsUserRelGroup;
import com.patzn.cloud.service.lims.base.vo.LmsUserRelGroupVO; import com.patzn.cloud.service.lims.base.vo.LmsUserRelGroupVO;
import com.patzn.cloud.service.lims.hmhj.service.IEntrustSampleItemService; import com.patzn.cloud.service.lims.hmhj.service.IEntrustSampleItemService;
import com.patzn.cloud.service.lims.hmhj.service.impl.UserInfoServiceImpl;
import io.swagger.annotations.Api; import io.swagger.annotations.Api;
import io.swagger.annotations.ApiImplicitParam; import io.swagger.annotations.ApiImplicitParam;
import io.swagger.annotations.ApiImplicitParams; import io.swagger.annotations.ApiImplicitParams;
...@@ -41,6 +42,7 @@ public class EntrustSampleItemController extends ServiceController { ...@@ -41,6 +42,7 @@ public class EntrustSampleItemController extends ServiceController {
@Autowired @Autowired
private IEntrustSampleItemService entrustSampleItemService; private IEntrustSampleItemService entrustSampleItemService;
@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),
......
...@@ -102,4 +102,6 @@ public interface IEntrustService extends IBaseService<Entrust> { ...@@ -102,4 +102,6 @@ public interface IEntrustService extends IBaseService<Entrust> {
boolean isCanIntoNextNode(Entrust entrust); boolean isCanIntoNextNode(Entrust entrust);
boolean isCanIntoPrevNode(Entrust entrust); boolean isCanIntoPrevNode(Entrust entrust);
Page<EntrustVO> pageEntrustSampleMake(Page<EntrustVO> page, EntrustVO entrust);
} }
...@@ -234,11 +234,12 @@ public class EntrustReportServiceImpl extends BaseServiceImpl<EntrustReportMappe ...@@ -234,11 +234,12 @@ public class EntrustReportServiceImpl extends BaseServiceImpl<EntrustReportMappe
if (!entrustSampleService.isRequireJudgeGrading(entrust.getId())) { if (!entrustSampleService.isRequireJudgeGrading(entrust.getId())) {
entrustSampleService.updateJudgeStatus(entrust.getId(), 2); entrustSampleService.updateJudgeStatus(entrust.getId(), 2);
} }
entrustService.updateById(entrust);
// 更改样品编码显示形式,由三级变为一级 // 更改样品编码显示形式,由三级变为一级
entrustSampleService.updateSampleCodeByEntrustId(entrust.getId(), 1); entrustSampleService.updateSampleCodeByEntrustId(entrust.getId(), 1);
} }
// 流程状态
entrust.setFlowStatus(toFlowStatus.getName());
entrustService.updateById(entrust);
entrustRecordService.record(new Long[]{entrust.getId()}, fromFlowStatus.getDisplay(), toFlowStatus.getDisplay(), 0, account, remark); entrustRecordService.record(new Long[]{entrust.getId()}, fromFlowStatus.getDisplay(), toFlowStatus.getDisplay(), 0, account, remark);
} }
} }
...@@ -275,14 +276,14 @@ public class EntrustReportServiceImpl extends BaseServiceImpl<EntrustReportMappe ...@@ -275,14 +276,14 @@ public class EntrustReportServiceImpl extends BaseServiceImpl<EntrustReportMappe
private void judgeStatusPath(Entrust entrust, EntrustFlowEnum nextStatus) { private void judgeStatusPath(Entrust entrust, EntrustFlowEnum nextStatus) {
RestAssert.fail(null == entrust, "委托信息为空"); RestAssert.fail(null == entrust, "委托信息为空");
String statusPath = entrust.getStatusPath(); String statusPath = entrust.getStatusPath(), flowStatus = entrust.getFlowStatus();
// 为空,或者路径中不包含当前流程状态 // 为空,或者路径中不包含当前流程状态
if (StringUtils.isBlank(statusPath) || !entrust.getStatusPath().contains(entrust.getFlowStatus())) { if (!EntrustFlowUtils.isContains(statusPath, flowStatus)) {
return; return;
} }
EntrustFlowEnum nextFlowStatus = EntrustFlowUtils.getNextFlowStatus(entrust.getFlowStatus(), statusPath); EntrustFlowEnum nextFlowStatus = EntrustFlowUtils.getNextFlowStatus(flowStatus, statusPath);
// RestAssert.fail(null == nextFlowStatus,"状态路径配置的下一流程节点为空,无法进行下一步"); // RestAssert.fail(null == nextFlowStatus,"状态路径配置的下一流程节点为空,无法进行下一步");
RestAssert.fail(null != nextFlowStatus && nextFlowStatus != nextStatus, String.format("状态路径配置的下一节点为【%s】,无法进行下一步",nextFlowStatus.getDisplay())); RestAssert.fail(null != nextFlowStatus && nextFlowStatus != nextStatus, String.format("状态路径配置的下一节点为【%s】,无法进行下一步", nextFlowStatus.getDisplay()));
} }
@Transactional(rollbackFor = Exception.class) @Transactional(rollbackFor = Exception.class)
...@@ -461,7 +462,8 @@ public class EntrustReportServiceImpl extends BaseServiceImpl<EntrustReportMappe ...@@ -461,7 +462,8 @@ public class EntrustReportServiceImpl extends BaseServiceImpl<EntrustReportMappe
sampleStatusEnum = EntrustSampleStatusEnum.REPORT_SEND; sampleStatusEnum = EntrustSampleStatusEnum.REPORT_SEND;
} }
if (null != sampleStatusEnum) { entrust.setFlowStatus(sampleStatusEnum.getName());
entrustService.updateById(entrust);
entrustSample.setStatus(sampleStatusEnum); entrustSample.setStatus(sampleStatusEnum);
entrustSample.setProgress(sampleStatusEnum); entrustSample.setProgress(sampleStatusEnum);
entrustSampleService.update(entrustSample, Condition.create().eq("entrust_id", entrust.getId())); entrustSampleService.update(entrustSample, Condition.create().eq("entrust_id", entrust.getId()));
...@@ -470,7 +472,6 @@ public class EntrustReportServiceImpl extends BaseServiceImpl<EntrustReportMappe ...@@ -470,7 +472,6 @@ public class EntrustReportServiceImpl extends BaseServiceImpl<EntrustReportMappe
entrustRecordService.record(new Long[]{entrust.getId()}, entrustReport.getStatus().getDisplay(), sampleStatusEnum.getDisplay(), 2, account, reason); entrustRecordService.record(new Long[]{entrust.getId()}, entrustReport.getStatus().getDisplay(), sampleStatusEnum.getDisplay(), 2, account, reason);
} }
} }
}
@Override @Override
public boolean backReportIssue(Long[] ids, String reason, Account account) { public boolean backReportIssue(Long[] ids, String reason, Account account) {
......
...@@ -86,6 +86,9 @@ public class EntrustServiceImpl extends BaseServiceImpl<EntrustMapper, Entrust> ...@@ -86,6 +86,9 @@ public class EntrustServiceImpl extends BaseServiceImpl<EntrustMapper, Entrust>
@Autowired @Autowired
private SysOrgClient sysOrgClient; private SysOrgClient sysOrgClient;
@Autowired
private UserInfoServiceImpl userInfoService;
@Autowired @Autowired
private Executor executor1; private Executor executor1;
...@@ -335,7 +338,7 @@ public class EntrustServiceImpl extends BaseServiceImpl<EntrustMapper, Entrust> ...@@ -335,7 +338,7 @@ public class EntrustServiceImpl extends BaseServiceImpl<EntrustMapper, Entrust>
List<Entrust> entrustList = getBatchIds(Arrays.asList(ids)); List<Entrust> entrustList = getBatchIds(Arrays.asList(ids));
boolean hasSendMessage = false; boolean hasSendMessage = false;
for (Entrust e : entrustList) { for (Entrust e : entrustList) {
if (StringUtils.isNotBlank(e.getStatusPath())) { if (isCanIntoNextNode(e)) {
rejectToPrevNode(e, reason, account); rejectToPrevNode(e, reason, account);
hasSendMessage = true; hasSendMessage = true;
} else { } else {
...@@ -362,7 +365,7 @@ public class EntrustServiceImpl extends BaseServiceImpl<EntrustMapper, Entrust> ...@@ -362,7 +365,7 @@ public class EntrustServiceImpl extends BaseServiceImpl<EntrustMapper, Entrust>
boolean hasSendMessage = false; boolean hasSendMessage = false;
for (Entrust e : entrustList) { for (Entrust e : entrustList) {
// 若存在路径,根据状态路径处理数据 // 若存在路径,根据状态路径处理数据
if (StringUtils.isNotBlank(e.getStatusPath()) && e.getStatusPath().contains(e.getFlowStatus())) { if (isCanIntoNextNode(e)) {
submitToNextNode(e, account); submitToNextNode(e, account);
hasSendMessage = true; hasSendMessage = true;
} else { } else {
...@@ -389,7 +392,7 @@ public class EntrustServiceImpl extends BaseServiceImpl<EntrustMapper, Entrust> ...@@ -389,7 +392,7 @@ public class EntrustServiceImpl extends BaseServiceImpl<EntrustMapper, Entrust>
boolean hasSendMessage = false; boolean hasSendMessage = false;
for (Entrust e : entrustList) { for (Entrust e : entrustList) {
// 若存在路径,根据状态路径处理数据 // 若存在路径,根据状态路径处理数据
if (StringUtils.isNotBlank(e.getStatusPath())) { if (isCanIntoNextNode(e)) {
submitToNextNode(e, account); submitToNextNode(e, account);
hasSendMessage = true; hasSendMessage = true;
} else { } else {
...@@ -567,63 +570,12 @@ public class EntrustServiceImpl extends BaseServiceImpl<EntrustMapper, Entrust> ...@@ -567,63 +570,12 @@ public class EntrustServiceImpl extends BaseServiceImpl<EntrustMapper, Entrust>
@Override @Override
public Page<EntrustVO> pageEntrustSampleReceive(Page<EntrustVO> page, EntrustVO entrust) { public Page<EntrustVO> pageEntrustSampleReceive(Page<EntrustVO> page, EntrustVO entrust) {
List<EntrustSamplePrepare> prepareList = entrustSamplePrepareService.list(Condition.create().setSqlSelect("entrust_sample_id")
.eq("status", EntrustSamplePrepareStatusEnum.RECEIVE).isNotNull("entrust_sample_id"));
if (CollectionUtils.isEmpty(prepareList)) {
return page;
}
List<Long> sampleIds = prepareList.stream().map(p -> {
return p.getEntrustSampleId();
}).collect(Collectors.toList());
if (CollectionUtils.isEmpty(sampleIds)) {
return page;
}
List<EntrustSample> entrustSamples = entrustSampleService.getBatchIds(sampleIds);
if (CollectionUtils.isEmpty(entrustSamples)) {
return page;
}
List<Long> ids = entrustSamples.stream().map(e -> {
return e.getEntrustId();
}).collect(Collectors.toList());
if (CollectionUtils.isEmpty(ids)) {
return page;
}
entrust.setIdsList(ids);
return page.setRecords(baseMapper.selectEntrustSampleReceive(page, entrust)); return page.setRecords(baseMapper.selectEntrustSampleReceive(page, entrust));
} }
@Override @Override
public Page<EntrustVO> pageEntrustSampleReceiveHis(Page<EntrustVO> page, EntrustVO entrust) { public Page<EntrustVO> pageEntrustSampleReceiveHis(Page<EntrustVO> page, EntrustVO entrust) {
List<EntrustSamplePrepare> prepareList = entrustSamplePrepareService.list(Condition.create().setSqlSelect("entrust_sample_id").ne("status", EntrustSamplePrepareStatusEnum.RECEIVE));
if (CollectionUtils.isEmpty(prepareList)) {
return page;
}
List<Long> sampleIds = prepareList.stream().map(p -> {
return p.getEntrustSampleId();
}).collect(Collectors.toList());
if (CollectionUtils.isEmpty(sampleIds)) {
return page;
}
List<EntrustSample> entrustSamples = entrustSampleService.getBatchIds(sampleIds);
if (CollectionUtils.isEmpty(entrustSamples)) {
return page;
}
List<Long> ids = entrustSamples.stream().map(e -> {
return e.getEntrustId();
}).collect(Collectors.toList());
if (CollectionUtils.isEmpty(ids)) {
return page;
}
entrust.setIdsList(ids);
return page.setRecords(baseMapper.selectEntrustSampleReceive(page, entrust)); return page.setRecords(baseMapper.selectEntrustSampleReceive(page, entrust));
} }
...@@ -664,64 +616,32 @@ public class EntrustServiceImpl extends BaseServiceImpl<EntrustMapper, Entrust> ...@@ -664,64 +616,32 @@ public class EntrustServiceImpl extends BaseServiceImpl<EntrustMapper, Entrust>
@Override @Override
public Page<EntrustVO> pageEntrustBySample(Page<EntrustVO> page, EntrustVO entrust) { public Page<EntrustVO> pageEntrustBySample(Page<EntrustVO> page, EntrustVO entrust) {
RestAssert.fail(null == entrust.getSampleStatus(), "样品状态不能为空");
List<EntrustSample> sampleList = entrustSampleService.list(Condition.create().eq("status", entrust.getSampleStatus()));
if (CollectionUtils.isEmpty(sampleList)) { if (null == entrust.getSampleStatus()) {
return page;
}
List<Long> ids = sampleList.stream().map(s -> {
return s.getEntrustId();
}).collect(Collectors.toList());
if (CollectionUtils.isEmpty(ids)) {
return page; return page;
} }
entrust.setIdsList(ids);
return page.setRecords(baseMapper.selectVOList(page, entrust)); return page.setRecords(baseMapper.selectVOList(page, entrust));
} }
@Override @Override
public Page<EntrustVO> pageEntrustByNotSample(Page<EntrustVO> page, EntrustVO entrust) { public Page<EntrustVO> pageEntrustByNotSample(Page<EntrustVO> page, EntrustVO entrust) {
RestAssert.fail(null == entrust.getNotSampleStatus(), "样品状态不能为空"); if (null == entrust.getNotSampleStatus()) {
List<EntrustSample> sampleList = entrustSampleService.list(Condition.create().ne("status", entrust.getNotSampleStatus()));
if (CollectionUtils.isEmpty(sampleList)) {
return page; return page;
} }
List<Long> ids = sampleList.stream().map(s -> {
return s.getEntrustId();
}).collect(Collectors.toList());
if (CollectionUtils.isEmpty(ids)) {
return page;
}
entrust.setIdsList(ids);
return page.setRecords(baseMapper.selectVOList(page, entrust)); return page.setRecords(baseMapper.selectVOList(page, entrust));
} }
@Override @Override
public Page<EntrustVO> pageEntrustByReport(Page<EntrustVO> page, EntrustVO entrust) { public Page<EntrustVO> pageEntrustByReport(Page<EntrustVO> page, EntrustVO entrust) {
RestAssert.fail(null == entrust.getReportStatus(), "报告状态不能为空"); if (null == entrust.getReportStatus()) {
List<EntrustReport> reportList = entrustReportService.list(Condition.create().eq("status", entrust.getReportStatus()));
if (CollectionUtils.isEmpty(reportList)) {
return page;
}
List<Long> ids = reportList.stream().map(s -> {
return s.getEntrustId();
}).collect(Collectors.toList());
if (CollectionUtils.isEmpty(ids)) {
return page; return page;
} }
// 此方法过滤检测单位
entrust.setIdsList(ids); entrust.setGroupNameList(userInfoService.getCurGroupNameList());
return page.setRecords(baseMapper.selectVOList(page, entrust)); return page.setRecords(baseMapper.selectVOList(page, entrust));
} }
@Override @Override
public Page<EntrustVO> pageEntrustByReportNotHis(Page<EntrustVO> page, EntrustVO entrust) { public Page<EntrustVO> pageEntrustByReportNotHis(Page<EntrustVO> page, EntrustVO entrust) {
RestAssert.fail(null == entrust.getReportNotStatus(), "报告状态不能为空"); RestAssert.fail(null == entrust.getReportNotStatus(), "报告状态不能为空");
...@@ -744,20 +664,12 @@ public class EntrustServiceImpl extends BaseServiceImpl<EntrustMapper, Entrust> ...@@ -744,20 +664,12 @@ public class EntrustServiceImpl extends BaseServiceImpl<EntrustMapper, Entrust>
@Override @Override
public Page<EntrustVO> pageEntrustByReportHis(Page<EntrustVO> page, EntrustVO entrust) { public Page<EntrustVO> pageEntrustByReportHis(Page<EntrustVO> page, EntrustVO entrust) {
RestAssert.fail(CollectionUtils.isEmpty(entrust.getReportStatusList()), "报告状态不能为空"); //
List<EntrustReport> reportList = entrustReportService.list(Condition.create().in("status", entrust.getReportStatusList())); if (CollectionUtils.isEmpty(entrust.getReportStatusList())) {
if (CollectionUtils.isEmpty(reportList)) {
return page;
}
List<Long> ids = reportList.stream().map(s -> {
return s.getEntrustId();
}).collect(Collectors.toList());
if (CollectionUtils.isEmpty(ids)) {
return page; return page;
} }
// 历史同样过滤检测单位
entrust.setIdsList(ids); entrust.setGroupNameList(userInfoService.getCurGroupNameList());
return page.setRecords(baseMapper.selectVOList(page, entrust)); return page.setRecords(baseMapper.selectVOList(page, entrust));
} }
...@@ -1372,14 +1284,27 @@ public class EntrustServiceImpl extends BaseServiceImpl<EntrustMapper, Entrust> ...@@ -1372,14 +1284,27 @@ public class EntrustServiceImpl extends BaseServiceImpl<EntrustMapper, Entrust>
public boolean isCanIntoNextNode(Entrust entrust) { public boolean isCanIntoNextNode(Entrust entrust) {
// 路径不为空且当前流程状态不为空且存在下一步流程节点 // 路径不为空且当前流程状态不为空且存在下一步流程节点
String statusPath = entrust.getStatusPath(), flowStatus = entrust.getFlowStatus(); String statusPath = entrust.getStatusPath(), flowStatus = entrust.getFlowStatus();
return org.apache.commons.lang3.StringUtils.isNotBlank(statusPath) && statusPath.contains(flowStatus) && null != EntrustFlowUtils.getNextFlowStatus(flowStatus, statusPath); if (StringUtils.isNotBlank(statusPath)) {
List<String> flowList = Arrays.asList(statusPath.split("->"));
return flowList.stream().anyMatch(t -> t.equals(flowStatus)) && null != EntrustFlowUtils.getNextFlowStatus(flowStatus, statusPath);
}
return false;
} }
@Override @Override
public boolean isCanIntoPrevNode(Entrust entrust) { public boolean isCanIntoPrevNode(Entrust entrust) {
// 路径不为空且当前流程状态不为空且存在上一步流程节点 // 路径不为空且当前流程状态不为空且存在上一步流程节点
String statusPath = entrust.getStatusPath(), flowStatus = entrust.getFlowStatus(); String statusPath = entrust.getStatusPath(), flowStatus = entrust.getFlowStatus();
return org.apache.commons.lang3.StringUtils.isNotBlank(statusPath) && statusPath.contains(flowStatus) && null != EntrustFlowUtils.getPrevFlowStatus(flowStatus, statusPath); if (StringUtils.isNotBlank(statusPath)) {
List<String> flowList = Arrays.asList(statusPath.split("->"));
return flowList.stream().anyMatch(t -> t.equals(flowStatus)) && null != EntrustFlowUtils.getPrevFlowStatus(flowStatus, statusPath);
}
return false;
}
@Override
public Page<EntrustVO> pageEntrustSampleMake(Page<EntrustVO> page, EntrustVO entrust) {
return page.setRecords(baseMapper.selectVOList(page, entrust));
} }
} }
...@@ -45,6 +45,12 @@ ...@@ -45,6 +45,12 @@
<if test="null!=vo.entrustCode"> <if test="null!=vo.entrustCode">
AND e.code LIKE CONCAT('%',#{vo.entrustCode},'%') AND e.code LIKE CONCAT('%',#{vo.entrustCode},'%')
</if> </if>
<if test="null != vo.groupNameList">
AND e.test_side IN
<foreach collection="vo.groupNameList" index="index" item="groupName" open="(" separator="," close=")">
#{groupName}
</foreach>
</if>
</where> </where>
order by date_part('day', CAST(b.storage_period AS TIMESTAMP) - CAST( now() AS TIMESTAMP)) asc,b.ctime desc order by date_part('day', CAST(b.storage_period AS TIMESTAMP) - CAST( now() AS TIMESTAMP)) asc,b.ctime desc
</select> </select>
...@@ -63,7 +69,7 @@ ...@@ -63,7 +69,7 @@
s.code AS "sampleCode" , s.code AS "sampleCode" ,
e.client , e.client ,
e.code AS "entrustCode", e.code AS "entrustCode",
(case when e.sample_handle_advise = '检测完毕退还' and s.status &gt;20 then 1 else 0 end) "weights" (case when e.sample_handle_advise = '检测完毕退还' and s.status &gt; 20 then 1 else 0 end) "weights"
FROM FROM
entrust_sample_backup b entrust_sample_backup b
JOIN entrust_sample s ON b.sample_id = s.ID JOIN entrust_sample s ON b.sample_id = s.ID
...@@ -92,6 +98,12 @@ ...@@ -92,6 +98,12 @@
<if test="null!=vo.entrustCode"> <if test="null!=vo.entrustCode">
AND e.code LIKE CONCAT('%',#{vo.entrustCode},'%') AND e.code LIKE CONCAT('%',#{vo.entrustCode},'%')
</if> </if>
<if test="null != vo.groupNameList">
AND e.test_side IN
<foreach collection="vo.groupNameList" index="index" item="groupName" open="(" separator="," close=")">
#{groupName}
</foreach>
</if>
</where> </where>
order by (case when e.sample_handle_advise = '检测完毕退还' and s.status &gt;20 then 1 else 0 end) desc, b.ctime desc order by (case when e.sample_handle_advise = '检测完毕退还' and s.status &gt;20 then 1 else 0 end) desc, b.ctime desc
</select> </select>
......
...@@ -241,6 +241,12 @@ ...@@ -241,6 +241,12 @@
#{id} #{id}
</foreach> </foreach>
</if> </if>
<if test="null != vo.groupNameList">
AND e.test_side IN
<foreach collection="vo.groupNameList" index="index" item="groupName" open="(" separator="," close=")">
#{groupName}
</foreach>
</if>
ORDER BY s.code , i.name ORDER BY s.code , i.name
</select> </select>
...@@ -340,6 +346,7 @@ ...@@ -340,6 +346,7 @@
<select id="selectByEntrustId" resultType="com.patzn.cloud.service.hmhj.vo.EntrustSampleItemVO"> <select id="selectByEntrustId" resultType="com.patzn.cloud.service.hmhj.vo.EntrustSampleItemVO">
SELECT i.id,i.name,i.entrust_sample_id,s.entrust_id,i.agreed_value,i.test_value,i.standard,s.code AS "sampleCode" SELECT i.id,i.name,i.entrust_sample_id,s.entrust_id,i.agreed_value,i.test_value,i.standard,s.code AS "sampleCode"
,s.name AS "sampleName", s.sample_shape ,s.sample_quantity, s.standard, s.sample_from,s.product_code,s.name_code, ,s.name AS "sampleName", s.sample_shape ,s.sample_quantity, s.standard, s.sample_from,s.product_code,s.name_code,
i.tester_id,i.tester,
(case when COALESCE(ii."END_INDEX",0) = 0 then 0 else 1 end) "endIndex" (case when COALESCE(ii."END_INDEX",0) = 0 then 0 else 1 end) "endIndex"
FROM FROM
entrust_sample_item i entrust_sample_item i
...@@ -453,7 +460,7 @@ ...@@ -453,7 +460,7 @@
join entrust_sample_item_index ii on ii.entrust_sample_item_id = i.id join entrust_sample_item_index ii on ii.entrust_sample_item_id = i.id
join entrust_sample s on s.id = i.entrust_sample_id join entrust_sample s on s.id = i.entrust_sample_id
join gspi g on g.grading_standard_id = s.product_standard_id and strpos(i.name,g.name) >= 0 join gspi g on g.grading_standard_id = s.product_standard_id and strpos(i.name,g.name) >= 0
where i.deleted = 0 and ii.deleted = 0 where i.deleted = 0 and ii.deleted = 0 AND s.type = 0
<if test="null != vo.entrustId"> <if test="null != vo.entrustId">
and s.entrust_id = #{vo.entrustId} and s.entrust_id = #{vo.entrustId}
</if> </if>
...@@ -535,7 +542,7 @@ ...@@ -535,7 +542,7 @@
JOIN entrust_sample_item i ON i.ID = ii.entrust_sample_item_id JOIN entrust_sample_item i ON i.ID = ii.entrust_sample_item_id
JOIN entrust_sample s ON s.ID = i.entrust_sample_id JOIN entrust_sample s ON s.ID = i.entrust_sample_id
JOIN entrust e on e.id = s.entrust_id JOIN entrust e on e.id = s.entrust_id
where ii.deleted = 0 and i.deleted = 0 and s.deleted = 0 and e.deleted = 0 where ii.deleted = 0 and i.deleted = 0 and s.deleted = 0 and e.deleted = 0 AND s.type = 0
<if test="null != vo.client"> <if test="null != vo.client">
and e.client LIKE CONCAT('%',#{vo.client},'%') and e.client LIKE CONCAT('%',#{vo.client},'%')
</if> </if>
......
...@@ -45,6 +45,10 @@ ...@@ -45,6 +45,10 @@
AND s.code LIKE CONCAT('%',#{vo.code},'%') AND s.code LIKE CONCAT('%',#{vo.code},'%')
</if> </if>
<if test="null != vo.type">
AND s.type = #{vo.type}
</if>
<if test="null != vo.notStatus"> <if test="null != vo.notStatus">
AND s.status != #{vo.notStatus} AND s.status != #{vo.notStatus}
</if> </if>
...@@ -138,8 +142,7 @@ ...@@ -138,8 +142,7 @@
group by cr.sample_id group by cr.sample_id
) cr on cr.sample_id = s.id ) cr on cr.sample_id = s.id
WHERE WHERE
s.deleted = 0 s.deleted = 0 AND s.type = 0 AND e.deleted = 0
AND e.deleted = 0
<if test="vo.name!=null"> <if test="vo.name!=null">
AND s.name LIKE CONCAT('%',#{vo.name},'%') AND s.name LIKE CONCAT('%',#{vo.name},'%')
</if> </if>
...@@ -203,7 +206,7 @@ ...@@ -203,7 +206,7 @@
JOIN electrolyzer e ON s.electrolyzer_id = e.ID JOIN electrolyzer e ON s.electrolyzer_id = e.ID
LEFT JOIN ix ix ON ix.entrust_sample_id = s.id LEFT JOIN ix ix ON ix.entrust_sample_id = s.id
WHERE WHERE
s.deleted = 0 and e.deleted = 0 and s.name = '原铝' s.deleted = 0 and e.deleted = 0 and s.name = '原铝' AND s.type = 0
<if test="null != vo.timeS and null != vo.timeE"> <if test="null != vo.timeS and null != vo.timeE">
AND EXISTS ( AND EXISTS (
select 1 from entrust_sample_item si where si.deleted = 0 and si.entrust_sample_id = s.id select 1 from entrust_sample_item si where si.deleted = 0 and si.entrust_sample_id = s.id
...@@ -290,7 +293,7 @@ ...@@ -290,7 +293,7 @@
LEFT JOIN ix ix ON ix.entrust_sample_id = s.id LEFT JOIN ix ix ON ix.entrust_sample_id = s.id
WHERE WHERE
s.deleted = 0 and e.deleted = 0 s.deleted = 0 and e.deleted = 0
and s.name = '电解质' and s.name = '电解质' AND s.type = 0
<if test="null != vo.timeS and null != vo.timeE"> <if test="null != vo.timeS and null != vo.timeE">
AND EXISTS ( AND EXISTS (
select 1 from entrust_sample_item si where si.deleted = 0 and si.entrust_sample_id = s.id select 1 from entrust_sample_item si where si.deleted = 0 and si.entrust_sample_id = s.id
...@@ -339,7 +342,7 @@ ...@@ -339,7 +342,7 @@
WHERE WHERE
i.ID = ii.entrust_sample_item_id i.ID = ii.entrust_sample_item_id
AND I.TESTER_ID = u.USER_ID AND I.TESTER_ID = u.USER_ID
-- and ii.name like '%磷生铁-%' and ii.name like '%磷生铁-%'
AND i.deleted = 0 AND i.deleted = 0
AND ii.deleted = 0 AND ii.deleted = 0
AND ii.test_value is not null and is_numeric(ii.test_value) AND ii.test_value is not null and is_numeric(ii.test_value)
...@@ -382,7 +385,7 @@ ...@@ -382,7 +385,7 @@
from entrust_sample s from entrust_sample s
join pi pi on pi.entrust_sample_id = s.id join pi pi on pi.entrust_sample_id = s.id
where s.deleted = 0 where s.deleted = 0 AND s.type = 0
group by pi.period group by pi.period
</select> </select>
......
...@@ -11,11 +11,12 @@ ...@@ -11,11 +11,12 @@
FROM FROM
entrust_sample s, entrust_sample s,
( (
SELECT COUNT (1) "total" FROM entrust_sample s WHERE s.deleted = 0 AND s.sample_grading IS NOT NULL SELECT COUNT (1) "total" FROM entrust_sample s WHERE s.deleted = 0
AND s.type = 0 AND s.sample_grading IS NOT NULL
AND to_char(s.judge_time, 'yyyy-MM-dd') = to_char( now(), 'yyyy-MM-dd') AND to_char(s.judge_time, 'yyyy-MM-dd') = to_char( now(), 'yyyy-MM-dd')
) A ) A
WHERE WHERE
s.deleted = 0 s.deleted = 0 AND s.type = 0
AND s.sample_grading IS NOT NULL AND to_char( s.judge_time, 'yyyy-MM-dd' ) = to_char(now(), 'yyyy-MM-dd') AND s.sample_grading IS NOT NULL AND to_char( s.judge_time, 'yyyy-MM-dd' ) = to_char(now(), 'yyyy-MM-dd')
GROUP BY GROUP BY
A.total, A.total,
...@@ -27,13 +28,13 @@ ...@@ -27,13 +28,13 @@
<!--外委完成量统计--> <!--外委完成量统计-->
<select id="selectOutTestFinishQuantity" resultType="com.patzn.cloud.service.hmhj.entity.Statistics"> <select id="selectOutTestFinishQuantity" resultType="com.patzn.cloud.service.hmhj.entity.Statistics">
SELECT SELECT
count(1) "total", count(distinct c.id) "total",
sum(case when s.status = 70 and s.judge_status = 2 then 1 else 0 end) "done_num" sum(case when s.status = 70 and s.judge_status = 2 then 1 else 0 end) "done_num"
FROM FROM
contract_sample c, entrust_sample s contract_sample c, entrust_sample s
WHERE WHERE
c.deleted = 0 and s.deleted = 0 and c.id = s.contract_sample_id c.deleted = 0 and s.deleted = 0 and c.id = s.contract_sample_id
and c.type = 1 and c.type = 1 AND s.type = 0
</select> </select>
<!--本周自产炭块质量统计--> <!--本周自产炭块质量统计-->
...@@ -50,14 +51,14 @@ ...@@ -50,14 +51,14 @@
FROM FROM
entrust_sample s entrust_sample s
WHERE WHERE
s.deleted = 0 s.deleted = 0 AND s.type = 0
AND s.sample_grading IS NOT NULL AND s.sample_grading IS NOT NULL
AND s.NAME = '自产阳极炭块' AND s.NAME = '自产阳极炭块'
AND EXTRACT ( YEAR FROM s.judge_time ) = EXTRACT ( YEAR FROM NOW() ) AND EXTRACT ( YEAR FROM s.judge_time ) = EXTRACT ( YEAR FROM NOW() )
AND EXTRACT ( WEEK FROM s.judge_time ) = EXTRACT ( WEEK FROM NOW() ) AND EXTRACT ( WEEK FROM s.judge_time ) = EXTRACT ( WEEK FROM NOW() )
) A ) A
WHERE WHERE
s.deleted = 0 s.deleted = 0 AND s.type = 0
AND s.sample_grading IS NOT NULL AND s.sample_grading IS NOT NULL
AND s.NAME = '自产阳极炭块' AND s.NAME = '自产阳极炭块'
AND EXTRACT ( YEAR FROM s.judge_time ) = EXTRACT ( YEAR FROM NOW() ) AND EXTRACT ( YEAR FROM s.judge_time ) = EXTRACT ( YEAR FROM NOW() )
...@@ -78,7 +79,7 @@ ...@@ -78,7 +79,7 @@
FROM FROM
entrust_sample s entrust_sample s
WHERE WHERE
s.deleted = 0 s.deleted = 0 AND s.type = 0
AND s.sample_grading IS NOT NULL AND s.sample_grading IS NOT NULL
AND s.status = 70 AND s.judge_status = 2 AND s.status = 70 AND s.judge_status = 2
AND EXTRACT ( YEAR FROM s.judge_time ) = EXTRACT ( YEAR FROM NOW() ) AND EXTRACT ( YEAR FROM s.judge_time ) = EXTRACT ( YEAR FROM NOW() )
...@@ -107,7 +108,7 @@ ...@@ -107,7 +108,7 @@
join entrust_report r on r.entrust_id = e.id join entrust_report r on r.entrust_id = e.id
WHERE WHERE
s.deleted = 0 and e.deleted = 0 and r.deleted = 0 s.deleted = 0 and e.deleted = 0 and r.deleted = 0
AND s.status = 70 AND s.judge_status = 2 AND s.status = 70 AND s.judge_status = 2 AND s.type = 0
AND s.judge_time between #{vo.timeS} and #{vo.timeE} AND s.judge_time between #{vo.timeS} and #{vo.timeE}
) a , (SELECT ) a , (SELECT
count(r.id) "total" count(r.id) "total"
...@@ -117,7 +118,7 @@ ...@@ -117,7 +118,7 @@
join entrust_report r on r.entrust_id = e.id join entrust_report r on r.entrust_id = e.id
WHERE WHERE
s.deleted = 0 and e.deleted = 0 and r.deleted = 0 s.deleted = 0 and e.deleted = 0 and r.deleted = 0
AND s.status = 70 AND s.judge_status = 2 AND s.status = 70 AND s.judge_status = 2 AND s.type = 0
AND s.judge_time between #{vo.lastYearTimeS} and #{vo.lastYearTimeE} AND s.judge_time between #{vo.lastYearTimeS} and #{vo.lastYearTimeE}
) b, ) b,
(SELECT (SELECT
...@@ -128,7 +129,7 @@ ...@@ -128,7 +129,7 @@
join entrust_report r on r.entrust_id = e.id join entrust_report r on r.entrust_id = e.id
WHERE WHERE
s.deleted = 0 and e.deleted = 0 and r.deleted = 0 s.deleted = 0 and e.deleted = 0 and r.deleted = 0
AND s.status = 70 AND s.judge_status = 2 AND s.status = 70 AND s.judge_status = 2 AND s.type = 0
AND s.judge_time between #{vo.prevTimeS} and #{vo.prevTimeE} AND s.judge_time between #{vo.prevTimeS} and #{vo.prevTimeE}
) c ) c
...@@ -144,7 +145,8 @@ ...@@ -144,7 +145,8 @@
join entrust_sample s on s.id = i.entrust_sample_id join entrust_sample s on s.id = i.entrust_sample_id
join contract_sample c on c.id = s.contract_sample_id join contract_sample c on c.id = s.contract_sample_id
WHERE WHERE
i.deleted = 0 and s.deleted = 0 and c.deleted = 0 and c.type = 1 i.deleted = 0 and s.deleted = 0 and c.deleted = 0
and c.type = 1 AND s.type = 0
<if test="null != vo.timeS and null != vo.timeE"> <if test="null != vo.timeS and null != vo.timeE">
AND i.ctime between #{vo.timeS} and #{vo.timeE} AND i.ctime between #{vo.timeS} and #{vo.timeE}
</if> </if>
...@@ -166,7 +168,7 @@ ...@@ -166,7 +168,7 @@
entrust_sample s entrust_sample s
join entrust e on e.id = s.entrust_id join entrust e on e.id = s.entrust_id
WHERE WHERE
s.deleted = 0 and e.deleted = 0 s.deleted = 0 and e.deleted = 0 AND s.type = 0
AND e.entrust_time between #{vo.timeS} and #{vo.timeE} AND e.entrust_time between #{vo.timeS} and #{vo.timeE}
) a , ) a ,
(SELECT (SELECT
...@@ -174,7 +176,7 @@ ...@@ -174,7 +176,7 @@
FROM FROM
entrust_sample s entrust_sample s
join entrust e on e.id = s.entrust_id join entrust e on e.id = s.entrust_id
WHERE s.deleted = 0 and e.deleted = 0 WHERE s.deleted = 0 and e.deleted = 0 AND s.type = 0
AND s.entrust_time between #{vo.lastYearTimeS} and #{vo.lastYearTimeE} AND s.entrust_time between #{vo.lastYearTimeS} and #{vo.lastYearTimeE}
) b, ) b,
(SELECT (SELECT
...@@ -183,7 +185,7 @@ ...@@ -183,7 +185,7 @@
entrust_sample s entrust_sample s
join entrust e on e.id = s.entrust_id join entrust e on e.id = s.entrust_id
WHERE WHERE
s.deleted = 0 and e.deleted = 0 s.deleted = 0 and e.deleted = 0 AND s.type = 0
AND s.entrust_time between #{vo.prevTimeS} and #{vo.prevTimeE} AND s.entrust_time between #{vo.prevTimeS} and #{vo.prevTimeE}
) c ) c
</select> </select>
...@@ -197,7 +199,7 @@ ...@@ -197,7 +199,7 @@
entrust_sample_item i entrust_sample_item i
join entrust_sample s on s.id = i.entrust_sample_id join entrust_sample s on s.id = i.entrust_sample_id
WHERE WHERE
i.deleted = 0 and s.deleted = 0 i.deleted = 0 and s.deleted = 0 AND s.type = 0
<if test="null != vo.timeS and null != vo.timeE"> <if test="null != vo.timeS and null != vo.timeE">
AND i.ctime between #{vo.timeS} and #{vo.timeE} AND i.ctime between #{vo.timeS} and #{vo.timeE}
</if> </if>
...@@ -216,7 +218,7 @@ ...@@ -216,7 +218,7 @@
entrust e entrust e
join entrust_report r on r.entrust_id = e.id join entrust_report r on r.entrust_id = e.id
WHERE WHERE
e.deleted = 0 and r.deleted = 0 and r.status = 50 e.deleted = 0 and r.deleted = 0 AND s.type = 0 and r.status = 50
<if test="null != vo.timeS and null != vo.timeE"> <if test="null != vo.timeS and null != vo.timeE">
AND r.report_check_time between #{vo.timeS} and #{vo.timeE} AND r.report_check_time between #{vo.timeS} and #{vo.timeE}
</if> </if>
...@@ -270,8 +272,7 @@ ...@@ -270,8 +272,7 @@
ENTRUST E ENTRUST E
JOIN ENTRUST_SAMPLE S ON S.entrust_id = E.ID JOIN ENTRUST_SAMPLE S ON S.entrust_id = E.ID
WHERE WHERE
E.deleted = 0 E.deleted = 0 AND S.deleted = 0 AND s.type = 0
AND S.deleted = 0
AND S.NAME IN ( '电解质', '硅铁', '磷铁', '锰铁', '水', '纯铝', '铝合金', '石灰石' ) AND S.NAME IN ( '电解质', '硅铁', '磷铁', '锰铁', '水', '纯铝', '铝合金', '石灰石' )
GROUP BY GROUP BY
s.NAME ORDER BY S.NAME s.NAME ORDER BY S.NAME
......
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