增加出库明细查询接口
This commit is contained in:
parent
96dcda49d3
commit
bbd4387916
@ -7,12 +7,14 @@ import com.ktg.common.core.page.TableDataInfo;
|
||||
import com.ktg.common.enums.BusinessType;
|
||||
import com.ktg.common.utils.poi.ExcelUtil;
|
||||
import com.ktg.mes.md.domain.WmsOutPlan;
|
||||
import com.ktg.mes.md.domain.WmsOutPlanDetailEntity;
|
||||
import com.ktg.mes.md.service.IWmsOutPlanService;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.security.access.prepost.PreAuthorize;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
import java.util.HashMap;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
@ -27,6 +29,16 @@ public class WmsOutPlanController extends BaseController {
|
||||
@Autowired
|
||||
private IWmsOutPlanService wmsOutPlanService;
|
||||
|
||||
/**
|
||||
* 查询出库计划管理列表
|
||||
*/
|
||||
@GetMapping("/open/list")
|
||||
public TableDataInfo openList(WmsOutPlanDetailEntity wmsOutPlanDetailEntity) {
|
||||
startPage();
|
||||
List<HashMap<String, Object>> list = wmsOutPlanService.selectWmsOutPlanDetailEntityList(wmsOutPlanDetailEntity);
|
||||
return getDataTable(list);
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询出库计划管理列表
|
||||
*/
|
||||
|
@ -1,7 +1,9 @@
|
||||
package com.ktg.mes.md.service;
|
||||
|
||||
import com.ktg.mes.md.domain.WmsOutPlan;
|
||||
import com.ktg.mes.md.domain.WmsOutPlanDetailEntity;
|
||||
|
||||
import java.util.HashMap;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
@ -60,4 +62,6 @@ public interface IWmsOutPlanService {
|
||||
int deleteWmsOutPlanByWmsOutPlanId(Long wmsOutPlanId);
|
||||
|
||||
boolean runWmsOutPlan(Long[] wmsOutPlanIds);
|
||||
|
||||
List<HashMap<String, Object>> selectWmsOutPlanDetailEntityList(WmsOutPlanDetailEntity wmsOutPlanDetailEntity);
|
||||
}
|
||||
|
@ -3,10 +3,7 @@ package com.ktg.mes.md.service.impl;
|
||||
import com.ktg.common.utils.DateUtils;
|
||||
import com.ktg.common.utils.StringUtils;
|
||||
import com.ktg.mes.md.domain.*;
|
||||
import com.ktg.mes.md.mapper.BaseKnifeMapper;
|
||||
import com.ktg.mes.md.mapper.WmsOutPlanDetailEntityMapper;
|
||||
import com.ktg.mes.md.mapper.WmsOutPlanMapper;
|
||||
import com.ktg.mes.md.mapper.WmsOutTaskMapper;
|
||||
import com.ktg.mes.md.mapper.*;
|
||||
import com.ktg.mes.md.service.IWmsOutPlanService;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
@ -15,6 +12,7 @@ import org.springframework.transaction.annotation.Transactional;
|
||||
import java.text.SimpleDateFormat;
|
||||
import java.util.ArrayList;
|
||||
import java.util.Date;
|
||||
import java.util.HashMap;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
@ -37,6 +35,9 @@ public class WmsOutPlanServiceImpl implements IWmsOutPlanService {
|
||||
@Autowired
|
||||
private BaseKnifeMapper baseKnifeMapper;
|
||||
|
||||
@Autowired
|
||||
private WmsBusinessTypeMapper wmsBusinessTypeMapper;
|
||||
|
||||
/**
|
||||
* 查询出库计划管理
|
||||
*
|
||||
@ -185,6 +186,48 @@ public class WmsOutPlanServiceImpl implements IWmsOutPlanService {
|
||||
return true;
|
||||
}
|
||||
|
||||
@Transactional
|
||||
@Override
|
||||
public List<HashMap<String, Object>> selectWmsOutPlanDetailEntityList(WmsOutPlanDetailEntity wmsOutPlanDetailEntity) {
|
||||
List<WmsOutPlanDetailEntity> wmsOutPlanDetailEntityList = wmsOutPlanDetailEntityMapper.selectWmsOutPlanDetailEntityList(wmsOutPlanDetailEntity);
|
||||
List<HashMap<String, Object>> hashMapList = new ArrayList<>();
|
||||
wmsOutPlanDetailEntityList.forEach(nowWmsOutPlanDetailEntity -> {
|
||||
// 根据出库实例对象获取出库计划明细
|
||||
WmsOutPlanDetail wmsOutPlanDetail = this.wmsOutPlanMapper.selectWmsOutPlanDetailById(nowWmsOutPlanDetailEntity.getWmsOutPlanDetailId());
|
||||
|
||||
// 根据计划明细获得出库计划
|
||||
WmsOutPlan wmsOutPlan = this.wmsOutPlanMapper.selectWmsOutPlanByWmsOutPlanId(wmsOutPlanDetail.getWmsOutPlanId());
|
||||
|
||||
// 根据出库计划获得出库类型
|
||||
WmsBusinessType wmsBusinessType = this.wmsBusinessTypeMapper.selectWmsBusinessTypeByTypeId(wmsOutPlan.getWmsBusinessTypeId().toString());
|
||||
|
||||
// 设定出库信息数据
|
||||
HashMap<String, Object> hashMap = new HashMap<>();
|
||||
/* 来自计划 */
|
||||
hashMap.put("planCode", wmsOutPlan.getPlanCode()); // 计划编号
|
||||
hashMap.put("planStatus", wmsOutPlan.getPlanState()); // 计划状态
|
||||
hashMap.put("planType", wmsOutPlan.getPlanType()); // 计划类型
|
||||
hashMap.put("useUsername", wmsOutPlan.getRecipientUsername()); // 领用人
|
||||
/* 来自出入库计划类型 */
|
||||
hashMap.put("planTypeId", wmsBusinessType.getTypeId()); // 出库类型ID
|
||||
hashMap.put("planTypeCode", wmsBusinessType.getCode()); // 出库类型编码
|
||||
hashMap.put("planTypeName", wmsBusinessType.getName()); // 出库类型名称
|
||||
/* 来自计划明细 */
|
||||
hashMap.put("detailBatchNum", wmsOutPlanDetail.getDetailBatchNum()); // 明细批次
|
||||
hashMap.put("wmStorageAreaId", wmsOutPlanDetail.getWmStorageAreaId()); // 库位ID
|
||||
hashMap.put("wmStorageAreaCode", wmsOutPlanDetail.getWmStorageAreaCode()); // 库位编码
|
||||
hashMap.put("wmStorageAreaName", wmsOutPlanDetail.getWmStorageAreaName()); // 库位名称
|
||||
hashMap.put("detailStatus", wmsOutPlanDetail.getDetailState()); // 明细状态
|
||||
/* 实体 */
|
||||
String outTime = null;
|
||||
if (nowWmsOutPlanDetailEntity.getCreateTime() != null)
|
||||
outTime = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss").format(nowWmsOutPlanDetailEntity.getCreateTime());
|
||||
hashMap.put("outTime", outTime); // 出库时间
|
||||
hashMapList.add(hashMap);
|
||||
});
|
||||
return hashMapList;
|
||||
}
|
||||
|
||||
/**
|
||||
* 新增出库计划明细信息
|
||||
*
|
||||
|
Loading…
Reference in New Issue
Block a user