触控屏端生产状态切换

This commit is contained in:
JinLu.Yin 2022-07-09 22:24:35 +08:00
parent f1ceb86a50
commit 5f8c246bf2
5 changed files with 73 additions and 46 deletions

View File

@ -228,6 +228,7 @@ create table pro_task (
end_time datetime comment '完成生产时间', end_time datetime comment '完成生产时间',
color_code char(7) default '#00AEF3' comment '甘特图显示颜色', color_code char(7) default '#00AEF3' comment '甘特图显示颜色',
request_date datetime comment '需求日期', request_date datetime comment '需求日期',
stauts varchar(64) default 'NORMARL' comment '生产状态',
remark varchar(500) default '' comment '备注', remark varchar(500) default '' comment '备注',
attr1 varchar(64) default null comment '预留字段1', attr1 varchar(64) default null comment '预留字段1',
attr2 varchar(255) default null comment '预留字段2', attr2 varchar(255) default null comment '预留字段2',

View File

@ -1,15 +1,14 @@
package com.ktg.mes.pro.controller; package com.ktg.mes.pro.controller;
import com.ktg.common.annotation.Log;
import com.ktg.common.core.controller.BaseController; import com.ktg.common.core.controller.BaseController;
import com.ktg.common.core.domain.AjaxResult; import com.ktg.common.core.domain.AjaxResult;
import com.ktg.common.enums.BusinessType;
import com.ktg.mes.pro.domain.ProTask; import com.ktg.mes.pro.domain.ProTask;
import com.ktg.mes.pro.service.IProTaskService; import com.ktg.mes.pro.service.IProTaskService;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.security.access.prepost.PreAuthorize; import org.springframework.security.access.prepost.PreAuthorize;
import org.springframework.web.bind.annotation.GetMapping; import org.springframework.web.bind.annotation.*;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import java.util.List; import java.util.List;
@ -40,4 +39,19 @@ public class ProTaskMobController extends BaseController {
{ {
return AjaxResult.success(proTaskService.selectProTaskByTaskId(taskId)); return AjaxResult.success(proTaskService.selectProTaskByTaskId(taskId));
} }
/**
* 修改生产任务状态
*/
@PreAuthorize("@ss.hasPermi('mes:pro:protask:edit')")
@Log(title = "生产任务", businessType = BusinessType.UPDATE)
@PostMapping
@ResponseBody
public AjaxResult edit(@RequestBody ProTask proTask)
{
return toAjax(proTaskService.updateProTask(proTask));
}
} }

View File

@ -136,6 +136,8 @@ public class ProTask extends BaseEntity
@Excel(name = "需求日期", width = 30, dateFormat = "yyyy-MM-dd") @Excel(name = "需求日期", width = 30, dateFormat = "yyyy-MM-dd")
private Date requestDate; private Date requestDate;
private String status;
/** 预留字段1 */ /** 预留字段1 */
private String attr1; private String attr1;
@ -409,7 +411,16 @@ public class ProTask extends BaseEntity
{ {
return requestDate; return requestDate;
} }
public void setAttr1(String attr1)
public String getStatus() {
return status;
}
public void setStatus(String status) {
this.status = status;
}
public void setAttr1(String attr1)
{ {
this.attr1 = attr1; this.attr1 = attr1;
} }
@ -448,45 +459,41 @@ public class ProTask extends BaseEntity
@Override @Override
public String toString() { public String toString() {
return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE) return "ProTask{" +
.append("taskId", getTaskId()) "taskId=" + taskId +
.append("taskCode", getTaskCode()) ", taskCode='" + taskCode + '\'' +
.append("taskName", getTaskName()) ", taskName='" + taskName + '\'' +
.append("workorderId", getWorkorderId()) ", workorderId=" + workorderId +
.append("workorderCode", getWorkorderCode()) ", workorderCode='" + workorderCode + '\'' +
.append("workorderName", getWorkorderName()) ", workorderName='" + workorderName + '\'' +
.append("workstationId", getWorkstationId()) ", workstationId=" + workstationId +
.append("workstationCode", getWorkstationCode()) ", workstationCode='" + workstationCode + '\'' +
.append("workstationName", getWorkstationName()) ", workstationName='" + workstationName + '\'' +
.append("processId", getProcessId()) ", processId=" + processId +
.append("processCode", getProcessCode()) ", processCode='" + processCode + '\'' +
.append("processName", getProcessName()) ", processName='" + processName + '\'' +
.append("itemId", getItemId()) ", itemId=" + itemId +
.append("itemCode", getItemCode()) ", itemCode='" + itemCode + '\'' +
.append("itemName", getItemName()) ", itemName='" + itemName + '\'' +
.append("specification", getSpecification()) ", specification='" + specification + '\'' +
.append("unitOfMeasure", getUnitOfMeasure()) ", unitOfMeasure='" + unitOfMeasure + '\'' +
.append("quantity", getQuantity()) ", quantity=" + quantity +
.append("quantityProduced", getQuantityProduced()) ", quantityProduced=" + quantityProduced +
.append("quantityChanged", getQuantityChanged()) ", quantityChanged=" + quantityChanged +
.append("clientId", getClientId()) ", clientId=" + clientId +
.append("clientCode", getClientCode()) ", clientCode='" + clientCode + '\'' +
.append("clientName", getClientName()) ", clientName='" + clientName + '\'' +
.append("clientNick", getClientNick()) ", clientNick='" + clientNick + '\'' +
.append("startTime", getStartTime()) ", startTime=" + startTime +
.append("duration", getDuration()) ", duration=" + duration +
.append("endTime", getEndTime()) ", endTime=" + endTime +
.append("colorCode", getColorCode()) ", colorCode='" + colorCode + '\'' +
.append("requestDate", getRequestDate()) ", requestDate=" + requestDate +
.append("remark", getRemark()) ", status='" + status + '\'' +
.append("attr1", getAttr1()) ", attr1='" + attr1 + '\'' +
.append("attr2", getAttr2()) ", attr2='" + attr2 + '\'' +
.append("attr3", getAttr3()) ", attr3=" + attr3 +
.append("attr4", getAttr4()) ", attr4=" + attr4 +
.append("createBy", getCreateBy()) '}';
.append("createTime", getCreateTime())
.append("updateBy", getUpdateBy())
.append("updateTime", getUpdateTime())
.toString();
} }
} }

View File

@ -34,6 +34,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<result property="endTime" column="end_time" /> <result property="endTime" column="end_time" />
<result property="colorCode" column="color_code" /> <result property="colorCode" column="color_code" />
<result property="requestDate" column="request_date" /> <result property="requestDate" column="request_date" />
<result property="status" column="status" />
<result property="remark" column="remark" /> <result property="remark" column="remark" />
<result property="attr1" column="attr1" /> <result property="attr1" column="attr1" />
<result property="attr2" column="attr2" /> <result property="attr2" column="attr2" />
@ -46,7 +47,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
</resultMap> </resultMap>
<sql id="selectProTaskVo"> <sql id="selectProTaskVo">
select task_id, task_code, task_name, workorder_id, workorder_code, workorder_name, workstation_id, workstation_code, workstation_name,process_id,process_code,process_name, item_id, item_code, item_name, specification, unit_of_measure, quantity, quantity_produced, quantity_changed, client_id, client_code, client_name, client_nick, start_time, duration, end_time, color_code, request_date, remark, attr1, attr2, attr3, attr4, create_by, create_time, update_by, update_time from pro_task select task_id, task_code, task_name, workorder_id, workorder_code, workorder_name, workstation_id, workstation_code, workstation_name,process_id,process_code,process_name, item_id, item_code, item_name, specification, unit_of_measure, quantity, quantity_produced, quantity_changed, client_id, client_code, client_name, client_nick, start_time, duration, end_time, color_code, request_date, status, remark, attr1, attr2, attr3, attr4, create_by, create_time, update_by, update_time from pro_task
</sql> </sql>
<select id="selectProTaskList" parameterType="ProTask" resultMap="ProTaskResult"> <select id="selectProTaskList" parameterType="ProTask" resultMap="ProTaskResult">
@ -80,6 +81,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<if test="endTime != null "> and end_time = #{endTime}</if> <if test="endTime != null "> and end_time = #{endTime}</if>
<if test="colorCode != null and colorCode != ''"> and color_code = #{colorCode}</if> <if test="colorCode != null and colorCode != ''"> and color_code = #{colorCode}</if>
<if test="requestDate != null "> and request_date = #{requestDate}</if> <if test="requestDate != null "> and request_date = #{requestDate}</if>
<if test="status != null "> and status = #{status}</if>
order by request_date asc order by request_date asc
</where> </where>
</select> </select>
@ -120,6 +122,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<if test="endTime != null">end_time,</if> <if test="endTime != null">end_time,</if>
<if test="colorCode != null">color_code,</if> <if test="colorCode != null">color_code,</if>
<if test="requestDate != null">request_date,</if> <if test="requestDate != null">request_date,</if>
<if test="status != null">status,</if>
<if test="remark != null">remark,</if> <if test="remark != null">remark,</if>
<if test="attr1 != null">attr1,</if> <if test="attr1 != null">attr1,</if>
<if test="attr2 != null">attr2,</if> <if test="attr2 != null">attr2,</if>
@ -159,6 +162,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<if test="endTime != null">#{endTime},</if> <if test="endTime != null">#{endTime},</if>
<if test="colorCode != null">#{colorCode},</if> <if test="colorCode != null">#{colorCode},</if>
<if test="requestDate != null">#{requestDate},</if> <if test="requestDate != null">#{requestDate},</if>
<if test="status != null">#{status},</if>
<if test="remark != null">#{remark},</if> <if test="remark != null">#{remark},</if>
<if test="attr1 != null">#{attr1},</if> <if test="attr1 != null">#{attr1},</if>
<if test="attr2 != null">#{attr2},</if> <if test="attr2 != null">#{attr2},</if>
@ -202,6 +206,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<if test="endTime != null">end_time = #{endTime},</if> <if test="endTime != null">end_time = #{endTime},</if>
<if test="colorCode != null">color_code = #{colorCode},</if> <if test="colorCode != null">color_code = #{colorCode},</if>
<if test="requestDate != null">request_date = #{requestDate},</if> <if test="requestDate != null">request_date = #{requestDate},</if>
<if test="status != null">status = #{status},</if>
<if test="remark != null">remark = #{remark},</if> <if test="remark != null">remark = #{remark},</if>
<if test="attr1 != null">attr1 = #{attr1},</if> <if test="attr1 != null">attr1 = #{attr1},</if>
<if test="attr2 != null">attr2 = #{attr2},</if> <if test="attr2 != null">attr2 = #{attr2},</if>