前端发
'paySn': JSON.stringify(this.dataForm.paySn),
'chooseModeAccountList': JSON.stringify(this.chooseModeAccountList),
后端接
String paySn = params.getString("paySn");
String chooseModeAccountJson = params.getString("chooseModeAccountList");
这两个为什么这种形式来接要传给后台的值
JSON.stringify(this.dataForm.paySn),
JSON.stringify(this.chooseModeAccountList),
这两个接的感觉和正常传值有什么区别吗?
String paySn = params.getString("paySn");
String chooseModeAccountJson = params.getString("chooseModeAccountList");
this.imgList.forEach(file => {
if (file.response != undefined) {
uploadFile = 'http://' + file.response.url
} else {
uploadFile = file.url
}
uploadFileList.push(uploadFile);
})
if (this.dataForm.incomeMode.length == 0) {
this.$message.error('请选择进账方式');
return;
}
this.$refs['dataForm'].validate((valid) => {
if (valid) {
this.$confirm('将提交至财务对账, 是否继续?', '提示', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning'
}).then(() => {
this.$http({
url: this.$http.adornUrl(`xxx/xxx/sss`),
method: 'post',
data: this.$http.adornData({
'paySn': JSON.stringify(this.dataForm.paySn),
'chooseModeAccountList': JSON.stringify(this.chooseModeAccountList),
})
}).then(({data}) => {
if (data && data.code === 0) {
this.$message({
message: '操作成功',
type: 'success',
duration: 1500,
onClose: () => {
this.backPage();
this.loading = false
this.tabsCloseCurrentHandle();
}
})
} else {
this.$message.error(data.msg)
}
})
}).catch(() => {
this.$message({
type: 'info',
message: '已取消提交'
});
});
}
});
},
@Override
public ReturnValue sss(JSONObject params) {
String paySn = params.getString("paySn");
String chooseModeAccountJson = params.getString("chooseModeAccountList");
OrderCustomerAccountEntity orderCustomerAccountEntity = TypeUtils.castToJavaBean(params, OrderCustomerAccountEntity.class);
orderCustomerAccountEntity.setPaySn(paySn);
orderCustomerAccountEntity.setChooseModeAccountJson(chooseModeAccountJson);//JSON进账方式
orderCustomerAccountService.insert(orderCustomerAccountEntity);
return new ReturnValue("0000","SUCCESS");
}