Commit 90526643 authored by lanbaoming's avatar lanbaoming

修改提货单状态逻辑判断

parent a45fd369
...@@ -36,28 +36,28 @@ import org.apache.ibatis.annotations.Select; ...@@ -36,28 +36,28 @@ import org.apache.ibatis.annotations.Select;
/** /**
* 出货 Mapper * 出货 Mapper
*
* @author lalala * @author lalala
*/ */
@Mapper @Mapper
public interface BoxMapper extends AbstractMapper<BoxDO> { public interface BoxMapper extends AbstractMapper<BoxDO> {
default PageResult<BoxBackVO> selectPage1(PageVO page, Object object) { default PageResult<BoxBackVO> selectPage1(PageVO page, Object object) {
if (object instanceof BoxQueryVO) { if (object instanceof BoxQueryVO) {
BoxQueryVO vo = (BoxQueryVO)object; BoxQueryVO vo = (BoxQueryVO) object;
if(StringUtils.isEmpty(vo.getTransportType())) { if (StringUtils.isEmpty(vo.getTransportType())) {
vo.setTransportType(null); vo.setTransportType(null);
} }
List<Long> warehouseIdList = vo.getWarehouseIdList(); List<Long> warehouseIdList = vo.getWarehouseIdList();
String lastSql = null; String lastSql = null;
if(vo.getLadingBillStatus() != null) { if (vo.getLadingBillStatus() != null) {
if(vo.getLadingBillStatus() == 0) { if (vo.getLadingBillStatus() == 0) {
lastSql = " having ladingCount=0"; lastSql = " having ladingCount=0";
} else if(vo.getLadingBillStatus() == 1) { } else if (vo.getLadingBillStatus() == 1) {
lastSql = " having ladingCount <> orderCount and ladingCount > 0"; lastSql = " having ladingCount <> orderCount and ladingCount > 0";
} else if(vo.getLadingBillStatus() == 2) { } else if (vo.getLadingBillStatus() == 2) {
lastSql = " having ladingCount = orderCount and ladingCount > 0"; lastSql = " having ladingCount = orderCount and ladingCount > 0";
} }
} }
...@@ -160,9 +160,9 @@ public interface BoxMapper extends AbstractMapper<BoxDO> { ...@@ -160,9 +160,9 @@ public interface BoxMapper extends AbstractMapper<BoxDO> {
Long orderCount = (Long) recordMap.get("orderCount"); Long orderCount = (Long) recordMap.get("orderCount");
Long ladingCount = (Long) recordMap.get("ladingCount"); Long ladingCount = (Long) recordMap.get("ladingCount");
boxEntity.setLadingBillStatus(0); boxEntity.setLadingBillStatus(0);
if(orderCount != 0) { if (orderCount != 0) {
if(ladingCount > 0) { if (ladingCount > 0) {
if(ladingCount >= orderCount) { if (ladingCount >= orderCount) {
boxEntity.setLadingBillStatus(2); boxEntity.setLadingBillStatus(2);
} else { } else {
boxEntity.setLadingBillStatus(1); boxEntity.setLadingBillStatus(1);
...@@ -181,19 +181,19 @@ public interface BoxMapper extends AbstractMapper<BoxDO> { ...@@ -181,19 +181,19 @@ public interface BoxMapper extends AbstractMapper<BoxDO> {
default PageResult<BoxBackVO> selectPage2(PageVO page, Object object) { default PageResult<BoxBackVO> selectPage2(PageVO page, Object object) {
if (object instanceof BoxQueryVO) { if (object instanceof BoxQueryVO) {
BoxQueryVO vo = (BoxQueryVO)object; BoxQueryVO vo = (BoxQueryVO) object;
if(StringUtils.isEmpty(vo.getTransportType())) { if (StringUtils.isEmpty(vo.getTransportType())) {
vo.setTransportType(null); vo.setTransportType(null);
} }
List<Long> warehouseIdList = vo.getWarehouseIdList(); List<Long> warehouseIdList = vo.getWarehouseIdList();
String lastSql = null; String lastSql = null;
if(vo.getLadingBillStatus() != null) { if (vo.getLadingBillStatus() != null) {
if(vo.getLadingBillStatus() == 0) { if (vo.getLadingBillStatus() == 0) {
lastSql = " and ladingCount=0"; lastSql = " and ladingCount=0";
} else if(vo.getLadingBillStatus() == 1) { } else if (vo.getLadingBillStatus() == 1) {
lastSql = " and ladingCount <> orderCount and ladingCount > 0"; lastSql = " and ladingCount <> orderCount and ladingCount > 0";
} else if(vo.getLadingBillStatus() == 2) { } else if (vo.getLadingBillStatus() == 2) {
lastSql = " and ladingCount = orderCount and ladingCount > 0"; lastSql = " and ladingCount = orderCount and ladingCount > 0";
} }
} }
...@@ -307,9 +307,12 @@ public interface BoxMapper extends AbstractMapper<BoxDO> { ...@@ -307,9 +307,12 @@ public interface BoxMapper extends AbstractMapper<BoxDO> {
Long orderCount = (Long) recordMap.get("orderCount"); Long orderCount = (Long) recordMap.get("orderCount");
Long ladingCount = (Long) recordMap.get("ladingCount"); Long ladingCount = (Long) recordMap.get("ladingCount");
boxEntity.setLadingBillStatus(0); boxEntity.setLadingBillStatus(0);
if(orderCount != 0) { if (orderCount != 0) {
if(ladingCount > 0) { if (ladingCount > 0) {
if(orderCount.equals(ladingCount)) { if (orderCount.equals(ladingCount)) {
boxEntity.setLadingBillStatus(2);
} else if (orderCount < ladingCount) {
//lanbm 2024-04-16 添加的逻辑,提单有可能补单
boxEntity.setLadingBillStatus(2); boxEntity.setLadingBillStatus(2);
} else { } else {
boxEntity.setLadingBillStatus(1); boxEntity.setLadingBillStatus(1);
...@@ -327,11 +330,10 @@ public interface BoxMapper extends AbstractMapper<BoxDO> { ...@@ -327,11 +330,10 @@ public interface BoxMapper extends AbstractMapper<BoxDO> {
} }
@Override @Override
default List<BoxDO> selectList(Object object) { default List<BoxDO> selectList(Object object) {
if (object instanceof BoxQueryVO) { if (object instanceof BoxQueryVO) {
BoxQueryVO vo = (BoxQueryVO)object; BoxQueryVO vo = (BoxQueryVO) object;
return selectList(new LambdaQuery<BoxDO>() return selectList(new LambdaQuery<BoxDO>()
.eqIfPresent(BoxDO::getId, vo.getId()) .eqIfPresent(BoxDO::getId, vo.getId())
.eqIfPresent(BoxDO::getSelfNo, vo.getSelfNo()) .eqIfPresent(BoxDO::getSelfNo, vo.getSelfNo())
...@@ -402,7 +404,7 @@ public interface BoxMapper extends AbstractMapper<BoxDO> { ...@@ -402,7 +404,7 @@ public interface BoxMapper extends AbstractMapper<BoxDO> {
String beginJSDate = null; String beginJSDate = null;
String endJsDate = null; String endJsDate = null;
if(vo.getBeginJsDate() != null) { if (vo.getBeginJsDate() != null) {
beginJSDate = DateUtil.format(vo.getBeginJsDate(), "yyyy-MM-dd HH:mm:ss"); beginJSDate = DateUtil.format(vo.getBeginJsDate(), "yyyy-MM-dd HH:mm:ss");
endJsDate = DateUtil.format(vo.getEndJsDate(), "yyyy-MM-dd HH:mm:ss"); endJsDate = DateUtil.format(vo.getEndJsDate(), "yyyy-MM-dd HH:mm:ss");
} }
...@@ -411,6 +413,7 @@ public interface BoxMapper extends AbstractMapper<BoxDO> { ...@@ -411,6 +413,7 @@ public interface BoxMapper extends AbstractMapper<BoxDO> {
vo.getSelfNo(), vo.getBoxStatus(), vo.getSlStatus(), beginJSDate, endJsDate); vo.getSelfNo(), vo.getBoxStatus(), vo.getSlStatus(), beginJSDate, endJsDate);
// return selectPage(page, boxQuery); // return selectPage(page, boxQuery);
} }
@ResultType(BoxDO.class) @ResultType(BoxDO.class)
@Select({ @Select({
"<script>", "<script>",
...@@ -518,8 +521,8 @@ public interface BoxMapper extends AbstractMapper<BoxDO> { ...@@ -518,8 +521,8 @@ public interface BoxMapper extends AbstractMapper<BoxDO> {
@Override @Override
default PageResult<BoxDO> selectPage(PageVO page, Object object) { default PageResult<BoxDO> selectPage(PageVO page, Object object) {
if (object instanceof BoxQueryVO) { if (object instanceof BoxQueryVO) {
BoxQueryVO vo = (BoxQueryVO)object; BoxQueryVO vo = (BoxQueryVO) object;
if(StringUtils.isEmpty(vo.getTransportType())) { if (StringUtils.isEmpty(vo.getTransportType())) {
vo.setTransportType(null); vo.setTransportType(null);
} }
List<Long> warehouseIdList = vo.getWarehouseIdList(); List<Long> warehouseIdList = vo.getWarehouseIdList();
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment