sunhh 2 роки тому
батько
коміт
e9045a6884

+ 102 - 0
purchase-admin/src/main/java/com/ozs/web/controller/base/BaseExpertController.java

@@ -0,0 +1,102 @@
+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.core.controller.BaseController;
+import com.ozs.common.core.domain.AjaxResult;
+import com.ozs.common.utils.StringUtils;
+import io.swagger.annotations.Api;
+import io.swagger.annotations.ApiOperation;
+import org.springframework.beans.factory.annotation.Autowired;
+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;
+
+import javax.validation.constraints.NotEmpty;
+import java.util.List;
+
+/**
+ * 专业库管理
+ *
+ * @author sunhh
+ */
+@Api(tags = "专家库管理")
+@RestController
+@RequestMapping("/base/expert")
+public class BaseExpertController extends BaseController {
+
+    @Autowired
+    private BaseExpertService baseExpertService;
+
+    @ApiOperation(value = "新增专家库", notes = "必传 专家库名称")
+    @PostMapping("/insertExpert")
+    public AjaxResult insertExpert(BaseExpert baseExpert) {
+        if (StringUtils.isNull(baseExpert) || StringUtils.isNull(baseExpert.getExpertName())) {
+            return error("专家库名称不能为空");
+        }
+        return toAjax(baseExpertService.save(baseExpert));
+    }
+
+    @ApiOperation(value = "删除专家库", notes = "必传 id")
+    @PostMapping("/deleteExpert")
+    public AjaxResult deleteExpert(BaseExpert baseExpert) {
+        if (StringUtils.isNull(baseExpert) || StringUtils.isNull(baseExpert.getId())) {
+            return error("专家库id不能为空");
+        }
+        return toAjax(baseExpertService.removeById(baseExpert.getId()));
+    }
+
+    @ApiOperation(value = "修改专家库", notes = "必传 id 及修改数据")
+    @PostMapping("/updateExpert")
+    public AjaxResult updateProfessional(BaseExpert baseExpert) {
+        if (StringUtils.isNull(baseExpert) || StringUtils.isNull(baseExpert.getId())) {
+            return error("专家库id和修改数据不能为空");
+        }
+        return toAjax(baseExpertService.updateById(baseExpert));
+    }
+
+    @ApiOperation(value = "查询专家库树结构", notes = "非必传 查询条件:品目名称")
+    @PostMapping("/selectExpert")
+    public AjaxResult selectExpert(@NotEmpty(message = "数据为空") @RequestBody BaseExpertVo baseExpertVo) {
+        LambdaQueryWrapper<BaseExpert> lw = new LambdaQueryWrapper<BaseExpert>();
+        if (!StringUtils.isBlank(baseExpertVo.getExpertName())) {
+            lw.like(BaseExpert::getExpertName, baseExpertVo.getExpertName());
+        }
+        if (!StringUtils.isBlank(baseExpertVo.getMajorType())) {
+            lw.eq(BaseExpert::getMajorType, baseExpertVo.getMajorType());
+        }
+        if (!ObjectUtils.isEmpty(baseExpertVo.getMajorGrade())) {
+            lw.eq(BaseExpert::getMajorGrade, baseExpertVo.getMajorGrade());
+        }
+        IPage<BaseExpert> page = baseExpertService.page(new Page<BaseExpert>(baseExpertVo.getPageNum(), baseExpertVo.getPageSize()), lw);
+        return success(page);
+    }
+
+    @ApiOperation(value = "黑白名单开关", notes = "必传id,supplierType 其他字段不传; 黑名单传0,白名单传1")
+    @PostMapping("/updateSupplierType")
+    public AjaxResult updateSupplierType(BaseExpert baseExpert) {
+        if (StringUtils.isNull(baseExpert) || StringUtils.isNull(baseExpert.getId()) || StringUtils.isNotNull(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));
+    }
+}

+ 0 - 5
purchase-admin/src/main/java/com/ozs/web/controller/base/BaseProfessionalController.java

@@ -5,21 +5,16 @@ import com.ozs.base.domain.vo.BaseProfessionalVo;
 import com.ozs.base.service.BaseProfessionalService;
 import com.ozs.common.core.controller.BaseController;
 import com.ozs.common.core.domain.AjaxResult;
-import com.ozs.common.core.domain.entity.SysUser;
 import com.ozs.common.exception.ServiceException;
 import com.ozs.common.utils.StringUtils;
 import com.ozs.common.utils.poi.ExcelUtil;
-import com.ozs.system.domain.SysConfig;
 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.web.bind.annotation.*;
 import org.springframework.web.multipart.MultipartFile;
 
 import javax.servlet.http.HttpServletResponse;
-import java.io.BufferedInputStream;
-import java.io.IOException;
 import java.util.List;
 
 /**

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

@@ -0,0 +1,90 @@
+package com.ozs.base.domain;
+
+import com.baomidou.mybatisplus.annotation.TableField;
+import com.baomidou.mybatisplus.annotation.TableName;
+import com.ozs.base.domain.vo.BaseExpertVo;
+import io.swagger.annotations.ApiModelProperty;
+import lombok.Data;
+import org.joda.time.DateTime;
+
+@Data
+@TableName("base_supplier")
+public class BaseExpert extends BaseExpertVo {
+
+    /**
+     * 主键ID
+     */
+    @ApiModelProperty(value = "id")
+    @TableField("id")
+    private Integer id;
+
+    /**
+     * 专家名称
+     */
+    @ApiModelProperty(value = "专家名称")
+    @TableField("expert_name")
+    private String expertName;
+
+    /**
+     * 专家性别
+     */
+    @ApiModelProperty(value = "专家性别")
+    @TableField("expert_gender")
+    private String expertGender;
+
+    /**
+     * 出生年月
+     */
+    @ApiModelProperty(value = "出生年月")
+    @TableField("expert_date_birth")
+    private DateTime expertDate_Birth;
+
+    /**
+     * 联系方式
+     */
+    @ApiModelProperty(value = "联系方式")
+    @TableField("expert_tel")
+    private String expertTel;
+
+    /**
+     * 专业类型
+     */
+    @ApiModelProperty(value = "专业类型")
+    @TableField("major_type")
+    private String majorType;
+
+    /**
+     * 单位信息
+     */
+    @ApiModelProperty(value = "单位信息")
+    @TableField("unit_information")
+    private String unitInformation;
+
+    /**
+     * 专业等级
+     */
+    @ApiModelProperty(value = "专业等级")
+    @TableField("major_grade")
+    private String majorGrade;
+
+    /**
+     * 采购品种
+     */
+    @ApiModelProperty(value = "采购品种")
+    @TableField("variety_purchase")
+    private String varietyPurchase;
+
+    /**
+     * 职称
+     */
+    @ApiModelProperty(value = "职称")
+    @TableField("professional_title")
+    private String professionalTitle;
+
+    /**
+     * 状态 黑白名单
+     */
+    @ApiModelProperty(value = "状态 黑白名单")
+    @TableField("status")
+    private String status;
+}

+ 23 - 0
purchase-system/src/main/java/com/ozs/base/domain/vo/BaseExpertVo.java

@@ -0,0 +1,23 @@
+package com.ozs.base.domain.vo;
+
+import com.ozs.common.vo.PageVo;
+import io.swagger.annotations.ApiModel;
+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;
+}

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

@@ -0,0 +1,9 @@
+package com.ozs.base.mapper;
+
+import com.baomidou.mybatisplus.core.mapper.BaseMapper;
+import com.ozs.base.domain.BaseExpert;
+import org.apache.ibatis.annotations.Mapper;
+
+@Mapper
+public interface BaseExpertMapper extends BaseMapper<BaseExpert> {
+}

+ 7 - 0
purchase-system/src/main/java/com/ozs/base/service/BaseExpertService.java

@@ -0,0 +1,7 @@
+package com.ozs.base.service;
+
+import com.baomidou.mybatisplus.extension.service.IService;
+import com.ozs.base.domain.BaseExpert;
+
+public interface BaseExpertService extends IService<BaseExpert> {
+}

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

@@ -0,0 +1,11 @@
+package com.ozs.base.service.impl;
+
+import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
+import com.ozs.base.domain.BaseExpert;
+import com.ozs.base.mapper.BaseExpertMapper;
+import com.ozs.base.service.BaseExpertService;
+import org.springframework.stereotype.Service;
+
+@Service
+public class BaseExpertServiceImpl extends ServiceImpl<BaseExpertMapper, BaseExpert> implements BaseExpertService {
+}