修试后入库接口开发
This commit is contained in:
parent
6ad082593d
commit
03d2c2f1d1
|
|
@ -424,9 +424,9 @@ public class BmQrBoxServiceImpl implements BmQrBoxService {
|
|||
return AjaxResult.error("物资状态异常,请完善后重试!");
|
||||
}
|
||||
if (!Objects.equals(machineVo.getMaStatus(), MaMachineStatusEnum.NEW_PURCHASE.getStatus().toString()) &&
|
||||
!Objects.equals(machineVo.getMaStatus(), MaMachineStatusEnum.IN_STORE.getStatus().toString())
|
||||
!Objects.equals(machineVo.getMaStatus(), MaMachineStatusEnum.REPAIR_TO_STORE.getStatus().toString())
|
||||
) {
|
||||
return AjaxResult.error("物资状态非在库或待入库状态,无法操作:" + machineVo.getMaStatus());
|
||||
return AjaxResult.error("物资状态待入库状态,无法操作:" + machineVo.getMaStatus());
|
||||
}
|
||||
|
||||
// 物资的新购批次判断,是否和Box标准箱内已存在的是同一批
|
||||
|
|
|
|||
|
|
@ -120,19 +120,5 @@ public class InputApplyDetailsController extends BaseController {
|
|||
|
||||
|
||||
|
||||
// /**
|
||||
// * 修试入库二维码扫描
|
||||
// */
|
||||
// @ApiOperation(value = "新增入库任务详细")
|
||||
// @PreventRepeatSubmit
|
||||
// @RequiresPermissions("input:details:code")
|
||||
// @SysLog(title = "扫描入库", businessType = OperaType.UPDATE, logType = 1,module = "修试入库->增加库存")
|
||||
// @PostMapping
|
||||
// public AjaxResult sanQrcodeInput(@RequestBody InputApplyDetails inputApplyDetails) {
|
||||
// try {
|
||||
// return toAjax(inputApplyDetailsService.sanInput(inputApplyDetails));
|
||||
// } catch (Exception e) {
|
||||
// return error("系统错误, " + e.getMessage());
|
||||
// }
|
||||
// }
|
||||
|
||||
}
|
||||
|
|
|
|||
|
|
@ -58,5 +58,5 @@ public interface IInputApplyDetailsService {
|
|||
*/
|
||||
public int deleteInputApplyDetailsById(Long id);
|
||||
|
||||
int sanInput(InputApplyDetails inputApplyDetails);
|
||||
|
||||
}
|
||||
|
|
|
|||
|
|
@ -24,8 +24,7 @@ public class InputApplyDetailsServiceImpl implements IInputApplyDetailsService {
|
|||
@Autowired
|
||||
private InputApplyDetailsMapper inputApplyDetailsMapper;
|
||||
|
||||
@Autowired
|
||||
private MachineMapper machineMapper;
|
||||
|
||||
/**
|
||||
* 查询入库任务详细
|
||||
*
|
||||
|
|
@ -102,88 +101,5 @@ public class InputApplyDetailsServiceImpl implements IInputApplyDetailsService {
|
|||
return inputApplyDetailsMapper.deleteInputApplyDetailsById(id);
|
||||
}
|
||||
|
||||
@Override
|
||||
@Transactional(rollbackFor = Exception.class)
|
||||
public int sanInput(InputApplyDetails inputApplyDetails) {
|
||||
int result = 0;
|
||||
try {
|
||||
//1查询入参设备是否为待入库设备
|
||||
|
||||
InputApplyDetails inputInfo = new InputApplyDetails();
|
||||
|
||||
inputInfo = checkMachineStatus(inputApplyDetails.getQrCode());
|
||||
if(inputInfo !=null){
|
||||
throw new ServiceException("设备不是修试后待入库状态");
|
||||
}
|
||||
//2更新入库设备数量
|
||||
result = updateInputNum(inputInfo);
|
||||
if(result <= 0){
|
||||
throw new ServiceException("更新入库数量失败");
|
||||
}
|
||||
//3更新库存数量
|
||||
result = updateStorageNum(inputInfo);
|
||||
if(result <= 0){
|
||||
throw new ServiceException("更新库存数量失败");
|
||||
}
|
||||
//4更新任务状态
|
||||
result = updateTaskStatus(inputInfo);
|
||||
if(result <= 0){
|
||||
throw new ServiceException("更新任务状态失败");
|
||||
}
|
||||
} catch (Exception e) {
|
||||
throw new ServiceException("系统错误, " + e.getMessage());
|
||||
}
|
||||
|
||||
return result;
|
||||
}
|
||||
|
||||
private int updateTaskStatus(InputApplyDetails inputApplyDetails) {
|
||||
int result = 0;
|
||||
|
||||
List<InputApplyDetails> inputList = inputApplyDetailsMapper.selectInputTaskStatus(inputApplyDetails);
|
||||
|
||||
if(inputList.size() > 0 && inputList!=null){
|
||||
result = 1;
|
||||
}else{
|
||||
result = inputApplyDetailsMapper.updateTaskStatus(inputApplyDetails);
|
||||
}
|
||||
|
||||
|
||||
return result;
|
||||
}
|
||||
|
||||
private int updateStorageNum(InputApplyDetails inputApplyDetails) {
|
||||
int result = 0;
|
||||
result = inputApplyDetailsMapper.updateStorageNum(inputApplyDetails);
|
||||
result = machineMapper.updateStatus(inputApplyDetails.getMaId(), 141);
|
||||
return result;
|
||||
}
|
||||
|
||||
private int updateInputNum(InputApplyDetails inputApplyDetails) {
|
||||
int result = 0;
|
||||
String auditBy = SecurityUtils.getLoginUser().getUserid().toString();
|
||||
result = inputApplyDetailsMapper.updateInputNum(inputApplyDetails);
|
||||
return result;
|
||||
}
|
||||
|
||||
private InputApplyDetails checkMachineStatus(String qrCode) {
|
||||
InputApplyDetails inputInfo = new InputApplyDetails();
|
||||
|
||||
Machine ma = new Machine();
|
||||
ma.setQrCode(qrCode);
|
||||
ma = machineMapper.selectMachineByQrCode(ma);
|
||||
long maId = ma.getId();
|
||||
|
||||
String status = ma.getMaStatus();
|
||||
if("145".equals(status)){
|
||||
InputApplyDetails inputApplyDetails = new InputApplyDetails();
|
||||
inputApplyDetails.setMaId(maId);
|
||||
inputInfo = inputApplyDetailsMapper.selectInputInfoByMaId(inputApplyDetails);
|
||||
|
||||
|
||||
}else{
|
||||
inputInfo = null;
|
||||
}
|
||||
return inputInfo;
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -132,4 +132,8 @@ public class TypeKeeperController extends BaseController {
|
|||
{
|
||||
return toAjax(typeKeeperService.deleteTypeKeeperByUserIdAndTypeId(typeKeepers));
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
|
|
|||
|
|
@ -11,6 +11,7 @@ import com.bonus.common.log.enums.OperaType;
|
|||
import com.bonus.material.back.domain.vo.MaCodeVo;
|
||||
import com.bonus.material.basic.domain.BmQrcodeInfo;
|
||||
import com.bonus.material.common.annotation.PreventRepeatSubmit;
|
||||
import com.bonus.material.input.domain.InputApplyDetails;
|
||||
import io.swagger.annotations.Api;
|
||||
import io.swagger.annotations.ApiOperation;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
|
|
@ -32,7 +33,7 @@ import com.bonus.common.core.utils.poi.ExcelUtil;
|
|||
|
||||
/**
|
||||
* 修试后入库Controller
|
||||
*
|
||||
*
|
||||
* @author xsheng
|
||||
* @date 2024-10-16
|
||||
*/
|
||||
|
|
@ -132,7 +133,7 @@ public class RepairInputDetailsController extends BaseController {
|
|||
@ApiOperation(value = "入库或批量入库操作")
|
||||
@PreventRepeatSubmit
|
||||
// @RequiresPermissions("purchase:storage:add")
|
||||
@StoreLog(title = "修试后入库", module = "修试入库->修试后入库")
|
||||
// @StoreLog(title = "修试后入库", module = "修试入库->修试后入库")
|
||||
@PostMapping("/warehouse")
|
||||
public AjaxResult warehouse(@RequestBody RepairInputDetails repairInputDetails) {
|
||||
return repairInputDetailsService.warehouse(repairInputDetails);
|
||||
|
|
@ -173,4 +174,21 @@ public class RepairInputDetailsController extends BaseController {
|
|||
public AjaxResult reject(@RequestBody RepairInputDetails repairInputDetails) {
|
||||
return repairInputDetailsService.reject(repairInputDetails);
|
||||
}
|
||||
|
||||
/**
|
||||
* 修试入库二维码扫描
|
||||
*/
|
||||
@ApiOperation(value = "修试入库二维码扫描")
|
||||
@PreventRepeatSubmit
|
||||
@SysLog(title = "扫描入库", businessType = OperaType.UPDATE, logType = 1,module = "修试入库->增加库存")
|
||||
@PostMapping("/sanQrcodeInput")
|
||||
public AjaxResult sanQrcodeInput(@RequestBody RepairInputDetails repairInputDetails) {
|
||||
try {
|
||||
return toAjax(repairInputDetailsService.sanInput(repairInputDetails));
|
||||
} catch (Exception e) {
|
||||
return error("系统错误, " + e.getMessage());
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
|
|
|||
|
|
@ -5,19 +5,20 @@ import java.util.List;
|
|||
import com.bonus.material.back.domain.vo.MaCodeVo;
|
||||
import com.bonus.common.biz.domain.repair.RepairInputDetails;
|
||||
import com.bonus.material.basic.domain.BmQrcodeInfo;
|
||||
import com.bonus.material.input.domain.InputApplyDetails;
|
||||
import com.bonus.material.repair.domain.RepairInputInfo;
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
|
||||
/**
|
||||
* 修试后入库Mapper接口
|
||||
*
|
||||
*
|
||||
* @author xsheng
|
||||
* @date 2024-10-16
|
||||
*/
|
||||
public interface RepairInputDetailsMapper {
|
||||
/**
|
||||
* 查询修试后入库
|
||||
*
|
||||
*
|
||||
* @param repairInputDetails 修试后入库主键
|
||||
* @return 修试后入库
|
||||
*/
|
||||
|
|
@ -25,7 +26,7 @@ public interface RepairInputDetailsMapper {
|
|||
|
||||
/**
|
||||
* 查询修试后入库列表
|
||||
*
|
||||
*
|
||||
* @param repairInputDetails 修试后入库
|
||||
* @return 修试后入库集合
|
||||
*/
|
||||
|
|
@ -36,7 +37,7 @@ public interface RepairInputDetailsMapper {
|
|||
|
||||
/**
|
||||
* 新增修试后入库
|
||||
*
|
||||
*
|
||||
* @param repairInputDetails 修试后入库
|
||||
* @return 结果
|
||||
*/
|
||||
|
|
@ -44,7 +45,7 @@ public interface RepairInputDetailsMapper {
|
|||
|
||||
/**
|
||||
* 修改修试后入库
|
||||
*
|
||||
*
|
||||
* @param repairInputDetails 修试后入库
|
||||
* @return 结果
|
||||
*/
|
||||
|
|
@ -52,7 +53,7 @@ public interface RepairInputDetailsMapper {
|
|||
|
||||
/**
|
||||
* 删除修试后入库
|
||||
*
|
||||
*
|
||||
* @param id 修试后入库主键
|
||||
* @return 结果
|
||||
*/
|
||||
|
|
@ -62,7 +63,7 @@ public interface RepairInputDetailsMapper {
|
|||
|
||||
/**
|
||||
* 批量删除修试后入库
|
||||
*
|
||||
*
|
||||
* @param ids 需要删除的数据主键集合
|
||||
* @return 结果
|
||||
*/
|
||||
|
|
@ -130,4 +131,14 @@ public interface RepairInputDetailsMapper {
|
|||
* @return
|
||||
*/
|
||||
List<RepairInputDetails> getInfoByQrcode(BmQrcodeInfo bmQrcodeInfo);
|
||||
|
||||
RepairInputDetails selectInputInfoByMaId(InputApplyDetails inputApplyDetails);
|
||||
|
||||
int updateInputNum(RepairInputDetails inputApplyDetails);
|
||||
|
||||
int updateStorageNum(RepairInputDetails inputApplyDetails);
|
||||
|
||||
int updateTaskStatus(RepairInputDetails inputApplyDetails);
|
||||
|
||||
List<RepairInputDetails> selectInputTaskStatus(RepairInputDetails inputApplyDetails);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -10,14 +10,14 @@ import com.bonus.material.repair.domain.RepairInputInfo;
|
|||
|
||||
/**
|
||||
* 修试后入库Service接口
|
||||
*
|
||||
*
|
||||
* @author xsheng
|
||||
* @date 2024-10-16
|
||||
*/
|
||||
public interface IRepairInputDetailsService {
|
||||
/**
|
||||
* 查询修试后入库
|
||||
*
|
||||
*
|
||||
* @param repairInputDetails 修试后入库主键
|
||||
* @return 修试后入库
|
||||
*/
|
||||
|
|
@ -25,7 +25,7 @@ public interface IRepairInputDetailsService {
|
|||
|
||||
/**
|
||||
* 查询修试后入库列表
|
||||
*
|
||||
*
|
||||
* @param repairInputDetails 修试后入库
|
||||
* @return 修试后入库集合
|
||||
*/
|
||||
|
|
@ -33,7 +33,7 @@ public interface IRepairInputDetailsService {
|
|||
|
||||
/**
|
||||
* 新增修试后入库
|
||||
*
|
||||
*
|
||||
* @param repairInputDetails 修试后入库
|
||||
* @return 结果
|
||||
*/
|
||||
|
|
@ -41,7 +41,7 @@ public interface IRepairInputDetailsService {
|
|||
|
||||
/**
|
||||
* 修改修试后入库
|
||||
*
|
||||
*
|
||||
* @param repairInputDetails 修试后入库
|
||||
* @return 结果
|
||||
*/
|
||||
|
|
@ -49,7 +49,7 @@ public interface IRepairInputDetailsService {
|
|||
|
||||
/**
|
||||
* 批量删除修试后入库
|
||||
*
|
||||
*
|
||||
* @param ids 需要删除的修试后入库主键集合
|
||||
* @return 结果
|
||||
*/
|
||||
|
|
@ -57,7 +57,7 @@ public interface IRepairInputDetailsService {
|
|||
|
||||
/**
|
||||
* 删除修试后入库信息
|
||||
*
|
||||
*
|
||||
* @param id 修试后入库主键
|
||||
* @return 结果
|
||||
*/
|
||||
|
|
@ -90,4 +90,6 @@ public interface IRepairInputDetailsService {
|
|||
* @return
|
||||
*/
|
||||
AjaxResult getInfoByQrcode(BmQrcodeInfo bmQrcodeInfo);
|
||||
|
||||
int sanInput(RepairInputDetails repairInputDetails);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -19,14 +19,18 @@ import com.bonus.common.security.utils.SecurityUtils;
|
|||
import com.bonus.material.back.domain.vo.MaCodeVo;
|
||||
import com.bonus.common.biz.domain.repair.RePairDto;
|
||||
import com.bonus.material.basic.domain.BmQrcodeInfo;
|
||||
import com.bonus.material.input.domain.InputApplyDetails;
|
||||
import com.bonus.material.lease.mapper.LeaseOutDetailsMapper;
|
||||
import com.bonus.material.ma.domain.Machine;
|
||||
import com.bonus.material.ma.domain.Type;
|
||||
import com.bonus.material.ma.mapper.MachineMapper;
|
||||
import com.bonus.material.repair.domain.RepairInputInfo;
|
||||
import com.bonus.material.repair.domain.vo.ScrapApplyDetailsVO;
|
||||
import com.bonus.material.task.domain.TmTask;
|
||||
import com.bonus.material.task.domain.TmTaskAgreement;
|
||||
import com.bonus.material.task.mapper.TmTaskAgreementMapper;
|
||||
import com.bonus.material.task.mapper.TmTaskMapper;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
import com.bonus.material.repair.mapper.RepairInputDetailsMapper;
|
||||
import com.bonus.common.biz.domain.repair.RepairInputDetails;
|
||||
|
|
@ -37,7 +41,7 @@ import javax.annotation.Resource;
|
|||
|
||||
/**
|
||||
* 修试后入库Service业务层处理
|
||||
*
|
||||
*
|
||||
* @author xsheng
|
||||
* @date 2024-10-16
|
||||
*/
|
||||
|
|
@ -55,9 +59,11 @@ public class RepairInputDetailsServiceImpl implements IRepairInputDetailsService
|
|||
@Resource
|
||||
private LeaseOutDetailsMapper leaseOutDetailsMapper;
|
||||
|
||||
@Resource
|
||||
private MachineMapper machineMapper;
|
||||
/**
|
||||
* 查询修试后入库
|
||||
*
|
||||
*
|
||||
* @param repairInputDetails 修试后入库主键
|
||||
* @return 修试后入库
|
||||
*/
|
||||
|
|
@ -97,7 +103,7 @@ public class RepairInputDetailsServiceImpl implements IRepairInputDetailsService
|
|||
|
||||
/**
|
||||
* 查询修试后入库列表
|
||||
*
|
||||
*
|
||||
* @param repairInputDetails 修试后入库
|
||||
* @return 修试后入库
|
||||
*/
|
||||
|
|
@ -149,7 +155,7 @@ public class RepairInputDetailsServiceImpl implements IRepairInputDetailsService
|
|||
|
||||
/**
|
||||
* 新增修试后入库
|
||||
*
|
||||
*
|
||||
* @param repairInputDetails 修试后入库
|
||||
* @return 结果
|
||||
*/
|
||||
|
|
@ -165,7 +171,7 @@ public class RepairInputDetailsServiceImpl implements IRepairInputDetailsService
|
|||
|
||||
/**
|
||||
* 修改修试后入库
|
||||
*
|
||||
*
|
||||
* @param repairInputDetails 修试后入库
|
||||
* @return 结果
|
||||
*/
|
||||
|
|
@ -181,7 +187,7 @@ public class RepairInputDetailsServiceImpl implements IRepairInputDetailsService
|
|||
|
||||
/**
|
||||
* 批量删除修试后入库
|
||||
*
|
||||
*
|
||||
* @param ids 需要删除的修试后入库主键
|
||||
* @return 结果
|
||||
*/
|
||||
|
|
@ -192,7 +198,7 @@ public class RepairInputDetailsServiceImpl implements IRepairInputDetailsService
|
|||
|
||||
/**
|
||||
* 删除修试后入库信息
|
||||
*
|
||||
*
|
||||
* @param id 修试后入库主键
|
||||
* @return 结果
|
||||
*/
|
||||
|
|
@ -715,4 +721,89 @@ public class RepairInputDetailsServiceImpl implements IRepairInputDetailsService
|
|||
|
||||
return result;
|
||||
}
|
||||
|
||||
@Override
|
||||
@Transactional(rollbackFor = Exception.class)
|
||||
public int sanInput(RepairInputDetails inputApplyDetails) {
|
||||
int result = 0;
|
||||
try {
|
||||
//1查询入参设备是否为待入库设备
|
||||
|
||||
RepairInputDetails inputInfo = new RepairInputDetails();
|
||||
|
||||
inputInfo = checkMachineStatus(inputApplyDetails.getQrCode());
|
||||
if(inputInfo ==null){
|
||||
throw new ServiceException("设备不是修试后待入库状态");
|
||||
}
|
||||
//2更新入库设备数量
|
||||
result = updateInputNum(inputInfo);
|
||||
if(result <= 0){
|
||||
throw new ServiceException("更新入库数量失败");
|
||||
}
|
||||
//3更新库存数量
|
||||
result = updateStorageNum(inputInfo);
|
||||
if(result <= 0){
|
||||
throw new ServiceException("更新库存数量失败");
|
||||
}
|
||||
//4更新任务状态
|
||||
result = updateRTaskStatus(inputInfo);
|
||||
if(result <= 0){
|
||||
throw new ServiceException("更新任务状态失败");
|
||||
}
|
||||
} catch (Exception e) {
|
||||
throw new ServiceException("系统错误, " + e.getMessage());
|
||||
}
|
||||
|
||||
return result;
|
||||
}
|
||||
|
||||
private int updateRTaskStatus(RepairInputDetails inputApplyDetails) {
|
||||
int result = 0;
|
||||
|
||||
List<RepairInputDetails> inputList = repairInputDetailsMapper.selectInputTaskStatus(inputApplyDetails);
|
||||
|
||||
if(inputList.size() > 0 && inputList!=null){
|
||||
result = 1;
|
||||
}else{
|
||||
result = repairInputDetailsMapper.updateTaskStatus(inputApplyDetails);
|
||||
}
|
||||
|
||||
|
||||
return result;
|
||||
}
|
||||
|
||||
private int updateStorageNum(RepairInputDetails inputApplyDetails) {
|
||||
int result = 0;
|
||||
result = repairInputDetailsMapper.updateStorageNum(inputApplyDetails);
|
||||
result = machineMapper.updateStatus(inputApplyDetails.getMaId(), 1);
|
||||
return result;
|
||||
}
|
||||
|
||||
private int updateInputNum(RepairInputDetails inputApplyDetails) {
|
||||
int result = 0;
|
||||
String auditBy = SecurityUtils.getLoginUser().getUserid().toString();
|
||||
result = repairInputDetailsMapper.updateInputNum(inputApplyDetails);
|
||||
return result;
|
||||
}
|
||||
|
||||
private RepairInputDetails checkMachineStatus(String qrCode) {
|
||||
RepairInputDetails inputInfo = new RepairInputDetails();
|
||||
|
||||
Machine ma = new Machine();
|
||||
ma.setQrCode(qrCode);
|
||||
Machine ma2 = machineMapper.selectMachineByQrCode(ma);
|
||||
long maId = ma2.getMaId();
|
||||
|
||||
String status = ma2.getMaStatus();
|
||||
if("5".equals(status)){
|
||||
InputApplyDetails inputApplyDetails = new InputApplyDetails();
|
||||
inputApplyDetails.setMaId(maId);
|
||||
inputInfo = repairInputDetailsMapper.selectInputInfoByMaId(inputApplyDetails);
|
||||
|
||||
|
||||
}else{
|
||||
inputInfo = null;
|
||||
}
|
||||
return inputInfo;
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -0,0 +1,55 @@
|
|||
package com.bonus.material.work.controller;
|
||||
|
||||
import com.bonus.common.core.web.controller.BaseController;
|
||||
import com.bonus.common.core.web.domain.AjaxResult;
|
||||
import com.bonus.common.core.web.page.TableDataInfo;
|
||||
import com.bonus.common.security.utils.SecurityUtils;
|
||||
import com.bonus.material.ma.domain.DirectApplyInfo;
|
||||
import com.bonus.material.work.domain.AuditFlow;
|
||||
import com.bonus.material.work.domain.SysWorkflowType;
|
||||
import com.bonus.material.work.service.IAuditFlowService;
|
||||
import com.bonus.material.work.service.IDirectAuditService;
|
||||
import io.swagger.annotations.Api;
|
||||
import io.swagger.annotations.ApiOperation;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* @author js
|
||||
* @description 业务办理--人员审批
|
||||
* @date 2025/2/17 13:13
|
||||
*/
|
||||
@Api(tags = "审批人员接口")
|
||||
@RestController
|
||||
@RequestMapping("/auditFlow")
|
||||
public class AuditFlowController extends BaseController {
|
||||
|
||||
@Resource
|
||||
private IAuditFlowService service;
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* 新增人员判断
|
||||
*/
|
||||
@ApiOperation(value = "新增任务人员判断")
|
||||
@PostMapping("/checkLegal")
|
||||
public AjaxResult checkLegal(@RequestBody AuditFlow flow )
|
||||
{
|
||||
try {
|
||||
int rs = service.checkLegal(flow);
|
||||
if(rs>1){
|
||||
return new AjaxResult(200,"人员合法!");
|
||||
}else{
|
||||
return new AjaxResult(500,"人员不在范围内!");
|
||||
}
|
||||
|
||||
}catch (Exception e){
|
||||
return error("接口调用失败!");
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
|
@ -0,0 +1,37 @@
|
|||
package com.bonus.material.work.domain;
|
||||
|
||||
|
||||
import com.bonus.common.core.annotation.Excel;
|
||||
import com.bonus.material.ma.domain.DirectApplyInfo;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.Data;
|
||||
import lombok.ToString;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
@Data
|
||||
@ToString
|
||||
public class AuditFlow {
|
||||
|
||||
private String id;
|
||||
|
||||
private String flowType;
|
||||
|
||||
private String flowCode;
|
||||
|
||||
private String projectId;
|
||||
|
||||
private String userName;
|
||||
/** 工程负责人 */
|
||||
@ApiModelProperty(value = "工程负责人")
|
||||
private String projectHead;
|
||||
/** 项目经理 */
|
||||
@ApiModelProperty(value = "项目经理 ")
|
||||
private String projectLeader;
|
||||
/** 项目总工 */
|
||||
@ApiModelProperty(value = "项目总工 ")
|
||||
private String projectEngineer;
|
||||
/** 技术员 */
|
||||
@ApiModelProperty(value = "技术员 ")
|
||||
private String projectTech;
|
||||
}
|
||||
|
|
@ -0,0 +1,18 @@
|
|||
package com.bonus.material.work.mapper;
|
||||
|
||||
|
||||
import com.bonus.material.ma.domain.DirectApplyInfo;
|
||||
import com.bonus.material.work.domain.DirectAudit;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* @description 业务办理--审核任务
|
||||
* @author hay
|
||||
* @date 2025/2/17 13:18
|
||||
*/
|
||||
public interface AuditFlowMapper {
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
|
@ -0,0 +1,21 @@
|
|||
package com.bonus.material.work.service;
|
||||
|
||||
|
||||
import com.bonus.common.core.web.domain.AjaxResult;
|
||||
import com.bonus.material.ma.domain.DirectApplyInfo;
|
||||
import com.bonus.material.work.domain.AuditFlow;
|
||||
import com.bonus.material.work.domain.DirectAudit;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* @author hay
|
||||
* @description 业务办理--审核
|
||||
* @date 2025/2/17 13:15
|
||||
*/
|
||||
public interface IAuditFlowService {
|
||||
|
||||
|
||||
int checkLegal(AuditFlow flow);
|
||||
}
|
||||
|
||||
|
|
@ -0,0 +1,73 @@
|
|||
package com.bonus.material.work.service.impl;
|
||||
|
||||
|
||||
import com.bonus.material.work.domain.AuditFlow;
|
||||
import com.bonus.material.work.mapper.AuditFlowMapper;
|
||||
import com.bonus.material.work.service.IAuditFlowService;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
|
||||
/**
|
||||
* @author js
|
||||
* @description 业务办理--审核
|
||||
* @date 2025/2/17 13:16
|
||||
*/
|
||||
@Service
|
||||
@Slf4j
|
||||
public class AuditFlowImpl implements IAuditFlowService {
|
||||
|
||||
@Resource
|
||||
private AuditFlowMapper mapper;
|
||||
|
||||
|
||||
@Override
|
||||
public int checkLegal(AuditFlow flow) {
|
||||
log.info("开始查询人员信息");
|
||||
|
||||
// 假设 type 是 AuditFlow 类中的一个字段,表示业务类型
|
||||
String type = flow.getFlowType();
|
||||
|
||||
switch (type) {
|
||||
case "0001":
|
||||
// 执行 case1 领料的逻辑
|
||||
return handleCase1(flow);
|
||||
case "0002":
|
||||
// 执行 case2 直转的逻辑
|
||||
return handleCase2(flow);
|
||||
case "0003":
|
||||
// 执行 case3 减免的逻辑
|
||||
return handleCase3(flow);
|
||||
default:
|
||||
log.warn("未知的业务类型: {}", type);
|
||||
return -1; // 表示不支持的类型
|
||||
}
|
||||
}
|
||||
|
||||
// 处理 case1:领料
|
||||
private int handleCase1(AuditFlow flow) {
|
||||
// 领料的具体校验逻辑
|
||||
log.info("进入领料流程");
|
||||
// ...
|
||||
|
||||
return 1; // 示例返回值
|
||||
}
|
||||
|
||||
// 处理 case2:直转
|
||||
private int handleCase2(AuditFlow flow) {
|
||||
// 直转的具体校验逻辑
|
||||
log.info("进入直转流程");
|
||||
// ...
|
||||
return 2; // 示例返回值
|
||||
}
|
||||
|
||||
// 处理 case3:减免
|
||||
private int handleCase3(AuditFlow flow) {
|
||||
// 减免的具体校验逻辑
|
||||
log.info("进入减免流程");
|
||||
// ...
|
||||
return 3; // 示例返回值
|
||||
}
|
||||
|
||||
}
|
||||
|
|
@ -103,52 +103,5 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|||
</foreach>
|
||||
</delete>
|
||||
|
||||
<update id="updateTaskStatus">
|
||||
update tm_task set task_status = 1
|
||||
where task_id = #{taskId}
|
||||
</update>
|
||||
|
||||
<update id="updateStorageNum">
|
||||
update ma_type set storage_num = storage_num + #{inputNum}
|
||||
where id = #{typeId}
|
||||
</update>
|
||||
|
||||
<update id="updateInputNum">
|
||||
update repair_input_details set input_num = 1,audit_by = #{auditBy},status = 1,audit_time = now()
|
||||
where task_id = #{taskId} and ma_id = #{maId}
|
||||
</update>
|
||||
|
||||
<select id="selectInputInfoByMaId" resultMap="InputApplyDetailsResult">
|
||||
select id, task_id, ma_id, type_id, input_num, create_by, create_time, update_by, update_time, remark, company_id from repair_input_details
|
||||
where ma_id = #{maId}
|
||||
limit 1
|
||||
</select>
|
||||
|
||||
<select id="selectInputTaskStatus" resultMap="InputApplyDetailsResult">
|
||||
SELECT
|
||||
task_id,
|
||||
SUM(repair_num) - SUM(inputNum) as waitNum
|
||||
FROM
|
||||
(
|
||||
|
||||
SELECT
|
||||
id,
|
||||
task_id,
|
||||
ma_id,
|
||||
type_id,
|
||||
repair_num,
|
||||
IFNULL(input_num,0) as inputNum,
|
||||
create_by,
|
||||
create_time,
|
||||
update_by,
|
||||
update_time,
|
||||
remark,
|
||||
company_id
|
||||
FROM
|
||||
repair_input_details
|
||||
WHERE
|
||||
task_id =1432
|
||||
) res
|
||||
HAVING waitNum > 0
|
||||
</select>
|
||||
</mapper>
|
||||
|
|
|
|||
|
|
@ -504,7 +504,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|||
|
||||
|
||||
|
||||
<select id="selectMachineByQrCode" resultMap="MachineResult">
|
||||
<select id="selectMachineByQrCode" resultType="com.bonus.material.ma.domain.Machine">
|
||||
SELECT
|
||||
mm.ma_id as maId,
|
||||
mm.ma_code as maCode,
|
||||
|
|
|
|||
|
|
@ -273,7 +273,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|||
#{item.remark,jdbcType=VARCHAR}, #{item.companyId,jdbcType=INTEGER})
|
||||
</foreach>
|
||||
</insert>
|
||||
|
||||
|
||||
<insert id="insertRepairInputDetails" parameterType="com.bonus.common.biz.domain.repair.RepairInputDetails" useGeneratedKeys="true" keyProperty="id">
|
||||
insert into repair_input_details
|
||||
<trim prefix="(" suffix=")" suffixOverrides=",">
|
||||
|
|
@ -407,9 +407,70 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|||
</delete>
|
||||
|
||||
<delete id="deleteRepairInputDetailsByIds" parameterType="String">
|
||||
delete from repair_input_details where id in
|
||||
delete from repair_input_details where id in
|
||||
<foreach item="id" collection="array" open="(" separator="," close=")">
|
||||
#{id}
|
||||
</foreach>
|
||||
</delete>
|
||||
</mapper>
|
||||
|
||||
<select id="selectInputInfoByMaId" resultMap="RepairInputDetailsResult">
|
||||
select id, task_id, ma_id, type_id, input_num, create_by, create_time, update_by, update_time, remark, company_id from repair_input_details
|
||||
where ma_id = #{maId}
|
||||
limit 1
|
||||
</select>
|
||||
|
||||
<update id="updateInputNum">
|
||||
update repair_input_details set input_num = 1,audit_by = #{auditBy},status = 1,audit_time = now()
|
||||
where task_id = #{taskId} and ma_id = #{maId}
|
||||
</update>
|
||||
|
||||
<update id="updateStorageNum">
|
||||
update ma_type set storage_num = storage_num + #{inputNum}
|
||||
where type_id = #{typeId}
|
||||
</update>
|
||||
|
||||
<update id="updateTaskStatus">
|
||||
update tm_task set task_status = 1
|
||||
where task_id = #{taskId}
|
||||
</update>
|
||||
|
||||
<select id="selectInputTaskStatus" resultMap="RepairInputDetailsResult">
|
||||
|
||||
SELECT
|
||||
task_id,
|
||||
SUM(repair_num) - SUM(inputNum) as waitNum
|
||||
FROM
|
||||
(
|
||||
|
||||
SELECT
|
||||
id,
|
||||
task_id,
|
||||
ma_id,
|
||||
type_id,
|
||||
repair_num,
|
||||
IFNULL(input_num,0) as inputNum,
|
||||
create_by,
|
||||
create_time,
|
||||
update_by,
|
||||
update_time,
|
||||
remark,
|
||||
company_id
|
||||
FROM
|
||||
repair_input_details
|
||||
WHERE
|
||||
task_id =#{taskId}
|
||||
) res
|
||||
HAVING waitNum > 0
|
||||
|
||||
</select>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
</mapper>
|
||||
|
|
|
|||
Loading…
Reference in New Issue