zjh
2024-07-29 ac1d836efbd5f5c8707ed0bf33b4631025d165c6
ltkj-admin/src/main/java/com/ltkj/web/controller/app/CustomerController.java
@@ -140,15 +140,7 @@
        if (customer != null) {
            customer.setConnect(tjCustomer.getConnect());
            if (customerService.updateById(customer)) {
                if(null !=key && key.equals("Y")){
                    AjaxResult xinXi = suijieHisXinXi(tjCustomer);
                    if(!xinXi.get("code").toString().equals("200")){
                        TransactionAspectSupport.currentTransactionStatus().setRollbackOnly();
                        return AjaxResult.error("注册失败,请到前台登记!" + xinXi.get("msg").toString());
                    }
                }
            }
            customerService.updateById(customer);
            return AjaxResult.success(customer);
        }
        String substring = cusIdcard.substring(cusIdcard.length() - 6);
@@ -156,7 +148,6 @@
        tjCustomer.setCusPassword(substring);
        tjCustomer.setCusBrithday(DateUtil.parse(MatchUtils.getBirthDayByIdCard(cusIdcard), "yyyy-MM-dd"));
        tjCustomer.setCusSex(Long.valueOf(MatchUtils.getSexByIdCard(cusIdcard)));
        //tjCustomer.setAddr(MatchUtils.getNativePlace(Integer.parseInt((cusIdcard))));
        tjCustomer.setAge(String.valueOf(MatchUtils.getAgeByIdCard(cusIdcard)));
        tjCustomer.setIdType("1");
        tjCustomer.setAgeUnit("0");
@@ -164,17 +155,18 @@
        tjCustomer.setCusIntroduce("无");
        tjCustomer.setCusNumber(0L);
        tjCustomer.setCusIsvip("N");
        if (customerService.save(tjCustomer)) {
            if(null !=key && key.equals("Y")){
                AjaxResult xinXi = suijieHisXinXi(tjCustomer);
                if(!xinXi.get("code").toString().equals("200")){
                    TransactionAspectSupport.currentTransactionStatus().setRollbackOnly();
                    return AjaxResult.error("注册失败,请到前台登记!" + xinXi.get("msg").toString());
                }
            }
        } else {
            customerService.save(tjCustomer);
            return AjaxResult.success(tjCustomer);
        }
        return AjaxResult.error("添加失败");
        return AjaxResult.success(tjCustomer);
    }
    /**
@@ -239,17 +231,20 @@
        one.setCusPhone(tjCustomer.getCusPhone());
        one.setCusNational(tjCustomer.getCusNational());
        one.setCusMarryStatus(tjCustomer.getCusMarryStatus());
        if (customerService.updateById(one)) {
            if(null !=key && key.equals("Y")){
                AjaxResult xinXi = suijieHisXinXi(one);
                if(!xinXi.get("code").toString().equals("200")){
                    TransactionAspectSupport.currentTransactionStatus().setRollbackOnly();
                    return AjaxResult.error("添加就诊人信息失败!" + xinXi.get("msg").toString());
                return AjaxResult.error("修改就诊人信息失败!" + xinXi.get("msg").toString());
            }
        } else {
            if (!customerService.updateById(one)) {
                return AjaxResult.error("修改失败");
                }
            }
            return AjaxResult.success(one);
        }
        return AjaxResult.error("修改失败");
    }
    /**
@@ -287,7 +282,6 @@
    }
    //将方法返回值解析成json格式
    public JSONObject getJSONObject(String builder) {
        String Response = JSONUtil.parseObj(builder).getStr("Response");
@@ -311,8 +305,15 @@
            if (null != resultData && resultData.size() > 0) {
                String pationid = resultData.get("PationId").toString();
                if (null != pationid) {
                    try {
                        if (tjCustomer.getCusId() == null) {
                    tjCustomer.setPationId(pationid);
                    customerService.updateById(tjCustomer);
                        }
                        customerService.saveOrUpdate(tjCustomer);
                    } catch (Exception e) {
                        e.printStackTrace();
                        return AjaxResult.error("操作失败!");
                    }
                    //保存注册入参出参
                    resultData.put("cardId",pationid);
                    JSONObject object4 = JSONUtil.parseObj(resultData);
@@ -323,7 +324,7 @@
                }
            }
           return AjaxResult.success();
            return AjaxResult.success(tjCustomer);
        }
        return AjaxResult.error(object.getStr("ResultContent"));
    }