车间转入转出
parent
083a8379e5
commit
be05ddfdc4
@ -0,0 +1,140 @@
|
||||
package com.foreverwin.mesnac.production.controller;
|
||||
|
||||
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||
import com.foreverwin.mesnac.production.model.WorkShopTransfer;
|
||||
import com.foreverwin.mesnac.production.service.WorkShopTransferService;
|
||||
import com.foreverwin.modular.core.util.FrontPage;
|
||||
import com.foreverwin.modular.core.util.R;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
*
|
||||
* @author Philip
|
||||
* @since 2021-08-02
|
||||
*/
|
||||
@RestController
|
||||
@RequestMapping("/Z-WORK-SHOP-TRANSFER")
|
||||
public class WorkShopTransferController {
|
||||
|
||||
@Autowired
|
||||
public WorkShopTransferService workShopTransferService;
|
||||
|
||||
@ResponseBody
|
||||
@GetMapping("/sfcEnter")
|
||||
public R sfcEnter(WorkShopTransfer workShopTransfer) {
|
||||
return R.ok(workShopTransferService.sfcEnter(workShopTransfer));
|
||||
}
|
||||
|
||||
@ResponseBody
|
||||
@GetMapping("/transfer")
|
||||
public R transfer(WorkShopTransfer workShopTransfer) {
|
||||
return R.ok(workShopTransferService.transfer(workShopTransfer));
|
||||
}
|
||||
|
||||
/**
|
||||
* 根据id查询
|
||||
*
|
||||
* @param id 主键
|
||||
* @return
|
||||
*/
|
||||
@ResponseBody
|
||||
@GetMapping("/{id:.+}")
|
||||
public R getWorkShopTransferById(@PathVariable String id) {
|
||||
return R.ok( workShopTransferService.getById(id));
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询所有数据
|
||||
*
|
||||
* @return
|
||||
*/
|
||||
@ResponseBody
|
||||
@GetMapping("")
|
||||
public R getWorkShopTransferList(WorkShopTransfer workShopTransfer){
|
||||
List<WorkShopTransfer> result;
|
||||
QueryWrapper<WorkShopTransfer> queryWrapper = new QueryWrapper<>();
|
||||
queryWrapper.setEntity(workShopTransfer);
|
||||
result = workShopTransferService.list(queryWrapper);
|
||||
return R.ok(result);
|
||||
}
|
||||
|
||||
/**
|
||||
* 分页查询数据
|
||||
*
|
||||
* @param frontPage 分页信息
|
||||
* @return
|
||||
*/
|
||||
@ResponseBody
|
||||
@GetMapping("/page")
|
||||
public R page(FrontPage<WorkShopTransfer> frontPage, WorkShopTransfer workShopTransfer){
|
||||
IPage result;
|
||||
QueryWrapper<WorkShopTransfer> queryWrapper = new QueryWrapper<>();
|
||||
queryWrapper.setEntity(workShopTransfer);
|
||||
if (frontPage.getGlobalQuery() != null && !"".equals(frontPage.getGlobalQuery().trim())) {
|
||||
//TODO modify global query
|
||||
queryWrapper.lambda().and(wrapper -> wrapper
|
||||
.like(WorkShopTransfer::getHandle, frontPage.getGlobalQuery())
|
||||
.or().like(WorkShopTransfer::getSite, frontPage.getGlobalQuery())
|
||||
.or().like(WorkShopTransfer::getWorkCenter, frontPage.getGlobalQuery())
|
||||
.or().like(WorkShopTransfer::getSfc, frontPage.getGlobalQuery())
|
||||
.or().like(WorkShopTransfer::getShopOrder, frontPage.getGlobalQuery())
|
||||
.or().like(WorkShopTransfer::getItem, frontPage.getGlobalQuery())
|
||||
.or().like(WorkShopTransfer::getLastOperation, frontPage.getGlobalQuery())
|
||||
.or().like(WorkShopTransfer::getStepId, frontPage.getGlobalQuery())
|
||||
.or().like(WorkShopTransfer::getOperation, frontPage.getGlobalQuery())
|
||||
.or().like(WorkShopTransfer::getType, frontPage.getGlobalQuery())
|
||||
.or().like(WorkShopTransfer::getIsOutSource, frontPage.getGlobalQuery())
|
||||
.or().like(WorkShopTransfer::getComments, frontPage.getGlobalQuery())
|
||||
.or().like(WorkShopTransfer::getCreateUser, frontPage.getGlobalQuery())
|
||||
);
|
||||
}
|
||||
result = workShopTransferService.page(frontPage.getPagePlus(), queryWrapper);
|
||||
return R.ok(result);
|
||||
}
|
||||
|
||||
/**
|
||||
* 新增
|
||||
* @param workShopTransfer 传递的实体
|
||||
* @return null 失败 实体成功
|
||||
*/
|
||||
@PostMapping
|
||||
public R save(@RequestBody WorkShopTransfer workShopTransfer) {
|
||||
return R.ok(workShopTransferService.save(workShopTransfer));
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改
|
||||
* @param workShopTransfer 传递的实体
|
||||
* @return null 失败 实体成功
|
||||
*/
|
||||
@PutMapping
|
||||
public R updateById(@RequestBody WorkShopTransfer workShopTransfer) {
|
||||
return R.ok(workShopTransferService.updateById(workShopTransfer));
|
||||
}
|
||||
|
||||
/**
|
||||
* 根据id删除对象
|
||||
* @param id 实体ID
|
||||
* @return 0 失败 1 成功
|
||||
*/
|
||||
@ResponseBody
|
||||
@RequestMapping(method = RequestMethod.DELETE, value = "/{id:.+}")
|
||||
public R removeById(@PathVariable("id") String id){
|
||||
return R.ok(workShopTransferService.removeById(id));
|
||||
}
|
||||
|
||||
/**
|
||||
* 批量删除对象
|
||||
* @param ids 实体集合ID
|
||||
* @return 0 失败 1 成功
|
||||
*/
|
||||
@ResponseBody
|
||||
@RequestMapping(method = RequestMethod.POST, value = "/delete-batch")
|
||||
public R removeByIds(List<String> ids){
|
||||
return R.ok(workShopTransferService.removeByIds(ids));
|
||||
}
|
||||
}
|
@ -0,0 +1,110 @@
|
||||
package com.foreverwin.mesnac.production.dto;
|
||||
|
||||
import com.foreverwin.mesnac.production.model.WorkShopTransfer;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
|
||||
public class WorkShopTransferDto extends WorkShopTransfer {
|
||||
private String lastOperation;
|
||||
private String lastOperationDesc;
|
||||
private String map;
|
||||
private String workOrder;
|
||||
private String itemDesc;
|
||||
private String itemNumber;
|
||||
private String operationDesc;
|
||||
private BigDecimal qty;
|
||||
private String status;
|
||||
private String dispatchNo;
|
||||
private String resrce;
|
||||
|
||||
public String getResrce() {
|
||||
return resrce;
|
||||
}
|
||||
|
||||
public void setResrce(String resrce) {
|
||||
this.resrce = resrce;
|
||||
}
|
||||
|
||||
public String getDispatchNo() {
|
||||
return dispatchNo;
|
||||
}
|
||||
|
||||
public void setDispatchNo(String dispatchNo) {
|
||||
this.dispatchNo = dispatchNo;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getLastOperation() {
|
||||
return lastOperation;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setLastOperation(String lastOperation) {
|
||||
this.lastOperation = lastOperation;
|
||||
}
|
||||
|
||||
public String getLastOperationDesc() {
|
||||
return lastOperationDesc;
|
||||
}
|
||||
|
||||
public void setLastOperationDesc(String lastOperationDesc) {
|
||||
this.lastOperationDesc = lastOperationDesc;
|
||||
}
|
||||
|
||||
public String getMap() {
|
||||
return map;
|
||||
}
|
||||
|
||||
public void setMap(String map) {
|
||||
this.map = map;
|
||||
}
|
||||
|
||||
public String getWorkOrder() {
|
||||
return workOrder;
|
||||
}
|
||||
|
||||
public void setWorkOrder(String workOrder) {
|
||||
this.workOrder = workOrder;
|
||||
}
|
||||
|
||||
public String getItemDesc() {
|
||||
return itemDesc;
|
||||
}
|
||||
|
||||
public void setItemDesc(String itemDesc) {
|
||||
this.itemDesc = itemDesc;
|
||||
}
|
||||
|
||||
public String getItemNumber() {
|
||||
return itemNumber;
|
||||
}
|
||||
|
||||
public void setItemNumber(String itemNumber) {
|
||||
this.itemNumber = itemNumber;
|
||||
}
|
||||
|
||||
public String getOperationDesc() {
|
||||
return operationDesc;
|
||||
}
|
||||
|
||||
public void setOperationDesc(String operationDesc) {
|
||||
this.operationDesc = operationDesc;
|
||||
}
|
||||
|
||||
@Override
|
||||
public BigDecimal getQty() {
|
||||
return qty;
|
||||
}
|
||||
|
||||
public void setQty(BigDecimal qty) {
|
||||
this.qty = qty;
|
||||
}
|
||||
|
||||
public String getStatus() {
|
||||
return status;
|
||||
}
|
||||
|
||||
public void setStatus(String status) {
|
||||
this.status = status;
|
||||
}
|
||||
}
|
@ -0,0 +1,21 @@
|
||||
package com.foreverwin.mesnac.production.mapper;
|
||||
|
||||
import com.foreverwin.mesnac.production.dto.WorkShopTransferDto;
|
||||
import com.foreverwin.mesnac.production.model.WorkShopTransfer;
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
import org.springframework.stereotype.Repository;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
* 车间转移记录 Mapper 接口
|
||||
* </p>
|
||||
*
|
||||
* @author Philip
|
||||
* @since 2021-07-30
|
||||
*/
|
||||
@Repository
|
||||
public interface WorkShopTransferMapper extends BaseMapper<WorkShopTransfer> {
|
||||
|
||||
WorkShopTransferDto getSfcData(@Param("site") String site,@Param("sfc") String sfc);
|
||||
}
|
@ -0,0 +1,281 @@
|
||||
package com.foreverwin.mesnac.production.model;
|
||||
|
||||
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 com.baomidou.mybatisplus.extension.activerecord.Model;
|
||||
|
||||
import java.io.Serializable;
|
||||
import java.math.BigDecimal;
|
||||
import java.time.LocalDateTime;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
* 车间转移记录
|
||||
* </p>
|
||||
*
|
||||
* @author Philip
|
||||
* @since 2021-08-02
|
||||
*/
|
||||
|
||||
@TableName("Z_WORK_SHOP_TRANSFER")
|
||||
|
||||
public class WorkShopTransfer extends Model<WorkShopTransfer> {
|
||||
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
/**
|
||||
* 主键
|
||||
*/
|
||||
@TableId(value = "HANDLE", type = IdType.INPUT)
|
||||
private String handle;
|
||||
/**
|
||||
* 站点
|
||||
*/
|
||||
@TableField("SITE")
|
||||
private String site;
|
||||
/**
|
||||
* 车间
|
||||
*/
|
||||
@TableField("WORK_CENTER")
|
||||
private String workCenter;
|
||||
/**
|
||||
* 产品条码
|
||||
*/
|
||||
@TableField("SFC")
|
||||
private String sfc;
|
||||
/**
|
||||
* 工单
|
||||
*/
|
||||
@TableField("SHOP_ORDER")
|
||||
private String shopOrder;
|
||||
/**
|
||||
* 物料
|
||||
*/
|
||||
@TableField("ITEM")
|
||||
private String item;
|
||||
/**
|
||||
* 上工序
|
||||
*/
|
||||
@TableField("LAST_OPERATION")
|
||||
private String lastOperation;
|
||||
/**
|
||||
* 步骤
|
||||
*/
|
||||
@TableField("STEP_ID")
|
||||
private String stepId;
|
||||
/**
|
||||
* 转入或转出工序
|
||||
*/
|
||||
@TableField("OPERATION")
|
||||
private String operation;
|
||||
/**
|
||||
* 数量
|
||||
*/
|
||||
@TableField("QTY")
|
||||
private BigDecimal qty;
|
||||
/**
|
||||
* 类型:转入转出
|
||||
*/
|
||||
@TableField("TYPE")
|
||||
private String type;
|
||||
/**
|
||||
* 是否外协工序
|
||||
*/
|
||||
@TableField("IS_OUT_SOURCE")
|
||||
private String isOutSource;
|
||||
/**
|
||||
* 备注
|
||||
*/
|
||||
@TableField("COMMENTS")
|
||||
private String comments;
|
||||
/**
|
||||
* 创建人
|
||||
*/
|
||||
@TableField("CREATE_USER")
|
||||
private String createUser;
|
||||
/**
|
||||
* 创建时间
|
||||
*/
|
||||
@TableField("CREATED_DATE_TIME")
|
||||
private LocalDateTime createdDateTime;
|
||||
|
||||
|
||||
public String getHandle() {
|
||||
return handle;
|
||||
}
|
||||
|
||||
public void setHandle(String handle) {
|
||||
this.handle = handle;
|
||||
}
|
||||
|
||||
public String getSite() {
|
||||
return site;
|
||||
}
|
||||
|
||||
public void setSite(String site) {
|
||||
this.site = site;
|
||||
}
|
||||
|
||||
public String getWorkCenter() {
|
||||
return workCenter;
|
||||
}
|
||||
|
||||
public void setWorkCenter(String workCenter) {
|
||||
this.workCenter = workCenter;
|
||||
}
|
||||
|
||||
public String getSfc() {
|
||||
return sfc;
|
||||
}
|
||||
|
||||
public void setSfc(String sfc) {
|
||||
this.sfc = sfc;
|
||||
}
|
||||
|
||||
public String getShopOrder() {
|
||||
return shopOrder;
|
||||
}
|
||||
|
||||
public void setShopOrder(String shopOrder) {
|
||||
this.shopOrder = shopOrder;
|
||||
}
|
||||
|
||||
public String getItem() {
|
||||
return item;
|
||||
}
|
||||
|
||||
public void setItem(String item) {
|
||||
this.item = item;
|
||||
}
|
||||
|
||||
public String getLastOperation() {
|
||||
return lastOperation;
|
||||
}
|
||||
|
||||
public void setLastOperation(String lastOperation) {
|
||||
this.lastOperation = lastOperation;
|
||||
}
|
||||
|
||||
public String getStepId() {
|
||||
return stepId;
|
||||
}
|
||||
|
||||
public void setStepId(String stepId) {
|
||||
this.stepId = stepId;
|
||||
}
|
||||
|
||||
public String getOperation() {
|
||||
return operation;
|
||||
}
|
||||
|
||||
public void setOperation(String operation) {
|
||||
this.operation = operation;
|
||||
}
|
||||
|
||||
public BigDecimal getQty() {
|
||||
return qty;
|
||||
}
|
||||
|
||||
public void setQty(BigDecimal qty) {
|
||||
this.qty = qty;
|
||||
}
|
||||
|
||||
public String getType() {
|
||||
return type;
|
||||
}
|
||||
|
||||
public void setType(String type) {
|
||||
this.type = type;
|
||||
}
|
||||
|
||||
public String getIsOutSource() {
|
||||
return isOutSource;
|
||||
}
|
||||
|
||||
public void setIsOutSource(String isOutSource) {
|
||||
this.isOutSource = isOutSource;
|
||||
}
|
||||
|
||||
public String getComments() {
|
||||
return comments;
|
||||
}
|
||||
|
||||
public void setComments(String comments) {
|
||||
this.comments = comments;
|
||||
}
|
||||
|
||||
public String getCreateUser() {
|
||||
return createUser;
|
||||
}
|
||||
|
||||
public void setCreateUser(String createUser) {
|
||||
this.createUser = createUser;
|
||||
}
|
||||
|
||||
public LocalDateTime getCreatedDateTime() {
|
||||
return createdDateTime;
|
||||
}
|
||||
|
||||
public void setCreatedDateTime(LocalDateTime createdDateTime) {
|
||||
this.createdDateTime = createdDateTime;
|
||||
}
|
||||
|
||||
public static final String HANDLE = "HANDLE";
|
||||
|
||||
public static final String SITE = "SITE";
|
||||
|
||||
public static final String WORK_CENTER = "WORK_CENTER";
|
||||
|
||||
public static final String SFC = "SFC";
|
||||
|
||||
public static final String SHOP_ORDER = "SHOP_ORDER";
|
||||
|
||||
public static final String ITEM = "ITEM";
|
||||
|
||||
public static final String LAST_OPERATION = "LAST_OPERATION";
|
||||
|
||||
public static final String STEP_ID = "STEP_ID";
|
||||
|
||||
public static final String OPERATION = "OPERATION";
|
||||
|
||||
public static final String QTY = "QTY";
|
||||
|
||||
public static final String TYPE = "TYPE";
|
||||
|
||||
public static final String IS_OUT_SOURCE = "IS_OUT_SOURCE";
|
||||
|
||||
public static final String COMMENTS = "COMMENTS";
|
||||
|
||||
public static final String CREATE_USER = "CREATE_USER";
|
||||
|
||||
public static final String CREATED_DATE_TIME = "CREATED_DATE_TIME";
|
||||
|
||||
|
||||
@Override
|
||||
protected Serializable pkVal() {
|
||||
return this.handle;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return "WorkShopTransfer{" +
|
||||
"handle = " + handle +
|
||||
", site = " + site +
|
||||
", workCenter = " + workCenter +
|
||||
", sfc = " + sfc +
|
||||
", shopOrder = " + shopOrder +
|
||||
", item = " + item +
|
||||
", lastOperation = " + lastOperation +
|
||||
", stepId = " + stepId +
|
||||
", operation = " + operation +
|
||||
", qty = " + qty +
|
||||
", type = " + type +
|
||||
", isOutSource = " + isOutSource +
|
||||
", comments = " + comments +
|
||||
", createUser = " + createUser +
|
||||
", createdDateTime = " + createdDateTime +
|
||||
"}";
|
||||
}
|
||||
}
|
@ -0,0 +1,32 @@
|
||||
package com.foreverwin.mesnac.production.service;
|
||||
|
||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||
import com.foreverwin.mesnac.production.model.WorkShopTransfer;
|
||||
import com.baomidou.mybatisplus.extension.service.IService;
|
||||
import com.foreverwin.modular.core.util.FrontPage;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
* 车间转移记录 服务类
|
||||
* </p>
|
||||
*
|
||||
* @author Philip
|
||||
* @since 2021-07-30
|
||||
*/
|
||||
public interface WorkShopTransferService extends IService<WorkShopTransfer> {
|
||||
|
||||
/**
|
||||
* 分页查询
|
||||
* @param frontPage
|
||||
* @return
|
||||
*/
|
||||
IPage<WorkShopTransfer> selectPage(FrontPage<WorkShopTransfer> frontPage, WorkShopTransfer workShopTransfer);
|
||||
|
||||
List<WorkShopTransfer> selectList(WorkShopTransfer workShopTransfer);
|
||||
|
||||
WorkShopTransfer sfcEnter(WorkShopTransfer workShopTransfer);
|
||||
|
||||
Object transfer(WorkShopTransfer workShopTransfer);
|
||||
}
|
@ -0,0 +1,155 @@
|
||||
package com.foreverwin.mesnac.production.service.impl;
|
||||
|
||||
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||
import com.foreverwin.mesnac.common.enums.DispatchStatusEnum;
|
||||
import com.foreverwin.mesnac.common.enums.HandleEnum;
|
||||
import com.foreverwin.mesnac.common.service.SfcDispatchCommonService;
|
||||
import com.foreverwin.mesnac.common.util.ExceptionUtil;
|
||||
import com.foreverwin.mesnac.common.util.StringUtil;
|
||||
import com.foreverwin.mesnac.meapi.model.Operation;
|
||||
import com.foreverwin.mesnac.meapi.model.Router;
|
||||
import com.foreverwin.mesnac.meapi.service.OperationService;
|
||||
import com.foreverwin.mesnac.meapi.service.RouterService;
|
||||
import com.foreverwin.mesnac.production.dto.WorkShopTransferDto;
|
||||
import com.foreverwin.mesnac.production.mapper.SfcCrossMapper;
|
||||
import com.foreverwin.mesnac.production.mapper.WorkShopTransferMapper;
|
||||
import com.foreverwin.mesnac.production.model.StepOperation;
|
||||
import com.foreverwin.mesnac.production.model.WorkShopTransfer;
|
||||
import com.foreverwin.mesnac.production.service.SfcCrossService;
|
||||
import com.foreverwin.mesnac.production.service.WorkShopTransferService;
|
||||
import com.foreverwin.modular.core.exception.BaseException;
|
||||
import com.foreverwin.modular.core.util.CommonMethods;
|
||||
import com.foreverwin.modular.core.util.FrontPage;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.context.i18n.LocaleContextHolder;
|
||||
import org.springframework.stereotype.Service;
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
|
||||
import java.time.LocalDateTime;
|
||||
import java.util.List;
|
||||
import java.util.UUID;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
* 车间转移记录 服务实现类
|
||||
* </p>
|
||||
*
|
||||
* @author Philip
|
||||
* @since 2021-07-30
|
||||
*/
|
||||
@Service
|
||||
@Transactional(rollbackFor = Exception.class)
|
||||
public class WorkShopTransferServiceImpl extends ServiceImpl<WorkShopTransferMapper, WorkShopTransfer> implements WorkShopTransferService {
|
||||
|
||||
@Autowired
|
||||
private SfcDispatchCommonService sfcDispatchCommonService;
|
||||
@Autowired
|
||||
private WorkShopTransferMapper workShopTransferMapper;
|
||||
@Autowired
|
||||
private OperationService operationService;
|
||||
@Autowired
|
||||
private SfcCrossService sfcCrossService;
|
||||
@Autowired
|
||||
private SfcCrossMapper sfcCrossMapper;
|
||||
@Autowired
|
||||
private RouterService routerService;
|
||||
|
||||
@Override
|
||||
public IPage<WorkShopTransfer> selectPage(FrontPage<WorkShopTransfer> frontPage, WorkShopTransfer workShopTransfer) {
|
||||
QueryWrapper<WorkShopTransfer> queryWrapper = new QueryWrapper<>();
|
||||
queryWrapper.setEntity(workShopTransfer);
|
||||
return super.page(frontPage.getPagePlus(), queryWrapper);
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<WorkShopTransfer> selectList(WorkShopTransfer workShopTransfer) {
|
||||
QueryWrapper<WorkShopTransfer> queryWrapper = new QueryWrapper<>();
|
||||
queryWrapper.setEntity(workShopTransfer);
|
||||
return super.list(queryWrapper);
|
||||
}
|
||||
|
||||
@Override
|
||||
public WorkShopTransferDto sfcEnter(WorkShopTransfer workShopTransfer) {
|
||||
//条码是否在工作中心下
|
||||
String site = CommonMethods.getSite();
|
||||
String sfc = workShopTransfer.getSfc();
|
||||
String workCenter = workShopTransfer.getWorkCenter();
|
||||
if (StringUtil.isBlank(sfc)) {
|
||||
throw new BaseException("产品条码不能为空");
|
||||
}
|
||||
|
||||
WorkShopTransferDto dto = workShopTransferMapper.getSfcData(site, sfc);
|
||||
if (dto == null) {
|
||||
throw new BaseException("未找到该产品条码");
|
||||
}
|
||||
if (StringUtil.isBlank(dto.getWorkCenter()) || !dto.getWorkCenter().equals(workCenter)) {
|
||||
throw new BaseException("产品条码不在所选车间");
|
||||
}
|
||||
//查询上一工序
|
||||
Router router = routerService.getRouterBySfcBo(HandleEnum.SFC.getHandle(site, sfc));
|
||||
int seq = 0;
|
||||
List<StepOperation> stepOperationList = sfcCrossMapper.findRouterOperationByRouterBo(site, router.getHandle(), LocaleContextHolder.getLocale().getLanguage());
|
||||
for (int i = 0; i < stepOperationList.size(); i++) {
|
||||
StepOperation stepOperation = stepOperationList.get(i);
|
||||
if (stepOperation.getStepId().equals(dto.getStepId())) {
|
||||
seq = i;
|
||||
}
|
||||
}
|
||||
if (seq != 0) {
|
||||
StepOperation stepOperation = stepOperationList.get(seq - 1);
|
||||
dto.setLastOperation(stepOperation.getOperation());
|
||||
dto.setLastOperationDesc(stepOperation.getDescription());
|
||||
}
|
||||
return dto;
|
||||
}
|
||||
|
||||
@Override
|
||||
public Object transfer(WorkShopTransfer workShopTransfer) {
|
||||
String site = CommonMethods.getSite();
|
||||
String user = CommonMethods.getUser();
|
||||
WorkShopTransferDto dto = sfcEnter(workShopTransfer);
|
||||
String isOutSource = dto.getIsOutSource();
|
||||
String sfcBO = HandleEnum.SFC.getHandle(site, workShopTransfer.getSfc());
|
||||
if (StringUtil.notBlank(isOutSource) && isOutSource.equals("Y")) {
|
||||
//转出开始
|
||||
try {
|
||||
Operation currentRevisionRef = operationService.getCurrentRevisionRef(site, dto.getOperation());
|
||||
if (workShopTransfer.getType().equals("OUT")) {
|
||||
sfcCrossService.startAction(site, currentRevisionRef.getHandle(), dto.getResrce(), sfcBO, dto.getQty());
|
||||
//更改派工单状态
|
||||
sfcDispatchCommonService.updateSfcDispatchStatus(site, CommonMethods.getUser(), dto.getDispatchNo(), DispatchStatusEnum.START.getCode());
|
||||
} else {
|
||||
//转入完成
|
||||
sfcCrossService.completeAction(site, currentRevisionRef.getHandle(), dto.getResrce(), sfcBO, dto.getQty());
|
||||
//更改派工单状态
|
||||
sfcDispatchCommonService.updateSfcDispatchStatus(site, CommonMethods.getUser(), dto.getDispatchNo(), DispatchStatusEnum.COMPLETE.getCode());
|
||||
}
|
||||
} catch (Exception e) {
|
||||
ExceptionUtil.throwException(e);
|
||||
}
|
||||
}
|
||||
|
||||
WorkShopTransfer transferLog = new WorkShopTransfer();
|
||||
transferLog.setHandle(UUID.randomUUID().toString());
|
||||
transferLog.setSite(site);
|
||||
transferLog.setWorkCenter(dto.getWorkCenter());
|
||||
transferLog.setSfc(dto.getSfc());
|
||||
transferLog.setShopOrder(dto.getShopOrder());
|
||||
transferLog.setItem(dto.getItem());
|
||||
transferLog.setLastOperation(dto.getLastOperation());
|
||||
transferLog.setStepId(dto.getStepId());
|
||||
transferLog.setOperation(dto.getOperation());
|
||||
transferLog.setQty(dto.getQty());
|
||||
transferLog.setType(workShopTransfer.getType());
|
||||
transferLog.setIsOutSource(isOutSource);
|
||||
transferLog.setComments(workShopTransfer.getComments());
|
||||
transferLog.setCreateUser(user);
|
||||
transferLog.setCreatedDateTime(LocalDateTime.now());
|
||||
save(transferLog);
|
||||
return null;
|
||||
}
|
||||
|
||||
|
||||
}
|
@ -0,0 +1,513 @@
|
||||
<?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.foreverwin.mesnac.production.mapper.WorkShopTransferMapper">
|
||||
|
||||
<!-- 通用查询映射结果 -->
|
||||
<resultMap id="BaseResultMap" type="com.foreverwin.mesnac.production.model.WorkShopTransfer">
|
||||
<id column="HANDLE" property="handle" />
|
||||
<result column="SITE" property="site" />
|
||||
<result column="WORK_CENTER" property="workCenter" />
|
||||
<result column="SFC" property="sfc" />
|
||||
<result column="SHOP_ORDER" property="shopOrder" />
|
||||
<result column="ITEM" property="item" />
|
||||
<result column="LAST_OPERATION" property="lastOperation" />
|
||||
<result column="STEP_ID" property="stepId" />
|
||||
<result column="OPERATION" property="operation" />
|
||||
<result column="QTY" property="qty" />
|
||||
<result column="TYPE" property="type" />
|
||||
<result column="IS_OUT_SOURCE" property="isOutSource" />
|
||||
<result column="COMMENTS" property="comments" />
|
||||
<result column="CREATE_USER" property="createUser" />
|
||||
<result column="CREATED_DATE_TIME" property="createdDateTime" />
|
||||
</resultMap>
|
||||
<resultMap id="FullResultMap" type="com.foreverwin.mesnac.production.dto.WorkShopTransferDto">
|
||||
<result column="MAP" property="map" />
|
||||
<result column="WORK_ORDER" property="workOrder" />
|
||||
<result column="ITEM_DESC" property="itemDesc" />
|
||||
<result column="ITEM_NUMBER" property="itemNumber" />
|
||||
<result column="OPERATION_DESC" property="operationDesc" />
|
||||
<result column="QTY" property="qty" />
|
||||
<result column="STATUS" property="status" />
|
||||
<result column="DISPATCH_NO" property="dispatchNo" />
|
||||
<result column="RESRCE" property="resrce" />
|
||||
</resultMap>
|
||||
<!-- 通用查询结果列 -->
|
||||
<sql id="Base_Column_List">
|
||||
HANDLE, SITE, WORK_CENTER, SFC, SHOP_ORDER, ITEM, LAST_OPERATION, STEP_ID, OPERATION, QTY, TYPE, IS_OUT_SOURCE, COMMENTS, CREATE_USER, CREATED_DATE_TIME
|
||||
</sql>
|
||||
|
||||
<!-- BaseMapper标准查询/修改/删除 -->
|
||||
<select id="selectById" resultMap="BaseResultMap">
|
||||
SELECT <include refid="Base_Column_List"></include> FROM Z_WORK_SHOP_TRANSFER WHERE HANDLE=#{handle}
|
||||
</select>
|
||||
|
||||
<select id="selectByMap" resultMap="BaseResultMap">
|
||||
SELECT <include refid="Base_Column_List"></include>
|
||||
FROM Z_WORK_SHOP_TRANSFER
|
||||
<if test="cm!=null and !cm.isEmpty">
|
||||
<where>
|
||||
<foreach collection="cm.keys" item="k" separator="AND">
|
||||
<if test="cm[k] != null">
|
||||
${k} = #{cm[${k}]}
|
||||
</if>
|
||||
</foreach>
|
||||
</where>
|
||||
</if>
|
||||
</select>
|
||||
|
||||
<select id="selectBatchIds" resultMap="BaseResultMap">
|
||||
SELECT <include refid="Base_Column_List"></include>
|
||||
FROM Z_WORK_SHOP_TRANSFER WHERE HANDLE IN (
|
||||
<foreach item="item" index="index" collection="coll" separator=",">#{item}
|
||||
</foreach>)
|
||||
</select>
|
||||
|
||||
<select id="selectOne" resultMap="BaseResultMap">
|
||||
SELECT <include refid="Base_Column_List"></include> FROM Z_WORK_SHOP_TRANSFER
|
||||
<where>
|
||||
<if test="ew.entity.handle!=null">
|
||||
HANDLE=#{ew.handle}
|
||||
</if>
|
||||
<if test="ew.entity.site!=null"> AND SITE=#{ew.entity.site}</if>
|
||||
<if test="ew.entity.workCenter!=null"> AND WORK_CENTER=#{ew.entity.workCenter}</if>
|
||||
<if test="ew.entity.sfc!=null"> AND SFC=#{ew.entity.sfc}</if>
|
||||
<if test="ew.entity.shopOrder!=null"> AND SHOP_ORDER=#{ew.entity.shopOrder}</if>
|
||||
<if test="ew.entity.item!=null"> AND ITEM=#{ew.entity.item}</if>
|
||||
<if test="ew.entity.lastOperation!=null"> AND LAST_OPERATION=#{ew.entity.lastOperation}</if>
|
||||
<if test="ew.entity.stepId!=null"> AND STEP_ID=#{ew.entity.stepId}</if>
|
||||
<if test="ew.entity.operation!=null"> AND OPERATION=#{ew.entity.operation}</if>
|
||||
<if test="ew.entity.qty!=null"> AND QTY=#{ew.entity.qty}</if>
|
||||
<if test="ew.entity.type!=null"> AND TYPE=#{ew.entity.type}</if>
|
||||
<if test="ew.entity.isOutSource!=null"> AND IS_OUT_SOURCE=#{ew.entity.isOutSource}</if>
|
||||
<if test="ew.entity.comments!=null"> AND COMMENTS=#{ew.entity.comments}</if>
|
||||
<if test="ew.entity.createUser!=null"> AND CREATE_USER=#{ew.entity.createUser}</if>
|
||||
<if test="ew.entity.createdDateTime!=null"> AND CREATED_DATE_TIME=#{ew.entity.createdDateTime}</if>
|
||||
</where>
|
||||
</select>
|
||||
|
||||
<select id="selectCount" resultType="Integer">
|
||||
SELECT COUNT(1) FROM Z_WORK_SHOP_TRANSFER
|
||||
<where>
|
||||
<if test="ew!=null">
|
||||
<if test="ew.entity!=null">
|
||||
<if test="ew.entity.handle!=null">
|
||||
HANDLE=#{ew.entity.handle}
|
||||
</if>
|
||||
<if test="ew.entity.site!=null"> AND SITE=#{ew.entity.site}</if>
|
||||
<if test="ew.entity.workCenter!=null"> AND WORK_CENTER=#{ew.entity.workCenter}</if>
|
||||
<if test="ew.entity.sfc!=null"> AND SFC=#{ew.entity.sfc}</if>
|
||||
<if test="ew.entity.shopOrder!=null"> AND SHOP_ORDER=#{ew.entity.shopOrder}</if>
|
||||
<if test="ew.entity.item!=null"> AND ITEM=#{ew.entity.item}</if>
|
||||
<if test="ew.entity.lastOperation!=null"> AND LAST_OPERATION=#{ew.entity.lastOperation}</if>
|
||||
<if test="ew.entity.stepId!=null"> AND STEP_ID=#{ew.entity.stepId}</if>
|
||||
<if test="ew.entity.operation!=null"> AND OPERATION=#{ew.entity.operation}</if>
|
||||
<if test="ew.entity.qty!=null"> AND QTY=#{ew.entity.qty}</if>
|
||||
<if test="ew.entity.type!=null"> AND TYPE=#{ew.entity.type}</if>
|
||||
<if test="ew.entity.isOutSource!=null"> AND IS_OUT_SOURCE=#{ew.entity.isOutSource}</if>
|
||||
<if test="ew.entity.comments!=null"> AND COMMENTS=#{ew.entity.comments}</if>
|
||||
<if test="ew.entity.createUser!=null"> AND CREATE_USER=#{ew.entity.createUser}</if>
|
||||
<if test="ew.entity.createdDateTime!=null"> AND CREATED_DATE_TIME=#{ew.entity.createdDateTime}</if>
|
||||
</if>
|
||||
<if test="ew!=null and ew.sqlSegment!=null and ew.nonEmptyOfWhere">
|
||||
${ew.sqlSegment}
|
||||
</if>
|
||||
</if>
|
||||
</where>
|
||||
<if test="ew!=null and ew.sqlSegment!=null and ew.emptyOfWhere">
|
||||
${ew.sqlSegment}
|
||||
</if>
|
||||
</select>
|
||||
|
||||
<select id="selectList" resultMap="BaseResultMap">
|
||||
SELECT <choose><when test="ew != null and ew.sqlSelect != null">${ew.sqlSelect}</when><otherwise><include refid="Base_Column_List"></include></otherwise></choose> FROM Z_WORK_SHOP_TRANSFER
|
||||
<where>
|
||||
<if test="ew!=null">
|
||||
<if test="ew.entity!=null">
|
||||
<if test="ew.entity.handle!=null">
|
||||
HANDLE=#{ew.entity.handle}
|
||||
</if>
|
||||
<if test="ew.entity.site!=null"> AND SITE=#{ew.entity.site}</if>
|
||||
<if test="ew.entity.workCenter!=null"> AND WORK_CENTER=#{ew.entity.workCenter}</if>
|
||||
<if test="ew.entity.sfc!=null"> AND SFC=#{ew.entity.sfc}</if>
|
||||
<if test="ew.entity.shopOrder!=null"> AND SHOP_ORDER=#{ew.entity.shopOrder}</if>
|
||||
<if test="ew.entity.item!=null"> AND ITEM=#{ew.entity.item}</if>
|
||||
<if test="ew.entity.lastOperation!=null"> AND LAST_OPERATION=#{ew.entity.lastOperation}</if>
|
||||
<if test="ew.entity.stepId!=null"> AND STEP_ID=#{ew.entity.stepId}</if>
|
||||
<if test="ew.entity.operation!=null"> AND OPERATION=#{ew.entity.operation}</if>
|
||||
<if test="ew.entity.qty!=null"> AND QTY=#{ew.entity.qty}</if>
|
||||
<if test="ew.entity.type!=null"> AND TYPE=#{ew.entity.type}</if>
|
||||
<if test="ew.entity.isOutSource!=null"> AND IS_OUT_SOURCE=#{ew.entity.isOutSource}</if>
|
||||
<if test="ew.entity.comments!=null"> AND COMMENTS=#{ew.entity.comments}</if>
|
||||
<if test="ew.entity.createUser!=null"> AND CREATE_USER=#{ew.entity.createUser}</if>
|
||||
<if test="ew.entity.createdDateTime!=null"> AND CREATED_DATE_TIME=#{ew.entity.createdDateTime}</if>
|
||||
</if>
|
||||
<if test="ew!=null and ew.sqlSegment!=null and ew.nonEmptyOfWhere">
|
||||
${ew.sqlSegment}
|
||||
</if>
|
||||
</if>
|
||||
</where>
|
||||
<if test="ew!=null and ew.sqlSegment!=null and ew.emptyOfWhere">
|
||||
${ew.sqlSegment}
|
||||
</if>
|
||||
</select>
|
||||
|
||||
<select id="selectMaps" resultType="HashMap">
|
||||
SELECT <choose><when test="ew != null and ew.sqlSelect != null">${ew.sqlSelect}</when><otherwise><include refid="Base_Column_List"></include></otherwise></choose> FROM Z_WORK_SHOP_TRANSFER
|
||||
<where>
|
||||
<if test="ew!=null">
|
||||
<if test="ew.entity!=null">
|
||||
<if test="ew.entity.handle!=null">
|
||||
HANDLE=#{ew.entity.handle}
|
||||
</if>
|
||||
<if test="ew.entity.site!=null"> AND SITE=#{ew.entity.site}</if>
|
||||
<if test="ew.entity.workCenter!=null"> AND WORK_CENTER=#{ew.entity.workCenter}</if>
|
||||
<if test="ew.entity.sfc!=null"> AND SFC=#{ew.entity.sfc}</if>
|
||||
<if test="ew.entity.shopOrder!=null"> AND SHOP_ORDER=#{ew.entity.shopOrder}</if>
|
||||
<if test="ew.entity.item!=null"> AND ITEM=#{ew.entity.item}</if>
|
||||
<if test="ew.entity.lastOperation!=null"> AND LAST_OPERATION=#{ew.entity.lastOperation}</if>
|
||||
<if test="ew.entity.stepId!=null"> AND STEP_ID=#{ew.entity.stepId}</if>
|
||||
<if test="ew.entity.operation!=null"> AND OPERATION=#{ew.entity.operation}</if>
|
||||
<if test="ew.entity.qty!=null"> AND QTY=#{ew.entity.qty}</if>
|
||||
<if test="ew.entity.type!=null"> AND TYPE=#{ew.entity.type}</if>
|
||||
<if test="ew.entity.isOutSource!=null"> AND IS_OUT_SOURCE=#{ew.entity.isOutSource}</if>
|
||||
<if test="ew.entity.comments!=null"> AND COMMENTS=#{ew.entity.comments}</if>
|
||||
<if test="ew.entity.createUser!=null"> AND CREATE_USER=#{ew.entity.createUser}</if>
|
||||
<if test="ew.entity.createdDateTime!=null"> AND CREATED_DATE_TIME=#{ew.entity.createdDateTime}</if>
|
||||
</if>
|
||||
<if test="ew!=null and ew.sqlSegment!=null and ew.nonEmptyOfWhere">
|
||||
${ew.sqlSegment}
|
||||
</if>
|
||||
</if>
|
||||
</where>
|
||||
<if test="ew!=null and ew.sqlSegment!=null and ew.emptyOfWhere">
|
||||
${ew.sqlSegment}
|
||||
</if>
|
||||
</select>
|
||||
|
||||
<select id="selectObjs" resultType="Object">
|
||||
SELECT <choose><when test="ew != null and ew.sqlSelect != null">${ew.sqlSelect}</when><otherwise><include refid="Base_Column_List"></include></otherwise></choose> FROM Z_WORK_SHOP_TRANSFER
|
||||
<where>
|
||||
<if test="ew!=null">
|
||||
<if test="ew.entity!=null">
|
||||
<if test="ew.entity.handle!=null">
|
||||
HANDLE=#{ew.entity.handle}
|
||||
</if>
|
||||
<if test="ew.entity.site!=null"> AND SITE=#{ew.entity.site}</if>
|
||||
<if test="ew.entity.workCenter!=null"> AND WORK_CENTER=#{ew.entity.workCenter}</if>
|
||||
<if test="ew.entity.sfc!=null"> AND SFC=#{ew.entity.sfc}</if>
|
||||
<if test="ew.entity.shopOrder!=null"> AND SHOP_ORDER=#{ew.entity.shopOrder}</if>
|
||||
<if test="ew.entity.item!=null"> AND ITEM=#{ew.entity.item}</if>
|
||||
<if test="ew.entity.lastOperation!=null"> AND LAST_OPERATION=#{ew.entity.lastOperation}</if>
|
||||
<if test="ew.entity.stepId!=null"> AND STEP_ID=#{ew.entity.stepId}</if>
|
||||
<if test="ew.entity.operation!=null"> AND OPERATION=#{ew.entity.operation}</if>
|
||||
<if test="ew.entity.qty!=null"> AND QTY=#{ew.entity.qty}</if>
|
||||
<if test="ew.entity.type!=null"> AND TYPE=#{ew.entity.type}</if>
|
||||
<if test="ew.entity.isOutSource!=null"> AND IS_OUT_SOURCE=#{ew.entity.isOutSource}</if>
|
||||
<if test="ew.entity.comments!=null"> AND COMMENTS=#{ew.entity.comments}</if>
|
||||
<if test="ew.entity.createUser!=null"> AND CREATE_USER=#{ew.entity.createUser}</if>
|
||||
<if test="ew.entity.createdDateTime!=null"> AND CREATED_DATE_TIME=#{ew.entity.createdDateTime}</if>
|
||||
</if>
|
||||
<if test="ew!=null and ew.sqlSegment!=null and ew.nonEmptyOfWhere">
|
||||
${ew.sqlSegment}
|
||||
</if>
|
||||
</if>
|
||||
</where>
|
||||
<if test="ew!=null and ew.sqlSegment!=null and ew.emptyOfWhere">
|
||||
${ew.sqlSegment}
|
||||
</if>
|
||||
</select>
|
||||
|
||||
<select id="selectPage" resultMap="BaseResultMap">
|
||||
SELECT <choose><when test="ew != null and ew.sqlSelect != null">${ew.sqlSelect}</when><otherwise><include refid="Base_Column_List"></include></otherwise></choose> FROM Z_WORK_SHOP_TRANSFER
|
||||
<where>
|
||||
<if test="ew!=null">
|
||||
<if test="ew.entity!=null">
|
||||
<if test="ew.entity.handle!=null">
|
||||
HANDLE=#{ew.entity.handle}
|
||||
</if>
|
||||
<if test="ew.entity.site!=null"> AND SITE=#{ew.entity.site}</if>
|
||||
<if test="ew.entity.workCenter!=null"> AND WORK_CENTER=#{ew.entity.workCenter}</if>
|
||||
<if test="ew.entity.sfc!=null"> AND SFC=#{ew.entity.sfc}</if>
|
||||
<if test="ew.entity.shopOrder!=null"> AND SHOP_ORDER=#{ew.entity.shopOrder}</if>
|
||||
<if test="ew.entity.item!=null"> AND ITEM=#{ew.entity.item}</if>
|
||||
<if test="ew.entity.lastOperation!=null"> AND LAST_OPERATION=#{ew.entity.lastOperation}</if>
|
||||
<if test="ew.entity.stepId!=null"> AND STEP_ID=#{ew.entity.stepId}</if>
|
||||
<if test="ew.entity.operation!=null"> AND OPERATION=#{ew.entity.operation}</if>
|
||||
<if test="ew.entity.qty!=null"> AND QTY=#{ew.entity.qty}</if>
|
||||
<if test="ew.entity.type!=null"> AND TYPE=#{ew.entity.type}</if>
|
||||
<if test="ew.entity.isOutSource!=null"> AND IS_OUT_SOURCE=#{ew.entity.isOutSource}</if>
|
||||
<if test="ew.entity.comments!=null"> AND COMMENTS=#{ew.entity.comments}</if>
|
||||
<if test="ew.entity.createUser!=null"> AND CREATE_USER=#{ew.entity.createUser}</if>
|
||||
<if test="ew.entity.createdDateTime!=null"> AND CREATED_DATE_TIME=#{ew.entity.createdDateTime}</if>
|
||||
</if>
|
||||
<if test="ew!=null and ew.sqlSegment!=null and ew.nonEmptyOfWhere">
|
||||
${ew.sqlSegment}
|
||||
</if>
|
||||
</if>
|
||||
</where>
|
||||
<if test="ew!=null and ew.sqlSegment!=null and ew.emptyOfWhere">
|
||||
${ew.sqlSegment}
|
||||
</if>
|
||||
</select>
|
||||
|
||||
<select id="selectMapsPage" resultType="HashMap">
|
||||
SELECT <choose><when test="ew != null and ew.sqlSelect != null">${ew.sqlSelect}</when><otherwise><include refid="Base_Column_List"></include></otherwise></choose> FROM Z_WORK_SHOP_TRANSFER
|
||||
<where>
|
||||
<if test="ew!=null">
|
||||
<if test="ew.entity!=null">
|
||||
<if test="ew.entity.handle!=null">
|
||||
HANDLE=#{ew.entity.handle}
|
||||
</if>
|
||||
<if test="ew.entity.site!=null"> AND SITE=#{ew.entity.site}</if>
|
||||
<if test="ew.entity.workCenter!=null"> AND WORK_CENTER=#{ew.entity.workCenter}</if>
|
||||
<if test="ew.entity.sfc!=null"> AND SFC=#{ew.entity.sfc}</if>
|
||||
<if test="ew.entity.shopOrder!=null"> AND SHOP_ORDER=#{ew.entity.shopOrder}</if>
|
||||
<if test="ew.entity.item!=null"> AND ITEM=#{ew.entity.item}</if>
|
||||
<if test="ew.entity.lastOperation!=null"> AND LAST_OPERATION=#{ew.entity.lastOperation}</if>
|
||||
<if test="ew.entity.stepId!=null"> AND STEP_ID=#{ew.entity.stepId}</if>
|
||||
<if test="ew.entity.operation!=null"> AND OPERATION=#{ew.entity.operation}</if>
|
||||
<if test="ew.entity.qty!=null"> AND QTY=#{ew.entity.qty}</if>
|
||||
<if test="ew.entity.type!=null"> AND TYPE=#{ew.entity.type}</if>
|
||||
<if test="ew.entity.isOutSource!=null"> AND IS_OUT_SOURCE=#{ew.entity.isOutSource}</if>
|
||||
<if test="ew.entity.comments!=null"> AND COMMENTS=#{ew.entity.comments}</if>
|
||||
<if test="ew.entity.createUser!=null"> AND CREATE_USER=#{ew.entity.createUser}</if>
|
||||
<if test="ew.entity.createdDateTime!=null"> AND CREATED_DATE_TIME=#{ew.entity.createdDateTime}</if>
|
||||
</if>
|
||||
<if test="ew!=null and ew.sqlSegment!=null and ew.nonEmptyOfWhere">
|
||||
${ew.sqlSegment}
|
||||
</if>
|
||||
</if>
|
||||
</where>
|
||||
<if test="ew!=null and ew.sqlSegment!=null and ew.emptyOfWhere">
|
||||
${ew.sqlSegment}
|
||||
</if>
|
||||
</select>
|
||||
|
||||
<insert id="insert" parameterType="com.foreverwin.mesnac.production.model.WorkShopTransfer">
|
||||
INSERT INTO Z_WORK_SHOP_TRANSFER
|
||||
<trim prefix="(" suffix=")" suffixOverrides=",">
|
||||
HANDLE,
|
||||
<if test="site!=null">SITE,</if>
|
||||
<if test="workCenter!=null">WORK_CENTER,</if>
|
||||
<if test="sfc!=null">SFC,</if>
|
||||
<if test="shopOrder!=null">SHOP_ORDER,</if>
|
||||
<if test="item!=null">ITEM,</if>
|
||||
<if test="lastOperation!=null">LAST_OPERATION,</if>
|
||||
<if test="stepId!=null">STEP_ID,</if>
|
||||
<if test="operation!=null">OPERATION,</if>
|
||||
<if test="qty!=null">QTY,</if>
|
||||
<if test="type!=null">TYPE,</if>
|
||||
<if test="isOutSource!=null">IS_OUT_SOURCE,</if>
|
||||
<if test="comments!=null">COMMENTS,</if>
|
||||
<if test="createUser!=null">CREATE_USER,</if>
|
||||
<if test="createdDateTime!=null">CREATED_DATE_TIME,</if>
|
||||
</trim> VALUES
|
||||
<trim prefix="(" suffix=")" suffixOverrides=",">
|
||||
#{handle},
|
||||
<if test="site!=null">#{site},</if>
|
||||
<if test="workCenter!=null">#{workCenter},</if>
|
||||
<if test="sfc!=null">#{sfc},</if>
|
||||
<if test="shopOrder!=null">#{shopOrder},</if>
|
||||
<if test="item!=null">#{item},</if>
|
||||
<if test="lastOperation!=null">#{lastOperation},</if>
|
||||
<if test="stepId!=null">#{stepId},</if>
|
||||
<if test="operation!=null">#{operation},</if>
|
||||
<if test="qty!=null">#{qty},</if>
|
||||
<if test="type!=null">#{type},</if>
|
||||
<if test="isOutSource!=null">#{isOutSource},</if>
|
||||
<if test="comments!=null">#{comments},</if>
|
||||
<if test="createUser!=null">#{createUser},</if>
|
||||
<if test="createdDateTime!=null">#{createdDateTime},</if>
|
||||
</trim>
|
||||
</insert>
|
||||
|
||||
<insert id="insertAllColumn" parameterType="com.foreverwin.mesnac.production.model.WorkShopTransfer">
|
||||
INSERT INTO Z_WORK_SHOP_TRANSFER
|
||||
<trim prefix="(" suffix=")" suffixOverrides=",">
|
||||
<include refid="Base_Column_List"></include>
|
||||
</trim> VALUES
|
||||
<trim prefix="(" suffix=")" suffixOverrides=",">
|
||||
#{handle},
|
||||
#{site},
|
||||
#{workCenter},
|
||||
#{sfc},
|
||||
#{shopOrder},
|
||||
#{item},
|
||||
#{lastOperation},
|
||||
#{stepId},
|
||||
#{operation},
|
||||
#{qty},
|
||||
#{type},
|
||||
#{isOutSource},
|
||||
#{comments},
|
||||
#{createUser},
|
||||
#{createdDateTime},
|
||||
</trim>
|
||||
</insert>
|
||||
|
||||
|
||||
<update id="updateById">
|
||||
UPDATE Z_WORK_SHOP_TRANSFER <trim prefix="SET" suffixOverrides=",">
|
||||
<if test="et.site!=null">SITE=#{et.site},</if>
|
||||
<if test="et.workCenter!=null">WORK_CENTER=#{et.workCenter},</if>
|
||||
<if test="et.sfc!=null">SFC=#{et.sfc},</if>
|
||||
<if test="et.shopOrder!=null">SHOP_ORDER=#{et.shopOrder},</if>
|
||||
<if test="et.item!=null">ITEM=#{et.item},</if>
|
||||
<if test="et.lastOperation!=null">LAST_OPERATION=#{et.lastOperation},</if>
|
||||
<if test="et.stepId!=null">STEP_ID=#{et.stepId},</if>
|
||||
<if test="et.operation!=null">OPERATION=#{et.operation},</if>
|
||||
<if test="et.qty!=null">QTY=#{et.qty},</if>
|
||||
<if test="et.type!=null">TYPE=#{et.type},</if>
|
||||
<if test="et.isOutSource!=null">IS_OUT_SOURCE=#{et.isOutSource},</if>
|
||||
<if test="et.comments!=null">COMMENTS=#{et.comments},</if>
|
||||
<if test="et.createUser!=null">CREATE_USER=#{et.createUser},</if>
|
||||
<if test="et.createdDateTime!=null">CREATED_DATE_TIME=#{et.createdDateTime},</if>
|
||||
</trim> WHERE HANDLE=#{et.handle} <if test="et instanceof java.util.Map"><if test="et.MP_OPTLOCK_VERSION_ORIGINAL!=null">and ${et.MP_OPTLOCK_VERSION_COLUMN}=#{et.MP_OPTLOCK_VERSION_ORIGINAL}</if></if>
|
||||
</update>
|
||||
|
||||
|
||||
<update id="updateAllColumnById">
|
||||
UPDATE Z_WORK_SHOP_TRANSFER <trim prefix="SET" suffixOverrides=",">
|
||||
SITE=#{et.site},
|
||||
WORK_CENTER=#{et.workCenter},
|
||||
SFC=#{et.sfc},
|
||||
SHOP_ORDER=#{et.shopOrder},
|
||||
ITEM=#{et.item},
|
||||
LAST_OPERATION=#{et.lastOperation},
|
||||
STEP_ID=#{et.stepId},
|
||||
OPERATION=#{et.operation},
|
||||
QTY=#{et.qty},
|
||||
TYPE=#{et.type},
|
||||
IS_OUT_SOURCE=#{et.isOutSource},
|
||||
COMMENTS=#{et.comments},
|
||||
CREATE_USER=#{et.createUser},
|
||||
CREATED_DATE_TIME=#{et.createdDateTime},
|
||||
</trim> WHERE HANDLE=#{et.handle} <if test="et instanceof java.util.Map"><if test="et.MP_OPTLOCK_VERSION_ORIGINAL!=null">and ${et.MP_OPTLOCK_VERSION_COLUMN}=#{et.MP_OPTLOCK_VERSION_ORIGINAL}</if></if>
|
||||
</update>
|
||||
|
||||
|
||||
<update id="update">
|
||||
UPDATE Z_WORK_SHOP_TRANSFER <trim prefix="SET" suffixOverrides=",">
|
||||
<if test="et.site!=null">SITE=#{et.site},</if>
|
||||
<if test="et.workCenter!=null">WORK_CENTER=#{et.workCenter},</if>
|
||||
<if test="et.sfc!=null">SFC=#{et.sfc},</if>
|
||||
<if test="et.shopOrder!=null">SHOP_ORDER=#{et.shopOrder},</if>
|
||||
<if test="et.item!=null">ITEM=#{et.item},</if>
|
||||
<if test="et.lastOperation!=null">LAST_OPERATION=#{et.lastOperation},</if>
|
||||
<if test="et.stepId!=null">STEP_ID=#{et.stepId},</if>
|
||||
<if test="et.operation!=null">OPERATION=#{et.operation},</if>
|
||||
<if test="et.qty!=null">QTY=#{et.qty},</if>
|
||||
<if test="et.type!=null">TYPE=#{et.type},</if>
|
||||
<if test="et.isOutSource!=null">IS_OUT_SOURCE=#{et.isOutSource},</if>
|
||||
<if test="et.comments!=null">COMMENTS=#{et.comments},</if>
|
||||
<if test="et.createUser!=null">CREATE_USER=#{et.createUser},</if>
|
||||
<if test="et.createdDateTime!=null">CREATED_DATE_TIME=#{et.createdDateTime},</if>
|
||||
</trim>
|
||||
<where>
|
||||
<if test="ew!=null">
|
||||
<if test="ew.entity!=null">
|
||||
HANDLE=#{ew.entity.handle}
|
||||
<if test="ew.entity.site!=null"> AND SITE=#{ew.entity.site}</if>
|
||||
<if test="ew.entity.workCenter!=null"> AND WORK_CENTER=#{ew.entity.workCenter}</if>
|
||||
<if test="ew.entity.sfc!=null"> AND SFC=#{ew.entity.sfc}</if>
|
||||
<if test="ew.entity.shopOrder!=null"> AND SHOP_ORDER=#{ew.entity.shopOrder}</if>
|
||||
<if test="ew.entity.item!=null"> AND ITEM=#{ew.entity.item}</if>
|
||||
<if test="ew.entity.lastOperation!=null"> AND LAST_OPERATION=#{ew.entity.lastOperation}</if>
|
||||
<if test="ew.entity.stepId!=null"> AND STEP_ID=#{ew.entity.stepId}</if>
|
||||
<if test="ew.entity.operation!=null"> AND OPERATION=#{ew.entity.operation}</if>
|
||||
<if test="ew.entity.qty!=null"> AND QTY=#{ew.entity.qty}</if>
|
||||
<if test="ew.entity.type!=null"> AND TYPE=#{ew.entity.type}</if>
|
||||
<if test="ew.entity.isOutSource!=null"> AND IS_OUT_SOURCE=#{ew.entity.isOutSource}</if>
|
||||
<if test="ew.entity.comments!=null"> AND COMMENTS=#{ew.entity.comments}</if>
|
||||
<if test="ew.entity.createUser!=null"> AND CREATE_USER=#{ew.entity.createUser}</if>
|
||||
<if test="ew.entity.createdDateTime!=null"> AND CREATED_DATE_TIME=#{ew.entity.createdDateTime}</if>
|
||||
</if>
|
||||
<if test="ew!=null and ew.sqlSegment!=null and ew.nonEmptyOfWhere">
|
||||
${ew.sqlSegment}
|
||||
</if>
|
||||
</if>
|
||||
</where>
|
||||
<if test="ew!=null and ew.sqlSegment!=null and ew.emptyOfWhere">
|
||||
${ew.sqlSegment}
|
||||
</if>
|
||||
</update>
|
||||
|
||||
<delete id="deleteById">
|
||||
DELETE FROM Z_WORK_SHOP_TRANSFER WHERE HANDLE=#{handle}
|
||||
</delete>
|
||||
|
||||
<delete id="deleteByMap">
|
||||
DELETE FROM Z_WORK_SHOP_TRANSFER
|
||||
<if test="cm!=null and !cm.isEmpty">
|
||||
<where>
|
||||
<foreach collection="cm.keys" item="k" separator="AND">
|
||||
<if test="cm[k] != null">
|
||||
${k} = #{cm[${k}]}
|
||||
</if>
|
||||
</foreach>
|
||||
</where>
|
||||
</if>
|
||||
</delete>
|
||||
|
||||
<delete id="delete">
|
||||
DELETE FROM Z_WORK_SHOP_TRANSFER
|
||||
<where>
|
||||
<if test="ew!=null">
|
||||
<if test="ew.entity!=null">
|
||||
<if test="ew.entity.handle!=null">
|
||||
HANDLE=#{ew.entity.handle}
|
||||
</if>
|
||||
<if test="ew.entity.site!=null"> AND SITE=#{ew.entity.site}</if>
|
||||
<if test="ew.entity.workCenter!=null"> AND WORK_CENTER=#{ew.entity.workCenter}</if>
|
||||
<if test="ew.entity.sfc!=null"> AND SFC=#{ew.entity.sfc}</if>
|
||||
<if test="ew.entity.shopOrder!=null"> AND SHOP_ORDER=#{ew.entity.shopOrder}</if>
|
||||
<if test="ew.entity.item!=null"> AND ITEM=#{ew.entity.item}</if>
|
||||
<if test="ew.entity.lastOperation!=null"> AND LAST_OPERATION=#{ew.entity.lastOperation}</if>
|
||||
<if test="ew.entity.stepId!=null"> AND STEP_ID=#{ew.entity.stepId}</if>
|
||||
<if test="ew.entity.operation!=null"> AND OPERATION=#{ew.entity.operation}</if>
|
||||
<if test="ew.entity.qty!=null"> AND QTY=#{ew.entity.qty}</if>
|
||||
<if test="ew.entity.type!=null"> AND TYPE=#{ew.entity.type}</if>
|
||||
<if test="ew.entity.isOutSource!=null"> AND IS_OUT_SOURCE=#{ew.entity.isOutSource}</if>
|
||||
<if test="ew.entity.comments!=null"> AND COMMENTS=#{ew.entity.comments}</if>
|
||||
<if test="ew.entity.createUser!=null"> AND CREATE_USER=#{ew.entity.createUser}</if>
|
||||
<if test="ew.entity.createdDateTime!=null"> AND CREATED_DATE_TIME=#{ew.entity.createdDateTime}</if>
|
||||
</if>
|
||||
<if test="ew!=null and ew.sqlSegment!=null and ew.nonEmptyOfWhere">
|
||||
${ew.sqlSegment}
|
||||
</if>
|
||||
</if>
|
||||
</where>
|
||||
<if test="ew!=null and ew.sqlSegment!=null and ew.emptyOfWhere">
|
||||
${ew.sqlSegment}
|
||||
</if>
|
||||
</delete>
|
||||
|
||||
<delete id="deleteBatchIds">
|
||||
DELETE FROM Z_WORK_SHOP_TRANSFER WHERE HANDLE IN (
|
||||
<foreach item="item" index="index" collection="coll" separator=",">#{item}
|
||||
</foreach>)
|
||||
</delete>
|
||||
<!-- BaseMapper标准查询/修改/删除 -->
|
||||
<select id="getSfcData" resultMap="FullResultMap">
|
||||
SELECT ZSD.STEP_ID,ZSD.RESRCE,ZSD.DISPATCH_NO,ZSD.WORK_CENTER,SC.SFC, SO.SHOP_ORDER,SO_CF3.VALUE "MAP", SO_CF2.VALUE WORK_ORDER,SO_CF.VALUE ITEM_NUMBER,SC.QTY, IM.ITEM, IT.DESCRIPTION ITEM_DESC, OP.OPERATION, OT.DESCRIPTION OPERATION_DESC,
|
||||
CASE WHEN ST.STATUS='403' THEN '活动中' WHEN ST.STATUS='402' THEN '排队中' WHEN ST.STATUS='401' THEN '新建' ELSE TO_CHAR(ST.STATUS) END STATUS,RO_CF.VALUE IS_OUT_SOURCE
|
||||
FROM SFC SC
|
||||
INNER JOIN SHOP_ORDER SO ON SO.HANDLE = SC.SHOP_ORDER_BO
|
||||
LEFT JOIN CUSTOM_FIELDS SO_CF3 ON SO_CF3.HANDLE = SO.HANDLE AND SO_CF3."ATTRIBUTE" = 'MAP'
|
||||
LEFT JOIN CUSTOM_FIELDS SO_CF2 ON SO_CF2.HANDLE = SO.HANDLE AND SO_CF2."ATTRIBUTE" = 'WORK_ORDER'
|
||||
LEFT JOIN CUSTOM_FIELDS SO_CF ON SO_CF.HANDLE = SO.HANDLE AND SO_CF."ATTRIBUTE" = 'ITEM_NUMBER'
|
||||
INNER JOIN STATUS ST ON ST.HANDLE = SC.STATUS_BO AND ST.STATUS_GROUP = 'SFC'
|
||||
INNER JOIN ITEM IM ON IM.HANDLE = SC.ITEM_BO
|
||||
LEFT JOIN ITEM_T IT ON IT.ITEM_BO = IM.HANDLE AND IT.LOCALE = 'zh'
|
||||
INNER JOIN SFC_ROUTING SG ON SG.SFC_BO = SC.HANDLE
|
||||
INNER JOIN SFC_ROUTER SR ON SR.SFC_ROUTING_BO = SG.HANDLE AND SR.IN_USE = 'true'
|
||||
INNER JOIN SFC_STEP SP ON SP.SFC_ROUTER_BO = SR.HANDLE AND (SP.QTY_IN_QUEUE > 0 OR SP.QTY_IN_WORK > 0)
|
||||
INNER JOIN ROUTER_STEP RS ON RS.ROUTER_BO = SR.ROUTER_BO AND RS.STEP_ID = SP.STEP_ID
|
||||
INNER JOIN ROUTER_OPERATION RO ON RO.ROUTER_STEP_BO = RS.HANDLE
|
||||
LEFT JOIN CUSTOM_FIELDS RO_CF ON RO_CF.HANDLE = RO.HANDLE AND RO_CF."ATTRIBUTE" = 'OUT_SOURCE'
|
||||
INNER JOIN OPERATION OP ON SP.OPERATION_BO = 'OperationBO:'||OP.SITE||','||OP.OPERATION||',#' AND OP.CURRENT_REVISION = 'true'
|
||||
LEFT JOIN OPERATION_T OT ON OT.OPERATION_BO = OP.HANDLE AND OT.LOCALE = 'zh'
|
||||
JOIN Z_SFC_DISPATCH ZSD ON ZSD.SITE = SC.SITE AND ZSD.SFC = SC.SFC AND ZSD.OPERATION = OP.OPERATION AND ZSD.STEP_ID = SP.STEP_ID
|
||||
WHERE SC.SITE = #{site} AND SC.SFC = #{sfc}
|
||||
</select>
|
||||
</mapper>
|
Loading…
Reference in New Issue