diff --git a/scripts/deploy.sh b/scripts/deploy.sh
index f30a20e..e7efa48 100644
--- a/scripts/deploy.sh
+++ b/scripts/deploy.sh
@@ -10,7 +10,7 @@ echo "workspace is ${WORKSPACE}"
mv ${WORKSPACE}/sgzb-auth/target/sgzb-auth-cq1.0.jar $deploy_path
mv ${WORKSPACE}/sgzb-gateway/target/sgzb-gateway-cq1.0.jar $deploy_path
mv ${WORKSPACE}/sgzb-modules/sgzb-system/target/sgzb-modules-system-cq1.0.jar $deploy_path
-mv ${WORKSPACE}/sgzb-modules/sgzb-material/target/sgzb-modules-material-cq1.0.jar $deploy_path
+mv ${WORKSPACE}/sgzb-modules/sgzb-material/target/sgzb-modules-material-common-3.0.jar $deploy_path
chmod 777 *.jar
echo "--------moveFile end--------------"
export sgzb_auth_enable=true
@@ -21,7 +21,7 @@ export sgzb_modules_material_enable=true
export sgzb_auth_jar=sgzb-auth-cq1.0.jar
export sgzb_gateway_jar=sgzb-gateway-cq1.0.jar
export sgzb_modules_system_jar=sgzb-modules-system-cq1.0.jar
-export sgzb_modules_material_jar=sgzb-modules-material-cq1.0.jar
+export sgzb_modules_material_jar=sgzb-modules-material-common-3.0.jar
export sgzb_auth_port=39200
export sgzb_gateway_port=39080
diff --git a/scripts/kill-cq1.0.sh b/scripts/kill-cq1.0.sh
index 71eaf24..a8ef67d 100644
--- a/scripts/kill-cq1.0.sh
+++ b/scripts/kill-cq1.0.sh
@@ -32,7 +32,7 @@ echo 'Stop Success!'
fi
-MA_RESOURCE_NAME=sgzb-modules-material-cq1.0.jar
+MA_RESOURCE_NAME=sgzb-modules-material-common-3.0.jar
tpid=`ps -ef|grep $MA_RESOURCE_NAME|grep -v grep|grep -v kill|awk '{print $2}'`
if [ ${tpid} ]; then
diff --git a/sgzb-api/sgzb-api-system/src/main/java/com/bonus/sgzb/base/api/domain/BackApplyInfo.java b/sgzb-api/sgzb-api-system/src/main/java/com/bonus/sgzb/base/api/domain/BackApplyInfo.java
index e916f52..101a712 100644
--- a/sgzb-api/sgzb-api-system/src/main/java/com/bonus/sgzb/base/api/domain/BackApplyInfo.java
+++ b/sgzb-api/sgzb-api-system/src/main/java/com/bonus/sgzb/base/api/domain/BackApplyInfo.java
@@ -281,6 +281,11 @@ public class BackApplyInfo extends BaseEntity {
@ApiModelProperty(value = "数量")
private String num;
+ /**
+ * 已完成的退料数量
+ */
+ private String finishedBackNum;
+
@ApiModelProperty(value = "详情id和数量")
private String detailsIdByNum;
diff --git a/sgzb-auth/src/main/resources/bootstrap.yml b/sgzb-auth/src/main/resources/bootstrap.yml
index 82f42c7..0117fe0 100644
--- a/sgzb-auth/src/main/resources/bootstrap.yml
+++ b/sgzb-auth/src/main/resources/bootstrap.yml
@@ -9,4 +9,4 @@ spring:
name: sgzb-auth
profiles:
# 环境配置
- active: sgzb_cloud_local
+ active: sgzb_cq_local
diff --git a/sgzb-gateway/src/main/resources/bootstrap.yml b/sgzb-gateway/src/main/resources/bootstrap.yml
index 6ffe4e5..c26d13d 100644
--- a/sgzb-gateway/src/main/resources/bootstrap.yml
+++ b/sgzb-gateway/src/main/resources/bootstrap.yml
@@ -9,4 +9,4 @@ spring:
name: sgzb-gateway
profiles:
# 环境配置
- active: sgzb_cloud_local
+ active: sgzb_cq_local
diff --git a/sgzb-modules/sgzb-material/pom.xml b/sgzb-modules/sgzb-material/pom.xml
index bb600d0..8f2647b 100644
--- a/sgzb-modules/sgzb-material/pom.xml
+++ b/sgzb-modules/sgzb-material/pom.xml
@@ -9,7 +9,7 @@
4.0.0
- sgzb-modules-material-cq1.0
+ sgzb-modules-material-common-3.0
sgzb-modules-material
diff --git a/sgzb-modules/sgzb-material/src/main/java/com/bonus/sgzb/app/mapper/BackReceiveMapper.java b/sgzb-modules/sgzb-material/src/main/java/com/bonus/sgzb/app/mapper/BackReceiveMapper.java
index 3301dbf..f5113b0 100644
--- a/sgzb-modules/sgzb-material/src/main/java/com/bonus/sgzb/app/mapper/BackReceiveMapper.java
+++ b/sgzb-modules/sgzb-material/src/main/java/com/bonus/sgzb/app/mapper/BackReceiveMapper.java
@@ -32,6 +32,8 @@ public interface BackReceiveMapper {
*/
List receiveView(BackApplyInfo record);
+ List receiveView2(BackApplyInfo record);
+
/**
* 添加接收数据back_check_details
* @param record
@@ -207,4 +209,6 @@ public interface BackReceiveMapper {
List getCtList(BackApplyInfo record);
List backReceiveRecordWebPt(BackApplyInfo record);
+
+ int finishBackCheckDetails(BackApplyInfo record);
}
\ No newline at end of file
diff --git a/sgzb-modules/sgzb-material/src/main/java/com/bonus/sgzb/app/service/impl/BackReceiveServiceImpl.java b/sgzb-modules/sgzb-material/src/main/java/com/bonus/sgzb/app/service/impl/BackReceiveServiceImpl.java
index 1caf9e0..c90173f 100644
--- a/sgzb-modules/sgzb-material/src/main/java/com/bonus/sgzb/app/service/impl/BackReceiveServiceImpl.java
+++ b/sgzb-modules/sgzb-material/src/main/java/com/bonus/sgzb/app/service/impl/BackReceiveServiceImpl.java
@@ -98,6 +98,10 @@ public class BackReceiveServiceImpl implements BackReceiveService {
return res;
}
+ private int finishBackCheckDetails(BackApplyInfo record) {
+ return backReceiveMapper.finishBackCheckDetails(record);
+ }
+
@Override
@Transactional(rollbackFor = Exception.class)
public int setCodeBack(BackApplyInfo record) {
@@ -143,7 +147,7 @@ public class BackReceiveServiceImpl implements BackReceiveService {
@Override
@Transactional(rollbackFor = Exception.class)
public int endBack(BackApplyInfo record) {
- int res;
+ int res = 0;
// try {
int taskId = record.getTaskId();
int passNum = 0;
@@ -163,9 +167,13 @@ public class BackReceiveServiceImpl implements BackReceiveService {
throw new RuntimeException("该退料单已完成退料");
}
//修改任务状态
- res = updateTaskStatus(taskId, 40);
- if (res == 0) {
- throw new RuntimeException("tm_task修改状态");
+ List list = backReceiveMapper.receiveView2(record);
+ boolean allZeros = list.stream().allMatch(n -> Double.valueOf(n.getNum()).intValue() == 0);
+ if (allZeros) {
+ res = updateTaskStatus(taskId, 40);
+ if (res == 0) {
+ throw new RuntimeException("tm_task修改状态");
+ }
}
//更加退料接收的数据创建下一步流程
//合格的插入入库记录input_apply_details,修改库存ma_type,修改机具状态
@@ -236,6 +244,9 @@ public class BackReceiveServiceImpl implements BackReceiveService {
record.setPostStoreNum(postStoreNum);
}
+ //完成退料的部分,更新 back_check_details 为 is_finished=1,此部分不支持撤回
+ finishBackCheckDetails(record);
+
//库存日志
record.setBackNum(passNum+maintenanceNum+scrapNum);
record.setPassNum(passNum);
diff --git a/sgzb-modules/sgzb-material/src/main/resources/bootstrap.yml b/sgzb-modules/sgzb-material/src/main/resources/bootstrap.yml
index d0a0f1e..34dca85 100644
--- a/sgzb-modules/sgzb-material/src/main/resources/bootstrap.yml
+++ b/sgzb-modules/sgzb-material/src/main/resources/bootstrap.yml
@@ -5,4 +5,4 @@ spring:
name: sgzb-material
profiles:
# 环境配置
- active: sgzb_cloud_local
\ No newline at end of file
+ active: sgzb_cq_local
\ No newline at end of file
diff --git a/sgzb-modules/sgzb-material/src/main/resources/mapper/app/BackReceiveMapper.xml b/sgzb-modules/sgzb-material/src/main/resources/mapper/app/BackReceiveMapper.xml
index e9a59cb..a4047b9 100644
--- a/sgzb-modules/sgzb-material/src/main/resources/mapper/app/BackReceiveMapper.xml
+++ b/sgzb-modules/sgzb-material/src/main/resources/mapper/app/BackReceiveMapper.xml
@@ -578,8 +578,13 @@
status = '1'
where id = #{info.id}
+
+
+ update back_check_details set is_finished = 1 where parent_id = #{parentId} and type_id = #{typeId} and (is_finished is null or is_finished != 1)
+
+
- delete from back_check_details where parent_id = #{parentId} and type_id = #{typeId}
+ delete from back_check_details where parent_id = #{parentId} and type_id = #{typeId} and (is_finished is null or is_finished != 1)
and ma_id = #{maId}
@@ -669,6 +674,7 @@
bad.status as status,
IFNULL(bad.audit_num,0)-IFNULL(aa.back_num,0) as num,
mt.manage_type as manageType,
+ bb.finished_back_num,
mtk.user_id,
CONCAT('NSJJ',mt.`code`,mt.model_code) as `code`
FROM
@@ -688,6 +694,16 @@
parent_id=#{id}
GROUP BY type_id
) aa on aa.typeId=bad.type_id
+ LEFT JOIN (
+ SELECT
+ type_id as typeId,
+ SUM(IFNULL(back_num,0)) as finished_back_num
+ FROM
+ back_check_details
+ WHERE
+ parent_id=#{id} and is_finished = 1
+ GROUP BY type_id
+ ) bb on bb.typeId=bad.type_id
WHERE
bai.id=#{id}
@@ -698,6 +714,58 @@
+
+
@@ -723,7 +791,7 @@
LEFT JOIN tm_task_agreement tta on tta.task_id=bai.task_id
WHERE
parent_id=#{parentId}
- and bcd.back_status='1'
+ and bcd.back_status='1' and (bcd.is_finished is null or bcd.is_finished != 1)