功能完善

This commit is contained in:
bns_han 2024-01-22 20:23:30 +08:00
parent 25334526a5
commit 968d639582
3 changed files with 23 additions and 2 deletions

View File

@ -55,4 +55,6 @@ public interface BackReceiveMapper {
List<BackApplyInfo> qrcodeQuery(BackApplyInfo record);
List<BackApplyInfo> backReceiveRecord(BackApplyInfo record);
int selectCodeByMaIdAndTaskId(@Param("maId") Integer maId,@Param("taskId") Integer taskId);
}

View File

@ -5,6 +5,7 @@ import com.bonus.sgzb.app.domain.GlobalConstants;
import com.bonus.sgzb.app.mapper.BackReceiveMapper;
import com.bonus.sgzb.app.service.BackReceiveService;
import com.bonus.sgzb.common.core.utils.DateUtils;
import com.bonus.sgzb.common.core.utils.StringHelper;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
@ -67,8 +68,16 @@ public class BackReceiveServiceImpl implements BackReceiveService {
public int setCodeBack(BackApplyInfo record) {
int res;
try{
//todo 此处需要判断 接收数量是否大于退料数量或者查询待接收数量是否为0
BackApplyInfo[] arr = record.getArr();
if (arr.length>0){
for (int i=0;i< arr.length;i++){
//根据maId和taskId查询是否已接收
int re = backReceiveMapper.selectCodeByMaIdAndTaskId(arr[i].getMaId(),record.getTaskId());
if (re>0){
throw new RuntimeException("该编码已接收");
}
}
}
int taskId = record.getTaskId();
//修改任务状态
res= updateTaskStatus(taskId,39);

View File

@ -738,6 +738,16 @@
ORDER BY
bcd.create_time DESC
</select>
<select id="selectCodeByMaIdAndTaskId" resultType="java.lang.Integer">
SELECT
COUNT(*)
FROM
back_check_details cbd
LEFT JOIN back_apply_info bai ON bai.id = cbd.parent_id
WHERE
cbd.ma_id = #{maId}
AND bai.task_id = #{taskId}
</select>
</mapper>