MrShi
2 天以前 39fc2d6754953e41a7334a2166347baacfcfb40a
server/visits/dmvisit_admin/src/main/java/com/doumee/api/business/WmsPushController.java
@@ -4,38 +4,21 @@
import com.doumee.api.BaseController;
import com.doumee.core.annotation.pr.PreventRepeat;
import com.doumee.core.exception.BusinessException;
import com.doumee.core.haikang.model.param.request.AcsDeviceListRequest;
import com.doumee.core.haikang.model.param.request.EventSubRequest;
import com.doumee.core.haikang.model.param.request.ParkListRequest;
import com.doumee.core.haikang.model.param.request.PrivilegeGroupRequest;
import com.doumee.core.haikang.model.param.request.event.acs.EventAcsRequest;
import com.doumee.core.haikang.model.param.request.event.parks.EventParkRequest;
import com.doumee.core.haikang.model.param.request.event.visit.EventVisitRequest;
import com.doumee.core.model.ApiResponse;
import com.doumee.core.utils.Constants;
import com.doumee.core.wms.model.request.WmsActionNoticeRequest;
import com.doumee.core.wms.model.request.WmsBaseRequest;
import com.doumee.core.wms.model.request.WmsInboundNoticeRequest;
import com.doumee.core.wms.model.request.WmsOutboundNoticeRequest;
import com.doumee.core.wms.model.response.WmsBaseResponse;
import com.doumee.service.business.WmsService;
import com.doumee.service.business.impl.hksync.HkSyncDeviceServiceImpl;
import com.doumee.service.business.impl.hksync.HkSyncParkServiceImpl;
import com.doumee.service.business.impl.hksync.HkSyncPrivilegeServiceImpl;
import com.doumee.service.business.impl.hksync.HkSyncPushServiceImpl;
import com.doumee.service.business.third.WmsService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import lombok.extern.slf4j.Slf4j;
import org.apache.commons.lang3.StringUtils;
import org.apache.shiro.authz.annotation.RequiresPermissions;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import java.util.List;
/**
 * @author 江蹄蹄
@@ -51,64 +34,63 @@
    private WmsService wmsService;
    @PreventRepeat
    @ApiOperation("【CMS】推送入库单通知任务")
    @ApiOperation("【WMS】推送入库单通知任务")
    @PostMapping("/push/inboundNotice")
    public WmsBaseResponse inboundNotice(@RequestBody List<WmsInboundNoticeRequest> param) {
    public WmsBaseResponse inboundNotice(@RequestBody WmsBaseRequest<WmsInboundNoticeRequest> param) {
        int success = Constants.ZERO;
        WmsBaseResponse result =null;
        try {
             result = wmsService.inboundNotice(param);
        }catch (BusinessException e){
            log.error("【CMS】推送入库单通知任务===失败:"+e.getMessage());
            log.error("【WMS】推送入库单通知任务===失败:"+e.getMessage());
            success = Constants.ONE;
        }catch (Exception e){
            log.error("【CMS】推送入库单通知任务===失败:"+e.getMessage());
            log.error("【WMS】推送入库单通知任务===失败:"+e.getMessage());
            e.printStackTrace();
            success = Constants.ONE;
        }finally {
            wmsService.saveInterfaceLog("/wms/push/inboundNotice", "推送入库单通知任务",JSONObject.toJSONString(param),
                    success, JSONObject.toJSONString(result),Constants.ONE);
        }
        return result;
    }
    @PreventRepeat
    @ApiOperation("【CMS】推送出库单通知任务")
    @ApiOperation("【WMS】推送出库单通知任务")
    @PostMapping("/push/outboundNotice")
    public WmsBaseResponse outboundNotice(@RequestBody List<WmsOutboundNoticeRequest> param) {
    public WmsBaseResponse outboundNotice(@RequestBody WmsBaseRequest<WmsOutboundNoticeRequest> param) {
        int success = Constants.ZERO;
        WmsBaseResponse result =null;
        try {
              result = wmsService.outboundNotice(param);
        }catch (BusinessException e){
            log.error("【CMS】推送出库单通知任务===失败:"+e.getMessage());
            log.error("【WMS】推送出库单通知任务===失败:"+e.getMessage());
            success = Constants.ONE;
        }catch (Exception e){
            log.error("【CMS】推送出库单通知任务===失败:"+e.getMessage());
            log.error("【WMS】推送出库单通知任务===失败:"+e.getMessage());
            e.printStackTrace();
            success = Constants.ONE;
        }finally {
            wmsService.saveInterfaceLog("/wms/push/outboundNotice", "推送出库单通知任务",JSONObject.toJSONString(param),success
            wmsService.saveInterfaceLog("/wms/push/outboundNotice", "【WMS】推送出库单通知任务",JSONObject.toJSONString(param),success
                    , JSONObject.toJSONString(result),Constants.ONE);
        }
        return result;
    }
    @PreventRepeat
    @ApiOperation("【CMS】推送取消入库单通知任务")
    @ApiOperation("【WMS】推送取消入库单通知任务")
    @PostMapping("/push/cancelInbound")
    public WmsBaseResponse cancelInbound(@RequestBody List<WmsActionNoticeRequest> param) {
    public WmsBaseResponse cancelInbound(@RequestBody WmsBaseRequest<WmsActionNoticeRequest> param) {
        int success = Constants.ZERO;
        WmsBaseResponse result =null;
        try {
            result = wmsService.cancelInbound(param);
        }catch (BusinessException e){
            log.error("【CMS】推送取消入库单通知任务===失败:"+e.getMessage());
            log.error("【WMS】推送取消入库单通知任务===失败:"+e.getMessage());
            success = Constants.ONE;
        }catch (Exception e){
            log.error("【CMS】推送取消入库单通知任务===失败:"+e.getMessage());
            log.error("【WMS】推送取消入库单通知任务===失败:"+e.getMessage());
            e.printStackTrace();
            success = Constants.ONE;
        }finally {
@@ -118,39 +100,39 @@
        return result;
    }
    @PreventRepeat
    @ApiOperation("【CMS】推送取消出库单通知任务")
    @ApiOperation("【WMS】推送取消出库单通知任务")
    @PostMapping("/push/cancelOutbound")
    public WmsBaseResponse cancelOutbound(@RequestBody List<WmsActionNoticeRequest> param) {
    public WmsBaseResponse cancelOutbound(@RequestBody WmsBaseRequest<WmsActionNoticeRequest> param) {
        int success = Constants.ZERO;
        WmsBaseResponse result =null;
        try {
            result = wmsService.cancelOutbound(param);
        }catch (BusinessException e){
            log.error("【CMS】推送取消出库单通知任务===失败:"+e.getMessage());
            log.error("【WMS】推送取消出库单通知任务===失败:"+e.getMessage());
            success = Constants.ONE;
        }catch (Exception e){
            log.error("【CMS】推送取消出库单通知任务===失败:"+e.getMessage());
            log.error("【WMS】推送取消出库单通知任务===失败:"+e.getMessage());
            e.printStackTrace();
            success = Constants.ONE;
        }finally {
            wmsService.saveInterfaceLog("/wms/push/cancelOutbound", "推送取消出库单通知任务",
            wmsService.saveInterfaceLog("/wms/push/cancelOutbound", "【TMS】推送取消出库单通知任务",
                    JSONObject.toJSONString(param),  success, JSONObject.toJSONString(result),Constants.ONE);
        }
        return result;
    }
    @PreventRepeat
    @ApiOperation("【CMS】推送出入库作业完成通知任务")
    @ApiOperation("【WMS】推送出入库作业完成通知任务")
    @PostMapping("/push/doneTask")
    public WmsBaseResponse doneTask(@RequestBody List<WmsActionNoticeRequest> param) {
    public WmsBaseResponse doneTask(@RequestBody WmsBaseRequest<WmsActionNoticeRequest> param) {
        int success = Constants.ZERO;
        WmsBaseResponse result =null;
        try {
            result = wmsService.doneTask(param);
        }catch (BusinessException e){
            log.error("【CMS】推送出入库作业完成通知任务===失败:"+e.getMessage());
            log.error("【WMS】推送出入库作业完成通知任务===失败:"+e.getMessage());
            success = Constants.ONE;
        }catch (Exception e){
            log.error("【CMS】推送出入库作业完成通知任务===失败:"+e.getMessage());
            log.error("【WMS】推送出入库作业完成通知任务===失败:"+e.getMessage());
            e.printStackTrace();
            success = Constants.ONE;
        }finally {