zjh
2024-10-18 57b41b18aa3472be34b8b13d725db8578a14b836
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
53
54
55
56
57
58
59
60
61
package com.ltkj.web.controller.lis;
 
import cn.hutool.json.JSONObject;
import cn.hutool.json.JSONUtil;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.ltkj.common.core.domain.AjaxResult;
import com.ltkj.hosp.domain.TbTransition;
import com.ltkj.hosp.domain.TjCustomer;
import com.ltkj.hosp.domain.TjOrder;
import com.ltkj.hosp.service.*;
import com.ltkj.system.service.ISysDeptService;
import com.ltkj.web.controller.pacs.PacsApiMethodService;
import org.springframework.beans.factory.annotation.Autowired;
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 javax.annotation.Resource;
import java.util.List;
 
/**
 * @Company: 西安路泰科技有限公司
 * @Author: zhaowenxuan
 * @Date: 2024/10/10 16:59
 */
@RestController
@RequestMapping("lis")
public class LisController {
    @Autowired
    private ITbTransitionService tbTransitionService;
    @Autowired
    private LisApiMethod lisApiMethod;
    @Autowired
    private ITjOrderService orderService;
    @Autowired
    private ITjCustomerService customerService;
    @Autowired
    private PacsApiMethodService pacsApiMethodService;
 
    @PostMapping("test")
    public AjaxResult test(@RequestBody String json){
        JSONObject parseObj = JSONUtil.parseObj(json);
        String cusId = parseObj.getStr("cusId");
        String cardId = parseObj.getStr("cardId");
        // 检验保存
        List<TbTransition> detailList = tbTransitionService.getTbTransitionListByCusId(cusId,cardId);
        TjOrder tjOrder = orderService.getOrderByTjNum(detailList.get(0).getTjNum());
        LambdaQueryWrapper<TjCustomer> wrapper = new LambdaQueryWrapper<>();
        wrapper.eq(TjCustomer::getCusIdcard,cusId);
        TjCustomer customer = customerService.getOne(wrapper);
        lisApiMethod.save(tjOrder,customer,detailList);
        // 检验作废
        lisApiMethod.cancel("",tjOrder.getCardId(),customer.getCusName());
        // 检查保存
        pacsApiMethodService.save(tjOrder,customer,detailList);
        // 检查作废
        pacsApiMethodService.updatePacsApply("","",customer.getCusName());
        return AjaxResult.success();
    }
}