代码更新
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
|
||||
Reference in New Issue
Block a user