Merge remote-tracking branch 'origin/master'

This commit is contained in:
sxu 2024-11-13 16:48:07 +08:00
commit 77af9c7fe0
6 changed files with 69 additions and 13 deletions

View File

@ -14,7 +14,9 @@ public enum PurchaseTaskStatusEnum {
IN_STORE(19, "已入库"),
TASK_TO_START(20, "入库待开始"),
TASK_IN_PROGRESS(21, "入库进行中"),
TASK_FINISHED(22, "入库已完成");
TASK_FINISHED(22, "入库已完成"),
LEASE_TASK_NO_PUBLISHED(0, "领料任务--未发布"),
LEASE_TASK_PUBLISHED(1, "领料任务--已发布");
private final Integer status;
private final String statusName;

View File

@ -101,6 +101,18 @@ public class LeaseApplyInfoController extends BaseController {
}
}
/**
* 领料任务发布
*/
@ApiOperation(value = "领料任务发布")
@PreventRepeatSubmit
@SysLog(title = "领料任务发布", businessType = OperaType.UPDATE, logType = 1,module = "仓储管理->发布领料任务")
@PostMapping("/publish")
public AjaxResult publish(@RequestBody @NotNull(message = "任务信息不能为空") LeaseApplyInfo leaseApplyInfo) {
return leaseApplyInfoService.publish(leaseApplyInfo);
}
/**
* 删除领料任务
*/

View File

@ -16,7 +16,7 @@ public interface LeaseApplyInfoMapper {
* @param id 领料任务主键
* @return 领料任务
*/
public LeaseApplyInfo selectLeaseApplyInfoById(Long id);
LeaseApplyInfo selectLeaseApplyInfoById(Long id);
/**
* 查询领料任务列表
@ -24,7 +24,7 @@ public interface LeaseApplyInfoMapper {
* @param leaseApplyInfo 领料任务
* @return 领料任务集合
*/
public List<LeaseApplyInfo> selectLeaseApplyInfoList(LeaseApplyInfo leaseApplyInfo);
List<LeaseApplyInfo> selectLeaseApplyInfoList(LeaseApplyInfo leaseApplyInfo);
/**
* 新增领料任务
@ -32,7 +32,7 @@ public interface LeaseApplyInfoMapper {
* @param leaseApplyInfo 领料任务
* @return 结果
*/
public int insertLeaseApplyInfo(LeaseApplyInfo leaseApplyInfo);
int insertLeaseApplyInfo(LeaseApplyInfo leaseApplyInfo);
/**
* 修改领料任务
@ -40,7 +40,7 @@ public interface LeaseApplyInfoMapper {
* @param leaseApplyInfo 领料任务
* @return 结果
*/
public int updateLeaseApplyInfo(LeaseApplyInfo leaseApplyInfo);
int updateLeaseApplyInfo(LeaseApplyInfo leaseApplyInfo);
/**
* 删除领料任务
@ -48,7 +48,7 @@ public interface LeaseApplyInfoMapper {
* @param id 领料任务主键
* @return 结果
*/
public int deleteLeaseApplyInfoById(Long id);
int deleteLeaseApplyInfoById(Long id);
/**
* 批量删除领料任务
@ -56,5 +56,5 @@ public interface LeaseApplyInfoMapper {
* @param ids 需要删除的数据主键集合
* @return 结果
*/
public int deleteLeaseApplyInfoByIds(Long[] ids);
int deleteLeaseApplyInfoByIds(Long[] ids);
}

View File

@ -38,6 +38,11 @@ public interface ILeaseApplyInfoService {
*/
AjaxResult insertLeaseApplyInfo(TmTaskRequestVo leaseApplyRequestVo);
/**
* 发布任务
*/
AjaxResult publish(LeaseApplyInfo leaseApplyInfo);
/**
* 修改领料任务
*

View File

@ -18,7 +18,7 @@ public interface ILeaseOutDetailsService {
* @param id 领料出库详细主键
* @return 领料出库详细
*/
public LeaseOutDetails selectLeaseOutDetailsById(Long id);
LeaseOutDetails selectLeaseOutDetailsById(Long id);
/**
* 查询领料出库详细列表
@ -26,7 +26,7 @@ public interface ILeaseOutDetailsService {
* @param leaseOutDetails 领料出库详细
* @return 领料出库详细集合
*/
public List<LeaseOutDetails> selectLeaseOutDetailsList(LeaseOutDetails leaseOutDetails);
List<LeaseOutDetails> selectLeaseOutDetailsList(LeaseOutDetails leaseOutDetails);
/**
* 新增领料出库详细
@ -34,7 +34,7 @@ public interface ILeaseOutDetailsService {
* @param leaseOutDetailsList 领料出库详细
* @return 结果
*/
public AjaxResult insertLeaseOutDetails(List<LeaseOutDetails> leaseOutDetailsList);
AjaxResult insertLeaseOutDetails(List<LeaseOutDetails> leaseOutDetailsList);
/**
* 修改领料出库详细
@ -42,7 +42,7 @@ public interface ILeaseOutDetailsService {
* @param leaseOutDetails 领料出库详细
* @return 结果
*/
public int updateLeaseOutDetails(LeaseOutDetails leaseOutDetails);
int updateLeaseOutDetails(LeaseOutDetails leaseOutDetails);
/**
* 批量删除领料出库详细
@ -50,7 +50,7 @@ public interface ILeaseOutDetailsService {
* @param ids 需要删除的领料出库详细主键集合
* @return 结果
*/
public int deleteLeaseOutDetailsByIds(Long[] ids);
int deleteLeaseOutDetailsByIds(Long[] ids);
/**
* 删除领料出库详细信息
@ -58,5 +58,5 @@ public interface ILeaseOutDetailsService {
* @param id 领料出库详细主键
* @return 结果
*/
public int deleteLeaseOutDetailsById(Long id);
int deleteLeaseOutDetailsById(Long id);
}

View File

@ -24,6 +24,7 @@ import org.springframework.stereotype.Service;
import com.bonus.material.lease.mapper.LeaseApplyInfoMapper;
import com.bonus.material.lease.domain.LeaseApplyInfo;
import com.bonus.material.lease.service.ILeaseApplyInfoService;
import org.springframework.transaction.annotation.Transactional;
import org.springframework.util.CollectionUtils;
import javax.annotation.Resource;
@ -134,6 +135,42 @@ public class LeaseApplyInfoServiceImpl implements ILeaseApplyInfoService {
}
}
/**
* 发布任务
*
* @param leaseApplyInfo 领料任务info
*/
@Override
@Transactional
public AjaxResult publish(LeaseApplyInfo leaseApplyInfo) {
if (leaseApplyInfo.getId() == null) {
return AjaxResult.error("ID为空,请完善后重新发布!");
}
if (leaseApplyInfo.getTaskId() == null) {
return AjaxResult.error("任务ID为空,请完善后重新发布!");
}
leaseApplyInfo.setUpdateTime(DateUtils.getNowDate());
leaseApplyInfo.setStatus(String.valueOf(PurchaseTaskStatusEnum.LEASE_TASK_PUBLISHED.getStatus()));
try {
int result = leaseApplyInfoMapper.updateLeaseApplyInfo(leaseApplyInfo);
if (result > 0) {
// 同步修改tm_task任务状态
TmTask tmTask = new TmTask();
tmTask.setTaskId(leaseApplyInfo.getTaskId());
tmTask.setStatus(String.valueOf(PurchaseTaskStatusEnum.LEASE_TASK_PUBLISHED.getStatus()));
tmTaskMapper.updateTmTask(tmTask);
return AjaxResult.success("发布成功");
}
return AjaxResult.error("发布失败");
} catch (DataAccessException e) {
// 抛出异常回滚数据
throw new RuntimeException();
} catch (Exception e) {
return AjaxResult.error("发布失败:" + e.getMessage());
}
}
private AjaxResult insertPurchaseCheckDetails(List<LeaseApplyDetails> leaseApplyDetailsList, Long taskId) {
if (!CollectionUtils.isEmpty(leaseApplyDetailsList)) {
for (LeaseApplyDetails details : leaseApplyDetailsList) {