代码更新
This commit is contained in:
@@ -3,6 +3,7 @@ package org.nl.wms.ext.mes.service.impl;
|
||||
import cn.hutool.core.date.DateUtil;
|
||||
import cn.hutool.core.util.IdUtil;
|
||||
import cn.hutool.core.util.ObjectUtil;
|
||||
import cn.hutool.core.util.StrUtil;
|
||||
import com.alibaba.fastjson.JSONArray;
|
||||
import com.alibaba.fastjson.JSONObject;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
@@ -81,7 +82,7 @@ public class MesToLmsServiceImpl implements MesToLmsService {
|
||||
json.put("product_area", jsonPoint.getString("product_area"));
|
||||
json.put("point_code", jsonPoint.getString("point_code"));
|
||||
json.put("realstart_time", DateUtil.now());
|
||||
json.put("status", "01");
|
||||
json.put("status", "1");
|
||||
json.put("is_delete", "0");
|
||||
json.put("agvno", "0");
|
||||
json.put("productin_qty", 0);
|
||||
@@ -176,12 +177,111 @@ public class MesToLmsServiceImpl implements MesToLmsService {
|
||||
@Override
|
||||
public JSONObject cutPlanTransfer(JSONObject param) {
|
||||
log.info("cutPlanTransfer接口输入参数为:-------------------"+param.toString());
|
||||
|
||||
String orderType = param.getString("OrderType"); // 分切订单类型
|
||||
String ContainerName = param.getString("ContainerName"); // 子卷号
|
||||
String ProductName = param.getString("ProductName"); // 产品编码
|
||||
String Description = param.getString("Description"); // 产品名称
|
||||
String Warehouse = param.getString("Warehouse"); // 来源卷位置
|
||||
String ResourceName = param.getString("ResourceName"); // 分切机台编码
|
||||
String SplitGroup = param.getString("SplitGroup"); // 分切组
|
||||
String ManufactureSort = param.getString("ManufactureSort"); // 生产顺序
|
||||
String MfgOrderName = param.getString("MfgOrderName"); // 生产订单
|
||||
String ManufactureDate = param.getString("ManufactureDate"); // 生产日期
|
||||
String PaperTubeOrFRP = param.getString("PaperTubeOrFRP"); // 管件类型
|
||||
String SplitBreadth = param.getString("SplitBreadth"); // 子卷幅宽
|
||||
String SplitHeight = param.getString("SplitHeight"); // 子卷理论长度
|
||||
String SplitWeight = param.getString("SplitWeight"); // 子卷理论重量
|
||||
|
||||
WQLObject tab = WQLObject.getWQLObject("PDM_BI_SlittingProductionPlan");
|
||||
|
||||
JSONObject result = new JSONObject();
|
||||
result.put("RTYPE", "S");
|
||||
result.put("RTMSG", "操作成功!");
|
||||
result.put("RTOAL", 1);
|
||||
result.put("RTDAT", null);
|
||||
System.out.println(result);
|
||||
try {
|
||||
// 基础校验
|
||||
if (ObjectUtil.isEmpty(orderType)) throw new BadRequestException("分切订单类型不能为空");
|
||||
if (ObjectUtil.isEmpty(ContainerName)) throw new BadRequestException("子卷号不能为空");
|
||||
if (ObjectUtil.isEmpty(ProductName)) throw new BadRequestException("产品编码不能为空");
|
||||
if (ObjectUtil.isEmpty(Description)) throw new BadRequestException("产品名称不能为空");
|
||||
if (ObjectUtil.isEmpty(Warehouse)) throw new BadRequestException("来源卷位置不能为空");
|
||||
if (ObjectUtil.isEmpty(ResourceName)) throw new BadRequestException("分切机台编码不能为空");
|
||||
if (ObjectUtil.isEmpty(SplitGroup)) throw new BadRequestException("分切组不能为空");
|
||||
if (ObjectUtil.isEmpty(ManufactureSort)) throw new BadRequestException("生产顺序不能为空");
|
||||
if (ObjectUtil.isEmpty(MfgOrderName)) throw new BadRequestException("生产订单不能为空");
|
||||
if (ObjectUtil.isEmpty(ManufactureDate)) throw new BadRequestException("生产日期不能为空");
|
||||
if (ObjectUtil.isEmpty(PaperTubeOrFRP)) throw new BadRequestException("管件类型不能为空");
|
||||
if (ObjectUtil.isEmpty(SplitBreadth)) throw new BadRequestException("子卷幅宽不能为空");
|
||||
if (ObjectUtil.isEmpty(SplitHeight)) throw new BadRequestException("子卷理论长度不能为空");
|
||||
if (ObjectUtil.isEmpty(SplitWeight)) throw new BadRequestException("子卷理论重量不能为空");
|
||||
|
||||
/* orderType
|
||||
* 1.当订单类型为1(常规)时 ParentContainerName 来源母卷号不能为空
|
||||
* 2.当订单类型为2(改制)时 RestructContainerName 改制来源子卷号、PackageBoxSN 子卷立库木箱号 不能为空
|
||||
*/
|
||||
if (StrUtil.equals(orderType, "1")) {
|
||||
if (ObjectUtil.isEmpty(param.getString("ParentContainerName"))) throw new BadRequestException("来源母卷号不能为空");
|
||||
} else {
|
||||
if (ObjectUtil.isEmpty(param.getString("RestructContainerName"))) throw new BadRequestException("改制来源子卷号不能为空");
|
||||
if (ObjectUtil.isEmpty(param.getString("PackageBoxSN"))) throw new BadRequestException("子卷立库木箱号不能为空");
|
||||
}
|
||||
/* PaperTubeOrFRP
|
||||
* 1.当管件类型为1(纸筒)时 PaperTubeMaterial 纸筒物料编码、PaperTubeDescription 纸筒物料描述、PaperTubeModel 纸筒规格 不能为空
|
||||
* 2.当管件类型为2(FRP管)时 FRPMaterial FRP管物料编码、FRPDescription FRP管物料描述、FRPModel FRP管规格 不能为空
|
||||
*/
|
||||
if (StrUtil.equals(PaperTubeOrFRP, "1")) {
|
||||
if (ObjectUtil.isEmpty(param.getString("PaperTubeMaterial"))) throw new BadRequestException("纸筒物料编码不能为空");
|
||||
if (ObjectUtil.isEmpty(param.getString("PaperTubeDescription"))) throw new BadRequestException("纸筒物料描述不能为空");
|
||||
if (ObjectUtil.isEmpty(param.getString("PaperTubeModel"))) throw new BadRequestException("纸筒规格不能为空");
|
||||
} else {
|
||||
if (ObjectUtil.isEmpty(param.getString("FRPMaterial"))) throw new BadRequestException("FRP管物料编码不能为空");
|
||||
if (ObjectUtil.isEmpty(param.getString("FRPDescription"))) throw new BadRequestException("FRP管物料描述不能为空");
|
||||
if (ObjectUtil.isEmpty(param.getString("FRPModel"))) throw new BadRequestException("FRP管规格不能为空");
|
||||
}
|
||||
|
||||
JSONObject json = new JSONObject();
|
||||
json.put("workorder_id", IdUtil.getSnowflake(1,1).nextId());
|
||||
json.put("order_type", orderType);
|
||||
json.put("container_name", ContainerName);
|
||||
json.put("product_name", ProductName);
|
||||
json.put("description", Description);
|
||||
json.put("parent_container_name", param.getString("ParentContainerName"));
|
||||
json.put("restruct_container_name", param.getString("RestructContainerName"));
|
||||
json.put("package_box_sn", param.getString("PackageBoxSN"));
|
||||
json.put("ware_house", Warehouse);
|
||||
json.put("resource_name", ResourceName);
|
||||
json.put("split_group", SplitGroup);
|
||||
json.put("manufacture_sort", ManufactureSort);
|
||||
json.put("mfg_order_name", MfgOrderName);
|
||||
json.put("manufacture_date", ManufactureDate);
|
||||
json.put("paper_tube_or_FRP", PaperTubeOrFRP);
|
||||
json.put("paper_tube_material", param.getString("PaperTubeMaterial"));
|
||||
json.put("paper_tube_description", param.getString("PaperTubeDescription"));
|
||||
json.put("paper_tube_model", param.getString("PaperTubeModel"));
|
||||
json.put("FRP_material", param.getString("FRPMaterial"));
|
||||
json.put("FRP_description", param.getString("FRPDescription"));
|
||||
json.put("FRP_model", param.getString("FRPModel"));
|
||||
json.put("split_breadth", SplitBreadth);
|
||||
json.put("split_height", SplitHeight);
|
||||
json.put("split_weight", SplitWeight);
|
||||
json.put("start_time",DateUtil.now());
|
||||
json.put("status","1");
|
||||
json.put("is_parent_ok","0");
|
||||
json.put("is_child_tz_ok","0");
|
||||
json.put("is_child_ps_ok","0");
|
||||
json.put("is_delete","0");
|
||||
tab.insert(json);
|
||||
|
||||
result.put("RTYPE", "S");
|
||||
result.put("RTMSG", "操作成功!");
|
||||
result.put("RTOAL", 1);
|
||||
result.put("RTDAT", null);
|
||||
System.out.println(result);
|
||||
} catch (Exception e) {
|
||||
result.put("RTYPE", "S");
|
||||
result.put("RTMSG", "操作失败!"+e.getMessage());
|
||||
result.put("RTOAL", 0);
|
||||
result.put("RTDAT", null);
|
||||
System.out.println(result);
|
||||
}
|
||||
return result;
|
||||
}
|
||||
|
||||
|
||||
@@ -0,0 +1,101 @@
|
||||
|
||||
package org.nl.wms.pdm.rest;
|
||||
|
||||
|
||||
import com.alibaba.fastjson.JSONObject;
|
||||
import org.nl.wms.pdm.service.SlittingproductionplanService;
|
||||
import org.nl.wms.pdm.service.dto.SlittingproductionplanDto;
|
||||
import org.springframework.data.domain.Pageable;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import org.nl.modules.logging.annotation.Log;
|
||||
import org.springframework.http.HttpStatus;
|
||||
import org.springframework.http.ResponseEntity;
|
||||
import cn.dev33.satoken.annotation.SaCheckPermission;
|
||||
import org.springframework.validation.annotation.Validated;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
import io.swagger.annotations.*;
|
||||
|
||||
import java.util.Map;
|
||||
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
|
||||
/**
|
||||
* @author liuxy
|
||||
* @date 2022-10-09
|
||||
**/
|
||||
@RestController
|
||||
@RequiredArgsConstructor
|
||||
@Api(tags = "分切计划管理")
|
||||
@RequestMapping("/api/slittingproductionplan")
|
||||
@Slf4j
|
||||
public class SlittingproductionplanController {
|
||||
|
||||
private final SlittingproductionplanService slittingproductionplanService;
|
||||
|
||||
@GetMapping
|
||||
@Log("查询分切计划")
|
||||
@ApiOperation("查询分切计划")
|
||||
//@SaCheckPermission("@el.check('slittingproductionplan:list')")
|
||||
public ResponseEntity<Object> query(@RequestParam Map whereJson, Pageable page) {
|
||||
return new ResponseEntity<>(slittingproductionplanService.queryAll(whereJson, page), HttpStatus.OK);
|
||||
}
|
||||
|
||||
@PostMapping
|
||||
@Log("新增分切计划")
|
||||
@ApiOperation("新增分切计划")
|
||||
//@SaCheckPermission("@el.check('slittingproductionplan:add')")
|
||||
public ResponseEntity<Object> create(@Validated @RequestBody SlittingproductionplanDto dto) {
|
||||
slittingproductionplanService.create(dto);
|
||||
return new ResponseEntity<>(HttpStatus.CREATED);
|
||||
}
|
||||
|
||||
@PutMapping
|
||||
@Log("修改分切计划")
|
||||
@ApiOperation("修改分切计划")
|
||||
//@SaCheckPermission("@el.check('slittingproductionplan:edit')")
|
||||
public ResponseEntity<Object> update(@Validated @RequestBody SlittingproductionplanDto dto) {
|
||||
slittingproductionplanService.update(dto);
|
||||
return new ResponseEntity<>(HttpStatus.NO_CONTENT);
|
||||
}
|
||||
|
||||
@Log("删除分切计划")
|
||||
@ApiOperation("删除分切计划")
|
||||
//@SaCheckPermission("@el.check('slittingproductionplan:del')")
|
||||
@DeleteMapping
|
||||
public ResponseEntity<Object> delete(@RequestBody Long[] ids) {
|
||||
slittingproductionplanService.deleteAll(ids);
|
||||
return new ResponseEntity<>(HttpStatus.OK);
|
||||
}
|
||||
|
||||
@Log("上料完成")
|
||||
@ApiOperation("上料完成")
|
||||
@PostMapping("/upMaterFinish")
|
||||
public ResponseEntity<Object> upMaterFinish(@RequestBody JSONObject whereJson) {
|
||||
slittingproductionplanService.upMaterFinish(whereJson);
|
||||
return new ResponseEntity<>(HttpStatus.OK);
|
||||
}
|
||||
|
||||
@Log("套管完成")
|
||||
@ApiOperation("套管完成")
|
||||
@PostMapping("/caseFinish")
|
||||
public ResponseEntity<Object> caseFinish(@RequestBody JSONObject whereJson) {
|
||||
slittingproductionplanService.caseFinish(whereJson);
|
||||
return new ResponseEntity<>(HttpStatus.OK);
|
||||
}
|
||||
|
||||
@Log("配送完成")
|
||||
@ApiOperation("配送完成")
|
||||
@PostMapping("/sendFinish")
|
||||
public ResponseEntity<Object> sendFinish(@RequestBody JSONObject whereJson) {
|
||||
slittingproductionplanService.sendFinish(whereJson);
|
||||
return new ResponseEntity<>(HttpStatus.OK);
|
||||
}
|
||||
|
||||
@Log("强制完成")
|
||||
@ApiOperation("强制完成")
|
||||
@PostMapping("/compelFinish")
|
||||
public ResponseEntity<Object> compelFinish(@RequestBody JSONObject whereJson) {
|
||||
slittingproductionplanService.compelFinish(whereJson);
|
||||
return new ResponseEntity<>(HttpStatus.OK);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,102 @@
|
||||
|
||||
package org.nl.wms.pdm.service;
|
||||
|
||||
import com.alibaba.fastjson.JSONObject;
|
||||
import org.nl.wms.pdm.service.dto.SlittingproductionplanDto;
|
||||
import org.springframework.data.domain.Pageable;
|
||||
|
||||
import java.util.Map;
|
||||
import java.util.List;
|
||||
import java.io.IOException;
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
|
||||
/**
|
||||
* @author liuxy
|
||||
* @description 服务接口
|
||||
* @date 2022-10-09
|
||||
**/
|
||||
public interface SlittingproductionplanService {
|
||||
|
||||
/**
|
||||
* 查询数据分页
|
||||
*
|
||||
* @param whereJson 条件
|
||||
* @param page 分页参数
|
||||
* @return Map<String, Object>
|
||||
*/
|
||||
Map<String, Object> queryAll(Map whereJson, Pageable page);
|
||||
|
||||
/**
|
||||
* 查询所有数据不分页
|
||||
*
|
||||
* @param whereJson 条件参数
|
||||
* @return List<SlittingproductionplanDto>
|
||||
*/
|
||||
List<SlittingproductionplanDto> queryAll(Map whereJson);
|
||||
|
||||
/**
|
||||
* 根据ID查询
|
||||
*
|
||||
* @param workorder_id ID
|
||||
* @return Slittingproductionplan
|
||||
*/
|
||||
SlittingproductionplanDto findById(Long workorder_id);
|
||||
|
||||
/**
|
||||
* 根据编码查询
|
||||
*
|
||||
* @param code code
|
||||
* @return Slittingproductionplan
|
||||
*/
|
||||
SlittingproductionplanDto findByCode(String code);
|
||||
|
||||
|
||||
/**
|
||||
* 创建
|
||||
*
|
||||
* @param dto /
|
||||
*/
|
||||
void create(SlittingproductionplanDto dto);
|
||||
|
||||
/**
|
||||
* 编辑
|
||||
*
|
||||
* @param dto /
|
||||
*/
|
||||
void update(SlittingproductionplanDto dto);
|
||||
|
||||
/**
|
||||
* 多选删除
|
||||
*
|
||||
* @param ids /
|
||||
*/
|
||||
void deleteAll(Long[] ids);
|
||||
|
||||
/**
|
||||
* 上料完成
|
||||
*
|
||||
* @param whereJson /
|
||||
*/
|
||||
void upMaterFinish(JSONObject whereJson);
|
||||
|
||||
/**
|
||||
* 套管完成
|
||||
*
|
||||
* @param whereJson /
|
||||
*/
|
||||
void caseFinish(JSONObject whereJson);
|
||||
|
||||
/**
|
||||
* 配送完成
|
||||
*
|
||||
* @param whereJson /
|
||||
*/
|
||||
void sendFinish(JSONObject whereJson);
|
||||
|
||||
/**
|
||||
* 强制完成
|
||||
*
|
||||
* @param whereJson /
|
||||
*/
|
||||
void compelFinish(JSONObject whereJson);
|
||||
}
|
||||
@@ -0,0 +1,141 @@
|
||||
package org.nl.wms.pdm.service.dto;
|
||||
|
||||
import lombok.Data;
|
||||
import java.math.BigDecimal;
|
||||
import java.io.Serializable;
|
||||
import com.fasterxml.jackson.databind.annotation.JsonSerialize;
|
||||
import com.fasterxml.jackson.databind.ser.std.ToStringSerializer;
|
||||
|
||||
/**
|
||||
* @description /
|
||||
* @author liuxy
|
||||
* @date 2022-10-09
|
||||
**/
|
||||
@Data
|
||||
public class SlittingproductionplanDto implements Serializable {
|
||||
|
||||
/** 分切计划标识 */
|
||||
/** 防止精度丢失 */
|
||||
@JsonSerialize(using= ToStringSerializer.class)
|
||||
private Long workorder_id;
|
||||
|
||||
/** 分切订单类型 */
|
||||
private String order_type;
|
||||
|
||||
/** 子卷号 */
|
||||
private String container_name;
|
||||
|
||||
/** 产品编码 */
|
||||
private String product_name;
|
||||
|
||||
/** 产品描述 */
|
||||
private String description;
|
||||
|
||||
/** 来源母卷号 */
|
||||
private String parent_container_name;
|
||||
|
||||
/** 改制来源子卷号 */
|
||||
private String restruct_container_name;
|
||||
|
||||
/** 子卷立库木箱号 */
|
||||
private String package_box_sn;
|
||||
|
||||
/** 来源卷位置 */
|
||||
private String ware_house;
|
||||
|
||||
/** 分切机台编码 */
|
||||
private String resource_name;
|
||||
|
||||
/** 分切组 */
|
||||
private String split_group;
|
||||
|
||||
/** 生产顺序 */
|
||||
private BigDecimal manufacture_sort;
|
||||
|
||||
/** 生产订单 */
|
||||
private String mfg_order_name;
|
||||
|
||||
/** 生产日期 */
|
||||
private String manufacture_date;
|
||||
|
||||
/** 管件类型 */
|
||||
private String paper_tube_or_FRP;
|
||||
|
||||
/** 纸筒物料编码 */
|
||||
private String paper_tube_material;
|
||||
|
||||
/** 纸筒物料描述 */
|
||||
private String paper_tube_description;
|
||||
|
||||
/** 纸筒规格 */
|
||||
private String paper_tube_model;
|
||||
|
||||
/** FRP管物料编码 */
|
||||
private String FRP_material;
|
||||
|
||||
/** FRP管物料描述 */
|
||||
private String FRP_description;
|
||||
|
||||
/** FRP管规格 */
|
||||
private String FRP_model;
|
||||
|
||||
/** 子卷幅宽 */
|
||||
private BigDecimal split_breadth;
|
||||
|
||||
/** 子卷理论长度 */
|
||||
private BigDecimal split_height;
|
||||
|
||||
/** 子卷理论重量 */
|
||||
private BigDecimal split_weight;
|
||||
|
||||
/** 开始时间 */
|
||||
private String start_time;
|
||||
|
||||
/** 结束时间 */
|
||||
private String end_time;
|
||||
|
||||
/** 状态 */
|
||||
private String status;
|
||||
|
||||
/** 备注 */
|
||||
private String remark;
|
||||
|
||||
/** 创建人 */
|
||||
private Long create_id;
|
||||
|
||||
/** 创建人姓名 */
|
||||
private String create_name;
|
||||
|
||||
/** 创建时间 */
|
||||
private String create_time;
|
||||
|
||||
/** 修改人 */
|
||||
private Long update_optid;
|
||||
|
||||
/** 修改人姓名 */
|
||||
private String update_optname;
|
||||
|
||||
/** 修改时间 */
|
||||
private String update_time;
|
||||
|
||||
/** 部门ID */
|
||||
private Long sysdeptid;
|
||||
|
||||
/** 公司ID */
|
||||
private Long syscompanyid;
|
||||
|
||||
/** 是否删除 */
|
||||
private String is_delete;
|
||||
|
||||
/** 上料完成 */
|
||||
private String is_parent_ok;
|
||||
|
||||
/** 子卷套轴完成 */
|
||||
private String is_child_tz_ok;
|
||||
|
||||
/** 子卷配送完成 */
|
||||
private String is_child_ps_ok;
|
||||
|
||||
/** 气涨轴编码 */
|
||||
private String qzzno;
|
||||
}
|
||||
@@ -156,7 +156,7 @@ public class RawfoilworkorderServiceImpl implements RawfoilworkorderService {
|
||||
WQLObject tab = WQLObject.getWQLObject("PDM_BI_RawFoilWorkOrder");
|
||||
|
||||
JSONObject json = tab.query("workorder_id = '" + workorder_id + "'").uniqueResult(0);
|
||||
json.put("status", "02");
|
||||
json.put("status", "2");
|
||||
json.put("finish_type", "02");
|
||||
json.put("realend_time", DateUtil.now());
|
||||
json.put("update_optid", currentUserId);
|
||||
|
||||
@@ -0,0 +1,238 @@
|
||||
|
||||
package org.nl.wms.pdm.service.impl;
|
||||
|
||||
|
||||
import cn.hutool.core.map.MapUtil;
|
||||
import cn.hutool.core.util.StrUtil;
|
||||
import com.alibaba.fastjson.JSON;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import org.nl.modules.common.exception.BadRequestException;
|
||||
import org.nl.modules.wql.WQL;
|
||||
import org.nl.wms.pdm.service.SlittingproductionplanService;
|
||||
import org.nl.wms.pdm.service.dto.SlittingproductionplanDto;
|
||||
import org.springframework.stereotype.Service;
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
|
||||
import org.springframework.data.domain.Pageable;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
import cn.hutool.core.date.DateUtil;
|
||||
import cn.hutool.core.util.IdUtil;
|
||||
import com.alibaba.fastjson.JSONArray;
|
||||
import com.alibaba.fastjson.JSONObject;
|
||||
import org.nl.modules.common.utils.SecurityUtils;
|
||||
import org.nl.modules.wql.core.bean.ResultBean;
|
||||
import org.nl.modules.wql.core.bean.WQLObject;
|
||||
import org.nl.modules.wql.util.WqlUtil;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import cn.hutool.core.util.ObjectUtil;
|
||||
|
||||
/**
|
||||
* @author liuxy
|
||||
* @description 服务实现
|
||||
* @date 2022-10-09
|
||||
**/
|
||||
@Service
|
||||
@RequiredArgsConstructor
|
||||
@Slf4j
|
||||
public class SlittingproductionplanServiceImpl implements SlittingproductionplanService {
|
||||
|
||||
@Override
|
||||
public Map<String, Object> queryAll(Map whereJson, Pageable page) {
|
||||
String order_type = MapUtil.getStr(whereJson, "order_type");
|
||||
String product_area = MapUtil.getStr(whereJson, "product_area");
|
||||
String status = MapUtil.getStr(whereJson, "status");
|
||||
String resource_name = MapUtil.getStr(whereJson, "resource_name");
|
||||
String parent_container_name = MapUtil.getStr(whereJson, "parent_container_name");
|
||||
String container_name = MapUtil.getStr(whereJson, "container_name");
|
||||
String begin_time = MapUtil.getStr(whereJson, "begin_time");
|
||||
String end_time = MapUtil.getStr(whereJson, "end_time");
|
||||
|
||||
JSONObject map = new JSONObject();
|
||||
map.put("flag", "1");
|
||||
map.put("order_type", order_type);
|
||||
map.put("product_area", product_area);
|
||||
map.put("status", status);
|
||||
map.put("begin_time", begin_time);
|
||||
map.put("end_time", end_time);
|
||||
if (ObjectUtil.isNotEmpty(resource_name)) map.put("resource_name","%"+resource_name+"%");
|
||||
if (ObjectUtil.isNotEmpty(parent_container_name)) map.put("parent_container_name","%"+parent_container_name+"%");
|
||||
if (ObjectUtil.isNotEmpty(container_name)) map.put("container_name","%"+container_name+"%");
|
||||
|
||||
JSONObject json = WQL.getWO("PDM_BI_SLIDTTINGPLAN_01").addParamMap(map).pageQuery(WqlUtil.getHttpContext(page), "plan.update_time DESC");
|
||||
return json;
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<SlittingproductionplanDto> queryAll(Map whereJson) {
|
||||
WQLObject wo = WQLObject.getWQLObject("pdm_bi_slittingproductionplan");
|
||||
JSONArray arr = wo.query().getResultJSONArray(0);
|
||||
if (ObjectUtil.isNotEmpty(arr)) return arr.toJavaList(SlittingproductionplanDto.class);
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public SlittingproductionplanDto findById(Long workorder_id) {
|
||||
WQLObject wo = WQLObject.getWQLObject("pdm_bi_slittingproductionplan");
|
||||
JSONObject json = wo.query("workorder_id = '" + workorder_id + "'").uniqueResult(0);
|
||||
if (ObjectUtil.isNotEmpty(json)) {
|
||||
return json.toJavaObject(SlittingproductionplanDto.class);
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public SlittingproductionplanDto findByCode(String code) {
|
||||
WQLObject wo = WQLObject.getWQLObject("pdm_bi_slittingproductionplan");
|
||||
JSONObject json = wo.query("code ='" + code + "'").uniqueResult(0);
|
||||
if (ObjectUtil.isNotEmpty(json)) {
|
||||
return json.toJavaObject(SlittingproductionplanDto.class);
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
@Transactional(rollbackFor = Exception.class)
|
||||
public void create(SlittingproductionplanDto dto) {
|
||||
Long currentUserId = SecurityUtils.getCurrentUserId();
|
||||
String nickName = SecurityUtils.getCurrentNickName();
|
||||
String now = DateUtil.now();
|
||||
|
||||
dto.setWorkorder_id(IdUtil.getSnowflake(1, 1).nextId());
|
||||
dto.setCreate_id(currentUserId);
|
||||
dto.setCreate_name(nickName);
|
||||
dto.setUpdate_optid(currentUserId);
|
||||
dto.setUpdate_optname(nickName);
|
||||
dto.setUpdate_time(now);
|
||||
dto.setCreate_time(now);
|
||||
|
||||
WQLObject wo = WQLObject.getWQLObject("pdm_bi_slittingproductionplan");
|
||||
JSONObject json = JSONObject.parseObject(JSON.toJSONString(dto));
|
||||
wo.insert(json);
|
||||
}
|
||||
|
||||
@Override
|
||||
@Transactional(rollbackFor = Exception.class)
|
||||
public void update(SlittingproductionplanDto dto) {
|
||||
SlittingproductionplanDto entity = this.findById(dto.getWorkorder_id());
|
||||
if (entity == null) throw new BadRequestException("被删除或无权限,操作失败!");
|
||||
|
||||
Long currentUserId = SecurityUtils.getCurrentUserId();
|
||||
String nickName = SecurityUtils.getCurrentNickName();
|
||||
|
||||
String now = DateUtil.now();
|
||||
dto.setUpdate_time(now);
|
||||
dto.setUpdate_optid(currentUserId);
|
||||
dto.setUpdate_optname(nickName);
|
||||
|
||||
WQLObject wo = WQLObject.getWQLObject("pdm_bi_slittingproductionplan");
|
||||
JSONObject json = JSONObject.parseObject(JSON.toJSONString(dto));
|
||||
wo.update(json);
|
||||
}
|
||||
|
||||
@Override
|
||||
@Transactional(rollbackFor = Exception.class)
|
||||
public void deleteAll(Long[] ids) {
|
||||
Long currentUserId = SecurityUtils.getCurrentUserId();
|
||||
String nickName = SecurityUtils.getCurrentNickName();
|
||||
String now = DateUtil.now();
|
||||
|
||||
WQLObject wo = WQLObject.getWQLObject("pdm_bi_slittingproductionplan");
|
||||
for (Long workorder_id : ids) {
|
||||
JSONObject param = new JSONObject();
|
||||
param.put("workorder_id", String.valueOf(workorder_id));
|
||||
param.put("is_delete", "1");
|
||||
param.put("update_optid", currentUserId);
|
||||
param.put("update_optname", nickName);
|
||||
param.put("update_time", now);
|
||||
wo.update(param);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
@Transactional(rollbackFor = Exception.class)
|
||||
public void upMaterFinish(JSONObject whereJson) {
|
||||
JSONArray data = whereJson.getJSONArray("data");
|
||||
Long currentUserId = SecurityUtils.getCurrentUserId();
|
||||
String currentUsername = SecurityUtils.getCurrentUsername();
|
||||
|
||||
WQLObject tab = WQLObject.getWQLObject("PDM_BI_SlittingProductionPlan");
|
||||
|
||||
for (int i = 0; i < data.size(); i++) {
|
||||
JSONObject json = data.getJSONObject(i);
|
||||
JSONObject jsonObject = tab.query("workorder_id = '" + json.getString("workorder_id") + "'").uniqueResult(0);
|
||||
jsonObject.put("is_parent_ok","1");
|
||||
jsonObject.put("update_optid",currentUserId);
|
||||
jsonObject.put("update_optname",currentUsername);
|
||||
jsonObject.put("update_time",DateUtil.now());
|
||||
tab.update(jsonObject);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
@Transactional(rollbackFor = Exception.class)
|
||||
public void caseFinish(JSONObject whereJson) {
|
||||
JSONArray data = whereJson.getJSONArray("data");
|
||||
Long currentUserId = SecurityUtils.getCurrentUserId();
|
||||
String currentUsername = SecurityUtils.getCurrentUsername();
|
||||
|
||||
WQLObject tab = WQLObject.getWQLObject("PDM_BI_SlittingProductionPlan");
|
||||
|
||||
for (int i = 0; i < data.size(); i++) {
|
||||
JSONObject json = data.getJSONObject(i);
|
||||
JSONObject jsonObject = tab.query("workorder_id = '" + json.getString("workorder_id") + "'").uniqueResult(0);
|
||||
jsonObject.put("is_child_tz_ok","1");
|
||||
jsonObject.put("update_optid",currentUserId);
|
||||
jsonObject.put("update_optname",currentUsername);
|
||||
jsonObject.put("update_time",DateUtil.now());
|
||||
tab.update(jsonObject);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
@Transactional(rollbackFor = Exception.class)
|
||||
public void sendFinish(JSONObject whereJson) {
|
||||
JSONArray data = whereJson.getJSONArray("data");
|
||||
Long currentUserId = SecurityUtils.getCurrentUserId();
|
||||
String currentUsername = SecurityUtils.getCurrentUsername();
|
||||
|
||||
WQLObject tab = WQLObject.getWQLObject("PDM_BI_SlittingProductionPlan");
|
||||
|
||||
for (int i = 0; i < data.size(); i++) {
|
||||
JSONObject json = data.getJSONObject(i);
|
||||
JSONObject jsonObject = tab.query("workorder_id = '" + json.getString("workorder_id") + "'").uniqueResult(0);
|
||||
jsonObject.put("is_child_ps_ok","1");
|
||||
jsonObject.put("update_optid",currentUserId);
|
||||
jsonObject.put("update_optname",currentUsername);
|
||||
jsonObject.put("update_time",DateUtil.now());
|
||||
tab.update(jsonObject);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
@Transactional(rollbackFor = Exception.class)
|
||||
public void compelFinish(JSONObject whereJson) {
|
||||
JSONArray data = whereJson.getJSONArray("data");
|
||||
Long currentUserId = SecurityUtils.getCurrentUserId();
|
||||
String currentUsername = SecurityUtils.getCurrentUsername();
|
||||
|
||||
WQLObject tab = WQLObject.getWQLObject("PDM_BI_SlittingProductionPlan");
|
||||
|
||||
for (int i = 0; i < data.size(); i++) {
|
||||
JSONObject json = data.getJSONObject(i);
|
||||
JSONObject jsonObject = tab.query("workorder_id = '" + json.getString("workorder_id") + "'").uniqueResult(0);
|
||||
if (StrUtil.equals(jsonObject.getString("status"), "2")) {
|
||||
throw new BadRequestException("此单号:"+jsonObject.getString("mfg_order_name")+"已完成");
|
||||
}
|
||||
jsonObject.put("status","2");
|
||||
jsonObject.put("end_time",DateUtil.now());
|
||||
jsonObject.put("update_optid",currentUserId);
|
||||
jsonObject.put("update_optname",currentUsername);
|
||||
jsonObject.put("update_time",DateUtil.now());
|
||||
tab.update(jsonObject);
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,94 @@
|
||||
[交易说明]
|
||||
交易名: 分切计划查询
|
||||
所属模块:
|
||||
功能简述:
|
||||
版权所有:
|
||||
表引用:
|
||||
版本经历:
|
||||
|
||||
[数据库]
|
||||
--指定数据库,为空采用默认值,默认为db.properties中列出的第一个库
|
||||
|
||||
[IO定义]
|
||||
#################################################
|
||||
## 表字段对应输入参数
|
||||
#################################################
|
||||
输入.flag TYPEAS s_string
|
||||
输入.order_type TYPEAS s_string
|
||||
输入.product_area TYPEAS s_string
|
||||
输入.status TYPEAS s_string
|
||||
输入.resource_name TYPEAS s_string
|
||||
输入.parent_container_name TYPEAS s_string
|
||||
输入.container_name TYPEAS s_string
|
||||
输入.begin_time TYPEAS s_string
|
||||
输入.end_time TYPEAS s_string
|
||||
|
||||
|
||||
[临时表]
|
||||
--这边列出来的临时表就会在运行期动态创建
|
||||
|
||||
[临时变量]
|
||||
--所有中间过程变量均可在此处定义
|
||||
|
||||
[业务过程]
|
||||
|
||||
##########################################
|
||||
# 1、输入输出检查 #
|
||||
##########################################
|
||||
|
||||
|
||||
##########################################
|
||||
# 2、主过程前处理 #
|
||||
##########################################
|
||||
|
||||
|
||||
##########################################
|
||||
# 3、业务主过程 #
|
||||
##########################################
|
||||
|
||||
IF 输入.flag = "1"
|
||||
PAGEQUERY
|
||||
SELECT
|
||||
plan.*,
|
||||
ivt.product_area
|
||||
FROM
|
||||
PDM_BI_SlittingProductionPlan plan
|
||||
LEFT JOIN ST_IVT_CutPointIvt ivt ON ivt.ext_code = plan.resource_name
|
||||
WHERE
|
||||
plan.is_delete = '0'
|
||||
|
||||
OPTION 输入.order_type <> ""
|
||||
plan.order_type = 输入.order_type
|
||||
ENDOPTION
|
||||
|
||||
OPTION 输入.product_area <> ""
|
||||
ivt.product_area = 输入.product_area
|
||||
ENDOPTION
|
||||
|
||||
OPTION 输入.status <> ""
|
||||
plan.status = 输入.status
|
||||
ENDOPTION
|
||||
|
||||
OPTION 输入.resource_name <> ""
|
||||
plan.resource_name like 输入.resource_name
|
||||
ENDOPTION
|
||||
|
||||
OPTION 输入.parent_container_name <> ""
|
||||
plan.parent_container_name like 输入.parent_container_name
|
||||
ENDOPTION
|
||||
|
||||
OPTION 输入.container_name <> ""
|
||||
plan.container_name like 输入.container_name
|
||||
ENDOPTION
|
||||
|
||||
OPTION 输入.begin_time <> ""
|
||||
plan.manufacture_date >= 输入.begin_time
|
||||
ENDOPTION
|
||||
|
||||
OPTION 输入.end_time <> ""
|
||||
plan.manufacture_date <= 输入.end_time
|
||||
ENDOPTION
|
||||
|
||||
ENDSELECT
|
||||
ENDPAGEQUERY
|
||||
ENDIF
|
||||
421
nladmin-ui/src/views/wms/pdm/order/slittingplan/index.vue
Normal file
421
nladmin-ui/src/views/wms/pdm/order/slittingplan/index.vue
Normal file
@@ -0,0 +1,421 @@
|
||||
<template>
|
||||
<div class="app-container">
|
||||
<!--工具栏-->
|
||||
<div class="head-container">
|
||||
<div v-if="crud.props.searchToggle">
|
||||
<!-- 搜索 -->
|
||||
<el-form
|
||||
:inline="true"
|
||||
class="demo-form-inline"
|
||||
label-position="right"
|
||||
label-width="11 0px"
|
||||
label-suffix=":"
|
||||
>
|
||||
<el-form-item label="订单类型">
|
||||
<el-select
|
||||
v-model="query.order_type"
|
||||
clearable
|
||||
size="mini"
|
||||
placeholder="请选择"
|
||||
class="filter-item"
|
||||
style="width: 250px"
|
||||
@change="hand"
|
||||
>
|
||||
<el-option
|
||||
v-for="item in dict.order_type"
|
||||
:label="item.label"
|
||||
:value="item.value"
|
||||
/>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item label="生产区域">
|
||||
<el-select
|
||||
v-model="query.product_area"
|
||||
clearable
|
||||
size="mini"
|
||||
placeholder="请选择"
|
||||
class="filter-item"
|
||||
style="width: 250px"
|
||||
@change="hand"
|
||||
>
|
||||
<el-option
|
||||
v-for="item in dict.product_area"
|
||||
:label="item.label"
|
||||
:value="item.value"
|
||||
/>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item label="状态">
|
||||
<el-select
|
||||
v-model="query.status"
|
||||
clearable
|
||||
size="mini"
|
||||
placeholder="请选择"
|
||||
class="filter-item"
|
||||
style="width: 250px"
|
||||
@change="hand"
|
||||
>
|
||||
<el-option
|
||||
v-for="item in dict.product_status"
|
||||
:label="item.label"
|
||||
:value="item.value"
|
||||
/>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item label="机台编码">
|
||||
<el-input
|
||||
v-model="query.resource_name"
|
||||
clearable
|
||||
size="mini"
|
||||
placeholder="机台编码"
|
||||
style="width: 250px"
|
||||
@keyup.enter.native="crud.toQuery"
|
||||
/>
|
||||
</el-form-item>
|
||||
<el-form-item label="母卷号">
|
||||
<el-input
|
||||
v-model="query.parent_container_name"
|
||||
clearable
|
||||
size="mini"
|
||||
placeholder="母卷号"
|
||||
style="width: 250px"
|
||||
@keyup.enter.native="crud.toQuery"
|
||||
/>
|
||||
</el-form-item>
|
||||
<el-form-item label="子卷号">
|
||||
<el-input
|
||||
v-model="query.container_name"
|
||||
clearable
|
||||
size="mini"
|
||||
placeholder="母卷号"
|
||||
style="width: 250px"
|
||||
@keyup.enter.native="crud.toQuery"
|
||||
/>
|
||||
</el-form-item>
|
||||
<el-form-item label="日期">
|
||||
<el-date-picker
|
||||
v-model="query.createTime"
|
||||
type="daterange"
|
||||
value-format="yyyy-MM-dd"
|
||||
start-placeholder="开始日期"
|
||||
end-placeholder="结束日期"
|
||||
:default-time="['00:00:00', '23:59:59']"
|
||||
@change="crud.toQuery"
|
||||
/>
|
||||
</el-form-item>
|
||||
<rrOperation />
|
||||
</el-form>
|
||||
</div>
|
||||
<!--如果想在工具栏加入更多按钮,可以使用插槽方式, slot = 'left' or 'right'-->
|
||||
<crudOperation :permission="permission">
|
||||
<el-button
|
||||
slot="right"
|
||||
class="filter-item"
|
||||
type="success"
|
||||
icon="el-icon-position"
|
||||
size="mini"
|
||||
:disabled="crud.selections.length < 1"
|
||||
@click="upMaterFinish"
|
||||
>
|
||||
上料完成
|
||||
</el-button>
|
||||
<el-button
|
||||
slot="right"
|
||||
class="filter-item"
|
||||
type="success"
|
||||
icon="el-icon-position"
|
||||
size="mini"
|
||||
:disabled="crud.selections.length < 1"
|
||||
@click="caseFinish"
|
||||
>
|
||||
套管完成
|
||||
</el-button>
|
||||
<el-button
|
||||
slot="right"
|
||||
class="filter-item"
|
||||
type="success"
|
||||
icon="el-icon-position"
|
||||
size="mini"
|
||||
:disabled="crud.selections.length < 1"
|
||||
@click="sendFinish"
|
||||
>
|
||||
配送完成
|
||||
</el-button>
|
||||
<el-button
|
||||
slot="right"
|
||||
class="filter-item"
|
||||
type="success"
|
||||
icon="el-icon-position"
|
||||
size="mini"
|
||||
:disabled="crud.selections.length < 1"
|
||||
@click="compelFinish"
|
||||
>
|
||||
强制完成
|
||||
</el-button>
|
||||
</crudOperation>
|
||||
<!--表单组件-->
|
||||
<el-dialog :close-on-click-modal="false" :before-close="crud.cancelCU" :visible.sync="crud.status.cu > 0" :title="crud.status.title" width="500px">
|
||||
<el-form ref="form" :model="form" :rules="rules" size="mini" label-width="80px">
|
||||
<el-form-item label="子卷号" prop="container_name">
|
||||
<el-input v-model="form.container_name" style="width: 370px;" />
|
||||
</el-form-item>
|
||||
<el-form-item label="产品编码" prop="product_name">
|
||||
<el-input v-model="form.product_name" style="width: 370px;" />
|
||||
</el-form-item>
|
||||
<el-form-item label="产品描述" prop="description">
|
||||
<el-input v-model="form.description" style="width: 370px;" />
|
||||
</el-form-item>
|
||||
<el-form-item label="分切机台编码" prop="resource_name">
|
||||
<el-input v-model="form.resource_name" style="width: 370px;" />
|
||||
</el-form-item>
|
||||
<el-form-item label="纸筒物料编码">
|
||||
<el-input v-model="form.paper_tube_material" style="width: 370px;" />
|
||||
</el-form-item>
|
||||
<el-form-item label="纸筒物料描述">
|
||||
<el-input v-model="form.paper_tube_description" style="width: 370px;" />
|
||||
</el-form-item>
|
||||
<el-form-item label="FRP管物料编码">
|
||||
<el-input v-model="form.FRP_material" style="width: 370px;" />
|
||||
</el-form-item>
|
||||
<el-form-item label="FRP管物料描述">
|
||||
<el-input v-model="form.FRP_description" style="width: 370px;" />
|
||||
</el-form-item>
|
||||
<el-form-item label="FRP管规格">
|
||||
<el-input v-model="form.FRP_model" style="width: 370px;" />
|
||||
</el-form-item>
|
||||
<el-form-item label="子卷幅宽" prop="split_breadth">
|
||||
<el-input v-model="form.split_breadth" style="width: 370px;" />
|
||||
</el-form-item>
|
||||
<el-form-item label="子卷理论长度" prop="split_height">
|
||||
<el-input v-model="form.split_height" style="width: 370px;" />
|
||||
</el-form-item>
|
||||
<el-form-item label="子卷理论重量" prop="split_weight">
|
||||
<el-input v-model="form.split_weight" style="width: 370px;" />
|
||||
</el-form-item>
|
||||
<el-form-item label="备注">
|
||||
<el-input v-model="form.remark" style="width: 370px;" />
|
||||
</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 v-if="false" prop="workorder_id" label="分切计划标识" />
|
||||
<el-table-column prop="status" label="状态" :formatter="formatStatusName"/>
|
||||
<el-table-column prop="order_type" label="订单类型" :formatter="formatTypeName"/>
|
||||
<el-table-column prop="mfg_order_name" label="订单号" show-overflow-tooltip/>
|
||||
<el-table-column prop="container_name" label="子卷号" />
|
||||
<el-table-column prop="parent_container_name" label="母卷号" />
|
||||
<el-table-column prop="ware_house" label="来源位置" :formatter="formatHouseName" width="120px" />
|
||||
<el-table-column prop="restruct_container_name" label="改制来源子卷号" width="120px"/>
|
||||
<el-table-column prop="package_box_sn" label="改制来源子卷木箱号" width="150px" />
|
||||
<el-table-column prop="resource_name" label="机台编码" />
|
||||
<el-table-column prop="product_name" label="产品编码" />
|
||||
<el-table-column prop="product_area" label="生产区域" />
|
||||
<el-table-column prop="split_group" label="分切组" />
|
||||
<el-table-column prop="manufacture_sort" label="生产顺序" />
|
||||
<el-table-column prop="manufacture_date" label="生产日期" width="120px" />
|
||||
<el-table-column prop="split_breadth" label="子卷幅宽" />
|
||||
<el-table-column prop="split_height" label="子卷理论长度" width="120px" />
|
||||
<el-table-column prop="split_weight" label="子卷理论重量" width="120px" />
|
||||
<el-table-column prop="paper_tube_or_frp" label="管件类型" :formatter="formatTubeName" />
|
||||
<el-table-column prop="paper_tube_material" label="纸筒物料编码" width="120px" />
|
||||
<el-table-column prop="paper_tube_description" label="纸筒物料描述" width="120px" />
|
||||
<el-table-column prop="paper_tube_model" label="纸筒规格" />
|
||||
<el-table-column prop="frp_material" label="FRP管物料编码" width="120px" />
|
||||
<el-table-column prop="frp_description" label="FRP管物料描述" width="120px" />
|
||||
<el-table-column prop="frp_model" label="FRP管规格" width="100px" />
|
||||
<el-table-column prop="is_parent_ok" label="母卷上料完成" width="100px" :formatter="formatParentName" />
|
||||
<el-table-column prop="is_child_tz_ok" label="子卷套轴完成" width="100px" :formatter="formatChildName" />
|
||||
<el-table-column prop="is_child_ps_ok" label="子卷配送完成" width="100px" :formatter="formatChildPsName" />
|
||||
<el-table-column prop="start_time" label="开始时间" width="150px" />
|
||||
<el-table-column prop="end_time" label="结束时间" width="150px" />
|
||||
<!-- <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 crudSlittingproductionplan from '@/views/wms/pdm/order/slittingplan/slittingproductionplan'
|
||||
import CRUD, { crud, form, header, presenter } 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 = {
|
||||
workorder_id: null,
|
||||
order_type: null,
|
||||
container_name: null,
|
||||
product_name: null,
|
||||
description: null,
|
||||
parent_container_name: null,
|
||||
restruct_container_name: null,
|
||||
package_box_sn: null,
|
||||
ware_house: null,
|
||||
resource_name: null,
|
||||
split_group: null,
|
||||
manufacture_sort: null,
|
||||
mfg_order_name: null,
|
||||
manufacture_date: null,
|
||||
paper_tube_or_FRP: null,
|
||||
paper_tube_material: null,
|
||||
paper_tube_description: null,
|
||||
paper_tube_model: null,
|
||||
FRP_material: null,
|
||||
FRP_description: null,
|
||||
FRP_model: null,
|
||||
split_breadth: null,
|
||||
split_height: null,
|
||||
split_weight: null,
|
||||
start_time: null,
|
||||
end_time: null,
|
||||
status: null,
|
||||
remark: null,
|
||||
create_id: null,
|
||||
create_name: null,
|
||||
create_time: null,
|
||||
update_optid: null,
|
||||
update_optname: null,
|
||||
update_time: null,
|
||||
sysdeptid: null,
|
||||
syscompanyid: null,
|
||||
is_delete: null,
|
||||
is_parent_ok: null,
|
||||
is_child_tz_ok: null,
|
||||
is_child_ps_ok: null,
|
||||
qzzno: null
|
||||
}
|
||||
export default {
|
||||
name: 'Slittingproductionplan',
|
||||
dicts: ['product_area', 'order_type', 'product_status', 'IS_OR_NOT', 'ware_house', 'paper_tube_or_frp'],
|
||||
components: { pagination, crudOperation, rrOperation, udOperation },
|
||||
mixins: [presenter(), header(), form(defaultForm), crud()],
|
||||
cruds() {
|
||||
return CRUD({
|
||||
title: '分切计划',
|
||||
url: 'api/slittingproductionplan',
|
||||
idField: 'workorder_id',
|
||||
sort: 'workorder_id,desc',
|
||||
crudMethod: { ...crudSlittingproductionplan },
|
||||
optShow: {
|
||||
add: false,
|
||||
edit: false,
|
||||
del: false,
|
||||
download: false,
|
||||
reset: true
|
||||
}
|
||||
})
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
permission: {},
|
||||
rules: {
|
||||
order_type: [
|
||||
{ required: true, message: '分切订单类型不能为空', trigger: 'blur' }
|
||||
],
|
||||
container_name: [
|
||||
{ required: true, message: '子卷号不能为空', trigger: 'blur' }
|
||||
],
|
||||
product_name: [
|
||||
{ required: true, message: '产品编码不能为空', trigger: 'blur' }
|
||||
],
|
||||
description: [
|
||||
{ required: true, message: '产品描述不能为空', trigger: 'blur' }
|
||||
],
|
||||
ware_house: [
|
||||
{ required: true, message: '来源卷位置不能为空', trigger: 'blur' }
|
||||
]
|
||||
}
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
// 钩子:在获取表格数据之前执行,false 则代表不获取数据
|
||||
[CRUD.HOOK.beforeRefresh]() {
|
||||
return true
|
||||
},
|
||||
hand() {
|
||||
this.crud.toQuery()
|
||||
},
|
||||
upMaterFinish() {
|
||||
const _selectData = this.$refs.table.selection
|
||||
const data = {
|
||||
'data': _selectData
|
||||
}
|
||||
crudSlittingproductionplan.upMaterFinish(data).then(res => {
|
||||
this.crud.toQuery()
|
||||
this.crud.notify('操作成功', CRUD.NOTIFICATION_TYPE.SUCCESS)
|
||||
})
|
||||
},
|
||||
caseFinish() {
|
||||
const _selectData = this.$refs.table.selection
|
||||
const data = {
|
||||
'data': _selectData
|
||||
}
|
||||
crudSlittingproductionplan.caseFinish(data).then(res => {
|
||||
this.crud.toQuery()
|
||||
this.crud.notify('操作成功', CRUD.NOTIFICATION_TYPE.SUCCESS)
|
||||
})
|
||||
},
|
||||
sendFinish() {
|
||||
const _selectData = this.$refs.table.selection
|
||||
const data = {
|
||||
'data': _selectData
|
||||
}
|
||||
crudSlittingproductionplan.sendFinish(data).then(res => {
|
||||
this.crud.toQuery()
|
||||
this.crud.notify('操作成功', CRUD.NOTIFICATION_TYPE.SUCCESS)
|
||||
})
|
||||
},
|
||||
compelFinish() {
|
||||
const _selectData = this.$refs.table.selection
|
||||
const data = {
|
||||
'data': _selectData
|
||||
}
|
||||
crudSlittingproductionplan.compelFinish(data).then(res => {
|
||||
this.crud.toQuery()
|
||||
this.crud.notify('操作成功', CRUD.NOTIFICATION_TYPE.SUCCESS)
|
||||
})
|
||||
},
|
||||
formatStatusName(row) {
|
||||
return this.dict.label.product_status[row.status]
|
||||
},
|
||||
formatTypeName(row) {
|
||||
return this.dict.label.order_type[row.order_type]
|
||||
},
|
||||
formatHouseName(row) {
|
||||
return this.dict.label.ware_house[row.ware_house]
|
||||
},
|
||||
formatTubeName(row) {
|
||||
return this.dict.label.paper_tube_or_frp[row.paper_tube_or_frp]
|
||||
},
|
||||
formatParentName(row) {
|
||||
return this.dict.label.IS_OR_NOT[row.is_parent_ok]
|
||||
},
|
||||
formatChildName(row) {
|
||||
return this.dict.label.IS_OR_NOT[row.is_child_tz_ok]
|
||||
},
|
||||
formatChildPsName(row) {
|
||||
return this.dict.label.IS_OR_NOT[row.is_child_ps_ok]
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<style scoped>
|
||||
|
||||
</style>
|
||||
@@ -0,0 +1,59 @@
|
||||
import request from '@/utils/request'
|
||||
|
||||
export function add(data) {
|
||||
return request({
|
||||
url: 'api/slittingproductionplan',
|
||||
method: 'post',
|
||||
data
|
||||
})
|
||||
}
|
||||
|
||||
export function del(ids) {
|
||||
return request({
|
||||
url: 'api/slittingproductionplan/',
|
||||
method: 'delete',
|
||||
data: ids
|
||||
})
|
||||
}
|
||||
|
||||
export function edit(data) {
|
||||
return request({
|
||||
url: 'api/slittingproductionplan',
|
||||
method: 'put',
|
||||
data
|
||||
})
|
||||
}
|
||||
|
||||
export function upMaterFinish(data) {
|
||||
return request({
|
||||
url: 'api/slittingproductionplan/upMaterFinish',
|
||||
method: 'post',
|
||||
data
|
||||
})
|
||||
}
|
||||
|
||||
export function caseFinish(data) {
|
||||
return request({
|
||||
url: 'api/slittingproductionplan/caseFinish',
|
||||
method: 'post',
|
||||
data
|
||||
})
|
||||
}
|
||||
|
||||
export function sendFinish(data) {
|
||||
return request({
|
||||
url: 'api/slittingproductionplan/sendFinish',
|
||||
method: 'post',
|
||||
data
|
||||
})
|
||||
}
|
||||
|
||||
export function compelFinish(data) {
|
||||
return request({
|
||||
url: 'api/slittingproductionplan/compelFinish',
|
||||
method: 'post',
|
||||
data
|
||||
})
|
||||
}
|
||||
|
||||
export default { add, edit, del, upMaterFinish, caseFinish, sendFinish, compelFinish }
|
||||
Reference in New Issue
Block a user