no message
							parent
							
								
									8d773f3630
								
							
						
					
					
						commit
						a74b651dce
					
				| 
						 | 
				
			
			@ -26,5 +26,5 @@ public class MoInfo {
 | 
			
		|||
    int pageSize;
 | 
			
		||||
 | 
			
		||||
    @ApiModelProperty(value = "参数")
 | 
			
		||||
    Params params;
 | 
			
		||||
    MoParams params;
 | 
			
		||||
}
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -0,0 +1,38 @@
 | 
			
		|||
package com.youchain.businessdata.inputJson;
 | 
			
		||||
 | 
			
		||||
import io.swagger.annotations.ApiModelProperty;
 | 
			
		||||
import io.swagger.v3.oas.annotations.media.Schema;
 | 
			
		||||
import lombok.Data;
 | 
			
		||||
 | 
			
		||||
import java.util.Set;
 | 
			
		||||
@Data
 | 
			
		||||
public class MoParams {
 | 
			
		||||
    @ApiModelProperty(value = "库存组织id")
 | 
			
		||||
    @Schema(example = "100059")
 | 
			
		||||
    int orgId;
 | 
			
		||||
 | 
			
		||||
    @ApiModelProperty(value = "子库编码")
 | 
			
		||||
    @Schema(example = "[\"MA2111\"]")
 | 
			
		||||
    Set invCodes;
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
    @ApiModelProperty(value = "开始时间")
 | 
			
		||||
    @Schema(example = "2023-07-03 00:00:00")
 | 
			
		||||
    String startTime;
 | 
			
		||||
 | 
			
		||||
    @ApiModelProperty(value = "结束时间")
 | 
			
		||||
    @Schema(example = "2023-07-03 23:59:59")
 | 
			
		||||
    String endTime;
 | 
			
		||||
 | 
			
		||||
    public MoParams() {
 | 
			
		||||
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    public MoParams(int orgId, Set invCodes, String startTime, String endTime) {
 | 
			
		||||
        this.orgId = orgId;
 | 
			
		||||
        this.invCodes = invCodes;
 | 
			
		||||
        this.startTime = startTime;
 | 
			
		||||
        this.endTime = endTime;
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
}
 | 
			
		||||
| 
						 | 
				
			
			@ -1,9 +1,7 @@
 | 
			
		|||
package com.youchain.businessdata.inputJson;
 | 
			
		||||
 | 
			
		||||
import io.swagger.annotations.ApiModelProperty;
 | 
			
		||||
import io.swagger.annotations.ApiParam;
 | 
			
		||||
import io.swagger.v3.oas.annotations.media.Schema;
 | 
			
		||||
import lombok.Builder;
 | 
			
		||||
import lombok.Data;
 | 
			
		||||
 | 
			
		||||
/**
 | 
			
		||||
| 
						 | 
				
			
			@ -20,13 +18,13 @@ public class OrderInfo {
 | 
			
		|||
    String sourceSystem;
 | 
			
		||||
 | 
			
		||||
    @ApiModelProperty(value = "参数")
 | 
			
		||||
    Params params;
 | 
			
		||||
    OrderParams params;
 | 
			
		||||
 | 
			
		||||
    public OrderInfo() {
 | 
			
		||||
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    public OrderInfo(String ifaceCode, String sourceSystem, Params params) {
 | 
			
		||||
    public OrderInfo(String ifaceCode, String sourceSystem, OrderParams params) {
 | 
			
		||||
        this.ifaceCode = ifaceCode;
 | 
			
		||||
        this.sourceSystem = sourceSystem;
 | 
			
		||||
        this.params = params;
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -2,19 +2,18 @@ package com.youchain.businessdata.inputJson;
 | 
			
		|||
 | 
			
		||||
import io.swagger.annotations.ApiModelProperty;
 | 
			
		||||
import io.swagger.v3.oas.annotations.media.Schema;
 | 
			
		||||
import lombok.Builder;
 | 
			
		||||
import lombok.Data;
 | 
			
		||||
 | 
			
		||||
import java.util.Set;
 | 
			
		||||
 | 
			
		||||
@Data
 | 
			
		||||
public class Params {
 | 
			
		||||
public class OrderParams {
 | 
			
		||||
    @ApiModelProperty(value = "库存组织id")
 | 
			
		||||
    @Schema(example = "100059")
 | 
			
		||||
    int orgId;
 | 
			
		||||
 | 
			
		||||
    @ApiModelProperty(value = "子库编码")
 | 
			
		||||
    @Schema(example = "[\"MA1181\", \"MA1181\"]")
 | 
			
		||||
    @Schema(example = "[\"MA2111\"]")
 | 
			
		||||
    Set invCodes;
 | 
			
		||||
 | 
			
		||||
    @ApiModelProperty(value = "检验结果")
 | 
			
		||||
| 
						 | 
				
			
			@ -36,11 +35,11 @@ public class Params {
 | 
			
		|||
    @Schema(example = "100")
 | 
			
		||||
    int pageSize;
 | 
			
		||||
 | 
			
		||||
    public Params(){
 | 
			
		||||
    public OrderParams(){
 | 
			
		||||
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    public Params(int orgId, Set invCodes, String iqcResult, String startTime, String endTime,int pageNo,int pageSize) {
 | 
			
		||||
    public OrderParams(int orgId, Set invCodes, String iqcResult, String startTime, String endTime, int pageNo, int pageSize) {
 | 
			
		||||
        this.orgId = orgId;
 | 
			
		||||
        this.invCodes = invCodes;
 | 
			
		||||
        this.iqcResult = iqcResult;
 | 
			
		||||
| 
						 | 
				
			
			@ -0,0 +1,24 @@
 | 
			
		|||
package com.youchain.businessdata.inputJson;
 | 
			
		||||
 | 
			
		||||
import io.swagger.annotations.ApiModelProperty;
 | 
			
		||||
import io.swagger.v3.oas.annotations.media.Schema;
 | 
			
		||||
import lombok.Data;
 | 
			
		||||
/**
 | 
			
		||||
 * @author <NAME>
 | 
			
		||||
 * @date 2024/04/12
 | 
			
		||||
 */
 | 
			
		||||
@Data
 | 
			
		||||
public class ReturnIssueInfo {
 | 
			
		||||
 | 
			
		||||
    @ApiModelProperty(value = "接口编码")
 | 
			
		||||
    @Schema(example = "MLS-WQ-006")
 | 
			
		||||
    String ifaceCode;
 | 
			
		||||
 | 
			
		||||
    @ApiModelProperty(value = "来源系统")
 | 
			
		||||
    @Schema(example = "WQ")
 | 
			
		||||
    String sourceSystem;
 | 
			
		||||
 | 
			
		||||
    @ApiModelProperty(value = "参数")
 | 
			
		||||
    ReturnIssueInfoParams  params;
 | 
			
		||||
 | 
			
		||||
}
 | 
			
		||||
| 
						 | 
				
			
			@ -0,0 +1,31 @@
 | 
			
		|||
package com.youchain.businessdata.inputJson;
 | 
			
		||||
 | 
			
		||||
import io.swagger.annotations.ApiModelProperty;
 | 
			
		||||
import io.swagger.v3.oas.annotations.media.Schema;
 | 
			
		||||
import lombok.Data;
 | 
			
		||||
 | 
			
		||||
import java.util.Set;
 | 
			
		||||
 | 
			
		||||
@Data
 | 
			
		||||
public class ReturnIssueInfoParams {
 | 
			
		||||
    @ApiModelProperty(value = "类型")
 | 
			
		||||
    @Schema(example = "ISSUE")
 | 
			
		||||
    String billType;
 | 
			
		||||
 | 
			
		||||
    @ApiModelProperty(value = "库存组织id")
 | 
			
		||||
    @Schema(example = "100219")
 | 
			
		||||
    int orgId;
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
    @ApiModelProperty(value = "标签集合")
 | 
			
		||||
    @Schema(example = "[\"DC0001\"]")
 | 
			
		||||
    Set labelNos;
 | 
			
		||||
 | 
			
		||||
    @ApiModelProperty(value = "子库编码")
 | 
			
		||||
    @Schema(example = "MC1311")
 | 
			
		||||
    String invCode;
 | 
			
		||||
 | 
			
		||||
    @ApiModelProperty(value = "需求工单")
 | 
			
		||||
    @Schema(example = "ZZ总部18210606021401")
 | 
			
		||||
    String workOrderName;
 | 
			
		||||
}
 | 
			
		||||
| 
						 | 
				
			
			@ -0,0 +1,25 @@
 | 
			
		|||
package com.youchain.businessdata.inputJson;
 | 
			
		||||
 | 
			
		||||
import io.swagger.annotations.ApiModelProperty;
 | 
			
		||||
import io.swagger.v3.oas.annotations.media.Schema;
 | 
			
		||||
import lombok.Data;
 | 
			
		||||
/**
 | 
			
		||||
 * @author <huojin>
 | 
			
		||||
 * Description:回传MO信息入参
 | 
			
		||||
 * @date 2024/04/12
 | 
			
		||||
 */
 | 
			
		||||
@Data
 | 
			
		||||
public class ReturnMoInfo {
 | 
			
		||||
    @ApiModelProperty(value = "接口编码")
 | 
			
		||||
    @Schema(example = "MLS-WQ-004")
 | 
			
		||||
    String ifaceCode;
 | 
			
		||||
 | 
			
		||||
    @ApiModelProperty(value = "来源系统")
 | 
			
		||||
    @Schema(example = "WQ")
 | 
			
		||||
    String sourceSystem;
 | 
			
		||||
 | 
			
		||||
    @ApiModelProperty(value = "参数")
 | 
			
		||||
    ReturnMoParams  params;
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
}
 | 
			
		||||
| 
						 | 
				
			
			@ -0,0 +1,22 @@
 | 
			
		|||
package com.youchain.businessdata.inputJson;
 | 
			
		||||
 | 
			
		||||
import io.swagger.annotations.ApiModelProperty;
 | 
			
		||||
import io.swagger.v3.oas.annotations.media.Schema;
 | 
			
		||||
import lombok.Data;
 | 
			
		||||
 | 
			
		||||
import java.util.Set;
 | 
			
		||||
@Data
 | 
			
		||||
public class ReturnMoParams {
 | 
			
		||||
 | 
			
		||||
    @ApiModelProperty(value = "库存组织id")
 | 
			
		||||
    @Schema(example = "100059")
 | 
			
		||||
    int orgId;
 | 
			
		||||
 | 
			
		||||
    @ApiModelProperty(value = "子库编码")
 | 
			
		||||
    @Schema(example = "MC1311")
 | 
			
		||||
    String invCode;
 | 
			
		||||
 | 
			
		||||
    @ApiModelProperty(value = "标签集合")
 | 
			
		||||
    @Schema(example = "[\"DC220608000006\"]")
 | 
			
		||||
    Set labelNos;
 | 
			
		||||
}
 | 
			
		||||
| 
						 | 
				
			
			@ -5,6 +5,8 @@ import com.youchain.annotation.Log;
 | 
			
		|||
import com.youchain.appupdate.inputJson.MissionStateCallback;
 | 
			
		||||
import com.youchain.businessdata.inputJson.MoInfo;
 | 
			
		||||
import com.youchain.businessdata.inputJson.OrderInfo;
 | 
			
		||||
import com.youchain.businessdata.inputJson.ReturnIssueInfo;
 | 
			
		||||
import com.youchain.businessdata.inputJson.ReturnMoInfo;
 | 
			
		||||
import com.youchain.businessdata.service.MlsService;
 | 
			
		||||
import com.youchain.exception.handler.ApiResult;
 | 
			
		||||
import io.swagger.annotations.Api;
 | 
			
		||||
| 
						 | 
				
			
			@ -36,12 +38,18 @@ public class MlsController {
 | 
			
		|||
    @ApiOperation("获取送货单信息")
 | 
			
		||||
    @AnonymousAccess
 | 
			
		||||
    public ResponseEntity<Object> getOrderInfo(@RequestBody OrderInfo orderInfo) {
 | 
			
		||||
        String resultJson = mlsService.getOrderJson(orderInfo);
 | 
			
		||||
        String resultJson = "";
 | 
			
		||||
        try {
 | 
			
		||||
            resultJson = mlsService.getOrderJson(orderInfo);//获取送货单JSON
 | 
			
		||||
        } catch (Exception e) {
 | 
			
		||||
            return new ResponseEntity<>(ApiResult.success(BAD_REQUEST.value(), e.getMessage(), ""), HttpStatus.BAD_REQUEST);
 | 
			
		||||
        }
 | 
			
		||||
 | 
			
		||||
        if (resultJson == null || resultJson.length() == 0) {
 | 
			
		||||
            return new ResponseEntity<>(ApiResult.success(BAD_REQUEST.value(), "接口异常!", ""), HttpStatus.BAD_REQUEST);
 | 
			
		||||
        } else {
 | 
			
		||||
            try {
 | 
			
		||||
                mlsService.getOrderInfo(resultJson);
 | 
			
		||||
                mlsService.getOrderInfo(resultJson);//获取送货单
 | 
			
		||||
                return new ResponseEntity<>(ApiResult.success(OK.value(), "", resultJson), HttpStatus.OK);
 | 
			
		||||
            } catch (Exception e) {
 | 
			
		||||
                return new ResponseEntity<>(ApiResult.success(BAD_REQUEST.value(), e.getMessage(), ""), HttpStatus.BAD_REQUEST);
 | 
			
		||||
| 
						 | 
				
			
			@ -52,15 +60,21 @@ public class MlsController {
 | 
			
		|||
 | 
			
		||||
    @PostMapping("/getMoInfo")
 | 
			
		||||
    @AnonymousAccess
 | 
			
		||||
    @Log("获取Mo票信息")
 | 
			
		||||
    @ApiOperation("获取Mo票信息")
 | 
			
		||||
    @Log("获取MO票信息")
 | 
			
		||||
    @ApiOperation("获取MO票信息")
 | 
			
		||||
    public ResponseEntity<Object> getMoInfo(@RequestBody MoInfo moInfo) {
 | 
			
		||||
        String resultJson = mlsService.getMoJson(moInfo);
 | 
			
		||||
        String resultJson = "";
 | 
			
		||||
        try {
 | 
			
		||||
            resultJson = mlsService.getMoJson(moInfo);//获取Mo票JSON
 | 
			
		||||
        } catch (Exception e) {
 | 
			
		||||
            return new ResponseEntity<>(ApiResult.success(BAD_REQUEST.value(), e.getMessage(), ""), HttpStatus.BAD_REQUEST);
 | 
			
		||||
        }
 | 
			
		||||
 | 
			
		||||
        if (resultJson == null || resultJson.length() == 0) {
 | 
			
		||||
            return new ResponseEntity<>(ApiResult.success(BAD_REQUEST.value(), "接口异常!", ""), HttpStatus.BAD_REQUEST);
 | 
			
		||||
        } else {
 | 
			
		||||
            try {
 | 
			
		||||
                mlsService.getMoInfo(resultJson);
 | 
			
		||||
                mlsService.getMoInfo(resultJson);//获取Mo票
 | 
			
		||||
                return new ResponseEntity<>(ApiResult.success(OK.value(), "", resultJson), HttpStatus.OK);
 | 
			
		||||
            } catch (Exception e) {
 | 
			
		||||
                return new ResponseEntity<>(ApiResult.success(BAD_REQUEST.value(), e.getMessage(), ""), HttpStatus.BAD_REQUEST);
 | 
			
		||||
| 
						 | 
				
			
			@ -68,4 +82,31 @@ public class MlsController {
 | 
			
		|||
        }
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    @PostMapping("/returnMo")
 | 
			
		||||
    @AnonymousAccess
 | 
			
		||||
    @Log("按MO票入库")
 | 
			
		||||
    @ApiOperation("按MO票入库")
 | 
			
		||||
    public ResponseEntity<Object> returnMo(@RequestBody ReturnMoInfo returnMoInfo) {
 | 
			
		||||
        try {
 | 
			
		||||
            String resultJson = mlsService.returnMo(returnMoInfo);//回传MO票J
 | 
			
		||||
            return new ResponseEntity<>(ApiResult.success(OK.value(), "", resultJson), HttpStatus.OK);
 | 
			
		||||
        } catch (Exception e) {
 | 
			
		||||
            return new ResponseEntity<>(ApiResult.success(BAD_REQUEST.value(), e.getMessage(), ""), HttpStatus.BAD_REQUEST);
 | 
			
		||||
        }
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    @PostMapping("/returnIssue")
 | 
			
		||||
    @AnonymousAccess
 | 
			
		||||
    @Log("叫料结果回传")
 | 
			
		||||
    @ApiOperation("叫料结果回传")
 | 
			
		||||
    public ResponseEntity<Object> returnIssue(@RequestBody ReturnIssueInfo returnMoInfo) {
 | 
			
		||||
        try {
 | 
			
		||||
            String resultJson = mlsService.returnIssue(returnMoInfo);//叫料结果回传
 | 
			
		||||
            return new ResponseEntity<>(ApiResult.success(OK.value(), "", resultJson), HttpStatus.OK);
 | 
			
		||||
        } catch (Exception e) {
 | 
			
		||||
            return new ResponseEntity<>(ApiResult.success(BAD_REQUEST.value(), e.getMessage(), ""), HttpStatus.BAD_REQUEST);
 | 
			
		||||
        }
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
}
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -3,6 +3,8 @@ package com.youchain.businessdata.service;
 | 
			
		|||
import com.youchain.annotation.Log;
 | 
			
		||||
import com.youchain.businessdata.inputJson.MoInfo;
 | 
			
		||||
import com.youchain.businessdata.inputJson.OrderInfo;
 | 
			
		||||
import com.youchain.businessdata.inputJson.ReturnIssueInfo;
 | 
			
		||||
import com.youchain.businessdata.inputJson.ReturnMoInfo;
 | 
			
		||||
import io.swagger.annotations.ApiOperation;
 | 
			
		||||
 | 
			
		||||
/**
 | 
			
		||||
| 
						 | 
				
			
			@ -10,6 +12,12 @@ import io.swagger.annotations.ApiOperation;
 | 
			
		|||
 */
 | 
			
		||||
public interface MlsService {
 | 
			
		||||
 | 
			
		||||
    /**
 | 
			
		||||
     * 获取ToKen
 | 
			
		||||
     * @return
 | 
			
		||||
     */
 | 
			
		||||
    String getToKen();
 | 
			
		||||
 | 
			
		||||
    /**
 | 
			
		||||
     * 获取送货单JSON
 | 
			
		||||
     * @return
 | 
			
		||||
| 
						 | 
				
			
			@ -34,4 +42,16 @@ public interface MlsService {
 | 
			
		|||
     * @return
 | 
			
		||||
     */
 | 
			
		||||
    void getMoInfo(String resultJson);
 | 
			
		||||
 | 
			
		||||
    /**
 | 
			
		||||
     * 回传MO票
 | 
			
		||||
     * @return
 | 
			
		||||
     */
 | 
			
		||||
    String returnMo(ReturnMoInfo returnMoInfo);
 | 
			
		||||
 | 
			
		||||
    /**
 | 
			
		||||
     * 叫料结果回传
 | 
			
		||||
     * @return
 | 
			
		||||
     */
 | 
			
		||||
    String returnIssue(ReturnIssueInfo returnIssueInfo);
 | 
			
		||||
}
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -54,6 +54,8 @@ public interface MoService {
 | 
			
		|||
     */
 | 
			
		||||
    MoDto findById(Integer id);
 | 
			
		||||
 | 
			
		||||
    MoDto findByLabelNo(String labelNo);
 | 
			
		||||
 | 
			
		||||
    /**
 | 
			
		||||
    * 创建
 | 
			
		||||
    * @param resources /
 | 
			
		||||
| 
						 | 
				
			
			@ -80,4 +82,11 @@ public interface MoService {
 | 
			
		|||
    * @throws IOException /
 | 
			
		||||
    */
 | 
			
		||||
    void download(List<MoDto> all, HttpServletResponse response) throws IOException;
 | 
			
		||||
 | 
			
		||||
    /**
 | 
			
		||||
     * 将MoDto转换为Entity对象的方法
 | 
			
		||||
     * @param moDto 要转换的对象
 | 
			
		||||
     * @return 转换后的对象
 | 
			
		||||
     */
 | 
			
		||||
    Mo toEntity(MoDto moDto);
 | 
			
		||||
}
 | 
			
		||||
| 
						 | 
				
			
			@ -15,7 +15,9 @@
 | 
			
		|||
*/
 | 
			
		||||
package com.youchain.businessdata.service;
 | 
			
		||||
 | 
			
		||||
import com.youchain.businessdata.domain.Mo;
 | 
			
		||||
import com.youchain.businessdata.domain.Order;
 | 
			
		||||
import com.youchain.businessdata.service.dto.MoDto;
 | 
			
		||||
import com.youchain.businessdata.service.dto.OrderDto;
 | 
			
		||||
import com.youchain.businessdata.service.dto.OrderQueryCriteria;
 | 
			
		||||
import org.springframework.data.domain.Pageable;
 | 
			
		||||
| 
						 | 
				
			
			@ -54,6 +56,13 @@ public interface OrderService {
 | 
			
		|||
     */
 | 
			
		||||
    OrderDto findById(Integer id);
 | 
			
		||||
 | 
			
		||||
    /**
 | 
			
		||||
     * 根据barcodeNumber查询
 | 
			
		||||
     * @param  barcodeNumber
 | 
			
		||||
     * @return OrderDto
 | 
			
		||||
     */
 | 
			
		||||
    OrderDto findByBarcodeNumber(String barcodeNumber);
 | 
			
		||||
 | 
			
		||||
    /**
 | 
			
		||||
    * 创建
 | 
			
		||||
    * @param resources /
 | 
			
		||||
| 
						 | 
				
			
			@ -81,4 +90,12 @@ public interface OrderService {
 | 
			
		|||
    */
 | 
			
		||||
    void download(List<OrderDto> all, HttpServletResponse response) throws IOException;
 | 
			
		||||
 | 
			
		||||
    /**
 | 
			
		||||
     * 将MoDto转换为Entity对象的方法
 | 
			
		||||
     * @param orderDto 要转换的对象
 | 
			
		||||
     * @return 转换后的对象
 | 
			
		||||
     */
 | 
			
		||||
    Order toEntity(OrderDto orderDto);
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
}
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -1,12 +0,0 @@
 | 
			
		|||
package com.youchain.businessdata.service;
 | 
			
		||||
 | 
			
		||||
/**
 | 
			
		||||
 * ToKen服务接口
 | 
			
		||||
 */
 | 
			
		||||
public interface ToKenService {
 | 
			
		||||
    /**
 | 
			
		||||
     * 获取ToKen
 | 
			
		||||
     * @return
 | 
			
		||||
     */
 | 
			
		||||
    String getToKen();
 | 
			
		||||
}
 | 
			
		||||
| 
						 | 
				
			
			@ -16,6 +16,8 @@
 | 
			
		|||
package com.youchain.businessdata.service.dto;
 | 
			
		||||
 | 
			
		||||
import lombok.Data;
 | 
			
		||||
 | 
			
		||||
import java.sql.Timestamp;
 | 
			
		||||
import java.util.List;
 | 
			
		||||
import com.youchain.annotation.Query;
 | 
			
		||||
 | 
			
		||||
| 
						 | 
				
			
			@ -26,4 +28,25 @@ import com.youchain.annotation.Query;
 | 
			
		|||
**/
 | 
			
		||||
@Data
 | 
			
		||||
public class MoQueryCriteria{
 | 
			
		||||
 | 
			
		||||
    /** 关联Id */
 | 
			
		||||
    @Query(type = Query.Type.INNER_LIKE)
 | 
			
		||||
    private String deliveryHeaderId;
 | 
			
		||||
 | 
			
		||||
    /** Mo票 */
 | 
			
		||||
    @Query(type = Query.Type.INNER_LIKE)
 | 
			
		||||
    private String labelNo;
 | 
			
		||||
 | 
			
		||||
    @Query(joinName = "item", propName="code",type = Query.Type.INNER_LIKE)
 | 
			
		||||
    private long itemCode;
 | 
			
		||||
 | 
			
		||||
    @Query(joinName = "item", propName="name",type = Query.Type.INNER_LIKE)
 | 
			
		||||
    private long itemName;
 | 
			
		||||
 | 
			
		||||
    /** Mo状态 */
 | 
			
		||||
    @Query(type = Query.Type.EQUAL)
 | 
			
		||||
    private String labelState;
 | 
			
		||||
 | 
			
		||||
    @Query(type = Query.Type.BETWEEN)
 | 
			
		||||
    private List<Timestamp> createTime;
 | 
			
		||||
}
 | 
			
		||||
| 
						 | 
				
			
			@ -28,6 +28,11 @@ import com.youchain.annotation.Query;
 | 
			
		|||
**/
 | 
			
		||||
@Data
 | 
			
		||||
public class OrderQueryCriteria{
 | 
			
		||||
 | 
			
		||||
    /** 关联Id */
 | 
			
		||||
    @Query(type = Query.Type.INNER_LIKE)
 | 
			
		||||
    private String deliveryHeaderId;
 | 
			
		||||
 | 
			
		||||
    /** 送货单条码号 */
 | 
			
		||||
    @Query(type = Query.Type.INNER_LIKE)
 | 
			
		||||
    private String barcodeNumber;
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -6,38 +6,72 @@ import com.alibaba.fastjson.JSONArray;
 | 
			
		|||
import com.alibaba.fastjson.JSONObject;
 | 
			
		||||
import com.youchain.basicdata.domain.Item;
 | 
			
		||||
import com.youchain.basicdata.service.ItemService;
 | 
			
		||||
import com.youchain.basicdata.service.dto.ItemDto;
 | 
			
		||||
import com.youchain.businessdata.domain.Mo;
 | 
			
		||||
import com.youchain.businessdata.domain.Order;
 | 
			
		||||
import com.youchain.businessdata.inputJson.MoInfo;
 | 
			
		||||
import com.youchain.businessdata.inputJson.OrderInfo;
 | 
			
		||||
import com.youchain.businessdata.inputJson.ReturnIssueInfo;
 | 
			
		||||
import com.youchain.businessdata.inputJson.ReturnMoInfo;
 | 
			
		||||
import com.youchain.businessdata.service.MlsService;
 | 
			
		||||
import com.youchain.businessdata.service.MoService;
 | 
			
		||||
import com.youchain.businessdata.service.OrderService;
 | 
			
		||||
import com.youchain.businessdata.service.ToKenService;
 | 
			
		||||
import com.youchain.businessdata.service.dto.MoDto;
 | 
			
		||||
import com.youchain.businessdata.service.dto.OrderDto;
 | 
			
		||||
import com.youchain.modules.system.domain.Dept;
 | 
			
		||||
import com.youchain.modules.system.service.DeptService;
 | 
			
		||||
import com.youchain.modules.system.service.dto.DeptDto;
 | 
			
		||||
import com.youchain.utils.HttpPostUtil;
 | 
			
		||||
import com.youchain.utils.StringUtils;
 | 
			
		||||
import com.youchain.utils.UrlApi;
 | 
			
		||||
import lombok.RequiredArgsConstructor;
 | 
			
		||||
import lombok.extern.slf4j.Slf4j;
 | 
			
		||||
import org.springframework.stereotype.Service;
 | 
			
		||||
import org.springframework.transaction.annotation.Transactional;
 | 
			
		||||
 | 
			
		||||
import javax.persistence.EntityManager;
 | 
			
		||||
import javax.persistence.Query;
 | 
			
		||||
import java.util.*;
 | 
			
		||||
 | 
			
		||||
@Service
 | 
			
		||||
@RequiredArgsConstructor
 | 
			
		||||
@Slf4j
 | 
			
		||||
public class MlsServiceImpl implements MlsService {
 | 
			
		||||
    private final ToKenService toKenService;
 | 
			
		||||
    private final OrderService orderService;
 | 
			
		||||
    private final ItemService itemService;
 | 
			
		||||
    private final DeptService deptService;
 | 
			
		||||
    private final MoService moService;
 | 
			
		||||
    private final EntityManager entityMapper;
 | 
			
		||||
 | 
			
		||||
    /**
 | 
			
		||||
     * 获取Token
 | 
			
		||||
     *
 | 
			
		||||
     * @return
 | 
			
		||||
     */
 | 
			
		||||
    @Override
 | 
			
		||||
    public String getToKen() {
 | 
			
		||||
        String toKen = "";
 | 
			
		||||
        String mlsUser = "WMS";
 | 
			
		||||
        String mlsPwd = "EDlsFOvn3xaJm*EH";
 | 
			
		||||
        JSONObject jsonObject = new JSONObject(new LinkedHashMap<>());
 | 
			
		||||
        Map<String, Object> objMap = new LinkedHashMap<>();
 | 
			
		||||
        objMap.put("mlsUser", mlsUser);//快码代码
 | 
			
		||||
        objMap.put("mlsPwd", mlsPwd);//快码值
 | 
			
		||||
        jsonObject.putAll(objMap);
 | 
			
		||||
        String resultJson = HttpPostUtil.sendPostReq(UrlApi.extSignIn, jsonObject.toString());//返回ResponseJson*/
 | 
			
		||||
        JSONObject resulObject = JSON.parseObject(resultJson);
 | 
			
		||||
        //判断接口是否成功
 | 
			
		||||
        if (resulObject == null) {
 | 
			
		||||
            throw new RuntimeException("获取toKen接口返回数据为空!");
 | 
			
		||||
        }
 | 
			
		||||
 | 
			
		||||
        String code = resulObject.getString("code") == null ? "" : resulObject.getString("code");
 | 
			
		||||
        String msg = resulObject.getString("msg") == null ? "" : resulObject.getString("msg");
 | 
			
		||||
 | 
			
		||||
        if ("0".equals(code)) {
 | 
			
		||||
            toKen = resulObject.getString("data") == null ? "" : resulObject.getString("data");
 | 
			
		||||
            return toKen;
 | 
			
		||||
        } else {
 | 
			
		||||
            throw new RuntimeException("MLS异常信息:" + msg);
 | 
			
		||||
        }
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    /**
 | 
			
		||||
     * 获取送货单JSON
 | 
			
		||||
| 
						 | 
				
			
			@ -52,8 +86,7 @@ public class MlsServiceImpl implements MlsService {
 | 
			
		|||
        objMap.put("sourceSystem", orderInfo.getSourceSystem());//来源系统
 | 
			
		||||
        objMap.put("params", orderInfo.getParams());
 | 
			
		||||
        jsonObject.putAll(objMap);
 | 
			
		||||
        String resultJson = HttpPostUtil.sendPostReq(UrlApi.publicApi, jsonObject.toString(), toKenService.getToKen());//返回ResponseJson*/
 | 
			
		||||
        return resultJson;
 | 
			
		||||
        return HttpPostUtil.sendPostReq(UrlApi.publicApi, jsonObject.toString(), this.getToKen());//返回ResponseJson*/
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    /**
 | 
			
		||||
| 
						 | 
				
			
			@ -64,73 +97,88 @@ public class MlsServiceImpl implements MlsService {
 | 
			
		|||
    @Override
 | 
			
		||||
    @Transactional(rollbackFor = Exception.class)
 | 
			
		||||
    public synchronized void getOrderInfo(String resultJson) {
 | 
			
		||||
        if (resultJson != null && resultJson.length() > 0) {
 | 
			
		||||
            JSONObject resulObject = JSON.parseObject(resultJson);
 | 
			
		||||
            String code = resulObject.getString("code") == null ? "" : resulObject.getString("code");
 | 
			
		||||
            String msg = resulObject.getString("msg") == null ? "" : resulObject.getString("msg");
 | 
			
		||||
            if ("0".equals(code)) {
 | 
			
		||||
                String data = resulObject.getString("data") == null ? "" : resulObject.getString("data");
 | 
			
		||||
                JSONObject dataObject = JSON.parseObject(data);
 | 
			
		||||
                JSONArray details = dataObject.getJSONArray("list");
 | 
			
		||||
                for (int i = 0; i < details.size(); i++) {
 | 
			
		||||
                    JSONObject detail = details.getJSONObject(i);
 | 
			
		||||
                    String barcodeNumber = detail.getString("barcodeNumber");//送货单条码号
 | 
			
		||||
                    String isCreatedLabel = detail.getString("isCreatedLabel");//是否已生成标签N
 | 
			
		||||
                    String itemCode = detail.getString("itemCode");//物料编码
 | 
			
		||||
                    String iqcResult = detail.getString("iqcResult");//检验结果(不合格:REJECT,合格:ACCEPT)
 | 
			
		||||
                    String supplierCode = detail.getString("supplierCode");//供应商编码
 | 
			
		||||
                    //String dispatchNumber=detail.getString("dispatchNumber");//文档没有该字段
 | 
			
		||||
                    String receivedLocationName = detail.getString("receivedLocationName");//LMES货位名称
 | 
			
		||||
                    String receivedInvCode = detail.getString("receivedInvCode");//LMES接收子库编码
 | 
			
		||||
                    //Integer deliveryNotifyLineId = detail.getInteger("deliveryNotifyLineId");//送货通知单行ID
 | 
			
		||||
                    String deliveryNumber = detail.getString("deliveryNumber");//送货单号
 | 
			
		||||
                    String receivedAreaCode = detail.getString("receivedAreaCode");//LMES接收货区编码
 | 
			
		||||
                    String supplierName = detail.getString("supplierName");//供应商名称
 | 
			
		||||
                    String isIqcInspected = detail.getString("isIqcInspected");//Y-已检验N-未检验
 | 
			
		||||
                    Double deliveryQty = detail.getDouble("deliveryQty");//计划数量
 | 
			
		||||
                    //String deliveryType=detail.getString("deliveryType");//文档没有该字段
 | 
			
		||||
                    String receivedLocationCode = detail.getString("receivedLocationCode");//LMES货位编码
 | 
			
		||||
                    String mlsUpdateTime = detail.getString("updateTime");//更新时间
 | 
			
		||||
                    String receivedInvName = detail.getString("receivedInvName");//LMES接收子库名称
 | 
			
		||||
                    Double receivedQty = detail.getDouble("receivedQty");//实际接收数量
 | 
			
		||||
                    //Integer deliveryLineId = detail.getInteger("deliveryLineId");//送货单行ID
 | 
			
		||||
                    String inInspector = detail.getString("inInspector");//检验员
 | 
			
		||||
                    Integer deliveryHeaderId = detail.getInteger("deliveryHeaderId");//送货单头ID和003接口关联
 | 
			
		||||
                    String receivedAreaName = detail.getString("receivedAreaName");//mls接收货区名称
 | 
			
		||||
                    String deliveryStatus = detail.getString("deliveryStatus");//送货单状态
 | 
			
		||||
 | 
			
		||||
                    //直接接收已合格的送货单
 | 
			
		||||
                    if ("Y".equals(isIqcInspected)) {
 | 
			
		||||
 | 
			
		||||
                        String order_hql = " from Order order where order.barcodeNumber= :barcodeNumber ";
 | 
			
		||||
                        Query query = entityMapper.createQuery(order_hql);
 | 
			
		||||
                        query.setParameter("barcodeNumber", barcodeNumber);
 | 
			
		||||
                        List<Order> orderList = query.getResultList();
 | 
			
		||||
                        if (orderList.size() > 0) {
 | 
			
		||||
                            //更新
 | 
			
		||||
                            Order order = orderList.get(0);
 | 
			
		||||
                            order.setDeliveryStatus(deliveryStatus);
 | 
			
		||||
                            orderService.update(order);
 | 
			
		||||
                        } else {
 | 
			
		||||
                            //创建
 | 
			
		||||
                            Order newOrder = new Order(deliveryHeaderId, null, null,
 | 
			
		||||
                                    deliveryNumber, barcodeNumber, deliveryStatus, receivedInvCode, receivedInvName,
 | 
			
		||||
                                    receivedAreaCode, receivedAreaName, receivedLocationCode, receivedLocationName,
 | 
			
		||||
                                    itemCode, deliveryQty, inInspector, receivedQty, isIqcInspected, iqcResult, isCreatedLabel,
 | 
			
		||||
                                    supplierCode, supplierName,mlsUpdateTime == null ? null : DateUtil.parse(mlsUpdateTime).toTimestamp()
 | 
			
		||||
                                    );
 | 
			
		||||
                            orderService.create(newOrder);
 | 
			
		||||
                        }
 | 
			
		||||
                    }
 | 
			
		||||
                }
 | 
			
		||||
            } else {
 | 
			
		||||
                throw new RuntimeException("MLS异常信息:" + msg);
 | 
			
		||||
            }
 | 
			
		||||
        } else {
 | 
			
		||||
        if (StringUtils.isEmpty(resultJson)) {
 | 
			
		||||
            throw new RuntimeException("获取送货单接口失败!");
 | 
			
		||||
        }
 | 
			
		||||
 | 
			
		||||
        JSONObject resulObject = JSON.parseObject(resultJson);
 | 
			
		||||
        String code = resulObject.getString("code") == null ? "" : resulObject.getString("code");
 | 
			
		||||
        String msg = resulObject.getString("msg") == null ? "" : resulObject.getString("msg");
 | 
			
		||||
        //判断接口是否成功
 | 
			
		||||
        if (!"0".equals(code)) {
 | 
			
		||||
            throw new RuntimeException("获取送货单接口异常信息:" + msg);
 | 
			
		||||
        }
 | 
			
		||||
 | 
			
		||||
        String data = resulObject.getString("data") == null ? "" : resulObject.getString("data");
 | 
			
		||||
        JSONObject dataObject = JSON.parseObject(data);
 | 
			
		||||
        if (dataObject == null) {
 | 
			
		||||
            throw new RuntimeException("获取送货单接口返回数据为空!");
 | 
			
		||||
        }
 | 
			
		||||
        JSONArray details = dataObject.getJSONArray("list");
 | 
			
		||||
        //判断是否有送货单数据
 | 
			
		||||
        if (details == null || details.size() == 0) {
 | 
			
		||||
            throw new RuntimeException("没有获取到送货单数据!");
 | 
			
		||||
        }
 | 
			
		||||
        //循环处理每个送货单
 | 
			
		||||
        log.info("送货单数量:"+details.size());
 | 
			
		||||
        for (int i = 0; i < details.size(); i++) {
 | 
			
		||||
            JSONObject detail = details.getJSONObject(i);
 | 
			
		||||
            String barcodeNumber = detail.getString("barcodeNumber");//送货单条码号
 | 
			
		||||
            String isCreatedLabel = detail.getString("isCreatedLabel");//是否已生成标签N
 | 
			
		||||
            String itemCode = detail.getString("itemCode");//物料编码
 | 
			
		||||
            String iqcResult = detail.getString("iqcResult");//检验结果(不合格:REJECT,合格:ACCEPT)
 | 
			
		||||
            String supplierCode = detail.getString("supplierCode");//供应商编码
 | 
			
		||||
            //String dispatchNumber=detail.getString("dispatchNumber");//文档没有该字段
 | 
			
		||||
            String receivedLocationName = detail.getString("receivedLocationName");//LMES货位名称
 | 
			
		||||
            String receivedInvCode = detail.getString("receivedInvCode");//LMES接收子库编码
 | 
			
		||||
            //Integer deliveryNotifyLineId = detail.getInteger("deliveryNotifyLineId");//送货通知单行ID
 | 
			
		||||
            String deliveryNumber = detail.getString("deliveryNumber");//送货单号
 | 
			
		||||
            String receivedAreaCode = detail.getString("receivedAreaCode");//LMES接收货区编码
 | 
			
		||||
            String supplierName = detail.getString("supplierName");//供应商名称
 | 
			
		||||
            String isIqcInspected = detail.getString("isIqcInspected");//Y-已检验N-未检验
 | 
			
		||||
            Double deliveryQty = detail.getDouble("deliveryQty");//计划数量
 | 
			
		||||
            //String deliveryType=detail.getString("deliveryType");//文档没有该字段
 | 
			
		||||
            String receivedLocationCode = detail.getString("receivedLocationCode");//LMES货位编码
 | 
			
		||||
            String mlsUpdateTime = detail.getString("updateTime");//更新时间
 | 
			
		||||
            String receivedInvName = detail.getString("receivedInvName");//LMES接收子库名称
 | 
			
		||||
            Double receivedQty = detail.getDouble("receivedQty");//实际接收数量
 | 
			
		||||
            //Integer deliveryLineId = detail.getInteger("deliveryLineId");//送货单行ID
 | 
			
		||||
            String inInspector = detail.getString("inInspector");//检验员
 | 
			
		||||
            Integer deliveryHeaderId = detail.getInteger("deliveryHeaderId");//送货单头ID和003接口关联
 | 
			
		||||
            String receivedAreaName = detail.getString("receivedAreaName");//mls接收货区名称
 | 
			
		||||
            String deliveryStatus = detail.getString("deliveryStatus");//送货单状态
 | 
			
		||||
 | 
			
		||||
            //直接接收已合格的送货单
 | 
			
		||||
            if ("Y".equals(isIqcInspected)) {
 | 
			
		||||
                OrderDto orderdto = orderService.findByBarcodeNumber(barcodeNumber);
 | 
			
		||||
                if (orderdto == null) {
 | 
			
		||||
                    //创建
 | 
			
		||||
                    Order newOrder = new Order(deliveryHeaderId, null, null,
 | 
			
		||||
                            deliveryNumber, barcodeNumber, deliveryStatus, receivedInvCode, receivedInvName,
 | 
			
		||||
                            receivedAreaCode, receivedAreaName, receivedLocationCode, receivedLocationName,
 | 
			
		||||
                            itemCode, deliveryQty, inInspector, receivedQty, isIqcInspected, iqcResult, isCreatedLabel,
 | 
			
		||||
                            supplierCode, supplierName, mlsUpdateTime == null ? null : DateUtil.parse(mlsUpdateTime).toTimestamp()
 | 
			
		||||
                    );
 | 
			
		||||
                    orderService.create(newOrder);
 | 
			
		||||
                } else {
 | 
			
		||||
                    //更新
 | 
			
		||||
                    Order order = orderService.toEntity(orderdto);
 | 
			
		||||
                    order.setDeliveryStatus(deliveryStatus);
 | 
			
		||||
                    orderService.update(order);
 | 
			
		||||
                }
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
            }
 | 
			
		||||
        }
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    /**
 | 
			
		||||
     * 获取MO票JSON信息
 | 
			
		||||
     *
 | 
			
		||||
     * @return
 | 
			
		||||
     */
 | 
			
		||||
    @Override
 | 
			
		||||
    public String getMoJson(MoInfo moInfo) {
 | 
			
		||||
        JSONObject jsonObject = new JSONObject(new LinkedHashMap<>());
 | 
			
		||||
| 
						 | 
				
			
			@ -139,8 +187,8 @@ public class MlsServiceImpl implements MlsService {
 | 
			
		|||
        objMap.put("sourceSystem", moInfo.getSourceSystem());//来源系统
 | 
			
		||||
        objMap.put("params", moInfo.getParams());
 | 
			
		||||
        jsonObject.putAll(objMap);
 | 
			
		||||
        String resultJson = HttpPostUtil.sendPostReq(UrlApi.publicApi, jsonObject.toString(), toKenService.getToKen());//返回ResponseJson*/
 | 
			
		||||
        return resultJson;
 | 
			
		||||
        return   HttpPostUtil.sendPostReq(UrlApi.publicApi, jsonObject.toString(), this.getToKen());
 | 
			
		||||
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    /**
 | 
			
		||||
| 
						 | 
				
			
			@ -151,90 +199,116 @@ public class MlsServiceImpl implements MlsService {
 | 
			
		|||
    @Override
 | 
			
		||||
    @Transactional(rollbackFor = Exception.class)
 | 
			
		||||
    public synchronized void getMoInfo(String resultJson) {
 | 
			
		||||
        if (resultJson != null && resultJson.length() > 0) {
 | 
			
		||||
            JSONObject resulObject = JSON.parseObject(resultJson);
 | 
			
		||||
            String code = resulObject.getString("code") == null ? "" : resulObject.getString("code");
 | 
			
		||||
            String msg = resulObject.getString("msg") == null ? "" : resulObject.getString("msg");
 | 
			
		||||
            if ("0".equals(code)) {
 | 
			
		||||
                String data = resulObject.getString("data") == null ? "" : resulObject.getString("data");
 | 
			
		||||
                JSONObject dataObject = JSON.parseObject(data);
 | 
			
		||||
                JSONArray details = dataObject.getJSONArray("list");
 | 
			
		||||
                for (int i = 0; i < details.size(); i++) {
 | 
			
		||||
                    JSONObject detail = details.getJSONObject(i);
 | 
			
		||||
                    Integer selfWorkOrderId = detail.getInteger("selfWorkOrderId");//自制件工单id
 | 
			
		||||
                    String sourceSystem = detail.getString("sourceSystem");//来源系统
 | 
			
		||||
                    String selfWorkOrderName = detail.getString("selfWorkOrderName");//自制件工单编号
 | 
			
		||||
                    String itemCode = detail.getString("itemCode");//物料编码
 | 
			
		||||
                    String labelType = detail.getString("labelType");//标签类型
 | 
			
		||||
                    String goodsAreaCode = detail.getString("goodsAreaCode");//MLS货区
 | 
			
		||||
                    String checkResult = detail.getString("checkResult");//检验状态
 | 
			
		||||
                    String datetimeStockIn = detail.getString("datetimeStockin");//入库时间
 | 
			
		||||
                    String deleteFlag = detail.getString("deleteFlag");//数据有效性;有效0,无效1
 | 
			
		||||
                    String uom = detail.getString("uom");//单位
 | 
			
		||||
                    String createUserCode = detail.getString("createUserCode");//创建人
 | 
			
		||||
                    String mlsUpdateTime = detail.getString("updateTime");//修改时间
 | 
			
		||||
                    String itemDesc = detail.getString("itemDesc");//物料描述
 | 
			
		||||
                    String labelNo = detail.getString("labelNo");//MO票
 | 
			
		||||
                    Long itemId = detail.getLong("itemId");//物料id
 | 
			
		||||
                    String updateUserCode = detail.getString("updateUserCode");//修改人
 | 
			
		||||
                    String mlsCreateTime = detail.getString("createTime");//创建时间
 | 
			
		||||
                    Double qty = detail.getDouble("qty");//可用数量
 | 
			
		||||
                    String labelState = detail.getString("labelState");//标签状态
 | 
			
		||||
                    Integer deliveryHeaderId = detail.getInteger("deliveryHeaderId");//送货单头ID;通过该字段能找到002接口送货单
 | 
			
		||||
                    String workOrderName = detail.getString("workOrderName");//工单编号
 | 
			
		||||
                    Integer workOrderId = detail.getInteger("workOrderId");//工单Id
 | 
			
		||||
                    String goodsLocationCode = detail.getString("goodsLocationCode");//MLS货位
 | 
			
		||||
                    String invCode = detail.getString("invCode");//MLS子库
 | 
			
		||||
 | 
			
		||||
                    //接收有效的MO票
 | 
			
		||||
                    if ("0".equals(deleteFlag)) {
 | 
			
		||||
                        //判断物料是否存在;不存在新增;
 | 
			
		||||
                        Item item = null;
 | 
			
		||||
                        String item_hql = " from Item item where item.code='" + itemCode + "' ";
 | 
			
		||||
                        Query item_query = entityMapper.createQuery(item_hql);
 | 
			
		||||
                        List<Item> itemList = item_query.getResultList();
 | 
			
		||||
                        if (itemList.size() > 0) {
 | 
			
		||||
                            item = itemList.get(0);
 | 
			
		||||
                        } else {
 | 
			
		||||
                            item = new Item();
 | 
			
		||||
                            item.setCode(itemCode);
 | 
			
		||||
                            item.setName(itemDesc);
 | 
			
		||||
                            item.setUnit(uom);
 | 
			
		||||
                            DeptDto deptDto= deptService.findById(7L);
 | 
			
		||||
                            Dept dept= deptService.toEntity(deptDto);
 | 
			
		||||
                            item.setDept(dept);
 | 
			
		||||
                            item.setSourceName(sourceSystem);
 | 
			
		||||
                            item.setSourceId(itemId);
 | 
			
		||||
                            itemService.create(item);
 | 
			
		||||
                        }
 | 
			
		||||
 | 
			
		||||
                        //判断MO票是否存在;不存在新增;存在更新
 | 
			
		||||
                        String mo_hql = " from Mo mo where mo.labelNo='" + labelNo + "' ";
 | 
			
		||||
                        Query mo_query = entityMapper.createQuery(mo_hql);
 | 
			
		||||
                        List<Mo> moList = mo_query.getResultList();
 | 
			
		||||
                        if (moList.size() > 0) {
 | 
			
		||||
                            Mo mo = moList.get(0);
 | 
			
		||||
                        } else {
 | 
			
		||||
                            Mo mo = new Mo(labelNo, labelType, labelState, deliveryHeaderId, sourceSystem, qty,
 | 
			
		||||
                                    workOrderId, workOrderName, selfWorkOrderId, selfWorkOrderName, null, item,
 | 
			
		||||
                                    checkResult, Boolean.parseBoolean(deleteFlag), null, null, null, null, invCode, goodsAreaCode, goodsLocationCode,
 | 
			
		||||
                                    datetimeStockIn == null ? null : DateUtil.parse(datetimeStockIn).toTimestamp(),
 | 
			
		||||
                                    mlsCreateTime == null ? null : DateUtil.parse(mlsCreateTime).toTimestamp(),
 | 
			
		||||
                                    mlsUpdateTime == null ? null : DateUtil.parse(mlsUpdateTime).toTimestamp(),
 | 
			
		||||
                                    createUserCode, updateUserCode
 | 
			
		||||
                            );
 | 
			
		||||
                            moService.create(mo);
 | 
			
		||||
 | 
			
		||||
                        }
 | 
			
		||||
                    }
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
                }
 | 
			
		||||
            } else {
 | 
			
		||||
                throw new RuntimeException("MLS异常信息:" + msg);
 | 
			
		||||
            }
 | 
			
		||||
        } else {
 | 
			
		||||
        if (StringUtils.isEmpty(resultJson)) {
 | 
			
		||||
            throw new RuntimeException("获取MO票接口失败!");
 | 
			
		||||
        }
 | 
			
		||||
 | 
			
		||||
        JSONObject resulObject = JSON.parseObject(resultJson);
 | 
			
		||||
        String code = resulObject.getString("code") == null ? "" : resulObject.getString("code");
 | 
			
		||||
        String msg = resulObject.getString("msg") == null ? "" : resulObject.getString("msg");
 | 
			
		||||
        if (!"0".equals(code)) {
 | 
			
		||||
            throw new RuntimeException("获取MO票接口异常信息:" + msg);
 | 
			
		||||
        }
 | 
			
		||||
 | 
			
		||||
        String data = resulObject.getString("data") == null ? "" : resulObject.getString("data");
 | 
			
		||||
        JSONObject dataObject = JSON.parseObject(data);
 | 
			
		||||
        if (dataObject == null) {
 | 
			
		||||
            throw new RuntimeException("获取MO票接口返回数据为空!");
 | 
			
		||||
        }
 | 
			
		||||
        JSONArray details = dataObject.getJSONArray("list");
 | 
			
		||||
        //判断是否有MO票数据
 | 
			
		||||
        if (details == null || details.size() == 0) {
 | 
			
		||||
            throw new RuntimeException("没有获取到MO票数据!");
 | 
			
		||||
        }
 | 
			
		||||
        //循环处理每个MO票
 | 
			
		||||
        log.info("MO票数量:"+details.size());
 | 
			
		||||
        for (int i = 0; i < details.size(); i++) {
 | 
			
		||||
            JSONObject detail = details.getJSONObject(i);
 | 
			
		||||
            Integer selfWorkOrderId = detail.getInteger("selfWorkOrderId");//自制件工单id
 | 
			
		||||
            String sourceSystem = detail.getString("sourceSystem");//来源系统
 | 
			
		||||
            String selfWorkOrderName = detail.getString("selfWorkOrderName");//自制件工单编号
 | 
			
		||||
            String itemCode = detail.getString("itemCode");//物料编码
 | 
			
		||||
            String labelType = detail.getString("labelType");//标签类型
 | 
			
		||||
            String goodsAreaCode = detail.getString("goodsAreaCode");//MLS货区
 | 
			
		||||
            String checkResult = detail.getString("checkResult");//检验状态
 | 
			
		||||
            String datetimeStockIn = detail.getString("datetimeStockin");//入库时间
 | 
			
		||||
            String deleteFlag = detail.getString("deleteFlag");//数据有效性;有效0,无效1
 | 
			
		||||
            String uom = detail.getString("uom");//单位
 | 
			
		||||
            String createUserCode = detail.getString("createUserCode");//创建人
 | 
			
		||||
            String mlsUpdateTime = detail.getString("updateTime");//修改时间
 | 
			
		||||
            String itemDesc = detail.getString("itemDesc");//物料描述
 | 
			
		||||
            String labelNo = detail.getString("labelNo");//MO票
 | 
			
		||||
            Long itemId = detail.getLong("itemId");//物料id
 | 
			
		||||
            String updateUserCode = detail.getString("updateUserCode");//修改人
 | 
			
		||||
            String mlsCreateTime = detail.getString("createTime");//创建时间
 | 
			
		||||
            Double qty = detail.getDouble("qty");//可用数量
 | 
			
		||||
            String labelState = detail.getString("labelState");//标签状态
 | 
			
		||||
            Integer deliveryHeaderId = detail.getInteger("deliveryHeaderId");//送货单头ID;通过该字段能找到002接口送货单
 | 
			
		||||
            String workOrderName = detail.getString("workOrderName");//工单编号
 | 
			
		||||
            Integer workOrderId = detail.getInteger("workOrderId");//工单Id
 | 
			
		||||
            String goodsLocationCode = detail.getString("goodsLocationCode");//MLS货位
 | 
			
		||||
            String invCode = detail.getString("invCode");//MLS子库
 | 
			
		||||
 | 
			
		||||
            //接收有效的MO票
 | 
			
		||||
            if ("PRINTED".equals(labelState)) {
 | 
			
		||||
                //判断物料是否存在;不存在新增;
 | 
			
		||||
                ItemDto itemDto = itemService.findByCode(itemCode);
 | 
			
		||||
                Item item = itemService.toEntity(itemDto);
 | 
			
		||||
                if (item == null) {
 | 
			
		||||
                    item = new Item();
 | 
			
		||||
                    item.setCode(itemCode);
 | 
			
		||||
                    item.setName(itemDesc);
 | 
			
		||||
                    item.setUnit(uom);
 | 
			
		||||
                    DeptDto deptDto = deptService.findById(7L);
 | 
			
		||||
                    Dept dept = deptService.toEntity(deptDto);
 | 
			
		||||
                    item.setDept(dept);
 | 
			
		||||
                    item.setSourceName(sourceSystem);
 | 
			
		||||
                    item.setSourceId(itemId);
 | 
			
		||||
                    itemService.create(item);
 | 
			
		||||
                }
 | 
			
		||||
 | 
			
		||||
                MoDto moDto = moService.findByLabelNo(labelNo);
 | 
			
		||||
                if (moDto == null) {
 | 
			
		||||
                    Mo mo = new Mo(labelNo, labelType, labelState, deliveryHeaderId, sourceSystem, qty,
 | 
			
		||||
                            workOrderId, workOrderName, selfWorkOrderId, selfWorkOrderName, null, item,
 | 
			
		||||
                            checkResult, Boolean.parseBoolean(deleteFlag), null, null, null, null, invCode, goodsAreaCode, goodsLocationCode,
 | 
			
		||||
                            datetimeStockIn == null ? null : DateUtil.parse(datetimeStockIn).toTimestamp(),
 | 
			
		||||
                            mlsCreateTime == null ? null : DateUtil.parse(mlsCreateTime).toTimestamp(),
 | 
			
		||||
                            mlsUpdateTime == null ? null : DateUtil.parse(mlsUpdateTime).toTimestamp(),
 | 
			
		||||
                            createUserCode, updateUserCode
 | 
			
		||||
                    );
 | 
			
		||||
                    moService.create(mo);
 | 
			
		||||
                }
 | 
			
		||||
            }
 | 
			
		||||
 | 
			
		||||
        }
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    @Override
 | 
			
		||||
    public String returnMo(ReturnMoInfo returnMoInfo) {
 | 
			
		||||
        JSONObject jsonObject = new JSONObject(new LinkedHashMap<>());
 | 
			
		||||
        Map<String, Object> objMap = new LinkedHashMap<>();
 | 
			
		||||
        objMap.put("ifaceCode", returnMoInfo.getIfaceCode());//获取送货单信息
 | 
			
		||||
        objMap.put("sourceSystem", returnMoInfo.getSourceSystem());//来源系统
 | 
			
		||||
        objMap.put("params", returnMoInfo.getParams());
 | 
			
		||||
        jsonObject.putAll(objMap);
 | 
			
		||||
        return   HttpPostUtil.sendPostReq(UrlApi.publicApi, jsonObject.toString(), this.getToKen());
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    /**
 | 
			
		||||
     * 叫料结果回传
 | 
			
		||||
     * @param returnIssueInfo
 | 
			
		||||
     * @return
 | 
			
		||||
     */
 | 
			
		||||
    @Override
 | 
			
		||||
    public String returnIssue(ReturnIssueInfo returnIssueInfo) {
 | 
			
		||||
        JSONObject jsonObject = new JSONObject(new LinkedHashMap<>());
 | 
			
		||||
        Map<String, Object> objMap = new LinkedHashMap<>();
 | 
			
		||||
        objMap.put("ifaceCode", returnIssueInfo.getIfaceCode());//获取送货单信息
 | 
			
		||||
        objMap.put("sourceSystem", returnIssueInfo.getSourceSystem());//来源系统
 | 
			
		||||
        objMap.put("params", returnIssueInfo.getParams());
 | 
			
		||||
        jsonObject.putAll(objMap);
 | 
			
		||||
        return   HttpPostUtil.sendPostReq(UrlApi.publicApi, jsonObject.toString(), this.getToKen());
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
}
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -1,20 +1,21 @@
 | 
			
		|||
/*
 | 
			
		||||
*  Copyright 2019-2020 Zheng Jie
 | 
			
		||||
*
 | 
			
		||||
*  Licensed under the Apache License, Version 2.0 (the "License");
 | 
			
		||||
*  you may not use this file except in compliance with the License.
 | 
			
		||||
*  You may obtain a copy of the License at
 | 
			
		||||
*
 | 
			
		||||
*  http://www.apache.org/licenses/LICENSE-2.0
 | 
			
		||||
*
 | 
			
		||||
*  Unless required by applicable law or agreed to in writing, software
 | 
			
		||||
*  distributed under the License is distributed on an "AS IS" BASIS,
 | 
			
		||||
*  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 | 
			
		||||
*  See the License for the specific language governing permissions and
 | 
			
		||||
*  limitations under the License.
 | 
			
		||||
*/
 | 
			
		||||
 *  Copyright 2019-2020 Zheng Jie
 | 
			
		||||
 *
 | 
			
		||||
 *  Licensed under the Apache License, Version 2.0 (the "License");
 | 
			
		||||
 *  you may not use this file except in compliance with the License.
 | 
			
		||||
 *  You may obtain a copy of the License at
 | 
			
		||||
 *
 | 
			
		||||
 *  http://www.apache.org/licenses/LICENSE-2.0
 | 
			
		||||
 *
 | 
			
		||||
 *  Unless required by applicable law or agreed to in writing, software
 | 
			
		||||
 *  distributed under the License is distributed on an "AS IS" BASIS,
 | 
			
		||||
 *  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 | 
			
		||||
 *  See the License for the specific language governing permissions and
 | 
			
		||||
 *  limitations under the License.
 | 
			
		||||
 */
 | 
			
		||||
package com.youchain.businessdata.service.impl;
 | 
			
		||||
 | 
			
		||||
import com.youchain.basicdata.domain.Item;
 | 
			
		||||
import com.youchain.businessdata.domain.Mo;
 | 
			
		||||
import com.youchain.exception.EntityExistException;
 | 
			
		||||
import com.youchain.utils.FileUtil;
 | 
			
		||||
| 
						 | 
				
			
			@ -27,49 +28,67 @@ import com.youchain.businessdata.service.MoService;
 | 
			
		|||
import com.youchain.businessdata.service.dto.MoDto;
 | 
			
		||||
import com.youchain.businessdata.service.dto.MoQueryCriteria;
 | 
			
		||||
import com.youchain.businessdata.service.mapstruct.MoMapper;
 | 
			
		||||
import org.springframework.data.domain.Example;
 | 
			
		||||
import org.springframework.stereotype.Service;
 | 
			
		||||
import org.springframework.transaction.annotation.Transactional;
 | 
			
		||||
import org.springframework.data.domain.Page;
 | 
			
		||||
import org.springframework.data.domain.Pageable;
 | 
			
		||||
 | 
			
		||||
import java.util.List;
 | 
			
		||||
import java.util.Map;
 | 
			
		||||
import java.io.IOException;
 | 
			
		||||
import javax.persistence.EntityManager;
 | 
			
		||||
import javax.persistence.Query;
 | 
			
		||||
import javax.servlet.http.HttpServletResponse;
 | 
			
		||||
import java.util.ArrayList;
 | 
			
		||||
import java.util.LinkedHashMap;
 | 
			
		||||
 | 
			
		||||
/**
 | 
			
		||||
* @website https://eladmin.vip
 | 
			
		||||
* @description 服务实现
 | 
			
		||||
* @author huojin
 | 
			
		||||
* @date 2024-04-10
 | 
			
		||||
**/
 | 
			
		||||
 * @author huojin
 | 
			
		||||
 * @website https://eladmin.vip
 | 
			
		||||
 * @description 服务实现
 | 
			
		||||
 * @date 2024-04-10
 | 
			
		||||
 **/
 | 
			
		||||
@Service
 | 
			
		||||
@RequiredArgsConstructor
 | 
			
		||||
public class MoServiceImpl implements MoService {
 | 
			
		||||
 | 
			
		||||
    private final MoRepository moRepository;
 | 
			
		||||
    private final MoMapper moMapper;
 | 
			
		||||
    private final EntityManager entityManager;
 | 
			
		||||
 | 
			
		||||
    @Override
 | 
			
		||||
    public Map<String,Object> queryAll(MoQueryCriteria criteria, Pageable pageable){
 | 
			
		||||
        Page<Mo> page = moRepository.findAll((root, criteriaQuery, criteriaBuilder) -> QueryHelp.getPredicate(root,criteria,criteriaBuilder),pageable);
 | 
			
		||||
    public Map<String, Object> queryAll(MoQueryCriteria criteria, Pageable pageable) {
 | 
			
		||||
        Page<Mo> page = moRepository.findAll((root, criteriaQuery, criteriaBuilder) -> QueryHelp.getPredicate(root, criteria, criteriaBuilder), pageable);
 | 
			
		||||
        return PageUtil.toPage(page.map(moMapper::toDto));
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    @Override
 | 
			
		||||
    public List<MoDto> queryAll(MoQueryCriteria criteria){
 | 
			
		||||
        return moMapper.toDto(moRepository.findAll((root, criteriaQuery, criteriaBuilder) -> QueryHelp.getPredicate(root,criteria,criteriaBuilder)));
 | 
			
		||||
    public List<MoDto> queryAll(MoQueryCriteria criteria) {
 | 
			
		||||
        return moMapper.toDto(moRepository.findAll((root, criteriaQuery, criteriaBuilder) -> QueryHelp.getPredicate(root, criteria, criteriaBuilder)));
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    @Override
 | 
			
		||||
    @Transactional
 | 
			
		||||
    public MoDto findById(Integer id) {
 | 
			
		||||
        Mo mo = moRepository.findById(id).orElseGet(Mo::new);
 | 
			
		||||
        ValidationUtil.isNull(mo.getId(),"Mo","id",id);
 | 
			
		||||
        ValidationUtil.isNull(mo.getId(), "Mo", "id", id);
 | 
			
		||||
        return moMapper.toDto(mo);
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    @Override
 | 
			
		||||
    public MoDto findByLabelNo(String labelNo) {
 | 
			
		||||
        String hql = "from Mo where labelNo = :labelNo";
 | 
			
		||||
        Query query = entityManager.createQuery(hql);
 | 
			
		||||
        query.setParameter("labelNo", labelNo);
 | 
			
		||||
        List<Mo> list = query.getResultList();
 | 
			
		||||
        if (list.size() > 0) {
 | 
			
		||||
            return moMapper.toDto(list.get(0));
 | 
			
		||||
        } else {
 | 
			
		||||
            return null;
 | 
			
		||||
        }
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    @Override
 | 
			
		||||
    @Transactional(rollbackFor = Exception.class)
 | 
			
		||||
    public MoDto create(Mo resources) {
 | 
			
		||||
| 
						 | 
				
			
			@ -80,7 +99,7 @@ public class MoServiceImpl implements MoService {
 | 
			
		|||
    @Transactional(rollbackFor = Exception.class)
 | 
			
		||||
    public void update(Mo resources) {
 | 
			
		||||
        Mo mo = moRepository.findById(resources.getId()).orElseGet(Mo::new);
 | 
			
		||||
        ValidationUtil.isNull( mo.getId(),"Mo","id",resources.getId());
 | 
			
		||||
        ValidationUtil.isNull(mo.getId(), "Mo", "id", resources.getId());
 | 
			
		||||
        mo.copy(resources);
 | 
			
		||||
        moRepository.save(mo);
 | 
			
		||||
    }
 | 
			
		||||
| 
						 | 
				
			
			@ -96,11 +115,16 @@ public class MoServiceImpl implements MoService {
 | 
			
		|||
    public void download(List<MoDto> all, HttpServletResponse response) throws IOException {
 | 
			
		||||
        List<Map<String, Object>> list = new ArrayList<>();
 | 
			
		||||
        for (MoDto mo : all) {
 | 
			
		||||
            Map<String,Object> map = new LinkedHashMap<>();
 | 
			
		||||
            Map<String, Object> map = new LinkedHashMap<>();
 | 
			
		||||
            map.put("自制件工单id", mo.getSelfWorkOrderId());
 | 
			
		||||
 | 
			
		||||
            list.add(map);
 | 
			
		||||
        }
 | 
			
		||||
        FileUtil.downloadExcel(list, response);
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    @Override
 | 
			
		||||
    public Mo toEntity(MoDto moDto) {
 | 
			
		||||
        return moMapper.toEntity(moDto);
 | 
			
		||||
    }
 | 
			
		||||
}
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -16,6 +16,7 @@
 | 
			
		|||
package com.youchain.businessdata.service.impl;
 | 
			
		||||
 | 
			
		||||
import com.youchain.businessdata.domain.AsnDetail;
 | 
			
		||||
import com.youchain.businessdata.domain.Mo;
 | 
			
		||||
import com.youchain.businessdata.domain.Order;
 | 
			
		||||
import com.youchain.utils.FileUtil;
 | 
			
		||||
import com.youchain.utils.PageUtil;
 | 
			
		||||
| 
						 | 
				
			
			@ -27,6 +28,7 @@ import com.youchain.businessdata.service.OrderService;
 | 
			
		|||
import com.youchain.businessdata.service.dto.OrderDto;
 | 
			
		||||
import com.youchain.businessdata.service.dto.OrderQueryCriteria;
 | 
			
		||||
import com.youchain.businessdata.service.mapstruct.OrderMapper;
 | 
			
		||||
import org.springframework.data.domain.Example;
 | 
			
		||||
import org.springframework.stereotype.Service;
 | 
			
		||||
import org.springframework.transaction.annotation.Transactional;
 | 
			
		||||
import org.springframework.data.domain.Page;
 | 
			
		||||
| 
						 | 
				
			
			@ -53,6 +55,7 @@ public class OrderServiceImpl implements OrderService {
 | 
			
		|||
 | 
			
		||||
    private final OrderRepository orderRepository;
 | 
			
		||||
    private final OrderMapper orderMapper;
 | 
			
		||||
    private final EntityManager entityManager;
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
    @Override
 | 
			
		||||
| 
						 | 
				
			
			@ -74,6 +77,20 @@ public class OrderServiceImpl implements OrderService {
 | 
			
		|||
        return orderMapper.toDto(order);
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    @Override
 | 
			
		||||
    public OrderDto findByBarcodeNumber(String barcodeNumber) {
 | 
			
		||||
        String hql = "from Order o where o.barcodeNumber = :barcodeNumber";
 | 
			
		||||
        Query query = entityManager.createQuery(hql);
 | 
			
		||||
        query.setParameter("barcodeNumber", barcodeNumber);
 | 
			
		||||
        List<Order> orders = query.getResultList();
 | 
			
		||||
        if (orders.size() > 0) {
 | 
			
		||||
            return orderMapper.toDto(orders.get(0)); // 返回第一个订单
 | 
			
		||||
        } else {
 | 
			
		||||
            return null;
 | 
			
		||||
        }
 | 
			
		||||
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    @Override
 | 
			
		||||
    @Transactional(rollbackFor = Exception.class)
 | 
			
		||||
    public OrderDto create(Order resources) {
 | 
			
		||||
| 
						 | 
				
			
			@ -108,5 +125,9 @@ public class OrderServiceImpl implements OrderService {
 | 
			
		|||
        FileUtil.downloadExcel(list, response);
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    @Override
 | 
			
		||||
    public Order toEntity(OrderDto orderDto) {
 | 
			
		||||
        return orderMapper.toEntity(orderDto);
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
}
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -1,42 +0,0 @@
 | 
			
		|||
package com.youchain.businessdata.service.impl;
 | 
			
		||||
 | 
			
		||||
import com.alibaba.fastjson.JSON;
 | 
			
		||||
import com.alibaba.fastjson.JSONObject;
 | 
			
		||||
import com.youchain.businessdata.service.ToKenService;
 | 
			
		||||
import com.youchain.utils.HttpPostUtil;
 | 
			
		||||
import com.youchain.utils.UrlApi;
 | 
			
		||||
import lombok.RequiredArgsConstructor;
 | 
			
		||||
import lombok.extern.slf4j.Slf4j;
 | 
			
		||||
import org.springframework.stereotype.Service;
 | 
			
		||||
 | 
			
		||||
import java.util.LinkedHashMap;
 | 
			
		||||
import java.util.Map;
 | 
			
		||||
 | 
			
		||||
@Service
 | 
			
		||||
@RequiredArgsConstructor
 | 
			
		||||
@Slf4j
 | 
			
		||||
public class ToKenServiceImpl implements ToKenService {
 | 
			
		||||
 | 
			
		||||
    @Override
 | 
			
		||||
    public String getToKen() {
 | 
			
		||||
        String toKen="";
 | 
			
		||||
        String mlsUser="WMS";
 | 
			
		||||
        String mlsPwd="EDlsFOvn3xaJm*EH";
 | 
			
		||||
        JSONObject jsonObject = new JSONObject(new LinkedHashMap<>());
 | 
			
		||||
        Map<String, Object> objMap = new LinkedHashMap<>();
 | 
			
		||||
        objMap.put("mlsUser", mlsUser);//快码代码
 | 
			
		||||
        objMap.put("mlsPwd", mlsPwd);//快码值
 | 
			
		||||
        jsonObject.putAll(objMap);
 | 
			
		||||
        String resultJson = HttpPostUtil.sendPostReq(UrlApi.extSignIn, jsonObject.toString());//返回ResponseJson*/
 | 
			
		||||
        JSONObject resulObject = JSON.parseObject(resultJson);
 | 
			
		||||
        String code = resulObject.getString("code") == null ? "" : resulObject.getString("code");
 | 
			
		||||
        String msg = resulObject.getString("msg") == null ? "" : resulObject.getString("msg");
 | 
			
		||||
 | 
			
		||||
        if("0".equals(code)){
 | 
			
		||||
            toKen = resulObject.getString("data") == null ? "" : resulObject.getString("data");
 | 
			
		||||
            return toKen;
 | 
			
		||||
        }else{
 | 
			
		||||
            throw new RuntimeException("MLS异常信息:"+msg);
 | 
			
		||||
        }
 | 
			
		||||
    }
 | 
			
		||||
}
 | 
			
		||||
| 
						 | 
				
			
			@ -2,7 +2,7 @@ package com.youchain.modules.quartz.task;
 | 
			
		|||
 | 
			
		||||
import cn.hutool.core.date.DateUtil;
 | 
			
		||||
import com.youchain.businessdata.inputJson.OrderInfo;
 | 
			
		||||
import com.youchain.businessdata.inputJson.Params;
 | 
			
		||||
import com.youchain.businessdata.inputJson.OrderParams;
 | 
			
		||||
import com.youchain.businessdata.rest.MlsController;
 | 
			
		||||
import lombok.extern.slf4j.Slf4j;
 | 
			
		||||
import org.springframework.beans.factory.annotation.Autowired;
 | 
			
		||||
| 
						 | 
				
			
			@ -28,26 +28,26 @@ public class orderTask {
 | 
			
		|||
        this.mlsController = mlsController;
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    public void orderTask(){
 | 
			
		||||
        Date date=new Date();
 | 
			
		||||
        OrderInfo orderInfo=new OrderInfo();
 | 
			
		||||
    public void orderTask() {
 | 
			
		||||
 | 
			
		||||
        Date date = new Date();
 | 
			
		||||
        OrderInfo orderInfo = new OrderInfo();
 | 
			
		||||
        orderInfo.setIfaceCode("MLS-WQ-002");
 | 
			
		||||
        orderInfo.setSourceSystem("WQ");
 | 
			
		||||
 | 
			
		||||
        Set invCodes=new HashSet<>();
 | 
			
		||||
        invCodes.add("MA1181");
 | 
			
		||||
        invCodes.add("MD2211");
 | 
			
		||||
        Set invCodes = new HashSet<>();
 | 
			
		||||
        invCodes.add("MA2111");
 | 
			
		||||
 | 
			
		||||
        String startTime=DateUtil.format(DateUtil.beginOfDay(date), "yyyy-MM-dd HH:mm:ss");
 | 
			
		||||
        String endTime=DateUtil.format(DateUtil.endOfDay(date), "yyyy-MM-dd HH:mm:ss");
 | 
			
		||||
        Params params=new Params(100059,invCodes,"",startTime,endTime,1,100);
 | 
			
		||||
        String startTime = DateUtil.format(DateUtil.beginOfDay(date), "yyyy-MM-dd HH:mm:ss");
 | 
			
		||||
        String endTime = DateUtil.format(DateUtil.endOfDay(date), "yyyy-MM-dd HH:mm:ss");
 | 
			
		||||
        OrderParams params = new OrderParams(100059, invCodes, "", startTime, endTime, 1, 100);
 | 
			
		||||
 | 
			
		||||
        orderInfo.setParams(params);
 | 
			
		||||
 | 
			
		||||
        try{
 | 
			
		||||
        try {
 | 
			
		||||
            log.info("获取送货单信息");
 | 
			
		||||
            mlsController.getOrderInfo(orderInfo);
 | 
			
		||||
        }catch (Exception e){
 | 
			
		||||
        } catch (Exception e) {
 | 
			
		||||
            throw new RuntimeException("MLS异常信息:" + e);
 | 
			
		||||
        }
 | 
			
		||||
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -1,16 +1,10 @@
 | 
			
		|||
package com.youchain;
 | 
			
		||||
 | 
			
		||||
import com.youchain.businessdata.domain.AgvTask;
 | 
			
		||||
import com.youchain.businessdata.service.MlsService;
 | 
			
		||||
import com.youchain.businessdata.service.ToKenService;
 | 
			
		||||
import lombok.extern.slf4j.Slf4j;
 | 
			
		||||
import org.junit.jupiter.api.Test;
 | 
			
		||||
import org.springframework.beans.factory.annotation.Autowired;
 | 
			
		||||
import org.springframework.boot.test.context.SpringBootTest;
 | 
			
		||||
import java.util.ArrayList;
 | 
			
		||||
import java.util.List;
 | 
			
		||||
import java.util.concurrent.ArrayBlockingQueue;
 | 
			
		||||
import java.util.concurrent.BlockingQueue;
 | 
			
		||||
 | 
			
		||||
@SpringBootTest(webEnvironment = SpringBootTest.WebEnvironment.RANDOM_PORT)
 | 
			
		||||
@Slf4j
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
		Loading…
	
		Reference in New Issue