生产报工修改
This commit is contained in:
parent
5c115d057b
commit
69cb50e767
@ -516,7 +516,7 @@ create table pro_andon_record (
|
||||
workstation_name varchar(125) comment '工作站名称',
|
||||
user_id bigint(20) not null comment '用户ID',
|
||||
user_name varchar(64) comment '用户名',
|
||||
nick_name bigint(125) comment '名称',
|
||||
nick_name varchar(125) comment '名称',
|
||||
workorder_id bigint(20) comment '生产工单ID',
|
||||
workorder_code varchar(64) comment '生产工单编号',
|
||||
workorder_name varchar(255) comment '生产工单名称',
|
||||
|
@ -238,6 +238,11 @@ public class ProFeedbackController extends BaseController
|
||||
return AjaxResult.error("当前生产工单的状态为已完成,不能继续报工,请刷新生产任务列表!");
|
||||
}
|
||||
|
||||
//仍旧有待检数量时不能执行
|
||||
if(StringUtils.isNotNull(feedback.getQuantityUncheck()) && feedback.getQuantityUncheck().compareTo(BigDecimal.ZERO) >0){
|
||||
return AjaxResult.error("当前报工单未完成检验(待检数量大于0),无法执行报工!");
|
||||
}
|
||||
|
||||
//更新生产任务的生产数量
|
||||
BigDecimal quantityProduced,quantityQuanlify,quantityUnquanlify;
|
||||
quantityQuanlify = task.getQuantityQuanlify()==null? new BigDecimal(0):task.getQuantityQuanlify();
|
||||
|
@ -10,6 +10,7 @@ import com.ktg.common.constant.UserConstants;
|
||||
import com.ktg.common.utils.StringUtils;
|
||||
import com.ktg.mes.pro.domain.*;
|
||||
import com.ktg.mes.pro.service.IProProcessService;
|
||||
import com.ktg.mes.pro.service.IProRouteService;
|
||||
import com.ktg.mes.pro.service.IProWorkorderService;
|
||||
import com.ktg.system.strategy.AutoCodeUtil;
|
||||
import org.springframework.security.access.prepost.PreAuthorize;
|
||||
@ -49,6 +50,9 @@ public class ProTaskController extends BaseController
|
||||
@Autowired
|
||||
private IProProcessService proProcessService;
|
||||
|
||||
@Autowired
|
||||
private IProRouteService proRouteService;
|
||||
|
||||
@Autowired
|
||||
private AutoCodeUtil autoCodeUtil;
|
||||
|
||||
@ -192,11 +196,26 @@ public class ProTaskController extends BaseController
|
||||
proTask.setClientCode(order.getClientCode());
|
||||
proTask.setClientName(order.getClientName());
|
||||
|
||||
//工艺信息
|
||||
if(StringUtils.isNotNull(proTask.getRouteId())){
|
||||
ProRoute route = proRouteService.selectProRouteByRouteId(proTask.getRouteId());
|
||||
if(StringUtils.isNotNull(route)){
|
||||
proTask.setRouteCode(route.getRouteCode());
|
||||
}else {
|
||||
return AjaxResult.error("当前生产任务对应的工艺路线信息无效!"+proTask.getRouteId());
|
||||
}
|
||||
}
|
||||
|
||||
//工序信息
|
||||
ProProcess process = proProcessService.selectProProcessByProcessId(proTask.getProcessId());
|
||||
if(StringUtils.isNotNull(process)){
|
||||
proTask.setProcessId(process.getProcessId());
|
||||
proTask.setProcessCode(process.getProcessCode());
|
||||
proTask.setProcessName(process.getProcessName());
|
||||
}else{
|
||||
return AjaxResult.error("当前生产任务对应的工序信息无效!"+proTask.getProcessId());
|
||||
}
|
||||
|
||||
|
||||
//自动生成任务编号和名称
|
||||
proTask.setTaskCode(autoCodeUtil.genSerialCode(UserConstants.TASK_CODE,null));
|
||||
@ -219,6 +238,47 @@ public class ProTaskController extends BaseController
|
||||
return AjaxResult.error("排产数量必须大于0!");
|
||||
}
|
||||
|
||||
if(!StringUtils.isNotNull(proTask.getWorkstationId())){
|
||||
return AjaxResult.error("请选择工作站!");
|
||||
}
|
||||
|
||||
if(proTask.getDuration()<=0){
|
||||
return AjaxResult.error("生产时长必须大于0!");
|
||||
}
|
||||
|
||||
//生产工单
|
||||
ProWorkorder order = proWorkorderService.selectProWorkorderByWorkorderId(proTask.getWorkorderId());
|
||||
proTask.setWorkorderCode(order.getWorkorderCode());
|
||||
proTask.setWorkorderName(order.getWorkorderName());
|
||||
proTask.setItemId(order.getProductId());
|
||||
proTask.setItemCode(order.getProductCode());
|
||||
proTask.setItemName(order.getProductName());
|
||||
proTask.setSpecification(order.getProductSpc());
|
||||
proTask.setUnitOfMeasure(order.getUnitOfMeasure());
|
||||
proTask.setClientId(order.getClientId());
|
||||
proTask.setClientCode(order.getClientCode());
|
||||
proTask.setClientName(order.getClientName());
|
||||
|
||||
//工艺信息
|
||||
if(StringUtils.isNotNull(proTask.getRouteId())){
|
||||
ProRoute route = proRouteService.selectProRouteByRouteId(proTask.getRouteId());
|
||||
if(StringUtils.isNotNull(route)){
|
||||
proTask.setRouteCode(route.getRouteCode());
|
||||
}else {
|
||||
return AjaxResult.error("当前生产任务对应的工艺路线信息无效!"+proTask.getRouteId());
|
||||
}
|
||||
}
|
||||
|
||||
//工序信息
|
||||
ProProcess process = proProcessService.selectProProcessByProcessId(proTask.getProcessId());
|
||||
if(StringUtils.isNotNull(process)){
|
||||
proTask.setProcessId(process.getProcessId());
|
||||
proTask.setProcessCode(process.getProcessCode());
|
||||
proTask.setProcessName(process.getProcessName());
|
||||
}else{
|
||||
return AjaxResult.error("当前生产任务对应的工序信息无效!"+proTask.getProcessId());
|
||||
}
|
||||
|
||||
return toAjax(proTaskService.updateProTask(proTask));
|
||||
}
|
||||
|
||||
|
@ -94,6 +94,10 @@ public class WmRtIssueLineController extends BaseController
|
||||
@PostMapping
|
||||
public AjaxResult add(@RequestBody WmRtIssueLine wmRtIssueLine)
|
||||
{
|
||||
if(!StringUtils.isNotNull(wmRtIssueLine.getMaterialStockId())){
|
||||
return AjaxResult.error("请从库存现有量中选择退料的物资!");
|
||||
}
|
||||
|
||||
if(StringUtils.isNotNull(wmRtIssueLine.getWarehouseId())){
|
||||
WmWarehouse warehouse = wmWarehouseService.selectWmWarehouseByWarehouseId(wmRtIssueLine.getWarehouseId());
|
||||
wmRtIssueLine.setWarehouseCode(warehouse.getWarehouseCode());
|
||||
|
@ -9,6 +9,7 @@ import com.ktg.common.constant.UserConstants;
|
||||
import com.ktg.system.strategy.AutoCodeUtil;
|
||||
import org.springframework.security.access.prepost.PreAuthorize;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
import org.springframework.web.bind.annotation.GetMapping;
|
||||
import org.springframework.web.bind.annotation.PostMapping;
|
||||
import org.springframework.web.bind.annotation.PutMapping;
|
||||
@ -94,6 +95,7 @@ public class WmSnController extends BaseController
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('mes:wm:sn:add')")
|
||||
@Log(title = "SN码", businessType = BusinessType.INSERT)
|
||||
@Transactional
|
||||
@PostMapping
|
||||
public AjaxResult add(@RequestBody WmSn wmSn)
|
||||
{
|
||||
|
@ -31,6 +31,14 @@ public interface WmMaterialStockMapper
|
||||
*/
|
||||
public List<WmMaterialStock> selectWmMaterialStockList(WmMaterialStock wmMaterialStock);
|
||||
|
||||
/**
|
||||
* 模糊查询库存记录列表
|
||||
*
|
||||
* @param wmMaterialStock 库存记录
|
||||
* @return 库存记录集合
|
||||
*/
|
||||
public List<WmMaterialStock> queryWmMaterialStockList(WmMaterialStock wmMaterialStock);
|
||||
|
||||
/**
|
||||
* 新增库存记录
|
||||
*
|
||||
|
@ -30,6 +30,16 @@ public interface IWmMaterialStockService
|
||||
*/
|
||||
public List<WmMaterialStock> selectWmMaterialStockList(WmMaterialStock wmMaterialStock);
|
||||
|
||||
|
||||
/**
|
||||
* 模糊查询库存记录列表
|
||||
*
|
||||
* @param wmMaterialStock 库存记录
|
||||
* @return 库存记录集合
|
||||
*/
|
||||
public List<WmMaterialStock> queryWmMaterialStockList(WmMaterialStock wmMaterialStock);
|
||||
|
||||
|
||||
/**
|
||||
* 新增库存记录
|
||||
*
|
||||
|
@ -46,6 +46,11 @@ public class WmMaterialStockServiceImpl implements IWmMaterialStockService
|
||||
return wmMaterialStockMapper.selectWmMaterialStockList(wmMaterialStock);
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<WmMaterialStock> queryWmMaterialStockList(WmMaterialStock wmMaterialStock) {
|
||||
return wmMaterialStockMapper.queryWmMaterialStockList(wmMaterialStock);
|
||||
}
|
||||
|
||||
/**
|
||||
* 新增库存记录
|
||||
*
|
||||
|
@ -51,7 +51,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||
</resultMap>
|
||||
|
||||
<sql id="selectProFeedbackVo">
|
||||
select f.record_id,f.feedback_type, f.workstation_id, f.workstation_code, f.workstation_name,f.process_id, f.process_code, f.process_name,p.is_check, f.workorder_id, f.workorder_code, f.workorder_name, f.task_id, f.task_code,f.item_id,f.item_code,f.item_name,f.specification,f.unit_of_measure, f.quantity, f.quantity_feedback, f.quantity_qualified, f.quantity_unquanlified,f.quantity_uncheck, f.user_name, f.nick_name, f.feedback_channel, f.feedback_time,f.record_user,f.record_nick,f.status, f.remark, f.attr1, f.attr2, f.attr3, f.attr4, f.create_by, f.create_time, f.update_by, f.update_time
|
||||
select f.record_id,f.feedback_type, f.workstation_id, f.workstation_code, f.workstation_name,f.route_id,f.route_code, f.process_id, f.process_code, f.process_name,p.is_check, f.workorder_id, f.workorder_code, f.workorder_name, f.task_id, f.task_code,f.item_id,f.item_code,f.item_name,f.specification,f.unit_of_measure, f.quantity, f.quantity_feedback, f.quantity_qualified, f.quantity_unquanlified,f.quantity_uncheck, f.user_name, f.nick_name, f.feedback_channel, f.feedback_time,f.record_user,f.record_nick,f.status, f.remark, f.attr1, f.attr2, f.attr3, f.attr4, f.create_by, f.create_time, f.update_by, f.update_time
|
||||
from pro_feedback f
|
||||
left join pro_route_process p
|
||||
on f.process_id = p.process_id and f.route_id = p.route_id
|
||||
@ -96,7 +96,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||
|
||||
<select id="selectProFeedbackByRecordId" parameterType="Long" resultMap="ProFeedbackResult">
|
||||
<include refid="selectProFeedbackVo"/>
|
||||
where record_id = #{recordId}
|
||||
where f.record_id = #{recordId}
|
||||
</select>
|
||||
|
||||
<insert id="insertProFeedback" parameterType="ProFeedback" useGeneratedKeys="true" keyProperty="recordId">
|
||||
@ -107,6 +107,8 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||
<if test="workstationId != null">workstation_id,</if>
|
||||
<if test="workstationCode != null">workstation_code,</if>
|
||||
<if test="workstationName != null">workstation_name,</if>
|
||||
<if test="routeId !=null">route_id,</if>
|
||||
<if test="routeCode !=null">route_code,</if>
|
||||
<if test="processId != null">process_id,</if>
|
||||
<if test="processCode != null">process_code,</if>
|
||||
<if test="processName != null">process_name,</if>
|
||||
@ -148,6 +150,8 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||
<if test="workstationId != null">#{workstationId},</if>
|
||||
<if test="workstationCode != null">#{workstationCode},</if>
|
||||
<if test="workstationName != null">#{workstationName},</if>
|
||||
<if test="routeId !=null">#{routeId},</if>
|
||||
<if test="routeCode !=null">#{routeCode},</if>
|
||||
<if test="processId != null">#{processId},</if>
|
||||
<if test="processCode != null">#{processCode},</if>
|
||||
<if test="processName != null">#{processName},</if>
|
||||
@ -193,6 +197,8 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||
<if test="workstationId != null">workstation_id = #{workstationId},</if>
|
||||
<if test="workstationCode != null">workstation_code = #{workstationCode},</if>
|
||||
<if test="workstationName != null">workstation_name = #{workstationName},</if>
|
||||
<if test="routeId !=null">route_id = #{routeId},</if>
|
||||
<if test="routeCode !=null">route_code = #{routeCode},</if>
|
||||
<if test="processId != null">process_id = #{processId},</if>
|
||||
<if test="processCode != null">process_code = #{processCode},</if>
|
||||
<if test="processName != null">process_name = #{processName},</if>
|
||||
|
@ -14,6 +14,8 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||
<result property="workstationId" column="workstation_id" />
|
||||
<result property="workstationCode" column="workstation_code" />
|
||||
<result property="workstationName" column="workstation_name" />
|
||||
<result property="routeId" column="route_id" ></result>
|
||||
<result property="routeCode" column="route_code"></result>
|
||||
<result property="processId" column="process_id" />
|
||||
<result property="processCode" column="process_code" />
|
||||
<result property="processName" column="process_name" />
|
||||
|
@ -71,7 +71,44 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||
<if test="quantityOnhand != null "> and quantity_onhand = #{quantityOnhand}</if>
|
||||
<if test="recptDate !=null"> and recpt_date = #{recptDate}</if>
|
||||
<if test="workorderId !=null">and workorder_id = #{workorderId}</if>
|
||||
<if test="workorderCode !=null">and workorder_code = #{workorderCode}</if>
|
||||
<if test="workorderCode !=null and workorderCode !=''">and workorder_code = #{workorderCode}</if>
|
||||
<if test="expireDate != null "> and expire_date = #{expireDate}</if>
|
||||
<if test="attr1 != null and attr1 != ''"> and attr1 = #{attr1}</if>
|
||||
<if test="attr2 != null and attr2 != ''"> and attr2 = #{attr2}</if>
|
||||
<if test="attr3 != null "> and attr3 = #{attr3}</if>
|
||||
<if test="attr4 != null "> and attr4 = #{attr4}</if>
|
||||
and quantity_onhand != 0
|
||||
order by recpt_date asc
|
||||
</where>
|
||||
</select>
|
||||
|
||||
<select id="queryWmMaterialStockList" parameterType="WmMaterialStock" resultMap="WmMaterialStockResult">
|
||||
<include refid="selectWmMaterialStockVo"/>
|
||||
<where>
|
||||
<if test="itemTypeId != null "> AND (item_type_id = #{itemTypeId} OR item_type_id in (select item_type_id from md_item_type where find_in_set(#{itemTypeId},ancestors)))</if>
|
||||
<if test="itemId != null "> and item_id = #{itemId}</if>
|
||||
<if test="itemCode != null and itemCode != ''"> and item_code like concat('%',#{itemCode},'%')</if>
|
||||
<if test="itemName != null and itemName != ''"> and item_name like concat('%', #{itemName}, '%')</if>
|
||||
<if test="specification != null and specification != ''"> and specification like concat('%',#{specification},'%')</if>
|
||||
<if test="unitOfMeasure != null and unitOfMeasure != ''"> and unit_of_measure = #{unitOfMeasure}</if>
|
||||
<if test="batchCode != null and batchCode != ''"> and batch_code like concat('%',#{batchCode},'%') </if>
|
||||
<if test="warehouseId != null "> and warehouse_id = #{warehouseId}</if>
|
||||
<if test="warehouseCode != null and warehouseCode != ''"> and warehouse_code = #{warehouseCode}</if>
|
||||
<if test="warehouseName != null and warehouseName != ''"> and warehouse_name like concat('%', #{warehouseName}, '%')</if>
|
||||
<if test="locationId != null "> and location_id = #{locationId}</if>
|
||||
<if test="locationCode != null and locationCode != ''"> and location_code = #{locationCode}</if>
|
||||
<if test="locationName != null and locationName != ''"> and location_name like concat('%', #{locationName}, '%')</if>
|
||||
<if test="areaId != null "> and area_id = #{areaId}</if>
|
||||
<if test="areaCode != null and areaCode != ''"> and area_code = #{areaCode}</if>
|
||||
<if test="areaName != null and areaName != ''"> and area_name like concat('%', #{areaName}, '%')</if>
|
||||
<if test="vendorId != null "> and vendor_id = #{vendorId}</if>
|
||||
<if test="vendorCode != null and vendorCode != ''"> and vendor_code = #{vendorCode}</if>
|
||||
<if test="vendorName != null and vendorName != ''"> and vendor_name like concat('%', #{vendorName}, '%')</if>
|
||||
<if test="vendorNick != null and vendorNick != ''"> and vendor_nick like concat('%',#{vendorNick},'%') </if>
|
||||
<if test="quantityOnhand != null "> and quantity_onhand = #{quantityOnhand}</if>
|
||||
<if test="recptDate !=null"> and recpt_date = #{recptDate}</if>
|
||||
<if test="workorderId !=null">and workorder_id = #{workorderId}</if>
|
||||
<if test="workorderCode !=null and workorderCode !=''">and workorder_code like concat('%',#{workorderCode},'%') </if>
|
||||
<if test="expireDate != null "> and expire_date = #{expireDate}</if>
|
||||
<if test="attr1 != null and attr1 != ''"> and attr1 = #{attr1}</if>
|
||||
<if test="attr2 != null and attr2 != ''"> and attr2 = #{attr2}</if>
|
||||
|
Loading…
Reference in New Issue
Block a user