GAT保險模組的修改

ZHOU_VIP發表於2017-03-20

1.示意圖


2.資料庫的修改



drop table CAR_SECURE;

-- Create table
create table CAR_SECURE
(
  record_id            VARCHAR2(32) not null,
  host_no              VARCHAR2(32),
  secure_no            VARCHAR2(100),
  secure_start_time    DATE,
  secure_end_time      DATE,
  secure_handle        VARCHAR2(32),
  create_user_id       NUMBER(8),
  create_user_name     VARCHAR2(60),
  create_time          DATE,
  create_org_id        NUMBER(8),
  create_dept_id       NUMBER(8),
  create_org_dept_name VARCHAR2(300),
  update_user_id       NUMBER(8),
  update_user_name     VARCHAR2(60),
  update_time          DATE,
  update_org_id        NUMBER(8),
  update_dept_id       NUMBER(8),
  update_org_dept_name VARCHAR2(300),
  host_id              NUMBER(8),
  secure_pay           NUMBER(10,2),
  secure_acc_no        VARCHAR2(100),
  secure_acc_pay       NUMBER(10,2),
  secure_tax           NUMBER(10,2),
  secure_remark        VARCHAR2(300),
  secure_num           NUMBER(10,2)
)
tablespace GPS_USER
  pctfree 10
  initrans 1
  maxtrans 255
  storage
  (
    initial 64K
    next 8K
    minextents 1
    maxextents unlimited
  );
-- Add comments to the table 
comment on table CAR_SECURE
  is '保險';
-- Add comments to the columns 
comment on column CAR_SECURE.record_id
  is '主鍵';
comment on column CAR_SECURE.host_no
  is '車牌號碼';
comment on column CAR_SECURE.secure_no
  is '商業保單號';
comment on column CAR_SECURE.secure_start_time
  is '起保時間';
comment on column CAR_SECURE.secure_end_time
  is '止保時間';
comment on column CAR_SECURE.secure_handle
  is '經辦人';
comment on column CAR_SECURE.create_user_id
  is '記錄建立人賬戶編號';
comment on column CAR_SECURE.create_user_name
  is '記錄建立人姓名';
comment on column CAR_SECURE.create_time
  is '記錄建立時間';
comment on column CAR_SECURE.create_org_id
  is '記錄建立人機構編號';
comment on column CAR_SECURE.create_dept_id
  is '記錄建立人部門編號';
comment on column CAR_SECURE.create_org_dept_name
  is '記錄建立人單位名稱';
comment on column CAR_SECURE.update_user_id
  is '記錄更新人賬戶編號';
comment on column CAR_SECURE.update_user_name
  is '記錄更新人姓名';
comment on column CAR_SECURE.update_time
  is '記錄更新時間';
comment on column CAR_SECURE.update_org_id
  is '記錄更新人機構編號';
comment on column CAR_SECURE.update_dept_id
  is '記錄更新人部門編號';
comment on column CAR_SECURE.update_org_dept_name
  is '記錄更新人單位名稱';
comment on column CAR_SECURE.host_id
  is '車輛ID';
comment on column CAR_SECURE.secure_pay
  is '商業保險金額';
comment on column CAR_SECURE.secure_acc_no
  is '交強險保單號';
comment on column CAR_SECURE.secure_acc_pay
  is '交強險金額';
comment on column CAR_SECURE.secure_tax
  is '稅';
comment on column CAR_SECURE.secure_remark
  is '備註';
comment on column CAR_SECURE.secure_num
  is '合計金額';
-- Create/Recreate primary, unique and foreign key constraints 
alter table CAR_SECURE
  add constraint CAR_SECURE_PK primary key (RECORD_ID)
  disable;

3.

http://localhost:8080/gps/test/main


superuser

jsecode@123

http://localhost:8080/gps/api.jsp


4.重要說明:


select t.RECORD_ID as recordId,
       t.HOST_ID as hostId,
       t.HOST_NO as carHostNO,
       t.SECURE_PAY as securePay,
       p.VEHICLE_MODEL as vehicleModel,
       po.APPSYSID as appSysId,
       po.APPDEPTID as appDeptId,
       t.SECURE_NO as secureNo,
       to_char(t.SECURE_START_TIME, 'yyyy-MM-dd HH24:mi:ss') as secureStartTime,
       to_char(t.SECURE_END_TIME, 'yyyy-MM-dd HH24:mi:ss') as secureEndTime,
       t.SECURE_HANDLE as secureHandle,
       t.secure_acc_no as secureAccNo,
       t.secure_acc_pay as secureAccPay,
       t.secure_tax as secureTax,
       t.secure_remark as secureRemark,
       (nvl(t.SECURE_PAY,0) + nvl(t.secure_acc_pay,0) + nvl(t.secure_tax,0)) as SECURE_NUM
  from CAR_SECURE_NEW t, POSITION_HOST_INFO_EXTEND p, POSITION_HOST_INFO po
 where t.host_id = p.hostid
   and t.host_id = po.hostid

新增的時候已經把三個費用相加了,所以查詢的時候直接查合計金額就可以了,不需要在sql語句中相加了
所以sql可以改為:
select t.RECORD_ID as recordId,
       t.HOST_ID as hostId,
       t.HOST_NO as carHostNO,
       t.SECURE_PAY as securePay,
       p.VEHICLE_MODEL as vehicleModel,
       po.APPSYSID as appSysId,
       po.APPDEPTID as appDeptId,
       t.SECURE_NO as secureNo,
       to_char(t.SECURE_START_TIME, 'yyyy-MM-dd HH24:mi:ss') as secureStartTime,
       to_char(t.SECURE_END_TIME, 'yyyy-MM-dd HH24:mi:ss') as secureEndTime,
       t.SECURE_HANDLE as secureHandle,
       t.secure_acc_no as secureAccNo,
       t.secure_acc_pay as secureAccPay,
       t.secure_tax as secureTax,
       t.secure_remark as secureRemark,
       t.secure_num as secureNum
  from CAR_SECURE_NEW t, POSITION_HOST_INFO_EXTEND p, POSITION_HOST_INFO po
 where t.host_id = p.hostid
   and t.host_id = po.hostid

起保和止保日期都不帶時分秒

新增的時候程式碼修改:
如果三個費用的金額為空,都預設為0,不為空就是本身新增各自輸入的值
合計金額是算出來的,頁面不給使用者輸入

匯入excel的時候,合計金額是三個金額相加,excel模板中不給合計這一欄

查詢的介面:
car/secure/list
{
    "startRow":0,
    "maxSize":20
}

{
    "retCode":1,
    "retMsg":"操作成功",
    "list":[
        {
            "recordId":"20170317114341423010628",
            "appSysId":2009,
            "appDeptId":2,
            "orgDeptName":"鹽城供電公司_響水供電公司",
            "carHostNO":"蘇JF6772",
            "secureNo":"GGG",
            "secureStartTime":"2016-11-01",
            "secureEndTime":"2016-11-02",
            "secureHandle":"王哈哈",
            "secureAccNo":"NNN",
            "secureAccPay":52,
            "secureTax":45.12,
            "secureRemark":"黃哥哥",
            "secureNum":97.12
        },
        {
            "recordId":"20170317114117211014776",
            "appSysId":2009,
            "appDeptId":2,
            "orgDeptName":"鹽城供電公司_響水供電公司",
            "carHostNO":"蘇JF6772",
            "secureNo":"AAA",
            "secureStartTime":"2016-11-01",
            "secureEndTime":"2016-11-02",
            "secureHandle":"啊哈哈的",
            "securePay":"102",
            "secureAccNo":"BBB",
            "secureAccPay":156,
            "secureTax":452,
            "secureRemark":"黃磊",
            "secureNum":710
        },
        {
            "recordId":"20170217142337379013138",
            "appSysId":23551,
            "appDeptId":6,
            "orgDeptName":"警保部_財務處",
            "carHostNO":"15000",
            "secureNo":"11111111",
            "secureStartTime":"2017-01-01",
            "secureEndTime":"2017-02-01",
            "secureHandle":"張三2017",
            "vehicleModel":"轎車",
            "securePay":"454",
            "secureAccNo":"QQQQ",
            "secureAccPay":545,
            "secureTax":77,
            "secureRemark":"大阿斯頓",
            "secureNum":1076
        },
        {
            "recordId":"20170217104605546013002",
            "appSysId":23551,
            "appDeptId":1,
            "orgDeptName":"警保部_一支隊",
            "carHostNO":"22111111",
            "secureNo":"SFG",
            "secureStartTime":"2017-01-01",
            "secureEndTime":"2017-02-01",
            "secureHandle":"ASDF",
            "securePay":"123",
            "secureAccNo":"ABCDE",
            "secureAccPay":145,
            "secureTax":100,
            "secureRemark":"劉備",
            "secureNum":368
        }
    ],
    "totalNum":23,
    "curRecordNum":4,
    "startRow":0,
    "nextStartRow":4
}


新增的介面:
car/secure/addCarSecure
{
    "carHostNO":"蘇JF6772",
    "secureNo":"AAA",
    "secureStartTime":"2016-11-1",
    "secureEndTime":"2016-11-2",
    "secureHandle":"啊哈哈的",
    "securePay":"102",
    "secureAccNo":"BBB",
    "secureAccPay":"156",
    "secureTax":"452",
    "secureRemark":"黃磊"
}

{
    "retCode":1,
    "retMsg":"操作成功"
}


修改的介面:
car/secure/modifyCarSecure
{
    "recordId":"20170317162902375015730",
    "secureNo":"ZHOU",
    "secureStartTime":"2016-12-2",
    "secureEndTime":"2016-12-3",
    "secureHandle":"周瑜",
    "securePay":"100.1",
    "secureAccNo":"SHU",
    "secureAccPay":"100.1",
    "secureTax":"100.1",
    "secureRemark":"周瑜"
}

{
    "retCode":1,
    "retMsg":"操作成功"
}


刪除的介面:
car/secure/delete 
[
    "20161117184331955013046"
]

{
    "retCode":1,
    "retMsg":"操作成功"
}


匯入的介面:
car/secure/importRecords
[{
    "lineNo":2,
    "carHostNO":"蘇H92B67",
    "secureNo":"abcd",
    "secureStartTime":"2016-11-1",
    "secureEndTime":"2016-11-2",
    "secureHandle":"經辦人的",
    "securePay":"",
    "secureAccNo":"BBB",
    "secureAccPay":"300",
    "secureTax":"",
    "secureNum":"456",
    "secureRemark":"李冰冰"

},
{
    "lineNo":3,
    "carHostNO":"蘇HN1623",
    "secureNo":"abcd",
    "secureStartTime":"2016-11-1",
    "secureEndTime":"2016-11-2",
    "secureHandle":"經辦人的",
    "securePay":"",
    "secureAccNo":"BBB",
    "secureAccPay":"300",
    "secureTax":"",
    "secureNum":"123",
    "secureRemark":"范冰冰"

}]

{
    "retCode":1,
    "retMsg":"操作成功"
}


相關文章