wang..123
2022-03-10 dcd7fcf596005d0c7cf66558bee97edf6c3b03a0
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
package com.zy.asrs.controller;
 
import com.core.annotations.ManagerAuth;
import com.core.common.Cools;
import com.core.common.R;
import com.zy.asrs.entity.MatCode;
import com.zy.asrs.service.MatCodeService;
import com.zy.common.service.erp.ErpService;
import com.zy.common.service.erp.entity.CPICMO;
import com.zy.common.web.BaseController;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
 
import java.util.Date;
import java.util.List;
 
@RestController
public class ERPrelevantController extends BaseController {
    @Autowired
    private ErpService erpService;
    @Autowired
    private MatCodeService matCodeService;
 
    @RequestMapping(value = "/erp/cpicmo/query")
    @ManagerAuth
    public R add(String fbillNo, String fsourceBillNo) {
        List<CPICMO> erpCPICMOlist = erpService.queryErpCPICMO(fbillNo, fsourceBillNo);
        if (erpCPICMOlist.size() > 0) {
            for (CPICMO erpList : erpCPICMOlist) {
                MatCode matCodeObj = matCodeService.selectById(erpList.getFnumber());
                if (!Cools.isEmpty(matCodeObj)) {
                    erpList.setFname(matCodeObj.getMatName());
                    erpList.setFmodel(matCodeObj.getStr3());
                }
            }
        }
        return R.ok().add(erpCPICMOlist);
    }
}