刘光辉
昨天 bb638871a7fb692d80f1b7a758f991dc0879002c
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
package jnpf.limsController;
 
import io.swagger.v3.oas.annotations.Operation;
import io.swagger.v3.oas.annotations.tags.Tag;
import jnpf.limsService.LimsWendingxingKaocaJihuaZhouqiService;
import jnpf.util.R;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.util.StringUtils;
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 java.util.Map;
 
@Tag(name = "lims稳定性考察计划检测执行接口", description = "稳定性考察计划周期检测执行")
@RestController
@RequestMapping("/lims/biz/wendingxing/kaoca/jiance")
public class LimsWendingxingKaocaJianceZhixingController {
 
    @Autowired
    private LimsWendingxingKaocaJihuaZhouqiService zhouqiService;
 
    /**
     * 执行稳定性考察计划周期检测并生成请验单。
     */
    @Operation(summary = "稳定性考察计划检测执行")
    @PostMapping("/zhixing")
    public R<String> execute(@RequestBody Map<String, String> params) {
        String jihuaZhouqiId = params == null ? null : params.get("jihua_zhouqi_id");
        String zhixingBizSign = params == null ? null : params.get("zhixing_biz_sign");
        if (!StringUtils.hasText(jihuaZhouqiId)) {
            return R.error("计划周期ID(jihua_zhouqi_id)不能为空");
        }
        if (!StringUtils.hasText(zhixingBizSign)) {
            return R.error("执行签名(zhixing_biz_sign)不能为空");
        }
 
        String qingyandanId = zhouqiService.executeJiance(
                jihuaZhouqiId.trim(), zhixingBizSign.trim());
        return R.success("执行成功", qingyandanId);
    }
}