sunhh před 2 roky
rodič
revize
65b1aad445

+ 40 - 0
purchase-admin/src/main/java/com/ozs/web/controller/base/BaseSupplierController.java

@@ -0,0 +1,40 @@
+package com.ozs.web.controller.base;
+
+import com.ozs.common.core.controller.BaseController;
+import com.ozs.common.core.domain.AjaxResult;
+import com.ozs.common.utils.StringUtils;
+import com.ozs.base.domain.BaseSupplier;
+import com.ozs.base.service.BaseSupplierService;
+import io.swagger.annotations.Api;
+import io.swagger.annotations.ApiImplicitParam;
+import io.swagger.annotations.ApiImplicitParams;
+import io.swagger.annotations.ApiOperation;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.web.bind.annotation.PostMapping;
+import org.springframework.web.bind.annotation.RequestMapping;
+import org.springframework.web.bind.annotation.RestController;
+
+/**
+ * 供应商管理
+ *
+ * @author sunhh
+ */
+@Api("供应商管理")
+@RestController
+@RequestMapping("/base/supplier")
+public class BaseSupplierController extends BaseController {
+
+    @Autowired
+    private BaseSupplierService baseSupplierService;
+
+    @ApiOperation("新增供应商户")
+    @ApiImplicitParams({@ApiImplicitParam(paramType = "body", dataType = "BaseSupplier",
+            name = "req", value = "信息参数", required = true)})
+    @PostMapping("/save")
+    public AjaxResult save(BaseSupplier baseSupplier) {
+        if (StringUtils.isNull(baseSupplier) || StringUtils.isNull(baseSupplier.getSupplierName())) {
+            return error("供应商名称不能为空");
+        }
+        return toAjax(baseSupplierService.insertBaseSupplier(baseSupplier));
+    }
+}

+ 3 - 0
purchase-admin/src/main/java/com/ozs/web/controller/system/SysLoginController.java

@@ -2,6 +2,8 @@ package com.ozs.web.controller.system;
 
 import java.util.List;
 import java.util.Set;
+
+import io.swagger.annotations.ApiOperation;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.web.bind.annotation.GetMapping;
 import org.springframework.web.bind.annotation.PostMapping;
@@ -40,6 +42,7 @@ public class SysLoginController
      * @param loginBody 登录信息
      * @return 结果
      */
+    @ApiOperation("新增用户")
     @PostMapping("/login")
     public AjaxResult login(@RequestBody LoginBody loginBody)
     {

+ 2 - 1
purchase-admin/src/main/resources/application.yml

@@ -9,7 +9,8 @@ purchase:
   # 实例演示开关
   demoEnabled: true
   # 文件路径 示例( Windows配置D:/purchase/uploadPath,Linux配置 /home/purchase/uploadPath)
-  profile: C:/purchase/uploadPath
+  #  profile: C:/purchase/uploadPath
+  profile: /Users/sunhuanhuan/Documents/project/106/文档/purchase/uploadPath
   # 获取ip地址开关
   addressEnabled: false
   # 验证码类型 math 数组计算 char 字符验证

+ 2 - 1
purchase-admin/src/main/resources/logback.xml

@@ -1,7 +1,8 @@
 <?xml version="1.0" encoding="UTF-8"?>
 <configuration>
     <!-- 日志存放路径 -->
-	<property name="log.path" value="/home/ruoyi/logs" />
+<!--	<property name="log.path" value="/home/ruoyi/logs" />-->
+    <property name="log.path" value="/Users/sunhuanhuan/Documents/project/106/文档/purchase/logs" />
     <!-- 日志输出格式 -->
 	<property name="log.pattern" value="%d{HH:mm:ss.SSS} [%thread] %-5level %logger{20} - [%method,%line] - %msg%n" />
 

+ 19 - 0
purchase-system/src/main/java/com/ozs/base/domain/BaseSupplier.java

@@ -0,0 +1,19 @@
+package com.ozs.base.domain;
+
+import lombok.Data;
+
+/**
+ * 供应商管理
+ *
+ * @author sunhh
+ */
+@Data
+public class BaseSupplier {
+    private int id;
+    private String supplierName;
+    private String supplierResponsiblePerson;
+    private String supplierAddress;
+    private String supplierType;
+    private String supplierState;
+    private String supplierAdvancePurchase;
+}

+ 21 - 0
purchase-system/src/main/java/com/ozs/base/mapper/BaseSupplierMapper.java

@@ -0,0 +1,21 @@
+package com.ozs.base.mapper;
+
+import com.ozs.base.domain.BaseSupplier;
+import org.apache.ibatis.annotations.Mapper;
+
+/**
+ * 供应商管理
+ *
+ * @author sunhh
+ */
+@Mapper
+public interface BaseSupplierMapper {
+
+    /**
+     * 新增参数配置
+     *
+     * @param baseSupplier 参数配置信息
+     * @return 结果
+     */
+    public int insertBaseSupplier(BaseSupplier baseSupplier);
+}

+ 20 - 0
purchase-system/src/main/java/com/ozs/base/service/BaseSupplierService.java

@@ -0,0 +1,20 @@
+package com.ozs.base.service;
+
+import com.ozs.base.domain.BaseSupplier;
+
+/**
+ * 供应商管理
+ *
+ * @author sunhh
+ */
+public interface BaseSupplierService {
+
+    /**
+     * 新增供应商
+     *
+     * @param baseSupplier 供应商信息
+     * @return 结果
+     */
+    public int insertBaseSupplier(BaseSupplier baseSupplier);
+
+}

+ 24 - 0
purchase-system/src/main/java/com/ozs/base/service/impl/BaseSupplierServiceImpl.java

@@ -0,0 +1,24 @@
+package com.ozs.base.service.impl;
+
+import com.ozs.base.domain.BaseSupplier;
+import com.ozs.base.mapper.BaseSupplierMapper;
+import com.ozs.base.service.BaseSupplierService;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.stereotype.Service;
+
+/**
+ * 供应商管理
+ *
+ * @author sunhh
+ */
+@Service
+public class BaseSupplierServiceImpl implements BaseSupplierService {
+
+    @Autowired
+    private BaseSupplierMapper baseSupplierMapper;
+
+    @Override
+    public int insertBaseSupplier(BaseSupplier baseSupplier) {
+        return baseSupplierMapper.insertBaseSupplier(baseSupplier);
+    }
+}

+ 27 - 0
purchase-system/src/main/resources/mapper/base/BaseSupplierMapper.xml

@@ -0,0 +1,27 @@
+<?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="com.ozs.base.mapper.BaseSupplierMapper">
+
+    <insert id="insertBaseSupplier" parameterType="BaseSupplier">
+        insert into base_supplier (
+        <if test="supplierName != null and supplierName != '' ">supplier_name,</if>
+        <if test="supplierResponsiblePerson != null and supplierResponsiblePerson != '' ">supplier_responsible_person,
+        </if>
+        <if test="supplierAddress != null and supplierAddress != '' ">supplier_address,</if>
+        <if test="supplierType != null and supplierType != '' ">supplier_type,</if>
+        <if test="supplierState != null and supplierState != ''">supplier_state,</if>
+        <if test="supplierAdvancePurchase != null and supplierAdvancePurchase != ''">supplier_advance_purchase,</if>
+        ) values (
+        <if test="supplierName != null and supplierName != ''">#{supplierName},</if>
+        <if test="supplierResponsiblePerson != null and supplierResponsiblePerson != ''">#{supplierResponsiblePerson},
+        </if>
+        <if test="supplierAddress != null and supplierAddress != ''">#{supplierAddress},</if>
+        <if test="supplierType != null and supplierType != ''">#{supplierType},</if>
+        <if test="supplierState != null and supplierState != ''">#{supplierState},</if>
+        <if test="supplierAdvancePurchase != null and supplierAdvancePurchase != ''">#{supplierAdvancePurchase},</if>
+        )
+    </insert>
+
+</mapper>