zjh
2023-12-06 41f99a843fb2c0424426e006f29c1e78192eae01
ltkj-admin/src/main/java/com/ltkj/web/controller/system/TjOrderController.java
@@ -4,6 +4,7 @@
import java.math.BigDecimal;
import java.math.RoundingMode;
import java.text.SimpleDateFormat;
import java.time.OffsetTime;
import java.util.*;
import java.util.List;
import java.util.stream.Collectors;
@@ -29,6 +30,7 @@
import com.ltkj.hosp.domain.*;
import com.ltkj.hosp.service.*;
import com.ltkj.hosp.vodomain.BingZhongVO;
import com.ltkj.hosp.vodomain.HistoryTjOrder;
import com.ltkj.hosp.vodomain.QjDomainVo;
import com.ltkj.mall.domain.MallCheckLog;
import com.ltkj.mall.domain.MallOrder;
@@ -64,7 +66,7 @@
 */
@RestController
@RequestMapping("/hosp/order")
@Api(tags = "体检记录接口")
@Api(tags = "PC端 ----体检记录接口")
@Slf4j
public class TjOrderController extends BaseController {
    @Resource
@@ -1643,4 +1645,39 @@
        }
        return AjaxResult.success("核收成功");
    }
    @GetMapping("/getHistryTjOrderByCusIdCard")
    @ApiOperation(value = "根据身份证号查看历史体检记录")
    @Transactional
    public AjaxResult getHistryTjOrderByCusIdCard(@RequestParam String cusIdCard) {
        TjCustomer tjCustomer = tjCustomerService.getTjCustomerByCusIdCard(cusIdCard);
        List<HistoryTjOrder> list=new ArrayList<>();
        if(null !=tjCustomer){
            List<TjOrder> orderList = tjOrderService.getTjOrderListByCusId(tjCustomer.getCusId());
            for (TjOrder order : orderList) {
                HistoryTjOrder historyTjOrder=new HistoryTjOrder();
                historyTjOrder.setUserName(tjCustomer.getCusName());
                historyTjOrder.setTjNum(order.getTjNumber());
                historyTjOrder.setTjTime(order.getCreateTime());
                historyTjOrder.setTjProName(tjOrderService.getHistoryTjOrderProByTjNum(order.getTjNumber()));
                list.add(historyTjOrder);
            }
        }
        return AjaxResult.success(list);
    }
    @GetMapping("/getHistryTjOrderProByCusIdCard")
    @ApiOperation(value = "根据身份证号查看历史体检项目记录")
    @Transactional
    public AjaxResult getHistryTjOrderProByCusIdCard(@RequestParam String cusIdCard) {
        TjCustomer tjCustomer = tjCustomerService.getTjCustomerByCusIdCard(cusIdCard);
        if(null !=tjCustomer){
            TjOrder order= tjOrderService.getLastTjOrderListByCusId(tjCustomer.getCusId());
            return AjaxResult.success(order);
        }
        return AjaxResult.success("暂无历史记录");
    }
}