Sfoglia il codice sorgente

v3项目-修改0908

wwh 2 mesi fa
parent
commit
b93be509b3
19 ha cambiato i file con 225 aggiunte e 27 eliminazioni
  1. 9 0
      app-admin/src/main/java/com/ruoyi/web/controller/app/PigpenController.java
  2. 11 4
      app-admin/src/main/java/com/ruoyi/web/controller/app/PurchaserController.java
  3. 17 5
      app-admin/src/main/java/com/ruoyi/web/controller/app/SupplierController.java
  4. 22 9
      app-admin/src/main/java/com/ruoyi/web/v2/v1/controller/JsReportController.java
  5. 2 1
      app-admin/src/main/java/com/ruoyi/web/v2/v1/service/impl/JsDivideCircleServiceImpl.java
  6. 31 2
      app-admin/src/main/java/com/ruoyi/web/v2/v1/service/impl/JsDrugCheckServiceImpl.java
  7. 1 1
      app-system/src/main/java/com/ruoyi/app/model/Pigpen.java
  8. 1 1
      app-system/src/main/java/com/ruoyi/app/model/Purchaser.java
  9. 11 0
      app-system/src/main/java/com/ruoyi/app/model/Staff.java
  10. 27 0
      app-system/src/main/java/com/ruoyi/app/model/Supplier.java
  11. 6 0
      app-system/src/main/java/com/ruoyi/app/service/IPigpenService.java
  12. 6 0
      app-system/src/main/java/com/ruoyi/app/service/IPurchaserService.java
  13. 6 0
      app-system/src/main/java/com/ruoyi/app/service/ISupplierService.java
  14. 14 0
      app-system/src/main/java/com/ruoyi/app/service/impl/PigpenServiceImpl.java
  15. 19 0
      app-system/src/main/java/com/ruoyi/app/service/impl/PurchaserServiceImpl.java
  16. 18 0
      app-system/src/main/java/com/ruoyi/app/service/impl/SupplierServiceImpl.java
  17. 7 3
      app-system/src/main/resources/mapper/app/StaffMapper.xml
  18. 9 1
      app-system/src/main/resources/mapper/app/SupplierMapper.xml
  19. 8 0
      sql/v3_biz_20250814.sql

+ 9 - 0
app-admin/src/main/java/com/ruoyi/web/controller/app/PigpenController.java

@@ -135,4 +135,13 @@ public class PigpenController extends BaseController
         List<Pigpen> list = pigpenService.selectPigpenList(pigpen);
         return success(list);
     }
+
+    /**
+     * 获取下一个自动生成的猪圈编号
+     */
+    @GetMapping("/nextNo")
+    public AjaxResult nextNo()
+    {
+        return success(pigpenService.getNextNo());
+    }
 }

+ 11 - 4
app-admin/src/main/java/com/ruoyi/web/controller/app/PurchaserController.java

@@ -95,10 +95,10 @@ public class PurchaserController extends BaseController
     @PostMapping
     public AjaxResult add(@Validated @RequestBody Purchaser purchaser)
     {
-        if (!purchaserService.checkPurchaserNoUnique(purchaser))
-        {
-            return error("新增肉商'" + purchaser.getPurchaserName() + "'失败,列表中存在重复的肉商编号");
-        }
+//        if (!purchaserService.checkPurchaserNoUnique(purchaser))
+//        {
+//            return error("新增肉商'" + purchaser.getPurchaserName() + "'失败,列表中存在重复的肉商编号");
+//        }
         if (!purchaserService.checkPurchaserNameUnique(purchaser))
         {
             return error("新增肉商'" + purchaser.getPurchaserName() + "'失败,列表中存在重复的肉商名称");
@@ -147,4 +147,11 @@ public class PurchaserController extends BaseController
     {
         return toAjax(purchaserService.deletePurchaserByIds(ids));
     }
+
+    @ApiOperation("查询自动生成的肉商编号")
+    @GetMapping("/nextNo")
+    public AjaxResult nextNo()
+    {
+        return success(purchaserService.getNextNo());
+    }
 }

+ 17 - 5
app-admin/src/main/java/com/ruoyi/web/controller/app/SupplierController.java

@@ -1,6 +1,7 @@
 package com.ruoyi.web.controller.app;
 
 import java.util.List;
+import java.util.stream.Collectors;
 import javax.servlet.http.HttpServletResponse;
 
 import com.ruoyi.app.model.request.ReqSupplierList;
@@ -60,6 +61,8 @@ public class SupplierController extends BaseController
     public AjaxResult optionselect()
     {
         List<Supplier> list = supplierService.selectAllSupplierList();
+        //去除被标记为黑名单的供应商
+        list = list.stream().filter(item -> "0".equals(item.getInBlacklist())).collect(Collectors.toList());
         return success(list);
     }
 
@@ -93,16 +96,16 @@ public class SupplierController extends BaseController
     @PreAuthorize("@ss.hasPermi('app:supplier:add')")
     @Log(title = "供应商", businessType = BusinessType.INSERT)
     @PostMapping
-    public AjaxResult add(@Validated  @RequestBody Supplier supplier)
+    public AjaxResult add(@RequestBody Supplier supplier)
     {
         if (!supplierService.checkSupplierNameUnique(supplier))
         {
             return error("新增供应商'" + supplier.getSupplierName() + "'失败,列表中存在重复的供应商名称");
         }
-        if (!supplierService.checkSupplierNoUnique(supplier))
-        {
-            return error("新增供应商'" + supplier.getSupplierName() + "'失败,列表中存在重复的供应商编号");
-        }
+//        if (!supplierService.checkSupplierNoUnique(supplier))
+//        {
+//            return error("新增供应商'" + supplier.getSupplierName() + "'失败,列表中存在重复的供应商编号");
+//        }
         supplier.setCreateBy(getUsername());
         return toAjax(supplierService.insertSupplier(supplier));
     }
@@ -139,4 +142,13 @@ public class SupplierController extends BaseController
     {
         return toAjax(supplierService.deleteSupplierByIds(ids));
     }
+
+    @ApiOperation("查询自动生成的供应商编号")
+    @GetMapping("/nextNo")
+    public AjaxResult nextNo()
+    {
+        return success(supplierService.getNextNo());
+    }
+
+
 }

+ 22 - 9
app-admin/src/main/java/com/ruoyi/web/v2/v1/controller/JsReportController.java

@@ -7,6 +7,9 @@ import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
 import com.ruoyi.app.model.Pigpen;
 import com.ruoyi.app.mapper.PigpenMapper;
 import com.ruoyi.common.core.domain.AjaxResult;
+import com.ruoyi.common.core.domain.entity.SysUser;
+import com.ruoyi.common.core.domain.model.LoginUser;
+import com.ruoyi.common.utils.SecurityUtils;
 import com.ruoyi.web.v2.v1.mapper.JsDivideCircleMapper;
 import com.ruoyi.web.v2.v1.model.JsDivideCircle;
 import com.ruoyi.web.v2.v1.model.JsReport;
@@ -84,15 +87,25 @@ public class JsReportController {
             if (!ObjectUtils.isEmpty(circle.getEntranceBatchId()) && !ObjectUtils.isEmpty(circle.getSeriesNo())) {
                 //先检索出同批次、同栏的历史记录,针对数量进行逻辑完整性校验,数量的变化过程,不能小于0,小于0就归零
                 List<JsDivideCircle> records = jsDivideCircleMapper.selectList(new LambdaQueryWrapper<JsDivideCircle>()
-                        .eq(JsDivideCircle::getSeriesNo, circle.getSeriesNo()).orderByAsc(JsDivideCircle::getId)
-                        .eq(JsDivideCircle::getStatusFlag, "opened"));
-                if (!ObjectUtils.isEmpty(records)) {
-                    if (circle.getAmount() > 0) {
+                        .eq(JsDivideCircle::getSeriesNo, circle.getSeriesNo())
+                        .eq(JsDivideCircle::getStatusFlag, "opened")
+                        .ge(JsDivideCircle::getAmount, circle.getAmount()));
+                boolean isDuplicated = records.stream().anyMatch(item -> item.getAmount().equals(circle.getAmount()));
+                if(circle.getAmount() > 0) {
+                    if (!ObjectUtils.isEmpty(records) && !isDuplicated) {
                         circle.setStatusFlag("opened");
                         circle.setId(null);
+                        //系统自动插入的数据,分圈时间设置为空
+                        circle.setDivideTime(null);
+                        circle.setCreateTime(new Date());
                         jsDivideCircleMapper.insert(circle);
-                    } else {
+                    }
+                }else {
+                    if (!ObjectUtils.isEmpty(records)) {
                         circle.setId(null);
+                        //系统自动插入的数据,分圈时间设置为空
+                        circle.setDivideTime(null);
+                        circle.setCreateTime(new Date());
                         jsDivideCircleMapper.insert(circle);
                         jsDivideCircleMapper.update(null, new LambdaUpdateWrapper<JsDivideCircle>()
                                 .eq(JsDivideCircle::getSeriesNo, circle.getSeriesNo())
@@ -103,16 +116,16 @@ public class JsReportController {
                         pigpen.setIsUse(0);
                         pigpenMapper.updatePigpen(pigpen);
                     }
-
                 }
             }
         }
         //保存完工报告记录
         JsReport jsReport = new JsReport();
         jsReport.setCreateTime(new Date());
-        jsReport.setUserName(Optional.ofNullable(SecurityContextHolder.getContext().getAuthentication())
-                .map(Authentication::getName)
-                .orElse("system"));
+        LoginUser loginUser = SecurityUtils.getLoginUser();
+        jsReport.setUserName(Optional.ofNullable(loginUser.getUser())
+                .map(SysUser::getNickName)
+                .orElse("系统管理员"));
         return success(reportService.save(jsReport));
     }
 }

+ 2 - 1
app-admin/src/main/java/com/ruoyi/web/v2/v1/service/impl/JsDivideCircleServiceImpl.java

@@ -172,7 +172,8 @@ public class JsDivideCircleServiceImpl extends ServiceImpl<JsDivideCircleMapper,
         } else {
             queryWrapper.between("divide_time", startTime+" 00:00:00", endTime+" 23:59:59");
         }
-        queryWrapper.orderByDesc("divide_time");
+        queryWrapper.isNotNull("divide_time");
+        queryWrapper.orderByDesc("id");
         queryWrapper.like(StringUtils.isNotEmpty(pigpenName),"pigpen_name", pigpenName);
         return success(jsDivideCircleMapper.selectPage(page, queryWrapper));
     }

+ 31 - 2
app-admin/src/main/java/com/ruoyi/web/v2/v1/service/impl/JsDrugCheckServiceImpl.java

@@ -407,6 +407,7 @@ public class JsDrugCheckServiceImpl extends ServiceImpl<JsDrugCheckMapper, JsDru
 
         List<SummaryVo> summaryVos = new ArrayList<>();
         List<SummaryVo> summaryVoList = new ArrayList<>();
+        List<SummaryVo> result = new ArrayList<>();
         if (entranceBatchList.size() != 0) {
             for (EntranceBatch entranceBatch : entranceBatchList) {
                 SummaryVo summaryVo = new SummaryVo();
@@ -479,9 +480,37 @@ public class JsDrugCheckServiceImpl extends ServiceImpl<JsDrugCheckMapper, JsDru
             summaryVoList = mergeObjectsByTime(summaryVos)
                     .stream().sorted(Comparator.comparing(SummaryVo::getCreateTime).reversed())
                     .collect(Collectors.toList());
+            //按天分组合计
+            result = summaryVoList.stream()
+                    .collect(Collectors.groupingBy(
+                            vo -> vo.getCreateTime().toInstant()
+                                    .atZone(ZoneId.systemDefault())
+                                    .toLocalDate(),
+                            Collectors.reducing(
+                                    new SummaryVo(null, 0, 0, 0, 0,0.0, "0.00", 0, 0, 0, 0),
+                                    (sum, item) -> {
+                                        double weightSum = Double.parseDouble(sum.getWeight()) + Double.parseDouble(item.getWeight());
+                                        return new SummaryVo(
+                                                item.getCreateTime(),
+                                                sum.getAmount() + item.getAmount(),
+                                                sum.getCheckAmount() + item.getCheckAmount(),
+                                                sum.getQualifiedAmount() + item.getQualifiedAmount(),
+                                                sum.getTuzaiAmount() + item.getTuzaiAmount(),
+                                                sum.getDongAmount() + item.getDongAmount(),
+                                                String.format("%.2f", weightSum),
+                                                sum.getRoadDealAmount() + item.getRoadDealAmount(),
+                                                sum.getIllnessDeadAmount() + item.getIllnessDeadAmount(),
+                                                sum.getIllnessDiseaseAmount() + item.getIllnessDiseaseAmount(),
+                                                sum.getSnapKillAmount() + item.getSnapKillAmount()
+                                        );
+                                    }
+                            )
+                    ))
+                    .values().stream()
+                    .sorted(Comparator.comparing(SummaryVo::getCreateTime).reversed())
+                    .collect(Collectors.toList());
         }
-
-        return PaginationUtil.paginate(summaryVoList, pageNum, pageSize);
+        return PaginationUtil.paginate(result, pageNum, pageSize);
     }
 
 

+ 1 - 1
app-system/src/main/java/com/ruoyi/app/model/Pigpen.java

@@ -73,7 +73,7 @@ public class Pigpen extends BaseEntity {
         this.pigpenName = pigpenName;
     }
 
-    @NotBlank(message = "待宰圈号不能为空")
+//    @NotBlank(message = "待宰圈号不能为空")
     @Size(min = 1, max = 3, message = "待宰圈号输入超出最大长度限制(3位)")
     @Pattern(regexp = "^\\d+$", message = "待宰圈号必须全部是数字")
     public String getPigpenName() {

+ 1 - 1
app-system/src/main/java/com/ruoyi/app/model/Purchaser.java

@@ -69,7 +69,7 @@ public class Purchaser extends BaseEntity
         this.purchaserNo = purchaserNo;
     }
 
-    @NotBlank(message = "肉商编号不能为空")
+//    @NotBlank(message = "肉商编号不能为空")
     @Size(min = 1, max = 3, message = "肉商编号输入超出最大长度限制(30位)")
     public String getPurchaserNo()
     {

+ 11 - 0
app-system/src/main/java/com/ruoyi/app/model/Staff.java

@@ -48,6 +48,9 @@ public class Staff extends BaseEntity
     @Excel(name = "健康证明")
     private String healthCert;
 
+    @Excel(name = "健康证明号")
+    private String healthCertNo;
+
     private List<SysPost> posts;
 
     /** 删除标志 */
@@ -139,6 +142,14 @@ public class Staff extends BaseEntity
         return healthCert;
     }
 
+    public String getHealthCertNo() {
+        return healthCertNo;
+    }
+
+    public void setHealthCertNo(String healthCertNo) {
+        this.healthCertNo = healthCertNo;
+    }
+
     public void setDelFlag(String delFlag) 
     {
         this.delFlag = delFlag;

+ 27 - 0
app-system/src/main/java/com/ruoyi/app/model/Supplier.java

@@ -61,6 +61,14 @@ public class Supplier extends BaseEntity
     /** 删除标志:0-存在 2-删除 */
     private String delFlag;
 
+    /** 供应商类别 */
+    @Excel(name = "供应商类别")
+    private String principalType;
+
+    /** 身份识别号 */
+    @Excel(name = "身份识别号")
+    private String principalId;
+
     public void setId(Long id) 
     {
         this.id = id;
@@ -180,6 +188,23 @@ public class Supplier extends BaseEntity
         return delFlag;
     }
 
+    public String getPrincipalType() {
+        return principalType;
+    }
+
+    public void setPrincipalType(String principalType) {
+        this.principalType = principalType;
+    }
+
+    public String getPrincipalId() {
+        return principalId;
+    }
+
+    public void setPrincipalId(String principalId) {
+        this.principalId = principalId;
+    }
+
+
     @Override
     public String toString() {
         return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE)
@@ -199,6 +224,8 @@ public class Supplier extends BaseEntity
             .append("updateTime", getUpdateTime())
             .append("updateBy", getUpdateBy())
             .append("delFlag", getDelFlag())
+            .append("principalType", getPrincipalType())
+            .append("principalId", getPrincipalId())
             .toString();
     }
 }

+ 6 - 0
app-system/src/main/java/com/ruoyi/app/service/IPigpenService.java

@@ -71,4 +71,10 @@ public interface IPigpenService
      * @return 结果
      */
     public int deletePigpenById(Long id);
+
+    /**
+     * 获取下一个自动生成的猪圈编号
+     * @return
+     */
+    public String getNextNo();
 }

+ 6 - 0
app-system/src/main/java/com/ruoyi/app/service/IPurchaserService.java

@@ -91,4 +91,10 @@ public interface IPurchaserService
      * @return 结果
      */
     public int deletePurchaserById(Long id);
+
+    /**
+     * 获取下一个自动生成的肉商编号
+     * @return
+     */
+    public String getNextNo();
 }

+ 6 - 0
app-system/src/main/java/com/ruoyi/app/service/ISupplierService.java

@@ -86,4 +86,10 @@ public interface ISupplierService
      */
     public int deleteSupplierById(Long id);
 
+    /**
+     * 获取下一个自动生成的供应商编号
+     * @return
+     */
+    public String getNextNo();
+
 }

+ 14 - 0
app-system/src/main/java/com/ruoyi/app/service/impl/PigpenServiceImpl.java

@@ -1,6 +1,7 @@
 package com.ruoyi.app.service.impl;
 
 import java.util.List;
+import java.util.OptionalLong;
 
 import com.ruoyi.app.DTO.PigpenDTO;
 import com.ruoyi.common.utils.DateUtils;
@@ -10,6 +11,7 @@ import org.springframework.stereotype.Service;
 import com.ruoyi.app.mapper.PigpenMapper;
 import com.ruoyi.app.model.Pigpen;
 import com.ruoyi.app.service.IPigpenService;
+import org.springframework.util.ObjectUtils;
 
 /**
  * 待宰圈Service业务层处理
@@ -81,6 +83,10 @@ public class PigpenServiceImpl implements IPigpenService
     public int insertPigpen(Pigpen pigpen)
     {
         pigpen.setCreateTime(DateUtils.getNowDate());
+        if(ObjectUtils.isEmpty(pigpen.getPigpenName())) {
+            //获取表中最大id值
+            pigpen.setPigpenName(getNextNo());
+        }
         return pigpenMapper.insertPigpen(pigpen);
     }
 
@@ -120,4 +126,12 @@ public class PigpenServiceImpl implements IPigpenService
     {
         return pigpenMapper.deletePigpenById(id);
     }
+
+    @Override
+    public String getNextNo() {
+        //获取表中最大id值
+        List<Pigpen> list = pigpenMapper.selectPigpenList(null);
+        OptionalLong maxId = list.stream().mapToLong(Pigpen::getId).max();
+        return String.format("%02d", maxId.getAsLong()+1);
+    }
 }

+ 19 - 0
app-system/src/main/java/com/ruoyi/app/service/impl/PurchaserServiceImpl.java

@@ -1,7 +1,9 @@
 package com.ruoyi.app.service.impl;
 
 import java.util.List;
+import java.util.OptionalLong;
 
+import com.ruoyi.app.model.Supplier;
 import com.ruoyi.app.model.request.ReqPurchaser;
 import com.ruoyi.app.mapper.DistributeBatchMapper;
 import com.ruoyi.app.mapper.SlaughterRelationMapper;
@@ -13,6 +15,7 @@ import org.springframework.stereotype.Service;
 import com.ruoyi.app.mapper.PurchaserMapper;
 import com.ruoyi.app.model.Purchaser;
 import com.ruoyi.app.service.IPurchaserService;
+import org.springframework.util.ObjectUtils;
 
 /**
  * 肉商Service业务层处理
@@ -134,6 +137,10 @@ public class PurchaserServiceImpl implements IPurchaserService
     public int insertPurchaser(Purchaser purchaser)
     {
         purchaser.setCreateTime(DateUtils.getNowDate());
+        //如果没有输入,自动生成供应商编号
+        if(ObjectUtils.isEmpty(purchaser.getPurchaserNo())) {
+            purchaser.setPurchaserNo(getNextNo());
+        }
         return purchaserMapper.insertPurchaser(purchaser);
     }
 
@@ -199,4 +206,16 @@ public class PurchaserServiceImpl implements IPurchaserService
         }
         return purchaserMapper.deletePurchaserById(id);
     }
+
+    @Override
+    public String getNextNo() {
+        //获取表中最大id值
+        List<Purchaser> list = purchaserMapper.selectPurchaserList(null);
+        OptionalLong maxId = list.stream().mapToLong(Purchaser::getId).max();
+        if(maxId.getAsLong() >= 1000) {
+            return ("RS" + maxId.getAsLong()+1);
+        }else {
+            return ("RS" + String.format("%04d", maxId.getAsLong()+1));
+        }
+    }
 }

+ 18 - 0
app-system/src/main/java/com/ruoyi/app/service/impl/SupplierServiceImpl.java

@@ -1,6 +1,7 @@
 package com.ruoyi.app.service.impl;
 
 import java.util.List;
+import java.util.OptionalLong;
 
 import com.ruoyi.app.model.request.ReqSupplierList;
 import com.ruoyi.app.mapper.DistributeBatchMapper;
@@ -14,6 +15,7 @@ import org.springframework.stereotype.Service;
 import com.ruoyi.app.mapper.SupplierMapper;
 import com.ruoyi.app.model.Supplier;
 import com.ruoyi.app.service.ISupplierService;
+import org.springframework.util.ObjectUtils;
 
 /**
  * 供应商Service业务层处理
@@ -117,6 +119,10 @@ public class SupplierServiceImpl implements ISupplierService
     public int insertSupplier(Supplier supplier)
     {
         supplier.setCreateTime(DateUtils.getNowDate());
+        //如果没有输入,自动生成供应商编号
+        if(ObjectUtils.isEmpty(supplier.getSupplierNo())) {
+            supplier.setSupplierNo(getNextNo());
+        }
         return supplierMapper.insertSupplier(supplier);
     }
 
@@ -191,4 +197,16 @@ public class SupplierServiceImpl implements ISupplierService
         }
         return supplierMapper.deleteSupplierById(id);
     }
+
+    @Override
+    public String getNextNo() {
+        //获取表中最大id值
+        List<Supplier> list = supplierMapper.selectSupplierList(null);
+        OptionalLong maxId = list.stream().mapToLong(Supplier::getId).max();
+        if(maxId.getAsLong() >= 1000) {
+            return String.format("GYS", maxId.getAsLong()+1);
+        }else {
+            return String.format("GYS", String.format("%04d", maxId.getAsLong()+1));
+        }
+    }
 }

+ 7 - 3
app-system/src/main/resources/mapper/app/StaffMapper.xml

@@ -17,6 +17,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
         <result property="updateTime"    column="update_time"    />
         <result property="updateBy"    column="update_by"    />
         <result property="delFlag"    column="del_flag"    />
+        <result property="healthCertNo"    column="health_cert_no"    />
         <collection  property="posts"   javaType="java.util.List"  resultMap="PostResult" />
     </resultMap>
     <resultMap id="PostResult" type="SysPost">
@@ -24,11 +25,11 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
         <result property="postName"      column="post_name"     />
     </resultMap>
     <sql id="selectStaffVo">
-        select id, realname, post_id, phone, technical_title, technical_cert, health_cert, create_time, create_by, update_time, update_by, del_flag from staff
+        select id, realname, post_id, phone, technical_title, technical_cert, health_cert,health_cert_no, create_time, create_by, update_time, update_by, del_flag from staff
     </sql>
 
     <select id="selectStaffList" parameterType="Staff" resultMap="StaffResult">
-        select s.id, s.realname, s.post_id, s.phone, s.technical_title, s.technical_cert, s.health_cert,
+        select s.id, s.realname, s.post_id, s.phone, s.technical_title, s.technical_cert, s.health_cert,s.health_cert_no,
         s.create_time, s.create_by, s.update_time, s.update_by,p.post_id as sys_post_id,p.post_name from staff as s
         left join staff_post sp on sp.staff_id = s.id
         left join sys_post p on p.post_id = sp.post_id
@@ -49,7 +50,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
     </select>
 
     <select id="selectStaffById" parameterType="Long" resultMap="StaffResult">
-        select s.id, s.realname, s.post_id, s.phone, s.technical_title, s.technical_cert, s.health_cert,
+        select s.id, s.realname, s.post_id, s.phone, s.technical_title, s.technical_cert, s.health_cert,s.health_cert_no,
                s.create_time, s.create_by, s.update_time, s.update_by,p.post_id as sys_post_id,p.post_name from staff as s
         left join staff_post sp on sp.staff_id = s.id
         left join sys_post p on p.post_id = sp.post_id
@@ -65,6 +66,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
             <if test="technicalTitle != null">technical_title,</if>
             <if test="technicalCert != null">technical_cert,</if>
             <if test="healthCert != null">health_cert,</if>
+            <if test="healthCertNo != null">health_cert_no,</if>
             <if test="createTime != null">create_time,</if>
             <if test="createBy != null">create_by,</if>
             del_flag
@@ -76,6 +78,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
             <if test="technicalTitle != null">#{technicalTitle},</if>
             <if test="technicalCert != null">#{technicalCert},</if>
             <if test="healthCert != null">#{healthCert},</if>
+            <if test="healthCertNo != null">#{healthCertNo},</if>
             <if test="createTime != null">#{createTime},</if>
             <if test="createBy != null">#{createBy},</if>
             '0'
@@ -98,6 +101,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
             <if test="technicalTitle != null">technical_title = #{technicalTitle},</if>
             <if test="technicalCert != null">technical_cert = #{technicalCert},</if>
             <if test="healthCert != null">health_cert = #{healthCert},</if>
+            <if test="healthCertNo != null">health_cert_no = #{healthCertNo},</if>
             <if test="updateTime != null">update_time = #{updateTime},</if>
             <if test="updateBy != null">update_by = #{updateBy},</if>
         </trim>

+ 9 - 1
app-system/src/main/resources/mapper/app/SupplierMapper.xml

@@ -21,6 +21,8 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
         <result property="updateTime"    column="update_time"    />
         <result property="updateBy"    column="update_by"    />
         <result property="delFlag"    column="del_flag"    />
+        <result property="principalType"    column="principal_type"    />
+        <result property="principalId"    column="principal_id"    />
     </resultMap>
     <resultMap type="com.ruoyi.app.DTO.SupplierAmountRankDTO" id="SupplierAmountRankDTOResult">
         <result property="totalAmount"    column="total_amount"    />
@@ -33,7 +35,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
     </resultMap>
 
     <sql id="selectSupplierVo">
-        select id, supplier_no,supplier_name, phone, supply_species, business_place, origin_place, region, evaluate, remark, in_blacklist, create_time, create_by, update_time, update_by, del_flag from supplier
+        select id, supplier_no,supplier_name, phone, supply_species, business_place, origin_place, region, evaluate, remark, in_blacklist, create_time, create_by, update_time, update_by, del_flag, principal_type, principal_id from supplier
     </sql>
 
     <select id="selectSupplierList" parameterType="com.ruoyi.app.model.request.ReqSupplierList" resultMap="SupplierResult">
@@ -82,6 +84,8 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
             <if test="inBlacklist != null">in_blacklist,</if>
             <if test="createTime != null">create_time,</if>
             <if test="createBy != null">create_by,</if>
+            <if test="principalType != null">principal_type,</if>
+            <if test="principalId != null">principal_id,</if>
             del_flag
          </trim>
         <trim prefix="values (" suffix=")" suffixOverrides=",">
@@ -97,6 +101,8 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
             <if test="inBlacklist != null">#{inBlacklist},</if>
             <if test="createTime != null">#{createTime},</if>
             <if test="createBy != null">#{createBy},</if>
+            <if test="principalType != null">#{principalType},</if>
+            <if test="principalId != null">#{principalId},</if>
             '0'
          </trim>
     </insert>
@@ -116,6 +122,8 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
             <if test="inBlacklist != null">in_blacklist = #{inBlacklist},</if>
             <if test="updateTime != null">update_time = #{updateTime},</if>
             <if test="updateBy != null">update_by = #{updateBy},</if>
+            <if test="principalType != null">#{principalType},</if>
+            <if test="principalId != null">#{principalId},</if>
         </trim>
         where id = #{id}
     </update>

+ 8 - 0
sql/v3_biz_20250814.sql

@@ -564,3 +564,11 @@ INSERT INTO `hb_device_maintenance_dictionary` (id, device_name, maintenance_ite
 INSERT INTO `hb_device_maintenance_dictionary` (id, device_name, maintenance_item, remarks, is_deleted, create_by, create_time, update_by, update_time) VALUES (NULL, '刨毛机','保养轴承',null, 0, 'admin', CURRENT_TIMESTAMP, NULL, CURRENT_TIMESTAMP);
 INSERT INTO `hb_device_maintenance_dictionary` (id, device_name, maintenance_item, remarks, is_deleted, create_by, create_time, update_by, update_time) VALUES (NULL, '劈半锯','检查限位导向器、启动开关、轴承',null, 0, 'admin', CURRENT_TIMESTAMP, NULL, CURRENT_TIMESTAMP);
 INSERT INTO `hb_device_maintenance_dictionary` (id, device_name, maintenance_item, remarks, is_deleted, create_by, create_time, update_by, update_time) VALUES (NULL, '劈半锯','检查锯片',null, 0, 'admin', CURRENT_TIMESTAMP, NULL, CURRENT_TIMESTAMP);
+
+
+-- 人员管理 添加“健康证明号”
+ALTER TABLE `staff` ADD COLUMN health_cert_no VARCHAR(20) COMMENT '健康证明号';
+
+-- 供应商管理 添加“供应商类别”、“身份证/主体识别号”
+ALTER TABLE `supplier` ADD COLUMN `principal_type` VARCHAR(30) COMMENT '供应商类别';
+ALTER TABLE `supplier` ADD COLUMN `principal_id` VARCHAR(60) COMMENT '身份识别号';