自动备货计划
This commit is contained in:
@@ -6,6 +6,7 @@ import java.util.UUID;
|
||||
|
||||
import com.ruoyi.common.utils.StringUtils;
|
||||
import com.ruoyi.project.bas.product.domain.BasProduct;
|
||||
import com.ruoyi.project.middle.mesOutorder.domain.MesOutorderMiddleAutoVo;
|
||||
import com.ruoyi.project.middle.mesOutorder.domain.MesOutorderMiddleVo;
|
||||
import com.ruoyi.project.out.outStock.domain.OutStockoutVo;
|
||||
import com.ruoyi.web.controller.common.BusinessException;
|
||||
@@ -26,7 +27,7 @@ import org.springframework.web.multipart.MultipartFile;
|
||||
|
||||
/**
|
||||
* mes出库单中间表Controller
|
||||
*
|
||||
*
|
||||
* @author ruoyi
|
||||
* @date 2024-06-17
|
||||
*/
|
||||
@@ -134,9 +135,18 @@ public class MesOutorderMiddleController extends BaseController
|
||||
@PostMapping("/addSave")
|
||||
@ResponseBody
|
||||
public AjaxResult addSave1(@RequestBody MesOutorderMiddleVo mesOutorderMiddleVo) {
|
||||
AjaxResult ajaxResult= mesOutorderMiddleService.insertMesOutorder(mesOutorderMiddleVo);
|
||||
AjaxResult ajaxResult= mesOutorderMiddleService.insertMesOutorder(mesOutorderMiddleVo,"1");
|
||||
return ajaxResult;
|
||||
}
|
||||
|
||||
@Log(title = "自动建单", businessType = BusinessType.INSERT)
|
||||
@PostMapping("/addSaveAuto")
|
||||
@ResponseBody
|
||||
public AjaxResult addSaveAuto(@RequestBody MesOutorderMiddleAutoVo mesOutorderMiddleAutoVo) {
|
||||
AjaxResult ajaxResult= mesOutorderMiddleService.insertMesOutorderAuto(mesOutorderMiddleAutoVo);
|
||||
return ajaxResult;
|
||||
}
|
||||
|
||||
@Log(title = "修改单据状态", businessType = BusinessType.INSERT)
|
||||
@PostMapping("/updateStatus")
|
||||
@ResponseBody
|
||||
|
||||
@@ -7,7 +7,7 @@ import com.ruoyi.common.core.domain.BaseEntity;
|
||||
|
||||
/**
|
||||
* mes出库单中间表对象 mes_outorder_middle
|
||||
*
|
||||
*
|
||||
* @author ruoyi
|
||||
* @date 2024-06-17
|
||||
*/
|
||||
@@ -50,6 +50,16 @@ public class MesOutorderMiddle
|
||||
private String beginDate;
|
||||
private String endDate;
|
||||
|
||||
private String createType;
|
||||
|
||||
public String getCreateType() {
|
||||
return createType;
|
||||
}
|
||||
|
||||
public void setCreateType(String createType) {
|
||||
this.createType = createType;
|
||||
}
|
||||
|
||||
public String getEndDate() {
|
||||
return endDate;
|
||||
}
|
||||
@@ -129,52 +139,52 @@ public class MesOutorderMiddle
|
||||
this.id = id;
|
||||
}
|
||||
|
||||
public String getId()
|
||||
public String getId()
|
||||
{
|
||||
return id;
|
||||
}
|
||||
public void setOrderId(String orderId)
|
||||
public void setOrderId(String orderId)
|
||||
{
|
||||
this.orderId = orderId;
|
||||
}
|
||||
|
||||
public String getOrderId()
|
||||
public String getOrderId()
|
||||
{
|
||||
return orderId;
|
||||
}
|
||||
public void setConstructor(String constructor)
|
||||
public void setConstructor(String constructor)
|
||||
{
|
||||
this.constructor = constructor;
|
||||
}
|
||||
|
||||
public String getConstructor()
|
||||
public String getConstructor()
|
||||
{
|
||||
return constructor;
|
||||
}
|
||||
public void setOperationType(String operationType)
|
||||
public void setOperationType(String operationType)
|
||||
{
|
||||
this.operationType = operationType;
|
||||
}
|
||||
|
||||
public String getOperationType()
|
||||
public String getOperationType()
|
||||
{
|
||||
return operationType;
|
||||
}
|
||||
public void setXfTime(String xfTime)
|
||||
public void setXfTime(String xfTime)
|
||||
{
|
||||
this.xfTime = xfTime;
|
||||
}
|
||||
|
||||
public String getXfTime()
|
||||
public String getXfTime()
|
||||
{
|
||||
return xfTime;
|
||||
}
|
||||
public void setOrderType(String orderType)
|
||||
public void setOrderType(String orderType)
|
||||
{
|
||||
this.orderType = orderType;
|
||||
}
|
||||
|
||||
public String getOrderType()
|
||||
public String getOrderType()
|
||||
{
|
||||
return orderType;
|
||||
}
|
||||
|
||||
@@ -0,0 +1,27 @@
|
||||
package com.ruoyi.project.middle.mesOutorder.domain;
|
||||
|
||||
import com.ruoyi.project.middle.mesOutorderDetail.domain.MesOutorderDetailMiddle;
|
||||
import com.ruoyi.project.out.productAndStock.domain.ViewProductAndStock;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
public class MesOutorderMiddleAutoVo {
|
||||
|
||||
private MesOutorderMiddle mesOutorderMiddle;
|
||||
|
||||
private ViewProductAndStock viewProductAndStock;
|
||||
|
||||
public MesOutorderMiddle getMesOutorderMiddle() {
|
||||
return mesOutorderMiddle;
|
||||
}
|
||||
|
||||
public void setMesOutorderMiddle(MesOutorderMiddle mesOutorderMiddle) {
|
||||
this.mesOutorderMiddle = mesOutorderMiddle;
|
||||
}
|
||||
public ViewProductAndStock getViewProductAndStock() {
|
||||
return viewProductAndStock;
|
||||
}
|
||||
public void setViewProductAndStock(ViewProductAndStock viewProductAndStock) {
|
||||
this.viewProductAndStock = viewProductAndStock;
|
||||
}
|
||||
}
|
||||
@@ -5,19 +5,20 @@ import java.util.Map;
|
||||
|
||||
import com.ruoyi.common.core.domain.AjaxResult;
|
||||
import com.ruoyi.project.middle.mesOutorder.domain.MesOutorderMiddle;
|
||||
import com.ruoyi.project.middle.mesOutorder.domain.MesOutorderMiddleAutoVo;
|
||||
import com.ruoyi.project.middle.mesOutorder.domain.MesOutorderMiddleVo;
|
||||
|
||||
/**
|
||||
* mes出库单中间表Service接口
|
||||
*
|
||||
*
|
||||
* @author ruoyi
|
||||
* @date 2024-06-17
|
||||
*/
|
||||
public interface IMesOutorderMiddleService
|
||||
public interface IMesOutorderMiddleService
|
||||
{
|
||||
/**
|
||||
* 查询mes出库单中间表
|
||||
*
|
||||
*
|
||||
* @param id mes出库单中间表主键
|
||||
* @return mes出库单中间表
|
||||
*/
|
||||
@@ -25,7 +26,7 @@ public interface IMesOutorderMiddleService
|
||||
|
||||
/**
|
||||
* 查询mes出库单中间表列表
|
||||
*
|
||||
*
|
||||
* @param mesOutorderMiddle mes出库单中间表
|
||||
* @return mes出库单中间表集合
|
||||
*/
|
||||
@@ -33,7 +34,7 @@ public interface IMesOutorderMiddleService
|
||||
|
||||
/**
|
||||
* 新增mes出库单中间表
|
||||
*
|
||||
*
|
||||
* @param mesOutorderMiddle mes出库单中间表
|
||||
* @return 结果
|
||||
*/
|
||||
@@ -41,7 +42,7 @@ public interface IMesOutorderMiddleService
|
||||
|
||||
/**
|
||||
* 修改mes出库单中间表
|
||||
*
|
||||
*
|
||||
* @param mesOutorderMiddle mes出库单中间表
|
||||
* @return 结果
|
||||
*/
|
||||
@@ -49,7 +50,7 @@ public interface IMesOutorderMiddleService
|
||||
|
||||
/**
|
||||
* 批量删除mes出库单中间表
|
||||
*
|
||||
*
|
||||
* @param ids 需要删除的mes出库单中间表主键集合
|
||||
* @return 结果
|
||||
*/
|
||||
@@ -57,14 +58,14 @@ public interface IMesOutorderMiddleService
|
||||
|
||||
/**
|
||||
* 删除mes出库单中间表信息
|
||||
*
|
||||
*
|
||||
* @param id mes出库单中间表主键
|
||||
* @return 结果
|
||||
*/
|
||||
public int deleteMesOutorderMiddleById(String id);
|
||||
|
||||
|
||||
public AjaxResult insertMesOutorder(MesOutorderMiddleVo mesOutorderMiddleVo);
|
||||
public AjaxResult insertMesOutorder(MesOutorderMiddleVo mesOutorderMiddleVo,String createType);
|
||||
|
||||
/**
|
||||
修改单据状态
|
||||
@@ -72,4 +73,5 @@ public interface IMesOutorderMiddleService
|
||||
public Map<String, Object> updateStatus(String[] orderIds, String status, String newStatus);
|
||||
|
||||
|
||||
}
|
||||
AjaxResult insertMesOutorderAuto(MesOutorderMiddleAutoVo mesOutorderMiddleAutoVo);
|
||||
}
|
||||
|
||||
@@ -2,10 +2,7 @@ package com.ruoyi.project.middle.mesOutorder.service.impl;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
import java.text.SimpleDateFormat;
|
||||
import java.util.Date;
|
||||
import java.util.HashMap;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.*;
|
||||
|
||||
import com.ruoyi.common.core.domain.AjaxResult;
|
||||
import com.ruoyi.common.core.domain.entity.SysUser;
|
||||
@@ -15,6 +12,7 @@ import com.ruoyi.common.utils.uuid.UUID;
|
||||
import com.ruoyi.project.bas.basCustomer.domain.BasCustomer;
|
||||
import com.ruoyi.project.bas.basCustomer.mapper.BasCustomerMapper;
|
||||
import com.ruoyi.project.bas.basJobId.service.IBasJobIdService;
|
||||
import com.ruoyi.project.middle.mesOutorder.domain.MesOutorderMiddleAutoVo;
|
||||
import com.ruoyi.project.middle.mesOutorder.domain.MesOutorderMiddleVo;
|
||||
import com.ruoyi.project.middle.mesOutorderDetail.domain.MesOutorderDetailMiddle;
|
||||
import com.ruoyi.project.middle.mesOutorderDetail.mapper.MesOutorderDetailMiddleMapper;
|
||||
@@ -22,6 +20,8 @@ import com.ruoyi.project.out.outStock.domain.OutStockout;
|
||||
import com.ruoyi.project.out.outStock.mapper.OutStockoutMapper;
|
||||
import com.ruoyi.project.out.outStockDetail.domain.OutStockoutDetail;
|
||||
import com.ruoyi.project.out.outStockDetail.mapper.OutStockoutDetailMapper;
|
||||
import com.ruoyi.project.out.productAndStock.domain.ViewProductAndStock;
|
||||
import com.ruoyi.project.out.productAndStock.service.IViewProductAndStockService;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
import com.ruoyi.project.middle.mesOutorder.mapper.MesOutorderMiddleMapper;
|
||||
@@ -31,12 +31,12 @@ import com.ruoyi.common.core.text.Convert;
|
||||
|
||||
/**
|
||||
* mes出库单中间表Service业务层处理
|
||||
*
|
||||
*
|
||||
* @author ruoyi
|
||||
* @date 2024-06-17
|
||||
*/
|
||||
@Service
|
||||
public class MesOutorderMiddleServiceImpl implements IMesOutorderMiddleService
|
||||
public class MesOutorderMiddleServiceImpl implements IMesOutorderMiddleService
|
||||
{
|
||||
@Autowired
|
||||
private MesOutorderMiddleMapper mesOutorderMiddleMapper;
|
||||
@@ -50,10 +50,12 @@ public class MesOutorderMiddleServiceImpl implements IMesOutorderMiddleService
|
||||
private OutStockoutMapper outStockoutMapper;
|
||||
@Autowired
|
||||
private OutStockoutDetailMapper outStockoutDetailMapper;
|
||||
@Autowired
|
||||
private IViewProductAndStockService viewProductAndStockService;
|
||||
|
||||
/**
|
||||
* 查询mes出库单中间表
|
||||
*
|
||||
*
|
||||
* @param id mes出库单中间表主键
|
||||
* @return mes出库单中间表
|
||||
*/
|
||||
@@ -65,7 +67,7 @@ public class MesOutorderMiddleServiceImpl implements IMesOutorderMiddleService
|
||||
|
||||
/**
|
||||
* 查询mes出库单中间表列表
|
||||
*
|
||||
*
|
||||
* @param mesOutorderMiddle mes出库单中间表
|
||||
* @return mes出库单中间表
|
||||
*/
|
||||
@@ -77,7 +79,7 @@ public class MesOutorderMiddleServiceImpl implements IMesOutorderMiddleService
|
||||
|
||||
/**
|
||||
* 新增mes出库单中间表
|
||||
*
|
||||
*
|
||||
* @param mesOutorderMiddle mes出库单中间表
|
||||
* @return 结果
|
||||
*/
|
||||
@@ -91,7 +93,7 @@ public class MesOutorderMiddleServiceImpl implements IMesOutorderMiddleService
|
||||
|
||||
/**
|
||||
* 修改mes出库单中间表
|
||||
*
|
||||
*
|
||||
* @param mesOutorderMiddle mes出库单中间表
|
||||
* @return 结果
|
||||
*/
|
||||
@@ -103,7 +105,7 @@ public class MesOutorderMiddleServiceImpl implements IMesOutorderMiddleService
|
||||
|
||||
/**
|
||||
* 批量删除mes出库单中间表
|
||||
*
|
||||
*
|
||||
* @param ids 需要删除的mes出库单中间表主键
|
||||
* @return 结果
|
||||
*/
|
||||
@@ -115,7 +117,7 @@ public class MesOutorderMiddleServiceImpl implements IMesOutorderMiddleService
|
||||
|
||||
/**
|
||||
* 删除mes出库单中间表信息
|
||||
*
|
||||
*
|
||||
* @param id mes出库单中间表主键
|
||||
* @return 结果
|
||||
*/
|
||||
@@ -126,7 +128,7 @@ public class MesOutorderMiddleServiceImpl implements IMesOutorderMiddleService
|
||||
}
|
||||
|
||||
@Override
|
||||
public AjaxResult insertMesOutorder(MesOutorderMiddleVo mesOutorderMiddleVo) {
|
||||
public AjaxResult insertMesOutorder(MesOutorderMiddleVo mesOutorderMiddleVo,String createType) {
|
||||
try {
|
||||
MesOutorderMiddle mesOutorderMiddle = mesOutorderMiddleVo.getMesOutorderMiddle();
|
||||
mesOutorderMiddle.setId(UUID.randomUUID().toString());
|
||||
@@ -138,6 +140,7 @@ public class MesOutorderMiddleServiceImpl implements IMesOutorderMiddleService
|
||||
userName = user.getUserName();
|
||||
mesOutorderMiddle.setConstructor(userName);
|
||||
mesOutorderMiddle.setStatus("1");
|
||||
mesOutorderMiddle.setCreateType(createType);
|
||||
mesOutorderMiddleMapper.insertMesOutorderMiddle(mesOutorderMiddle);
|
||||
OutStockout outStockout = new OutStockout();
|
||||
outStockout.setStockoutId(mesOutorderMiddle.getSaleOrder());
|
||||
@@ -211,4 +214,41 @@ public class MesOutorderMiddleServiceImpl implements IMesOutorderMiddleService
|
||||
resultMap.put("errorInfo", builder.toString());
|
||||
return resultMap;
|
||||
}
|
||||
|
||||
@Override
|
||||
public AjaxResult insertMesOutorderAuto(MesOutorderMiddleAutoVo mesOutorderMiddleAutoVo) {
|
||||
ViewProductAndStock viewProductAndStock = mesOutorderMiddleAutoVo.getViewProductAndStock();
|
||||
List<ViewProductAndStock> viewProductAndStocks = viewProductAndStockService.selectViewProductAndStockList(viewProductAndStock);
|
||||
MesOutorderMiddleVo mesOutorderMiddleVo = new MesOutorderMiddleVo();
|
||||
MesOutorderMiddle mesOutorderMiddle = new MesOutorderMiddle();
|
||||
List<MesOutorderDetailMiddle> mesOutorderDetailMiddleList = new ArrayList<>();
|
||||
BigDecimal quantity = viewProductAndStock.getBhQuantity();
|
||||
//拼接数据
|
||||
for (ViewProductAndStock viewProductAndStock1 : viewProductAndStocks) {
|
||||
if (quantity.compareTo(BigDecimal.valueOf(0))==0){
|
||||
break;
|
||||
}
|
||||
MesOutorderDetailMiddle mesOutorderDetailMiddle = new MesOutorderDetailMiddle();
|
||||
mesOutorderDetailMiddle.setErpCode(viewProductAndStock1.getProductId());
|
||||
mesOutorderDetailMiddle.setProductName(viewProductAndStock1.getProductName());
|
||||
mesOutorderDetailMiddle.setProduceDate(viewProductAndStock1.getInClassName());
|
||||
mesOutorderDetailMiddle.setProductBatch(viewProductAndStock1.getLotNo());
|
||||
mesOutorderDetailMiddle.setMaterialCode(viewProductAndStock1.getClassgroupNumber());
|
||||
mesOutorderDetailMiddle.setShape(viewProductAndStock1.getProductDetailId());
|
||||
mesOutorderDetailMiddle.setPrintDate(viewProductAndStock1.getPrintDate());
|
||||
//mesOutorderDetailMiddle.setQuantity(viewProductAndStock1.getMaterialCode());
|
||||
//mesOutorderDetailMiddle.setRemark(viewProductAndStock1.getMaterialCode());
|
||||
if (quantity.compareTo(viewProductAndStock1.getQuantity())>=0){
|
||||
mesOutorderDetailMiddle.setPlanInQuantity(viewProductAndStock1.getQuantity());
|
||||
quantity = quantity.subtract(viewProductAndStock1.getQuantity());
|
||||
}else {
|
||||
mesOutorderDetailMiddle.setPlanInQuantity(quantity);
|
||||
quantity = BigDecimal.ZERO;
|
||||
}
|
||||
mesOutorderDetailMiddleList.add(mesOutorderDetailMiddle);
|
||||
}
|
||||
mesOutorderMiddleVo.setMesOutorderMiddle(mesOutorderMiddle);
|
||||
mesOutorderMiddleVo.setMesOutorderDetailMiddleList(mesOutorderDetailMiddleList);
|
||||
return insertMesOutorder(mesOutorderMiddleVo, "2");
|
||||
}
|
||||
}
|
||||
|
||||
@@ -472,7 +472,7 @@ public class OutStockoutServiceImpl implements IOutStockoutService {
|
||||
|
||||
List<MesOutorderDetailMiddle> mesOutorderDetailMiddles = mesOutorderDetailMiddleMapper.selectMesOutorderDetailMiddleList(mesOutorderDetailMiddle2);
|
||||
//只要有=备注不为空,就循环主单下的整个子单
|
||||
|
||||
|
||||
// for(int i=0;i<mesOutorderDetailMiddles.size();i++){
|
||||
// lineNos[i]=mesOutorderDetailMiddles.get(i).getLineNo();
|
||||
// if(mesOutorderDetailMiddles.get(i).getRemark()==null || mesOutorderDetailMiddles.get(i).getRemark()==""){
|
||||
@@ -556,7 +556,7 @@ public class OutStockoutServiceImpl implements IOutStockoutService {
|
||||
mesOutorderMiddleVo.setMesOutorderDetailMiddleList(mesOutorderDetailMiddles);
|
||||
|
||||
|
||||
AjaxResult ajaxResult = mesOutorderMiddleService.insertMesOutorder(mesOutorderMiddleVo);
|
||||
AjaxResult ajaxResult = mesOutorderMiddleService.insertMesOutorder(mesOutorderMiddleVo,"1");
|
||||
OutStockout outStockout = new OutStockout();
|
||||
outStockout.setStockoutId(stockoutId);
|
||||
outStockout.setStatus("2");
|
||||
|
||||
@@ -44,12 +44,21 @@ public class ViewProductAndStock extends BaseEntity
|
||||
/** 库存数量 */
|
||||
@Excel(name = "库存数量")
|
||||
private BigDecimal quantity;
|
||||
private BigDecimal bhQuantity;
|
||||
|
||||
@Excel(name = "出库时间")
|
||||
private String printDate;
|
||||
|
||||
private String outType;
|
||||
|
||||
public BigDecimal getBhQuantity() {
|
||||
return bhQuantity;
|
||||
}
|
||||
|
||||
public void setBhQuantity(BigDecimal bhQuantity) {
|
||||
this.bhQuantity = bhQuantity;
|
||||
}
|
||||
|
||||
public String getPrintDate() {
|
||||
return printDate;
|
||||
}
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||
"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
||||
<mapper namespace="com.ruoyi.project.middle.mesOutorder.mapper.MesOutorderMiddleMapper">
|
||||
|
||||
|
||||
<resultMap type="MesOutorderMiddle" id="MesOutorderMiddleResult">
|
||||
<result property="id" column="id" />
|
||||
<result property="orderId" column="order_id" />
|
||||
@@ -16,10 +16,11 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||
<result property="saleName" column="sale_name" />
|
||||
<result property="status" column="status" />
|
||||
<result property="saleOrder" column="sale_order" />
|
||||
<result property="createType" column="create_type" />
|
||||
</resultMap>
|
||||
|
||||
<sql id="selectMesOutorderMiddleVo">
|
||||
select mom.id, order_id, constructor, operation_type, create_time, xf_time, order_type,sale_unit,status,sale_order,customer_name as sale_name from mes_outorder_middle mom
|
||||
select mom.id, order_id, constructor, operation_type, create_time, xf_time, order_type,sale_unit,status,sale_order,customer_name as sale_name,mom.create_type from mes_outorder_middle mom
|
||||
left join bas_customer bc on bc.customer_no = mom.sale_unit
|
||||
</sql>
|
||||
<sql id="selectMesOutorderMiddleVo1">
|
||||
@@ -28,7 +29,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||
</sql>
|
||||
<select id="selectMesOutorderMiddleList" parameterType="MesOutorderMiddle" resultMap="MesOutorderMiddleResult">
|
||||
<include refid="selectMesOutorderMiddleVo"/>
|
||||
<where>
|
||||
<where>
|
||||
<if test="orderId != null and orderId != ''"> and order_id = #{orderId}</if>
|
||||
<if test="constructor != null and constructor != ''"> and constructor = #{constructor}</if>
|
||||
<if test="operationType != null and operationType != ''"> and operation_type = #{operationType}</if>
|
||||
@@ -54,7 +55,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||
<if test="endDate != null and endDate != ''"> and create_time <= #{endDate}</if>
|
||||
</where>
|
||||
</select>
|
||||
|
||||
|
||||
<select id="selectMesOutorderMiddleById" parameterType="String" resultMap="MesOutorderMiddleResult">
|
||||
<include refid="selectMesOutorderMiddleVo"/>
|
||||
where id = #{id}
|
||||
@@ -64,7 +65,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||
<include refid="selectMesOutorderMiddleVo"/>
|
||||
where order_id = #{orderId}
|
||||
</select>
|
||||
|
||||
|
||||
<insert id="insertMesOutorderMiddle" parameterType="MesOutorderMiddle">
|
||||
insert into mes_outorder_middle
|
||||
<trim prefix="(" suffix=")" suffixOverrides=",">
|
||||
@@ -78,6 +79,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||
<if test="saleUnit != null">sale_unit,</if>
|
||||
<if test="status != null">status,</if>
|
||||
<if test="saleOrder != null">sale_order,</if>
|
||||
<if test="createType != null">create_type,</if>
|
||||
</trim>
|
||||
<trim prefix="values (" suffix=")" suffixOverrides=",">
|
||||
<if test="id != null">#{id},</if>
|
||||
@@ -90,6 +92,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||
<if test="saleUnit != null">#{saleUnit},</if>
|
||||
<if test="status != null">#{status},</if>
|
||||
<if test="saleOrder != null">#{saleOrder},</if>
|
||||
<if test="createType != null">#{createType},</if>
|
||||
</trim>
|
||||
</insert>
|
||||
|
||||
@@ -114,7 +117,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||
</delete>
|
||||
|
||||
<delete id="deleteMesOutorderMiddleByIds" parameterType="String">
|
||||
delete from mes_outorder_middle where id in
|
||||
delete from mes_outorder_middle where id in
|
||||
<foreach item="id" collection="array" open="(" separator="," close=")">
|
||||
#{id}
|
||||
</foreach>
|
||||
@@ -123,4 +126,4 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||
{call proc_updateMsedjStatus_out(
|
||||
#{orderId},#{status},#{newStatus},#{v_result,mode=OUT,jdbcType=VARCHAR},#{v_resultString,mode=OUT,jdbcType=VARCHAR})}
|
||||
</select>
|
||||
</mapper>
|
||||
</mapper>
|
||||
|
||||
@@ -66,6 +66,9 @@
|
||||
<a id="continue" class="btn btn-success" onclick="newReceiptAgain()" >
|
||||
<i class="fa fa-plus"></i> 继续建单
|
||||
</a>
|
||||
<a id="autoCreate" class="btn btn-info" onclick="openAutoCreateModal()" >
|
||||
<i class="fa fa-magic"></i> 自动建单
|
||||
</a>
|
||||
<a id="delete" class="btn btn-danger" onclick="deleteProduct()" >
|
||||
<i class="fa fa-plus"></i> 删除物资
|
||||
</a>
|
||||
@@ -482,6 +485,104 @@
|
||||
$.form.reset()
|
||||
}
|
||||
|
||||
// 自动建单弹窗
|
||||
function openAutoCreateModal() {
|
||||
var html = '<div style="padding: 20px;">' +
|
||||
'<form class="form-horizontal">' +
|
||||
'<div class="form-group">' +
|
||||
'<label class="col-sm-4 control-label is-required">物料牌号:</label>' +
|
||||
'<div class="col-sm-7">' +
|
||||
'<input type="text" id="auto_materialCode" class="form-control" placeholder="请输入物料牌号">' +
|
||||
'</div>' +
|
||||
'</div>' +
|
||||
'<div class="form-group">' +
|
||||
'<label class="col-sm-4 control-label">物料规格:</label>' +
|
||||
'<div class="col-sm-7">' +
|
||||
'<input type="text" id="auto_produceDate" class="form-control" placeholder="请输入物料规格">' +
|
||||
'</div>' +
|
||||
'</div>' +
|
||||
'<div class="form-group">' +
|
||||
'<label class="col-sm-4 control-label is-required">备货数量:</label>' +
|
||||
'<div class="col-sm-7">' +
|
||||
'<input type="number" id="auto_planInQuantity" class="form-control" placeholder="请输入备货数量">' +
|
||||
'</div>' +
|
||||
'</div>' +
|
||||
'</form>' +
|
||||
'</div>';
|
||||
|
||||
layer.open({
|
||||
type: 1,
|
||||
title: '自动建单',
|
||||
area: ['500px', '320px'],
|
||||
content: html,
|
||||
btn: ['确定', '取消'],
|
||||
yes: function (index, layero) {
|
||||
var materialCode = $("#auto_materialCode").val();
|
||||
var produceDate = $("#auto_produceDate").val();
|
||||
var planInQuantity = $("#auto_planInQuantity").val();
|
||||
|
||||
if ($.common.isEmpty(materialCode) || $.common.isEmpty(planInQuantity)) {
|
||||
$.modal.alertWarning("物料牌号和备货数量为必填项");
|
||||
return;
|
||||
}
|
||||
|
||||
if (planInQuantity <= 0) {
|
||||
$.modal.alertWarning("备货数量必须大于0");
|
||||
return;
|
||||
}
|
||||
|
||||
var loadIndex = layer.load(2);
|
||||
|
||||
// 组装参数,保持与 /mes/mesOutorder/addSave 的 mesOutorderMiddle 一致
|
||||
var params = new Object();
|
||||
var o = {};
|
||||
var a = $("#formId").serializeArray();
|
||||
$.each(a, function() {
|
||||
if (o[this.name]) {
|
||||
if (!o[this.name].push) {
|
||||
o[this.name] = [o[this.name]];
|
||||
}
|
||||
o[this.name].push(this.value || '');
|
||||
} else {
|
||||
o[this.name] = this.value || '';
|
||||
}
|
||||
});
|
||||
|
||||
// 将弹窗中的内容加入 viewProductAndStock
|
||||
var viewProductAndStock = {
|
||||
classgroupNumber: materialCode,
|
||||
inClassName: produceDate,
|
||||
bhQuantity: planInQuantity
|
||||
};
|
||||
|
||||
params.mesOutorderMiddle = o;
|
||||
params.viewProductAndStock = viewProductAndStock;
|
||||
|
||||
// 调用正式接口
|
||||
$.ajax({
|
||||
url: 'http://localhost:8090/mes/mesOutorder/addSaveAuto',
|
||||
type: 'post',
|
||||
contentType: 'application/json',
|
||||
data: JSON.stringify(params),
|
||||
dataType: 'json',
|
||||
success: function(result) {
|
||||
layer.close(loadIndex);
|
||||
if (result.code == web_status.SUCCESS) {
|
||||
layer.close(index);
|
||||
$.modal.msgSuccess("自动建单成功");
|
||||
} else {
|
||||
$.modal.alertError(result.msg || "接口调用失败");
|
||||
}
|
||||
},
|
||||
error: function(XMLHttpRequest, textStatus, error) {
|
||||
layer.close(loadIndex);
|
||||
$.modal.alertError("网络错误,设置失败");
|
||||
}
|
||||
});
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
//删除物资
|
||||
function deleteProduct() {
|
||||
//获取选中行的内容
|
||||
|
||||
@@ -927,6 +927,19 @@
|
||||
title: '销售单位',
|
||||
align: 'center'
|
||||
},
|
||||
{
|
||||
field: 'createType',
|
||||
title: '建单类型',
|
||||
align: 'center',
|
||||
formatter: function (value, row, index) {
|
||||
// return $.table.selectDictLabel(djstatus, value);
|
||||
if (value === "1") {
|
||||
return "人工建单"
|
||||
} else if (value == "2") {
|
||||
return "自动建单"
|
||||
}
|
||||
}
|
||||
},
|
||||
|
||||
{
|
||||
field: 'createTime',
|
||||
|
||||
Reference in New Issue
Block a user