rev:接口联调
This commit is contained in:
@@ -40,8 +40,8 @@ public enum AcsTaskEnum {
|
||||
STATUS_FINISH("2","完成"),
|
||||
STATUS_CANNEL("3","取消"),
|
||||
//专机请求
|
||||
REQUEST_CALLTYPE_FULL("1","专机满料请求"),
|
||||
REQUEST_CALLTYPE_EMP("2","专机缺料请求"),
|
||||
REQUEST_CALLTYPE_FULL("2","专机满料请求"),
|
||||
REQUEST_CALLTYPE_EMP("1","专机缺料请求"),
|
||||
REQUEST_PLOTTER_SEND_FULL("3","刻字满料请求"),
|
||||
REQUEST_PLOTTER_CALL_EMP("4","刻字缺空框请求"),
|
||||
REQUEST_WARP_CALL_FULL("5","包装缺料请求"),
|
||||
|
||||
@@ -0,0 +1,55 @@
|
||||
package org.nl.common.utils;
|
||||
|
||||
import com.alibaba.fastjson.JSON;
|
||||
import com.alibaba.fastjson.JSONObject;
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Getter;
|
||||
import org.nl.config.thread.ThreadPoolExecutorUtil;
|
||||
import org.nl.modules.wql.util.SpringContextHolder;
|
||||
import org.nl.system.service.ql.IPdmQlOptionService;
|
||||
import org.nl.system.service.ql.dao.PdmQlOption;
|
||||
|
||||
import java.util.Date;
|
||||
import java.util.Map;
|
||||
import java.util.concurrent.ThreadPoolExecutor;
|
||||
|
||||
/*
|
||||
* @author ZZQ
|
||||
* @Date 2023/4/25 15:40
|
||||
*/
|
||||
public class OptionRecord {
|
||||
|
||||
private final static ThreadPoolExecutor EXECUTOR = ThreadPoolExecutorUtil.getPoll();
|
||||
|
||||
public static void record(OptionEnum type, Buss classname, String order, Map option){
|
||||
EXECUTOR.execute(()->{
|
||||
IPdmQlOptionService bean = SpringContextHolder.getBean(IPdmQlOptionService.class);
|
||||
PdmQlOption qlOption = new PdmQlOption();
|
||||
if (option !=null){
|
||||
qlOption.setOptionDate(JSON.toJSONString(option));
|
||||
}
|
||||
qlOption.setOrderno(order);
|
||||
qlOption.setType(type.name());
|
||||
qlOption.setCreateTime(new Date());
|
||||
qlOption.setCreateId(SecurityUtils.getCurrentUserId());
|
||||
qlOption.setCreateId(SecurityUtils.getCurrentNickName());
|
||||
qlOption.setBussclass(classname.name());
|
||||
bean.save(qlOption);
|
||||
});
|
||||
}
|
||||
|
||||
@Getter
|
||||
@AllArgsConstructor
|
||||
public enum OptionEnum{
|
||||
ADDOP,
|
||||
DELETEOP,
|
||||
UPDATEOP,
|
||||
}
|
||||
@Getter
|
||||
@AllArgsConstructor
|
||||
public enum Buss{
|
||||
WORKORDER,
|
||||
MATERIAL,
|
||||
VECHILE,
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,21 @@
|
||||
package org.nl.system.controller.ql;
|
||||
|
||||
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
* 操作记录表 前端控制器
|
||||
* </p>
|
||||
*
|
||||
* @author generator
|
||||
* @since 2023-04-25
|
||||
*/
|
||||
@RestController
|
||||
@RequestMapping("/pdmQlOption")
|
||||
public class PdmQlOptionController {
|
||||
|
||||
}
|
||||
|
||||
@@ -0,0 +1,16 @@
|
||||
package org.nl.system.service.ql;
|
||||
|
||||
import com.baomidou.mybatisplus.extension.service.IService;
|
||||
import org.nl.system.service.ql.dao.PdmQlOption;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
* 操作记录表 服务类
|
||||
* </p>
|
||||
*
|
||||
* @author generator
|
||||
* @since 2023-04-25
|
||||
*/
|
||||
public interface IPdmQlOptionService extends IService<PdmQlOption> {
|
||||
|
||||
}
|
||||
@@ -0,0 +1,71 @@
|
||||
package org.nl.system.service.ql.dao;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.TableName;
|
||||
import java.time.LocalDateTime;
|
||||
import java.io.Serializable;
|
||||
import java.util.Date;
|
||||
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
* 操作记录表
|
||||
* </p>
|
||||
*
|
||||
* @author generator
|
||||
* @since 2023-04-25
|
||||
*/
|
||||
@Data
|
||||
@EqualsAndHashCode(callSuper = false)
|
||||
@TableName("pdm_ql_option")
|
||||
public class PdmQlOption implements Serializable {
|
||||
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
/**
|
||||
* 项目id
|
||||
*/
|
||||
private String optionId;
|
||||
|
||||
/**
|
||||
* 检测类型
|
||||
*/
|
||||
private String type;
|
||||
|
||||
/**
|
||||
* 单据
|
||||
*/
|
||||
private String orderno;
|
||||
|
||||
/**
|
||||
* 数据
|
||||
*/
|
||||
private String optionDate;
|
||||
/**
|
||||
* 业务类
|
||||
*/
|
||||
private String bussclass;
|
||||
|
||||
/**
|
||||
* 创建人姓名
|
||||
*/
|
||||
private String createName;
|
||||
|
||||
/**
|
||||
* 创建时间
|
||||
*/
|
||||
private Date createTime;
|
||||
|
||||
/**
|
||||
* 创建人
|
||||
*/
|
||||
private String createId;
|
||||
|
||||
/**
|
||||
* 备注
|
||||
*/
|
||||
private String remark;
|
||||
|
||||
|
||||
}
|
||||
@@ -0,0 +1,16 @@
|
||||
package org.nl.system.service.ql.dao.mapper;
|
||||
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
import org.nl.system.service.ql.dao.PdmQlOption;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
* 操作记录表 Mapper 接口
|
||||
* </p>
|
||||
*
|
||||
* @author generator
|
||||
* @since 2023-04-25
|
||||
*/
|
||||
public interface PdmQlOptionMapper extends BaseMapper<PdmQlOption> {
|
||||
|
||||
}
|
||||
@@ -0,0 +1,5 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
||||
<mapper namespace="org.nl.system.service.ql.dao.mapper.PdmQlOptionMapper">
|
||||
|
||||
</mapper>
|
||||
@@ -0,0 +1,20 @@
|
||||
package org.nl.system.service.ql.impl;
|
||||
|
||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||
import org.nl.system.service.ql.IPdmQlOptionService;
|
||||
import org.nl.system.service.ql.dao.PdmQlOption;
|
||||
import org.nl.system.service.ql.dao.mapper.PdmQlOptionMapper;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
* 操作记录表 服务实现类
|
||||
* </p>
|
||||
*
|
||||
* @author generator
|
||||
* @since 2023-04-25
|
||||
*/
|
||||
@Service
|
||||
public class PdmQlOptionServiceImpl extends ServiceImpl<PdmQlOptionMapper, PdmQlOption> implements IPdmQlOptionService {
|
||||
|
||||
}
|
||||
@@ -18,6 +18,7 @@ import org.nl.wms.pda.service.CacheLineHandService;
|
||||
import org.nl.wms.sch.tasks.SpeMachineryTask;
|
||||
import org.nl.wms.sch.tasks.TaskScheduleService;
|
||||
import org.nl.wms.sch.tasks.WashMachineryTask;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.http.HttpStatus;
|
||||
import org.springframework.http.ResponseEntity;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
@@ -30,7 +31,6 @@ import java.util.Map;
|
||||
* @date 2021-07-21
|
||||
**/
|
||||
@RestController
|
||||
@RequiredArgsConstructor
|
||||
@Api(tags = "acs接收wms")
|
||||
@RequestMapping("/api/acsToWms/task")
|
||||
@Slf4j
|
||||
@@ -71,7 +71,7 @@ public class AcsToWmsController {
|
||||
@Log("ACS给WMS下发工单完成状态")
|
||||
@ApiOperation("ACS给WMS下发工单完成状态")
|
||||
@SaIgnore
|
||||
public ResponseEntity<Object> orderFinish(@RequestBody JSONObject param) {
|
||||
public ResponseEntity<Object> orderStatus(@RequestBody JSONObject param) {
|
||||
return new ResponseEntity<>(acsToWmsService.orderStatus(param), HttpStatus.OK);
|
||||
}
|
||||
|
||||
@@ -133,4 +133,11 @@ public class AcsToWmsController {
|
||||
washMachineryTask.createTask(new JSONObject(MapOf.of("device_code","QX03")));
|
||||
return null;
|
||||
}
|
||||
@PostMapping("/taskPublish")
|
||||
@Log("向wms反实施数量")
|
||||
@ApiOperation("向wms反订单实施数量")
|
||||
@SaIgnore
|
||||
public void taskScheduleService(){
|
||||
taskScheduleService.taskPublish();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -14,6 +14,7 @@ import org.nl.common.enums.StatusEnum;
|
||||
import org.nl.common.enums.WorkerOrderEnum;
|
||||
import org.nl.common.utils.IdUtil;
|
||||
import org.nl.common.utils.MapOf;
|
||||
import org.nl.common.utils.OptionRecord;
|
||||
import org.nl.common.utils.RedissonUtils;
|
||||
import org.nl.modules.common.exception.BadRequestException;
|
||||
import org.nl.modules.wql.core.bean.WQLObject;
|
||||
@@ -32,7 +33,9 @@ import org.nl.wms.sch.tasks.WashMachineryTask;
|
||||
import org.redisson.api.RLock;
|
||||
import org.redisson.api.RedissonClient;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.context.annotation.Lazy;
|
||||
import org.springframework.http.HttpStatus;
|
||||
import org.springframework.scheduling.annotation.Async;
|
||||
import org.springframework.stereotype.Service;
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
import org.springframework.util.CollectionUtils;
|
||||
@@ -54,6 +57,7 @@ public class AcsToWmsServiceImpl implements AcsToWmsService{
|
||||
|
||||
public static Map<AcsTaskEnum, AbstractAcsTask> Task_Collent = new HashMap<>();
|
||||
@Autowired
|
||||
@Lazy
|
||||
private TaskService taskService;
|
||||
@Autowired
|
||||
private CacheLineHandService cacheLineHandService;
|
||||
@@ -214,21 +218,17 @@ public class AcsToWmsServiceImpl implements AcsToWmsService{
|
||||
public Map<String, Object> orderStatus(JSONObject orderJson) {
|
||||
JSONObject result = new JSONObject();
|
||||
try {
|
||||
String workorder_id = orderJson.getString("workorder_id");
|
||||
String order_status = orderJson.getString("status");
|
||||
String real_qty = orderJson.getString("real_qty");
|
||||
WQLObject wo = WQLObject.getWQLObject("PDM_produce_workOrder");
|
||||
JSONObject map = new JSONObject();
|
||||
map.put("workorder_id", workorder_id);
|
||||
map.put("order_status", order_status);
|
||||
map.put("update_id", 1001001);
|
||||
map.put("real_qty", real_qty);
|
||||
map.put("workorder_id", orderJson.getString("workorder_id"));
|
||||
map.put("workorder_status", orderJson.getString("status"));
|
||||
map.put("update_id", "1");
|
||||
map.put("real_qty", orderJson.getString("real_qty"));
|
||||
map.put("current_device_code", "");
|
||||
map.put("update_name", "acs");
|
||||
map.put("update_time", DateUtil.now());
|
||||
map.put("realproduceend_date", DateUtil.now());
|
||||
wo.update(map, "workorder_id = '" + workorder_id + "'");
|
||||
|
||||
WQLObject.getWQLObject("PDM_produce_workOrder").update(map, "workorder_id = '" + orderJson.getString("workorder_id") + "'");
|
||||
OptionRecord.record(OptionRecord.OptionEnum.UPDATEOP, OptionRecord.Buss.WORKORDER,orderJson.getString("workorder_id"),MapOf.of("workorder_status", orderJson.getString("status")));
|
||||
} catch (Exception e){
|
||||
result.put("status", 400);
|
||||
result.put("message", e.getMessage());
|
||||
@@ -250,7 +250,7 @@ public class AcsToWmsServiceImpl implements AcsToWmsService{
|
||||
String workorder_code = param.getString("workorder_code");
|
||||
String status_type = param.getString("status_type");
|
||||
String start_time = param.getString("start_time");
|
||||
String err_status_id = param.getString("err_status_id");
|
||||
String err_status_id = param.getString("error_code");//关联pdm_bi_devicerunerrorlink获取异常信息
|
||||
JSONObject lastRecord = devRecordTab.query("device_code = '" + device_code + "' order by order_num desc limit 1").uniqueResult(0);
|
||||
if (lastRecord!=null){
|
||||
lastRecord.put("end_time",DateUtil.now());
|
||||
@@ -263,6 +263,7 @@ public class AcsToWmsServiceImpl implements AcsToWmsService{
|
||||
}
|
||||
|
||||
@Override
|
||||
@Async
|
||||
public void feedDevQty(Map param) {
|
||||
WQLObject deviceTab = WQLObject.getWQLObject("pdm_bi_device");
|
||||
if (CollectionUtils.isEmpty(param)){
|
||||
@@ -271,8 +272,10 @@ public class AcsToWmsServiceImpl implements AcsToWmsService{
|
||||
Iterator iterator = param.keySet().iterator();
|
||||
while (iterator.hasNext()){
|
||||
String deviceCode = (String)iterator.next();
|
||||
String qty = String.valueOf(param.get(deviceCode));
|
||||
deviceTab.update(MapOf.of("deviceinstor_qty",qty),"device_code = '"+deviceCode+"'");
|
||||
if (!StringUtils.isEmpty(deviceCode)){
|
||||
String qty = String.valueOf(param.get(deviceCode));
|
||||
deviceTab.update(MapOf.of("deviceinstor_qty",qty),"device_code = '"+deviceCode+"'");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -304,6 +307,7 @@ public class AcsToWmsServiceImpl implements AcsToWmsService{
|
||||
}
|
||||
|
||||
@Override
|
||||
@Async
|
||||
public void feedOrderRealQty(JSONObject param) {
|
||||
WQLObject wo = WQLObject.getWQLObject("pdm_produce_workorder");
|
||||
if (CollectionUtils.isEmpty(param)){
|
||||
@@ -311,9 +315,9 @@ public class AcsToWmsServiceImpl implements AcsToWmsService{
|
||||
}
|
||||
Iterator<String> iterator = param.keySet().iterator();
|
||||
while (iterator.hasNext()){
|
||||
String workorder_id = iterator.next();
|
||||
String real_qty = param.getString(workorder_id);
|
||||
wo.update(MapOf.of("real_qty",real_qty),"workorder_id = '"+workorder_id+"'");
|
||||
String workorderCode = iterator.next();
|
||||
String real_qty = param.getString(workorderCode);
|
||||
wo.update(MapOf.of("real_qty",real_qty),"workorder_code = '"+workorderCode+"'");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -50,23 +50,23 @@ public class AgvInstService {
|
||||
//4.有则创建agv指令,
|
||||
// 没有则创建缓存架任务
|
||||
public void fullMaster(JSONObject task){
|
||||
final String OPT_NAME = "满料请求:";
|
||||
WQLObject basePoint = WQLObject.getWQLObject("sch_base_point");
|
||||
WQLObject taskTab = WQLObject.getWQLObject("sch_base_task");
|
||||
WQLObject cacheLineSearch = WQLObject.getWQLObject("SCH_cacheLine_region_relation");
|
||||
String point_code = task.getString("start_point_code");
|
||||
String quantity = task.getString("quantity");
|
||||
JSONObject devicePoint = basePoint.query("point_code = '" + point_code + "' and is_delete = 0 and is_used = 1").uniqueResult(0);
|
||||
JSONObject devicePoint = WQLObject.getWQLObject("sch_base_point").query("point_code = '" + point_code + "' and is_delete = 0 and is_used = 1").uniqueResult(0);
|
||||
String nextPoint;
|
||||
//判断缓存线是不是去深坑清洗:深坑区域15个点:判断空的物料坑位:
|
||||
String cacheVehile = "";
|
||||
if (devicePoint.getString("next_region_code").equals(ConstantParam.SK_REGION)){
|
||||
JSONArray nextPointList = WQL.getWO("sch_point").addParamMap(MapOf.of("flag","7","region_code", devicePoint.getString("next_region_code"),"qty",quantity)).process().getResultJSONArray(0);
|
||||
//查询生坑重量是否超限:深坑需要乘以系数
|
||||
JSONArray nextPointList = WQL.getWO("sch_point").addParamMap(MapOf.of("flag","7","region_code", devicePoint.getString("next_region_code"),"qty",Integer.valueOf(quantity)*ConstantParam.MATERAIL_RATIO)).process().getResultJSONArray(0);
|
||||
if (nextPointList.size() == 0){
|
||||
throw new BadRequestException(OPT_NAME+"深坑区域:"+devicePoint.getString("next_region_code")+"无可用点位");
|
||||
throw new BadRequestException("深坑清洗储料仓:"+devicePoint.getString("next_region_code")+"无可用点位");
|
||||
}
|
||||
nextPoint = nextPointList.getJSONObject(0).getString("point_code");
|
||||
}else {
|
||||
//专机的话:需要判断专机上料口物料是否满足数量
|
||||
JSONArray nextPointList = WQL.getWO("sch_point").addParamMap(MapOf.of("flag","3","region_code", devicePoint.getString("next_region_code"),"qty",quantity)).process().getResultJSONArray(0);
|
||||
if (nextPointList.size() == 0){
|
||||
JSONObject cacheLine = cacheLineSearch.query("region_code = '"+devicePoint.getString("region_code")+"'").uniqueResult(0);
|
||||
@@ -74,16 +74,16 @@ public class AgvInstService {
|
||||
//满料请求:查询缓存线空载具列表
|
||||
cacheVehile = getEmpCacheVehile(nextPoint, null);
|
||||
if (StringUtils.isBlank(cacheVehile)) {
|
||||
throw new BadRequestException(OPT_NAME+"缓存线:"+nextPoint+"没有可用空载具");
|
||||
throw new BadRequestException("缓存线:"+nextPoint+"没有可用空载具");
|
||||
}
|
||||
}else {
|
||||
nextPoint = nextPointList.getJSONObject(0).getString("point_code");
|
||||
}
|
||||
}
|
||||
if (StringUtils.isBlank(nextPoint)){
|
||||
throw new BadRequestException(OPT_NAME+"设备:"+point_code+"没有可用点位");
|
||||
throw new BadRequestException("设备:"+point_code+"没有可用点位");
|
||||
}
|
||||
basePoint.update(MapOf.of("lock_type",StatusEnum.LOCK_ON.getCode(),"point_code = '"+nextPoint+"'"));
|
||||
WQLObject.getWQLObject("sch_base_point").update(MapOf.of("task_id",task.getString("task_id"),"lock_type",StatusEnum.LOCK_ON.getCode(),"point_code = '"+nextPoint+"'"));
|
||||
task.put("vehicle_code",cacheVehile);
|
||||
task.put("next_point_code",nextPoint);
|
||||
task.put("task_status",StatusEnum.TASK_START_END_P.getCode());
|
||||
@@ -95,35 +95,29 @@ public class AgvInstService {
|
||||
//2.根据当前设备绑定的物料id,从缓存线中获取相同物料对应载具列表
|
||||
//3.agv根据对应载具列表行进扫码匹配:匹配到对应物料则创建点对点任务
|
||||
public void callMatter(JSONObject task){
|
||||
final String OPT_NAME = "专机缺料请求:";
|
||||
WQLObject basePointTable = WQLObject.getWQLObject("SCH_BASE_Point");
|
||||
WQLObject cacheLineTable = WQLObject.getWQLObject("SCH_cacheLine_region_relation");
|
||||
WQLObject taskTable = WQLObject.getWQLObject("SCH_base_task");
|
||||
//参数
|
||||
String material_id = task.getString("material_id");
|
||||
|
||||
JSONObject devicePoint = basePointTable.query("point_code = '" + task.getString("next_point_code") + "' and is_delete = 0 and is_used = 1").uniqueResult(0);
|
||||
|
||||
JSONObject cacheLine = cacheLineTable.query("region_code = '"+devicePoint.getString("region_code")+"' and is_active = '"+StatusEnum.STATUS_TRUE.getCode()+"'").uniqueResult(0);
|
||||
Assert.notNull(cacheLine, String.format(OPT_NAME+"区域%s对应缓存线信息不存在", devicePoint.getString("region_code")));
|
||||
JSONObject devicePoint = WQLObject.getWQLObject("SCH_BASE_Point").query("point_code = '" + targetDevice + "' and is_delete = 0 and is_used = 1").uniqueResult(0);
|
||||
JSONObject cacheLine = WQLObject.getWQLObject("SCH_cacheLine_region_relation").query("region_code = '"+devicePoint.getString("region_code")+"' and is_active = '"+StatusEnum.STATUS_TRUE.getCode()+"'").uniqueResult(0);
|
||||
Assert.notNull(cacheLine, String.format("区域%s对应缓存线信息不存在", devicePoint.getString("region_code")));
|
||||
//缓存线位置编码 :缺料请求获取缓存线满载具列表
|
||||
String startPoint = cacheLine.getString("cacheline_code");
|
||||
String cacheVehile = getEmpCacheVehile(startPoint, material_id);
|
||||
if (StringUtils.isBlank(cacheVehile)) {
|
||||
throw new BadRequestException(OPT_NAME+"缓存线:"+startPoint+"没有可用载具");
|
||||
throw new BadRequestException("缓存线:"+startPoint+"没有物料"+material_id+"对应可用载具");
|
||||
}
|
||||
//判断当前物料载具已经任务分配数量:如果>物料已经分配任务。说明满了,不允许再分配
|
||||
JSONArray allocateTask = taskTable.query("point_code1 = '" + startPoint + "' and material_id = '" + material_id + "' and task_status <" + StatusEnum.TASK_FINISH.getCode()).getResultJSONArray(0);
|
||||
JSONArray allocateTask = WQLObject.getWQLObject("SCH_base_task").query("point_code1 = '" + startPoint + "' and material_id = '" + material_id + "' and task_status <" + StatusEnum.TASK_FINISH.getCode()).getResultJSONArray(0);
|
||||
if (allocateTask.size()>=cacheVehile.split(",").length){
|
||||
log.error(OPT_NAME+"callMatter 缓存线:{}上含有物料:{}的载具分配完,任务id:{}",startPoint,material_id,allocateTask.stream().map(o-> ((JSONObject)o).getString("task_id")).collect(Collectors.joining(",")));
|
||||
throw new BadRequestException(String.format(OPT_NAME+"缓存线%s上含物料%s的载具已分配完",startPoint,material_id));
|
||||
log.error("callMatter 缓存线:{}上含有物料:{}的载具分配完,任务id:{}",startPoint,material_id,allocateTask.stream().map(o-> ((JSONObject)o).getString("task_id")).collect(Collectors.joining(",")));
|
||||
throw new BadRequestException(String.format("缓存线%s上含物料%s的载具已分配完",startPoint,material_id));
|
||||
}
|
||||
task.put("vehicle_code",cacheVehile);
|
||||
task.put("start_point_code",startPoint);
|
||||
task.put("return_point_code",startPoint);
|
||||
task.put("task_status",StatusEnum.TASK_START_END_P.getCode());
|
||||
task.put("update_time", DateUtil.now());
|
||||
taskTable.update(task);
|
||||
WQLObject.getWQLObject("SCH_base_task").update(task);
|
||||
|
||||
}
|
||||
|
||||
|
||||
@@ -48,7 +48,7 @@ public class ProduceWorkorderController {
|
||||
produceWorkorderService.create(dto);
|
||||
return new ResponseEntity<>(HttpStatus.CREATED);
|
||||
}
|
||||
@PostMapping("/submits")
|
||||
@PostMapping("/create")
|
||||
@Log("新增工单管理")
|
||||
@ApiOperation("新增工单管理")
|
||||
//@PreAuthorize("@el.check('produceWorkorder:add')")
|
||||
|
||||
@@ -14,9 +14,11 @@ import com.alibaba.fastjson.JSONObject;
|
||||
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
import org.nl.common.enums.StatusEnum;
|
||||
import org.nl.common.enums.WorkerOrderEnum;
|
||||
import org.nl.common.utils.MapOf;
|
||||
import org.nl.common.utils.OptionRecord;
|
||||
import org.nl.common.utils.api.CommonResult;
|
||||
import org.nl.common.utils.api.RestBusinessTemplate;
|
||||
import org.nl.modules.common.exception.BadRequestException;
|
||||
@@ -323,28 +325,44 @@ public class ProduceshiftorderServiceImpl implements ProduceshiftorderService{
|
||||
@Override
|
||||
@Transactional(rollbackFor = Exception.class)
|
||||
public CommonResult<Map<String,Object>> openStart(JSONObject param) {
|
||||
String currentUserId = SecurityUtils.getCurrentUserId();
|
||||
String nickName = SecurityUtils.getCurrentNickName();
|
||||
WQLObject wo = WQLObject.getWQLObject("pdm_produce_workorder");
|
||||
//获取前台传入的开工的工单信息
|
||||
String workorder_id = param.getString("workorder_id");
|
||||
String device_code = param.getString("device_code");
|
||||
//1-创建、2-下发、3-生产中、4-暂停、5-完成
|
||||
JSONObject result = wo.query("current_device_code = '" + device_code + "' and workorder_status in ('2','3','4') and workorder_id != '" + workorder_id + "'").uniqueResult(0);
|
||||
JSONObject result = WQLObject.getWQLObject("pdm_produce_workorder").query("current_device_code = '" + param.getString("device_code") + "' and workorder_status in ('2','3','4') and workorder_id != '" + workorder_id + "'").uniqueResult(0);
|
||||
//判断该工单状态
|
||||
if(ObjectUtil.isNotEmpty(result)) {
|
||||
throw new BadRequestException("已有工单选择该设备开工,请更换开工设备!");
|
||||
}
|
||||
//TODO:开工时修改生产班次工单表 生产设备、以及工单状态
|
||||
wo.update(MapOf.of("workorder_id", workorder_id, "workorder_status", WorkerOrderEnum.SEND.getCode(), "update_id", currentUserId, "update_name", nickName, "update_time", DateUtil.now()));
|
||||
JSONArray array = new JSONArray();
|
||||
JSONObject order = new JSONObject(MapOf.of("workorder_id", workorder_id, "type", WorkerOrderEnum.SEND.getCode()));
|
||||
JSONObject order = packageForm(workorder_id);
|
||||
array.add(order);
|
||||
//下发acs
|
||||
Map<String,Object> resp = wmsToAcsService.orderStatusUpdate(array);
|
||||
WQLObject.getWQLObject("pdm_produce_workorder").update(MapOf.of("workorder_id", workorder_id, "workorder_status", WorkerOrderEnum.SEND.getCode(), "update_id", SecurityUtils.getCurrentUserId(), "update_name", SecurityUtils.getCurrentNickName(), "update_time", DateUtil.now()));
|
||||
Map<String,Object> resp = wmsToAcsService.order(array);
|
||||
//TODO:记录表记录操作
|
||||
OptionRecord.record(OptionRecord.OptionEnum.UPDATEOP, OptionRecord.Buss.WORKORDER,workorder_id,MapOf.of("workorder_status", WorkerOrderEnum.SEND.getCode()));
|
||||
return RestBusinessTemplate.execute(() -> resp);
|
||||
}
|
||||
|
||||
@NotNull
|
||||
private JSONObject packageForm(String workorder_id) {
|
||||
JSONObject workOrder = WQLObject.getWQLObject("pdm_produce_workorder").query(" workorder_id = '" + workorder_id + "'").uniqueResult(0);
|
||||
JSONObject form = new JSONObject();
|
||||
JSONObject material = WQLObject.getWQLObject("md_me_materialbase").query("material_id = '" + workOrder.getString("material_id") + "'").uniqueResult(0);
|
||||
JSONObject device_code = WQLObject.getWQLObject("pdm_bi_device").query("device_code = '" +workOrder.getString("current_device_code")+ "'").uniqueResult(0);
|
||||
form.put("workorder_id",workOrder.get("workorder_id"));
|
||||
form.put("workorder_code",workOrder.get("workorder_code"));
|
||||
form.put("qty", workOrder.getString("plan_qty"));
|
||||
form.put("outupperlimit_qty",device_code.getString("outupperlimit_qty"));
|
||||
form.put("material_id",workOrder.get("material_id"));
|
||||
form.put("material_name",material.get("material_name"));
|
||||
form.put("material_code",material.get("material_code"));
|
||||
form.put("material_spec",material.get("material_spec"));
|
||||
form.put("device_code",workOrder.getString("current_device_code"));
|
||||
form.put("is_needmove",workOrder.getString("is_needmove"));
|
||||
return form;
|
||||
}
|
||||
|
||||
/**
|
||||
* 报工操作
|
||||
*
|
||||
|
||||
@@ -109,9 +109,8 @@ public class SpeMachineryTask extends AbstractAcsTask {
|
||||
task.put("material_id", reqestPram.getString("material_id"));
|
||||
task.put("handle_class", this.getClass().getName());
|
||||
task.put("finished_type", "1");
|
||||
task.put("is_delete", "0");
|
||||
String currentUserId = SecurityUtils.getCurrentUserId();
|
||||
task.put("create_id", currentUserId);
|
||||
task.put("is_delete", StatusEnum.LOCK_OFF.getCode());
|
||||
task.put("create_id", SecurityUtils.getCurrentUserId());
|
||||
task.put("create_name", SecurityUtils.getCurrentNickName());
|
||||
task.put("update_id", currentUserId);
|
||||
task.put("update_name", SecurityUtils.getCurrentNickName());
|
||||
|
||||
@@ -754,7 +754,7 @@ export default {
|
||||
var orders = []
|
||||
console.log(rows)
|
||||
rows.forEach((item) => {
|
||||
orders.push(item.workprocedure_id)
|
||||
orders.push(item.workorder_id)
|
||||
})
|
||||
crudProduceshiftorder.submits(orders).then(res => {
|
||||
this.crud.notify('下发成功', CRUD.NOTIFICATION_TYPE.SUCCESS)
|
||||
|
||||
@@ -1,320 +0,0 @@
|
||||
<template>
|
||||
<div>
|
||||
<el-dialog
|
||||
title="物料检测方案设置"
|
||||
append-to-body
|
||||
:visible.sync="crud.status.cu > 0"
|
||||
fullscreen
|
||||
destroy-on-close
|
||||
:before-close="crud.cancelCU"
|
||||
@open="open"
|
||||
>
|
||||
<el-form :inline="true" :model="form" class="demo-form-inline">
|
||||
|
||||
<el-form-item label="物料" prop="material_name">
|
||||
<el-input
|
||||
v-model="form.material_name"
|
||||
style="width: 280px;"
|
||||
placeholder="请选择物料"
|
||||
clearable
|
||||
prefix-icon="el-icon-search"
|
||||
@focus="materShow=true"
|
||||
@clear="form.material_id=''"
|
||||
/>
|
||||
</el-form-item>
|
||||
<el-form-item v-if="false" label="物料" prop="material_id">
|
||||
<el-input v-model.trim="form.material_id" style="width: 280px;" />
|
||||
</el-form-item>
|
||||
|
||||
<el-form-item label="方案名称">
|
||||
<el-select
|
||||
v-model="form.inspection_scheme_id"
|
||||
filterable
|
||||
clearable
|
||||
size="mini"
|
||||
placeholder="方案名称"
|
||||
class="filter-item"
|
||||
@change="handDtl"
|
||||
>
|
||||
<el-option
|
||||
v-for="item in selectList"
|
||||
:label="item.inspection_scheme_name"
|
||||
:value="item.inspection_scheme_id"
|
||||
/>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
|
||||
<el-form-item>
|
||||
<el-form-item>
|
||||
<el-button icon="el-icon-check" type="success" @click="onSubmit">保存</el-button>
|
||||
</el-form-item>
|
||||
<el-form-item>
|
||||
<el-button icon="el-icon-error" type="info" @click="crud.cancelCU">关闭</el-button>
|
||||
</el-form-item>
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
|
||||
<!--表格渲染-->
|
||||
<el-table
|
||||
:data="form.tableData"
|
||||
border
|
||||
size="mini"
|
||||
stripe
|
||||
style="width: 100%"
|
||||
>
|
||||
<el-table-column
|
||||
v-if="false"
|
||||
prop="inspection_item_id"
|
||||
label="项点标识"
|
||||
/>
|
||||
<el-table-column
|
||||
prop="order_index"
|
||||
width="60"
|
||||
label="序号"
|
||||
>
|
||||
<template slot-scope="scope">
|
||||
<span>{{ scope.$index + 1 }}</span>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column
|
||||
prop="inspection_item_code"
|
||||
label="项点编码"
|
||||
/>
|
||||
<el-table-column
|
||||
prop="inspection_item_name"
|
||||
show-overflow-tooltip
|
||||
label="项点名称"
|
||||
/>
|
||||
<el-table-column
|
||||
prop="inspection_item_type_name"
|
||||
label="项点类别"
|
||||
/>
|
||||
<el-table-column
|
||||
prop="workprocedure_name"
|
||||
label="工序名称"
|
||||
/>
|
||||
<el-table-column
|
||||
prop="inspection_type_name"
|
||||
label="检测方式"
|
||||
/>
|
||||
<el-table-column
|
||||
prop="down_limit"
|
||||
label="合格下限(≥)"
|
||||
width="155"
|
||||
>
|
||||
<template slot-scope="scope">
|
||||
<el-input-number
|
||||
v-if="form.tableData[scope.$index].inspection_type==='02'"
|
||||
v-model="form.tableData[scope.$index].down_limit"
|
||||
:precision="4"
|
||||
/>
|
||||
</template>
|
||||
</el-table-column>
|
||||
|
||||
<el-table-column
|
||||
prop="up_limit"
|
||||
label="合格上限(≤)"
|
||||
width="155"
|
||||
>
|
||||
<template slot-scope="scope">
|
||||
<el-input-number
|
||||
v-if="form.tableData[scope.$index].inspection_type==='02'"
|
||||
v-model="form.tableData[scope.$index].up_limit"
|
||||
:precision="4"
|
||||
/>
|
||||
</template>
|
||||
</el-table-column>
|
||||
|
||||
<el-table-column
|
||||
prop="down_limit_value"
|
||||
label="下限临界值(≤)"
|
||||
width="155"
|
||||
>
|
||||
<template slot-scope="scope">
|
||||
<el-input-number
|
||||
v-if="form.tableData[scope.$index].inspection_type==='02'"
|
||||
v-model="form.tableData[scope.$index].down_limit_value"
|
||||
:precision="4"
|
||||
/>
|
||||
</template>
|
||||
</el-table-column>
|
||||
|
||||
<el-table-column
|
||||
prop="up_limit_value"
|
||||
label="上限临界值(≥)"
|
||||
width="155"
|
||||
>
|
||||
<template slot-scope="scope">
|
||||
<el-input-number
|
||||
v-if="form.tableData[scope.$index].inspection_type==='02'"
|
||||
v-model="form.tableData[scope.$index].up_limit_value"
|
||||
:precision="4"
|
||||
/>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column
|
||||
prop="remark"
|
||||
label="备注"
|
||||
>
|
||||
<template slot-scope="scope">
|
||||
<el-input v-model.trim="form.tableData[scope.$index].remark" size="mini" class="edit-input" />
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
<!-- <span slot="footer" class="dialog-footer">
|
||||
<el-button @click="dialogVisible = false">取 消</el-button>
|
||||
<el-button type="primary" @click="dialogVisible = false">确 定</el-button>
|
||||
</span>-->
|
||||
</el-dialog>
|
||||
|
||||
<MaterDtl
|
||||
:dialog-show.sync="materShow"
|
||||
:is-single="true"
|
||||
:mater-opt-code="'00'"
|
||||
@tableChanged2="tableChanged2"
|
||||
/>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import CRUD, { crud, form } from '@crud/crud'
|
||||
import {} from '@/views/wms/ql/materialInspection/materialInspection'
|
||||
import MaterDtl from '@/views/wms/pub/MaterDialog'
|
||||
import crudProductStandard from '@/api/wms/basedata/ql/productStandard'
|
||||
|
||||
const defaultForm = {
|
||||
material_id: '',
|
||||
material_code: '',
|
||||
material_name: '',
|
||||
inspection_scheme_id: '',
|
||||
tableData: []
|
||||
}
|
||||
export default {
|
||||
name: 'AddDialog',
|
||||
components: { MaterDtl },
|
||||
mixins: [crud(), form(defaultForm)],
|
||||
data() {
|
||||
return {
|
||||
selectList: [],
|
||||
materShow: false,
|
||||
dialogVisible: false,
|
||||
inspectionItemType: null
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
open() {
|
||||
crudInspectionSchemeMst.selectList().then(res => {
|
||||
this.selectList = res
|
||||
})
|
||||
this.handDtl2()
|
||||
},
|
||||
handDtl2() { // 修改的时候有物料标识
|
||||
const param = {
|
||||
inspection_scheme_id: this.form.inspection_scheme_id,
|
||||
material_id: this.form.material_id
|
||||
}
|
||||
crudProductStandard.getInspectionSchemeDtl(param).then(res => {
|
||||
const map1 = res.map(function(item) {
|
||||
if (!item.down_limit_value) item.down_limit_value = undefined
|
||||
if (!item.up_limit_value) item.up_limit_value = undefined
|
||||
if (!item.down_limit) item.down_limit = undefined
|
||||
if (!item.up_limit) item.up_limit = undefined
|
||||
return item
|
||||
})
|
||||
this.form.tableData = map1
|
||||
})
|
||||
},
|
||||
handDtl() {
|
||||
const param = {
|
||||
inspection_scheme_id: this.form.inspection_scheme_id
|
||||
}
|
||||
crudProductStandard.getInspectionSchemeDtl(param).then(res => {
|
||||
const map1 = res.map(function(item) {
|
||||
if (!item.down_limit_value) item.down_limit_value = undefined
|
||||
if (!item.up_limit_value) item.up_limit_value = undefined
|
||||
if (!item.down_limit) item.down_limit = undefined
|
||||
if (!item.up_limit) item.up_limit = undefined
|
||||
return item
|
||||
})
|
||||
this.form.tableData = map1
|
||||
})
|
||||
},
|
||||
hand() {
|
||||
|
||||
},
|
||||
onSubmit() {
|
||||
let optType = null
|
||||
|
||||
const isCopyAdd = this.$parent.isCopyAdd
|
||||
debugger
|
||||
if (isCopyAdd === '1') {
|
||||
optType = '01' // 复制新增
|
||||
} else if (this.crud.status.add === 1) {
|
||||
optType = '02' // 新增
|
||||
} else {
|
||||
this.crud.status.add
|
||||
optType = '03' // 修改
|
||||
}
|
||||
// 判断是新增还是修改还是复制新增
|
||||
this.form.optType = optType
|
||||
const arr = this.form.tableData
|
||||
const that = this
|
||||
const errMsgList = []
|
||||
const data = arr.map(function(item) {
|
||||
debugger
|
||||
// 合格上下限同时为填入的数字或同时为空
|
||||
if ((!isNaN(item.up_limit) && !isNaN(item.down_limit)) || (isNaN(item.up_limit) && isNaN(item.down_limit))) {
|
||||
// 临界上下限同时为填入的数字或同时为空
|
||||
if ((!isNaN(item.up_limit_value) && !isNaN(item.down_limit_value)) || (isNaN(item.up_limit_value) && isNaN(item.down_limit_value))) {
|
||||
if (isNaN(item.up_limit) && !isNaN(item.up_limit_value)) {
|
||||
errMsgList.push(item.order_index)
|
||||
}
|
||||
return item
|
||||
} else {
|
||||
errMsgList.push(item.order_index)
|
||||
}
|
||||
} else {
|
||||
errMsgList.push(item.order_index)
|
||||
return item
|
||||
}
|
||||
})
|
||||
if (errMsgList.length > 0) {
|
||||
that.crud.notify(errMsgList.toString() + '行格式错误,请检查!', CRUD.NOTIFICATION_TYPE.INFO)
|
||||
return
|
||||
}
|
||||
|
||||
this.form.tableData = data
|
||||
crudProductStandard.saveData(this.form).then(res => {
|
||||
this.crud.cancelCU()
|
||||
this.$parent.isCopyAdd = null
|
||||
this.crud.toQuery()
|
||||
this.notify('操作成功', 'success')
|
||||
})
|
||||
},
|
||||
notify(title, type) {
|
||||
this.$notify({
|
||||
title: title,
|
||||
type: type,
|
||||
duration: 2500
|
||||
})
|
||||
},
|
||||
tableChanged2(data) {
|
||||
// 新增一行物料时,给行进行赋值
|
||||
this.form.material_id = data.material_id
|
||||
this.form.material_code = data.material_code
|
||||
this.form.material_name = data.material_name + '##' + data.material_code
|
||||
},
|
||||
close() {
|
||||
this.$emit('update:visiable1', false)
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<style rel="stylesheet/scss" lang="scss">
|
||||
.edit-input {
|
||||
.el-input__inner {
|
||||
border: 1px solid #e5e6e7;
|
||||
}
|
||||
}
|
||||
</style>
|
||||
@@ -1,142 +0,0 @@
|
||||
<template>
|
||||
<div class="app-container">
|
||||
<!--工具栏-->
|
||||
<div class="head-container">
|
||||
<div v-if="crud.props.searchToggle">
|
||||
<!-- 搜索 -->
|
||||
<label class="el-form-item-label">模糊搜索</label>
|
||||
<el-input v-model="query.blurry" clearable placeholder="项点名称" style="width: 185px;" class="filter-item" @keyup.enter.native="crud.toQuery" />
|
||||
<rrOperation :crud="crud" />
|
||||
</div>
|
||||
<!--如果想在工具栏加入更多按钮,可以使用插槽方式, slot = 'left' or 'right'-->
|
||||
<crudOperation :permission="permission" />
|
||||
<!--表单组件-->
|
||||
<el-dialog :close-on-click-modal="false" :before-close="crud.cancelCU" :visible.sync="crud.status.cu > 0" :title="crud.status.title" width="475px">
|
||||
<el-form ref="form" :model="form" :rules="rules" size="mini" label-width="120px">
|
||||
<el-form-item label="项点名称" prop="name">
|
||||
<el-input v-model="form.name" style="width: 250px;" />
|
||||
</el-form-item>
|
||||
<el-form-item label="标准值">
|
||||
<el-input v-model="form.standard" style="width: 250px;" />
|
||||
</el-form-item>
|
||||
<el-form-item label="项点类型" prop="inspectionType">
|
||||
<el-select
|
||||
v-model="form.inspectionType"
|
||||
placeholder=""
|
||||
style="width: 250px"
|
||||
>
|
||||
<el-option
|
||||
v-for="item in dict.INSPECTION_POINT_TYPE"
|
||||
:key="item.id"
|
||||
:label="item.label"
|
||||
:value="item.value"
|
||||
/>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
|
||||
<el-form-item label="备注">
|
||||
<el-input v-model="form.remark" :rows="3" type="textarea" style="width: 250px;" />
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
<div slot="footer" class="dialog-footer">
|
||||
<el-button type="text" @click="crud.cancelCU">取消</el-button>
|
||||
<el-button :loading="crud.cu === 2" type="primary" @click="crud.submitCU">确认</el-button>
|
||||
</div>
|
||||
</el-dialog>
|
||||
<!--表格渲染-->
|
||||
<el-table ref="table" v-loading="crud.loading" :data="crud.data" size="mini" style="width: 100%;" @selection-change="crud.selectionChangeHandler">
|
||||
<el-table-column type="selection" width="55" />
|
||||
<el-table-column prop="inspectionCode" label="项点编码" />
|
||||
<el-table-column prop="name" label="项点名称" />
|
||||
<el-table-column prop="standard" label="标准值">
|
||||
<template slot-scope="scope">
|
||||
{{ is_or_no(scope.row.standard, scope.row.inspectionType) }}
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column prop="inspectionType" label="项点类型">
|
||||
<template slot-scope="scope">
|
||||
{{ dict.label.INSPECTION_POINT_TYPE[scope.row.inspectionType] }}
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column prop="remark" label="备注" />
|
||||
<el-table-column v-permission="[]" label="操作" width="120px" align="center" fixed="right">
|
||||
<template slot-scope="scope">
|
||||
<udOperation
|
||||
:data="scope.row"
|
||||
:permission="permission"
|
||||
/>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
<!--分页组件-->
|
||||
<pagination />
|
||||
</div>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import crudInspection from '@/views/wms/ql/inspection/inspectionpoint'
|
||||
import CRUD, { presenter, header, form, crud } from '@crud/crud'
|
||||
import rrOperation from '@crud/RR.operation'
|
||||
import crudOperation from '@crud/CRUD.operation'
|
||||
import udOperation from '@crud/UD.operation'
|
||||
import pagination from '@crud/Pagination'
|
||||
|
||||
const defaultForm = { inspectionType: '1', inspectionId: null, inspectionCode: null, name: null, standard: null, remark: null }
|
||||
export default {
|
||||
name: 'InspectionPoint',
|
||||
dicts: ['INSPECTION_POINT_TYPE'],
|
||||
components: { pagination, crudOperation, rrOperation, udOperation },
|
||||
mixins: [presenter(), header(), form(defaultForm), crud()],
|
||||
cruds() {
|
||||
return CRUD({ title: '质检项点', url: 'api/mdQlInspectionpoint', idField: 'inspectionId', sort: 'id,desc',
|
||||
optShow: {
|
||||
add: true,
|
||||
edit: true,
|
||||
del: true,
|
||||
reset: true,
|
||||
download: false
|
||||
},
|
||||
crudMethod: { ...crudInspection }})
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
permission: {
|
||||
},
|
||||
rules: {
|
||||
inspectionCode: [
|
||||
{ required: true, message: '项点编码不能为空', trigger: 'blur' }
|
||||
],
|
||||
name: [
|
||||
{ required: true, message: '项点名称不能为空', trigger: 'blur' }
|
||||
],
|
||||
inspectionType: [
|
||||
{ required: true, message: '项点类型不能为空', trigger: 'blur' }
|
||||
]
|
||||
},
|
||||
queryTypeOptions: [
|
||||
{ key: 'inspection_code', display_name: '项点编码' }
|
||||
]
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
is_or_no(val, type) {
|
||||
if (type === '01' && val === '1') {
|
||||
return '是'
|
||||
} else if (type === '01' && val === '0') {
|
||||
return '否'
|
||||
} else {
|
||||
return val
|
||||
}
|
||||
},
|
||||
// 钩子:在获取表格数据之前执行,false 则代表不获取数据
|
||||
[CRUD.HOOK.beforeRefresh]() {
|
||||
return true
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<style scoped>
|
||||
|
||||
</style>
|
||||
@@ -1,35 +0,0 @@
|
||||
import request from '@/utils/request'
|
||||
|
||||
export function add(data) {
|
||||
return request({
|
||||
url: '/api/materialInspection/create',
|
||||
method: 'post',
|
||||
data
|
||||
})
|
||||
}
|
||||
|
||||
export function del(ids) {
|
||||
return request({
|
||||
url: '/api/materialInspection/delete',
|
||||
method: 'post',
|
||||
data: ids
|
||||
})
|
||||
}
|
||||
|
||||
export function edit(data) {
|
||||
return request({
|
||||
url: '/api/materialInspection/update',
|
||||
method: 'post',
|
||||
data
|
||||
})
|
||||
}
|
||||
|
||||
export function edit(data) {
|
||||
return request({
|
||||
url: '/api/materialInspection/update',
|
||||
method: 'post',
|
||||
data
|
||||
})
|
||||
}
|
||||
|
||||
export default { add, edit, del }
|
||||
Reference in New Issue
Block a user