生产订单管理
This commit is contained in:
parent
c59157c3cb
commit
5e1ef72fa5
|
|
@ -0,0 +1,104 @@
|
|||
package com.nflg.product.bomnew.api.user;
|
||||
|
||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||
import com.nflg.product.base.core.api.BaseApi;
|
||||
import com.nflg.product.bomnew.pojo.query.ProductionOrderQuery;
|
||||
import com.nflg.product.bomnew.pojo.query.ProductionOrderSaveQuery;
|
||||
import com.nflg.product.bomnew.pojo.vo.ProductionOrderItemVO;
|
||||
import com.nflg.product.bomnew.pojo.vo.ProductionOrderVO;
|
||||
import com.nflg.product.bomnew.service.ProductionOrderService;
|
||||
import io.swagger.annotations.Api;
|
||||
import io.swagger.annotations.ApiOperation;
|
||||
import nflg.product.common.vo.ResultVO;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
import javax.validation.Valid;
|
||||
import javax.validation.constraints.NotNull;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* @author makejava
|
||||
*/
|
||||
@Api(tags = "生产订单")
|
||||
@RestController
|
||||
@RequestMapping("productionOrder")
|
||||
public class ProductionOrderApi extends BaseApi {
|
||||
|
||||
/**
|
||||
* 服务对象
|
||||
*/
|
||||
@Resource
|
||||
private ProductionOrderService productionOrderService;
|
||||
|
||||
/**
|
||||
* 分页查询所有数据
|
||||
*
|
||||
* @param query Query 查询实体
|
||||
* @return 所有数据
|
||||
*/
|
||||
@PostMapping("getListByPage")
|
||||
@ApiOperation("auto-生产订单列表")
|
||||
public ResultVO<IPage<ProductionOrderVO>> selectProductionOrderPageByCondition(@RequestBody ProductionOrderQuery query) {
|
||||
return ResultVO.success(productionOrderService.getListByPage(query));
|
||||
}
|
||||
|
||||
@GetMapping("getItemList")
|
||||
@ApiOperation("auto-生产订单详情")
|
||||
public ResultVO<List<ProductionOrderItemVO>> getItemList(@RequestParam Long rowId) {
|
||||
return ResultVO.success(productionOrderService.getItemList(rowId));
|
||||
}
|
||||
|
||||
@GetMapping("queryPostByUser")
|
||||
@ApiOperation("auto-查询用户所有岗位")
|
||||
public ResultVO<String> queryPostByUser() {
|
||||
return ResultVO.success(productionOrderService.queryPostByUser());
|
||||
}
|
||||
|
||||
/**
|
||||
* 暂存
|
||||
* @param query 保存的数据
|
||||
* @return
|
||||
*/
|
||||
@PostMapping("temporary")
|
||||
@ApiOperation("暂存")
|
||||
public ResultVO<String> temporary(@Valid @RequestBody @NotNull ProductionOrderSaveQuery query) {
|
||||
productionOrderService.save(query, false);
|
||||
return ResultVO.success();
|
||||
}
|
||||
|
||||
/**
|
||||
* 提交
|
||||
* @param query 保存的数据
|
||||
* @return
|
||||
*/
|
||||
@PostMapping("submit")
|
||||
@ApiOperation("提交")
|
||||
public ResultVO<String> submit(@Valid @RequestBody @NotNull ProductionOrderSaveQuery query) {
|
||||
productionOrderService.submit(query);
|
||||
return ResultVO.success();
|
||||
}
|
||||
|
||||
/**
|
||||
* 发起变更通知
|
||||
* @return
|
||||
*/
|
||||
@PostMapping("sendNotice")
|
||||
@ApiOperation("发起变更通知")
|
||||
public ResultVO<String> sendNotice(@RequestBody List<Long> rowIds) {
|
||||
productionOrderService.sendNotice(rowIds);
|
||||
return ResultVO.success();
|
||||
}
|
||||
|
||||
/**
|
||||
* 确认状态
|
||||
* @return
|
||||
*/
|
||||
@PostMapping("confirmStatus")
|
||||
@ApiOperation("确认状态")
|
||||
public ResultVO<String> confirmStatus(@Valid @RequestBody @NotNull ProductionOrderQuery query) {
|
||||
productionOrderService.confirmStatus(query.getRowId(), query.getConfirmStatus());
|
||||
return ResultVO.success();
|
||||
}
|
||||
|
||||
}
|
||||
|
|
@ -0,0 +1,11 @@
|
|||
package com.nflg.product.bomnew.mapper.master;
|
||||
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
import com.nflg.product.bomnew.pojo.entity.ProductionOrderItemEntity;
|
||||
|
||||
/**
|
||||
* @author makejava
|
||||
*/
|
||||
public interface ProductionOrderItemMapper extends BaseMapper<ProductionOrderItemEntity> {
|
||||
|
||||
}
|
||||
|
|
@ -0,0 +1,18 @@
|
|||
package com.nflg.product.bomnew.mapper.master;
|
||||
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import com.nflg.product.bomnew.pojo.entity.ProductionOrderEntity;
|
||||
import com.nflg.product.bomnew.pojo.query.ProductionOrderQuery;
|
||||
import com.nflg.product.bomnew.pojo.vo.ProductionOrderVO;
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
|
||||
/**
|
||||
* @author makejava
|
||||
*/
|
||||
public interface ProductionOrderMapper extends BaseMapper<ProductionOrderEntity> {
|
||||
|
||||
Page<ProductionOrderVO> getListByPage(Page<ProductionOrderQuery> page , @Param("query") ProductionOrderQuery query);
|
||||
|
||||
String queryPostByUser(@Param("userRowId") Long userRowId);
|
||||
}
|
||||
|
|
@ -0,0 +1,156 @@
|
|||
package com.nflg.product.bomnew.pojo.entity;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.IdType;
|
||||
import com.baomidou.mybatisplus.annotation.TableField;
|
||||
import com.baomidou.mybatisplus.annotation.TableId;
|
||||
import com.baomidou.mybatisplus.annotation.TableName;
|
||||
import io.swagger.annotations.ApiModel;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.Data;
|
||||
import lombok.experimental.Accessors;
|
||||
|
||||
import java.io.Serializable;
|
||||
import java.math.BigDecimal;
|
||||
import java.time.LocalDateTime;
|
||||
|
||||
/**
|
||||
* t_production_order
|
||||
* 生产订单抬头表
|
||||
*
|
||||
* @author makejava
|
||||
*/
|
||||
@Data
|
||||
@Accessors(chain = true)
|
||||
@ApiModel(value = "com-nflg-product-bomnew-pojo-main-entity-ProductionOrderEntity")
|
||||
@TableName(value = "t_production_order")
|
||||
public class ProductionOrderEntity implements Serializable {
|
||||
|
||||
/**
|
||||
* 行ID 雪花
|
||||
*/
|
||||
@TableId(value = "row_id", type = IdType.ASSIGN_ID)
|
||||
@ApiModelProperty(value = "行ID 雪花")
|
||||
private Long rowId;
|
||||
|
||||
/**
|
||||
* 工厂
|
||||
*/
|
||||
@TableField(value = "factory")
|
||||
@ApiModelProperty(value = "工厂")
|
||||
private String factory;
|
||||
|
||||
/**
|
||||
* 生产订单号
|
||||
*/
|
||||
@TableField(value = "production_order")
|
||||
@ApiModelProperty(value = "生产订单号")
|
||||
private String productionOrder;
|
||||
|
||||
/**
|
||||
* 物料编码
|
||||
*/
|
||||
@TableField(value = "material_no")
|
||||
@ApiModelProperty(value = "物料编码")
|
||||
private String materialNo;
|
||||
|
||||
/**
|
||||
* 物料描述
|
||||
*/
|
||||
@TableField(value = "material_desc")
|
||||
@ApiModelProperty(value = "物料描述")
|
||||
private String materialDesc;
|
||||
|
||||
/**
|
||||
* 数量
|
||||
*/
|
||||
@TableField(value = "num")
|
||||
@ApiModelProperty(value = "数量")
|
||||
private BigDecimal num;
|
||||
|
||||
/**
|
||||
* 单位
|
||||
*/
|
||||
@TableField(value = "unit")
|
||||
@ApiModelProperty(value = "单位")
|
||||
private String unit;
|
||||
|
||||
/**
|
||||
* 生产订单类型
|
||||
*/
|
||||
@TableField(value = "order_type")
|
||||
@ApiModelProperty(value = "生产订单类型")
|
||||
private String orderType;
|
||||
|
||||
/**
|
||||
* 长文本
|
||||
*/
|
||||
@TableField(value = "long_text")
|
||||
@ApiModelProperty(value = "长文本")
|
||||
private String longText;
|
||||
|
||||
/**
|
||||
* 合同号
|
||||
*/
|
||||
@TableField(value = "contract_no")
|
||||
@ApiModelProperty(value = "合同号")
|
||||
private String contractNo;
|
||||
|
||||
/**
|
||||
* 追踪ID号
|
||||
*/
|
||||
@TableField(value = "find_id")
|
||||
@ApiModelProperty(value = "追踪ID号")
|
||||
private String findId;
|
||||
|
||||
/**
|
||||
* 状态 0 未处理、1 已处理、2 已导入SAP
|
||||
*/
|
||||
@TableField(value = "edit_status")
|
||||
@ApiModelProperty(value = "状态 0 未处理、1 已处理、2 已导入SAP")
|
||||
private Integer editStatus;
|
||||
|
||||
/**
|
||||
* 提交 0否 1是
|
||||
*/
|
||||
@TableField(value = "submit")
|
||||
@ApiModelProperty(value = "提交 0否 1是")
|
||||
private Integer submit;
|
||||
|
||||
/**
|
||||
* 确认情况 0设计待确认 1供应链待确认 2计划待确认 3计划已确认
|
||||
*/
|
||||
@TableField(value = "confirm_status")
|
||||
@ApiModelProperty(value = "确认情况 0设计待确认 1供应链待确认 2计划待确认 3计划已确认")
|
||||
private Integer confirmStatus;
|
||||
|
||||
/**
|
||||
* 创建人
|
||||
*/
|
||||
@TableField(value = "created_by")
|
||||
@ApiModelProperty(value = "创建人")
|
||||
private String createdBy;
|
||||
|
||||
/**
|
||||
* 创建时间
|
||||
*/
|
||||
@TableField(value = "created_time")
|
||||
@ApiModelProperty(value = "创建时间")
|
||||
private LocalDateTime createdTime;
|
||||
|
||||
/**
|
||||
* 更新人
|
||||
*/
|
||||
@TableField(value = "updated_by")
|
||||
@ApiModelProperty(value = "更新人")
|
||||
private String updatedBy;
|
||||
|
||||
/**
|
||||
* 更新时间
|
||||
*/
|
||||
@TableField(value = "updated_time")
|
||||
@ApiModelProperty(value = "更新时间")
|
||||
private LocalDateTime updatedTime;
|
||||
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
}
|
||||
|
|
@ -0,0 +1,191 @@
|
|||
package com.nflg.product.bomnew.pojo.entity;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.IdType;
|
||||
import com.baomidou.mybatisplus.annotation.TableField;
|
||||
import com.baomidou.mybatisplus.annotation.TableId;
|
||||
import com.baomidou.mybatisplus.annotation.TableName;
|
||||
import io.swagger.annotations.ApiModel;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.Data;
|
||||
import lombok.experimental.Accessors;
|
||||
|
||||
import java.io.Serializable;
|
||||
import java.math.BigDecimal;
|
||||
import java.time.LocalDateTime;
|
||||
|
||||
/**
|
||||
* t_production_order_item
|
||||
* 生产订单明细表
|
||||
*
|
||||
* @author makejava
|
||||
*/
|
||||
@Data
|
||||
@Accessors(chain = true)
|
||||
@ApiModel(value = "com-nflg-product-bomnew-pojo-main-entity-ProductionOrderItemEntity")
|
||||
@TableName(value = "t_production_order_item")
|
||||
public class ProductionOrderItemEntity implements Serializable {
|
||||
|
||||
/**
|
||||
* 行ID 雪花
|
||||
*/
|
||||
@TableId(value = "row_id", type = IdType.ASSIGN_ID)
|
||||
@ApiModelProperty(value = "行ID 雪花")
|
||||
private Long rowId;
|
||||
|
||||
/**
|
||||
* 生产订单行ID
|
||||
*/
|
||||
@TableField(value = "order_row_id")
|
||||
@ApiModelProperty(value = "生产订单行ID")
|
||||
private Long orderRowId;
|
||||
|
||||
/**
|
||||
* 项目号
|
||||
*/
|
||||
@TableField(value = "item_no")
|
||||
@ApiModelProperty(value = "项目号")
|
||||
private String itemNo;
|
||||
|
||||
/**
|
||||
* 物料编码
|
||||
*/
|
||||
@TableField(value = "material_no")
|
||||
@ApiModelProperty(value = "物料编码")
|
||||
private String materialNo;
|
||||
|
||||
/**
|
||||
* 物料描述
|
||||
*/
|
||||
@TableField(value = "material_desc")
|
||||
@ApiModelProperty(value = "物料描述")
|
||||
private String materialDesc;
|
||||
|
||||
/**
|
||||
* 父物料 0否 1是
|
||||
*/
|
||||
@TableField(value = "parent_material")
|
||||
@ApiModelProperty(value = "父物料 0否 1是")
|
||||
private Integer parentMaterial;
|
||||
|
||||
/**
|
||||
* 需求数量
|
||||
*/
|
||||
@TableField(value = "command_num")
|
||||
@ApiModelProperty(value = "需求数量")
|
||||
private BigDecimal commandNum;
|
||||
|
||||
/**
|
||||
* 承诺数量
|
||||
*/
|
||||
@TableField(value = "promise_num")
|
||||
@ApiModelProperty(value = "承诺数量")
|
||||
private BigDecimal promiseNum;
|
||||
|
||||
/**
|
||||
* 提货数
|
||||
*/
|
||||
@TableField(value = "pick_num")
|
||||
@ApiModelProperty(value = "提货数")
|
||||
private BigDecimal pickNum;
|
||||
|
||||
/**
|
||||
* 单位
|
||||
*/
|
||||
@TableField(value = "unit")
|
||||
@ApiModelProperty(value = "单位")
|
||||
private String unit;
|
||||
|
||||
/**
|
||||
* 项目类别
|
||||
*/
|
||||
@TableField(value = "project_type")
|
||||
@ApiModelProperty(value = "项目类别")
|
||||
private String projectType;
|
||||
|
||||
/**
|
||||
* 工序
|
||||
*/
|
||||
@TableField(value = "progress")
|
||||
@ApiModelProperty(value = "工序")
|
||||
private String progress;
|
||||
|
||||
/**
|
||||
* 追踪ID号
|
||||
*/
|
||||
@TableField(value = "find_id")
|
||||
@ApiModelProperty(value = "追踪ID号")
|
||||
private String findId;
|
||||
|
||||
/**
|
||||
* 批次号
|
||||
*/
|
||||
@TableField(value = "batch_no")
|
||||
@ApiModelProperty(value = "批次号")
|
||||
private String batchNo;
|
||||
|
||||
/**
|
||||
* 工厂
|
||||
*/
|
||||
@TableField(value = "factory")
|
||||
@ApiModelProperty(value = "工厂")
|
||||
private String factory;
|
||||
|
||||
/**
|
||||
* 存储地点
|
||||
*/
|
||||
@TableField(value = "storage")
|
||||
@ApiModelProperty(value = "存储地点")
|
||||
private String storage;
|
||||
|
||||
/**
|
||||
* 反冲 0否 1是
|
||||
*/
|
||||
@TableField(value = "fanchong")
|
||||
@ApiModelProperty(value = "反冲 0否 1是")
|
||||
private Integer fanchong;
|
||||
|
||||
/**
|
||||
* 虚拟件 0否 1是
|
||||
*/
|
||||
@TableField(value = "virtual_material")
|
||||
@ApiModelProperty(value = "虚拟件 0否 1是")
|
||||
private Integer virtualMaterial;
|
||||
|
||||
/**
|
||||
* 提交 0否 1是
|
||||
*/
|
||||
@TableField(value = "submit")
|
||||
@ApiModelProperty(value = "提交 0否 1是")
|
||||
private Integer submit;
|
||||
|
||||
/**
|
||||
* 创建人
|
||||
*/
|
||||
@TableField(value = "created_by")
|
||||
@ApiModelProperty(value = "创建人")
|
||||
private String createdBy;
|
||||
|
||||
/**
|
||||
* 创建时间
|
||||
*/
|
||||
@TableField(value = "created_time")
|
||||
@ApiModelProperty(value = "创建时间")
|
||||
private LocalDateTime createdTime;
|
||||
|
||||
/**
|
||||
* 更新人
|
||||
*/
|
||||
@TableField(value = "updated_by")
|
||||
@ApiModelProperty(value = "更新人")
|
||||
private String updatedBy;
|
||||
|
||||
/**
|
||||
* 更新时间
|
||||
*/
|
||||
@TableField(value = "updated_time")
|
||||
@ApiModelProperty(value = "更新时间")
|
||||
private LocalDateTime updatedTime;
|
||||
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
}
|
||||
|
|
@ -0,0 +1,50 @@
|
|||
package com.nflg.product.bomnew.pojo.query;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.IdType;
|
||||
import com.baomidou.mybatisplus.annotation.TableId;
|
||||
import io.swagger.annotations.ApiModel;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.Data;
|
||||
import lombok.experimental.Accessors;
|
||||
|
||||
import java.io.Serializable;
|
||||
|
||||
/**
|
||||
* @author makejava
|
||||
*/
|
||||
@Data
|
||||
@Accessors(chain = true)
|
||||
@ApiModel(value = "com-nflg-product-bomnew-pojo-new-query-ProductionOrderQuery")
|
||||
public class ProductionOrderQuery extends BasePageQuery implements Serializable {
|
||||
|
||||
/**
|
||||
* 行ID 雪花
|
||||
*/
|
||||
@ApiModelProperty(value = "行ID 雪花")
|
||||
private Long rowId;
|
||||
|
||||
/**
|
||||
* 生产订单号
|
||||
*/
|
||||
@ApiModelProperty(value = "生产订单号")
|
||||
private String productionOrder;
|
||||
|
||||
/**
|
||||
* 开始时间
|
||||
*/
|
||||
@ApiModelProperty(value = "开始时间")
|
||||
private String startDate;
|
||||
|
||||
/**
|
||||
* 结束时间
|
||||
*/
|
||||
@ApiModelProperty(value = "结束时间")
|
||||
private String endDate;
|
||||
|
||||
/**
|
||||
* 确认情况 0设计待确认 1供应链待确认 2计划待确认 3计划已确认
|
||||
*/
|
||||
@ApiModelProperty(value = "确认情况 0设计待确认 1供应链待确认 2计划待确认 3计划已确认")
|
||||
private Integer confirmStatus;
|
||||
|
||||
}
|
||||
|
|
@ -0,0 +1,35 @@
|
|||
package com.nflg.product.bomnew.pojo.query;
|
||||
|
||||
import com.nflg.product.bomnew.pojo.vo.ProductionOrderItemVO;
|
||||
import com.nflg.product.bomnew.pojo.vo.ProductionOrderVO;
|
||||
import io.swagger.annotations.ApiModel;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.Data;
|
||||
import lombok.experimental.Accessors;
|
||||
|
||||
import javax.validation.constraints.NotNull;
|
||||
import java.io.Serializable;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* @author makejava
|
||||
*/
|
||||
@Data
|
||||
@Accessors(chain = true)
|
||||
@ApiModel(value = "com-nflg-product-bomnew-pojo-new-query-ProductionOrderSaveQuery")
|
||||
public class ProductionOrderSaveQuery implements Serializable {
|
||||
|
||||
/**
|
||||
* 抬头
|
||||
*/
|
||||
@ApiModelProperty(value = "抬头")
|
||||
@NotNull
|
||||
private ProductionOrderVO header;
|
||||
|
||||
/**
|
||||
* 明细
|
||||
*/
|
||||
@ApiModelProperty(value = "明细")
|
||||
@NotNull
|
||||
private List<ProductionOrderItemVO> details;
|
||||
}
|
||||
|
|
@ -0,0 +1,157 @@
|
|||
package com.nflg.product.bomnew.pojo.vo;
|
||||
|
||||
import io.swagger.annotations.ApiModel;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.Data;
|
||||
import lombok.experimental.Accessors;
|
||||
|
||||
import java.io.Serializable;
|
||||
import java.math.BigDecimal;
|
||||
import java.time.LocalDateTime;
|
||||
|
||||
@Data
|
||||
@Accessors(chain = true)
|
||||
@ApiModel(value="com-nflg-product-bomnew-pojo-new-vo-ProductionOrderItemVO")
|
||||
public class ProductionOrderItemVO implements Serializable {
|
||||
|
||||
/**
|
||||
* 行ID 雪花
|
||||
*/
|
||||
@ApiModelProperty(value = "行ID 雪花")
|
||||
private Long rowId;
|
||||
|
||||
/**
|
||||
* 生产订单行ID
|
||||
*/
|
||||
@ApiModelProperty(value = "生产订单行ID")
|
||||
private Long orderRowId;
|
||||
|
||||
/**
|
||||
* 项目号
|
||||
*/
|
||||
@ApiModelProperty(value = "项目号")
|
||||
private String itemNo;
|
||||
|
||||
/**
|
||||
* 物料编码
|
||||
*/
|
||||
@ApiModelProperty(value = "物料编码")
|
||||
private String materialNo;
|
||||
|
||||
/**
|
||||
* 物料描述
|
||||
*/
|
||||
@ApiModelProperty(value = "物料描述")
|
||||
private String materialDesc;
|
||||
|
||||
/**
|
||||
* 父物料 0否 1是
|
||||
*/
|
||||
@ApiModelProperty(value = "父物料 0否 1是")
|
||||
private Integer parentMaterial;
|
||||
|
||||
/**
|
||||
* 需求数量
|
||||
*/
|
||||
@ApiModelProperty(value = "需求数量")
|
||||
private BigDecimal commandNum;
|
||||
|
||||
/**
|
||||
* 承诺数量
|
||||
*/
|
||||
@ApiModelProperty(value = "承诺数量")
|
||||
private BigDecimal promiseNum;
|
||||
|
||||
/**
|
||||
* 提货数
|
||||
*/
|
||||
@ApiModelProperty(value = "提货数")
|
||||
private BigDecimal pickNum;
|
||||
|
||||
/**
|
||||
* 单位
|
||||
*/
|
||||
@ApiModelProperty(value = "单位")
|
||||
private String unit;
|
||||
|
||||
/**
|
||||
* 项目类别
|
||||
*/
|
||||
@ApiModelProperty(value = "项目类别")
|
||||
private String projectType;
|
||||
|
||||
/**
|
||||
* 工序
|
||||
*/
|
||||
@ApiModelProperty(value = "工序")
|
||||
private String progress;
|
||||
|
||||
/**
|
||||
* 追踪ID号
|
||||
*/
|
||||
@ApiModelProperty(value = "追踪ID号")
|
||||
private String findId;
|
||||
|
||||
/**
|
||||
* 批次号
|
||||
*/
|
||||
@ApiModelProperty(value = "批次号")
|
||||
private String batchNo;
|
||||
|
||||
/**
|
||||
* 工厂
|
||||
*/
|
||||
@ApiModelProperty(value = "工厂")
|
||||
private String factory;
|
||||
|
||||
/**
|
||||
* 存储地点
|
||||
*/
|
||||
@ApiModelProperty(value = "存储地点")
|
||||
private String storage;
|
||||
|
||||
/**
|
||||
* 反冲 0否 1是
|
||||
*/
|
||||
@ApiModelProperty(value = "反冲 0否 1是")
|
||||
private Integer fanchong;
|
||||
|
||||
/**
|
||||
* 虚拟件 0否 1是
|
||||
*/
|
||||
@ApiModelProperty(value = "虚拟件 0否 1是")
|
||||
private Integer virtualMaterial;
|
||||
|
||||
/**
|
||||
* 提交 0否 1是
|
||||
*/
|
||||
@ApiModelProperty(value = "提交 0否 1是")
|
||||
private Integer submit;
|
||||
|
||||
/**
|
||||
* 创建人
|
||||
*/
|
||||
@ApiModelProperty(value = "创建人")
|
||||
private String createdBy;
|
||||
|
||||
/**
|
||||
* 创建时间
|
||||
*/
|
||||
@ApiModelProperty(value = "创建时间")
|
||||
private LocalDateTime createdTime;
|
||||
|
||||
/**
|
||||
* 更新人
|
||||
*/
|
||||
@ApiModelProperty(value = "更新人")
|
||||
private String updatedBy;
|
||||
|
||||
/**
|
||||
* 更新时间
|
||||
*/
|
||||
@ApiModelProperty(value = "更新时间")
|
||||
private LocalDateTime updatedTime;
|
||||
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
}
|
||||
|
|
@ -0,0 +1,128 @@
|
|||
package com.nflg.product.bomnew.pojo.vo;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.TableField;
|
||||
import io.swagger.annotations.ApiModel;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.Data;
|
||||
import lombok.experimental.Accessors;
|
||||
|
||||
import java.io.Serializable;
|
||||
import java.math.BigDecimal;
|
||||
import java.time.LocalDateTime;
|
||||
|
||||
@Data
|
||||
@Accessors(chain = true)
|
||||
@ApiModel(value="com-nflg-product-bomnew-pojo-new-vo-ProductionOrderVO")
|
||||
public class ProductionOrderVO implements Serializable {
|
||||
|
||||
/**
|
||||
* 行ID 雪花
|
||||
*/
|
||||
@ApiModelProperty(value = "行ID 雪花")
|
||||
private Long rowId;
|
||||
|
||||
/**
|
||||
* 工厂
|
||||
*/
|
||||
@ApiModelProperty(value = "工厂")
|
||||
private String factory;
|
||||
|
||||
/**
|
||||
* 生产订单号
|
||||
*/
|
||||
@ApiModelProperty(value = "生产订单号")
|
||||
private String productionOrder;
|
||||
|
||||
/**
|
||||
* 物料编码
|
||||
*/
|
||||
@ApiModelProperty(value = "物料编码")
|
||||
private String materialNo;
|
||||
|
||||
/**
|
||||
* 物料描述
|
||||
*/
|
||||
@ApiModelProperty(value = "物料描述")
|
||||
private String materialDesc;
|
||||
|
||||
/**
|
||||
* 数量
|
||||
*/
|
||||
@ApiModelProperty(value = "数量")
|
||||
private BigDecimal num;
|
||||
|
||||
/**
|
||||
* 单位
|
||||
*/
|
||||
@ApiModelProperty(value = "单位")
|
||||
private String unit;
|
||||
|
||||
/**
|
||||
* 生产订单类型
|
||||
*/
|
||||
@ApiModelProperty(value = "生产订单类型")
|
||||
private String orderType;
|
||||
|
||||
/**
|
||||
* 长文本
|
||||
*/
|
||||
@ApiModelProperty(value = "长文本")
|
||||
private String longText;
|
||||
|
||||
/**
|
||||
* 合同号
|
||||
*/
|
||||
@ApiModelProperty(value = "合同号")
|
||||
private String contractNo;
|
||||
|
||||
/**
|
||||
* 追踪ID号
|
||||
*/
|
||||
@ApiModelProperty(value = "追踪ID号")
|
||||
private String findId;
|
||||
|
||||
/**
|
||||
* 状态 0 未处理、1 已处理、2 已导入SAP
|
||||
*/
|
||||
@ApiModelProperty(value = "状态 0 未处理、1 已处理、2 已导入SAP")
|
||||
private Integer editStatus;
|
||||
|
||||
/**
|
||||
* 提交 0否 1是
|
||||
*/
|
||||
@ApiModelProperty(value = "提交 0否 1是")
|
||||
private Integer submit;
|
||||
|
||||
/**
|
||||
* 确认情况 0设计待确认 1供应链待确认 2计划待确认 3计划已确认
|
||||
*/
|
||||
@ApiModelProperty(value = "确认情况 0设计待确认 1供应链待确认 2计划待确认 3计划已确认")
|
||||
private Integer confirmStatus;
|
||||
|
||||
/**
|
||||
* 创建人
|
||||
*/
|
||||
@ApiModelProperty(value = "创建人")
|
||||
private String createdBy;
|
||||
|
||||
/**
|
||||
* 创建时间
|
||||
*/
|
||||
@ApiModelProperty(value = "创建时间")
|
||||
private LocalDateTime createdTime;
|
||||
|
||||
/**
|
||||
* 更新人
|
||||
*/
|
||||
@ApiModelProperty(value = "更新人")
|
||||
private String updatedBy;
|
||||
|
||||
/**
|
||||
* 更新时间
|
||||
*/
|
||||
@ApiModelProperty(value = "更新时间")
|
||||
private LocalDateTime updatedTime;
|
||||
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
}
|
||||
|
|
@ -0,0 +1,16 @@
|
|||
package com.nflg.product.bomnew.service;
|
||||
|
||||
|
||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||
import com.nflg.product.bomnew.mapper.master.ProductionOrderItemMapper;
|
||||
import com.nflg.product.bomnew.pojo.entity.ProductionOrderItemEntity;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
|
||||
/**
|
||||
* @author makejava
|
||||
*/
|
||||
@Service
|
||||
public class ProductionOrderItemService extends ServiceImpl<ProductionOrderItemMapper, ProductionOrderItemEntity> {
|
||||
|
||||
}
|
||||
|
|
@ -0,0 +1,147 @@
|
|||
package com.nflg.product.bomnew.service;
|
||||
|
||||
|
||||
import cn.hutool.core.collection.CollUtil;
|
||||
import cn.hutool.core.convert.Convert;
|
||||
import cn.hutool.core.lang.TypeReference;
|
||||
import cn.hutool.core.util.ObjectUtil;
|
||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||
import com.baomidou.mybatisplus.core.toolkit.IdWorker;
|
||||
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||
import com.nflg.product.base.core.conmon.util.SessionUtil;
|
||||
import com.nflg.product.bomnew.mapper.master.ProductionOrderMapper;
|
||||
import com.nflg.product.bomnew.pojo.entity.BomNewDQbomChildEntity;
|
||||
import com.nflg.product.bomnew.pojo.entity.ProductionOrderEntity;
|
||||
import com.nflg.product.bomnew.pojo.entity.ProductionOrderItemEntity;
|
||||
import com.nflg.product.bomnew.pojo.query.ProductionOrderQuery;
|
||||
import com.nflg.product.bomnew.pojo.query.ProductionOrderSaveQuery;
|
||||
import com.nflg.product.bomnew.pojo.vo.ProductionOrderItemVO;
|
||||
import com.nflg.product.bomnew.pojo.vo.ProductionOrderVO;
|
||||
import com.nflg.product.bomnew.util.VUtils;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
import java.time.LocalDateTime;
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
|
||||
/**
|
||||
* @author makejava
|
||||
*/
|
||||
@Service
|
||||
public class ProductionOrderService extends ServiceImpl<ProductionOrderMapper, ProductionOrderEntity> {
|
||||
|
||||
@Resource
|
||||
private ProductionOrderItemService productionOrderItemService;
|
||||
|
||||
public IPage<ProductionOrderVO> getListByPage(ProductionOrderQuery query){
|
||||
Page<ProductionOrderQuery> page=new Page<>(query.getPage(),query.getPageSize());
|
||||
return this.getBaseMapper().getListByPage(page,query);
|
||||
}
|
||||
|
||||
public List<ProductionOrderItemVO> getItemList(Long rowId) {
|
||||
VUtils.isTure(ObjectUtil.isEmpty(rowId)).throwMessage("生产订单 rowId 不能为空");
|
||||
List<ProductionOrderItemEntity> itemList = productionOrderItemService.lambdaQuery().eq(ProductionOrderItemEntity::getOrderRowId, rowId).list();
|
||||
return Convert.toList(ProductionOrderItemVO.class, itemList);
|
||||
}
|
||||
|
||||
public String queryPostByUser() {
|
||||
return this.getBaseMapper().queryPostByUser(SessionUtil.getRowId());
|
||||
}
|
||||
|
||||
/**
|
||||
* 暂存
|
||||
* @param query
|
||||
*/
|
||||
public void save(ProductionOrderSaveQuery query, boolean submit) {
|
||||
VUtils.isTure(ObjectUtil.isEmpty(query.getHeader()) || ObjectUtil.isEmpty(query.getHeader().getRowId()))
|
||||
.throwMessage("生产订单 rowId 不能为空");
|
||||
Long orderRowId = query.getHeader().getRowId();
|
||||
// 清空所有明细
|
||||
productionOrderItemService.getBaseMapper()
|
||||
.delete(Wrappers.lambdaQuery(ProductionOrderItemEntity.class).eq(ProductionOrderItemEntity::getOrderRowId, orderRowId));
|
||||
// 处理明细
|
||||
List<ProductionOrderItemEntity> items = Convert.toList(ProductionOrderItemEntity.class, query.getDetails());
|
||||
items.forEach(item -> {
|
||||
Long headerRowId = item.getOrderRowId();
|
||||
item.setSubmit(submit ? 1 : 0);
|
||||
item.setUpdatedBy(SessionUtil.getUserCode());
|
||||
item.setUpdatedTime(LocalDateTime.now());
|
||||
// 新增
|
||||
if (ObjectUtil.isEmpty(headerRowId)) {
|
||||
item.setRowId(IdWorker.getId());
|
||||
item.setOrderRowId(orderRowId);
|
||||
item.setCreatedBy(SessionUtil.getUserCode());
|
||||
item.setCreatedTime(LocalDateTime.now());
|
||||
} else {
|
||||
// 修改
|
||||
}
|
||||
});
|
||||
productionOrderItemService.saveOrUpdateBatch(items);
|
||||
// 处理抬头
|
||||
ProductionOrderEntity header = new ProductionOrderEntity();
|
||||
header.setRowId(orderRowId);
|
||||
header.setSubmit(submit ? 1 : 0);
|
||||
header.setUpdatedBy(SessionUtil.getUserCode());
|
||||
header.setUpdatedTime(LocalDateTime.now());
|
||||
this.updateById(header);
|
||||
}
|
||||
|
||||
/**
|
||||
* 提交
|
||||
* @param query
|
||||
*/
|
||||
public void submit(ProductionOrderSaveQuery query) {
|
||||
save(query, true);
|
||||
// 其他逻辑
|
||||
}
|
||||
|
||||
/**
|
||||
* 发起变更通知
|
||||
* @param rowIds
|
||||
*/
|
||||
public void sendNotice(List<Long> rowIds) {
|
||||
VUtils.isTure(CollUtil.isEmpty(rowIds)).throwMessage("请选择要发起变更的数据");
|
||||
List<ProductionOrderEntity> updateList = new ArrayList<>(rowIds.size());
|
||||
rowIds.forEach(rowId -> {
|
||||
ProductionOrderEntity update = new ProductionOrderEntity();
|
||||
update.setRowId(rowId);
|
||||
update.setEditStatus(1); // 已处理
|
||||
update.setUpdatedBy(SessionUtil.getUserCode());
|
||||
update.setUpdatedTime(LocalDateTime.now());
|
||||
updateList.add(update);
|
||||
});
|
||||
this.updateBatchById(updateList);
|
||||
}
|
||||
|
||||
public void confirmStatus(Long rowId, Integer confirmStatus) {
|
||||
VUtils.isTure(ObjectUtil.isEmpty(rowId)).throwMessage("生产订单 rowId 不能为空");
|
||||
ProductionOrderEntity updateEntity = new ProductionOrderEntity();
|
||||
updateEntity.setRowId(rowId);
|
||||
updateEntity.setConfirmStatus(confirmStatus);
|
||||
updateEntity.setUpdatedBy(SessionUtil.getUserCode());
|
||||
updateEntity.setUpdatedTime(LocalDateTime.now());
|
||||
this.updateById(updateEntity);
|
||||
// 计划已确认,自动提交到AP
|
||||
if (confirmStatus == 3) {
|
||||
syncChange2Sap(rowId);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 生产订单变更提交到SAP
|
||||
* @param rowId
|
||||
*/
|
||||
private void syncChange2Sap(Long rowId) {
|
||||
// TODO
|
||||
ProductionOrderEntity updateEntity = new ProductionOrderEntity();
|
||||
updateEntity.setRowId(rowId);
|
||||
updateEntity.setEditStatus(2);
|
||||
updateEntity.setUpdatedBy(SessionUtil.getUserCode());
|
||||
updateEntity.setUpdatedTime(LocalDateTime.now());
|
||||
this.updateById(updateEntity);
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,4 @@
|
|||
<?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="com.nflg.product.bomnew.mapper.master.ProductionOrderMapper">
|
||||
</mapper>
|
||||
|
|
@ -0,0 +1,50 @@
|
|||
<?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="com.nflg.product.bomnew.mapper.master.ProductionOrderMapper">
|
||||
|
||||
<resultMap id="BaseResultMap" type="com.nflg.product.bomnew.pojo.entity.ProductionOrderEntity">
|
||||
<!--@mbg.generated-->
|
||||
<!--@Table t_production_order -->
|
||||
<id column="row_id" property="rowId" jdbcType="BIGINT"/>
|
||||
<result column="factory" property="factory" jdbcType="VARCHAR"/>
|
||||
<result column="production_order" property="productionOrder" jdbcType="VARCHAR"/>
|
||||
<result column="material_no" property="materialNo" jdbcType="VARCHAR"/>
|
||||
<result column="material_desc" property="materialDesc" jdbcType="VARCHAR"/>
|
||||
<result column="num" property="num" jdbcType="NUMERIC"/>
|
||||
<result column="unit" property="unit" jdbcType="VARCHAR"/>
|
||||
<result column="order_type" property="orderType" jdbcType="VARCHAR"/>
|
||||
<result column="long_text" property="longText" jdbcType="VARCHAR"/>
|
||||
<result column="contract_no" property="contractNo" jdbcType="VARCHAR"/>
|
||||
<result column="find_id" property="findId" jdbcType="VARCHAR"/>
|
||||
<result column="edit_status" property="editStatus" jdbcType="INTEGER"/>
|
||||
<result column="created_by" property="createdBy" jdbcType="VARCHAR"/>
|
||||
<result column="created_time" property="createdTime" jdbcType="TIMESTAMP"/>
|
||||
<result column="updated_by" property="updatedBy" jdbcType="VARCHAR"/>
|
||||
<result column="updated_time" property="updatedTime" jdbcType="TIMESTAMP"/>
|
||||
</resultMap>
|
||||
|
||||
<sql id="whr">
|
||||
<if test="query.productionOrder!=null and query.productionOrder!=''">
|
||||
and production_order like concat('%',#{query.productionOrder},'%')
|
||||
</if>
|
||||
<if test="query.startDate!=null and query.startDate!=''">
|
||||
and created_time >= #{query.startDate}
|
||||
</if>
|
||||
<if test="query.endDate!=null and query.endDate!=''">
|
||||
and created_time <= #{query.endDate}
|
||||
</if>
|
||||
</sql>
|
||||
|
||||
<select id="getListByPage" resultType="com.nflg.product.bomnew.pojo.vo.ProductionOrderVO">
|
||||
select * from t_production_order where 1=1
|
||||
<include refid="whr"/>
|
||||
order by row_id desc
|
||||
</select>
|
||||
|
||||
<select id="queryPostByUser" resultType="java.lang.String">
|
||||
select group_concat(distinct post_name) postName from t_authority_role_post where role_row_id in (
|
||||
select role_row_id from t_authority_role_user where user_row_id = (
|
||||
select row_id from t_authority_user where row_id = #{userRowId}
|
||||
))
|
||||
</select>
|
||||
</mapper>
|
||||
Loading…
Reference in New Issue