chenlu
2024-02-27 b09e0423b15d6402b44d4ef338bfb85f027daf3c
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
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
 
package com.example.erp.service.pp;
 
import com.alibaba.fastjson.JSONArray;
import com.alibaba.fastjson.JSONObject;
import com.baomidou.dynamic.datasource.annotation.DS;
import com.example.erp.entity.pp.ProductionScheduling;
import com.example.erp.mapper.pp.ProductionSchedulingMapper;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
 
import java.sql.Date;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
 
@Service
@DS("pp")
public class ProductionSchedulingService {
    @Autowired
    ProductionSchedulingMapper productionSchedulingMapper;
 
    //带时间查询
    public Map<String, Object> SelectSchedulingSv(String selectTime1, String selectTime2, String orderId,String processes, Integer state, ProductionScheduling productionScheduling ) {
        Map<String, Object> map = new HashMap<>();
 
        if (state==2){//已排产
            map.put("data", productionSchedulingMapper.SelectOkSchedulingMp(selectTime1, selectTime2,orderId,processes, productionScheduling));
 
        }else if (state==1){//未排产
            map.put("data", productionSchedulingMapper.SelectNoSchedulingMp(selectTime1, selectTime2,orderId,processes, productionScheduling));
 
        }
 
        return map;
    }
 
 
    //首次查询排产数据
    public Map<String, Object> selectLastScheduling(String selectTime1, String selectTime2,ProductionScheduling productionScheduling ) {
        Map<String, Object> map = new HashMap<>();
        map.put("data", productionSchedulingMapper.selectLastSchedulingMp(selectTime1, selectTime2, productionScheduling));
        return map;
    }
 
    //带订单号查询
    public Map<String, Object> SelectSchedulingNotSv(String selectTime1, String selectTime2, String orderId, String processes, Integer state, ProductionScheduling productionScheduling) {
        Map<String, Object> map = new HashMap<>();
        map.put("data", productionSchedulingMapper.SelectSchedulingNotMp(selectTime1, selectTime2,orderId,processes, productionScheduling));
        return map;
    }
}