rev:优化修改
This commit is contained in:
@@ -1,6 +1,7 @@
|
||||
package org.nl.wms.basedata_manage.controller;
|
||||
|
||||
|
||||
import com.alibaba.fastjson.JSONObject;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.nl.common.base.TableDataInfo;
|
||||
@@ -61,4 +62,10 @@ public class DeviceInfoController {
|
||||
return new ResponseEntity<>(HttpStatus.OK);
|
||||
}
|
||||
|
||||
@PostMapping("/getDevice")
|
||||
@Log("查询设备")
|
||||
public ResponseEntity<Object> getDevice(@RequestBody JSONObject jsonObject) {
|
||||
return new ResponseEntity<>(iEmBiDeviceinfoService.getDevice(jsonObject),HttpStatus.OK);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
package org.nl.wms.basedata_manage.controller;
|
||||
|
||||
|
||||
import cn.dev33.satoken.annotation.SaIgnore;
|
||||
import com.alibaba.fastjson.JSONObject;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
@@ -13,8 +14,10 @@ import org.springframework.http.HttpStatus;
|
||||
import org.springframework.http.ResponseEntity;
|
||||
import org.springframework.validation.annotation.Validated;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
import org.springframework.web.multipart.MultipartFile;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
import javax.servlet.http.HttpServletRequest;
|
||||
import java.util.Map;
|
||||
import java.util.Set;
|
||||
|
||||
@@ -101,4 +104,11 @@ public class GroupController {
|
||||
iMdPbGroupplateService.printDelete(dto);
|
||||
return new ResponseEntity<>(HttpStatus.OK);
|
||||
}
|
||||
|
||||
@PostMapping("/importExcel")
|
||||
@Log("导入数据")
|
||||
@SaIgnore
|
||||
public ResponseEntity<Object> importExcel(@RequestParam("file") MultipartFile file, HttpServletRequest request) {
|
||||
return new ResponseEntity<>(iMdPbGroupplateService.importExcel(file, request),HttpStatus.OK);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,10 +1,12 @@
|
||||
package org.nl.wms.basedata_manage.service;
|
||||
|
||||
import com.alibaba.fastjson.JSONObject;
|
||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||
import com.baomidou.mybatisplus.extension.service.IService;
|
||||
import org.nl.common.domain.query.PageQuery;
|
||||
import org.nl.wms.basedata_manage.service.dao.EmBiDeviceinfo;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.Set;
|
||||
|
||||
@@ -44,4 +46,10 @@ public interface IEmBiDeviceinfoService extends IService<EmBiDeviceinfo> {
|
||||
*/
|
||||
void delete(Set<String> ids);
|
||||
|
||||
/**
|
||||
* 查询设备
|
||||
* @param jsonObject {}
|
||||
* @return List<EmBiDeviceinfo>
|
||||
*/
|
||||
List<EmBiDeviceinfo> getDevice(JSONObject jsonObject);
|
||||
}
|
||||
|
||||
@@ -38,6 +38,12 @@ public interface IMdCsSupplierbaseService extends IService<MdCsSupplierbase> {
|
||||
*/
|
||||
void update(MdCsSupplierbase dto);
|
||||
|
||||
/**
|
||||
* 根据编码获取供应商
|
||||
* @param supp_code 供应商编码
|
||||
*/
|
||||
MdCsSupplierbase getByCode(String supp_code);
|
||||
|
||||
/**
|
||||
* 删除供应商
|
||||
* @param ids 供应商标识集合
|
||||
|
||||
@@ -44,7 +44,7 @@ public interface MdPbStoragevehicleextMapper extends BaseMapper<MdPbStoragevehic
|
||||
* @param material_id
|
||||
* @return
|
||||
*/
|
||||
BigDecimal queryCanuseSum(@Param("pcsn") String pcsn, @Param("material_id") String material_id, @Param("sect_code") String sect_code);
|
||||
BigDecimal queryCanuseSum(@Param("pcsn") String pcsn, @Param("material_id") String material_id, @Param("sect_code") String sect_code, @Param("device_code") String device_code);
|
||||
|
||||
/**
|
||||
* 分页查询
|
||||
@@ -71,7 +71,7 @@ public interface MdPbStoragevehicleextMapper extends BaseMapper<MdPbStoragevehic
|
||||
* @param material_id
|
||||
* @return
|
||||
*/
|
||||
List<MdPbStoragevehicleextDto> queryOutAllocation(@Param("pcsn") String pcsn,@Param("material_id") String material_id,@Param("sect_code") String sect_code);
|
||||
List<MdPbStoragevehicleextDto> queryOutAllocation(@Param("pcsn") String pcsn,@Param("material_id") String material_id,@Param("sect_code") String sect_code, @Param("device_code") String device_code);
|
||||
|
||||
/**
|
||||
* 手持出库确认查询明细
|
||||
|
||||
@@ -183,11 +183,15 @@
|
||||
SUM(canuse_qty)
|
||||
FROM
|
||||
md_pb_storagevehicleext ex
|
||||
LEFT JOIN st_ivt_structattr st on ex.storagevehicle_code = st.storagevehicle_code
|
||||
INNER JOIN md_pb_groupplate late on late.material_id = ex.material_id and late.storagevehicle_code = ex.storagevehicle_code
|
||||
AND ex.pcsn = late.pcsn
|
||||
INNER JOIN st_ivt_structattr st on ex.storagevehicle_code = st.storagevehicle_code
|
||||
<where>
|
||||
ex.material_id = #{material_id}
|
||||
AND
|
||||
st.lock_type = 0
|
||||
AND
|
||||
late.status = '2'
|
||||
<if test="pcsn!= null and pcsn!= ''">
|
||||
AND
|
||||
ex.pcsn = #{pcsn}
|
||||
@@ -197,6 +201,11 @@
|
||||
AND
|
||||
st.sect_id = #{sect_code}
|
||||
</if>
|
||||
|
||||
<if test="device_code!= null and device_code!= ''">
|
||||
AND
|
||||
late.device_code = #{device_code}
|
||||
</if>
|
||||
</where>
|
||||
</select>
|
||||
|
||||
@@ -229,6 +238,10 @@
|
||||
AND
|
||||
st.sect_id = #{sect_code}
|
||||
</if>
|
||||
<if test="device_code!= null and device_code!= ''">
|
||||
AND
|
||||
late.device_code = #{device_code}
|
||||
</if>
|
||||
</where>
|
||||
ORDER BY quality_day,ex.insert_time,ex.canuse_qty
|
||||
</select>
|
||||
@@ -322,13 +335,16 @@
|
||||
attr.struct_code,
|
||||
attr.struct_name,
|
||||
mater.material_code,
|
||||
mater.material_name
|
||||
mater.material_name,
|
||||
late.device_code
|
||||
FROM
|
||||
md_pb_storagevehicleext ext
|
||||
INNER JOIN st_ivt_structattr attr ON ext.storagevehicle_code = attr.storagevehicle_code
|
||||
INNER JOIN md_me_materialbase mater ON mater.material_id = ext.material_id
|
||||
INNER JOIN md_pb_groupplate late ON ext.storagevehicle_code = late.storagevehicle_code
|
||||
AND late.material_id = ext.material_id AND late.pcsn = ext.pcsn
|
||||
<where>
|
||||
1 = 1
|
||||
late.status = '2'
|
||||
<if test="params.stor_id != null and params.stor_id != ''">
|
||||
AND
|
||||
attr.stor_id = #{params.stor_id}
|
||||
@@ -353,6 +369,11 @@
|
||||
AND
|
||||
ext.pcsn LIKE #{params.pcsn}
|
||||
</if>
|
||||
|
||||
<if test="params.device_code != null and params.device_code != ''">
|
||||
AND
|
||||
late.device_code = #{params.device_code}
|
||||
</if>
|
||||
</where>
|
||||
ORDER BY ext.insert_time
|
||||
</select>
|
||||
|
||||
@@ -45,4 +45,9 @@ public class MdPbStoragevehicleextDto extends MdPbStoragevehicleext{
|
||||
*/
|
||||
private String material_name;
|
||||
|
||||
/**
|
||||
* 机台拜纳姆
|
||||
*/
|
||||
private String device_code;
|
||||
|
||||
}
|
||||
|
||||
@@ -3,6 +3,7 @@ package org.nl.wms.basedata_manage.service.impl;
|
||||
import cn.hutool.core.date.DateUtil;
|
||||
import cn.hutool.core.map.MapUtil;
|
||||
import cn.hutool.core.util.ObjectUtil;
|
||||
import com.alibaba.fastjson.JSONObject;
|
||||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||
@@ -16,9 +17,11 @@ import org.nl.wms.basedata_manage.enums.BaseDataEnum;
|
||||
import org.nl.wms.basedata_manage.service.IEmBiDeviceinfoService;
|
||||
import org.nl.wms.basedata_manage.service.dao.EmBiDeviceinfo;
|
||||
import org.nl.wms.basedata_manage.service.dao.mapper.EmBiDeviceinfoMapper;
|
||||
import org.nl.wms.warehouse_management.enums.IOSConstant;
|
||||
import org.springframework.stereotype.Service;
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.Set;
|
||||
|
||||
@@ -93,4 +96,15 @@ public class EmBiDeviceinfoServiceImpl extends ServiceImpl<EmBiDeviceinfoMapper,
|
||||
public void delete(Set<String> ids) {
|
||||
this.baseMapper.deleteBatchIds(ids);
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<EmBiDeviceinfo> getDevice(JSONObject jsonObject) {
|
||||
String device_code = jsonObject.getString("device_code");
|
||||
return this.baseMapper.selectList(
|
||||
new QueryWrapper<EmBiDeviceinfo>().lambda()
|
||||
.eq(EmBiDeviceinfo::getIs_delete, IOSConstant.ZERO)
|
||||
.eq(EmBiDeviceinfo::getIs_used, IOSConstant.ONE)
|
||||
.eq(ObjectUtil.isNotEmpty(device_code), EmBiDeviceinfo::getDevice_code, device_code)
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -16,6 +16,8 @@ import org.nl.wms.basedata_manage.enums.BaseDataEnum;
|
||||
import org.nl.wms.basedata_manage.service.IMdCsSupplierbaseService;
|
||||
import org.nl.wms.basedata_manage.service.dao.MdCsSupplierbase;
|
||||
import org.nl.wms.basedata_manage.service.dao.mapper.MdCsSupplierbaseMapper;
|
||||
import org.nl.wms.warehouse_management.enums.IOSConstant;
|
||||
import org.nl.wms.warehouse_management.enums.IOSEnum;
|
||||
import org.springframework.stereotype.Service;
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
|
||||
@@ -88,6 +90,21 @@ public class MdCsSupplierbaseServiceImpl extends ServiceImpl<MdCsSupplierbaseMap
|
||||
this.updateById(dto);
|
||||
}
|
||||
|
||||
@Override
|
||||
public MdCsSupplierbase getByCode(String supp_code) {
|
||||
MdCsSupplierbase mdCsSupplierbase = this.baseMapper.selectOne(
|
||||
new QueryWrapper<MdCsSupplierbase>().lambda()
|
||||
.eq(MdCsSupplierbase::getSupp_code, supp_code)
|
||||
.eq(MdCsSupplierbase::getIs_delete, IOSConstant.ZERO)
|
||||
.eq(MdCsSupplierbase::getIs_used, IOSConstant.ONE)
|
||||
);
|
||||
|
||||
if (ObjectUtil.isEmpty(mdCsSupplierbase)) {
|
||||
throw new BadRequestException("供应商编码为【"+supp_code+"】不存在!");
|
||||
}
|
||||
return mdCsSupplierbase;
|
||||
}
|
||||
|
||||
@Override
|
||||
@Transactional
|
||||
public void delete(Set<String> ids) {
|
||||
|
||||
@@ -205,6 +205,9 @@ public class SectattrServiceImpl extends ServiceImpl<SectattrMapper, Sectattr> i
|
||||
IOSEnum.SECT_CODE.code("待检区"),IOSEnum.SECT_CODE.code("大料箱区"),
|
||||
IOSEnum.SECT_CODE.code("不合格区")
|
||||
)
|
||||
.in(bill_type.equals(IOSEnum.OUT_BILL_TYPE.code("质检出库")),Sectattr::getSect_code,
|
||||
IOSEnum.SECT_CODE.code("待检区"),IOSEnum.SECT_CODE.code("大料箱区")
|
||||
)
|
||||
);
|
||||
|
||||
if (!sectattrList.isEmpty()) {
|
||||
|
||||
@@ -53,4 +53,11 @@ public class PdaInGroupBoxController {
|
||||
return new ResponseEntity<>(pdaInGroupBoxService.queryPcsn(), HttpStatus.OK);
|
||||
}
|
||||
|
||||
@PostMapping("/queryDevice")
|
||||
@Log("入库组盘查设备编码下拉框")
|
||||
@SaIgnore
|
||||
public ResponseEntity<Object> queryDevice() {
|
||||
return new ResponseEntity<>(pdaInGroupBoxService.queryDevice(), HttpStatus.OK);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -53,4 +53,10 @@ public interface PdaInGroupBoxService {
|
||||
* @return PdaResponse
|
||||
*/
|
||||
PdaResponse queryPcsn();
|
||||
|
||||
/**
|
||||
* 入库组盘查设备编码下拉框
|
||||
* @return PdaResponse
|
||||
*/
|
||||
PdaResponse queryDevice();
|
||||
}
|
||||
|
||||
@@ -6,7 +6,9 @@ import com.alibaba.fastjson.JSON;
|
||||
import com.alibaba.fastjson.JSONObject;
|
||||
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||
import org.nl.common.exception.BadRequestException;
|
||||
import org.nl.wms.basedata_manage.service.IEmBiDeviceinfoService;
|
||||
import org.nl.wms.basedata_manage.service.IMdMeMaterialbaseService;
|
||||
import org.nl.wms.basedata_manage.service.dao.EmBiDeviceinfo;
|
||||
import org.nl.wms.basedata_manage.service.dao.MdMeMaterialbase;
|
||||
import org.nl.wms.pda.general_management.service.PdaInGroupBoxService;
|
||||
import org.nl.wms.pda.util.PdaResponse;
|
||||
@@ -52,6 +54,12 @@ public class PdaInGroupBoxServiceImpl implements PdaInGroupBoxService {
|
||||
@Autowired
|
||||
private IMdMeMaterialbaseService iMdMeMaterialbaseService;
|
||||
|
||||
/**
|
||||
* 设备服务
|
||||
*/
|
||||
@Autowired
|
||||
private IEmBiDeviceinfoService iEmBiDeviceinfoService;
|
||||
|
||||
@Override
|
||||
public PdaResponse confirmBox(JSONObject whereJson) {
|
||||
GroupPlate groupPlate = JSONObject.parseObject(JSON.toJSONString(whereJson), GroupPlate.class);
|
||||
@@ -134,4 +142,20 @@ public class PdaInGroupBoxServiceImpl implements PdaInGroupBoxService {
|
||||
|
||||
return PdaResponse.requestParamOk(resultList);
|
||||
}
|
||||
|
||||
@Override
|
||||
public PdaResponse queryDevice() {
|
||||
JSONObject jsonObject = new JSONObject();
|
||||
|
||||
List<EmBiDeviceinfo> deviceList = iEmBiDeviceinfoService.getDevice(jsonObject);
|
||||
|
||||
List<JSONObject> resultList = new ArrayList<>();
|
||||
deviceList.forEach(row -> {
|
||||
JSONObject json = new JSONObject();
|
||||
json.put("text", row.getDevice_code());
|
||||
json.put("value", row.getDevice_code());
|
||||
resultList.add(json);
|
||||
});
|
||||
return PdaResponse.requestParamOk(resultList);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -124,5 +124,5 @@ public class IOSConstant {
|
||||
/**
|
||||
* 物料id:焊丝(盘状)
|
||||
*/
|
||||
public final static String MATERIAL_HS_PZ = "19456870186461192161";
|
||||
public final static String MATERIAL_HS_PZ = "1999384605630795776";
|
||||
}
|
||||
|
||||
@@ -7,7 +7,10 @@ import org.nl.common.domain.query.PageQuery;
|
||||
import org.nl.wms.basedata_manage.service.dao.MdCsSupplierbase;
|
||||
import org.nl.wms.basedata_manage.service.dao.MdMeMaterialbase;
|
||||
import org.nl.wms.warehouse_management.service.dao.GroupPlate;
|
||||
import org.springframework.web.multipart.MultipartFile;
|
||||
|
||||
import javax.servlet.http.HttpServletRequest;
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.Set;
|
||||
@@ -93,4 +96,11 @@ public interface IMdPbGroupplateService extends IService<GroupPlate> {
|
||||
*/
|
||||
void printDelete(GroupPlate dto);
|
||||
|
||||
/**
|
||||
* 导入excel
|
||||
* @param file : 文件
|
||||
* @param request post请求
|
||||
* @return ArrayList<JSONObject>
|
||||
*/
|
||||
ArrayList<JSONObject> importExcel(MultipartFile file, HttpServletRequest request);
|
||||
}
|
||||
|
||||
@@ -129,4 +129,9 @@ public class GroupPlate implements Serializable {
|
||||
* 打印标签后是否删除
|
||||
*/
|
||||
private String is_need_delete;
|
||||
|
||||
/**
|
||||
* 机台编码
|
||||
*/
|
||||
private String device_code;
|
||||
}
|
||||
|
||||
@@ -3,6 +3,8 @@ package org.nl.wms.warehouse_management.service.impl;
|
||||
import cn.hutool.core.date.DateTime;
|
||||
import cn.hutool.core.date.DateUtil;
|
||||
import cn.hutool.core.util.ObjectUtil;
|
||||
import cn.hutool.poi.excel.ExcelReader;
|
||||
import cn.hutool.poi.excel.ExcelUtil;
|
||||
import com.alibaba.fastjson.JSONObject;
|
||||
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||
@@ -30,11 +32,13 @@ import org.nl.wms.warehouse_management.service.dto.GroupPlateDto;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
import org.springframework.web.multipart.MultipartFile;
|
||||
|
||||
import java.util.HashSet;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.Set;
|
||||
import javax.servlet.http.HttpServletRequest;
|
||||
import java.io.InputStream;
|
||||
import java.math.BigDecimal;
|
||||
import java.util.*;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
@@ -173,4 +177,62 @@ public class MdPbGroupplateServiceImpl extends ServiceImpl<MdPbGroupplateMapper,
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
@Transactional(rollbackFor = Exception.class)
|
||||
public ArrayList<JSONObject> importExcel(MultipartFile file, HttpServletRequest request) {
|
||||
// 1.获取上传文件输入流
|
||||
InputStream inputStream = null;
|
||||
|
||||
try {
|
||||
inputStream = file.getInputStream();
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
ExcelReader excelReader = ExcelUtil.getReader(inputStream);
|
||||
List<List<Object>> read = excelReader.read(0, excelReader.getRowCount());
|
||||
|
||||
for (int i = 0; i < read.size(); i++) {
|
||||
List list = read.get(i);
|
||||
// 载具编码
|
||||
String storagevehicle_code = list.get(0).toString();
|
||||
// 物料编码
|
||||
String material_code = list.get(1).toString();
|
||||
// 批次
|
||||
String pcsn = list.get(2).toString();
|
||||
// 组盘数量
|
||||
String qty = list.get(3).toString();
|
||||
// 备注
|
||||
String remark = list.get(4).toString();
|
||||
// 供应商编码
|
||||
String supp_code = list.get(5).toString();
|
||||
// 生产日期
|
||||
String produce_time = list.get(6).toString();
|
||||
// 烘干次数
|
||||
String bake_num = list.get(7).toString();
|
||||
// 品质类型
|
||||
String quality_type = list.get(8).toString();
|
||||
// 料箱类型
|
||||
String box_type = list.get(9).toString();
|
||||
// 机台编码
|
||||
String device_code = list.get(10).toString();
|
||||
|
||||
GroupPlate groupPlate = new GroupPlate();
|
||||
groupPlate.setStoragevehicle_code(storagevehicle_code);
|
||||
MdMeMaterialbase materDao = iMdMeMaterialbaseService.getByCode(material_code);
|
||||
groupPlate.setMaterial_id(materDao.getMaterial_id());
|
||||
groupPlate.setPcsn(pcsn);
|
||||
groupPlate.setQty(BigDecimal.valueOf(Double.parseDouble(qty)));
|
||||
groupPlate.setRemark(remark);
|
||||
MdCsSupplierbase suppDao = iMdCsSupplierbaseService.getByCode(supp_code);
|
||||
groupPlate.setSupp_code(suppDao.getSupp_code());
|
||||
groupPlate.setProduce_time(produce_time);
|
||||
groupPlate.setBake_num(Integer.parseInt(bake_num));
|
||||
groupPlate.setQuality_type(quality_type);
|
||||
groupPlate.setBox_type(box_type);
|
||||
groupPlate.setDevice_code(device_code);
|
||||
this.create(groupPlate);
|
||||
}
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -21,9 +21,11 @@ import org.nl.common.utils.SecurityUtils;
|
||||
import org.nl.config.IdUtil;
|
||||
import org.nl.wms.basedata_manage.enums.BaseDataEnum;
|
||||
import org.nl.wms.basedata_manage.service.IBsrealStorattrService;
|
||||
import org.nl.wms.basedata_manage.service.IMdMeMaterialbaseService;
|
||||
import org.nl.wms.basedata_manage.service.IMdPbStoragevehicleextService;
|
||||
import org.nl.wms.basedata_manage.service.IStructattrService;
|
||||
import org.nl.wms.basedata_manage.service.dao.BsrealStorattr;
|
||||
import org.nl.wms.basedata_manage.service.dao.MdMeMaterialbase;
|
||||
import org.nl.wms.basedata_manage.service.dao.Structattr;
|
||||
import org.nl.wms.basedata_manage.service.dao.mapper.MdPbStoragevehicleextMapper;
|
||||
import org.nl.wms.basedata_manage.service.dto.MdPbStoragevehicleextDto;
|
||||
@@ -158,6 +160,12 @@ public class OutBillServiceImpl extends ServiceImpl<IOStorInvMapper, IOStorInv>
|
||||
@Resource
|
||||
private IPdmBomCallMaterialDtlService iPdmBomCallMaterialDtlService;
|
||||
|
||||
/**
|
||||
* 物料服务
|
||||
*/
|
||||
@Autowired
|
||||
private IMdMeMaterialbaseService iMdMeMaterialbaseService;
|
||||
|
||||
@Override
|
||||
public IPage<IOStorInv> pageQuery(Map whereJson, PageQuery page, String[] stor_id, String[] bill_status, String[] bill_type) {
|
||||
HashMap<String, String> map = new HashMap<>(whereJson);
|
||||
@@ -437,7 +445,19 @@ public class OutBillServiceImpl extends ServiceImpl<IOStorInvMapper, IOStorInv>
|
||||
sect_code = IOSConstant.SECT_CODE_HG;
|
||||
}
|
||||
|
||||
BigDecimal canuseSum = mdPbStoragevehicleextMapper.queryCanuseSum(pcsn, material_id, sect_code);
|
||||
String device_code = "";
|
||||
if (ObjectUtil.isNotEmpty(dtl.getSource_billdtl_id())) {
|
||||
if (ioStorInv.getBill_type().equals(IOSEnum.OUT_BILL_TYPE.code("领料出库"))
|
||||
|| ioStorInv.getBill_type().equals(IOSEnum.OUT_BILL_TYPE.code("烘干出库"))
|
||||
) {
|
||||
// 查询工单信息
|
||||
PdmBomCallMaterial callDao = iPdmBomCallMaterialService.getById(dtl.getSource_billdtl_id());
|
||||
if (ObjectUtil.isNotEmpty(callDao)) {
|
||||
device_code = callDao.getDevice_code();
|
||||
}
|
||||
}
|
||||
}
|
||||
BigDecimal canuseSum = mdPbStoragevehicleextMapper.queryCanuseSum(pcsn, material_id, sect_code, device_code);
|
||||
|
||||
if (ObjectUtil.isEmpty(canuseSum) || canuseSum.doubleValue() < unassign_qty) {
|
||||
throw new BadRequestException("物料编号:" + dtl.getMaterial_code() + "出库分配数量不满足");
|
||||
@@ -451,7 +471,7 @@ public class OutBillServiceImpl extends ServiceImpl<IOStorInvMapper, IOStorInv>
|
||||
*/
|
||||
|
||||
//出库分配查询货位信息
|
||||
List<MdPbStoragevehicleextDto> outAllocationList = mdPbStoragevehicleextMapper.queryOutAllocation(pcsn, material_id, sect_code);
|
||||
List<MdPbStoragevehicleextDto> outAllocationList = mdPbStoragevehicleextMapper.queryOutAllocation(pcsn, material_id, sect_code, device_code);
|
||||
|
||||
int seq_no = 1;
|
||||
double allocation_canuse_qty = 0;
|
||||
@@ -465,7 +485,8 @@ public class OutBillServiceImpl extends ServiceImpl<IOStorInvMapper, IOStorInv>
|
||||
// 判断是否领料出库
|
||||
if (ioStorInv.getBill_type().equals(IOSEnum.OUT_BILL_TYPE.code("领料出库"))) {
|
||||
// 判断是否是盘丝(焊状)
|
||||
if (!dtl.getMaterial_id().equals(IOSConstant.MATERIAL_HS_PZ)) {
|
||||
MdMeMaterialbase materDao = iMdMeMaterialbaseService.getById(dtl.getMaterial_id());
|
||||
if (!materDao.getMaterial_type_id().equals(IOSConstant.MATERIAL_HS_PZ)) {
|
||||
ioStorInvDis.setIs_check(IOSConstant.ONE);
|
||||
ioStorInvDis.setCheck_qty(outAllocation.getCanuse_qty());
|
||||
play_qty = NumberUtil.add(play_qty, unassign_qty);
|
||||
@@ -680,9 +701,22 @@ public class OutBillServiceImpl extends ServiceImpl<IOStorInvMapper, IOStorInv>
|
||||
if (ObjectUtil.isEmpty(sect_code)) {
|
||||
sect_code = IOSConstant.SECT_CODE_HG;
|
||||
}
|
||||
BigDecimal canuseSum = mdPbStoragevehicleextMapper.queryCanuseSum(pcsn, material_id, sect_code);
|
||||
|
||||
if (canuseSum.doubleValue() < unassign_qty) {
|
||||
String device_code = "";
|
||||
if (ObjectUtil.isNotEmpty(dtl.getSource_billdtl_id())) {
|
||||
if (ioStorInv.getBill_type().equals(IOSEnum.OUT_BILL_TYPE.code("领料出库"))
|
||||
|| ioStorInv.getBill_type().equals(IOSEnum.OUT_BILL_TYPE.code("烘干出库"))
|
||||
) {
|
||||
// 查询工单信息
|
||||
PdmBomCallMaterial callDao = iPdmBomCallMaterialService.getById(dtl.getSource_billdtl_id());
|
||||
if (ObjectUtil.isNotEmpty(callDao)) {
|
||||
device_code = callDao.getDevice_code();
|
||||
}
|
||||
}
|
||||
}
|
||||
BigDecimal canuseSum = mdPbStoragevehicleextMapper.queryCanuseSum(pcsn, material_id, sect_code, device_code);
|
||||
|
||||
if (ObjectUtil.isEmpty(canuseSum) || canuseSum.doubleValue() < unassign_qty) {
|
||||
throw new BadRequestException("物料编号:" + dtl.getMaterial_code() + "出库分配数量不满足");
|
||||
}
|
||||
|
||||
@@ -693,7 +727,7 @@ public class OutBillServiceImpl extends ServiceImpl<IOStorInvMapper, IOStorInv>
|
||||
*/
|
||||
|
||||
//出库分配查询货位信息
|
||||
List<MdPbStoragevehicleextDto> outAllocationList = mdPbStoragevehicleextMapper.queryOutAllocation(pcsn, material_id, sect_code);
|
||||
List<MdPbStoragevehicleextDto> outAllocationList = mdPbStoragevehicleextMapper.queryOutAllocation(pcsn, material_id, sect_code, device_code);
|
||||
|
||||
int seq_no = 1;
|
||||
double allocation_canuse_qty = 0;
|
||||
@@ -707,7 +741,8 @@ public class OutBillServiceImpl extends ServiceImpl<IOStorInvMapper, IOStorInv>
|
||||
// 判断是否领料出库
|
||||
if (ioStorInv.getBill_type().equals(IOSEnum.OUT_BILL_TYPE.code("领料出库"))) {
|
||||
// 判断是否是盘丝(焊状)
|
||||
if (!dtl.getMaterial_id().equals(IOSConstant.MATERIAL_HS_PZ)) {
|
||||
MdMeMaterialbase materDao = iMdMeMaterialbaseService.getById(dtl.getMaterial_id());
|
||||
if (!materDao.getMaterial_type_id().equals(IOSConstant.MATERIAL_HS_PZ)) {
|
||||
ioStorInvDis.setIs_check(IOSConstant.ONE);
|
||||
ioStorInvDis.setCheck_qty(outAllocation.getCanuse_qty());
|
||||
play_qty = NumberUtil.add(play_qty, unassign_qty);
|
||||
@@ -891,6 +926,20 @@ public class OutBillServiceImpl extends ServiceImpl<IOStorInvMapper, IOStorInv>
|
||||
|
||||
@Override
|
||||
public List<MdPbStoragevehicleextDto> queryAvailableInv(Map whereJson) {
|
||||
String source_billdtl_id = MapUtil.getStr(whereJson, "source_billdtl_id");
|
||||
IOStorInv ioStorInv = this.getById(MapUtil.getStr(whereJson, "iostorinv_id"));
|
||||
|
||||
if (ObjectUtil.isNotEmpty(source_billdtl_id)) {
|
||||
if (ioStorInv.getBill_type().equals(IOSEnum.OUT_BILL_TYPE.code("领料出库"))
|
||||
|| ioStorInv.getBill_type().equals(IOSEnum.OUT_BILL_TYPE.code("烘干出库"))
|
||||
) {
|
||||
// 查询工单信息
|
||||
PdmBomCallMaterial callDao = iPdmBomCallMaterialService.getById(source_billdtl_id);
|
||||
if (ObjectUtil.isNotEmpty(callDao)) {
|
||||
whereJson.put("device_code",callDao.getDevice_code());
|
||||
}
|
||||
}
|
||||
}
|
||||
return mdPbStoragevehicleextMapper.queryAvailableInv(whereJson);
|
||||
}
|
||||
|
||||
@@ -940,7 +989,8 @@ public class OutBillServiceImpl extends ServiceImpl<IOStorInvMapper, IOStorInv>
|
||||
// 判断是否领料出库
|
||||
if (ioStorInv.getBill_type().equals(IOSEnum.OUT_BILL_TYPE.code("领料出库"))) {
|
||||
// 判断是否是盘丝(焊状)
|
||||
if (!dtl.getMaterial_id().equals(IOSConstant.MATERIAL_HS_PZ)) {
|
||||
MdMeMaterialbase materDao = iMdMeMaterialbaseService.getById(dtl.getMaterial_id());
|
||||
if (!materDao.getMaterial_type_id().equals(IOSConstant.MATERIAL_HS_PZ)) {
|
||||
ioStorInvDis.setIs_check(IOSConstant.ONE);
|
||||
ioStorInvDis.setCheck_qty(ivt.getBigDecimal("canuse_qty"));
|
||||
play_qty = NumberUtil.add(play_qty, unassign_qty);
|
||||
|
||||
Reference in New Issue
Block a user