修改任务开始条件

This commit is contained in:
liuhanqing
2025-07-23 11:05:05 +08:00
parent 597bb18b97
commit 302cddef41
9 changed files with 87 additions and 37 deletions

View File

@@ -36,6 +36,18 @@ public class ToWmsApiController {
return ajaxResult;
}
/**
* 接收开始信号
*/
@PostMapping("/startSignal")
public AjaxResult startSignal(@RequestBody MydoJob mydoJob) {
AjaxResult ajaxResult = toWmsService.startSignal(mydoJob);
RequestLog requestLog = requestLogService.getRequestLog(JSONUtil.toJsonStr(mydoJob), "startSignal");
requestLog.setResponseBody(Convert.toStr(ajaxResult.get("msg")));
requestLogService.insertRequestLog(requestLog);
return ajaxResult;
}
/**
* 入库、出库 任务完成回传
* Map<String, String>

View File

@@ -20,4 +20,6 @@ public interface IToWmsService {
AjaxResult reMaterial(MydoJob mydoJob);
AjaxResult getJob(MydoJob mydoJob);
AjaxResult startSignal(MydoJob mydoJob);
}

View File

@@ -56,8 +56,8 @@ public class ToWcsServiceImpl implements IToWcsService {
for (MydoJob outMydoJob : outMydoJobs) {
RequestLog requestLog = requestLogService.getRequestLog(PUSH_OUT_MYDO_JOB, JSONUtil.toJsonStr(outMydoJob), "推送出库任务");
if ("1".equals(requestLog.getIsSuccessful())){
outMydoJob.setStatus("3");
outMydoJob.setStartTime(DateUtil.formatDateTime(DateUtil.date()));
outMydoJob.setStatus("2");
//outMydoJob.setStartTime(DateUtil.formatDateTime(DateUtil.date()));
mydoJobService.updateMydoJob(outMydoJob);
}
}

View File

@@ -84,8 +84,7 @@ public class ToWmsServiceImpl implements IToWmsService {
if ("1".equals(mydoJob.getExecutionPhase())){
mydoJob.setExecutionPhase("2");
mydoJob.setEntranceId(param.getEntranceId());
mydoJob.setStatus("3");
mydoJob.setStartTime(DateUtil.formatDateTime(DateUtil.date()));
mydoJob.setStatus("2");
mydoJobService.updateMydoJob(mydoJob);
}
return AjaxResult.success(mydoJob);
@@ -222,4 +221,21 @@ public class ToWmsServiceImpl implements IToWmsService {
return AjaxResult.success(mydoJobs);
}
}
@Override
public AjaxResult startSignal(MydoJob mydoJob) {
MydoJob mydoJobParam = new MydoJob();
mydoJobParam.setTaskNo(mydoJob.getTaskNo());
List<MydoJob> mydoJobs = mydoJobService.selectMydoJobListApi(mydoJobParam);
if (mydoJobs.isEmpty()){
return AjaxResult.error("没有该作业");
}else {
for (MydoJob mydoJob1 : mydoJobs) {
mydoJob1.setStatus("3");
mydoJob1.setStartTime(DateUtil.formatDateTime(DateUtil.date()));
mydoJobService.updateMydoJob(mydoJob1);
}
return AjaxResult.success("开始作业成功");
}
}
}

View File

@@ -5,15 +5,15 @@ import com.ruoyi.job.mydojobdetail.domain.MydoJobDetail;
/**
* 子任务Service接口
*
*
* @author ruoyi
* @date 2025-05-22
*/
public interface IMydoJobDetailService
public interface IMydoJobDetailService
{
/**
* 查询子任务
*
*
* @param jobDetailId 子任务主键
* @return 子任务
*/
@@ -21,7 +21,7 @@ public interface IMydoJobDetailService
/**
* 查询子任务列表
*
*
* @param mydoJobDetail 子任务
* @return 子任务集合
*/
@@ -29,7 +29,7 @@ public interface IMydoJobDetailService
/**
* 新增子任务
*
*
* @param mydoJobDetail 子任务
* @return 结果
*/
@@ -37,7 +37,7 @@ public interface IMydoJobDetailService
/**
* 修改子任务
*
*
* @param mydoJobDetail 子任务
* @return 结果
*/
@@ -45,7 +45,7 @@ public interface IMydoJobDetailService
/**
* 批量删除子任务
*
*
* @param jobDetailIds 需要删除的子任务主键集合
* @return 结果
*/
@@ -53,7 +53,7 @@ public interface IMydoJobDetailService
/**
* 删除子任务信息
*
*
* @param jobDetailId 子任务主键
* @return 结果
*/

View File

@@ -29,34 +29,53 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
</resultMap>
<sql id="selectCheckStockinVo">
select stock_guid, stock_check_id, check_type, create_date, create_man_id, status, cs.warehouse_id, finish_date, erp_bill, stock_source, department_no, customer_no, class_no, supplier_no, spare1, spare2, spare3, spare4, spare5 ,
bw.warehouse_name, sd.dept_name as department_name
select cs.stock_guid,
cs.stock_check_id,
cs.check_type,
cs.create_date,
cs.create_man_id,
cs.status,
cs.warehouse_id,
cs.finish_date,
cs.erp_bill,
cs.stock_source,
cs.department_no,
cs.customer_no,
cs.class_no,
cs.supplier_no,
cs.spare1,
cs.spare2,
cs.spare3,
cs.spare4,
cs.spare5,
bw.warehouse_name,
sd.dept_name as department_name
from check_stockin cs
left join bas_warehouse bw on cs.warehouse_id = bw.warehouse_id
left join sys_dept sd on cs.department_no = sd.dept_id
left join bas_warehouse bw on cs.warehouse_id = bw.warehouse_id
left join sys_dept sd on cs.department_no = sd.dept_id
</sql>
<select id="selectCheckStockinList" parameterType="CheckStockin" resultMap="CheckStockinResult">
<include refid="selectCheckStockinVo"/>
<where>
<if test="stockCheckId != null and stockCheckId != ''"> and stock_check_id = #{stockCheckId}</if>
<if test="checkType != null and checkType != ''"> and check_type = #{checkType}</if>
<if test="createDate != null and createDate != ''"> and create_date = #{createDate}</if>
<if test="createManId != null and createManId != ''"> and create_man_id = #{createManId}</if>
<if test="status != null and status != ''"> and status = #{status}</if>
<if test="stockCheckId != null and stockCheckId != ''"> and cs.stock_check_id = #{stockCheckId}</if>
<if test="checkType != null and checkType != ''"> and cs.check_type = #{checkType}</if>
<if test="createDate != null and createDate != ''"> and cs.create_date = #{createDate}</if>
<if test="createManId != null and createManId != ''"> and cs.create_man_id = #{createManId}</if>
<if test="status != null and status != ''"> and cs.status = #{status}</if>
<if test="warehouseId != null and warehouseId != ''"> and cs.warehouse_id = #{warehouseId}</if>
<if test="finishDate != null and finishDate != ''"> and finish_date = #{finishDate}</if>
<if test="erpBill != null and erpBill != ''"> and erp_bill = #{erpBill}</if>
<if test="stockSource != null and stockSource != ''"> and stock_source = #{stockSource}</if>
<if test="departmentNo != null and departmentNo != ''"> and department_no = #{departmentNo}</if>
<if test="customerNo != null and customerNo != ''"> and customer_no = #{customerNo}</if>
<if test="classNo != null and classNo != ''"> and class_no = #{classNo}</if>
<if test="supplierNo != null and supplierNo != ''"> and supplier_no = #{supplierNo}</if>
<if test="spare1 != null and spare1 != ''"> and spare1 = #{spare1}</if>
<if test="spare2 != null and spare2 != ''"> and spare2 = #{spare2}</if>
<if test="spare3 != null and spare3 != ''"> and spare3 = #{spare3}</if>
<if test="spare4 != null and spare4 != ''"> and spare4 = #{spare4}</if>
<if test="spare5 != null and spare5 != ''"> and spare5 = #{spare5}</if>
<if test="finishDate != null and finishDate != ''"> and cs.finish_date = #{finishDate}</if>
<if test="erpBill != null and erpBill != ''"> and cs.erp_bill = #{erpBill}</if>
<if test="stockSource != null and stockSource != ''"> and cs.stock_source = #{stockSource}</if>
<if test="departmentNo != null and departmentNo != ''"> and cs.department_no = #{departmentNo}</if>
<if test="customerNo != null and customerNo != ''"> and cs.customer_no = #{customerNo}</if>
<if test="classNo != null and classNo != ''"> and cs.class_no = #{classNo}</if>
<if test="supplierNo != null and supplierNo != ''"> and cs.supplier_no = #{supplierNo}</if>
<if test="spare1 != null and spare1 != ''"> and cs.spare1 = #{spare1}</if>
<if test="spare2 != null and spare2 != ''"> and cs.spare2 = #{spare2}</if>
<if test="spare3 != null and spare3 != ''"> and cs.spare3 = #{spare3}</if>
<if test="spare4 != null and spare4 != ''"> and cs.spare4 = #{spare4}</if>
<if test="spare5 != null and spare5 != ''"> and cs.spare5 = #{spare5}</if>
</where>
</select>