This commit is contained in:
xd 2024-05-06 17:16:24 +08:00
parent 7a8b425741
commit 33bcaec535
7 changed files with 75 additions and 19 deletions

View File

@ -1,5 +1,5 @@
#for tests only !
#Mon May 06 14:44:29 CST 2024
#Mon May 06 17:03:41 CST 2024
jco.destination.pool_capacity=10
jco.client.lang=ZH
jco.client.ashost=172.19.0.125

View File

@ -126,23 +126,39 @@ public class CustomerController extends BaseController
public AjaxResult commitCustomer(@RequestBody Customer customer)
{
String cus_id = customer.getCusId();
customer.setUpdateBy(getUsername());
customer.setCusApprovalStatus("1");//客户提交 状态设置为 审核中
//TODO 提交校验
if(StringUtils.isEmpty(cus_id)){
customer.setCusId(UUID.fastUUID().toString());
customer.setCusCode(IdUtils.createNo("KH_",2));
customer.setCreateBy(getUsername());
customerService.insertCustomer(customer);
//提交OA中间表 TODO
//....
return success();
}else{
customer.setUpdateBy(getUsername());
customerService.updateCustomer(customer);
//提交OA中间表 TODO
//....
return success();
}
}
/**
* 提交客户信息-SAP
*/
@PreAuthorize("@ss.hasPermi('customer:customer:commitSAP')")
@Log(title = "客户信息提交", businessType = BusinessType.OTHER)
@PostMapping("/commitSAPCustomer")
public AjaxResult commitSAPCustomer(@RequestBody Customer customer)
{
customer.setUpdateBy(getUsername());
customer.setCusApprovalStatus("2");//客户提交 状态设置为 已审核
customerService.updateCustomer(customer);
//TODO 提交校验 调用SAP rfc接口 更新客户凭证号
return success();
}
/**
* 删除客户管理
*/

View File

@ -2,6 +2,7 @@ package com.ruoyi.customer.service.impl;
import java.util.List;
import com.ruoyi.common.annotation.DataScope;
import com.ruoyi.common.utils.DateUtils;
import com.ruoyi.common.utils.uuid.UUID;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
@ -60,6 +61,8 @@ public class CustomerServiceImpl implements ICustomerService
@Override
public int insertCustomer(Customer customer)
{
customer.setCreateTime(DateUtils.getNowDate());
customer.setUpdateTime(DateUtils.getNowDate());
int rows = customerMapper.insertCustomer(customer);
insertBank(customer);
return rows;
@ -75,6 +78,7 @@ public class CustomerServiceImpl implements ICustomerService
@Override
public int updateCustomer(Customer customer)
{
customer.setUpdateTime(DateUtils.getNowDate());
customerMapper.deleteBankByCusId(customer.getCusId());
insertBank(customer);
return customerMapper.updateCustomer(customer);

View File

@ -56,6 +56,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<sql id="customerJoins">
LEFT JOIN sys_user u on u.user_name=a.create_by
LEFT JOIN sys_dept d on u.dept_id = d.dept_id
</sql>
<sql id="selectCustomerVo">

View File

@ -44,6 +44,15 @@ export function commitCustomer(data) {
})
}
//提交客户信息-SAP
export function commitSAPCustomer(data) {
return request({
url: '/customer/customer/commitSAPCustomer',
method: 'post',
data: data
})
}
// 删除客户管理
export function delCustomer(cusId) {
return request({

View File

@ -42,6 +42,7 @@
:key="dict.value"
:label="dict.label"
:value="dict.value"
v-if="(!cusApprovalStatusHidden && (dict.value == '1' || dict.value == '2')) || cusApprovalStatusHidden "
/>
</el-select>
</el-form-item>
@ -107,7 +108,7 @@
</el-table-column>
<el-table-column fixed label="客户名称" align="center" prop="cusName" width="230px">
<template slot-scope="scope">
<el-link v-hasPermi="['customer:customer:edit']" :underline="false" type="primary" @click="handleUpdate(scope.row)">{{scope.row.cusName}}</el-link>
<el-link :underline="false" type="primary" @click="handleUpdate(scope.row)">{{scope.row.cusName}}</el-link>
</template>
</el-table-column>
<el-table-column label="客户编码" align="center" prop="cusCode" width="230px"></el-table-column>
@ -298,26 +299,26 @@
<el-table :data="bankList" @selection-change="handleBankSelectionChange" ref="bank">
<el-table-column type="selection" width="50" align="center" />
<el-table-column label="序号" align="center" prop="index" width="50"/>
<el-table-column label="国家" prop="bankCountry">
<el-table-column label="国家" prop="bankCountry" v-if="checkRole(['ITZX_SJZ'])">
<template slot-scope="scope">
<el-input v-model="scope.row.bankCountry" placeholder="选择银行代码自动带出" :disabled="true"/>
</template>
</el-table-column>
<el-table-column label="银行代码" prop="bankCode">
<el-table-column label="银行代码" prop="bankCode" v-if="checkRole(['ITZX_SJZ'])">
<template slot-scope="scope">
<el-input v-model="scope.row.bankCode" placeholder="请输入银行代码">
<i slot="suffix" class="el-input__icon el-icon-search" @click="handleSearchBankCode(scope)"></i>
<el-input v-model="scope.row.bankCode" placeholder="请输入银行代码" :disabled="true" >
<i v-if="!isDisSjz" slot="suffix" class="el-input__icon el-icon-search" @click="handleSearchBankCode(scope)"></i>
</el-input>
</template>
</el-table-column>
<el-table-column label="银行名称" prop="bankName">
<template slot-scope="scope">
<el-input v-model="scope.row.bankName" placeholder="请输入银行名称" />
<el-input v-model="scope.row.bankName" placeholder="请输入银行名称" :disabled="isDisSalesman"/>
</template>
</el-table-column>
<el-table-column label="银行账户" prop="bankAccount">
<template slot-scope="scope">
<el-input v-model="scope.row.bankAccount" placeholder="请输入银行账户" />
<el-input v-model="scope.row.bankAccount" placeholder="请输入银行账户" :disabled="isDisSalesman" />
</template>
</el-table-column>
</el-table>
@ -472,7 +473,7 @@
<el-table-column label="法人" align="center" prop="operName" />
<el-table-column label="注册时间" align="center" prop="startDate" />
<el-table-column label="增值税号" align="center" prop="creditCode" />
<el-table-column label="地址" align="center" prop="address" />
</el-table>
<!--<pagination
v-show="qccTotal>0"
@ -534,7 +535,7 @@
}
</style>
<script>
import { listCustomer, getCustomer, delCustomer, addCustomer, updateCustomer, commitCustomer, qccListCustomer } from "@/api/customer/customer";
import { listCustomer, getCustomer, delCustomer, addCustomer, updateCustomer, commitCustomer,commitSAPCustomer, qccListCustomer } from "@/api/customer/customer";
import { checkPermi, checkRole } from "@/utils/permission"; //
import { bankCodeList,getCountrys,getIndustryCode,getLanguage,getPaymentTerms,getSalesOrganization,getDistributionChannel,getSalesTerritory,getSaleOffice,getTax,getReconciliationAccount } from "@/api/common/sapRfc";// sap-rfc
@ -592,6 +593,8 @@ export default {
dicts: ['cus_currency','cus_group','cus_approval_status', 'cus_type', 'common_state'],
data() {
return {
//
cusApprovalStatusHidden: true,
//
activeName: 'customerInfo',
@ -757,6 +760,7 @@ export default {
created() {
const roles = this.$store.state.user.roles;
if(roles && roles.indexOf('ITZX_SJZ') !== -1 && roles.indexOf('admin') == -1 ){//
this.cusApprovalStatusHidden = false;
this.queryParams.cusApprovalStatus = '1';
}
this.getList();
@ -843,7 +847,7 @@ export default {
this.isDisSalesman = this.form.cusApprovalStatus == '0'?false:true;
this.buttonShowSjz = this.form.cusApprovalStatus != '0'?true:false;
this.isDisSjz = this.form.cusApprovalStatus != '0'?true:false;
this.isDisSjz = this.form.cusApprovalStatus == '1'?false:true;
this.bankList = response.data.bankList;
this.open = true;
@ -884,6 +888,19 @@ export default {
}
});
},
/** 提交SAP按钮 */
commitSAPForm() {
this.$refs["form"].validate(valid => {
if (valid) {
this.form.bankList = this.bankList;
commitSAPCustomer(this.form).then(response => {
this.$modal.msgSuccess("提交SAP成功");
this.open = false;
this.getList();
});
}
});
},
/** 删除按钮操作 */
handleDelete(row) {
const cusIds = row.cusId || this.ids;
@ -932,6 +949,7 @@ export default {
openQcc(){
this.qccOpen = true;
this.qccTitle = "企查查客户信息";
this.resetQccQuery();
},
/** 切换每页显示条数 */
@ -972,6 +990,8 @@ export default {
const selectedData = qccTable.selection;
this.form.cusName = selectedData[0].name;
this.form.cusVatNo = selectedData[0].creditCode;
this.form.cusQccStreet = selectedData[0].address;
this.qccOpen = false;
},
//
@ -982,8 +1002,9 @@ export default {
/** 重置按钮操作 */
resetQccQuery() {
this.qccCustomerList = [];
//this.qccTotal = 0;
this.resetForm("queryQccForm");
this.queryQccParams = {
Name: ""
}
},
/*****************************企查查查询模块*************************************/
/*****************************银行代码查询模块*************************************/

View File

@ -32,6 +32,7 @@
:key="dict.value"
:label="dict.label"
:value="dict.value"
v-if="!quotApprovalStatusHidden && (dict.value == '1' || dict.value == '2') "
/>
</el-select>
</el-form-item>
@ -720,6 +721,7 @@
import { listQuot, getQuot, delQuot, addQuot, updateQuot, quotFileList, quotFileDelete, commitQuot, commitJsQuot, commitHjQuot, feedbackQuot, rejectQuot } from "@/api/quot/quot";
import { getToken } from "@/utils/auth";
import { checkPermi } from '@/utils/permission';//
import { getDicts } from "@/api/system/dict/data";
//
import jsqrDialog from '@/views/technicalConfirm/technicalConfirm/jsxzInfo.vue';
@ -736,6 +738,8 @@ export default {
dicts: ['quot_approval_status','quot_jsxz_group','quot_jsxz_chapter','quot_jsxz_approval_status','quot_jsxz_standard','quot_hj_approval_status'],
data() {
return {
//
quotApprovalStatusHidden: true,
//
activeName: 'quotInfo',
@ -824,7 +828,8 @@ export default {
created() {
const roles = this.$store.state.user.roles;
if(roles && roles.indexOf('QUOT') !== -1 && roles.indexOf('admin') == -1 ){//
this.queryParams.quotApprovalStatus = '1';
this.quotApprovalStatusHidden = false;
this.queryParams.quotApprovalStatus = '1';
}
this.getList();
},