jindie:修改配置
MES:物料条码增加safeflag字段;生产派工增加saleorder的保存,并且在派工时派工数量为0的不保存。
WMS:原材料入库逻辑修改(原材料库位库存按照物料条码库存(之前是批次码保存),原材料总库存根据销售订单保存)
master
xins 6 months ago
parent 0685544bcd
commit 8e4aa6f469

@ -26,6 +26,10 @@
<groupId>org.quartz-scheduler</groupId>
<artifactId>quartz</artifactId>
</dependency>
<dependency>
<groupId>com.hw</groupId>
<artifactId>hw-common-core</artifactId>
</dependency>
</dependencies>

@ -110,6 +110,8 @@ public class MesBaseBarcodeInfo extends BaseEntity
@Excel(name = "生产计划明细编号")
private String planDetailCode;
private String safeFlag;
/** 销售订单编号;适合生产出入库等 */
@Excel(name = "销售订单ID")
private Long saleOrderId;
@ -372,6 +374,14 @@ public class MesBaseBarcodeInfo extends BaseEntity
return planDetailCode;
}
public String getSafeFlag() {
return safeFlag;
}
public void setSafeFlag(String safeFlag) {
this.safeFlag = safeFlag;
}
public Long getSaleOrderId() {
return saleOrderId;
}

@ -16,6 +16,7 @@
<module>hw-api-printer</module>
<module>hw-api-dms</module>
<module>hw-api-job</module>
<module>hw-api-jindie</module>
</modules>
<artifactId>hw-api</artifactId>

@ -26,6 +26,16 @@ public class MesProductPlan extends BaseEntity
@Excel(name = "生产工单ID")
private Long productOrderId;
/**
* ID,mes_sale_orderorder_id;
*/
private Long saleOrderId;
/**
*
*/
private String saleorderCode;
/**
*
*/
@ -155,15 +165,7 @@ public class MesProductPlan extends BaseEntity
/** 工单已派工数量 */
private BigDecimal dispatchedAmount;
/**
* ID,mes_sale_orderorder_id;
*/
private Long saleOrderId;
/**
*
*/
private String saleorderCode;
public Long getSaleOrderId() {
return saleOrderId;
@ -255,6 +257,8 @@ public class MesProductPlan extends BaseEntity
{
return productOrderId;
}
public void setPlanCode(String planCode)
{
this.planCode = planCode;

@ -141,6 +141,7 @@ public class MesBaseBarcodeInfoServiceImpl implements IMesBaseBarcodeInfoService
toInsertedBarcodeInfo.setSaleOrderId(mesOrderBind.getSaleOrderId());
toInsertedBarcodeInfo.setSaleorderCode(mesOrderBind.getSaleOrderCode());
toInsertedBarcodeInfo.setSafeFlag(mesOrderBind.getSafeFlag());
if (mesBaseBarcodeInfo.getBatchFlag().equals(MesConstants.NOT_IS_BATCH)) {
toInsertedBarcodeInfo.setAmount(new BigDecimal(1));

@ -96,17 +96,21 @@ public class MesProductPlanServiceImpl implements IMesProductPlanService {
@Transactional
@Override
public int insertMesProductPlan(MesProductPlan mesProductPlan) {
mesProductPlan.setCreateBy(SecurityUtils.getUsername());
mesProductPlan.setCreateTime(DateUtils.getNowDate());
mesProductPlan.setPlanCode(Seq.getId(Seq.planCodeSeqType, Seq.planCodeCode));
int rows = mesProductPlanMapper.insertMesProductPlan(mesProductPlan);
//更新工单已派工数量
MesProductOrder mesProductOrder = new MesProductOrder();
mesProductOrder.setProductOrderId(mesProductPlan.getProductOrderId());
mesProductOrder.setDispatchAmount(mesProductPlan.getDispatchedAmount());
mesProductOrderService.updateMesProductOrder(mesProductOrder);
insertMesProductPlanDetail(mesProductPlan);
return rows;
if (mesProductPlan.getPlanAmount().compareTo(BigDecimal.ZERO) > 0) {
mesProductPlan.setCreateBy(SecurityUtils.getUsername());
mesProductPlan.setCreateTime(DateUtils.getNowDate());
mesProductPlan.setPlanCode(Seq.getId(Seq.planCodeSeqType, Seq.planCodeCode));
int rows = mesProductPlanMapper.insertMesProductPlan(mesProductPlan);
//更新工单已派工数量
MesProductOrder mesProductOrder = new MesProductOrder();
mesProductOrder.setProductOrderId(mesProductPlan.getProductOrderId());
mesProductOrder.setDispatchAmount(mesProductPlan.getDispatchedAmount());
mesProductOrderService.updateMesProductOrder(mesProductOrder);
// insertMesProductPlanDetail(mesProductPlan);
return rows;
}
return 0;
}
/**

@ -28,6 +28,7 @@
<result property="lastOutstockDate" column="last_outstock_date"/>
<result property="planCode" column="plan_code"/>
<result property="planDetailCode" column="plan_detail_code"/>
<result property="safeFlag" column="safe_flag"/>
<result property="saleOrderId" column="sale_order_id"/>
<result property="saleorderCode" column="saleorder_code"/>
<result property="projectNo" column="project_no"/>
@ -66,6 +67,7 @@
bbi.last_outstock_date,
bbi.plan_code,
bbi.plan_detail_code,
bbi.safe_flag,
bbi.sale_order_id,
bbi.saleorder_code,
bbi.project_no,
@ -148,6 +150,7 @@
<if test="lastOutstockDate != null">last_outstock_date,</if>
<if test="planCode != null">plan_code,</if>
<if test="planDetailCode != null">plan_detail_code,</if>
<if test="safeFlag != null">safe_flag,</if>
<if test="saleOrderId != null">sale_order_id,</if>
<if test="saleorderCode != null">saleorder_code,</if>
<if test="projectNo != null">project_no,</if>
@ -181,6 +184,7 @@
<if test="lastOutstockDate != null">#{lastOutstockDate},</if>
<if test="planCode != null">#{planCode},</if>
<if test="planDetailCode != null">#{planDetailCode},</if>
<if test="safeFlag != null">#{safeFlag},</if>
<if test="saleOrderId != null">#{saleOrderId},</if>
<if test="saleorderCode != null">#{saleorderCode},</if>
<if test="projectNo != null">#{projectNo},</if>

@ -7,7 +7,8 @@
<resultMap type="MesProductPlan" id="MesProductPlanResult">
<result property="planId" column="plan_id"/>
<result property="productOrderId" column="product_order_id"/>
<result property="orderCode" column="order_code"/>
<result property="saleOrderId" column="sale_order_id"/>
<result property="saleorderCode" column="saleorder_code"/>
<result property="planCode" column="plan_code"/>
<result property="dispatchCode" column="dispatch_code"/>
<result property="materialId" column="material_id"/>
@ -41,8 +42,8 @@
<result property="processName" column="process_name"/>
<result property="stationName" column="station_name"/>
<result property="sopId" column="sop_id"/>
<result property="saleOrderId" column="sale_order_id"/>
<result property="saleorderCode" column="saleorder_code"/>
<result property="orderCode" column="order_code"/>
</resultMap>
<resultMap id="MesProductPlanMesProductPlanDetailResult" type="MesProductPlan" extends="MesProductPlanResult">
@ -191,6 +192,8 @@
insert into mes_product_plan
<trim prefix="(" suffix=")" suffixOverrides=",">
<if test="productOrderId != null">product_order_id,</if>
<if test="saleOrderId != null and saleOrderId != ''">sale_order_id,</if>
<if test="saleorderCode != null and saleorderCode != ''">saleorder_code,</if>
<if test="planCode != null and planCode != ''">plan_code,</if>
<if test="dispatchCode != null and dispatchCode != ''">dispatch_code,</if>
<if test="materialId != null">material_id,</if>
@ -219,6 +222,8 @@
</trim>
<trim prefix="values (" suffix=")" suffixOverrides=",">
<if test="productOrderId != null">#{productOrderId},</if>
<if test="saleOrderId != null">#{saleOrderId},</if>
<if test="saleorderCode != null and saleorderCode != ''">#{saleorderCode},</if>
<if test="planCode != null and planCode != ''">#{planCode},</if>
<if test="dispatchCode != null and dispatchCode != ''">#{dispatchCode},</if>
<if test="materialId != null">#{materialId},</if>

@ -9,6 +9,7 @@ import com.hw.common.core.web.domain.AjaxResult;
import com.hw.common.core.web.page.TableDataInfo;
import com.hw.common.log.annotation.Log;
import com.hw.common.log.enums.BusinessType;
import com.hw.common.security.annotation.RequiresPermissions;
import com.hw.mes.api.RemoteMesService;
import com.hw.mes.api.domain.MesBaseBarcodeInfo;
import com.hw.wms.domain.*;
@ -91,9 +92,9 @@ public class WmsMobileController extends BaseController {
/**
*
*
*/
// @RequiresPermissions("wms:mobile:addrawinstock")
@RequiresPermissions("wms:mobile:addrawinstock")
@Log(title = "原材料入库记录", businessType = BusinessType.INSERT)
@PostMapping(("/addRawInstock"))
public AjaxResult addRawInstock(@Validated @RequestBody WmsRawInstockVo wmsRawInstockVo) {

@ -60,6 +60,10 @@ public class WmsRawStock extends BaseEntity
/**托盘码*/
private String palletInfoCode;
private Long saleOrderId;
private String safeFlag;
/** 入库时间 */
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
@Excel(name = "入库时间", width = 30, dateFormat = "yyyy-MM-dd HH:mm:ss")
@ -204,6 +208,22 @@ public class WmsRawStock extends BaseEntity
this.palletInfoCode = palletInfoCode;
}
public Long getSaleOrderId() {
return saleOrderId;
}
public void setSaleOrderId(Long saleOrderId) {
this.saleOrderId = saleOrderId;
}
public String getSafeFlag() {
return safeFlag;
}
public void setSafeFlag(String safeFlag) {
this.safeFlag = safeFlag;
}
public void setInstockDate(Date instockDate)
{
this.instockDate = instockDate;

@ -63,13 +63,11 @@ public interface WmsRawStockMapper {
/**
*
* @param locationCode
*
* @param instockBatch
* @return WmsRawStock
*/
public WmsRawStock selectRawStockByLocationAndBatch(@Param("locationCode") String locationCode,
@Param("instockBatch") String instockBatch);
public WmsRawStock selectRawStockByBarcode(@Param("instockBatch") String instockBatch);
/**
*

@ -533,7 +533,8 @@ public class WmsMoveServiceImpl implements IWmsMoveService {
public void moveOutUpdateRawStock(String locationCode, String batchCode, BigDecimal applyQty,
String userName, Date currentDate) {
WmsRawStock wmsRawStock = wmsRawStockMapper.selectRawStockByLocationAndBatch(locationCode, batchCode);
//TODO批次码
WmsRawStock wmsRawStock = wmsRawStockMapper.selectRawStockByBarcode(batchCode);
if (wmsRawStock == null) {
throw new ServiceException("原库位无库存信息,不能进行移库");
}
@ -688,7 +689,8 @@ public class WmsMoveServiceImpl implements IWmsMoveService {
BigDecimal applyQty, String userName, Date currentDate) {
String batchCode = mesBaseBarcodeInfo.getBatchCode();
String locationCode = location.getLocationCode();
WmsRawStock rawStock = wmsRawStockMapper.selectRawStockByLocationAndBatch(locationCode, batchCode);
//todo批次码
WmsRawStock rawStock = wmsRawStockMapper.selectRawStockByBarcode(batchCode);
if (rawStock != null) {
rawStock.setTotalAmount(rawStock.getTotalAmount().add(applyQty));
rawStock.setUpdateDate(currentDate);

@ -148,7 +148,6 @@ public class WmsRawInstockServiceImpl implements IWmsRawInstockService {
if (baseLocation == null) {
throw new ServiceException("库位编码有误");
}
//todo 可入物料wms_warehouse_material判断是否可以入此库位
BigDecimal instockAmount = wmsRawInstockVo.getInstockAmount();
if (baseBarcodeInfo.getBatchFlag().equals(MesConstants.IS_BATCH)) {
@ -204,7 +203,7 @@ public class WmsRawInstockServiceImpl implements IWmsRawInstockService {
*/
public void updateRawStock(WmsRawInstock wmsRawInstock, WmsRawInstockVo wmsRawInstockVo, WmsBaseLocation baseLocation
, MesBaseBarcodeInfo baseBarcodeInfo, String userName, Date currentDate) {
String instockBatch = baseBarcodeInfo.getBatchCode();
String barcode = baseBarcodeInfo.getBarcodeInfo();
String locationCode = wmsRawInstock.getLocationCode();
//判断此库位的数量限制,是否还能入库
@ -217,10 +216,14 @@ public class WmsRawInstockServiceImpl implements IWmsRawInstockService {
throw new ServiceException("已超出库位数量限制,请重新选择库位");
}
String batchFlag = baseBarcodeInfo.getBatchFlag();
//如果是同一库位入同一批次,则更新数量
WmsRawStock wmsRawStock = wmsRawStockMapper.selectRawStockByLocationAndBatch(locationCode, instockBatch);
WmsRawStock wmsRawStock = wmsRawStockMapper.selectRawStockByBarcode(barcode);
if (wmsRawStock != null) {
// wmsRawStock.setQualityStatus(wmsRawInstockVo.getQualityStatus());
if(!batchFlag.equals(MesConstants.IS_BATCH)){
throw new ServiceException("此物料条码已经入库");
}
wmsRawStock.setTotalAmount(wmsRawStock.getTotalAmount().add(wmsRawInstockVo.getInstockAmount()));
wmsRawStock.setUpdateBy(userName);
wmsRawStock.setUpdateDate(currentDate);
@ -231,11 +234,15 @@ public class WmsRawInstockServiceImpl implements IWmsRawInstockService {
wmsRawStock.setLocationCode(locationCode);
wmsRawStock.setStockType(WmsConstants.RWA_STOCK_STOCK_TYPE_RAW);
wmsRawStock.setMaterialId(baseBarcodeInfo.getMaterialId());
wmsRawStock.setInstockBatch(instockBatch);
wmsRawStock.setInstockBatch(barcode);
wmsRawStock.setWarehouseFloor(baseLocation.getWarehouseFloor());
// wmsRawStock.setLastOutstockTime(baseBarcodeInfo.getLastOutstockDate());
// wmsRawStock.setQualityStatus(wmsRawInstockVo.getQualityStatus());
wmsRawStock.setTotalAmount(wmsRawInstockVo.getInstockAmount());
wmsRawStock.setSaleOrderId(baseBarcodeInfo.getSaleOrderId());
wmsRawStock.setSafeFlag(baseBarcodeInfo.getSafeFlag());
wmsRawStock.setInstockDate(baseBarcodeInfo.getAcceptedDate());
wmsRawStock.setLastOutstockTime(baseBarcodeInfo.getLastOutstockDate());
wmsRawStock.setCreateBy(userName);
wmsRawStock.setCreateDate(currentDate);
wmsRawStockMapper.insertWmsRawStock(wmsRawStock);

@ -231,10 +231,11 @@ public class WmsRawOutstockServiceImpl implements IWmsRawOutstockService {
throw new ServiceException("请输入审核意见");
}
wmsRawOutstocks.forEach(wmsRawOutstock -> {
//todo:批次码
String locationCode = wmsRawOutstock.getLocationCode();
String instockBatch = wmsRawOutstock.getMaterialBatch();
BigDecimal planAmount = wmsRawOutstock.getOutstockAmount();
WmsRawStock wmsRawStock = wmsRawStockMapper.selectRawStockByLocationAndBatch(locationCode, instockBatch);
WmsRawStock wmsRawStock = wmsRawStockMapper.selectRawStockByBarcode(instockBatch);
if (wmsRawStock != null) {
BigDecimal occupyAmount = wmsRawStock.getOccupyAmount() == null ?
BigDecimal.ZERO : wmsRawStock.getOccupyAmount();
@ -396,7 +397,8 @@ public class WmsRawOutstockServiceImpl implements IWmsRawOutstockService {
public void updateRawStock(String locationCode, String batchCode, BigDecimal outstockAmount, String userName, Date currentDate) {
//更新原材料库存占用数量和总数量
WmsRawStock wmsRawStock = wmsRawStockMapper.selectRawStockByLocationAndBatch(locationCode, batchCode);
//todo 批次码
WmsRawStock wmsRawStock = wmsRawStockMapper.selectRawStockByBarcode(batchCode);
if (wmsRawStock == null) {
throw new ServiceException("没找到库存信息");
} else {
@ -464,7 +466,7 @@ public class WmsRawOutstockServiceImpl implements IWmsRawOutstockService {
/**
*
*
*
* wms_raw_outstock_detail
* @param wmsRawOutstock
* @return
*/
@ -1059,7 +1061,8 @@ public class WmsRawOutstockServiceImpl implements IWmsRawOutstockService {
public void directOutstockUpdateRawStock(String locationCode, String batchCode, BigDecimal outstockAmount,
String userName, Date currentDate) {
WmsRawStock wmsRawStock = wmsRawStockMapper.selectRawStockByLocationAndBatch(locationCode, batchCode);
//TODO:批次码
WmsRawStock wmsRawStock = wmsRawStockMapper.selectRawStockByBarcode(batchCode);
if (wmsRawStock == null) {
throw new ServiceException("没找到库存信息");
} else {

@ -377,7 +377,8 @@ public class WmsRawReturnServiceImpl implements IWmsRawReturnService {
String locationCode = wmsRawReturnConfirmVo.getLocationCode();
String instockBatch = mesBaseBarcodeInfo.getBatchCode();
WmsRawStock wmsRawStock = wmsRawStockMapper.selectRawStockByLocationAndBatch(locationCode, instockBatch);
//todo 批次码
WmsRawStock wmsRawStock = wmsRawStockMapper.selectRawStockByBarcode(instockBatch);
if (wmsRawStock == null) {
WmsBaseWarehouse warehouse = wmsBaseWarehouseMapper.selectWmsBaseWarehouseByWarehouseId(baseLocation.getWarehouseId());
wmsRawStock = new WmsRawStock();

@ -16,12 +16,12 @@ spring:
# 服务注册地址
server-addr: 175.27.215.92:8848
namespace: jyhb-test
group: xins
group: xins1
config:
# 配置中心地址
server-addr: 175.27.215.92:8848
namespace: jyhb-test
group: xins
group: xins1
# 配置文件格式
file-extension: yml
# 共享配置

@ -98,6 +98,8 @@
<if test="stockType != null and stockType != ''">stock_type,</if>
<if test="materialId != null">material_id,</if>
<if test="instockBatch != null and instockBatch != ''">instock_batch,</if>
<if test="saleOrderId != null">sale_order_id,</if>
<if test="safeFlag != null and safeFlag != ''">safe_flag,</if>
<if test="instockDate != null">instock_date,</if>
<if test="lastOutstockTime != null">last_outstock_time,</if>
<if test="qualityStatus != null and qualityStatus != ''">quality_status,</if>
@ -119,6 +121,8 @@
<if test="stockType != null and stockType != ''">#{stockType},</if>
<if test="materialId != null">#{materialId},</if>
<if test="instockBatch != null and instockBatch != ''">#{instockBatch},</if>
<if test="saleOrderId != null">#{saleOrderId},</if>
<if test="safeFlag != null and safeFlag != ''">#{safeFlag},</if>
<if test="instockDate != null">#{instockDate},</if>
<if test="lastOutstockTime != null">#{lastOutstockTime},</if>
<if test="qualityStatus != null and qualityStatus != ''">#{qualityStatus},</if>
@ -174,9 +178,9 @@
</delete>
<select id="selectRawStockByLocationAndBatch" resultMap="WmsRawStockResult">
<select id="selectRawStockByBarcode" resultMap="WmsRawStockResult">
<include refid="selectWmsRawStockVo"/>
where location_code = #{locationCode} and instock_batch = #{instockBatch}
where instock_batch = #{instockBatch}
</select>
<select id="getRawStockTotalAmount" resultType="BigDecimal" parameterType="WmsRawStock">

@ -794,7 +794,7 @@ export default {
this.$set(this.internalForm,"productionDate",response.data.productionDate);
this.$set(this.internalForm,"saleOrderId",response.data.saleOrderId);
this.$set(this.internalForm,"saleorderCode",response.data.saleorderCode);
alert(response.data.saleorderCode)
});

@ -561,6 +561,8 @@ export default {
obj.materialId = this.form.materialId;
obj.materialBomId = this.form.materialBomId;
obj.productOrderId = this.form.productOrderId;
obj.saleOrderId = this.form.saleOrderId;
obj.saleorderCode = this.form.saleorderCode;
// ID
if (lastProcessId == null) {
obj.lastProcessId = 0;

Loading…
Cancel
Save