Compare commits
13 Commits
b84fd1e046
...
master
| Author | SHA1 | Date | |
|---|---|---|---|
| 8ceaeb03ef | |||
| 8323ae3cd9 | |||
| 15a4053cab | |||
| a892cdd03d | |||
| ac45b0c79b | |||
| 0c23b61cbb | |||
| dbc2bada83 | |||
| 8f802a8738 | |||
| d29b336252 | |||
| 2183528894 | |||
| 367dd00008 | |||
| 54c9486a88 | |||
| 56e4514ee8 |
@@ -1244,6 +1244,25 @@ public class ExcelUtil<T>
|
|||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
if (value instanceof String)
|
||||||
|
{
|
||||||
|
String str = (String) value;
|
||||||
|
|
||||||
|
if ("sapNo".equals(field.getName() )
|
||||||
|
&& str.matches("^\\d{1,15}$"))
|
||||||
|
{
|
||||||
|
cell.setCellValue(Double.parseDouble(str));
|
||||||
|
|
||||||
|
// 设置为数字格式
|
||||||
|
CellStyle numStyle = wb.createCellStyle();
|
||||||
|
numStyle.cloneStyleFrom(cell.getCellStyle());
|
||||||
|
numStyle.setDataFormat(wb.createDataFormat().getFormat("0"));
|
||||||
|
cell.setCellStyle(numStyle);
|
||||||
|
|
||||||
|
addStatisticsData(column, str, attr);
|
||||||
|
return cell;
|
||||||
|
}
|
||||||
|
}
|
||||||
// 设置列类型
|
// 设置列类型
|
||||||
setCellVo(value, attr, cell);
|
setCellVo(value, attr, cell);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,17 +1,22 @@
|
|||||||
package com.zg.project.inventory.AutoInventory.controller;
|
package com.zg.project.inventory.AutoInventory.controller;
|
||||||
|
|
||||||
|
import com.github.pagehelper.PageHelper;
|
||||||
import com.zg.common.utils.StringUtils;
|
import com.zg.common.utils.StringUtils;
|
||||||
import com.zg.common.utils.poi.ExcelUtil;
|
import com.zg.common.utils.poi.ExcelUtil;
|
||||||
import com.zg.framework.web.controller.BaseController;
|
import com.zg.framework.web.controller.BaseController;
|
||||||
import com.zg.framework.web.domain.AjaxResult;
|
import com.zg.framework.web.domain.AjaxResult;
|
||||||
import com.zg.framework.web.page.TableDataInfo;
|
import com.zg.framework.web.page.TableDataInfo;
|
||||||
import com.zg.project.inventory.AutoInventory.service.InventoryMatchScanService;
|
import com.zg.project.inventory.AutoInventory.service.InventoryMatchScanService;
|
||||||
|
import com.zg.project.inventory.domain.dto.InventoryDTO;
|
||||||
import com.zg.project.inventory.domain.dto.MatchScanPageDTO;
|
import com.zg.project.inventory.domain.dto.MatchScanPageDTO;
|
||||||
import com.zg.project.inventory.domain.entity.InventoryMatchScan;
|
import com.zg.project.inventory.domain.entity.InventoryMatchScan;
|
||||||
import com.zg.project.inventory.domain.vo.InventoryMatchScanVO;
|
import com.zg.project.inventory.domain.vo.InventoryMatchScanVO;
|
||||||
import com.zg.project.inventory.domain.vo.RkInfoMatchVO;
|
import com.zg.project.inventory.domain.vo.RkInfoMatchVO;
|
||||||
import com.zg.project.inventory.domain.vo.RkInventoryExportVO;
|
import com.zg.project.inventory.domain.vo.RkInventoryExportVO;
|
||||||
import com.zg.project.wisdom.domain.RkInfo;
|
import com.zg.project.wisdom.domain.RkInfo;
|
||||||
|
import com.zg.project.wisdom.domain.RkRecord;
|
||||||
|
import com.zg.project.wisdom.domain.vo.StockStatisticVO;
|
||||||
|
import com.zg.project.wisdom.mapper.RkInfoMapper;
|
||||||
import com.zg.project.wisdom.service.IRkInfoService;
|
import com.zg.project.wisdom.service.IRkInfoService;
|
||||||
import io.swagger.annotations.ApiOperation;
|
import io.swagger.annotations.ApiOperation;
|
||||||
import org.springframework.beans.BeanUtils;
|
import org.springframework.beans.BeanUtils;
|
||||||
@@ -36,7 +41,8 @@ public class InventoryMatchScanController extends BaseController {
|
|||||||
|
|
||||||
@Autowired
|
@Autowired
|
||||||
private IRkInfoService rkInfoService;
|
private IRkInfoService rkInfoService;
|
||||||
|
@Autowired
|
||||||
|
private RkInfoMapper rkInfoMapper;
|
||||||
/**
|
/**
|
||||||
* 分页查询盘点结果
|
* 分页查询盘点结果
|
||||||
* @param matchScan
|
* @param matchScan
|
||||||
@@ -142,4 +148,27 @@ public class InventoryMatchScanController extends BaseController {
|
|||||||
return AjaxResult.success(getDataTable(list));
|
return AjaxResult.success(getDataTable(list));
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@PostMapping("/inventoryList")
|
||||||
|
public TableDataInfo inventoryList(@RequestBody InventoryDTO query) {
|
||||||
|
PageHelper.startPage(query.getPageNum(), query.getPageSize());
|
||||||
|
String warehouseCode = query.getWarehouseCode();
|
||||||
|
String sceneId = query.getSceneId();
|
||||||
|
List<RkInfo> normalAll =
|
||||||
|
rkInfoMapper.getByWarehouseAndScene(warehouseCode, sceneId);
|
||||||
|
return getDataTable(normalAll);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 出入库统计,返回总数
|
||||||
|
*/
|
||||||
|
@PostMapping("/statistics")
|
||||||
|
public AjaxResult statistics(@RequestBody InventoryDTO query) {
|
||||||
|
RkInfo rkInfo = new RkInfo();
|
||||||
|
rkInfo.setScene(query.getSceneId());
|
||||||
|
rkInfo.setCangku(query.getWarehouseCode());
|
||||||
|
StockStatisticVO stockStatistic = rkInfoMapper.selectStockStatisticByCondition(rkInfo);
|
||||||
|
return AjaxResult.success(stockStatistic);
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -0,0 +1,14 @@
|
|||||||
|
package com.zg.project.inventory.domain.dto;
|
||||||
|
|
||||||
|
import lombok.Data;
|
||||||
|
|
||||||
|
@Data
|
||||||
|
public class InventoryDTO {
|
||||||
|
private String warehouseCode;
|
||||||
|
private String sceneId;
|
||||||
|
/** 当前页 */
|
||||||
|
private Integer pageNum;
|
||||||
|
|
||||||
|
/** 每页条数 */
|
||||||
|
private Integer pageSize;
|
||||||
|
}
|
||||||
@@ -70,6 +70,7 @@ public class RkStatisticsController {
|
|||||||
List<TodoStatVO> list = rkStatisticsService.selectTodoStat();
|
List<TodoStatVO> list = rkStatisticsService.selectTodoStat();
|
||||||
return AjaxResult.success(list);
|
return AjaxResult.success(list);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 小仓库位使用情况统计(总库位/已使用/未使用)
|
* 小仓库位使用情况统计(总库位/已使用/未使用)
|
||||||
*/
|
*/
|
||||||
@@ -78,6 +79,7 @@ public class RkStatisticsController {
|
|||||||
List<WarehouseSlotStatVO> list = rkStatisticsService.selectWarehouseSlotStat();
|
List<WarehouseSlotStatVO> list = rkStatisticsService.selectWarehouseSlotStat();
|
||||||
return AjaxResult.success(list);
|
return AjaxResult.success(list);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 库龄>=30天明细导出(分组:>30天 / >60天)
|
* 库龄>=30天明细导出(分组:>30天 / >60天)
|
||||||
*/
|
*/
|
||||||
|
|||||||
@@ -251,6 +251,12 @@ public class RkInfo extends BaseEntity
|
|||||||
@DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
|
@DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
|
||||||
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
|
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
|
||||||
private Date endDate;
|
private Date endDate;
|
||||||
|
/** 场景 */
|
||||||
|
@Excel(name = "场景",readConverterExp = "HJ=货架,DC=堆场")
|
||||||
|
private String scene;
|
||||||
|
|
||||||
|
private String sceneName;
|
||||||
|
|
||||||
public void setId(Long id)
|
public void setId(Long id)
|
||||||
{
|
{
|
||||||
this.id = id;
|
this.id = id;
|
||||||
@@ -796,6 +802,24 @@ public class RkInfo extends BaseEntity
|
|||||||
this.endDate = endDate;
|
this.endDate = endDate;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public void setScene(String scene)
|
||||||
|
{
|
||||||
|
this.scene = scene;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getScene()
|
||||||
|
{
|
||||||
|
return scene;
|
||||||
|
}
|
||||||
|
public void setSceneName(String sceneName)
|
||||||
|
{
|
||||||
|
this.sceneName = sceneName;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getSceneName()
|
||||||
|
{
|
||||||
|
return sceneName;
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public String toString() {
|
public String toString() {
|
||||||
@@ -861,6 +885,7 @@ public class RkInfo extends BaseEntity
|
|||||||
.append("startDate", startDate)
|
.append("startDate", startDate)
|
||||||
.append("endDate", endDate)
|
.append("endDate", endDate)
|
||||||
.append("totalAmount", totalAmount)
|
.append("totalAmount", totalAmount)
|
||||||
|
.append("scene", getScene())
|
||||||
.toString();
|
.toString();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -172,4 +172,15 @@ public interface RkInfoMapper
|
|||||||
|
|
||||||
|
|
||||||
List<RkInfo> listRkInfoByPcodes(ArrayList<String> strings);
|
List<RkInfo> listRkInfoByPcodes(ArrayList<String> strings);
|
||||||
|
/**
|
||||||
|
* 查询今日最大单号
|
||||||
|
* */
|
||||||
|
String selectTodayMaxBillNo(String prefix, String date);
|
||||||
|
/**
|
||||||
|
* 更新单位
|
||||||
|
* */
|
||||||
|
int updateDw(@Param("sapNo") String sapNo,
|
||||||
|
@Param("wlNo") String wlNo,
|
||||||
|
@Param("xmNo") String xmNo,
|
||||||
|
@Param("dw") String dw);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -176,4 +176,11 @@ public interface RkRecordMapper
|
|||||||
*/
|
*/
|
||||||
Integer selectMinDeliveryStatusByBillNo(
|
Integer selectMinDeliveryStatusByBillNo(
|
||||||
@Param("billNo") String billNo);
|
@Param("billNo") String billNo);
|
||||||
|
/**
|
||||||
|
* 更新单位
|
||||||
|
*/
|
||||||
|
int updateDw(@Param("sapNo") String sapNo,
|
||||||
|
@Param("wlNo") String wlNo,
|
||||||
|
@Param("xmNo") String xmNo,
|
||||||
|
@Param("dw") String dw);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -10,6 +10,8 @@ import com.zg.common.utils.SecurityUtils;
|
|||||||
import com.zg.common.utils.StringUtils;
|
import com.zg.common.utils.StringUtils;
|
||||||
import com.zg.framework.web.domain.AjaxResult;
|
import com.zg.framework.web.domain.AjaxResult;
|
||||||
import com.zg.project.wisdom.domain.dto.ExcelFieldMapping;
|
import com.zg.project.wisdom.domain.dto.ExcelFieldMapping;
|
||||||
|
import com.zg.project.wisdom.mapper.RkInfoMapper;
|
||||||
|
import com.zg.project.wisdom.mapper.RkRecordMapper;
|
||||||
import org.apache.poi.ss.usermodel.*;
|
import org.apache.poi.ss.usermodel.*;
|
||||||
import org.springframework.beans.factory.annotation.Autowired;
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
import org.springframework.stereotype.Service;
|
import org.springframework.stereotype.Service;
|
||||||
@@ -30,7 +32,11 @@ public class GysJhServiceImpl implements IGysJhService
|
|||||||
{
|
{
|
||||||
@Autowired
|
@Autowired
|
||||||
private GysJhMapper gysJhMapper;
|
private GysJhMapper gysJhMapper;
|
||||||
|
@Autowired
|
||||||
|
private RkInfoMapper rkInfoMapper;
|
||||||
|
|
||||||
|
@Autowired
|
||||||
|
private RkRecordMapper rkRecordMapper;
|
||||||
/**
|
/**
|
||||||
* 查询供应计划
|
* 查询供应计划
|
||||||
*
|
*
|
||||||
@@ -78,7 +84,24 @@ public class GysJhServiceImpl implements IGysJhService
|
|||||||
public int updateGysJh(GysJh gysJh)
|
public int updateGysJh(GysJh gysJh)
|
||||||
{
|
{
|
||||||
gysJh.setUpdateTime(DateUtils.getNowDate());
|
gysJh.setUpdateTime(DateUtils.getNowDate());
|
||||||
return gysJhMapper.updateGysJh(gysJh);
|
int rows = gysJhMapper.updateGysJh(gysJh);
|
||||||
|
|
||||||
|
// 2️⃣ 同步更新 rk_info
|
||||||
|
rkInfoMapper.updateDw(
|
||||||
|
gysJh.getSapNo(),
|
||||||
|
gysJh.getWlNo(),
|
||||||
|
gysJh.getXmNo(),
|
||||||
|
gysJh.getDw()
|
||||||
|
);
|
||||||
|
|
||||||
|
// 3️⃣ 同步更新 rk_record
|
||||||
|
rkRecordMapper.updateDw(
|
||||||
|
gysJh.getSapNo(),
|
||||||
|
gysJh.getWlNo(),
|
||||||
|
gysJh.getXmNo(),
|
||||||
|
gysJh.getDw()
|
||||||
|
);
|
||||||
|
return rows;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|||||||
@@ -102,7 +102,7 @@ public class RkBillServiceImpl implements IRkBillService
|
|||||||
throw new RuntimeException("入库明细不能为空");
|
throw new RuntimeException("入库明细不能为空");
|
||||||
}
|
}
|
||||||
|
|
||||||
String billNo = BillNoUtil.generateTodayBillNo("RK", null);
|
String billNo = BillNoUtil.generateTodayBillNo("RK", rkInfoMapper);
|
||||||
Date now = DateUtils.getNowDate();
|
Date now = DateUtils.getNowDate();
|
||||||
String userId = String.valueOf(SecurityUtils.getUserId());
|
String userId = String.valueOf(SecurityUtils.getUserId());
|
||||||
|
|
||||||
@@ -133,7 +133,7 @@ public class RkBillServiceImpl implements IRkBillService
|
|||||||
for (RkInfo info : rkInfoList) {
|
for (RkInfo info : rkInfoList) {
|
||||||
|
|
||||||
info.setExecStatus(bill.getExecStatus());
|
info.setExecStatus(bill.getExecStatus());
|
||||||
|
String scene = "";
|
||||||
// 库位校验
|
// 库位校验
|
||||||
if (StringUtils.isNotBlank(info.getPcode())) {
|
if (StringUtils.isNotBlank(info.getPcode())) {
|
||||||
PcdeDetail pcde = pcdeDetailMapper.selectByPcodeAndWarehouse(
|
PcdeDetail pcde = pcdeDetailMapper.selectByPcodeAndWarehouse(
|
||||||
@@ -144,6 +144,9 @@ public class RkBillServiceImpl implements IRkBillService
|
|||||||
throw new RuntimeException("库位不存在:" + info.getPcode());
|
throw new RuntimeException("库位不存在:" + info.getPcode());
|
||||||
}
|
}
|
||||||
info.setPcodeId(pcde.getEncodedId());
|
info.setPcodeId(pcde.getEncodedId());
|
||||||
|
if(StringUtils.isNotBlank(pcde.getScene())){
|
||||||
|
scene = pcde.getScene();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// rk_info
|
// rk_info
|
||||||
@@ -159,7 +162,7 @@ public class RkBillServiceImpl implements IRkBillService
|
|||||||
info.setHasMoved("0");
|
info.setHasMoved("0");
|
||||||
info.setIsBorrowed("0");
|
info.setIsBorrowed("0");
|
||||||
info.setIsDelete("0");
|
info.setIsDelete("0");
|
||||||
|
info.setScene(scene);
|
||||||
info.setCreateTime(now);
|
info.setCreateTime(now);
|
||||||
info.setCreateBy(userId);
|
info.setCreateBy(userId);
|
||||||
|
|
||||||
@@ -372,6 +375,7 @@ public class RkBillServiceImpl implements IRkBillService
|
|||||||
}
|
}
|
||||||
|
|
||||||
info.setPcodeId(pcde.getEncodedId());
|
info.setPcodeId(pcde.getEncodedId());
|
||||||
|
info.setScene(pcde.getScene());
|
||||||
}
|
}
|
||||||
|
|
||||||
/* 5.2 继承主单字段 */
|
/* 5.2 继承主单字段 */
|
||||||
@@ -538,7 +542,7 @@ public class RkBillServiceImpl implements IRkBillService
|
|||||||
throw new RuntimeException("出库明细不能为空");
|
throw new RuntimeException("出库明细不能为空");
|
||||||
}
|
}
|
||||||
|
|
||||||
String billNo = BillNoUtil.generateTodayBillNo("CK", null);
|
String billNo = BillNoUtil.generateTodayBillNo("CK", rkInfoMapper);
|
||||||
Date now = DateUtils.getNowDate();
|
Date now = DateUtils.getNowDate();
|
||||||
String userId = String.valueOf(SecurityUtils.getUserId());
|
String userId = String.valueOf(SecurityUtils.getUserId());
|
||||||
|
|
||||||
|
|||||||
@@ -288,7 +288,7 @@ public class RkInfoServiceImpl implements IRkInfoService
|
|||||||
scan.setTaskId(taskId);
|
scan.setTaskId(taskId);
|
||||||
scan.setPcode(r.getPcode());
|
scan.setPcode(r.getPcode());
|
||||||
|
|
||||||
// 👉 你要求:全部都是正常
|
// 全部都是正常
|
||||||
scan.setStatus("0");
|
scan.setStatus("0");
|
||||||
|
|
||||||
scan.setDeviceId(deviceId);
|
scan.setDeviceId(deviceId);
|
||||||
|
|||||||
@@ -7,6 +7,8 @@ import java.util.stream.Collectors;
|
|||||||
import com.zg.common.exception.ServiceException;
|
import com.zg.common.exception.ServiceException;
|
||||||
import com.zg.common.utils.DateUtils;
|
import com.zg.common.utils.DateUtils;
|
||||||
import com.zg.common.utils.StringUtils;
|
import com.zg.common.utils.StringUtils;
|
||||||
|
import com.zg.project.information.domain.PcdeDetail;
|
||||||
|
import com.zg.project.information.mapper.PcdeDetailMapper;
|
||||||
import com.zg.project.wisdom.domain.GysJh;
|
import com.zg.project.wisdom.domain.GysJh;
|
||||||
import com.zg.project.wisdom.domain.RkInfo;
|
import com.zg.project.wisdom.domain.RkInfo;
|
||||||
import com.zg.project.wisdom.domain.vo.RecordStatisticVO;
|
import com.zg.project.wisdom.domain.vo.RecordStatisticVO;
|
||||||
@@ -43,6 +45,8 @@ public class RkRecordServiceImpl implements IRkRecordService
|
|||||||
@Autowired
|
@Autowired
|
||||||
private GysJhMapper gysJhMapper;
|
private GysJhMapper gysJhMapper;
|
||||||
|
|
||||||
|
@Autowired
|
||||||
|
private PcdeDetailMapper pcdeDetailMapper;
|
||||||
/**
|
/**
|
||||||
* 查询出入库记录
|
* 查询出入库记录
|
||||||
*
|
*
|
||||||
@@ -199,6 +203,22 @@ public class RkRecordServiceImpl implements IRkRecordService
|
|||||||
}
|
}
|
||||||
|
|
||||||
/* ---------- 同步库存(明确字段,禁止 BeanUtils) ---------- */
|
/* ---------- 同步库存(明确字段,禁止 BeanUtils) ---------- */
|
||||||
|
String scene = "";
|
||||||
|
// 库位校验
|
||||||
|
if (StringUtils.isNotBlank(info.getPcode())) {
|
||||||
|
PcdeDetail pcde = pcdeDetailMapper.selectByPcodeAndWarehouse(
|
||||||
|
rkRecord.getPcode(),
|
||||||
|
rkRecord.getCangku()
|
||||||
|
);
|
||||||
|
if (pcde == null) {
|
||||||
|
throw new RuntimeException("库位不存在:" + info.getPcode());
|
||||||
|
}
|
||||||
|
info.setPcodeId(pcde.getEncodedId());
|
||||||
|
if(StringUtils.isNotBlank(pcde.getScene())){
|
||||||
|
scene = pcde.getScene();
|
||||||
|
info.setScene(scene);
|
||||||
|
}
|
||||||
|
}
|
||||||
info.setRealQty(newInQty);
|
info.setRealQty(newInQty);
|
||||||
info.setWlNo(rkRecord.getWlNo());
|
info.setWlNo(rkRecord.getWlNo());
|
||||||
info.setWlMs(rkRecord.getWlMs());
|
info.setWlMs(rkRecord.getWlMs());
|
||||||
@@ -210,6 +230,7 @@ public class RkRecordServiceImpl implements IRkRecordService
|
|||||||
info.setHtDj(rkRecord.getHtDj());
|
info.setHtDj(rkRecord.getHtDj());
|
||||||
info.setCangku(rkRecord.getCangku());
|
info.setCangku(rkRecord.getCangku());
|
||||||
info.setPcode(rkRecord.getPcode());
|
info.setPcode(rkRecord.getPcode());
|
||||||
|
info.setRemark(rkRecord.getRemark());
|
||||||
info.setIsChuku("0");
|
info.setIsChuku("0");
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -246,6 +267,7 @@ public class RkRecordServiceImpl implements IRkRecordService
|
|||||||
info.setHtDj(rkRecord.getHtDj());
|
info.setHtDj(rkRecord.getHtDj());
|
||||||
info.setCangku(rkRecord.getCangku());
|
info.setCangku(rkRecord.getCangku());
|
||||||
info.setPcode(rkRecord.getPcode());
|
info.setPcode(rkRecord.getPcode());
|
||||||
|
info.setRemark(rkRecord.getRemark());
|
||||||
}
|
}
|
||||||
|
|
||||||
/* ====================== 4. 更新库存表 ====================== */
|
/* ====================== 4. 更新库存表 ====================== */
|
||||||
|
|||||||
@@ -1,6 +1,7 @@
|
|||||||
package com.zg.project.wisdom.utils;
|
package com.zg.project.wisdom.utils;
|
||||||
|
|
||||||
import com.zg.project.wisdom.mapper.RkInfoMapper;
|
import com.zg.project.wisdom.mapper.RkInfoMapper;
|
||||||
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
|
|
||||||
import java.text.SimpleDateFormat;
|
import java.text.SimpleDateFormat;
|
||||||
import java.util.Date;
|
import java.util.Date;
|
||||||
@@ -22,6 +23,8 @@ public class BillNoUtil {
|
|||||||
|
|
||||||
private static final String DEFAULT_PREFIX = "RK";
|
private static final String DEFAULT_PREFIX = "RK";
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 生成单据号(短号,不查数据库)
|
* 生成单据号(短号,不查数据库)
|
||||||
* 格式:PREFIX + yyMMdd + HHmmss + 2位随机数
|
* 格式:PREFIX + yyMMdd + HHmmss + 2位随机数
|
||||||
@@ -32,20 +35,25 @@ public class BillNoUtil {
|
|||||||
*/
|
*/
|
||||||
public static synchronized String generateTodayBillNo(String prefix, RkInfoMapper rkInfoMapper) {
|
public static synchronized String generateTodayBillNo(String prefix, RkInfoMapper rkInfoMapper) {
|
||||||
|
|
||||||
// 前缀处理
|
// 日期 yyMMdd
|
||||||
final String p = (prefix == null || prefix.trim().isEmpty())
|
String date = new SimpleDateFormat("yyMMdd").format(new Date());
|
||||||
? DEFAULT_PREFIX
|
|
||||||
: prefix.trim().toUpperCase();
|
|
||||||
|
|
||||||
// 时间到秒:yyMMddHHmmss(12位)
|
// 查询今日最大单号
|
||||||
String time = new SimpleDateFormat("yyMMddHHmmss").format(new Date());
|
String maxBillNo = rkInfoMapper.selectTodayMaxBillNo(prefix, date);
|
||||||
|
|
||||||
// 2位随机数:10~99(避免同一秒内多次点击撞号)
|
int seq = 1;
|
||||||
int rnd = ThreadLocalRandom.current().nextInt(10, 100);
|
|
||||||
|
|
||||||
return p + time + rnd;
|
if (maxBillNo != null && maxBillNo.length() > 8) {
|
||||||
|
// 取最后8位流水号
|
||||||
|
String seqStr = maxBillNo.substring(prefix.length() + date.length());
|
||||||
|
seq = Integer.parseInt(seqStr) + 1;
|
||||||
|
}
|
||||||
|
|
||||||
|
// 8位补零
|
||||||
|
String seqFormat = String.format("%08d", seq);
|
||||||
|
|
||||||
|
return prefix + date + seqFormat;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 需要更短的版本(可选)
|
* 需要更短的版本(可选)
|
||||||
* 格式:PREFIX + yyMMdd + 4位随机数
|
* 格式:PREFIX + yyMMdd + 4位随机数
|
||||||
|
|||||||
@@ -66,13 +66,19 @@
|
|||||||
<result property="fycde1" column="fycde_1"/>
|
<result property="fycde1" column="fycde_1"/>
|
||||||
<result property="fycde2" column="fycde_2"/>
|
<result property="fycde2" column="fycde_2"/>
|
||||||
<result property="isUpdate" column="is_update"/>
|
<result property="isUpdate" column="is_update"/>
|
||||||
|
<result property="scene" column="scene"/>
|
||||||
|
<result property="sceneName" column="sceneName"/>
|
||||||
</resultMap>
|
</resultMap>
|
||||||
|
|
||||||
<!-- ========================= 公共查询 SQL(联表完整版) ========================= -->
|
<!-- ========================= 公共查询 SQL(联表完整版) ========================= -->
|
||||||
<sql id="selectRkInfoVo">
|
<sql id="selectRkInfoVo">
|
||||||
SELECT
|
SELECT
|
||||||
ri.*,
|
ri.*,
|
||||||
|
CASE
|
||||||
|
WHEN ri.scene = 'HJ' THEN '货架'
|
||||||
|
WHEN ri.scene = 'DC' THEN '堆场'
|
||||||
|
ELSE ri.scene
|
||||||
|
END AS sceneName,
|
||||||
/* ===== 新增:计算总金额 ===== */
|
/* ===== 新增:计算总金额 ===== */
|
||||||
ri.real_qty * ri.ht_dj AS total_amount,
|
ri.real_qty * ri.ht_dj AS total_amount,
|
||||||
|
|
||||||
@@ -154,7 +160,9 @@
|
|||||||
<if test="remark != null and remark != ''">
|
<if test="remark != null and remark != ''">
|
||||||
AND ri.remark LIKE CONCAT('%', #{remark}, '%')
|
AND ri.remark LIKE CONCAT('%', #{remark}, '%')
|
||||||
</if>
|
</if>
|
||||||
|
<if test="scene != null and scene != ''">
|
||||||
|
AND ri.scene LIKE CONCAT('%', #{scene}, '%')
|
||||||
|
</if>
|
||||||
<if test="isDelete != null and isDelete != ''">
|
<if test="isDelete != null and isDelete != ''">
|
||||||
AND ri.is_delete = #{isDelete}
|
AND ri.is_delete = #{isDelete}
|
||||||
</if>
|
</if>
|
||||||
@@ -240,6 +248,9 @@
|
|||||||
<if test="wlMs != null and wlMs != ''">
|
<if test="wlMs != null and wlMs != ''">
|
||||||
AND ri.wl_ms LIKE CONCAT('%', #{wlMs}, '%')
|
AND ri.wl_ms LIKE CONCAT('%', #{wlMs}, '%')
|
||||||
</if>
|
</if>
|
||||||
|
<if test="scene != null and scene != ''">
|
||||||
|
AND ri.scene LIKE CONCAT('%', #{scene}, '%')
|
||||||
|
</if>
|
||||||
<if test="gysMc != null and gysMc != ''">
|
<if test="gysMc != null and gysMc != ''">
|
||||||
AND ri.gys_mc LIKE CONCAT('%', #{gysMc}, '%')
|
AND ri.gys_mc LIKE CONCAT('%', #{gysMc}, '%')
|
||||||
</if>
|
</if>
|
||||||
@@ -298,7 +309,7 @@
|
|||||||
is_delivery,
|
is_delivery,
|
||||||
fycde_1, fycde_2,
|
fycde_1, fycde_2,
|
||||||
is_update,
|
is_update,
|
||||||
create_by, create_time, is_delete
|
create_by, create_time, is_delete,scene
|
||||||
)
|
)
|
||||||
VALUES (
|
VALUES (
|
||||||
#{operationType}, #{bizType}, #{wlType}, #{cangku}, #{operationTime}, #{operator},
|
#{operationType}, #{bizType}, #{wlType}, #{cangku}, #{operationTime}, #{operator},
|
||||||
@@ -316,7 +327,7 @@
|
|||||||
#{isDelivery},
|
#{isDelivery},
|
||||||
#{fycde1}, #{fycde2},
|
#{fycde1}, #{fycde2},
|
||||||
#{isUpdate},
|
#{isUpdate},
|
||||||
#{createBy}, #{createTime}, #{isDelete}
|
#{createBy}, #{createTime}, #{isDelete},#{scene}
|
||||||
)
|
)
|
||||||
</insert>
|
</insert>
|
||||||
|
|
||||||
@@ -372,6 +383,7 @@
|
|||||||
<if test="updateBy != null">update_by = #{updateBy},</if>
|
<if test="updateBy != null">update_by = #{updateBy},</if>
|
||||||
<if test="updateTime != null">update_time = #{updateTime},</if>
|
<if test="updateTime != null">update_time = #{updateTime},</if>
|
||||||
<if test="isDelete != null">is_delete = #{isDelete},</if>
|
<if test="isDelete != null">is_delete = #{isDelete},</if>
|
||||||
|
<if test="scene != null">scene = #{scene}</if>
|
||||||
</trim>
|
</trim>
|
||||||
WHERE id = #{id}
|
WHERE id = #{id}
|
||||||
</update>
|
</update>
|
||||||
@@ -593,10 +605,34 @@
|
|||||||
|
|
||||||
<select id="getByWarehouseAndScene" resultMap="RkInfoResult">
|
<select id="getByWarehouseAndScene" resultMap="RkInfoResult">
|
||||||
SELECT
|
SELECT
|
||||||
ri.*
|
ri.*,
|
||||||
|
CASE
|
||||||
|
WHEN pd.scene = 'HJ' THEN '货架'
|
||||||
|
WHEN pd.scene = 'DC' THEN '堆场'
|
||||||
|
ELSE pd.scene
|
||||||
|
END AS sceneName,
|
||||||
|
sit.type_name AS operationTypeName,
|
||||||
|
/* ===== 新增:计算总金额 ===== */
|
||||||
|
ri.real_qty * ri.ht_dj AS total_amount,
|
||||||
|
|
||||||
|
COALESCE(sit.type_name, sot.type_name) AS operation_type_name,
|
||||||
|
mt.type_name AS wl_type_name,
|
||||||
|
|
||||||
|
wh.warehouse_name,
|
||||||
|
wh.parent_warehouse_code,
|
||||||
|
wh.parent_warehouse_name,
|
||||||
|
|
||||||
|
su.nick_name AS operator_name,
|
||||||
|
|
||||||
|
DATEDIFF(CURRENT_DATE, ri.operation_time) AS stock_age
|
||||||
|
|
||||||
FROM rk_info ri
|
FROM rk_info ri
|
||||||
JOIN pcde_detail pd
|
LEFT JOIN stock_in_type sit ON ri.operation_type = sit.type_code
|
||||||
ON pd.pcode = ri.pcode
|
LEFT JOIN stock_out_type sot ON ri.operation_type = sot.type_code
|
||||||
|
LEFT JOIN material_type mt ON ri.wl_type = mt.type_code
|
||||||
|
LEFT JOIN warehouse_info wh ON ri.cangku = wh.warehouse_code
|
||||||
|
LEFT JOIN sys_user su ON ri.operator = su.user_id
|
||||||
|
LEFT JOIN pcde_detail pd ON pd.pcode = ri.pcode
|
||||||
WHERE ri.exec_status = 1
|
WHERE ri.exec_status = 1
|
||||||
AND ri.is_delete = '0'
|
AND ri.is_delete = '0'
|
||||||
AND ri.is_chuku = '0'
|
AND ri.is_chuku = '0'
|
||||||
@@ -618,5 +654,17 @@
|
|||||||
|
|
||||||
</select>
|
</select>
|
||||||
|
|
||||||
|
<select id="selectTodayMaxBillNo" resultType="java.lang.String">
|
||||||
|
SELECT MAX(bill_no)
|
||||||
|
FROM rk_record
|
||||||
|
WHERE bill_no LIKE CONCAT(#{prefix}, #{date}, '%')
|
||||||
|
</select>
|
||||||
|
|
||||||
|
<update id="updateDw">
|
||||||
|
UPDATE rk_info
|
||||||
|
SET dw = #{dw}
|
||||||
|
WHERE sap_no = #{sapNo}
|
||||||
|
AND wl_no = #{wlNo}
|
||||||
|
AND xm_no = #{xmNo}
|
||||||
|
</update>
|
||||||
</mapper>
|
</mapper>
|
||||||
|
|||||||
@@ -92,31 +92,35 @@
|
|||||||
<sql id="selectRkRecordVo">
|
<sql id="selectRkRecordVo">
|
||||||
SELECT
|
SELECT
|
||||||
rr.*,
|
rr.*,
|
||||||
|
COALESCE(rr.real_qty, 0) * COALESCE(rr.ht_dj, 0) AS total_amount,
|
||||||
/* ===== 新增:统一计算总金额 ===== */
|
|
||||||
rr.real_qty * rr.ht_dj AS total_amount,
|
|
||||||
|
|
||||||
su.nick_name AS operator_name,
|
su.nick_name AS operator_name,
|
||||||
mt.type_name AS wl_type_name,
|
mt.type_name AS wl_type_name,
|
||||||
COALESCE(sit.type_name, sot.type_name) AS operation_type_name,
|
COALESCE(sit.type_name, sot.type_name) AS operation_type_name,
|
||||||
|
|
||||||
-- 小仓
|
|
||||||
wh.warehouse_name AS warehouse_name,
|
wh.warehouse_name AS warehouse_name,
|
||||||
|
|
||||||
-- 大仓
|
|
||||||
wh.parent_warehouse_code AS parent_warehouse_code,
|
wh.parent_warehouse_code AS parent_warehouse_code,
|
||||||
wh.parent_warehouse_name AS parent_warehouse_name,
|
wh.parent_warehouse_name AS parent_warehouse_name,
|
||||||
|
ct.team_name AS team_name,
|
||||||
|
|
||||||
ct.team_name AS team_name
|
(
|
||||||
|
SELECT MIN(gj.id)
|
||||||
|
FROM gys_jh gj
|
||||||
|
WHERE gj.sap_no = rr.sap_no
|
||||||
|
AND gj.wl_no = rr.wl_no
|
||||||
|
AND gj.xm_no = rr.xm_no
|
||||||
|
AND gj.is_delete = '0'
|
||||||
|
) AS gys_jh_id
|
||||||
|
|
||||||
FROM rk_record rr
|
FROM rk_record rr
|
||||||
LEFT JOIN sys_user su ON rr.operator = su.user_id
|
LEFT JOIN sys_user su
|
||||||
LEFT JOIN material_type mt ON rr.wl_type = mt.type_code
|
ON rr.operator = su.user_id
|
||||||
LEFT JOIN stock_in_type sit ON rr.operation_type = sit.type_code
|
LEFT JOIN material_type mt
|
||||||
LEFT JOIN stock_out_type sot ON rr.operation_type = sot.type_code
|
ON rr.wl_type = mt.type_code
|
||||||
|
LEFT JOIN stock_in_type sit
|
||||||
LEFT JOIN warehouse_info wh ON rr.cangku = wh.warehouse_code
|
ON rr.operation_type = sit.type_code
|
||||||
|
LEFT JOIN stock_out_type sot
|
||||||
|
ON rr.operation_type = sot.type_code
|
||||||
|
LEFT JOIN warehouse_info wh
|
||||||
|
ON rr.cangku = wh.warehouse_code
|
||||||
LEFT JOIN construction_team ct
|
LEFT JOIN construction_team ct
|
||||||
ON rr.team_code = ct.team_code
|
ON rr.team_code = ct.team_code
|
||||||
AND ct.is_delete = '0'
|
AND ct.is_delete = '0'
|
||||||
@@ -282,7 +286,11 @@
|
|||||||
<include refid="selectRkRecordVo"/>
|
<include refid="selectRkRecordVo"/>
|
||||||
WHERE rr.bill_no = #{billNo}
|
WHERE rr.bill_no = #{billNo}
|
||||||
AND (rr.is_delete = '0' OR rr.is_delete = 0 OR rr.is_delete IS NULL)
|
AND (rr.is_delete = '0' OR rr.is_delete = 0 OR rr.is_delete IS NULL)
|
||||||
ORDER BY rr.exec_status = '0' DESC, rr.create_time ASC
|
|
||||||
|
ORDER BY
|
||||||
|
rr.exec_status = '0' DESC,
|
||||||
|
rr.create_time ASC,
|
||||||
|
gj.gys_jh_id ASC
|
||||||
</select>
|
</select>
|
||||||
|
|
||||||
<select id="selectRkRecordByIds" resultMap="RkRecordResult">
|
<select id="selectRkRecordByIds" resultMap="RkRecordResult">
|
||||||
@@ -598,36 +606,140 @@
|
|||||||
IFNULL(SUM(rr.real_qty), 0) AS totalQuantity
|
IFNULL(SUM(rr.real_qty), 0) AS totalQuantity
|
||||||
FROM rk_record rr
|
FROM rk_record rr
|
||||||
<where>
|
<where>
|
||||||
rr.is_delete = 0
|
|
||||||
AND rr.exec_status = 1
|
|
||||||
|
|
||||||
<!-- 已修复:String 不可用 size() -->
|
AND rr.exec_status = '1'
|
||||||
|
|
||||||
<if test="operationType != null and operationType != ''">
|
<if test="operationType != null and operationType != ''">
|
||||||
AND rr.operation_type = #{operationType}
|
AND rr.operation_type = #{operationType}
|
||||||
</if>
|
</if>
|
||||||
|
|
||||||
<if test="xmNo != null and xmNo != ''">
|
<!-- 多 bizType -->
|
||||||
AND rr.xm_no LIKE CONCAT('%', #{xmNo}, '%')
|
<if test="bizTypeList != null and bizTypeList.size > 0">
|
||||||
|
AND rr.biz_type IN
|
||||||
|
<foreach collection="bizTypeList"
|
||||||
|
item="bt"
|
||||||
|
open="("
|
||||||
|
separator=","
|
||||||
|
close=")">
|
||||||
|
#{bt}
|
||||||
|
</foreach>
|
||||||
</if>
|
</if>
|
||||||
|
|
||||||
<if test="wlNo != null and wlNo != ''">
|
<if test="bizType != null and bizType != ''">
|
||||||
AND rr.wl_no LIKE CONCAT('%', #{wlNo}, '%')
|
AND rr.biz_type = #{bizType}
|
||||||
</if>
|
</if>
|
||||||
|
|
||||||
<if test="pcode != null and pcode != ''">
|
<if test="pcode != null and pcode != ''">
|
||||||
AND rr.pcode LIKE CONCAT('%', #{pcode}, '%')
|
AND rr.pcode = #{pcode}
|
||||||
|
</if>
|
||||||
|
|
||||||
|
<if test="wlType != null and wlType != ''">
|
||||||
|
AND rr.wl_type = #{wlType}
|
||||||
</if>
|
</if>
|
||||||
|
|
||||||
<if test="cangku != null and cangku != ''">
|
<if test="cangku != null and cangku != ''">
|
||||||
AND rr.cangku LIKE CONCAT('%', #{cangku}, '%')
|
AND rr.cangku = #{cangku}
|
||||||
</if>
|
</if>
|
||||||
|
|
||||||
<if test="startDate != null">
|
<if test="operator != null and operator != ''">
|
||||||
AND rr.operation_time >= #{startDate}
|
AND rr.operator = #{operator}
|
||||||
</if>
|
</if>
|
||||||
|
|
||||||
<if test="endDate != null">
|
<if test="isChuku != null and isChuku != ''">
|
||||||
AND rr.operation_time <= #{endDate}
|
AND rr.is_chuku = #{isChuku}
|
||||||
|
</if>
|
||||||
|
|
||||||
|
<if test="status != null and status != ''">
|
||||||
|
AND rr.status = #{status}
|
||||||
|
</if>
|
||||||
|
|
||||||
|
<if test="execStatus != null and execStatus != ''">
|
||||||
|
AND rr.exec_status = #{execStatus}
|
||||||
|
</if>
|
||||||
|
|
||||||
|
<if test="billNo != null and billNo != ''">
|
||||||
|
AND rr.bill_no = #{billNo}
|
||||||
|
</if>
|
||||||
|
|
||||||
|
<if test="isDelivery != null and isDelivery != ''">
|
||||||
|
AND rr.is_delivery = #{isDelivery}
|
||||||
|
</if>
|
||||||
|
|
||||||
|
<!-- 项目 -->
|
||||||
|
<if test="xmNo != null and xmNo != ''">
|
||||||
|
AND rr.xm_no LIKE concat('%', #{xmNo}, '%')
|
||||||
|
</if>
|
||||||
|
<if test="xmMs != null and xmMs != ''">
|
||||||
|
AND rr.xm_ms LIKE concat('%', #{xmMs}, '%')
|
||||||
|
</if>
|
||||||
|
|
||||||
|
<!-- 订单 -->
|
||||||
|
<if test="sapNo != null and sapNo != ''">
|
||||||
|
AND rr.sap_no LIKE concat('%', #{sapNo}, '%')
|
||||||
|
</if>
|
||||||
|
|
||||||
|
<!-- 供应商 -->
|
||||||
|
<if test="gysMc != null and gysMc != ''">
|
||||||
|
AND rr.gys_mc LIKE concat('%', #{gysMc}, '%')
|
||||||
|
</if>
|
||||||
|
|
||||||
|
<if test="wlNo != null and wlNo != ''">
|
||||||
|
AND rr.wl_no LIKE concat('%', #{wlNo}, '%')
|
||||||
|
</if>
|
||||||
|
|
||||||
|
<if test="wlMs != null and wlMs != ''">
|
||||||
|
AND rr.wl_ms LIKE concat('%', #{wlMs}, '%')
|
||||||
|
</if>
|
||||||
|
|
||||||
|
<!-- 是否借料 -->
|
||||||
|
<if test="isBorrowed != null and isBorrowed != ''">
|
||||||
|
AND rr.is_borrowed = #{isBorrowed}
|
||||||
|
</if>
|
||||||
|
|
||||||
|
<!-- 删除标识 -->
|
||||||
|
<if test="isDelete == null">
|
||||||
|
AND (rr.is_delete = '0' OR rr.is_delete = 0 OR rr.is_delete IS NULL)
|
||||||
|
</if>
|
||||||
|
<if test="isDelete != null and isDelete != ''">
|
||||||
|
AND rr.is_delete = #{isDelete}
|
||||||
|
</if>
|
||||||
|
|
||||||
|
<!-- ================= 时间条件(最终正确版) ================= -->
|
||||||
|
<if test="startDate != null or endDate != null">
|
||||||
|
AND (
|
||||||
|
<!-- 普通入库 / 出库:精确到时分秒 -->
|
||||||
|
(
|
||||||
|
rr.biz_type IN ('0','1')
|
||||||
|
<if test="startDate != null">
|
||||||
|
AND rr.operation_time >= #{startDate}
|
||||||
|
</if>
|
||||||
|
<if test="endDate != null">
|
||||||
|
AND rr.operation_time <= #{endDate}
|
||||||
|
</if>
|
||||||
|
)
|
||||||
|
OR
|
||||||
|
<!-- 借料出库:按 borrow_time(按天) -->
|
||||||
|
(
|
||||||
|
rr.biz_type = '2'
|
||||||
|
<if test="startDate != null">
|
||||||
|
AND rr.borrow_time >= DATE(#{startDate})
|
||||||
|
</if>
|
||||||
|
<if test="endDate != null">
|
||||||
|
AND rr.borrow_time < DATE_ADD(DATE(#{endDate}), INTERVAL 1 DAY)
|
||||||
|
</if>
|
||||||
|
)
|
||||||
|
OR
|
||||||
|
<!-- 还料入库:按 return_time(按天) -->
|
||||||
|
(
|
||||||
|
rr.biz_type = '3'
|
||||||
|
<if test="startDate != null">
|
||||||
|
AND rr.return_time >= DATE(#{startDate})
|
||||||
|
</if>
|
||||||
|
<if test="endDate != null">
|
||||||
|
AND rr.return_time < DATE_ADD(DATE(#{endDate}), INTERVAL 1 DAY)
|
||||||
|
</if>
|
||||||
|
)
|
||||||
|
)
|
||||||
</if>
|
</if>
|
||||||
</where>
|
</where>
|
||||||
</select>
|
</select>
|
||||||
@@ -826,5 +938,13 @@
|
|||||||
AND is_delete = '0'
|
AND is_delete = '0'
|
||||||
</update>
|
</update>
|
||||||
|
|
||||||
|
<update id="updateDw">
|
||||||
|
UPDATE rk_record
|
||||||
|
SET dw = #{dw}
|
||||||
|
WHERE sap_no = #{sapNo}
|
||||||
|
AND wl_no = #{wlNo}
|
||||||
|
AND xm_no = #{xmNo}
|
||||||
|
</update>
|
||||||
|
|
||||||
|
|
||||||
</mapper>
|
</mapper>
|
||||||
|
|||||||
@@ -253,33 +253,46 @@
|
|||||||
</select>
|
</select>
|
||||||
<select id="selectWarehouseSlotStat"
|
<select id="selectWarehouseSlotStat"
|
||||||
resultType="com.zg.project.wisdom.domain.vo.WarehouseSlotStatVO">
|
resultType="com.zg.project.wisdom.domain.vo.WarehouseSlotStatVO">
|
||||||
<![CDATA[
|
<![CDATA[
|
||||||
|
|
||||||
SELECT
|
SELECT
|
||||||
p.warehouse_code AS cangkuCode,
|
p.warehouse_code AS cangkuCode,
|
||||||
p.warehouse_name AS cangkuName,
|
p.warehouse_name AS cangkuName,
|
||||||
|
|
||||||
COUNT(DISTINCT p.pcode) AS totalSlot,
|
COUNT(p.pcode) AS totalSlot,
|
||||||
|
|
||||||
COUNT(DISTINCT CASE WHEN r.id IS NOT NULL THEN p.pcode END) AS usedSlot,
|
COUNT(u.pcode) AS usedSlot,
|
||||||
|
|
||||||
COUNT(DISTINCT p.pcode)
|
COUNT(p.pcode) - COUNT(u.pcode) AS unusedSlot
|
||||||
- COUNT(DISTINCT CASE WHEN r.id IS NOT NULL THEN p.pcode END) AS unusedSlot
|
|
||||||
|
|
||||||
FROM pcde_detail p
|
FROM pcde_detail p
|
||||||
LEFT JOIN rk_info r
|
|
||||||
ON r.pcode = p.pcode
|
LEFT JOIN (
|
||||||
AND r.cangku = p.warehouse_code
|
SELECT DISTINCT
|
||||||
AND r.is_delete = '0'
|
pcode,
|
||||||
AND r.is_chuku = '0'
|
cangku
|
||||||
|
FROM rk_info
|
||||||
|
WHERE is_delete = '0'
|
||||||
|
AND is_chuku = '0'
|
||||||
|
AND exec_status = '1'
|
||||||
|
) u
|
||||||
|
ON u.pcode = p.pcode
|
||||||
|
AND u.cangku = p.warehouse_code
|
||||||
|
|
||||||
WHERE p.is_delete = '0'
|
WHERE p.is_delete = '0'
|
||||||
AND p.warehouse_name IS NOT NULL
|
AND p.warehouse_name IS NOT NULL
|
||||||
AND TRIM(p.warehouse_name) <> ''
|
AND TRIM(p.warehouse_name) <> ''
|
||||||
|
|
||||||
GROUP BY p.warehouse_code, p.warehouse_name
|
GROUP BY
|
||||||
ORDER BY p.warehouse_code
|
p.warehouse_code,
|
||||||
|
p.warehouse_name
|
||||||
|
|
||||||
|
ORDER BY
|
||||||
|
p.warehouse_code
|
||||||
|
|
||||||
]]>
|
]]>
|
||||||
</select>
|
</select>
|
||||||
|
|
||||||
<select id="selectStockAgeExport30"
|
<select id="selectStockAgeExport30"
|
||||||
resultType="com.zg.project.wisdom.domain.vo.StockAgeExportVO">
|
resultType="com.zg.project.wisdom.domain.vo.StockAgeExportVO">
|
||||||
<![CDATA[
|
<![CDATA[
|
||||||
|
|||||||
Reference in New Issue
Block a user