Browse Source

专业库修改

sunhh 2 năm trước cách đây
mục cha
commit
90171365ff
18 tập tin đã thay đổi với 259 bổ sung79 xóa
  1. 32 31
      purchase-admin/src/main/java/com/ozs/web/controller/base/BaseExpertController.java
  2. 9 7
      purchase-admin/src/main/java/com/ozs/web/controller/base/BaseProfessionalController.java
  3. 48 12
      purchase-admin/src/main/java/com/ozs/web/controller/base/BaseSupplierController.java
  4. 3 3
      purchase-admin/src/main/resources/application-dev.yml
  5. 1 1
      purchase-admin/src/main/resources/application.yml
  6. 2 2
      purchase-admin/src/main/resources/logback.xml
  7. 3 3
      purchase-system/src/main/java/com/ozs/base/domain/BaseExpert.java
  8. 1 3
      purchase-system/src/main/java/com/ozs/base/domain/BaseProfessional.java
  9. 5 2
      purchase-system/src/main/java/com/ozs/base/domain/BaseSupplier.java
  10. 9 11
      purchase-system/src/main/java/com/ozs/base/domain/vo/BaseExpertVo.java
  11. 22 0
      purchase-system/src/main/java/com/ozs/base/domain/vo/BaseSupplierVo.java
  12. 1 0
      purchase-system/src/main/java/com/ozs/base/mapper/BaseExpertMapper.java
  13. 3 1
      purchase-system/src/main/java/com/ozs/base/mapper/BaseSupplierMapper.java
  14. 5 1
      purchase-system/src/main/java/com/ozs/base/service/BaseExpertService.java
  15. 3 1
      purchase-system/src/main/java/com/ozs/base/service/BaseSupplierService.java
  16. 22 0
      purchase-system/src/main/java/com/ozs/base/service/impl/BaseExpertServiceImpl.java
  17. 4 1
      purchase-system/src/main/java/com/ozs/base/service/impl/BaseSupplierServiceImpl.java
  18. 86 0
      purchase-system/src/main/resources/mapper/base/BaseExpertMapper.xml

+ 32 - 31
purchase-admin/src/main/java/com/ozs/web/controller/base/BaseExpertController.java

@@ -3,21 +3,20 @@ package com.ozs.web.controller.base;
 import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
 import com.baomidou.mybatisplus.core.metadata.IPage;
 import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
-import com.ozs.base.domain.BaseAgency;
 import com.ozs.base.domain.BaseExpert;
-import com.ozs.base.domain.BaseProfessional;
-import com.ozs.base.domain.BaseSupplier;
 import com.ozs.base.domain.vo.BaseExpertVo;
-import com.ozs.base.domain.vo.BaseProfessionalVo;
 import com.ozs.base.service.BaseExpertService;
-import com.ozs.base.service.BaseProfessionalService;
-import com.ozs.base.vo.BaseAgentPageReqVo;
+import com.ozs.common.annotation.Log;
+import com.ozs.common.constant.ModularConstans;
 import com.ozs.common.core.controller.BaseController;
 import com.ozs.common.core.domain.AjaxResult;
+import com.ozs.common.enums.BusinessType;
 import com.ozs.common.utils.StringUtils;
 import io.swagger.annotations.Api;
 import io.swagger.annotations.ApiOperation;
+import org.joda.time.DateTime;
 import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.security.access.prepost.PreAuthorize;
 import org.springframework.util.ObjectUtils;
 import org.springframework.web.bind.annotation.PostMapping;
 import org.springframework.web.bind.annotation.RequestBody;
@@ -25,10 +24,9 @@ import org.springframework.web.bind.annotation.RequestMapping;
 import org.springframework.web.bind.annotation.RestController;
 
 import javax.validation.constraints.NotEmpty;
-import java.util.List;
 
 /**
- * 专库管理
+ * 专库管理
  *
  * @author sunhh
  */
@@ -42,16 +40,18 @@ public class BaseExpertController extends BaseController {
 
     @ApiOperation(value = "新增专家库", notes = "必传 专家库名称")
     @PostMapping("/insertExpert")
-    public AjaxResult insertExpert(BaseExpert baseExpert) {
+    @PreAuthorize("@ss.hasPermi('base:expert:insertExpert')")
+    @Log(title = ModularConstans.policy, businessType = BusinessType.INSERT)
+    public AjaxResult insertExpert(@RequestBody BaseExpert baseExpert) {
         if (StringUtils.isNull(baseExpert) || StringUtils.isNull(baseExpert.getExpertName())) {
             return error("专家库名称不能为空");
         }
-        return toAjax(baseExpertService.save(baseExpert));
+        return toAjax(baseExpertService.insertExpert(baseExpert));
     }
 
     @ApiOperation(value = "删除专家库", notes = "必传 id")
     @PostMapping("/deleteExpert")
-    public AjaxResult deleteExpert(BaseExpert baseExpert) {
+    public AjaxResult deleteExpert(@RequestBody BaseExpert baseExpert) {
         if (StringUtils.isNull(baseExpert) || StringUtils.isNull(baseExpert.getId())) {
             return error("专家库id不能为空");
         }
@@ -60,43 +60,44 @@ public class BaseExpertController extends BaseController {
 
     @ApiOperation(value = "修改专家库", notes = "必传 id 及修改数据")
     @PostMapping("/updateExpert")
-    public AjaxResult updateProfessional(BaseExpert baseExpert) {
+    public AjaxResult updateProfessional(@RequestBody BaseExpert baseExpert) {
         if (StringUtils.isNull(baseExpert) || StringUtils.isNull(baseExpert.getId())) {
             return error("专家库id和修改数据不能为空");
         }
         return toAjax(baseExpertService.updateById(baseExpert));
     }
 
-    @ApiOperation(value = "查询专家库树结构", notes = "非必传 查询条件:品目名称")
+    @ApiOperation(value = "查询专家库", notes = "非必传 查询条件:品目名称")
     @PostMapping("/selectExpert")
-    public AjaxResult selectExpert(@NotEmpty(message = "数据为空") @RequestBody BaseExpertVo baseExpertVo) {
+    public AjaxResult selectExpert(@RequestBody BaseExpertVo baseExpertVo) {
         LambdaQueryWrapper<BaseExpert> lw = new LambdaQueryWrapper<BaseExpert>();
-        if (!StringUtils.isBlank(baseExpertVo.getExpertName())) {
-            lw.like(BaseExpert::getExpertName, baseExpertVo.getExpertName());
+        if (!StringUtils.isBlank(baseExpertVo.getExpertNameVo())) {
+            lw.like(BaseExpert::getExpertName, baseExpertVo.getExpertNameVo());
         }
-        if (!StringUtils.isBlank(baseExpertVo.getMajorType())) {
-            lw.eq(BaseExpert::getMajorType, baseExpertVo.getMajorType());
+        if (!StringUtils.isBlank(baseExpertVo.getMajorTypeVo())) {
+            lw.eq(BaseExpert::getMajorType, baseExpertVo.getMajorTypeVo());
         }
-        if (!ObjectUtils.isEmpty(baseExpertVo.getMajorGrade())) {
-            lw.eq(BaseExpert::getMajorGrade, baseExpertVo.getMajorGrade());
+        if (!ObjectUtils.isEmpty(baseExpertVo.getMajorGradeVo())) {
+            lw.eq(BaseExpert::getMajorGrade, baseExpertVo.getMajorGradeVo());
         }
         IPage<BaseExpert> page = baseExpertService.page(new Page<BaseExpert>(baseExpertVo.getPageNum(), baseExpertVo.getPageSize()), lw);
         return success(page);
     }
 
-    @ApiOperation(value = "黑白名单开关", notes = "必传id,supplierType 其他字段不传; 黑名单传0,白名单传1")
+    @ApiOperation(value = "黑白名单开关", notes = "必传id,status 其他字段不传; 黑名单传0,白名单传1")
     @PostMapping("/updateSupplierType")
-    public AjaxResult updateSupplierType(BaseExpert baseExpert) {
-        if (StringUtils.isNull(baseExpert) || StringUtils.isNull(baseExpert.getId()) || StringUtils.isNotNull(baseExpert.getStatus())) {
+    public AjaxResult updateSupplierType(@RequestBody BaseExpert baseExpert) {
+        if (StringUtils.isNull(baseExpert) || StringUtils.isNull(baseExpert.getId())
+                || StringUtils.isNull(baseExpert.getStatus())) {
             return error("状态及ID不能为空");
         }
-        LambdaQueryWrapper<BaseExpert> lw = new LambdaQueryWrapper<BaseExpert>();
-        if (!StringUtils.isNull(baseExpert.getId())) {
-            lw.eq(BaseExpert::getId, baseExpert.getId());
-        }
-        if (!StringUtils.isBlank(baseExpert.getStatus())) {
-            lw.like(BaseExpert::getStatus, baseExpert.getStatus());
-        }
-        return toAjax(baseExpertService.update(lw));
+//        LambdaQueryWrapper<BaseExpert> lw = new LambdaQueryWrapper<BaseExpert>();
+//        if (!StringUtils.isNull(baseExpert.getId())) {
+//            lw.eq(BaseExpert::getId, baseExpert.getId());
+//        }
+//        if (!StringUtils.isBlank(baseExpert.getStatus())) {
+//            lw.eq(BaseExpert::getStatus, baseExpert.getStatus());
+//        }
+        return toAjax(baseExpertService.updateSupplierType(baseExpert));
     }
 }

+ 9 - 7
purchase-admin/src/main/java/com/ozs/web/controller/base/BaseProfessionalController.java

@@ -32,9 +32,11 @@ public class BaseProfessionalController extends BaseController {
 
     @ApiOperation(value = "新增专业库", notes = "必传 专业库名称、一级分类、编码、父级编码;没有父级编码传0")
     @PostMapping("/insertProfessional")
-    public AjaxResult insertProfessional(BaseProfessional baseProfessional) {
-        if (StringUtils.isNull(baseProfessional) || StringUtils.isNull(baseProfessional.getProfessionalName())
-                || StringUtils.isNull(baseProfessional.getProfessionalCode()) || StringUtils.isNull(baseProfessional.getProfessionalGrade())) {
+    public AjaxResult insertProfessional(@RequestBody BaseProfessional baseProfessional) {
+        if (StringUtils.isNull(baseProfessional)
+                || StringUtils.isNull(baseProfessional.getProfessionalName())
+                || StringUtils.isNull(baseProfessional.getProfessionalCode())
+                || StringUtils.isNull(baseProfessional.getProfessionalGrade())) {
             return error("专业库名称、编码、一级分类不能为空");
         }
         return toAjax(baseProfessionalService.save(baseProfessional));
@@ -42,7 +44,7 @@ public class BaseProfessionalController extends BaseController {
 
     @ApiOperation(value = "删除专业库", notes = "必传 id")
     @PostMapping("/deleteProfessional")
-    public AjaxResult deleteProfessional(BaseProfessional baseProfessional) {
+    public AjaxResult deleteProfessional(@RequestBody BaseProfessional baseProfessional) {
         if (StringUtils.isNull(baseProfessional) || StringUtils.isNull(baseProfessional.getId())) {
             return error("专业库id不能为空");
         }
@@ -58,7 +60,7 @@ public class BaseProfessionalController extends BaseController {
 
     @ApiOperation(value = "修改专业库", notes = "必传 id 及修改数据")
     @PostMapping("/updateProfessional")
-    public AjaxResult updateProfessional(BaseProfessional baseProfessional) {
+    public AjaxResult updateProfessional(@RequestBody BaseProfessional baseProfessional) {
         if (StringUtils.isNull(baseProfessional) || StringUtils.isNull(baseProfessional.getId())) {
             return error("专业库id和修改数据不能为空");
         }
@@ -67,14 +69,14 @@ public class BaseProfessionalController extends BaseController {
 
     @ApiOperation(value = "查询专业库树结构", notes = "非必传 查询条件:品目名称")
     @PostMapping("/selectBaseProfessional")
-    public AjaxResult selectBaseProfessional(BaseProfessionalVo baseProfessionalVo) {
+    public AjaxResult selectBaseProfessional(@RequestBody BaseProfessionalVo baseProfessionalVo) {
         List<BaseProfessionalVo> baseSupplierList = baseProfessionalService.selectBaseProfessional(baseProfessionalVo);
         return success(baseSupplierList);
     }
 
     @ApiOperation(value = "导入专业库", notes = "导入表格")
     @PostMapping("/importBaseProfessional")
-    public AjaxResult importBaseProfessional(MultipartFile file) throws Exception {
+    public AjaxResult importBaseProfessional(@RequestBody MultipartFile file) throws Exception {
         ExcelUtil<BaseProfessional> util = new ExcelUtil<BaseProfessional>(BaseProfessional.class);
         List<BaseProfessional> baseProfessionalList = util.importExcel(file.getInputStream());
         if (StringUtils.isNull(baseProfessionalList) || baseProfessionalList.size() == 0) {

+ 48 - 12
purchase-admin/src/main/java/com/ozs/web/controller/base/BaseSupplierController.java

@@ -1,15 +1,26 @@
 package com.ozs.web.controller.base;
 
+import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
+import com.baomidou.mybatisplus.core.metadata.IPage;
+import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
+import com.ozs.base.domain.BaseExpert;
+import com.ozs.base.domain.vo.BaseSupplierVo;
+import com.ozs.common.annotation.Log;
+import com.ozs.common.constant.ModularConstans;
 import com.ozs.common.core.controller.BaseController;
 import com.ozs.common.core.domain.AjaxResult;
 import com.ozs.common.core.page.TableDataInfo;
+import com.ozs.common.enums.BusinessType;
 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.ApiOperation;
 import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.security.access.prepost.PreAuthorize;
+import org.springframework.util.ObjectUtils;
 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;
 
@@ -20,7 +31,7 @@ import java.util.List;
  *
  * @author sunhh
  */
-@Api(tags="供应商管理")
+@Api(tags = "供应商管理")
 @RestController
 @RequestMapping("/base/supplier")
 public class BaseSupplierController extends BaseController {
@@ -30,7 +41,9 @@ public class BaseSupplierController extends BaseController {
 
     @ApiOperation(value = "新增供应商户", notes = "")
     @PostMapping("/insertBaseSupplier")
-    public AjaxResult insertBaseSupplier(BaseSupplier baseSupplier) {
+    @PreAuthorize("@ss.hasPermi('base:supplier:insertBaseSupplier')")
+    @Log(title = ModularConstans.policy, businessType = BusinessType.INSERT)
+    public AjaxResult insertBaseSupplier(@RequestBody BaseSupplier baseSupplier) {
         if (StringUtils.isNull(baseSupplier) || StringUtils.isNull(baseSupplier.getSupplierName())) {
             return error("供应商名称不能为空");
         }
@@ -39,7 +52,9 @@ public class BaseSupplierController extends BaseController {
 
     @ApiOperation(value = "删除供应商户", notes = "必传ID")
     @PostMapping("/deleteBaseSupplier")
-    public AjaxResult deleteBaseSupplier(BaseSupplier baseSupplier) {
+    @PreAuthorize("@ss.hasPermi('base:supplier:deleteBaseSupplier')")
+    @Log(title = ModularConstans.policy, businessType = BusinessType.DELETE)
+    public AjaxResult deleteBaseSupplier(@RequestBody BaseSupplier baseSupplier) {
         if (StringUtils.isNull(baseSupplier) || StringUtils.isNull(baseSupplier.getId())) {
             return error("删除ID不能为空");
         }
@@ -48,7 +63,9 @@ public class BaseSupplierController extends BaseController {
 
     @ApiOperation(value = "修改供应商户", notes = "必传ID及修改字段")
     @PostMapping("/updateBaseSupplier")
-    public AjaxResult updateBaseSupplier(BaseSupplier baseSupplier) {
+    @PreAuthorize("@ss.hasPermi('base:supplier:updateBaseSupplier')")
+    @Log(title = ModularConstans.policy, businessType = BusinessType.UPDATE)
+    public AjaxResult updateBaseSupplier(@RequestBody BaseSupplier baseSupplier) {
         if (StringUtils.isNull(baseSupplier) || StringUtils.isNull(baseSupplier.getId())) {
             return error("修改数据及ID不能为空");
         }
@@ -57,17 +74,19 @@ public class BaseSupplierController extends BaseController {
 
     @ApiOperation(value = "预先采购开关", notes = "必传id,supplierAdvancePurchase 其他字段不传; 关闭传0,开启传1")
     @PostMapping("/updateBaseSupplierAdvancePurchase")
-    public AjaxResult updateBaseSupplierAdvancePurchase(BaseSupplier baseSupplier) {
-        if (StringUtils.isNull(baseSupplier) || StringUtils.isNull(baseSupplier.getId()) || StringUtils.isNotNull(baseSupplier.getSupplierAdvancePurchase())) {
+    public AjaxResult updateBaseSupplierAdvancePurchase(@RequestBody BaseSupplier baseSupplier) {
+        if (StringUtils.isNull(baseSupplier) || StringUtils.isNull(baseSupplier.getId())
+                || StringUtils.isNull(baseSupplier.getSupplierAdvancePurchase())) {
             return error("预先采购及ID不能为空");
         }
         return toAjax(baseSupplierService.updateBaseSupplier(baseSupplier));
     }
 
-    @ApiOperation(value = "黑白名单开关", notes = "必传id,supplierType 其他字段不传; 黑名单传0,白名单传1")
+    @ApiOperation(value = "黑白名单开关", notes = "必传id,supplierState 其他字段不传; 黑名单传0,白名单传1")
     @PostMapping("/updateSupplierType")
-    public AjaxResult updateSupplierType(BaseSupplier baseSupplier) {
-        if (StringUtils.isNull(baseSupplier) || StringUtils.isNull(baseSupplier.getId()) || StringUtils.isNotNull(baseSupplier.getSupplierType())) {
+    public AjaxResult updateSupplierType(@RequestBody BaseSupplier baseSupplier) {
+        if (StringUtils.isNull(baseSupplier) || StringUtils.isNull(baseSupplier.getId())
+                || StringUtils.isNull(baseSupplier.getSupplierState())) {
             return error("状态及ID不能为空");
         }
         return toAjax(baseSupplierService.updateBaseSupplier(baseSupplier));
@@ -75,8 +94,25 @@ public class BaseSupplierController extends BaseController {
 
     @ApiOperation(value = "查询供应商户", notes = "非必传 查询条件:供应商名称,供应商类型,供应商状态,预先采购状态")
     @PostMapping("/selectBaseSupplier")
-    public TableDataInfo selectBaseSupplier(BaseSupplier baseSupplier) {
-        List<BaseSupplier> baseSupplierList = baseSupplierService.selectBaseSupplier(baseSupplier);
-        return getDataTable(baseSupplierList);
+    @PreAuthorize("@ss.hasPermi('base:supplier:selectBaseSupplier')")
+    @Log(title = ModularConstans.policy, businessType = BusinessType.QUERY)
+    public AjaxResult selectBaseSupplier(@RequestBody BaseSupplierVo baseSupplierVo) {
+//        List<BaseSupplier> baseSupplierList = baseSupplierService.selectBaseSupplier(baseSupplier);
+//        return getDataTable(baseSupplierList);
+        LambdaQueryWrapper<BaseSupplier> lw = new LambdaQueryWrapper<BaseSupplier>();
+        if (!StringUtils.isBlank(baseSupplierVo.getSupplierName())) {
+            lw.like(BaseSupplier::getSupplierName, "%" + baseSupplierVo.getSupplierName() + "%");
+        }
+        if (!StringUtils.isBlank(baseSupplierVo.getSupplierState())) {
+            lw.eq(BaseSupplier::getSupplierState, baseSupplierVo.getSupplierState());
+        }
+        if (!StringUtils.isBlank(baseSupplierVo.getSupplierType())) {
+            lw.eq(BaseSupplier::getSupplierType, baseSupplierVo.getSupplierType());
+        }
+        if (!StringUtils.isBlank(baseSupplierVo.getSupplierAdvancePurchase())) {
+            lw.eq(BaseSupplier::getSupplierAdvancePurchase, baseSupplierVo.getSupplierAdvancePurchase());
+        }
+        IPage<BaseSupplier> page = baseSupplierService.page(new Page<BaseSupplier>(baseSupplierVo.getPageNum(), baseSupplierVo.getPageSize()), lw);
+        return success(page);
     }
 }

+ 3 - 3
purchase-admin/src/main/resources/application-dev.yml

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

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

@@ -10,4 +10,4 @@ server:
 # Spring配置
 spring:
   profiles:
-    active: druid,test
+    active: druid,dev

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

@@ -1,8 +1,8 @@
 <?xml version="1.0" encoding="UTF-8"?>
 <configuration>
     <!-- 日志存放路径 -->
-        <property name="log.path" value="/home/purchase/logs" />
-<!--    <property name="log.path" value="/Users/sunhuanhuan/Documents/project/106/文档/purchase/logs"/>-->
+<!--        <property name="log.path" value="/home/purchase/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"/>
 

+ 3 - 3
purchase-system/src/main/java/com/ozs/base/domain/BaseExpert.java

@@ -8,8 +8,8 @@ import lombok.Data;
 import org.joda.time.DateTime;
 
 @Data
-@TableName("base_supplier")
-public class BaseExpert extends BaseExpertVo {
+@TableName("base_expert")
+public class BaseExpert {
 
     /**
      * 主键ID
@@ -37,7 +37,7 @@ public class BaseExpert extends BaseExpertVo {
      */
     @ApiModelProperty(value = "出生年月")
     @TableField("expert_date_birth")
-    private DateTime expertDate_Birth;
+    private String expertDateBirth;
 
     /**
      * 联系方式

+ 1 - 3
purchase-system/src/main/java/com/ozs/base/domain/BaseProfessional.java

@@ -5,11 +5,9 @@ import com.baomidou.mybatisplus.annotation.TableName;
 import io.swagger.annotations.ApiModelProperty;
 import lombok.Data;
 
-import java.io.Serializable;
-
 @Data
 @TableName("base_professional")
-public class BaseProfessional implements Serializable {
+public class BaseProfessional {
 
     /**
      * 主键ID

+ 5 - 2
purchase-system/src/main/java/com/ozs/base/domain/BaseSupplier.java

@@ -2,6 +2,8 @@ package com.ozs.base.domain;
 
 import lombok.Data;
 
+import javax.validation.constraints.NotBlank;
+
 /**
  * 供应商管理
  *
@@ -11,14 +13,15 @@ import lombok.Data;
 public class BaseSupplier {
     private int id;
     // 供应商名称
+    @NotBlank(message = "供应商名称不能为空")
     private String supplierName;
     // 供应商负责人
     private String supplierResponsiblePerson;
     // 供应商地址
     private String supplierAddress;
-    // 供应商类型 黑白名单
+    // 供应商类型
     private String supplierType;
-    // 状态
+    // 状态 黑白名单
     private String supplierState;
     // 预先采购
     private String supplierAdvancePurchase;

+ 9 - 11
purchase-system/src/main/java/com/ozs/base/domain/vo/BaseExpertVo.java

@@ -2,22 +2,20 @@ package com.ozs.base.domain.vo;
 
 import com.ozs.common.vo.PageVo;
 import io.swagger.annotations.ApiModel;
+import io.swagger.annotations.ApiModelProperty;
 import lombok.AllArgsConstructor;
 import lombok.Data;
 import lombok.NoArgsConstructor;
 
-@ApiModel(value = "BaseAgentPageReqVo", description = "专家库分页查询")
 @Data
-@AllArgsConstructor
-@NoArgsConstructor
 public class BaseExpertVo extends PageVo {
 
-    // 专家姓名
-    private String expertName;
-    // 专业类型
-    private String majorType;
-    // 专业等级
-    private String majorGrade;
-    // 采购品种
-    private String varietyPurchase;
+    @ApiModelProperty("专家姓名")
+    private String expertNameVo;
+    @ApiModelProperty("专业类型")
+    private String majorTypeVo;
+    @ApiModelProperty("专业等级")
+    private String majorGradeVo;
+    @ApiModelProperty("采购品种")
+    private String varietyPurchaseVo;
 }

+ 22 - 0
purchase-system/src/main/java/com/ozs/base/domain/vo/BaseSupplierVo.java

@@ -0,0 +1,22 @@
+package com.ozs.base.domain.vo;
+
+import com.ozs.common.vo.PageVo;
+import io.swagger.annotations.ApiModelProperty;
+import lombok.Data;
+
+@Data
+public class BaseSupplierVo extends PageVo {
+
+    @ApiModelProperty("供应商名称")
+    private String supplierName;
+    @ApiModelProperty("供应商负责人")
+    private String supplierResponsiblePerson;
+    @ApiModelProperty("供应商地址")
+    private String supplierAddress;
+    @ApiModelProperty("供应商类型")
+    private String supplierType;
+    @ApiModelProperty("状态 黑白名单")
+    private String supplierState;
+    @ApiModelProperty("预先采购")
+    private String supplierAdvancePurchase;
+}

+ 1 - 0
purchase-system/src/main/java/com/ozs/base/mapper/BaseExpertMapper.java

@@ -6,4 +6,5 @@ import org.apache.ibatis.annotations.Mapper;
 
 @Mapper
 public interface BaseExpertMapper extends BaseMapper<BaseExpert> {
+    int insertExpert(BaseExpert baseExpert);
 }

+ 3 - 1
purchase-system/src/main/java/com/ozs/base/mapper/BaseSupplierMapper.java

@@ -1,5 +1,7 @@
 package com.ozs.base.mapper;
 
+import com.baomidou.mybatisplus.core.mapper.BaseMapper;
+import com.ozs.base.domain.BaseExpert;
 import com.ozs.base.domain.BaseSupplier;
 import org.apache.ibatis.annotations.Mapper;
 
@@ -11,7 +13,7 @@ import java.util.List;
  * @author sunhh
  */
 @Mapper
-public interface BaseSupplierMapper {
+public interface BaseSupplierMapper extends BaseMapper<BaseSupplier> {
 
     /**
      * 新增

+ 5 - 1
purchase-system/src/main/java/com/ozs/base/service/BaseExpertService.java

@@ -1,7 +1,11 @@
 package com.ozs.base.service;
 
 import com.baomidou.mybatisplus.extension.service.IService;
+import com.ozs.base.domain.BaseAgency;
 import com.ozs.base.domain.BaseExpert;
 
-public interface BaseExpertService extends IService<BaseExpert> {
+public interface BaseExpertService  extends IService<BaseExpert> {
+    int insertExpert(BaseExpert baseExpert);
+
+    int updateSupplierType(BaseExpert baseExpert);
 }

+ 3 - 1
purchase-system/src/main/java/com/ozs/base/service/BaseSupplierService.java

@@ -1,5 +1,7 @@
 package com.ozs.base.service;
 
+import com.baomidou.mybatisplus.extension.service.IService;
+import com.ozs.base.domain.BaseExpert;
 import com.ozs.base.domain.BaseSupplier;
 
 import java.util.List;
@@ -9,7 +11,7 @@ import java.util.List;
  *
  * @author sunhh
  */
-public interface BaseSupplierService {
+public interface BaseSupplierService extends IService<BaseSupplier> {
 
     /**
      * 新增供应商

+ 22 - 0
purchase-system/src/main/java/com/ozs/base/service/impl/BaseExpertServiceImpl.java

@@ -1,11 +1,33 @@
 package com.ozs.base.service.impl;
 
+import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper;
 import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
+import com.ozs.base.domain.BaseAgency;
 import com.ozs.base.domain.BaseExpert;
 import com.ozs.base.mapper.BaseExpertMapper;
+import com.ozs.base.mapper.BaseSupplierMapper;
 import com.ozs.base.service.BaseExpertService;
+import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.stereotype.Service;
 
 @Service
 public class BaseExpertServiceImpl extends ServiceImpl<BaseExpertMapper, BaseExpert> implements BaseExpertService {
+
+    @Autowired
+    private BaseExpertMapper baseExpertMapper;
+
+    @Override
+    public int insertExpert(BaseExpert baseExpert) {
+        return baseExpertMapper.insertExpert(baseExpert);
+    }
+
+    @Override
+    public int updateSupplierType(BaseExpert baseExpert) {
+        LambdaUpdateWrapper<BaseExpert> lambdaUpdateWrapper = new LambdaUpdateWrapper<>();
+        //eq是指你查询的条件,set是指你修改的值
+        lambdaUpdateWrapper
+                .eq(BaseExpert::getId, baseExpert.getId())
+                .set(BaseExpert::getStatus, baseExpert.getStatus());
+        return baseExpertMapper.update(null, lambdaUpdateWrapper);
+    }
 }

+ 4 - 1
purchase-system/src/main/java/com/ozs/base/service/impl/BaseSupplierServiceImpl.java

@@ -1,6 +1,9 @@
 package com.ozs.base.service.impl;
 
+import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
+import com.ozs.base.domain.BaseExpert;
 import com.ozs.base.domain.BaseSupplier;
+import com.ozs.base.mapper.BaseExpertMapper;
 import com.ozs.base.mapper.BaseSupplierMapper;
 import com.ozs.base.service.BaseSupplierService;
 import org.springframework.beans.factory.annotation.Autowired;
@@ -14,7 +17,7 @@ import java.util.List;
  * @author sunhh
  */
 @Service
-public class BaseSupplierServiceImpl implements BaseSupplierService {
+public class BaseSupplierServiceImpl extends ServiceImpl<BaseSupplierMapper, BaseSupplier> implements BaseSupplierService {
 
     @Autowired
     private BaseSupplierMapper baseSupplierMapper;

+ 86 - 0
purchase-system/src/main/resources/mapper/base/BaseExpertMapper.xml

@@ -0,0 +1,86 @@
+<?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.BaseExpertMapper">
+    <resultMap type="com.ozs.base.domain.BaseExpert" id="BaseExpertResult">
+        <id property="id" column="id"/>
+        <result property="expertName" column="expert_name"/>
+        <result property="expertGender" column="expert_gender"/>
+        <result property="expertDateBirth" column="expert_date_birth"/>
+        <result property="expertTel" column="expert_tel"/>
+        <result property="majorType" column="major_type"/>
+        <result property="unitInformation" column="unit_information"/>
+        <result property="majorGrade" column="major_grade"/>
+        <result property="varietyPurchase" column="variety_purchase"/>
+        <result property="professionalTitle" column="professional_title"/>
+        <result property="status" column="status"/>
+    </resultMap>
+
+    <insert id="insertExpert" parameterType="com.ozs.base.domain.BaseExpert">
+        insert into base_expert (
+        <if test="expertName != null and expertName != '' ">
+            expert_name,
+        </if>
+        <if test="expertGender != null and expertGender != '' ">
+            expert_gender,
+        </if>
+        <if test="expertDateBirth != null and expertDateBirth != '' ">
+            expert_date_birth,
+        </if>
+        <if test="expertTel != null and expertTel != '' ">
+            expert_tel,
+        </if>
+        <if test="majorType != null and majorType != ''">
+            major_type,
+        </if>
+        <if test="unitInformation != null and unitInformation != ''">
+            unit_information,
+        </if>
+        <if test="majorGrade != null and majorGrade != '' ">
+            major_grade,
+        </if>
+        <if test="varietyPurchase != null and varietyPurchase != '' ">
+            variety_purchase,
+        </if>
+        <if test="professionalTitle != null and professionalTitle != ''">
+            professional_title,
+        </if>
+        <if test="status != null and status != ''">
+            status
+        </if>
+        ) values (
+        <if test="expertName != null and expertName != ''">
+            #{expertName},
+        </if>
+        <if test="expertGender != null and expertGender != ''">
+            #{expertGender},
+        </if>
+        <if test="expertDateBirth != null and expertDateBirth != ''">
+            #{expertDateBirth},
+        </if>
+        <if test="expertTel != null and expertTel != ''">
+            #{expertTel},
+        </if>
+        <if test="majorType != null and majorType != ''">
+            #{majorType},
+        </if>
+        <if test="unitInformation != null and unitInformation != ''">
+            #{unitInformation},
+        </if>
+        <if test="majorGrade != null and majorGrade != ''">
+            #{majorGrade},
+        </if>
+        <if test="varietyPurchase != null and varietyPurchase != ''">
+            #{varietyPurchase},
+        </if>
+        <if test="professionalTitle != null and professionalTitle != ''">
+            #{professionalTitle},
+        </if>
+        <if test="status != null and status != ''">
+            #{status}
+        </if>
+        )
+    </insert>
+
+</mapper>