保存数据问题

Blade 未结 2 1347
sp
sp 2020-06-30 10:39

一、该问题的重现步骤是什么?

1. 实体类 ItemMasterData 的各个字段定义如下

image.png


image.png

2、Controller接口定义如下

image.png

3、调用接口传入的参数

{
    "itemName":"2 3",
    "displaySapDb":"速品",
    "displayItemCategory":"茶叶",
    "itemStatus":1,
    "itemCode":"1",
    "frgnName":"2",
    "uZ20Spec":"3",
    "displayItemType":"物料",
    "displayItmsGrpCod":"100",
    "displayItmsGrpNam":"项目",
    "displayManBtchNum":"序列号",
    "displayVatGroupPu":"J0",
    "displayVatGroupPuName":"进项税0%",
    "displayCardCode":"C1T0001",
    "displayCardName":"天津普乐包装容器有限公司",
    "buyUnitMsr":"4",
    "purPackMsr":"5",
    "displayVatGroupSa":"J6",
    "displayVatGroupSaName":"进项税10%",
    "salUnitMsr":"6",
    "salPackMsr":"7",
    "displayGlMethod":"仓库",
    "displayEvalSystem":"移动平均",
    "invntryUom":"8",
    "displayDfltWh":"01",
    "displayDfltWhName":"一般仓库",
    "uI002":"9",
    "uI003":"10",
    "uI016":"11",
    "uI005":"餐饮",
    "uI007":"12",
    "uI008":"13",
    "uZ98Perq":"14",
    "uI004":"Y",
    "uI011":"15",
    "uI012":"16",
    "uI013":"17",
    "uI014":"18",
    "uGySpdm":"19",
    "uI015":"20",

    "processDefinitionId":"ItemMasterData:3:8702143f-b9de-11ea-a925-00163e1013f5",
    "attachments":[
        {
            "id":"1277536063063007234",
            "name":"图片_20200609103439.jpg",
            "url":"uploadFile/2941bb54-e302-4014-909e-b953774e0867.jpg",
            "uid":1593423314931
        }]
}


4、但是Controller接收到的参数信息,如:实体类命名的是uI014,传入的也是uI014,但是实际却需要ui014, 然后数据库中u_i014就没有存入数据

================  Request Start  ================
===> POST: /process/itemMasterData/save-draft
====Body=====  {"id":null,"createUser":null,"createDept":null,"createTime":null,"updateUser":null,"updateTime":null,"status":null,"isDeleted":null,"flow":{"taskId":null,"taskName":null,"taskDefinitionKey":null,"assignee":null,"assigneeName":null,"category":null,"categoryName":null,"createTime":null,"endTime":null,"claimTime":null,"historyTaskEndTime":null,"executionId":null,"processInstanceId":null,"processDefinitionId":null,"processDefinitionKey":null,"processDefinitionName":null,"processDefinitionVersion":0,"processDefinitionDesc":null,"processDefinitionDiagramResName":null,"processDefinitionResName":null,"historyProcessInstanceId":null,"processIsFinished":null,"historyActivityName":null,"historyActivityDurationTime":null,"businessTable":null,"businessId":null,"status":null,"comment":null,"flag":null,"beginDate":null,"endDate":null,"variables":null,"pass":false},"tenantId":null,"processDefinitionId":"ItemMasterData:3:8702143f-b9de-11ea-a925-00163e1013f5","processInstanceId":null,"applyTime":null,"orderCode":null,"displaySapDb":"速品","displayItemCategory":"茶叶","itemStatus":"1","itemCode":"1","frgnName":"2","itemName":"2 3","displayItemType":"物料","displayItmsGrpCod":"100","displayItmsGrpNam":"项目","displayManBtchNum":"序列号","displayCardCode":"C1T0001","displayCardName":"天津普乐包装容器有限公司","buyUnitMsr":"4","purPackMsr":"5","displayVatGroupPu":"J0","displayVatGroupPuName":"进项税0%","displayVatGroupSa":"J6","displayVatGroupSaName":"进项税10%","salUnitMsr":"6","salPackMsr":"7","displayGlMethod":"仓库","invntryUom":"8","displayEvalSystem":"移动平均","displayDfltWh":"01","displayDfltWhName":"一般仓库","attachments":[{"id":"1277536063063007234","createUser":null,"createDept":null,"createTime":null,"updateUser":null,"updateTime":null,"status":null,"isDeleted":null,"businessId":null,"processInstanceId":null,"name":"图片_20200609103439.jpg","url":"uploadFile/2941bb54-e302-4014-909e-b953774e0867.jpg","type":null,"attachmentSize":0}],"uz20Spec":null,"ui004":null,"ui016":null,"ui013":null,"ui003":null,"uz98Perq":null,"ui015":null,"ui005":null,"ui011":null,"ui007":null,"ui012":null,"ugySpdm":null,"ui002":null,"ui014":null,"ui008":null}


5、接口执行sql如下

Original SQL: INSERT INTO blade_process_item_master_data  ( id,

process_definition_id,

display_sap_db,
display_item_category,
item_status,
item_code,
frgn_name,

item_name,
display_item_type,
display_itms_grp_cod,
display_itms_grp_nam,
display_man_btch_num,
display_card_code,
display_card_name,
buy_unit_msr,
pur_pack_msr,
display_vat_group_pu,
display_vat_group_pu_name,
display_vat_group_sa,
display_vat_group_sa_name,
sal_unit_msr,
sal_pack_msr,
display_gl_method,
invntry_uom,
display_eval_system,
display_dflt_wh,
display_dflt_wh_name,


create_time,

update_time,
status,
is_deleted )  VALUES  ( ?,

?,

?,
?,
?,
?,
?,

?,
?,
?,
?,
?,
?,
?,
?,
?,
?,
?,
?,
?,
?,
?,
?,
?,
?,
?,
?,


?,

?,
?,
? )


6、数据库字段

image.png


二、你期待的结果是什么?实际看到的又是什么?

实体类命名的是uI014,传入的也是uI014,但是实际却需要ui014, 然后数据库中u_i014就没有存入数据。如何操作才能正常保存数据?


三、你正在使用的是什么产品,什么版本?在什么操作系统上?

bladex_cloud 2.5 windows 

2条回答
  •  smallchill
    smallchill (楼主)
    2020-06-30 13:44

    需要满足驼峰规则,并且字段第一个小写后不能紧接这第二个大写。

    比如把uI004改成uuI004,数据库内字段为uu_i004,具体的要看mybatis-plus驼峰转换的类逻辑

提交回复