Compare commits
78 Commits
c6c44828e0
...
lims_dev
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
927731c217 | ||
| 2b60bd7c7b | |||
|
|
9a2b45e29c | ||
| 7c7e7b4761 | |||
|
|
39d720c1df | ||
|
|
d6fc03b199 | ||
|
|
04ac449897 | ||
|
|
eff36758c2 | ||
|
|
cb50244685 | ||
|
|
246e6391b8 | ||
| 4c129dee4e | |||
| 63fc44a7d1 | |||
| 9a4e50b081 | |||
|
|
7f1c4dd8c4 | ||
| 7a03bc6293 | |||
| 171de4c8d4 | |||
|
|
60bc01201b | ||
|
|
8fdeb65895 | ||
|
|
41b4e53db1 | ||
| 600e8bcd92 | |||
| 353a6dcb3e | |||
| ab505189f3 | |||
| 3b306b4137 | |||
| 9b99e41676 | |||
|
|
1dbbeba233 | ||
|
|
b92d61648f | ||
| b85eb7ea91 | |||
| 76069855ec | |||
| ea948a70bc | |||
| e133ec82c8 | |||
| be75cb4cf9 | |||
| b320d36181 | |||
|
|
172f04a260 | ||
| 821ce6a7cf | |||
|
|
c7fe2db73c | ||
| 984ae17431 | |||
| 4fd689c530 | |||
|
|
2c377a76ec | ||
|
|
2f71bc7fb1 | ||
| 30ce46ce4d | |||
|
|
d25658f202 | ||
|
|
8aa329d989 | ||
|
|
a3a31d8600 | ||
| daafd3ae37 | |||
| 91df898e09 | |||
|
|
baa7884fd7 | ||
|
|
c522cf5f8f | ||
|
|
46aa2c9692 | ||
|
|
411983986f | ||
|
|
94757f31de | ||
|
|
42afe2adb3 | ||
|
|
5657f8cf09 | ||
| a49bee0abd | |||
| d0673f36b1 | |||
|
|
eaea741480 | ||
|
|
44a6e11803 | ||
| cc79a15a16 | |||
| 1e82c22284 | |||
| c2d067e47c | |||
| 92ec9454ba | |||
|
|
57041e4adc | ||
|
|
a8580e1e30 | ||
|
|
82934c153d | ||
| 87fbd54692 | |||
| 918f8465a9 | |||
| 5ef620fa9a | |||
| 2b45f932dc | |||
| 6ca60e94cd | |||
| 8b3bfe2083 | |||
|
|
9037a27cb8 | ||
|
|
a26327d4e7 | ||
|
|
3028d478fe | ||
|
|
d814fae16d | ||
|
|
e6113058c0 | ||
|
|
49b6f956ff | ||
|
|
d80d5da026 | ||
|
|
c3f891095f | ||
|
|
ac2295cac9 |
@@ -11,7 +11,7 @@ metadata:
|
||||
description: DESC_PLACEHOLDER
|
||||
rollout.kubernetes.io/change-cause: "DESC_PLACEHOLDER:VERSION_PLACEHOLDER"
|
||||
spec:
|
||||
replicas: 1
|
||||
replicas: 2
|
||||
selector:
|
||||
matchLabels:
|
||||
app: qms-server
|
||||
@@ -74,3 +74,13 @@ spec:
|
||||
port: 9999
|
||||
targetPort: 9999
|
||||
nodePort: 30194
|
||||
- name: websocket-8320
|
||||
protocol: TCP
|
||||
port: 8320
|
||||
targetPort: 8320
|
||||
nodePort: 30320
|
||||
- name: tcp-8330
|
||||
protocol: TCP
|
||||
port: 8330
|
||||
targetPort: 8330
|
||||
nodePort: 30330
|
||||
|
||||
14
pom.xml
14
pom.xml
@@ -17,7 +17,7 @@
|
||||
<url>https://github.com/YunaiV/ruoyi-vue-pro</url>
|
||||
|
||||
<properties>
|
||||
<revision>3.0.43</revision>
|
||||
<revision>3.0.45</revision>
|
||||
<!-- Maven 相关 -->
|
||||
<java.version>17</java.version>
|
||||
<maven.compiler.source>${java.version}</maven.compiler.source>
|
||||
@@ -177,8 +177,8 @@
|
||||
<config.server-addr>172.16.46.63:30848</config.server-addr>
|
||||
<config.namespace>dev</config.namespace>
|
||||
<config.group>DEFAULT_GROUP</config.group>
|
||||
<config.username/>
|
||||
<config.password/>
|
||||
<config.username>nacos</config.username>
|
||||
<config.password>P@ssword25</config.password>
|
||||
<config.version>1.0.0</config.version>
|
||||
</properties>
|
||||
</profile>
|
||||
@@ -190,8 +190,8 @@
|
||||
<config.server-addr>172.16.46.63:30848</config.server-addr>
|
||||
<config.namespace>prod</config.namespace>
|
||||
<config.group>DEFAULT_GROUP</config.group>
|
||||
<config.username/>
|
||||
<config.password/>
|
||||
<config.username>nacos</config.username>
|
||||
<config.password>P@ssword25</config.password>
|
||||
<config.version>1.0.0</config.version>
|
||||
</properties>
|
||||
</profile>
|
||||
@@ -203,8 +203,8 @@
|
||||
<config.server-addr>172.16.46.63:30848</config.server-addr>
|
||||
<config.namespace>local</config.namespace>
|
||||
<config.group>DEFAULT_GROUP</config.group>
|
||||
<config.username/>
|
||||
<config.password/>
|
||||
<config.username>nacos</config.username>
|
||||
<config.password>P@ssword25</config.password>
|
||||
<config.version>1.0.0</config.version>
|
||||
</properties>
|
||||
</profile>
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
ARG BASE_IMAGE=172.16.46.66:10043/base-service/skywalking-agent-jre:9.7.0
|
||||
FROM ${BASE_IMAGE}
|
||||
FROM 172.16.46.66:10043/base-service/report-base:x86_64-ubuntu_22-jre21-2.0.0
|
||||
#ARG BASE_IMAGE=172.16.46.66:10043/base-service/skywalking-agent-jre:9.7.0
|
||||
#FROM ${BASE_IMAGE}
|
||||
RUN mkdir -p /appdata/server
|
||||
WORKDIR /appdata/server
|
||||
## 将后端项目的 Jar 文件,复制到镜像中
|
||||
@@ -8,10 +9,10 @@ COPY ./target/qms-server.jar app.jar
|
||||
## 设置 TZ 时区
|
||||
ENV TZ=Asia/Shanghai
|
||||
ENV JAVA_OPTS="-Xms512m -Xmx512m"
|
||||
ENV SW_AGENT_HOME=/opt/skywalking/agent
|
||||
ENV SW_AGENT_NAME=qms-server
|
||||
ENV SW_AGENT_COLLECTOR_BACKEND_SERVICES=172.16.46.63:30201
|
||||
ENV AGENT_JAVA_OPTS="-javaagent:${SW_AGENT_HOME}/skywalking-agent.jar -Dskywalking.agent.service_name=${SW_AGENT_NAME} -Dskywalking.collector.backend_service=${SW_AGENT_COLLECTOR_BACKEND_SERVICES}"
|
||||
#ENV SW_AGENT_HOME=/opt/skywalking/agent
|
||||
#ENV SW_AGENT_NAME=qms-server
|
||||
#ENV SW_AGENT_COLLECTOR_BACKEND_SERVICES=172.16.46.63:30201
|
||||
#ENV AGENT_JAVA_OPTS="-javaagent:${SW_AGENT_HOME}/skywalking-agent.jar -Dskywalking.agent.service_name=${SW_AGENT_NAME} -Dskywalking.collector.backend_service=${SW_AGENT_COLLECTOR_BACKEND_SERVICES}"
|
||||
|
||||
# 暴露端口
|
||||
EXPOSE 48205
|
||||
|
||||
11
qms-server/build-docker-push.bat
Normal file
11
qms-server/build-docker-push.bat
Normal file
@@ -0,0 +1,11 @@
|
||||
call docker build -t zgty-qms:v6.0.0 .
|
||||
|
||||
call docker tag zgty-qms:v6.0.0 192.168.26.103:8075/zgty/zgty-qms:v6.0.0
|
||||
|
||||
call docker push 192.168.26.103:8075/zgty/zgty-qms:v6.0.0
|
||||
|
||||
call docker rmi 192.168.26.103:8075/zgty/zgty-qms:v6.0.0
|
||||
|
||||
call docker rmi zgty-qms:v6.0.0
|
||||
|
||||
pause
|
||||
@@ -105,3 +105,87 @@ justauth:
|
||||
prefix: 'social_auth_state:' # 缓存前缀,目前只对 Redis 缓存生效,默认 JUSTAUTH::STATE::
|
||||
timeout: 24h # 超时时长,目前只对 Redis 缓存生效,默认 3 分钟
|
||||
|
||||
|
||||
--- #################### liteflow相关配置 ####################
|
||||
liteflow:
|
||||
#规则文件路径
|
||||
rule-source: el_xml:com.zt.plat.module.qms.core.liteflow.parser.QmsXmlFlowELParser
|
||||
#-----------------以下非必须-----------------
|
||||
#liteflow是否开启,默认为true
|
||||
enable: true
|
||||
#liteflow的banner打印是否开启,默认为true
|
||||
print-banner: true
|
||||
#上下文的初始数量槽,默认值为1024,这个值不用刻意配置,这个值会自动扩容
|
||||
slot-size: 1024
|
||||
#FlowExecutor的execute2Future的线程数,默认为64
|
||||
main-executor-works: 64
|
||||
#FlowExecutor的execute2Future的自定义线程池Builder,LiteFlow提供了默认的Builder
|
||||
main-executor-class: com.yomahub.liteflow.thread.LiteFlowDefaultMainExecutorBuilder
|
||||
#自定义请求ID的生成类,LiteFlow提供了默认的生成类
|
||||
request-id-generator-class: com.yomahub.liteflow.flow.id.DefaultRequestIdGenerator
|
||||
#全局异步节点线程池大小,默认为64
|
||||
global-thread-pool-size: 64
|
||||
#全局异步节点线程池队列大小,默认为512
|
||||
global-thread-pool-queue-size: 512
|
||||
#全局异步节点线程池自定义Builder,LiteFlow提供了默认的线程池Builder
|
||||
global-thread-pool-executor-class: com.yomahub.liteflow.thread.LiteFlowDefaultGlobalExecutorBuilder
|
||||
#异步线程最长的等待时间(只用于when),默认值为15000
|
||||
when-max-wait-time: 15000
|
||||
#异步线程最长的等待时间(只用于when),默认值为MILLISECONDS,毫秒
|
||||
when-max-wait-time-unit: MILLISECONDS
|
||||
#每个WHEN是否用单独的线程池
|
||||
when-thread-pool-isolate: false
|
||||
#设置解析模式,一共有三种模式,PARSE_ALL_ON_START | PARSE_ALL_ON_FIRST_EXEC | PARSE_ONE_ON_FIRST_EXEC
|
||||
parse-mode: PARSE_ONE_ON_FIRST_EXEC
|
||||
#全局重试次数,默认为0
|
||||
retry-count: 0
|
||||
#是否支持不同类型的加载方式混用,默认为false
|
||||
support-multiple-type: false
|
||||
#全局默认节点执行器
|
||||
node-executor-class: com.yomahub.liteflow.flow.executor.DefaultNodeExecutor
|
||||
#是否打印执行中过程中的日志,默认为true
|
||||
print-execution-log: true
|
||||
#是否开启本地文件监听,默认为false
|
||||
enable-monitor-file: false
|
||||
#是否开启快速解析模式,默认为false
|
||||
fast-load: false
|
||||
#是否开启Node节点实例ID持久化,默认为false
|
||||
enable-node-instance-id: false
|
||||
#是否开启虚拟线程(只在JDK21+环境有效),默认为true
|
||||
enable-virtual-thread: true
|
||||
#简易监控配置选项
|
||||
monitor:
|
||||
#监控是否开启,默认不开启
|
||||
enable-log: false
|
||||
#监控队列存储大小,默认值为200
|
||||
queue-limit: 200
|
||||
#监控一开始延迟多少执行,默认值为300000毫秒,也就是5分钟
|
||||
delay: 300000
|
||||
#监控日志打印每过多少时间执行一次,默认值为300000毫秒,也就是5分钟
|
||||
period: 300000
|
||||
|
||||
zzjc:
|
||||
druid:
|
||||
sql-log: true
|
||||
snowflake:
|
||||
data-center-id: 30
|
||||
tio:
|
||||
server:
|
||||
# port
|
||||
port: 8320
|
||||
# 心跳时间
|
||||
heartbeat-timeout: 20000
|
||||
websocket:
|
||||
# enable websocket default false
|
||||
enable: true
|
||||
# websocket port
|
||||
port: 8330
|
||||
# 集群配置 默认关闭,集群开启需要redis
|
||||
cluster:
|
||||
enabled: true
|
||||
group: true
|
||||
redis:
|
||||
mode: single
|
||||
ip: 172.16.46.63 # 地址
|
||||
port: 30379 # 端口
|
||||
database: 0 # 数据库索引
|
||||
File diff suppressed because it is too large
Load Diff
@@ -87,7 +87,7 @@ public interface ErrorCodeConstants {
|
||||
ErrorCode CONFIG_PERMISSION_NOT_EXISTS = new ErrorCode(1_032_050_000, "权限配置不存在");
|
||||
ErrorCode CONFIG_PERMISSION_DUPLICATE = new ErrorCode(1_032_050_000, "权限配置数据有误");
|
||||
ErrorCode CONFIG_WAREHOUSE_LOCATION_NOT_EXISTS = new ErrorCode(1_032_050_000, "存放位置不存在");
|
||||
ErrorCode CONFIG_WAREHOUSE_LOCATION_CODE_DUPLICATE = new ErrorCode(1_032_050_000, "库位编码重复,请检查库位数据,或联系管理员处理!");
|
||||
ErrorCode CONFIG_WAREHOUSE_LOCATION_CODE_DUPLICATE = new ErrorCode(1_032_050_000, "库位编码重复,请检查!");
|
||||
|
||||
/*=================================bus 检验业务 1_032_100_000 ~ 1_032_149_999==================================*/
|
||||
ErrorCode BUSINESS_SAMPLE_ENTRUST_REGISTRATION_NOT_EXISTS = new ErrorCode(1_032_100_000, "委检登记业务不存在");
|
||||
@@ -102,7 +102,8 @@ public interface ErrorCodeConstants {
|
||||
ErrorCode BUSINESS_ASSAY_TASK_DATA_NOT_EXISTS = new ErrorCode(1_032_100_000, "子样检测任务业务不存在");
|
||||
ErrorCode BUSINESS_ASSAY_PROJECT_DATA_NOT_EXISTS = new ErrorCode(1_032_100_000, "检测项目数据业务不存在");
|
||||
ErrorCode BUSINESS_ASSAY_PARAMETER_DATA_NOT_EXISTS = new ErrorCode(1_032_100_000, "检测参数数据业务不存在");
|
||||
ErrorCode BUSINESS_SUB_SAMPLE_ASSESSMENT_NOT_EXISTS = new ErrorCode(1_032_100_000, "子样判定数据业务不存在");
|
||||
ErrorCode BUSINESS_SUB_SAMPLE_ASSESSMENT_NOT_EXISTS = new ErrorCode(1_032_100_000, "子样判定业务不存在");
|
||||
ErrorCode BUSINESS_SUB_SAMPLE_ASSESSMENT_PROJECT_NOT_EXISTS = new ErrorCode(1_032_100_000, "子样判定检测项目数据业务不存在");
|
||||
ErrorCode BUSINESS_SAMPLE_HANDOVER_NOT_EXISTS = new ErrorCode(1_032_100_000, "样品交接单业务不存在");
|
||||
ErrorCode BUSINESS_SAMPLE_HANDOVER_DETAIL_NOT_EXISTS = new ErrorCode(1_032_100_000, "样品交接明细不存在");
|
||||
ErrorCode BUSINESS_ASSAY_TASK_NOT_EXISTS = new ErrorCode(1_032_100_000, "检测任务分配业务不存在");
|
||||
@@ -116,6 +117,7 @@ public interface ErrorCodeConstants {
|
||||
ErrorCode BUSINESS_STANDARD_SAMPLE_PROJECT_NOT_EXISTS = new ErrorCode(1_032_100_000, "标准样检测项目业务不存在");
|
||||
|
||||
ErrorCode BUSINESS_SUB_PARENT_SAMPLE_ASSESSMENT_NOT_EXISTS = new ErrorCode(1_032_100_000, "班组判定数据业务不存在");
|
||||
ErrorCode BUSINESS_SUB_PARENT_SAMPLE_ASSESSMENT_PROJECT_NOT_EXISTS = new ErrorCode(1_032_100_000, "班组判定检测项目数据业务不存在");
|
||||
|
||||
ErrorCode BUSINESS_SUB_SAMPLE_PARENT_RECHECK_NOT_EXISTS = new ErrorCode(1_032_100_000, "分样复检业务数据不存在");
|
||||
|
||||
@@ -147,6 +149,9 @@ public interface ErrorCodeConstants {
|
||||
ErrorCode MATERIAL_INFOMATION_NOT_EXISTS = new ErrorCode(1_032_150_000, "试剂耗材不存在");
|
||||
ErrorCode MATERIAL_PRODUCT_NOT_EXISTS = new ErrorCode(1_032_150_000, "试剂耗材大类不存在");
|
||||
|
||||
ErrorCode MATERIAL_LIFECYCLE_DETAIL_NOT_EXISTS = new ErrorCode(1_032_150_000, "物料通用流程明细不存在");
|
||||
ErrorCode MATERIAL_LIFECYCLE_NOT_EXISTS = new ErrorCode(1_032_150_000, "物料通用流程不存在");
|
||||
|
||||
|
||||
/*================================= tx 1_032_200_000 ~ 1_032_249_999 ==================================*/
|
||||
|
||||
|
||||
@@ -122,6 +122,9 @@ public interface QmsCommonConstant {
|
||||
/** 分析收样 **/
|
||||
String FLOW_NODE_ANALYSIS_RECEIVE = "flw_analysis_receive";
|
||||
|
||||
/** 分析 **/
|
||||
String FLOW_NODE_ANALYSIS = "flw_analysis";
|
||||
|
||||
/** 分析送样 **/
|
||||
String FLOW_NODE_ANALYSIS_SEND = "flw_analysis_send";
|
||||
|
||||
@@ -155,9 +158,40 @@ public interface QmsCommonConstant {
|
||||
/** 品质控制 **/
|
||||
String ASSAY_PROJECT_USAGE_QUALITY_CONTROL = "quality_control";
|
||||
|
||||
/** 结果判定-初始值 **/
|
||||
String ASMT_INITIAL = "initial";
|
||||
|
||||
/** 结果判定-待上报 **/
|
||||
String ASMT_PENDING_REPORT = "pending_report";
|
||||
|
||||
/** 结果判定-待判定 **/
|
||||
String ASMT_PENDING_ASSESSMENT = "pending_assessment";
|
||||
|
||||
/** 结果判定-复测中 **/
|
||||
String ASMT_RE_INSPECTED = "re_inspected";
|
||||
|
||||
/** 结果判定-已上报 */
|
||||
String ASMT_REPORTED = "reported";
|
||||
|
||||
/** 检验完成状态-完成 **/
|
||||
String CHECKED = "checked";
|
||||
|
||||
/** 检验完成状态-未完成 **/
|
||||
String UNCHECKED = "unchecked";
|
||||
|
||||
/** 自动 **/
|
||||
String AUTOMATIC = "automatic";
|
||||
|
||||
/** 手动 **/
|
||||
String MANUAL = "manual";
|
||||
|
||||
|
||||
/** 样品库操作类型: 归库、调拨、下架 **/
|
||||
String SAMPLE_STORAGE_OPERATION_TYPE_STORAGE = "storage";
|
||||
String SAMPLE_STORAGE_OPERATION_TYPE_TRANSFER = "dispatch";
|
||||
String SAMPLE_STORAGE_OPERATION_TYPE_TAKEN_OFF = "take_off";
|
||||
|
||||
|
||||
/** 允许提交 **/
|
||||
String ALLOW_SUBMIT = "allow_submit";
|
||||
}
|
||||
|
||||
@@ -17,7 +17,8 @@ public interface QmsPermissionConstant {
|
||||
String TARGET_TYPE_CUSTOM = "custom";
|
||||
|
||||
//======================各业务模块权限常量=============================
|
||||
//报告发起权限
|
||||
String REPORT_DOCUMENT_TYPE_START = "report_document_type_start";
|
||||
|
||||
String REPORT_DOCUMENT_TYPE_START = "report_document_type_start"; //报告发起权限
|
||||
String SAMPLE_WAREHOUSE_ADMIN = "sample_warehouse_admin"; //样品库管理员
|
||||
|
||||
}
|
||||
|
||||
@@ -1,12 +1,16 @@
|
||||
package com.zt.plat.module.qms.business.bus.controller.admin;
|
||||
|
||||
import com.alibaba.fastjson.JSONObject;
|
||||
import com.zt.plat.module.qms.business.bus.controller.vo.BusinessSampleDispatchPageReqVO;
|
||||
import com.zt.plat.module.qms.business.bus.controller.vo.BusinessSampleDispatchRespVO;
|
||||
import com.zt.plat.module.qms.business.bus.controller.vo.BusinessSampleDispatchSaveReqVO;
|
||||
import com.zt.plat.module.qms.business.bus.controller.vo.*;
|
||||
import com.zt.plat.module.qms.business.bus.dal.dataobject.BusinessSampleDispatchDetailDO;
|
||||
import com.zt.plat.module.qms.business.bus.dal.dataobject.BusinessSubSampleDO;
|
||||
import com.zt.plat.module.qms.business.bus.service.BusinessSampleDispatchDetailService;
|
||||
import com.zt.plat.module.qms.business.bus.service.BusinessSubSampleService;
|
||||
import com.zt.plat.module.qms.business.config.controller.vo.ConfigWarehouseLocationPageReqVO;
|
||||
import com.zt.plat.module.qms.business.config.controller.vo.ConfigWarehouseLocationRespVO;
|
||||
import com.zt.plat.module.qms.business.config.service.ConfigWarehouseLocationService;
|
||||
import com.zt.plat.module.qms.enums.QmsCommonConstant;
|
||||
import org.springframework.util.ObjectUtils;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
import jakarta.annotation.Resource;
|
||||
import org.springframework.validation.annotation.Validated;
|
||||
@@ -46,7 +50,9 @@ public class BusinessSampleDispatchController implements BusinessControllerMarke
|
||||
|
||||
|
||||
@Resource private BusinessSampleDispatchService businessSampleDispatchService;
|
||||
@Resource private BusinessSampleDispatchDetailService businessSampleDispatchDetailService;
|
||||
@Resource private BusinessSubSampleService businessSubSampleService;
|
||||
@Resource private ConfigWarehouseLocationService configWarehouseLocationService;
|
||||
|
||||
@PostMapping("/createTempData")
|
||||
@Operation(summary = "创建临时数据")
|
||||
@@ -60,6 +66,7 @@ public class BusinessSampleDispatchController implements BusinessControllerMarke
|
||||
@Operation(summary = "更新样品调拨")
|
||||
public CommonResult<Boolean> updateBusinessSampleDispatch(@Valid @RequestBody BusinessSampleDispatchSaveReqVO updateReqVO) {
|
||||
updateReqVO.setCancelStatus("0");
|
||||
updateReqVO.setFlowStatus(QmsCommonConstant.NOT_START);
|
||||
businessSampleDispatchService.updateBusinessSampleDispatch(updateReqVO);
|
||||
return success(true);
|
||||
}
|
||||
@@ -67,19 +74,35 @@ public class BusinessSampleDispatchController implements BusinessControllerMarke
|
||||
@PostMapping("/addOrRemoveSample")
|
||||
@Operation(summary = "增加或移除样品")
|
||||
public CommonResult<Boolean> addOrRemoveSample(@Valid @RequestBody BusinessSampleDispatchSaveReqVO updateReqVO) {
|
||||
businessSampleDispatchService.addOrRemoveSample(updateReqVO);
|
||||
businessSampleDispatchService.addOrRemoveSample(updateReqVO, true);
|
||||
return success(true);
|
||||
}
|
||||
|
||||
@PostMapping("/addBySampleCode")
|
||||
@Operation(summary = "增加或移除样品")
|
||||
public CommonResult<Boolean> addBySampleCode(HttpServletRequest request) {
|
||||
String id = request.getParameter("id");
|
||||
String sampleCode = request.getParameter("sampleCode");
|
||||
BusinessSubSampleDO businessSubSampleDO = businessSubSampleService.getBySampleCode(sampleCode);
|
||||
@PostMapping("/addBySampleReturnCode")
|
||||
@Operation(summary = "按归库码增加样品")
|
||||
public CommonResult<Boolean> addBySampleReturnCode(@RequestBody JSONObject param) {
|
||||
String id = param.getString("id");
|
||||
String sampleReturnCode = param.getString("sampleReturnCode");
|
||||
String warehouseCode = param.getString("warehouseCode");
|
||||
if(ObjectUtils.isEmpty(warehouseCode)){
|
||||
return CommonResult.error(BUSINESS_SUB_SAMPLE_NOT_EXISTS.getCode(), "请选择仓库,再扫描样品!");
|
||||
}
|
||||
BusinessSubSampleDO businessSubSampleDO = businessSubSampleService.getBySampleReturnCode(sampleReturnCode);
|
||||
if(businessSubSampleDO == null)
|
||||
return CommonResult.error(BUSINESS_SUB_SAMPLE_NOT_EXISTS.getCode(), "未查询到此样品!");
|
||||
//判断样品状态
|
||||
//判断样品状态、库位
|
||||
// String sampleWarehouseCode = businessSubSampleDO.getWarehouseCode(); //todo 判断库位
|
||||
ConfigWarehouseLocationPageReqVO warehouseReqVO = new ConfigWarehouseLocationPageReqVO();
|
||||
warehouseReqVO.setId(businessSubSampleDO.getConfigWarehouseLocationInfomationId());
|
||||
PageResult<ConfigWarehouseLocationRespVO> warehousePage = configWarehouseLocationService.getConfigWarehouseLocationPage(warehouseReqVO);
|
||||
if(warehousePage.getTotal() == 0){
|
||||
return CommonResult.error(BUSINESS_SUB_SAMPLE_NOT_EXISTS.getCode(), "未查询到样品所在仓库,请检查样品码是否正确!");
|
||||
}
|
||||
ConfigWarehouseLocationRespVO warehouse = warehousePage.getList().get(0);
|
||||
if(!warehouseCode.equals(warehouse.getWarehouseCode())){
|
||||
return CommonResult.error(BUSINESS_SUB_SAMPLE_NOT_EXISTS.getCode(), "此样品所在仓库为:"+warehouse.getWarehouseName()+",请检查样品码是否正确!");
|
||||
}
|
||||
|
||||
String returnStatus = businessSubSampleDO.getReturnStatus();
|
||||
if(!QmsCommonConstant.COMPLETED.equals(returnStatus)){
|
||||
return CommonResult.error(BUSINESS_SUB_SAMPLE_NOT_EXISTS.getCode(), "样品状态为:"+returnStatus+",不能调拨!");
|
||||
@@ -88,12 +111,19 @@ public class BusinessSampleDispatchController implements BusinessControllerMarke
|
||||
if("1".equals(dispatchStatus)){
|
||||
return CommonResult.error(BUSINESS_SUB_SAMPLE_NOT_EXISTS.getCode(), "样品已被调拨:请归还后再调拨!");
|
||||
}
|
||||
BusinessSampleDispatchDetailPageReqVO reqVO = new BusinessSampleDispatchDetailPageReqVO();
|
||||
reqVO.setParentId(Long.valueOf(id));
|
||||
reqVO.setSampleReturnCode(sampleReturnCode);
|
||||
PageResult<BusinessSampleDispatchDetailExtendRespVO> pageDetailList = businessSampleDispatchDetailService.getBusinessSampleDispatchDetailPage(reqVO);
|
||||
if(pageDetailList.getTotal() > 0){
|
||||
return CommonResult.error(BUSINESS_SUB_SAMPLE_NOT_EXISTS.getCode(), "次样品已添加,请勿重复添加!");
|
||||
}
|
||||
List<Long> sampleIds = new ArrayList<>();
|
||||
sampleIds.add(businessSubSampleDO.getId());
|
||||
BusinessSampleDispatchSaveReqVO updateReqVO = new BusinessSampleDispatchSaveReqVO();
|
||||
updateReqVO.setId(Long.valueOf(id));
|
||||
updateReqVO.setAddSubSampleIds(sampleIds);
|
||||
businessSampleDispatchService.addOrRemoveSample(updateReqVO);
|
||||
businessSampleDispatchService.addOrRemoveSample(updateReqVO, false);
|
||||
return success(true);
|
||||
}
|
||||
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user