Commit 27019d57 authored by 李驰骋's avatar 李驰骋

报工调整

parent 48aee805
......@@ -302,21 +302,12 @@ public class ProFeedback extends BaseEntity {
@TableField(exist = false)
private String printContents;
@ApiModelProperty("小包装数量")
@TableField(exist = false)
private Integer minPackageNum;
@ApiModelProperty("指令报工数据")
@TableField(exist = false)
private List<ProWorkOrderSoDirectiveReport> directiveReportData;
@ApiModelProperty("SIZE报工数据")
@TableField(exist = false)
private List<ProWorkOrderSoSizeItemReport> sizeReportData;
@ApiModelProperty("包装标签二维码")
@ApiModelProperty("标签二维码")
private String qrcode;
@ApiModelProperty("Decompression")
private String decompressionValue;
private String sapRequestParam;
private String sapResponse;
......
......@@ -39,6 +39,9 @@ public class ProProcess extends BaseEntity
@ApiModelProperty("是否包装工序,1:是,0:否")
private String isPackage;
@ApiModelProperty("是否序列号报工,1:是,0:否")
private Integer isSerialReport;
private String isExistTool;
/** 预留字段1 */
private String attr1;
......
......@@ -293,6 +293,10 @@ public class ProTask extends BaseEntity {
@TableField(exist = false)
private String isPackage;
@ApiModelProperty("是否序列号报工")
@TableField(exist = false)
private String isSerialReport;
@TableField(exist = false)
private String statusName;
@TableField(exist = false)
......
......@@ -159,7 +159,7 @@ public interface ProTaskMapper extends BaseMapper<ProTask> {
"\t, t.duration, ptw.schedule_end_date, t.color_code, t.request_date, t.remark\n" +
"\t, t.attr1, t.attr2, t.attr3, t.attr4, t.create_by\n" +
"\t, t.create_time, t.update_by, t.update_time, ptw.STATUS,ptw.task_type, ptw.quantity_qualify\n" +
"\t, ptw.quantity_unqualify, mw.workunit_id, mw.workunit_code, mw.workunit_name, t.arrange_code, proc.is_package\n" +
"\t, ptw.quantity_unqualify, mw.workunit_id, mw.workunit_code, mw.workunit_name, t.arrange_code, proc.is_package, proc.is_serial_report\n" +
"\t, (case ptw.STATUS when 'BEGINNING' then 1 when 'PAUSE' then 2 when 'ERROR_STOP' then 3 when 'PREPARE' then 4 end) statusIndex \n" +
"from pro_task t\n" +
"\tleft join pro_task_workunit ptw on ptw.task_id = t.task_id\n" +
......
......@@ -1859,28 +1859,7 @@ public class ProTaskServiceImpl implements IProTaskService {
query.in("t.task_id", taskVoList.stream().map(ProTaskVo::getTaskId).collect(Collectors.toList()));
}
}
//判断是否前端有没传来工单或者是编码
if (StringUtils.isNotEmpty(proTaskQuery.getArrangeCode())) {
QueryWrapper<ProTask> queryWrapper = new QueryWrapper<>();
queryWrapper.in("ptw.status", statusList);
queryWrapper.eq(proTask.getWorkunitId() != null, "mw.workunit_id", proTask.getWorkunitId());
queryWrapper.gt(proTask.getAllowProduce() != null && proTask.getAllowProduce() == 1, "t.quantity_wait", 0);
queryWrapper.orderByAsc("statusIndex").orderByAsc("ptw.schedule_start_date");
List<ProTask> proTasks = this.selectProTaskJoinTaskWorkUnit(queryWrapper);
List<ProTask> proTasks1 = this.selectProTaskJoinTaskWorkUnit(query);
for (ProTask task : proTasks1) {
for (ProTask task1 : proTasks) {
if (task.getTaskId().equals(task1.getTaskId())) {
task1.setLocation(1L);
}
}
}
list.addAll(proTasks);
} else {
list = this.selectProTaskJoinTaskWorkUnit(query);
}
list = this.selectProTaskJoinTaskWorkUnit(query);
rst = list.stream().filter(t -> !TaskStatusEnum.FINISHED.getStatus().equals(t.getStatus())).collect(Collectors.toList());
if (CollectionUtil.isNotEmpty(rst)) {
......
......@@ -3,6 +3,7 @@ package com.ximai.mes.pro.service.impl.task;
import cn.hutool.core.bean.BeanUtil;
import cn.hutool.core.collection.CollUtil;
import cn.hutool.core.collection.CollectionUtil;
import cn.hutool.core.util.NumberUtil;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.ximai.common.core.domain.BaseEntity;
import com.ximai.common.core.domain.entity.SysUser;
......@@ -440,6 +441,10 @@ public class ProTaskWorkunitServiceImpl implements IProTaskWorkunitService {
ProTaskWorkunit taskWorkunit = this.selectProTaskWorkunitByTaskWorkunitId(outsourceSplitParam.getTaskWorkunitId());
ProTaskWorkunit newTaskWorkunit = BeanUtil.copyProperties(taskWorkunit, ProTaskWorkunit.class);
newTaskWorkunit.setQuantity(outsourceSplitParam.getSplitQuantity());
newTaskWorkunit.setQuantityQualify(BigDecimal.ZERO);
newTaskWorkunit.setQuantityUnqualify(BigDecimal.ZERO);
newTaskWorkunit.setQuantityProduced(BigDecimal.ZERO);
newTaskWorkunit.setQuantityChanged(BigDecimal.ZERO);
BeanUtil.copyProperties(outsourceSplitParam, newTaskWorkunit);
this.insertProTaskWorkunit(newTaskWorkunit);
//原数量扣减
......@@ -456,11 +461,19 @@ public class ProTaskWorkunitServiceImpl implements IProTaskWorkunitService {
ProTaskWorkunit newTaskWorkunit = BeanUtil.copyProperties(taskWorkunit, ProTaskWorkunit.class);
newTaskWorkunit.setWorkunitId(IMdWorkunitService.OUTSOURCE_WORKUNIT_ID);
newTaskWorkunit.setQuantity(toOutsourceParam.getToOutsourceQuantity());
newTaskWorkunit.setQuantityQualify(BigDecimal.ZERO);
newTaskWorkunit.setQuantityUnqualify(BigDecimal.ZERO);
newTaskWorkunit.setQuantityProduced(BigDecimal.ZERO);
newTaskWorkunit.setQuantityChanged(BigDecimal.ZERO);
BeanUtil.copyProperties(toOutsourceParam, newTaskWorkunit);
this.insertProTaskWorkunit(newTaskWorkunit);
//原数量扣减
taskWorkunit.setQuantity(taskWorkunit.getQuantity().subtract(toOutsourceParam.getToOutsourceQuantity()));
this.updateProTaskWorkunit(taskWorkunit);
//待加工数量扣减
ProTask proTask = proTaskService.selectProTaskByTaskId(taskWorkunit.getTaskId());
proTask.setQuantityWait(NumberUtil.max(proTask.getQuantityWait().subtract(toOutsourceParam.getToOutsourceQuantity()),BigDecimal.ZERO));
proTaskService.updateProTask(proTask);
});
}
......
......@@ -47,6 +47,7 @@
<result property="recordUser" column="record_user"/>
<result property="recordNick" column="record_nick"/>
<result property="status" column="status"/>
<result property="decompressionValue" column="decompression_value"/>
<result property="remark" column="remark"/>
<result property="qrcode" column="qrcode"/>
<result property="attr1" column="attr1"/>
......@@ -96,6 +97,7 @@
f.record_user,
f.record_nick,
f.status,
f.decompression_value,
f.remark,
f.attr1,
f.attr2,
......@@ -207,6 +209,7 @@
<if test="workorderSoSizes != null">workorder_so_sizes,</if>
<if test="netWeight != null">net_weight,</if>
<if test="quantityStorage != null">quantity_storage,</if>
<if test="decompressionValue != null">decompression_value,</if>
<if test="remark != null">remark,</if>
<if test="machineTime != null">machine_time,</if>
<if test="qrcode != null">qrcode,</if>
......@@ -261,6 +264,7 @@
<if test="workorderSoSizes != null">#{workorderSoSizes},</if>
<if test="netWeight != null">#{netWeight},</if>
<if test="quantityStorage != null">#{quantityStorage},</if>
<if test="decompressionValue != null">#{decompressionValue},</if>
<if test="remark != null">#{remark},</if>
<if test="machineTime != null">#{machineTime},</if>
<if test="qrcode != null">#{qrcode},</if>
......@@ -317,6 +321,7 @@
<if test="workorderSoSizeItemId != null">workorder_so_size_item_id = #{workorderSoSizeItemId},</if>
<if test="netWeight != null">net_weight = #{netWeight},</if>
<if test="quantityStorage != null">quantity_storage = #{quantityStorage},</if>
<if test="decompressionValue != null">decompression_value = #{decompressionValue},</if>
<if test="remark != null">remark = #{remark},</if>
<if test="machineTime != null">machine_time = #{machineTime},</if>
<if test="qrcode != null">qrcode = #{qrcode},</if>
......
......@@ -11,6 +11,7 @@
<result property="attention" column="attention"/>
<result property="enableFlag" column="enable_flag"/>
<result property="isPackage" column="is_package"/>
<result property="isSerialReport" column="is_serial_report"/>
<result property="remark" column="remark"/>
<result property="attr1" column="attr1"/>
<result property="attr2" column="attr2"/>
......@@ -78,6 +79,7 @@
<if test="attention != null">attention,</if>
<if test="enableFlag != null and enableFlag != ''">enable_flag,</if>
<if test="isPackage != null">is_package,</if>
<if test="isSerialReport != null">is_serial_report,</if>
<if test="remark != null">remark,</if>
<if test="attr1 != null">attr1,</if>
<if test="attr2 != null">attr2,</if>
......@@ -95,6 +97,7 @@
<if test="attention != null">#{attention},</if>
<if test="enableFlag != null and enableFlag != ''">#{enableFlag},</if>
<if test="isPackage != null">#{isPackage},</if>
<if test="isSerialReport != null">#{isSerialReport},</if>
<if test="remark != null">#{remark},</if>
<if test="attr1 != null">#{attr1},</if>
<if test="attr2 != null">#{attr2},</if>
......@@ -118,6 +121,7 @@
<if test="isExistTool != null">is_exist_tool = #{isExistTool},</if>
<if test="enableFlag != null and enableFlag != ''">enable_flag = #{enableFlag},</if>
<if test="isPackage != null">is_package = #{isPackage},</if>
<if test="isSerialReport != null">is_serial_report = #{isSerialReport},</if>
<if test="remark != null">remark = #{remark},</if>
<if test="attr1 != null">attr1 = #{attr1},</if>
<if test="attr2 != null">attr2 = #{attr2},</if>
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment