Forráskód Böngészése

委外订单接口

ysh 2 éve
szülő
commit
4fdec64a4c

+ 52 - 0
jeecg-boot-module-system/src/main/java/org/jeecg/modules/openApi/controller/SubcontractingOrderController.java

@@ -0,0 +1,52 @@
+package org.jeecg.modules.openApi.controller;
+
+import io.swagger.annotations.Api;
+import lombok.extern.slf4j.Slf4j;
+import org.jeecg.common.system.base.controller.JeecgController;
+import org.jeecg.modules.openApi.entity.PurchaseWarehousing;
+import org.jeecg.modules.openApi.entity.ResHttpStatus;
+import org.jeecg.modules.openApi.entity.SubcontractingOrder;
+import org.jeecg.modules.openApi.service.IPurchaseWarehousingService;
+import org.jeecg.modules.openApi.service.SubcontractingOrderService;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.http.HttpStatus;
+import org.springframework.http.ResponseEntity;
+import org.springframework.web.bind.annotation.RequestMapping;
+import org.springframework.web.bind.annotation.RequestMethod;
+import org.springframework.web.bind.annotation.ResponseBody;
+import org.springframework.web.bind.annotation.RestController;
+
+/**
+ * @Description: 委外订单
+ * @Author: jeecg-boot
+ * @Date:   2022-04-3
+ * @Version: V1.0
+ */
+@Slf4j
+@Api(tags="委外订单(染厂)- 验布机")
+@RestController
+@RequestMapping("/openApi/subcontractingOrder")
+public class SubcontractingOrderController extends JeecgController<SubcontractingOrder, SubcontractingOrderService> {
+
+    @Autowired
+    private SubcontractingOrderService subcontractingOrderService;
+
+    /**
+     * 根据订单号获取委外订单详情
+     */
+    @RequestMapping(value = "/getSubcontractingOrderByCode",method = RequestMethod.GET)
+    @ResponseBody
+    public ResponseEntity<ResHttpStatus> getSubcontractingOrderByCode(String code, String key) {
+        ResHttpStatus res = new ResHttpStatus();
+
+        SubcontractingOrder order =subcontractingOrderService.selectOrderByCode("SYW313-森宏");
+        res.setCode("200");
+        res.setMsg("成功");
+        res.setSuccess(true);
+        res.setData(order);
+
+        return new ResponseEntity<ResHttpStatus>(res, HttpStatus.OK);
+    }
+
+
+}

+ 51 - 0
jeecg-boot-module-system/src/main/java/org/jeecg/modules/openApi/entity/ResHttpStatus.java

@@ -0,0 +1,51 @@
+package org.jeecg.modules.openApi.entity;
+
+
+/**
+ * 返回json数据
+ * @author ysh
+ *
+ */
+public class ResHttpStatus {
+
+    // 返回http状态码
+    private String code;
+    // 返回状态消息
+    private String msg;
+    // 返回状态消息
+    private boolean success;
+
+    private Object data;
+
+    public String getCode() {
+        return code;
+    }
+
+    public void setCode(String code) {
+        this.code = code;
+    }
+
+    public String getMsg() {
+        return msg;
+    }
+
+    public void setMsg(String msg) {
+        this.msg = msg;
+    }
+
+    public Object getData() {
+        return data;
+    }
+
+    public void setData(Object data) {
+        this.data = data;
+    }
+
+    public boolean getSuccess() {
+        return success;
+    }
+
+    public void setSuccess(boolean success) {
+        this.success = success;
+    }
+}

+ 23 - 0
jeecg-boot-module-system/src/main/java/org/jeecg/modules/openApi/entity/SubcontractingOrder.java

@@ -0,0 +1,23 @@
+package org.jeecg.modules.openApi.entity;
+
+import com.baomidou.mybatisplus.annotation.TableName;
+import io.swagger.annotations.ApiModel;
+import lombok.Data;
+import lombok.EqualsAndHashCode;
+import lombok.experimental.Accessors;
+
+@Data
+public class SubcontractingOrder {
+    //染厂
+    private String cCode; //委外订单号
+    private String cInvCode; //存货编码
+    private String cInvName; //存货名称(英文名称)
+    private String itemNumber; //款号
+    //缸号
+    //织厂
+    //颜色
+    private String dyeFactoryCode;//色号
+    //要求克重
+    //总卷数
+    //要求门幅
+}

+ 22 - 0
jeecg-boot-module-system/src/main/java/org/jeecg/modules/openApi/mapper/SubcontractingOrderMapper.java

@@ -0,0 +1,22 @@
+package org.jeecg.modules.openApi.mapper;
+
+import com.baomidou.mybatisplus.annotation.InterceptorIgnore;
+import com.baomidou.mybatisplus.core.mapper.BaseMapper;
+import org.jeecg.modules.openApi.entity.SubcontractingOrder;
+
+
+/**
+ * @Description: 委外订单
+ * @Author: jeecg-boot
+ * @Version: V1.0
+ */
+public interface SubcontractingOrderMapper extends BaseMapper<SubcontractingOrder> {
+
+    /**
+     * 根据委外订单编码获取订单详情
+     * @param code
+     * @return
+     */
+    SubcontractingOrder selectOrderByCode( String code);
+
+}

+ 10 - 0
jeecg-boot-module-system/src/main/java/org/jeecg/modules/openApi/mapper/xml/SubcontractingOrderMapper.xml

@@ -0,0 +1,10 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
+<mapper namespace="org.jeecg.modules.openApi.mapper.SubcontractingOrderMapper">
+
+    <select id="selectOrderByCode" resultType="org.jeecg.modules.openApi.entity.SubcontractingOrder">
+
+        select * from OM_MOMain where ccode = 'SYW313-森宏'
+
+    </select>
+</mapper>

+ 9 - 0
jeecg-boot-module-system/src/main/java/org/jeecg/modules/openApi/service/SubcontractingOrderService.java

@@ -0,0 +1,9 @@
+package org.jeecg.modules.openApi.service;
+
+import com.baomidou.mybatisplus.extension.service.IService;
+import org.jeecg.modules.openApi.entity.SubcontractingOrder;
+
+public interface SubcontractingOrderService extends IService<SubcontractingOrder> {
+
+    SubcontractingOrder selectOrderByCode(String code);
+}

+ 24 - 0
jeecg-boot-module-system/src/main/java/org/jeecg/modules/openApi/service/impl/SubcontractingOrderImpl.java

@@ -0,0 +1,24 @@
+package org.jeecg.modules.openApi.service.impl;
+
+import com.baomidou.dynamic.datasource.annotation.DS;
+import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
+import org.jeecg.modules.openApi.entity.SubcontractingOrder;
+import org.jeecg.modules.openApi.mapper.SubcontractingOrderMapper;
+import org.jeecg.modules.openApi.service.SubcontractingOrderService;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.stereotype.Service;
+import org.springframework.transaction.annotation.Transactional;
+
+import javax.annotation.Resource;
+
+@Service
+public class SubcontractingOrderImpl extends ServiceImpl<SubcontractingOrderMapper, SubcontractingOrder> implements SubcontractingOrderService {
+
+    @Autowired
+    private SubcontractingOrderMapper subcontractingOrderMapper;
+
+    @DS("multi-one")
+    public SubcontractingOrder selectOrderByCode(String code){
+        return subcontractingOrderMapper.selectOrderByCode(code);
+    }
+}