|
|
|
@ -4,8 +4,13 @@ import java.math.BigDecimal;
|
|
|
|
|
import java.util.List;
|
|
|
|
|
|
|
|
|
|
import com.hw.common.core.constant.MesConstants;
|
|
|
|
|
import com.hw.common.core.exception.ServiceException;
|
|
|
|
|
import com.hw.common.core.utils.DateUtils;
|
|
|
|
|
import com.hw.common.security.utils.SecurityUtils;
|
|
|
|
|
import com.hw.mes.api.domain.MesBaseBarcodeInfo;
|
|
|
|
|
import com.hw.mes.domain.MesOrderBind;
|
|
|
|
|
import com.hw.mes.mapper.MesBaseBarcodeInfoMapper;
|
|
|
|
|
import com.hw.mes.mapper.MesOrderBindMapper;
|
|
|
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
|
|
|
import org.springframework.stereotype.Service;
|
|
|
|
|
import com.hw.mes.mapper.MesBaseMaterialInfoMapper;
|
|
|
|
@ -23,6 +28,12 @@ public class MesBaseMaterialInfoServiceImpl implements IMesBaseMaterialInfoServi
|
|
|
|
|
@Autowired
|
|
|
|
|
private MesBaseMaterialInfoMapper mesBaseMaterialInfoMapper;
|
|
|
|
|
|
|
|
|
|
@Autowired
|
|
|
|
|
private MesBaseBarcodeInfoMapper mesBaseBarcodeInfoMapper;
|
|
|
|
|
|
|
|
|
|
@Autowired
|
|
|
|
|
private MesOrderBindMapper mesOrderBindMapper;
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* 查询物料信息
|
|
|
|
|
*
|
|
|
|
@ -65,6 +76,21 @@ public class MesBaseMaterialInfoServiceImpl implements IMesBaseMaterialInfoServi
|
|
|
|
|
*/
|
|
|
|
|
@Override
|
|
|
|
|
public int updateMesBaseMaterialInfo(MesBaseMaterialInfo mesBaseMaterialInfo) {
|
|
|
|
|
// MesBaseBarcodeInfo queryBaseBarcodeInfo = new MesBaseBarcodeInfo();
|
|
|
|
|
// queryBaseBarcodeInfo.setMaterialId(mesBaseMaterialInfo.getMaterialId());
|
|
|
|
|
// int barcodeInfoCount = mesBaseBarcodeInfoMapper.selectMesBaseBarcodeInfoCount(queryBaseBarcodeInfo);
|
|
|
|
|
// if (barcodeInfoCount > 0) {
|
|
|
|
|
// throw new ServiceException("此物料已经有条码信息,不能修改");
|
|
|
|
|
// }
|
|
|
|
|
//
|
|
|
|
|
// MesOrderBind queryOrderBind = new MesOrderBind();
|
|
|
|
|
// queryOrderBind.setMaterialId(mesBaseMaterialInfo.getMaterialId());
|
|
|
|
|
// List<MesOrderBind> orderBinds = mesOrderBindMapper.selectMesOrderBindList(queryOrderBind);
|
|
|
|
|
// if (orderBinds != null && orderBinds.size() > 0) {
|
|
|
|
|
// throw new ServiceException("此物料已经有采购订单和销售订单绑定信息,不能修改");
|
|
|
|
|
// }
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
mesBaseMaterialInfo.setUpdateTime(DateUtils.getNowDate());
|
|
|
|
|
mesBaseMaterialInfo.setUpdateBy(SecurityUtils.getUsername());
|
|
|
|
|
if (!mesBaseMaterialInfo.getBatchFlag().equals(MesConstants.IS_BATCH)) {
|
|
|
|
|