外协库存事务核心
This commit is contained in:
parent
9c6ac9950b
commit
a071a40a89
@ -144,6 +144,9 @@ public class UserConstants
|
||||
public static final String TRANSACTION_TYPE_ITEM_ISSUE_OUT = "ITEM_ISSUE_OUT"; //生产领用-出库事务
|
||||
public static final String TRANSACTION_TYPE_ITEM_ISSUE_IN = "ITEM_ISSUE_IN"; //生产领用-入库事务
|
||||
|
||||
public static final String TRANSACTION_TYPE_OUTSOURCE_ISSUE_OUT ="OUTSOURCE_ISSUE_OUT"; //外协领用-出库事务
|
||||
public static final String TRANSACTION_TYPE_OUTSOURCE_RECPT_IN ="OUTSOURCE_RECPT_IN"; //外协入库-入库事务
|
||||
|
||||
public static final String TRANSACTION_TYPE_ITEM_RT_ISSUE_OUT = "ITEM_RT_ISSUE_OUT"; //生产退料-出库事务
|
||||
public static final String TRANSACTION_TYPE_ITEM_RT_ISSUE_IN = "ITEM_RT_ISSUE_IN"; //生产退料-入库事务
|
||||
|
||||
|
@ -0,0 +1,104 @@
|
||||
package com.ktg.mes.md.controller;
|
||||
|
||||
import java.util.List;
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
import org.springframework.security.access.prepost.PreAuthorize;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.web.bind.annotation.GetMapping;
|
||||
import org.springframework.web.bind.annotation.PostMapping;
|
||||
import org.springframework.web.bind.annotation.PutMapping;
|
||||
import org.springframework.web.bind.annotation.DeleteMapping;
|
||||
import org.springframework.web.bind.annotation.PathVariable;
|
||||
import org.springframework.web.bind.annotation.RequestBody;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
import com.ktg.common.annotation.Log;
|
||||
import com.ktg.common.core.controller.BaseController;
|
||||
import com.ktg.common.core.domain.AjaxResult;
|
||||
import com.ktg.common.enums.BusinessType;
|
||||
import com.ktg.mes.md.domain.MdProductSip;
|
||||
import com.ktg.mes.md.service.IMdProductSipService;
|
||||
import com.ktg.common.utils.poi.ExcelUtil;
|
||||
import com.ktg.common.core.page.TableDataInfo;
|
||||
|
||||
/**
|
||||
* 产品SIPController
|
||||
*
|
||||
* @author yinjinlu
|
||||
* @date 2023-10-31
|
||||
*/
|
||||
@RestController
|
||||
@RequestMapping("/mes/md/sip")
|
||||
public class MdProductSipController extends BaseController
|
||||
{
|
||||
@Autowired
|
||||
private IMdProductSipService mdProductSipService;
|
||||
|
||||
/**
|
||||
* 查询产品SIP列表
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('mes:md:sip:list')")
|
||||
@GetMapping("/list")
|
||||
public TableDataInfo list(MdProductSip mdProductSip)
|
||||
{
|
||||
startPage();
|
||||
List<MdProductSip> list = mdProductSipService.selectMdProductSipList(mdProductSip);
|
||||
return getDataTable(list);
|
||||
}
|
||||
|
||||
/**
|
||||
* 导出产品SIP列表
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('mes:md:sip:export')")
|
||||
@Log(title = "产品SIP", businessType = BusinessType.EXPORT)
|
||||
@PostMapping("/export")
|
||||
public void export(HttpServletResponse response, MdProductSip mdProductSip)
|
||||
{
|
||||
List<MdProductSip> list = mdProductSipService.selectMdProductSipList(mdProductSip);
|
||||
ExcelUtil<MdProductSip> util = new ExcelUtil<MdProductSip>(MdProductSip.class);
|
||||
util.exportExcel(response, list, "产品SIP数据");
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取产品SIP详细信息
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('mes:md:sip:query')")
|
||||
@GetMapping(value = "/{sipId}")
|
||||
public AjaxResult getInfo(@PathVariable("sipId") Long sipId)
|
||||
{
|
||||
return AjaxResult.success(mdProductSipService.selectMdProductSipBySipId(sipId));
|
||||
}
|
||||
|
||||
/**
|
||||
* 新增产品SIP
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('mes:md:sip:add')")
|
||||
@Log(title = "产品SIP", businessType = BusinessType.INSERT)
|
||||
@PostMapping
|
||||
public AjaxResult add(@RequestBody MdProductSip mdProductSip)
|
||||
{
|
||||
return toAjax(mdProductSipService.insertMdProductSip(mdProductSip));
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改产品SIP
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('mes:md:sip:edit')")
|
||||
@Log(title = "产品SIP", businessType = BusinessType.UPDATE)
|
||||
@PutMapping
|
||||
public AjaxResult edit(@RequestBody MdProductSip mdProductSip)
|
||||
{
|
||||
return toAjax(mdProductSipService.updateMdProductSip(mdProductSip));
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除产品SIP
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('mes:md:sip:remove')")
|
||||
@Log(title = "产品SIP", businessType = BusinessType.DELETE)
|
||||
@DeleteMapping("/{sipIds}")
|
||||
public AjaxResult remove(@PathVariable Long[] sipIds)
|
||||
{
|
||||
return toAjax(mdProductSipService.deleteMdProductSipBySipIds(sipIds));
|
||||
}
|
||||
}
|
@ -1,8 +1,7 @@
|
||||
package com.ktg.mes.md.controller;
|
||||
package com.ktg.mes.md.controller.mobile;
|
||||
|
||||
import com.ktg.common.core.controller.BaseController;
|
||||
import com.ktg.common.core.domain.AjaxResult;
|
||||
import com.ktg.common.core.page.TableDataInfo;
|
||||
import com.ktg.mes.md.domain.MdProductSop;
|
||||
import com.ktg.mes.md.service.IMdProductSopService;
|
||||
import io.swagger.annotations.ApiOperation;
|
206
ktg-mes/src/main/java/com/ktg/mes/md/domain/MdProductSip.java
Normal file
206
ktg-mes/src/main/java/com/ktg/mes/md/domain/MdProductSip.java
Normal file
@ -0,0 +1,206 @@
|
||||
package com.ktg.mes.md.domain;
|
||||
|
||||
import org.apache.commons.lang3.builder.ToStringBuilder;
|
||||
import org.apache.commons.lang3.builder.ToStringStyle;
|
||||
import com.ktg.common.annotation.Excel;
|
||||
import com.ktg.common.core.domain.BaseEntity;
|
||||
|
||||
/**
|
||||
* 产品SIP对象 md_product_sip
|
||||
*
|
||||
* @author yinjinlu
|
||||
* @date 2023-10-31
|
||||
*/
|
||||
public class MdProductSip extends BaseEntity
|
||||
{
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
/** 记录ID */
|
||||
private Long sipId;
|
||||
|
||||
/** 物料产品ID */
|
||||
@Excel(name = "物料产品ID")
|
||||
private Long itemId;
|
||||
|
||||
/** 排列顺序 */
|
||||
@Excel(name = "排列顺序")
|
||||
private Integer orderNum;
|
||||
|
||||
/** 对应的工序 */
|
||||
@Excel(name = "对应的工序")
|
||||
private Long processId;
|
||||
|
||||
/** 工序编号 */
|
||||
@Excel(name = "工序编号")
|
||||
private String processCode;
|
||||
|
||||
/** 工序名称 */
|
||||
@Excel(name = "工序名称")
|
||||
private String processName;
|
||||
|
||||
/** 标题 */
|
||||
@Excel(name = "标题")
|
||||
private String sipTitle;
|
||||
|
||||
/** 详细描述 */
|
||||
@Excel(name = "详细描述")
|
||||
private String sipDescription;
|
||||
|
||||
/** 图片地址 */
|
||||
@Excel(name = "图片地址")
|
||||
private String sipUrl;
|
||||
|
||||
/** 预留字段1 */
|
||||
private String attr1;
|
||||
|
||||
/** 预留字段2 */
|
||||
private String attr2;
|
||||
|
||||
/** 预留字段3 */
|
||||
private Long attr3;
|
||||
|
||||
/** 预留字段4 */
|
||||
private Long attr4;
|
||||
|
||||
public void setSipId(Long sipId)
|
||||
{
|
||||
this.sipId = sipId;
|
||||
}
|
||||
|
||||
public Long getSipId()
|
||||
{
|
||||
return sipId;
|
||||
}
|
||||
public void setItemId(Long itemId)
|
||||
{
|
||||
this.itemId = itemId;
|
||||
}
|
||||
|
||||
public Long getItemId()
|
||||
{
|
||||
return itemId;
|
||||
}
|
||||
public void setOrderNum(Integer orderNum)
|
||||
{
|
||||
this.orderNum = orderNum;
|
||||
}
|
||||
|
||||
public Integer getOrderNum()
|
||||
{
|
||||
return orderNum;
|
||||
}
|
||||
public void setProcessId(Long processId)
|
||||
{
|
||||
this.processId = processId;
|
||||
}
|
||||
|
||||
public Long getProcessId()
|
||||
{
|
||||
return processId;
|
||||
}
|
||||
public void setProcessCode(String processCode)
|
||||
{
|
||||
this.processCode = processCode;
|
||||
}
|
||||
|
||||
public String getProcessCode()
|
||||
{
|
||||
return processCode;
|
||||
}
|
||||
public void setProcessName(String processName)
|
||||
{
|
||||
this.processName = processName;
|
||||
}
|
||||
|
||||
public String getProcessName()
|
||||
{
|
||||
return processName;
|
||||
}
|
||||
public void setSipTitle(String sipTitle)
|
||||
{
|
||||
this.sipTitle = sipTitle;
|
||||
}
|
||||
|
||||
public String getSipTitle()
|
||||
{
|
||||
return sipTitle;
|
||||
}
|
||||
public void setSipDescription(String sipDescription)
|
||||
{
|
||||
this.sipDescription = sipDescription;
|
||||
}
|
||||
|
||||
public String getSipDescription()
|
||||
{
|
||||
return sipDescription;
|
||||
}
|
||||
public void setSipUrl(String sipUrl)
|
||||
{
|
||||
this.sipUrl = sipUrl;
|
||||
}
|
||||
|
||||
public String getSipUrl()
|
||||
{
|
||||
return sipUrl;
|
||||
}
|
||||
public void setAttr1(String attr1)
|
||||
{
|
||||
this.attr1 = attr1;
|
||||
}
|
||||
|
||||
public String getAttr1()
|
||||
{
|
||||
return attr1;
|
||||
}
|
||||
public void setAttr2(String attr2)
|
||||
{
|
||||
this.attr2 = attr2;
|
||||
}
|
||||
|
||||
public String getAttr2()
|
||||
{
|
||||
return attr2;
|
||||
}
|
||||
public void setAttr3(Long attr3)
|
||||
{
|
||||
this.attr3 = attr3;
|
||||
}
|
||||
|
||||
public Long getAttr3()
|
||||
{
|
||||
return attr3;
|
||||
}
|
||||
public void setAttr4(Long attr4)
|
||||
{
|
||||
this.attr4 = attr4;
|
||||
}
|
||||
|
||||
public Long getAttr4()
|
||||
{
|
||||
return attr4;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE)
|
||||
.append("sipId", getSipId())
|
||||
.append("itemId", getItemId())
|
||||
.append("orderNum", getOrderNum())
|
||||
.append("processId", getProcessId())
|
||||
.append("processCode", getProcessCode())
|
||||
.append("processName", getProcessName())
|
||||
.append("sipTitle", getSipTitle())
|
||||
.append("sipDescription", getSipDescription())
|
||||
.append("sipUrl", getSipUrl())
|
||||
.append("remark", getRemark())
|
||||
.append("attr1", getAttr1())
|
||||
.append("attr2", getAttr2())
|
||||
.append("attr3", getAttr3())
|
||||
.append("attr4", getAttr4())
|
||||
.append("createBy", getCreateBy())
|
||||
.append("createTime", getCreateTime())
|
||||
.append("updateBy", getUpdateBy())
|
||||
.append("updateTime", getUpdateTime())
|
||||
.toString();
|
||||
}
|
||||
}
|
@ -0,0 +1,61 @@
|
||||
package com.ktg.mes.md.mapper;
|
||||
|
||||
import java.util.List;
|
||||
import com.ktg.mes.md.domain.MdProductSip;
|
||||
|
||||
/**
|
||||
* 产品SIPMapper接口
|
||||
*
|
||||
* @author yinjinlu
|
||||
* @date 2023-10-31
|
||||
*/
|
||||
public interface MdProductSipMapper
|
||||
{
|
||||
/**
|
||||
* 查询产品SIP
|
||||
*
|
||||
* @param sipId 产品SIP主键
|
||||
* @return 产品SIP
|
||||
*/
|
||||
public MdProductSip selectMdProductSipBySipId(Long sipId);
|
||||
|
||||
/**
|
||||
* 查询产品SIP列表
|
||||
*
|
||||
* @param mdProductSip 产品SIP
|
||||
* @return 产品SIP集合
|
||||
*/
|
||||
public List<MdProductSip> selectMdProductSipList(MdProductSip mdProductSip);
|
||||
|
||||
/**
|
||||
* 新增产品SIP
|
||||
*
|
||||
* @param mdProductSip 产品SIP
|
||||
* @return 结果
|
||||
*/
|
||||
public int insertMdProductSip(MdProductSip mdProductSip);
|
||||
|
||||
/**
|
||||
* 修改产品SIP
|
||||
*
|
||||
* @param mdProductSip 产品SIP
|
||||
* @return 结果
|
||||
*/
|
||||
public int updateMdProductSip(MdProductSip mdProductSip);
|
||||
|
||||
/**
|
||||
* 删除产品SIP
|
||||
*
|
||||
* @param sipId 产品SIP主键
|
||||
* @return 结果
|
||||
*/
|
||||
public int deleteMdProductSipBySipId(Long sipId);
|
||||
|
||||
/**
|
||||
* 批量删除产品SIP
|
||||
*
|
||||
* @param sipIds 需要删除的数据主键集合
|
||||
* @return 结果
|
||||
*/
|
||||
public int deleteMdProductSipBySipIds(Long[] sipIds);
|
||||
}
|
@ -0,0 +1,61 @@
|
||||
package com.ktg.mes.md.service;
|
||||
|
||||
import java.util.List;
|
||||
import com.ktg.mes.md.domain.MdProductSip;
|
||||
|
||||
/**
|
||||
* 产品SIPService接口
|
||||
*
|
||||
* @author yinjinlu
|
||||
* @date 2023-10-31
|
||||
*/
|
||||
public interface IMdProductSipService
|
||||
{
|
||||
/**
|
||||
* 查询产品SIP
|
||||
*
|
||||
* @param sipId 产品SIP主键
|
||||
* @return 产品SIP
|
||||
*/
|
||||
public MdProductSip selectMdProductSipBySipId(Long sipId);
|
||||
|
||||
/**
|
||||
* 查询产品SIP列表
|
||||
*
|
||||
* @param mdProductSip 产品SIP
|
||||
* @return 产品SIP集合
|
||||
*/
|
||||
public List<MdProductSip> selectMdProductSipList(MdProductSip mdProductSip);
|
||||
|
||||
/**
|
||||
* 新增产品SIP
|
||||
*
|
||||
* @param mdProductSip 产品SIP
|
||||
* @return 结果
|
||||
*/
|
||||
public int insertMdProductSip(MdProductSip mdProductSip);
|
||||
|
||||
/**
|
||||
* 修改产品SIP
|
||||
*
|
||||
* @param mdProductSip 产品SIP
|
||||
* @return 结果
|
||||
*/
|
||||
public int updateMdProductSip(MdProductSip mdProductSip);
|
||||
|
||||
/**
|
||||
* 批量删除产品SIP
|
||||
*
|
||||
* @param sipIds 需要删除的产品SIP主键集合
|
||||
* @return 结果
|
||||
*/
|
||||
public int deleteMdProductSipBySipIds(Long[] sipIds);
|
||||
|
||||
/**
|
||||
* 删除产品SIP信息
|
||||
*
|
||||
* @param sipId 产品SIP主键
|
||||
* @return 结果
|
||||
*/
|
||||
public int deleteMdProductSipBySipId(Long sipId);
|
||||
}
|
@ -0,0 +1,96 @@
|
||||
package com.ktg.mes.md.service.impl;
|
||||
|
||||
import java.util.List;
|
||||
import com.ktg.common.utils.DateUtils;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
import com.ktg.mes.md.mapper.MdProductSipMapper;
|
||||
import com.ktg.mes.md.domain.MdProductSip;
|
||||
import com.ktg.mes.md.service.IMdProductSipService;
|
||||
|
||||
/**
|
||||
* 产品SIPService业务层处理
|
||||
*
|
||||
* @author yinjinlu
|
||||
* @date 2023-10-31
|
||||
*/
|
||||
@Service
|
||||
public class MdProductSipServiceImpl implements IMdProductSipService
|
||||
{
|
||||
@Autowired
|
||||
private MdProductSipMapper mdProductSipMapper;
|
||||
|
||||
/**
|
||||
* 查询产品SIP
|
||||
*
|
||||
* @param sipId 产品SIP主键
|
||||
* @return 产品SIP
|
||||
*/
|
||||
@Override
|
||||
public MdProductSip selectMdProductSipBySipId(Long sipId)
|
||||
{
|
||||
return mdProductSipMapper.selectMdProductSipBySipId(sipId);
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询产品SIP列表
|
||||
*
|
||||
* @param mdProductSip 产品SIP
|
||||
* @return 产品SIP
|
||||
*/
|
||||
@Override
|
||||
public List<MdProductSip> selectMdProductSipList(MdProductSip mdProductSip)
|
||||
{
|
||||
return mdProductSipMapper.selectMdProductSipList(mdProductSip);
|
||||
}
|
||||
|
||||
/**
|
||||
* 新增产品SIP
|
||||
*
|
||||
* @param mdProductSip 产品SIP
|
||||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
public int insertMdProductSip(MdProductSip mdProductSip)
|
||||
{
|
||||
mdProductSip.setCreateTime(DateUtils.getNowDate());
|
||||
return mdProductSipMapper.insertMdProductSip(mdProductSip);
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改产品SIP
|
||||
*
|
||||
* @param mdProductSip 产品SIP
|
||||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
public int updateMdProductSip(MdProductSip mdProductSip)
|
||||
{
|
||||
mdProductSip.setUpdateTime(DateUtils.getNowDate());
|
||||
return mdProductSipMapper.updateMdProductSip(mdProductSip);
|
||||
}
|
||||
|
||||
/**
|
||||
* 批量删除产品SIP
|
||||
*
|
||||
* @param sipIds 需要删除的产品SIP主键
|
||||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
public int deleteMdProductSipBySipIds(Long[] sipIds)
|
||||
{
|
||||
return mdProductSipMapper.deleteMdProductSipBySipIds(sipIds);
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除产品SIP信息
|
||||
*
|
||||
* @param sipId 产品SIP主键
|
||||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
public int deleteMdProductSipBySipId(Long sipId)
|
||||
{
|
||||
return mdProductSipMapper.deleteMdProductSipBySipId(sipId);
|
||||
}
|
||||
}
|
@ -9,6 +9,8 @@ import com.ktg.mes.wm.domain.WmIssueHeader;
|
||||
import com.ktg.mes.wm.domain.WmIssueLine;
|
||||
import com.ktg.mes.wm.domain.WmOutsourceIssueLine;
|
||||
import com.ktg.mes.wm.domain.tx.IssueTxBean;
|
||||
import com.ktg.mes.wm.domain.tx.OutsourceIssueTxBean;
|
||||
import com.ktg.mes.wm.service.IStorageCoreService;
|
||||
import com.ktg.mes.wm.service.IWmOutsourceIssueLineService;
|
||||
import org.springframework.security.access.prepost.PreAuthorize;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
@ -46,6 +48,9 @@ public class WmOutsourceIssueController extends BaseController
|
||||
@Autowired
|
||||
private IWmOutsourceIssueLineService wmOutsourceIssueLineService;
|
||||
|
||||
@Autowired
|
||||
private IStorageCoreService storageCoreService;
|
||||
|
||||
/**
|
||||
* 查询外协领料单头列表
|
||||
*/
|
||||
@ -108,9 +113,14 @@ public class WmOutsourceIssueController extends BaseController
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('mes:wm:outsourceissue:remove')")
|
||||
@Log(title = "外协领料单头", businessType = BusinessType.DELETE)
|
||||
@Transactional
|
||||
@DeleteMapping("/{issueIds}")
|
||||
public AjaxResult remove(@PathVariable Long[] issueIds)
|
||||
{
|
||||
for (Long issueId:issueIds
|
||||
) {
|
||||
wmOutsourceIssueLineService.deleteWmOutsourceIssueLineByIssueId(issueId);
|
||||
}
|
||||
return toAjax(wmOutsourceIssueService.deleteWmOutsourceIssueByIssueIds(issueIds));
|
||||
}
|
||||
|
||||
@ -130,8 +140,10 @@ public class WmOutsourceIssueController extends BaseController
|
||||
if(CollUtil.isEmpty(lines)){
|
||||
return AjaxResult.error("请指定领出的物资");
|
||||
}
|
||||
//TODO: 库存事务核心处理
|
||||
|
||||
List<OutsourceIssueTxBean> beans = wmOutsourceIssueService.getTxBeans(issueId);
|
||||
|
||||
storageCoreService.processOutsourceIssue(beans);
|
||||
//更新单据状态
|
||||
header.setStatus(UserConstants.ORDER_STATUS_FINISHED);
|
||||
wmOutsourceIssueService.updateWmOutsourceIssue(header);
|
||||
|
@ -1,9 +1,24 @@
|
||||
package com.ktg.mes.wm.controller;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
import java.util.List;
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
|
||||
import ch.qos.logback.core.util.StringCollectionUtil;
|
||||
import com.ktg.common.constant.UserConstants;
|
||||
import com.ktg.common.utils.StringUtils;
|
||||
import com.ktg.mes.pro.domain.ProWorkorder;
|
||||
import com.ktg.mes.pro.service.IProWorkorderService;
|
||||
import com.ktg.mes.wm.domain.WmItemRecpt;
|
||||
import com.ktg.mes.wm.domain.WmOutsourceRecptLine;
|
||||
import com.ktg.mes.wm.domain.tx.ItemRecptTxBean;
|
||||
import com.ktg.mes.wm.domain.tx.OutsourceRecptTxBean;
|
||||
import com.ktg.mes.wm.service.IStorageCoreService;
|
||||
import com.ktg.mes.wm.service.IWmOutsourceRecptLineService;
|
||||
import org.springframework.security.access.prepost.PreAuthorize;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
import org.springframework.util.CollectionUtils;
|
||||
import org.springframework.web.bind.annotation.GetMapping;
|
||||
import org.springframework.web.bind.annotation.PostMapping;
|
||||
import org.springframework.web.bind.annotation.PutMapping;
|
||||
@ -34,6 +49,16 @@ public class WmOutsourceRecptController extends BaseController
|
||||
@Autowired
|
||||
private IWmOutsourceRecptService wmOutsourceRecptService;
|
||||
|
||||
@Autowired
|
||||
private IWmOutsourceRecptLineService wmOutsourceRecptLineService;
|
||||
|
||||
@Autowired
|
||||
private IStorageCoreService storageCoreService;
|
||||
|
||||
@Autowired
|
||||
private IProWorkorderService proWorkorderService;
|
||||
|
||||
|
||||
/**
|
||||
* 查询外协入库单列表
|
||||
*/
|
||||
@ -96,9 +121,62 @@ public class WmOutsourceRecptController extends BaseController
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('mes:wm:outsourcerecpt:remove')")
|
||||
@Log(title = "外协入库单", businessType = BusinessType.DELETE)
|
||||
@Transactional
|
||||
@DeleteMapping("/{recptIds}")
|
||||
public AjaxResult remove(@PathVariable Long[] recptIds)
|
||||
{
|
||||
for (Long recptId:recptIds
|
||||
) {
|
||||
wmOutsourceRecptLineService.selectWmOutsourceRecptLineByRecptId(recptId);
|
||||
}
|
||||
return toAjax(wmOutsourceRecptService.deleteWmOutsourceRecptByRecptIds(recptIds));
|
||||
}
|
||||
|
||||
/**
|
||||
* 执行入库
|
||||
* @return
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('mes:wm:outsourcerecpt:edit')")
|
||||
@Log(title = "外协入库单", businessType = BusinessType.UPDATE)
|
||||
@Transactional
|
||||
@PutMapping("/{recptId}")
|
||||
public AjaxResult execute(@PathVariable Long recptId){
|
||||
|
||||
WmOutsourceRecpt recpt = wmOutsourceRecptService.selectWmOutsourceRecptByRecptId(recptId);
|
||||
|
||||
List<WmOutsourceRecptLine> lines = wmOutsourceRecptLineService.selectWmOutsourceRecptLineByRecptId(recptId);
|
||||
if(CollectionUtils.isEmpty(lines)){
|
||||
return AjaxResult.error("请指定入库的物资!");
|
||||
}
|
||||
|
||||
//构造Transaction事务,并执行库存更新逻辑
|
||||
List<OutsourceRecptTxBean> beans = wmOutsourceRecptService.getTxBeans(recptId);
|
||||
|
||||
//调用库存核心
|
||||
storageCoreService.processOutsourceRecpt(beans);
|
||||
|
||||
//根据当前入库的物料更新对应的生产工单/生产任务 已生产数量
|
||||
ProWorkorder workorder = proWorkorderService.selectProWorkorderByWorkorderId(recpt.getWorkorderId());
|
||||
if(!StringUtils.isNotNull(workorder)){
|
||||
return AjaxResult.error("未找到对应的外协工单/外协任务!");
|
||||
}
|
||||
|
||||
//正常外协入库的产品必须先经过检验,确认合格数量后才能执行入库,并且更新外协工单的进度。此处暂时先直接根据入库数量更新外协工单的生产数量。
|
||||
BigDecimal produced = workorder.getQuantityProduced() == null?new BigDecimal(0):workorder.getQuantityProduced();
|
||||
for (int i = 0; i < lines.size(); i++) {
|
||||
WmOutsourceRecptLine line = lines.get(i);
|
||||
//判断入库的物资,如果是生产工单中的产品,则更新已生产数量
|
||||
if(line.getItemCode().equals(workorder.getProductCode())){
|
||||
workorder.setQuantityProduced( produced.add(line.getQuantityRecived()));
|
||||
}
|
||||
}
|
||||
proWorkorderService.updateProWorkorder(workorder);
|
||||
|
||||
//更新单据状态
|
||||
recpt.setStatus(UserConstants.ORDER_STATUS_FINISHED);
|
||||
wmOutsourceRecptService.updateWmOutsourceRecpt(recpt);
|
||||
|
||||
return AjaxResult.success();
|
||||
}
|
||||
|
||||
}
|
||||
|
@ -0,0 +1,343 @@
|
||||
package com.ktg.mes.wm.domain.tx;
|
||||
|
||||
import com.ktg.common.core.domain.BaseEntity;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
|
||||
public class OutsourceIssueTxBean extends BaseEntity {
|
||||
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
private Long materialStockId;
|
||||
|
||||
/** 产品物料ID */
|
||||
private Long itemId;
|
||||
|
||||
/** 产品物料编码 */
|
||||
private String itemCode;
|
||||
|
||||
/** 产品物料名称 */
|
||||
private String itemName;
|
||||
|
||||
/** 规格型号 */
|
||||
private String specification;
|
||||
|
||||
/** 单位 */
|
||||
private String unitOfMeasure;
|
||||
|
||||
/** 批次号 */
|
||||
private String batchCode;
|
||||
|
||||
/** 供应商ID */
|
||||
private Long vendorId;
|
||||
|
||||
/** 供应商编号 */
|
||||
private String vendorCode;
|
||||
|
||||
/** 供应商名称 */
|
||||
private String vendorName;
|
||||
|
||||
/** 供应商简称 */
|
||||
private String vendorNick;
|
||||
|
||||
/** 仓库ID */
|
||||
private Long warehouseId;
|
||||
|
||||
/** 仓库编码 */
|
||||
private String warehouseCode;
|
||||
|
||||
/** 仓库名称 */
|
||||
private String warehouseName;
|
||||
|
||||
/** 库区ID */
|
||||
private Long locationId;
|
||||
|
||||
/** 库区编码 */
|
||||
private String locationCode;
|
||||
|
||||
/** 库区名称 */
|
||||
private String locationName;
|
||||
|
||||
/** 库位ID */
|
||||
private Long areaId;
|
||||
|
||||
/** 库位编码 */
|
||||
private String areaCode;
|
||||
|
||||
/** 库位名称 */
|
||||
private String areaName;
|
||||
|
||||
/** 单据类型 */
|
||||
private String sourceDocType;
|
||||
|
||||
/** 单据ID */
|
||||
private Long sourceDocId;
|
||||
|
||||
/** 单据编号 */
|
||||
private String sourceDocCode;
|
||||
|
||||
/** 单据行ID */
|
||||
private Long sourceDocLineId;
|
||||
|
||||
/** 事务数量 */
|
||||
private BigDecimal transactionQuantity;
|
||||
|
||||
/**
|
||||
* 生产工单ID
|
||||
*/
|
||||
private Long workorderId;
|
||||
|
||||
/**
|
||||
* 生产工单编号
|
||||
*/
|
||||
private String workorderCode;
|
||||
|
||||
public Long getMaterialStockId() {
|
||||
return materialStockId;
|
||||
}
|
||||
|
||||
public void setMaterialStockId(Long materialStockId) {
|
||||
this.materialStockId = materialStockId;
|
||||
}
|
||||
|
||||
public Long getItemId() {
|
||||
return itemId;
|
||||
}
|
||||
|
||||
public void setItemId(Long itemId) {
|
||||
this.itemId = itemId;
|
||||
}
|
||||
|
||||
public String getItemCode() {
|
||||
return itemCode;
|
||||
}
|
||||
|
||||
public void setItemCode(String itemCode) {
|
||||
this.itemCode = itemCode;
|
||||
}
|
||||
|
||||
public String getItemName() {
|
||||
return itemName;
|
||||
}
|
||||
|
||||
public void setItemName(String itemName) {
|
||||
this.itemName = itemName;
|
||||
}
|
||||
|
||||
public String getSpecification() {
|
||||
return specification;
|
||||
}
|
||||
|
||||
public void setSpecification(String specification) {
|
||||
this.specification = specification;
|
||||
}
|
||||
|
||||
public String getUnitOfMeasure() {
|
||||
return unitOfMeasure;
|
||||
}
|
||||
|
||||
public void setUnitOfMeasure(String unitOfMeasure) {
|
||||
this.unitOfMeasure = unitOfMeasure;
|
||||
}
|
||||
|
||||
public String getBatchCode() {
|
||||
return batchCode;
|
||||
}
|
||||
|
||||
public void setBatchCode(String batchCode) {
|
||||
this.batchCode = batchCode;
|
||||
}
|
||||
|
||||
public Long getVendorId() {
|
||||
return vendorId;
|
||||
}
|
||||
|
||||
public void setVendorId(Long vendorId) {
|
||||
this.vendorId = vendorId;
|
||||
}
|
||||
|
||||
public String getVendorCode() {
|
||||
return vendorCode;
|
||||
}
|
||||
|
||||
public void setVendorCode(String vendorCode) {
|
||||
this.vendorCode = vendorCode;
|
||||
}
|
||||
|
||||
public String getVendorName() {
|
||||
return vendorName;
|
||||
}
|
||||
|
||||
public void setVendorName(String vendorName) {
|
||||
this.vendorName = vendorName;
|
||||
}
|
||||
|
||||
public String getVendorNick() {
|
||||
return vendorNick;
|
||||
}
|
||||
|
||||
public void setVendorNick(String vendorNick) {
|
||||
this.vendorNick = vendorNick;
|
||||
}
|
||||
|
||||
public Long getWarehouseId() {
|
||||
return warehouseId;
|
||||
}
|
||||
|
||||
public void setWarehouseId(Long warehouseId) {
|
||||
this.warehouseId = warehouseId;
|
||||
}
|
||||
|
||||
public String getWarehouseCode() {
|
||||
return warehouseCode;
|
||||
}
|
||||
|
||||
public void setWarehouseCode(String warehouseCode) {
|
||||
this.warehouseCode = warehouseCode;
|
||||
}
|
||||
|
||||
public String getWarehouseName() {
|
||||
return warehouseName;
|
||||
}
|
||||
|
||||
public void setWarehouseName(String warehouseName) {
|
||||
this.warehouseName = warehouseName;
|
||||
}
|
||||
|
||||
public Long getLocationId() {
|
||||
return locationId;
|
||||
}
|
||||
|
||||
public void setLocationId(Long locationId) {
|
||||
this.locationId = locationId;
|
||||
}
|
||||
|
||||
public String getLocationCode() {
|
||||
return locationCode;
|
||||
}
|
||||
|
||||
public void setLocationCode(String locationCode) {
|
||||
this.locationCode = locationCode;
|
||||
}
|
||||
|
||||
public String getLocationName() {
|
||||
return locationName;
|
||||
}
|
||||
|
||||
public void setLocationName(String locationName) {
|
||||
this.locationName = locationName;
|
||||
}
|
||||
|
||||
public Long getAreaId() {
|
||||
return areaId;
|
||||
}
|
||||
|
||||
public void setAreaId(Long areaId) {
|
||||
this.areaId = areaId;
|
||||
}
|
||||
|
||||
public String getAreaCode() {
|
||||
return areaCode;
|
||||
}
|
||||
|
||||
public void setAreaCode(String areaCode) {
|
||||
this.areaCode = areaCode;
|
||||
}
|
||||
|
||||
public String getAreaName() {
|
||||
return areaName;
|
||||
}
|
||||
|
||||
public void setAreaName(String areaName) {
|
||||
this.areaName = areaName;
|
||||
}
|
||||
|
||||
public String getSourceDocType() {
|
||||
return sourceDocType;
|
||||
}
|
||||
|
||||
public void setSourceDocType(String sourceDocType) {
|
||||
this.sourceDocType = sourceDocType;
|
||||
}
|
||||
|
||||
public Long getSourceDocId() {
|
||||
return sourceDocId;
|
||||
}
|
||||
|
||||
public void setSourceDocId(Long sourceDocId) {
|
||||
this.sourceDocId = sourceDocId;
|
||||
}
|
||||
|
||||
public String getSourceDocCode() {
|
||||
return sourceDocCode;
|
||||
}
|
||||
|
||||
public void setSourceDocCode(String sourceDocCode) {
|
||||
this.sourceDocCode = sourceDocCode;
|
||||
}
|
||||
|
||||
public Long getSourceDocLineId() {
|
||||
return sourceDocLineId;
|
||||
}
|
||||
|
||||
public void setSourceDocLineId(Long sourceDocLineId) {
|
||||
this.sourceDocLineId = sourceDocLineId;
|
||||
}
|
||||
|
||||
public BigDecimal getTransactionQuantity() {
|
||||
return transactionQuantity;
|
||||
}
|
||||
|
||||
public void setTransactionQuantity(BigDecimal transactionQuantity) {
|
||||
this.transactionQuantity = transactionQuantity;
|
||||
}
|
||||
|
||||
public Long getWorkorderId() {
|
||||
return workorderId;
|
||||
}
|
||||
|
||||
public void setWorkorderId(Long workorderId) {
|
||||
this.workorderId = workorderId;
|
||||
}
|
||||
|
||||
public String getWorkorderCode() {
|
||||
return workorderCode;
|
||||
}
|
||||
|
||||
public void setWorkorderCode(String workorderCode) {
|
||||
this.workorderCode = workorderCode;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return "OutsourceIssueTxBean{" +
|
||||
"materialStockId=" + materialStockId +
|
||||
", itemId=" + itemId +
|
||||
", itemCode='" + itemCode + '\'' +
|
||||
", itemName='" + itemName + '\'' +
|
||||
", specification='" + specification + '\'' +
|
||||
", unitOfMeasure='" + unitOfMeasure + '\'' +
|
||||
", batchCode='" + batchCode + '\'' +
|
||||
", vendorId=" + vendorId +
|
||||
", vendorCode='" + vendorCode + '\'' +
|
||||
", vendorName='" + vendorName + '\'' +
|
||||
", vendorNick='" + vendorNick + '\'' +
|
||||
", warehouseId=" + warehouseId +
|
||||
", warehouseCode='" + warehouseCode + '\'' +
|
||||
", warehouseName='" + warehouseName + '\'' +
|
||||
", locationId=" + locationId +
|
||||
", locationCode='" + locationCode + '\'' +
|
||||
", locationName='" + locationName + '\'' +
|
||||
", areaId=" + areaId +
|
||||
", areaCode='" + areaCode + '\'' +
|
||||
", areaName='" + areaName + '\'' +
|
||||
", sourceDocType='" + sourceDocType + '\'' +
|
||||
", sourceDocId=" + sourceDocId +
|
||||
", sourceDocCode='" + sourceDocCode + '\'' +
|
||||
", sourceDocLineId=" + sourceDocLineId +
|
||||
", transactionQuantity=" + transactionQuantity +
|
||||
", workorderId=" + workorderId +
|
||||
", workorderCode='" + workorderCode + '\'' +
|
||||
'}';
|
||||
}
|
||||
}
|
@ -0,0 +1,333 @@
|
||||
package com.ktg.mes.wm.domain.tx;
|
||||
|
||||
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||
import com.ktg.common.core.domain.BaseEntity;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
import java.util.Date;
|
||||
|
||||
public class OutsourceRecptTxBean extends BaseEntity {
|
||||
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
/** 产品物料ID */
|
||||
private Long itemId;
|
||||
|
||||
/** 产品物料编码 */
|
||||
private String itemCode;
|
||||
|
||||
/** 产品物料名称 */
|
||||
private String itemName;
|
||||
|
||||
/** 规格型号 */
|
||||
private String specification;
|
||||
|
||||
/** 单位 */
|
||||
private String unitOfMeasure;
|
||||
|
||||
/** 入库批次号 */
|
||||
private String batchCode;
|
||||
|
||||
/** 仓库ID */
|
||||
private Long warehouseId;
|
||||
|
||||
/** 仓库编码 */
|
||||
private String warehouseCode;
|
||||
|
||||
/** 仓库名称 */
|
||||
private String warehouseName;
|
||||
|
||||
/** 库区ID */
|
||||
private Long locationId;
|
||||
|
||||
/** 库区编码 */
|
||||
private String locationCode;
|
||||
|
||||
/** 库区名称 */
|
||||
private String locationName;
|
||||
|
||||
/** 库位ID */
|
||||
private Long areaId;
|
||||
|
||||
/** 库位编码 */
|
||||
private String areaCode;
|
||||
|
||||
/** 库位名称 */
|
||||
private String areaName;
|
||||
|
||||
/** 供应商ID */
|
||||
private Long vendorId;
|
||||
|
||||
/** 供应商编号 */
|
||||
private String vendorCode;
|
||||
|
||||
/** 供应商名称 */
|
||||
private String vendorName;
|
||||
|
||||
/** 供应商简称 */
|
||||
private String vendorNick;
|
||||
|
||||
/** 单据类型 */
|
||||
private String sourceDocType;
|
||||
|
||||
/** 单据ID */
|
||||
private Long sourceDocId;
|
||||
|
||||
/** 单据编号 */
|
||||
private String sourceDocCode;
|
||||
|
||||
/** 单据行ID */
|
||||
private Long sourceDocLineId;
|
||||
|
||||
/** 事务数量 */
|
||||
private BigDecimal transactionQuantity;
|
||||
|
||||
/** 入库日期 */
|
||||
@JsonFormat(pattern = "yyyy-MM-dd hh:mm:ss")
|
||||
private Date recptDate;
|
||||
|
||||
/** 库存有效期 */
|
||||
@JsonFormat(pattern = "yyyy-MM-dd")
|
||||
private Date expireDate;
|
||||
|
||||
|
||||
public Long getItemId() {
|
||||
return itemId;
|
||||
}
|
||||
|
||||
public void setItemId(Long itemId) {
|
||||
this.itemId = itemId;
|
||||
}
|
||||
|
||||
public String getItemCode() {
|
||||
return itemCode;
|
||||
}
|
||||
|
||||
public void setItemCode(String itemCode) {
|
||||
this.itemCode = itemCode;
|
||||
}
|
||||
|
||||
public String getItemName() {
|
||||
return itemName;
|
||||
}
|
||||
|
||||
public void setItemName(String itemName) {
|
||||
this.itemName = itemName;
|
||||
}
|
||||
|
||||
public String getSpecification() {
|
||||
return specification;
|
||||
}
|
||||
|
||||
public void setSpecification(String specification) {
|
||||
this.specification = specification;
|
||||
}
|
||||
|
||||
public String getUnitOfMeasure() {
|
||||
return unitOfMeasure;
|
||||
}
|
||||
|
||||
public void setUnitOfMeasure(String unitOfMeasure) {
|
||||
this.unitOfMeasure = unitOfMeasure;
|
||||
}
|
||||
|
||||
public String getBatchCode() {
|
||||
return batchCode;
|
||||
}
|
||||
|
||||
public void setBatchCode(String batchCode) {
|
||||
this.batchCode = batchCode;
|
||||
}
|
||||
|
||||
public Long getWarehouseId() {
|
||||
return warehouseId;
|
||||
}
|
||||
|
||||
public void setWarehouseId(Long warehouseId) {
|
||||
this.warehouseId = warehouseId;
|
||||
}
|
||||
|
||||
public String getWarehouseCode() {
|
||||
return warehouseCode;
|
||||
}
|
||||
|
||||
public void setWarehouseCode(String warehouseCode) {
|
||||
this.warehouseCode = warehouseCode;
|
||||
}
|
||||
|
||||
public String getWarehouseName() {
|
||||
return warehouseName;
|
||||
}
|
||||
|
||||
public void setWarehouseName(String warehouseName) {
|
||||
this.warehouseName = warehouseName;
|
||||
}
|
||||
|
||||
public Long getLocationId() {
|
||||
return locationId;
|
||||
}
|
||||
|
||||
public void setLocationId(Long locationId) {
|
||||
this.locationId = locationId;
|
||||
}
|
||||
|
||||
public String getLocationCode() {
|
||||
return locationCode;
|
||||
}
|
||||
|
||||
public void setLocationCode(String locationCode) {
|
||||
this.locationCode = locationCode;
|
||||
}
|
||||
|
||||
public String getLocationName() {
|
||||
return locationName;
|
||||
}
|
||||
|
||||
public void setLocationName(String locationName) {
|
||||
this.locationName = locationName;
|
||||
}
|
||||
|
||||
public Long getAreaId() {
|
||||
return areaId;
|
||||
}
|
||||
|
||||
public void setAreaId(Long areaId) {
|
||||
this.areaId = areaId;
|
||||
}
|
||||
|
||||
public String getAreaCode() {
|
||||
return areaCode;
|
||||
}
|
||||
|
||||
public void setAreaCode(String areaCode) {
|
||||
this.areaCode = areaCode;
|
||||
}
|
||||
|
||||
public String getAreaName() {
|
||||
return areaName;
|
||||
}
|
||||
|
||||
public void setAreaName(String areaName) {
|
||||
this.areaName = areaName;
|
||||
}
|
||||
|
||||
public Long getVendorId() {
|
||||
return vendorId;
|
||||
}
|
||||
|
||||
public void setVendorId(Long vendorId) {
|
||||
this.vendorId = vendorId;
|
||||
}
|
||||
|
||||
public String getVendorCode() {
|
||||
return vendorCode;
|
||||
}
|
||||
|
||||
public void setVendorCode(String vendorCode) {
|
||||
this.vendorCode = vendorCode;
|
||||
}
|
||||
|
||||
public String getVendorName() {
|
||||
return vendorName;
|
||||
}
|
||||
|
||||
public void setVendorName(String vendorName) {
|
||||
this.vendorName = vendorName;
|
||||
}
|
||||
|
||||
public String getVendorNick() {
|
||||
return vendorNick;
|
||||
}
|
||||
|
||||
public void setVendorNick(String vendorNick) {
|
||||
this.vendorNick = vendorNick;
|
||||
}
|
||||
|
||||
public String getSourceDocType() {
|
||||
return sourceDocType;
|
||||
}
|
||||
|
||||
public void setSourceDocType(String sourceDocType) {
|
||||
this.sourceDocType = sourceDocType;
|
||||
}
|
||||
|
||||
public Long getSourceDocId() {
|
||||
return sourceDocId;
|
||||
}
|
||||
|
||||
public void setSourceDocId(Long sourceDocId) {
|
||||
this.sourceDocId = sourceDocId;
|
||||
}
|
||||
|
||||
public String getSourceDocCode() {
|
||||
return sourceDocCode;
|
||||
}
|
||||
|
||||
public void setSourceDocCode(String sourceDocCode) {
|
||||
this.sourceDocCode = sourceDocCode;
|
||||
}
|
||||
|
||||
public Long getSourceDocLineId() {
|
||||
return sourceDocLineId;
|
||||
}
|
||||
|
||||
public void setSourceDocLineId(Long sourceDocLineId) {
|
||||
this.sourceDocLineId = sourceDocLineId;
|
||||
}
|
||||
|
||||
public BigDecimal getTransactionQuantity() {
|
||||
return transactionQuantity;
|
||||
}
|
||||
|
||||
public void setTransactionQuantity(BigDecimal transactionQuantity) {
|
||||
this.transactionQuantity = transactionQuantity;
|
||||
}
|
||||
|
||||
public Date getRecptDate() {
|
||||
return recptDate;
|
||||
}
|
||||
|
||||
public void setRecptDate(Date recptDate) {
|
||||
this.recptDate = recptDate;
|
||||
}
|
||||
|
||||
public Date getExpireDate() {
|
||||
return expireDate;
|
||||
}
|
||||
|
||||
public void setExpireDate(Date expireDate) {
|
||||
this.expireDate = expireDate;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return "OutsourceRecptTxBean{" +
|
||||
"itemId=" + itemId +
|
||||
", itemCode='" + itemCode + '\'' +
|
||||
", itemName='" + itemName + '\'' +
|
||||
", specification='" + specification + '\'' +
|
||||
", unitOfMeasure='" + unitOfMeasure + '\'' +
|
||||
", batchCode='" + batchCode + '\'' +
|
||||
", warehouseId=" + warehouseId +
|
||||
", warehouseCode='" + warehouseCode + '\'' +
|
||||
", warehouseName='" + warehouseName + '\'' +
|
||||
", locationId=" + locationId +
|
||||
", locationCode='" + locationCode + '\'' +
|
||||
", locationName='" + locationName + '\'' +
|
||||
", areaId=" + areaId +
|
||||
", areaCode='" + areaCode + '\'' +
|
||||
", areaName='" + areaName + '\'' +
|
||||
", vendorId=" + vendorId +
|
||||
", vendorCode='" + vendorCode + '\'' +
|
||||
", vendorName='" + vendorName + '\'' +
|
||||
", vendorNick='" + vendorNick + '\'' +
|
||||
", sourceDocType='" + sourceDocType + '\'' +
|
||||
", sourceDocId=" + sourceDocId +
|
||||
", sourceDocCode='" + sourceDocCode + '\'' +
|
||||
", sourceDocLineId=" + sourceDocLineId +
|
||||
", transactionQuantity=" + transactionQuantity +
|
||||
", recptDate=" + recptDate +
|
||||
", expireDate=" + expireDate +
|
||||
'}';
|
||||
}
|
||||
}
|
@ -27,6 +27,13 @@ public interface WmOutsourceIssueLineMapper
|
||||
*/
|
||||
public List<WmOutsourceIssueLine> selectWmOutsourceIssueLineList(WmOutsourceIssueLine wmOutsourceIssueLine);
|
||||
|
||||
/**
|
||||
* 根据发货单ID查询所有行信息
|
||||
* @param issueId
|
||||
* @return
|
||||
*/
|
||||
public List<WmOutsourceIssueLine> selectWmOutsourceIssueLineByIssueId(Long issueId);
|
||||
|
||||
/**
|
||||
* 新增外协领料单行
|
||||
*
|
||||
@ -58,4 +65,11 @@ public interface WmOutsourceIssueLineMapper
|
||||
* @return 结果
|
||||
*/
|
||||
public int deleteWmOutsourceIssueLineByLineIds(Long[] lineIds);
|
||||
|
||||
/**
|
||||
* 根据发料单ID删除所有行
|
||||
* @param issueId
|
||||
* @return
|
||||
*/
|
||||
public int deleteWmOutsourceIssueLineByIssueId(Long issueId);
|
||||
}
|
||||
|
@ -2,6 +2,7 @@ package com.ktg.mes.wm.mapper;
|
||||
|
||||
import java.util.List;
|
||||
import com.ktg.mes.wm.domain.WmOutsourceIssue;
|
||||
import com.ktg.mes.wm.domain.tx.OutsourceIssueTxBean;
|
||||
|
||||
/**
|
||||
* 外协领料单头Mapper接口
|
||||
@ -58,4 +59,6 @@ public interface WmOutsourceIssueMapper
|
||||
* @return 结果
|
||||
*/
|
||||
public int deleteWmOutsourceIssueByIssueIds(Long[] issueIds);
|
||||
|
||||
public List<OutsourceIssueTxBean> getTxBeans(Long issueId);
|
||||
}
|
||||
|
@ -27,6 +27,13 @@ public interface WmOutsourceRecptLineMapper
|
||||
*/
|
||||
public List<WmOutsourceRecptLine> selectWmOutsourceRecptLineList(WmOutsourceRecptLine wmOutsourceRecptLine);
|
||||
|
||||
/**
|
||||
* 根据外协入库单ID查询所有入库单行
|
||||
* @param recptId
|
||||
* @return
|
||||
*/
|
||||
public List<WmOutsourceRecptLine> selectWmOutsourceRecptLineByRecptId(Long recptId);
|
||||
|
||||
/**
|
||||
* 新增外协入库单行
|
||||
*
|
||||
@ -58,4 +65,11 @@ public interface WmOutsourceRecptLineMapper
|
||||
* @return 结果
|
||||
*/
|
||||
public int deleteWmOutsourceRecptLineByLineIds(Long[] lineIds);
|
||||
|
||||
/**
|
||||
* 根据外协入库单头ID删除所有行
|
||||
* @param recptId
|
||||
* @return
|
||||
*/
|
||||
public int deleteWmOutsourceRecptLineByRecptId(Long recptId);
|
||||
}
|
||||
|
@ -2,6 +2,7 @@ package com.ktg.mes.wm.mapper;
|
||||
|
||||
import java.util.List;
|
||||
import com.ktg.mes.wm.domain.WmOutsourceRecpt;
|
||||
import com.ktg.mes.wm.domain.tx.OutsourceRecptTxBean;
|
||||
|
||||
/**
|
||||
* 外协入库单Mapper接口
|
||||
@ -58,4 +59,6 @@ public interface WmOutsourceRecptMapper
|
||||
* @return 结果
|
||||
*/
|
||||
public int deleteWmOutsourceRecptByRecptIds(Long[] recptIds);
|
||||
|
||||
public List<OutsourceRecptTxBean> getTxBeans(Long recptId);
|
||||
}
|
||||
|
@ -27,6 +27,18 @@ public interface IStorageCoreService {
|
||||
*/
|
||||
public void processIssue(List<IssueTxBean> lines);
|
||||
|
||||
/**
|
||||
* 处理外协领料
|
||||
* @param lines
|
||||
*/
|
||||
public void processOutsourceIssue(List<OutsourceIssueTxBean> lines);
|
||||
|
||||
/**
|
||||
* 处理外协入库
|
||||
* @param lines
|
||||
*/
|
||||
public void processOutsourceRecpt(List<OutsourceRecptTxBean> lines);
|
||||
|
||||
/**
|
||||
* 处理生产退料
|
||||
* @param lines
|
||||
|
@ -27,6 +27,14 @@ public interface IWmOutsourceIssueLineService
|
||||
*/
|
||||
public List<WmOutsourceIssueLine> selectWmOutsourceIssueLineList(WmOutsourceIssueLine wmOutsourceIssueLine);
|
||||
|
||||
|
||||
/**
|
||||
* 根据外协领料单ID查询所有行
|
||||
* @param issueId
|
||||
* @return
|
||||
*/
|
||||
public List<WmOutsourceIssueLine> selectWmOutsourceIssueLineByIssueId(Long issueId);
|
||||
|
||||
/**
|
||||
* 新增外协领料单行
|
||||
*
|
||||
@ -58,4 +66,11 @@ public interface IWmOutsourceIssueLineService
|
||||
* @return 结果
|
||||
*/
|
||||
public int deleteWmOutsourceIssueLineByLineId(Long lineId);
|
||||
|
||||
/**
|
||||
* 根据发料单ID删除所有行
|
||||
* @param issueId
|
||||
* @return
|
||||
*/
|
||||
public int deleteWmOutsourceIssueLineByIssueId(Long issueId);
|
||||
}
|
||||
|
@ -2,6 +2,8 @@ package com.ktg.mes.wm.service;
|
||||
|
||||
import java.util.List;
|
||||
import com.ktg.mes.wm.domain.WmOutsourceIssue;
|
||||
import com.ktg.mes.wm.domain.tx.IssueTxBean;
|
||||
import com.ktg.mes.wm.domain.tx.OutsourceIssueTxBean;
|
||||
|
||||
/**
|
||||
* 外协领料单头Service接口
|
||||
@ -58,4 +60,6 @@ public interface IWmOutsourceIssueService
|
||||
* @return 结果
|
||||
*/
|
||||
public int deleteWmOutsourceIssueByIssueId(Long issueId);
|
||||
|
||||
public List<OutsourceIssueTxBean> getTxBeans(Long issueId);
|
||||
}
|
||||
|
@ -27,6 +27,13 @@ public interface IWmOutsourceRecptLineService
|
||||
*/
|
||||
public List<WmOutsourceRecptLine> selectWmOutsourceRecptLineList(WmOutsourceRecptLine wmOutsourceRecptLine);
|
||||
|
||||
/**
|
||||
* 根据外协入库单ID查询所有入库单行
|
||||
* @param recptId
|
||||
* @return
|
||||
*/
|
||||
public List<WmOutsourceRecptLine> selectWmOutsourceRecptLineByRecptId(Long recptId);
|
||||
|
||||
/**
|
||||
* 新增外协入库单行
|
||||
*
|
||||
@ -58,4 +65,11 @@ public interface IWmOutsourceRecptLineService
|
||||
* @return 结果
|
||||
*/
|
||||
public int deleteWmOutsourceRecptLineByLineId(Long lineId);
|
||||
|
||||
/**
|
||||
* 根据外协入库单头ID删除所有行
|
||||
* @param recptId
|
||||
* @return
|
||||
*/
|
||||
public int deleteWmOutsourceRecptLineByRecptId(Long recptId);
|
||||
}
|
||||
|
@ -2,6 +2,7 @@ package com.ktg.mes.wm.service;
|
||||
|
||||
import java.util.List;
|
||||
import com.ktg.mes.wm.domain.WmOutsourceRecpt;
|
||||
import com.ktg.mes.wm.domain.tx.OutsourceRecptTxBean;
|
||||
|
||||
/**
|
||||
* 外协入库单Service接口
|
||||
@ -58,4 +59,11 @@ public interface IWmOutsourceRecptService
|
||||
* @return 结果
|
||||
*/
|
||||
public int deleteWmOutsourceRecptByRecptId(Long recptId);
|
||||
|
||||
/**
|
||||
* 获取执行入库的TxBeans
|
||||
* @param recptId
|
||||
* @return
|
||||
*/
|
||||
public List<OutsourceRecptTxBean> getTxBeans(Long recptId);
|
||||
}
|
||||
|
@ -134,6 +134,43 @@ public class StorageCoreServiceImpl implements IStorageCoreService {
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void processOutsourceIssue(List<OutsourceIssueTxBean> lines) {
|
||||
if(CollUtil.isEmpty(lines)){
|
||||
throw new BussinessException("没有需要处理的外协发货单行");
|
||||
}
|
||||
|
||||
String transactionType_out = UserConstants.TRANSACTION_TYPE_ITEM_ISSUE_OUT;
|
||||
for(int i=0;i<lines.size();i++){
|
||||
OutsourceIssueTxBean line = lines.get(i);
|
||||
//构造一条库存减少的事务
|
||||
WmTransaction transaction_out = new WmTransaction();
|
||||
transaction_out.setTransactionType(transactionType_out);
|
||||
BeanUtils.copyBeanProp(transaction_out,line);
|
||||
transaction_out.setTransactionFlag(-1);//库存减少
|
||||
transaction_out.setTransactionDate(new Date());
|
||||
wmTransactionService.processTransaction(transaction_out);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void processOutsourceRecpt(List<OutsourceRecptTxBean> lines) {
|
||||
String transactionType = UserConstants.TRANSACTION_TYPE_OUTSOURCE_RECPT_IN;
|
||||
if(CollUtil.isEmpty(lines)){
|
||||
throw new BussinessException("没有需要处理的外协入库单行");
|
||||
}
|
||||
|
||||
for (int i =0;i<lines.size();i++){
|
||||
OutsourceRecptTxBean line = lines.get(i);
|
||||
WmTransaction transaction = new WmTransaction();
|
||||
transaction.setTransactionType(transactionType);
|
||||
BeanUtils.copyBeanProp(transaction,line);
|
||||
transaction.setTransactionFlag(1); //库存增加
|
||||
transaction.setTransactionDate(new Date());
|
||||
wmTransactionService.processTransaction(transaction);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 生产退料
|
||||
|
@ -44,6 +44,16 @@ public class WmOutsourceIssueLineServiceImpl implements IWmOutsourceIssueLineSer
|
||||
return wmOutsourceIssueLineMapper.selectWmOutsourceIssueLineList(wmOutsourceIssueLine);
|
||||
}
|
||||
|
||||
/**
|
||||
* 根据发货单ID查询所有行信息
|
||||
* @param issueId
|
||||
* @return
|
||||
*/
|
||||
@Override
|
||||
public List<WmOutsourceIssueLine> selectWmOutsourceIssueLineByIssueId(Long issueId){
|
||||
return wmOutsourceIssueLineMapper.selectWmOutsourceIssueLineByIssueId(issueId);
|
||||
}
|
||||
|
||||
/**
|
||||
* 新增外协领料单行
|
||||
*
|
||||
@ -93,4 +103,13 @@ public class WmOutsourceIssueLineServiceImpl implements IWmOutsourceIssueLineSer
|
||||
{
|
||||
return wmOutsourceIssueLineMapper.deleteWmOutsourceIssueLineByLineId(lineId);
|
||||
}
|
||||
|
||||
/**
|
||||
* 根据发料单ID删除所有行
|
||||
* @param issueId
|
||||
* @return
|
||||
*/
|
||||
public int deleteWmOutsourceIssueLineByIssueId(Long issueId){
|
||||
return wmOutsourceIssueLineMapper.deleteWmOutsourceIssueLineByIssueId(issueId);
|
||||
}
|
||||
}
|
||||
|
@ -2,6 +2,8 @@ package com.ktg.mes.wm.service.impl;
|
||||
|
||||
import java.util.List;
|
||||
import com.ktg.common.utils.DateUtils;
|
||||
import com.ktg.mes.wm.domain.tx.IssueTxBean;
|
||||
import com.ktg.mes.wm.domain.tx.OutsourceIssueTxBean;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
import com.ktg.mes.wm.mapper.WmOutsourceIssueMapper;
|
||||
@ -15,8 +17,8 @@ import com.ktg.mes.wm.service.IWmOutsourceIssueService;
|
||||
* @date 2023-10-30
|
||||
*/
|
||||
@Service
|
||||
public class WmOutsourceIssueServiceImpl implements IWmOutsourceIssueService
|
||||
{
|
||||
public class WmOutsourceIssueServiceImpl implements IWmOutsourceIssueService {
|
||||
|
||||
@Autowired
|
||||
private WmOutsourceIssueMapper wmOutsourceIssueMapper;
|
||||
|
||||
@ -27,8 +29,7 @@ public class WmOutsourceIssueServiceImpl implements IWmOutsourceIssueService
|
||||
* @return 外协领料单头
|
||||
*/
|
||||
@Override
|
||||
public WmOutsourceIssue selectWmOutsourceIssueByIssueId(Long issueId)
|
||||
{
|
||||
public WmOutsourceIssue selectWmOutsourceIssueByIssueId(Long issueId) {
|
||||
return wmOutsourceIssueMapper.selectWmOutsourceIssueByIssueId(issueId);
|
||||
}
|
||||
|
||||
@ -39,8 +40,7 @@ public class WmOutsourceIssueServiceImpl implements IWmOutsourceIssueService
|
||||
* @return 外协领料单头
|
||||
*/
|
||||
@Override
|
||||
public List<WmOutsourceIssue> selectWmOutsourceIssueList(WmOutsourceIssue wmOutsourceIssue)
|
||||
{
|
||||
public List<WmOutsourceIssue> selectWmOutsourceIssueList(WmOutsourceIssue wmOutsourceIssue) {
|
||||
return wmOutsourceIssueMapper.selectWmOutsourceIssueList(wmOutsourceIssue);
|
||||
}
|
||||
|
||||
@ -51,8 +51,7 @@ public class WmOutsourceIssueServiceImpl implements IWmOutsourceIssueService
|
||||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
public int insertWmOutsourceIssue(WmOutsourceIssue wmOutsourceIssue)
|
||||
{
|
||||
public int insertWmOutsourceIssue(WmOutsourceIssue wmOutsourceIssue) {
|
||||
wmOutsourceIssue.setCreateTime(DateUtils.getNowDate());
|
||||
return wmOutsourceIssueMapper.insertWmOutsourceIssue(wmOutsourceIssue);
|
||||
}
|
||||
@ -64,8 +63,7 @@ public class WmOutsourceIssueServiceImpl implements IWmOutsourceIssueService
|
||||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
public int updateWmOutsourceIssue(WmOutsourceIssue wmOutsourceIssue)
|
||||
{
|
||||
public int updateWmOutsourceIssue(WmOutsourceIssue wmOutsourceIssue) {
|
||||
wmOutsourceIssue.setUpdateTime(DateUtils.getNowDate());
|
||||
return wmOutsourceIssueMapper.updateWmOutsourceIssue(wmOutsourceIssue);
|
||||
}
|
||||
@ -77,8 +75,7 @@ public class WmOutsourceIssueServiceImpl implements IWmOutsourceIssueService
|
||||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
public int deleteWmOutsourceIssueByIssueIds(Long[] issueIds)
|
||||
{
|
||||
public int deleteWmOutsourceIssueByIssueIds(Long[] issueIds) {
|
||||
return wmOutsourceIssueMapper.deleteWmOutsourceIssueByIssueIds(issueIds);
|
||||
}
|
||||
|
||||
@ -89,8 +86,12 @@ public class WmOutsourceIssueServiceImpl implements IWmOutsourceIssueService
|
||||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
public int deleteWmOutsourceIssueByIssueId(Long issueId)
|
||||
{
|
||||
public int deleteWmOutsourceIssueByIssueId(Long issueId) {
|
||||
return wmOutsourceIssueMapper.deleteWmOutsourceIssueByIssueId(issueId);
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<OutsourceIssueTxBean> getTxBeans(Long issueId) {
|
||||
return wmOutsourceIssueMapper.getTxBeans(issueId);
|
||||
}
|
||||
}
|
||||
|
@ -44,6 +44,11 @@ public class WmOutsourceRecptLineServiceImpl implements IWmOutsourceRecptLineSer
|
||||
return wmOutsourceRecptLineMapper.selectWmOutsourceRecptLineList(wmOutsourceRecptLine);
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<WmOutsourceRecptLine> selectWmOutsourceRecptLineByRecptId(Long recptId) {
|
||||
return wmOutsourceRecptLineMapper.selectWmOutsourceRecptLineByRecptId(recptId);
|
||||
}
|
||||
|
||||
/**
|
||||
* 新增外协入库单行
|
||||
*
|
||||
@ -93,4 +98,9 @@ public class WmOutsourceRecptLineServiceImpl implements IWmOutsourceRecptLineSer
|
||||
{
|
||||
return wmOutsourceRecptLineMapper.deleteWmOutsourceRecptLineByLineId(lineId);
|
||||
}
|
||||
|
||||
@Override
|
||||
public int deleteWmOutsourceRecptLineByRecptId(Long recptId) {
|
||||
return wmOutsourceRecptLineMapper.deleteWmOutsourceRecptLineByRecptId(recptId);
|
||||
}
|
||||
}
|
||||
|
@ -2,6 +2,7 @@ package com.ktg.mes.wm.service.impl;
|
||||
|
||||
import java.util.List;
|
||||
import com.ktg.common.utils.DateUtils;
|
||||
import com.ktg.mes.wm.domain.tx.OutsourceRecptTxBean;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
import com.ktg.mes.wm.mapper.WmOutsourceRecptMapper;
|
||||
@ -93,4 +94,9 @@ public class WmOutsourceRecptServiceImpl implements IWmOutsourceRecptService
|
||||
{
|
||||
return wmOutsourceRecptMapper.deleteWmOutsourceRecptByRecptId(recptId);
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<OutsourceRecptTxBean> getTxBeans(Long recptId) {
|
||||
return wmOutsourceRecptMapper.getTxBeans(recptId);
|
||||
}
|
||||
}
|
||||
|
127
ktg-mes/src/main/resources/mapper/md/MdProductSipMapper.xml
Normal file
127
ktg-mes/src/main/resources/mapper/md/MdProductSipMapper.xml
Normal file
@ -0,0 +1,127 @@
|
||||
<?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.ktg.mes.md.mapper.MdProductSipMapper">
|
||||
|
||||
<resultMap type="MdProductSip" id="MdProductSipResult">
|
||||
<result property="sipId" column="sip_id" />
|
||||
<result property="itemId" column="item_id" />
|
||||
<result property="orderNum" column="order_num" />
|
||||
<result property="processId" column="process_id" />
|
||||
<result property="processCode" column="process_code" />
|
||||
<result property="processName" column="process_name" />
|
||||
<result property="sipTitle" column="sip_title" />
|
||||
<result property="sipDescription" column="sip_description" />
|
||||
<result property="sipUrl" column="sip_url" />
|
||||
<result property="remark" column="remark" />
|
||||
<result property="attr1" column="attr1" />
|
||||
<result property="attr2" column="attr2" />
|
||||
<result property="attr3" column="attr3" />
|
||||
<result property="attr4" column="attr4" />
|
||||
<result property="createBy" column="create_by" />
|
||||
<result property="createTime" column="create_time" />
|
||||
<result property="updateBy" column="update_by" />
|
||||
<result property="updateTime" column="update_time" />
|
||||
</resultMap>
|
||||
|
||||
<sql id="selectMdProductSipVo">
|
||||
select sip_id, item_id, order_num, process_id, process_code, process_name, sip_title, sip_description, sip_url, remark, attr1, attr2, attr3, attr4, create_by, create_time, update_by, update_time from md_product_sip
|
||||
</sql>
|
||||
|
||||
<select id="selectMdProductSipList" parameterType="MdProductSip" resultMap="MdProductSipResult">
|
||||
<include refid="selectMdProductSipVo"/>
|
||||
<where>
|
||||
<if test="itemId != null "> and item_id = #{itemId}</if>
|
||||
<if test="orderNum != null "> and order_num = #{orderNum}</if>
|
||||
<if test="processId != null "> and process_id = #{processId}</if>
|
||||
<if test="processCode != null and processCode != ''"> and process_code = #{processCode}</if>
|
||||
<if test="processName != null and processName != ''"> and process_name like concat('%', #{processName}, '%')</if>
|
||||
<if test="sipTitle != null and sipTitle != ''"> and sip_title = #{sipTitle}</if>
|
||||
<if test="sipDescription != null and sipDescription != ''"> and sip_description = #{sipDescription}</if>
|
||||
<if test="sipUrl != null and sipUrl != ''"> and sip_url = #{sipUrl}</if>
|
||||
</where>
|
||||
</select>
|
||||
|
||||
<select id="selectMdProductSipBySipId" parameterType="Long" resultMap="MdProductSipResult">
|
||||
<include refid="selectMdProductSipVo"/>
|
||||
where sip_id = #{sipId}
|
||||
</select>
|
||||
|
||||
<insert id="insertMdProductSip" parameterType="MdProductSip" useGeneratedKeys="true" keyProperty="sipId">
|
||||
insert into md_product_sip
|
||||
<trim prefix="(" suffix=")" suffixOverrides=",">
|
||||
<if test="itemId != null">item_id,</if>
|
||||
<if test="orderNum != null">order_num,</if>
|
||||
<if test="processId != null">process_id,</if>
|
||||
<if test="processCode != null">process_code,</if>
|
||||
<if test="processName != null">process_name,</if>
|
||||
<if test="sipTitle != null">sip_title,</if>
|
||||
<if test="sipDescription != null">sip_description,</if>
|
||||
<if test="sipUrl != null">sip_url,</if>
|
||||
<if test="remark != null">remark,</if>
|
||||
<if test="attr1 != null">attr1,</if>
|
||||
<if test="attr2 != null">attr2,</if>
|
||||
<if test="attr3 != null">attr3,</if>
|
||||
<if test="attr4 != null">attr4,</if>
|
||||
<if test="createBy != null">create_by,</if>
|
||||
<if test="createTime != null">create_time,</if>
|
||||
<if test="updateBy != null">update_by,</if>
|
||||
<if test="updateTime != null">update_time,</if>
|
||||
</trim>
|
||||
<trim prefix="values (" suffix=")" suffixOverrides=",">
|
||||
<if test="itemId != null">#{itemId},</if>
|
||||
<if test="orderNum != null">#{orderNum},</if>
|
||||
<if test="processId != null">#{processId},</if>
|
||||
<if test="processCode != null">#{processCode},</if>
|
||||
<if test="processName != null">#{processName},</if>
|
||||
<if test="sipTitle != null">#{sipTitle},</if>
|
||||
<if test="sipDescription != null">#{sipDescription},</if>
|
||||
<if test="sipUrl != null">#{sipUrl},</if>
|
||||
<if test="remark != null">#{remark},</if>
|
||||
<if test="attr1 != null">#{attr1},</if>
|
||||
<if test="attr2 != null">#{attr2},</if>
|
||||
<if test="attr3 != null">#{attr3},</if>
|
||||
<if test="attr4 != null">#{attr4},</if>
|
||||
<if test="createBy != null">#{createBy},</if>
|
||||
<if test="createTime != null">#{createTime},</if>
|
||||
<if test="updateBy != null">#{updateBy},</if>
|
||||
<if test="updateTime != null">#{updateTime},</if>
|
||||
</trim>
|
||||
</insert>
|
||||
|
||||
<update id="updateMdProductSip" parameterType="MdProductSip">
|
||||
update md_product_sip
|
||||
<trim prefix="SET" suffixOverrides=",">
|
||||
<if test="itemId != null">item_id = #{itemId},</if>
|
||||
<if test="orderNum != null">order_num = #{orderNum},</if>
|
||||
<if test="processId != null">process_id = #{processId},</if>
|
||||
<if test="processCode != null">process_code = #{processCode},</if>
|
||||
<if test="processName != null">process_name = #{processName},</if>
|
||||
<if test="sipTitle != null">sip_title = #{sipTitle},</if>
|
||||
<if test="sipDescription != null">sip_description = #{sipDescription},</if>
|
||||
<if test="sipUrl != null">sip_url = #{sipUrl},</if>
|
||||
<if test="remark != null">remark = #{remark},</if>
|
||||
<if test="attr1 != null">attr1 = #{attr1},</if>
|
||||
<if test="attr2 != null">attr2 = #{attr2},</if>
|
||||
<if test="attr3 != null">attr3 = #{attr3},</if>
|
||||
<if test="attr4 != null">attr4 = #{attr4},</if>
|
||||
<if test="createBy != null">create_by = #{createBy},</if>
|
||||
<if test="createTime != null">create_time = #{createTime},</if>
|
||||
<if test="updateBy != null">update_by = #{updateBy},</if>
|
||||
<if test="updateTime != null">update_time = #{updateTime},</if>
|
||||
</trim>
|
||||
where sip_id = #{sipId}
|
||||
</update>
|
||||
|
||||
<delete id="deleteMdProductSipBySipId" parameterType="Long">
|
||||
delete from md_product_sip where sip_id = #{sipId}
|
||||
</delete>
|
||||
|
||||
<delete id="deleteMdProductSipBySipIds" parameterType="String">
|
||||
delete from md_product_sip where sip_id in
|
||||
<foreach item="sipId" collection="array" open="(" separator="," close=")">
|
||||
#{sipId}
|
||||
</foreach>
|
||||
</delete>
|
||||
</mapper>
|
@ -68,6 +68,11 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||
where line_id = #{lineId}
|
||||
</select>
|
||||
|
||||
<select id="selectWmOutsourceIssueLineByIssueId" parameterType="Long" resultMap="WmOutsourceIssueLineResult">
|
||||
<include refid="selectWmOutsourceIssueLineVo"/>
|
||||
where issue_id = #{issueId}
|
||||
</select>
|
||||
|
||||
<insert id="insertWmOutsourceIssueLine" parameterType="WmOutsourceIssueLine" useGeneratedKeys="true" keyProperty="lineId">
|
||||
insert into wm_outsource_issue_line
|
||||
<trim prefix="(" suffix=")" suffixOverrides=",">
|
||||
@ -168,6 +173,10 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||
delete from wm_outsource_issue_line where line_id = #{lineId}
|
||||
</delete>
|
||||
|
||||
<delete id="deleteWmOutsourceIssueLineByIssueId" parameterType="Long">
|
||||
delete from wm_outsource_issue_line where issue_id = #{issueId}
|
||||
</delete>
|
||||
|
||||
<delete id="deleteWmOutsourceIssueLineByLineIds" parameterType="String">
|
||||
delete from wm_outsource_issue_line where line_id in
|
||||
<foreach item="lineId" collection="array" open="(" separator="," close=")">
|
||||
|
@ -36,6 +36,40 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||
<result property="updateTime" column="update_time" />
|
||||
</resultMap>
|
||||
|
||||
<resultMap id="OutsourceIssueTxBeanResult" type="OutsourceIssueTxBean">
|
||||
<result property="materialStockId" column="material_stock_id"></result>
|
||||
<result property="itemId" column="item_id"></result>
|
||||
<result property="itemCode" column="item_code"></result>
|
||||
<result property="itemName" column="item_name"></result>
|
||||
<result property="specification" column="specification"></result>
|
||||
<result property="unitOfMeasure" column="unit_of_measure"></result>
|
||||
<result property="batchCode" column="batch_code"></result>
|
||||
<result property="warehouseId" column="warehouse_id"></result>
|
||||
<result property="warehouseCode" column="warehouse_code"></result>
|
||||
<result property="warehouseName" column="warehouse_name"></result>
|
||||
<result property="locationId" column="location_id"></result>
|
||||
<result property="locationCode" column="location_code"></result>
|
||||
<result property="locationName" column="location_name"></result>
|
||||
<result property="areaId" column="area_id"></result>
|
||||
<result property="areaCode" column="area_code"></result>
|
||||
<result property="areaName" column="area_name"></result>
|
||||
<result property="vendorId" column="vendor_id"></result>
|
||||
<result property="vendorCode" column="vendor_code"></result>
|
||||
<result property="vendorName" column="vendor_name"></result>
|
||||
<result property="vendorNick" column="vendor_nick"></result>
|
||||
<result property="sourceDocType" column="source_doc_type"></result>
|
||||
<result property="sourceDocId" column="source_doc_id"></result>
|
||||
<result property="sourceDocCode" column="source_doc_code"></result>
|
||||
<result property="sourceDocLineId" column="source_doc_line_id"></result>
|
||||
<result property="transactionQuantity" column="transaction_quantity"></result>
|
||||
<result property="workorderId" column="workorder_id"></result>
|
||||
<result property="workorderCode" column="workorder_code"></result>
|
||||
<result property="createBy" column="create_by" />
|
||||
<result property="createTime" column="create_time" />
|
||||
<result property="updateBy" column="update_by" />
|
||||
<result property="updateTime" column="update_time" />
|
||||
</resultMap>
|
||||
|
||||
<sql id="selectWmOutsourceIssueVo">
|
||||
select issue_id, issue_code, issue_name, workorder_id, workorder_code, vendor_id, vendor_code, vendor_name, vendor_nick, warehouse_id, warehouse_code, warehouse_name, location_id, location_code, location_name, area_id, area_code, area_name, issue_date, status, remark, attr1, attr2, attr3, attr4, create_by, create_time, update_by, update_time from wm_outsource_issue
|
||||
</sql>
|
||||
@ -70,6 +104,18 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||
where issue_id = #{issueId}
|
||||
</select>
|
||||
|
||||
<select id="getTxBeans" parameterType="Long" resultMap="OutsourceIssueTxBeanResult">
|
||||
SELECT irl.material_stock_id, irl.`item_id`,irl.`item_code`,irl.`item_name`,irl.`specification`,irl.`unit_of_measure`,irl.`batch_code`,
|
||||
irl.`warehouse_id`,irl.`warehouse_code`,irl.`warehouse_name`,irl.`location_id`,irl.`location_code`,irl.`location_name`,irl.`area_id`,irl.`area_code`,irl.`area_name`,
|
||||
'ISSUE' AS source_doc_type,ir.`issue_id` AS source_doc_id,ir.`issue_code` AS source_doc_code,irl.`line_id` AS source_doc_line_id,
|
||||
irl.`quantity_issued` AS transaction_quantity,ir.workorder_id,ir.workorder_code,
|
||||
ir.`create_by`,ir.`create_time`,ir.`update_by`,ir.`update_time`
|
||||
FROM wm_outsource_issue ir
|
||||
LEFT JOIN wm_outsource_issue_line irl
|
||||
ON ir.issue_id = irl.`issue_id`
|
||||
WHERE ir.`issue_id` = #{issueId}
|
||||
</select>
|
||||
|
||||
<insert id="insertWmOutsourceIssue" parameterType="WmOutsourceIssue" useGeneratedKeys="true" keyProperty="issueId">
|
||||
insert into wm_outsource_issue
|
||||
<trim prefix="(" suffix=")" suffixOverrides=",">
|
||||
|
@ -74,6 +74,11 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||
where line_id = #{lineId}
|
||||
</select>
|
||||
|
||||
<select id="selectWmOutsourceRecptLineByRecptId" parameterType="Long" resultMap="WmOutsourceRecptLineResult">
|
||||
<include refid="selectWmOutsourceRecptLineVo"/>
|
||||
where recpt_id = #{recptId}
|
||||
</select>
|
||||
|
||||
<insert id="insertWmOutsourceRecptLine" parameterType="WmOutsourceRecptLine" useGeneratedKeys="true" keyProperty="lineId">
|
||||
insert into wm_outsource_recpt_line
|
||||
<trim prefix="(" suffix=")" suffixOverrides=",">
|
||||
@ -183,6 +188,10 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||
delete from wm_outsource_recpt_line where line_id = #{lineId}
|
||||
</delete>
|
||||
|
||||
<delete id="deleteWmOutsourceRecptLineByRecptId" parameterType="Long">
|
||||
delete from wm_outsource_recpt_line where recpt_id = #{recptId}
|
||||
</delete>
|
||||
|
||||
<delete id="deleteWmOutsourceRecptLineByLineIds" parameterType="String">
|
||||
delete from wm_outsource_recpt_line where line_id in
|
||||
<foreach item="lineId" collection="array" open="(" separator="," close=")">
|
||||
|
@ -38,6 +38,39 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||
<result property="updateTime" column="update_time" />
|
||||
</resultMap>
|
||||
|
||||
<resultMap type="OutsourceRecptTxBean" id="OutsourceRecptTxBeanResult">
|
||||
<result property="itemId" column="item_id"></result>
|
||||
<result property="itemCode" column="item_code"></result>
|
||||
<result property="itemName" column="item_name"></result>
|
||||
<result property="specification" column="specification"></result>
|
||||
<result property="unitOfMeasure" column="unit_of_measure"></result>
|
||||
<result property="batchCode" column="batch_code"></result>
|
||||
<result property="warehouseId" column="warehouse_id"></result>
|
||||
<result property="warehouseCode" column="warehouse_code"></result>
|
||||
<result property="warehouseName" column="warehouse_name"></result>
|
||||
<result property="locationId" column="location_id"></result>
|
||||
<result property="locationCode" column="location_code"></result>
|
||||
<result property="locationName" column="location_name"></result>
|
||||
<result property="areaId" column="area_id"></result>
|
||||
<result property="areaCode" column="area_code"></result>
|
||||
<result property="areaName" column="area_name"></result>
|
||||
<result property="vendorId" column="vendor_id"></result>
|
||||
<result property="vendorCode" column="vendor_code"></result>
|
||||
<result property="vendorName" column="vendor_name"></result>
|
||||
<result property="vendorNick" column="vendor_nick"></result>
|
||||
<result property="sourceDocType" column="source_doc_type"></result>
|
||||
<result property="sourceDocId" column="source_doc_id"></result>
|
||||
<result property="sourceDocCode" column="source_doc_code"></result>
|
||||
<result property="sourceDocLineId" column="source_doc_line_id"></result>
|
||||
<result property="transactionQuantity" column="transaction_quantity"></result>
|
||||
<result property="recptDate" column="recpt_date"></result>
|
||||
<result property="expireDate" column="expire_date"></result>
|
||||
<result property="createBy" column="create_by" />
|
||||
<result property="createTime" column="create_time" />
|
||||
<result property="updateBy" column="update_by" />
|
||||
<result property="updateTime" column="update_time" />
|
||||
</resultMap>
|
||||
|
||||
<sql id="selectWmOutsourceRecptVo">
|
||||
select recpt_id, recpt_code, recpt_name, iqc_id, iqc_code, workorder_id, workorder_code, vendor_id, vendor_code, vendor_name, vendor_nick, warehouse_id, warehouse_code, warehouse_name, location_id, location_code, location_name, area_id, area_code, area_name, recpt_date, status, remark, attr1, attr2, attr3, attr4, create_by, create_time, update_by, update_time from wm_outsource_recpt
|
||||
</sql>
|
||||
@ -74,6 +107,19 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||
where recpt_id = #{recptId}
|
||||
</select>
|
||||
|
||||
<select id="getTxBeans" parameterType="Long" resultMap="OutsourceRecptTxBeanResult">
|
||||
SELECT irl.`item_id`,irl.`item_code`,irl.`item_name`,irl.`specification`,irl.`unit_of_measure`,irl.`batch_code`,
|
||||
irl.`warehouse_id`,irl.`warehouse_code`,irl.`warehouse_name`,irl.`location_id`,irl.`location_code`,irl.`location_name`,irl.`area_id`,irl.`area_code`,irl.`area_name`,
|
||||
ir.`vendor_id`,ir.`vendor_code`,ir.`vendor_name`,ir.`vendor_nick`,
|
||||
'IR' AS source_doc_type,ir.`recpt_id` AS source_doc_id,ir.`recpt_code` AS source_doc_code,irl.`line_id` AS source_doc_line_id,
|
||||
irl.`quantity_recived` AS transaction_quantity,ir.recpt_date, irl.`expire_date`,
|
||||
ir.`create_by`,ir.`create_time`,ir.`update_by`,ir.`update_time`
|
||||
FROM wm_outsource_recpt ir
|
||||
LEFT JOIN wm_outsource_recpt_line irl
|
||||
ON ir.recpt_id = irl.`recpt_id`
|
||||
WHERE ir.`recpt_id` = #{recptId}
|
||||
</select>
|
||||
|
||||
<insert id="insertWmOutsourceRecpt" parameterType="WmOutsourceRecpt" useGeneratedKeys="true" keyProperty="recptId">
|
||||
insert into wm_outsource_recpt
|
||||
<trim prefix="(" suffix=")" suffixOverrides=",">
|
||||
|
Loading…
Reference in New Issue
Block a user