whyclxw
2024-07-23 2271cde3d0392b9a2320a20aadca4b3cb93ae652
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
package com.whyc.service;
 
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.whyc.mapper.DefectiveProductsHistoryMapper;
import com.whyc.pojo.DefectiveProducts;
import com.whyc.pojo.DefectiveProductsHistory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
 
import java.util.Date;
 
@Service
public class DefectiveProductsHistoryService {
 
    @Autowired(required = false)
    private DefectiveProductsHistoryMapper mapper;
 
    //记录处理过程
    public void addHis(DefectiveProducts defective) {
        DefectiveProductsHistory his=new DefectiveProductsHistory();
        his.setDeftId(defective.getId());
        his.setRecordTime(defective.getStartTime());
        his.setBadProduct(defective.getBadProduct());
        his.setConfirmStatus(defective.getConfirmStatus());
        his.setNote(defective.getNote());
        his.setReceiverIds(defective.getReceiverIds());
        his.setReceiverNames(defective.getReceiverNames());
        mapper.insert(his);
    }
    //记录处理记录
    public void updateDefective(DefectiveProductsHistory defectiveHis) {
        defectiveHis.setRecordTime(new Date());
        mapper.insert(defectiveHis);
    }
}