diff --git a/api-admin/src/main/java/com/glxp/api/admin/controller/basic/BussinessLocalTypeController.java b/api-admin/src/main/java/com/glxp/api/admin/controller/basic/BussinessLocalTypeController.java index 42ceff9d..825462d9 100644 --- a/api-admin/src/main/java/com/glxp/api/admin/controller/basic/BussinessLocalTypeController.java +++ b/api-admin/src/main/java/com/glxp/api/admin/controller/basic/BussinessLocalTypeController.java @@ -3,13 +3,10 @@ package com.glxp.api.admin.controller.basic; import cn.hutool.core.util.StrUtil; import com.github.pagehelper.PageInfo; import com.glxp.api.admin.annotation.AuthRuleAnnotation; -import com.glxp.api.admin.constant.Constant; -import com.glxp.api.admin.entity.auth.AuthAdmin; import com.glxp.api.admin.entity.basic.BussinessChangeTypeEntity; import com.glxp.api.admin.entity.basic.BussinessLocalTypeEntity; import com.glxp.api.admin.entity.basic.BussinessTypeEntity; import com.glxp.api.admin.entity.business.StockOrderEntity; -import com.glxp.api.admin.exception.JsonException; import com.glxp.api.admin.req.basic.BusNoUserRequest; import com.glxp.api.admin.req.basic.BussinessLocalTypeFilterRequest; import com.glxp.api.admin.req.business.StockOrderFilterRequest; @@ -30,11 +27,8 @@ import org.springframework.web.bind.annotation.GetMapping; import org.springframework.web.bind.annotation.PostMapping; import org.springframework.web.bind.annotation.RequestBody; import org.springframework.web.bind.annotation.RestController; -import org.springframework.web.context.request.RequestContextHolder; -import org.springframework.web.context.request.ServletRequestAttributes; import javax.annotation.Resource; -import javax.servlet.http.HttpServletRequest; import java.util.ArrayList; import java.util.Date; import java.util.List; @@ -227,5 +221,16 @@ public class BussinessLocalTypeController { return ResultVOUtils.success("更新成功"); } + /** + * 第三方系统,单据提交接口,查询未绑定的业务单据类型 + * + * @return + */ + @GetMapping("/udiwms/localBusType/filterForThirdSys") + public BaseResponse filterForThirdSys() { + List list = bussinessLocalTypeService.filterForThirdSys(); + return ResultVOUtils.success(list); + } + } diff --git a/api-admin/src/main/java/com/glxp/api/admin/controller/business/StockOrderController.java b/api-admin/src/main/java/com/glxp/api/admin/controller/business/StockOrderController.java index a300fe3e..c3fb2e9e 100644 --- a/api-admin/src/main/java/com/glxp/api/admin/controller/business/StockOrderController.java +++ b/api-admin/src/main/java/com/glxp/api/admin/controller/business/StockOrderController.java @@ -5,9 +5,7 @@ import cn.hutool.core.collection.CollUtil; import cn.hutool.core.util.StrUtil; import com.github.pagehelper.PageInfo; import com.glxp.api.admin.annotation.AuthRuleAnnotation; -import com.glxp.api.admin.constant.Constant; import com.glxp.api.admin.constant.ConstantStatus; -import com.glxp.api.admin.controller.inventory.InvPrintController; import com.glxp.api.admin.entity.auth.AuthAdmin; import com.glxp.api.admin.entity.basic.BasicUnitMaintainEntity; import com.glxp.api.admin.entity.basic.BussinessLocalTypeEntity; @@ -15,7 +13,6 @@ import com.glxp.api.admin.entity.basic.BussinessTypeEntity; import com.glxp.api.admin.entity.business.StockOrderDetailEntity; import com.glxp.api.admin.entity.business.StockOrderEntity; import com.glxp.api.admin.entity.business.StockQRCodeTextEntity; -import com.glxp.api.admin.entity.info.CompanyEntity; import com.glxp.api.admin.entity.info.SystemParamConfigEntity; import com.glxp.api.admin.entity.inout.OrderEntity; import com.glxp.api.admin.entity.inout.WarehouseEntity; @@ -50,7 +47,6 @@ import com.glxp.api.admin.service.inout.CodesService; import com.glxp.api.admin.service.inout.CodesTempService; import com.glxp.api.admin.service.inout.OrderService; import com.glxp.api.admin.service.inout.WarehouseUserService; -import com.glxp.api.admin.service.inventory.InCodeLogService; import com.glxp.api.admin.service.inventory.InvStockPrintService; import com.glxp.api.admin.service.inventory.InvWarehouseService; import com.glxp.api.admin.util.*; @@ -59,7 +55,6 @@ import com.glxp.api.common.res.BaseResponse; import com.glxp.api.common.util.ResultVOUtils; import org.apache.commons.lang3.StringUtils; import org.springframework.beans.BeanUtils; -import org.springframework.beans.factory.annotation.Value; import org.springframework.validation.BindingResult; import org.springframework.web.bind.annotation.*; import org.springframework.web.context.request.RequestContextHolder; @@ -278,9 +273,6 @@ public class StockOrderController { return ResultVOUtils.error(ResultEnum.PARAM_VERIFY_FALL, bindingResult.getFieldError().getDefaultMessage()); } List stockOrderEntityList; -// if (stockOrderFilterRequest.getStatus() == null) { -// stockOrderFilterRequest.setStatus(0 + ""); -// } if (StringUtils.isNotBlank(stockOrderFilterRequest.getCorpId())) { Integer userId = customerService.getUserId(); @@ -308,6 +300,7 @@ public class StockOrderController { //判断订单是否可以补单 List resultList = orderService.checkSupplementOrder(stockOrderEntityList); + resultList = orderService.checkSubmitOrder(resultList); PageSimpleResponse pageSimpleResponse = new PageSimpleResponse<>(); pageSimpleResponse.setTotal(pageInfo.getTotal()); pageSimpleResponse.setList(resultList); diff --git a/api-admin/src/main/java/com/glxp/api/admin/dao/basic/BasicThirdSysBusApiDao.java b/api-admin/src/main/java/com/glxp/api/admin/dao/basic/BasicThirdSysBusApiDao.java index 9873e4d5..a6c728be 100644 --- a/api-admin/src/main/java/com/glxp/api/admin/dao/basic/BasicThirdSysBusApiDao.java +++ b/api-admin/src/main/java/com/glxp/api/admin/dao/basic/BasicThirdSysBusApiDao.java @@ -24,4 +24,6 @@ public interface BasicThirdSysBusApiDao { boolean saveBusTypes(@Param("list") List list); boolean deleteById(@Param("id") Integer id); + + BasicThirdSysBusApiEntity selectByCode(@Param("code") String code); } diff --git a/api-admin/src/main/java/com/glxp/api/admin/dao/basic/BussinessLocalTypeDao.java b/api-admin/src/main/java/com/glxp/api/admin/dao/basic/BussinessLocalTypeDao.java index 6c5989c6..205efa38 100644 --- a/api-admin/src/main/java/com/glxp/api/admin/dao/basic/BussinessLocalTypeDao.java +++ b/api-admin/src/main/java/com/glxp/api/admin/dao/basic/BussinessLocalTypeDao.java @@ -3,7 +3,6 @@ package com.glxp.api.admin.dao.basic; import com.glxp.api.admin.entity.basic.BussinessLocalTypeEntity; import com.glxp.api.admin.req.basic.BusOriginJoinFilterRequest; import com.glxp.api.admin.req.basic.BussinessLocalTypeFilterRequest; -import com.glxp.api.admin.req.receipt.BussinessTypeFilterRequest; import com.glxp.api.admin.res.basic.BussinessOriginTypeResponse; import org.apache.ibatis.annotations.Mapper; import org.apache.ibatis.annotations.Param; @@ -37,4 +36,6 @@ public interface BussinessLocalTypeDao { boolean insertBussinessType(BussinessLocalTypeEntity bussinessTypeEntity); boolean deleteById(@Param("id") String id); + + List filterFoeThirdSys(); } diff --git a/api-admin/src/main/java/com/glxp/api/admin/dao/inout/OrderDao.java b/api-admin/src/main/java/com/glxp/api/admin/dao/inout/OrderDao.java index 1affe07b..3f5cc1ee 100644 --- a/api-admin/src/main/java/com/glxp/api/admin/dao/inout/OrderDao.java +++ b/api-admin/src/main/java/com/glxp/api/admin/dao/inout/OrderDao.java @@ -54,4 +54,5 @@ public interface OrderDao { List findAllByTime(OrderFilterRequest orderFilterRequest); + Integer selectExportStatus(@Param("id") String id); } diff --git a/api-admin/src/main/java/com/glxp/api/admin/res/inout/StockOrderResponse.java b/api-admin/src/main/java/com/glxp/api/admin/res/inout/StockOrderResponse.java index 086fa881..73caad20 100644 --- a/api-admin/src/main/java/com/glxp/api/admin/res/inout/StockOrderResponse.java +++ b/api-admin/src/main/java/com/glxp/api/admin/res/inout/StockOrderResponse.java @@ -6,6 +6,13 @@ import lombok.Data; @Data public class StockOrderResponse extends StockOrderEntity { + //是否可以补单 private boolean enableSupplementOrder; + //此单据是否可以提交 + private boolean submitFlag; + + //单据导出状态 + private Integer exportStatus; + } diff --git a/api-admin/src/main/java/com/glxp/api/admin/service/basic/BussinessLocalTypeService.java b/api-admin/src/main/java/com/glxp/api/admin/service/basic/BussinessLocalTypeService.java index f29383d2..5061ad26 100644 --- a/api-admin/src/main/java/com/glxp/api/admin/service/basic/BussinessLocalTypeService.java +++ b/api-admin/src/main/java/com/glxp/api/admin/service/basic/BussinessLocalTypeService.java @@ -37,5 +37,6 @@ public interface BussinessLocalTypeService { boolean deleteById(String id); + List filterForThirdSys(); } diff --git a/api-admin/src/main/java/com/glxp/api/admin/service/basic/BussinessOriginTypeService.java b/api-admin/src/main/java/com/glxp/api/admin/service/basic/BussinessOriginTypeService.java index ffb2bae6..b36960ea 100644 --- a/api-admin/src/main/java/com/glxp/api/admin/service/basic/BussinessOriginTypeService.java +++ b/api-admin/src/main/java/com/glxp/api/admin/service/basic/BussinessOriginTypeService.java @@ -28,10 +28,13 @@ public interface BussinessOriginTypeService { List filterJoinList(BussinessOriginTypeFilterRequest bussinessOriginTypeFilterRequest); + //第三方单据类型 BussinessOriginTypeResponse finByThirdAction(String action); + //业务单据 BussinessOriginTypeResponse finByLocalAction(String action); + //扫码单据 BussinessOriginTypeResponse finByMainAction(String action); } diff --git a/api-admin/src/main/java/com/glxp/api/admin/service/basic/impl/BussinessLocalTypeServiceImpl.java b/api-admin/src/main/java/com/glxp/api/admin/service/basic/impl/BussinessLocalTypeServiceImpl.java index 2c67e016..23beae02 100644 --- a/api-admin/src/main/java/com/glxp/api/admin/service/basic/impl/BussinessLocalTypeServiceImpl.java +++ b/api-admin/src/main/java/com/glxp/api/admin/service/basic/impl/BussinessLocalTypeServiceImpl.java @@ -4,10 +4,8 @@ import com.github.pagehelper.PageHelper; import com.glxp.api.admin.dao.basic.BussinessLocalTypeDao; import com.glxp.api.admin.entity.basic.BasicThirdSysDetailEntity; import com.glxp.api.admin.entity.basic.BussinessLocalTypeEntity; -import com.glxp.api.admin.entity.basic.BussinessTypeEntity; import com.glxp.api.admin.req.basic.BusOriginJoinFilterRequest; import com.glxp.api.admin.req.basic.BussinessLocalTypeFilterRequest; -import com.glxp.api.admin.req.receipt.BussinessTypeFilterRequest; import com.glxp.api.admin.res.basic.BussinessOriginTypeResponse; import com.glxp.api.admin.service.basic.BasicThirdSysDetailService; import com.glxp.api.admin.service.basic.BussinessLocalTypeService; @@ -157,4 +155,10 @@ public class BussinessLocalTypeServiceImpl implements BussinessLocalTypeService public boolean deleteById(String id) { return bussinessLocalTypeDao.deleteById(id); } + + @Override + public List filterForThirdSys() { + //查询第三方系统,订单提交接口未绑定的业务单据类型 + return bussinessLocalTypeDao.filterFoeThirdSys(); + } } diff --git a/api-admin/src/main/java/com/glxp/api/admin/service/inout/OrderService.java b/api-admin/src/main/java/com/glxp/api/admin/service/inout/OrderService.java index ce2d7e11..b211d28f 100644 --- a/api-admin/src/main/java/com/glxp/api/admin/service/inout/OrderService.java +++ b/api-admin/src/main/java/com/glxp/api/admin/service/inout/OrderService.java @@ -71,4 +71,12 @@ public interface OrderService { * @return */ List checkSupplementOrder(List stockOrderEntityList); + + /** + * 校验此单据是否可以提交到第三方系统 + * + * @param orderResponseList + * @return + */ + List checkSubmitOrder(List orderResponseList); } diff --git a/api-admin/src/main/java/com/glxp/api/admin/service/inout/impl/OrderServiceImpl.java b/api-admin/src/main/java/com/glxp/api/admin/service/inout/impl/OrderServiceImpl.java index d1854880..e736ad29 100644 --- a/api-admin/src/main/java/com/glxp/api/admin/service/inout/impl/OrderServiceImpl.java +++ b/api-admin/src/main/java/com/glxp/api/admin/service/inout/impl/OrderServiceImpl.java @@ -5,12 +5,14 @@ import cn.hutool.core.collection.CollUtil; import cn.hutool.core.util.StrUtil; import com.github.pagehelper.PageHelper; import com.glxp.api.admin.constant.ConstantStatus; +import com.glxp.api.admin.dao.basic.BasicThirdSysBusApiDao; import com.glxp.api.admin.dao.basic.BussinessTypeDao; import com.glxp.api.admin.dao.business.StockOrderDao; +import com.glxp.api.admin.dao.inout.CodesDao; import com.glxp.api.admin.dao.inout.CodesTempDao; import com.glxp.api.admin.dao.inout.OrderDao; -import com.glxp.api.admin.dao.inout.CodesDao; import com.glxp.api.admin.dao.inventory.InvWarehouseDao; +import com.glxp.api.admin.entity.basic.BasicThirdSysBusApiEntity; import com.glxp.api.admin.entity.basic.BussinessTypeEntity; import com.glxp.api.admin.entity.business.StockOrderEntity; import com.glxp.api.admin.entity.info.SystemParamConfigEntity; @@ -32,9 +34,7 @@ import lombok.extern.slf4j.Slf4j; import org.springframework.stereotype.Service; import javax.annotation.Resource; -import java.util.ArrayList; -import java.util.Collections; -import java.util.List; +import java.util.*; @Slf4j @Service @@ -57,6 +57,8 @@ public class OrderServiceImpl implements OrderService { SystemParamConfigService systemParamConfigService; @Resource GennerOrderUtils gennerOrderUtils; + @Resource + private BasicThirdSysBusApiDao basicThirdSysBusApiDao; @Override public List listOrders(OrderQueryRequest orderQueryRequest) { @@ -296,5 +298,29 @@ public class OrderServiceImpl implements OrderService { return result; } + @Override + public List checkSubmitOrder(List orderResponseList) { + if (CollUtil.isEmpty(orderResponseList)) { + return Collections.emptyList(); + } + + //查询第三方系统的 + List actions = new ArrayList<>(); + for (StockOrderResponse stockOrderResponse : orderResponseList) { + if (!actions.contains(stockOrderResponse.getBillType())) { + BasicThirdSysBusApiEntity basicThirdSysBusApiEntity = basicThirdSysBusApiDao.selectByCode(stockOrderResponse.getBillType()); + actions.add(basicThirdSysBusApiEntity.getCode()); + } + + if (actions.contains(stockOrderResponse.getBillType())) { + stockOrderResponse.setSubmitFlag(true); + Integer exportStatus = orderDao.selectExportStatus(stockOrderResponse.getOrderIdFk()); + stockOrderResponse.setExportStatus(exportStatus); + }else { + stockOrderResponse.setSubmitFlag(false); + } + } + return orderResponseList; + } } diff --git a/api-admin/src/main/resources/mybatis/mapper/basic/BasicThirdSysBusApiDao.xml b/api-admin/src/main/resources/mybatis/mapper/basic/BasicThirdSysBusApiDao.xml index 2aee8d3f..19b21e66 100644 --- a/api-admin/src/main/resources/mybatis/mapper/basic/BasicThirdSysBusApiDao.xml +++ b/api-admin/src/main/resources/mybatis/mapper/basic/BasicThirdSysBusApiDao.xml @@ -74,4 +74,9 @@ from basic_third_sys_bus_api where id = #{id} + \ No newline at end of file diff --git a/api-admin/src/main/resources/mybatis/mapper/basic/BussinessLocalTypeDao.xml b/api-admin/src/main/resources/mybatis/mapper/basic/BussinessLocalTypeDao.xml index 39e249f9..c1aee27b 100644 --- a/api-admin/src/main/resources/mybatis/mapper/basic/BussinessLocalTypeDao.xml +++ b/api-admin/src/main/resources/mybatis/mapper/basic/BussinessLocalTypeDao.xml @@ -228,5 +228,12 @@ WHERE id = #{id} - + diff --git a/api-admin/src/main/resources/mybatis/mapper/inout/OrderDao.xml b/api-admin/src/main/resources/mybatis/mapper/inout/OrderDao.xml index 5de6d74b..6209ca87 100644 --- a/api-admin/src/main/resources/mybatis/mapper/inout/OrderDao.xml +++ b/api-admin/src/main/resources/mybatis/mapper/inout/OrderDao.xml @@ -518,4 +518,10 @@ #{item} + + \ No newline at end of file