This commit is contained in:
xd 2024-03-26 16:46:24 +08:00
parent 665d37a32f
commit 94ade6f6b2
4 changed files with 86 additions and 44 deletions

View File

@ -96,6 +96,7 @@ public class CustomerController extends BaseController
public AjaxResult add(@RequestBody Customer customer)
{
customer.setCusCode(IdUtils.createNo("KH_",3));
customer.setCreateBy(getUsername());
return toAjax(customerService.insertCustomer(customer));
}
@ -107,6 +108,7 @@ public class CustomerController extends BaseController
@PutMapping
public AjaxResult edit(@RequestBody Customer customer)
{
customer.setUpdateBy(getUsername());
return toAjax(customerService.updateCustomer(customer));
}

View File

@ -84,6 +84,10 @@ public class Customer extends BaseEntity
@Excel(name = "客户审批状态")
private String cusApprovalStatus;
/** 创建人 */
@Excel(name = "创建人")
private String createName;
/** 银行信息 */
private List<Bank> bankList;
@ -277,6 +281,14 @@ public class Customer extends BaseEntity
return cusApprovalStatus;
}
public String getCreateName() {
return createName;
}
public void setCreateName(String createName) {
this.createName = createName;
}
public List<Bank> getBankList()
{
return bankList;

View File

@ -26,6 +26,11 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<result property="cusRemark" column="cus_remark" />
<result property="cusState" column="cus_state" />
<result property="cusApprovalStatus" column="cus_approval_status" />
<result property="createBy" column="create_by" />
<result property="createName" column="create_name" />
<result property="createTime" column="create_time" />
<result property="updateBy" column="update_by" />
<result property="updateTime" column="update_time" />
</resultMap>
<resultMap id="CustomerBankResult" type="Customer" extends="CustomerResult">
@ -39,8 +44,17 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<result property="cusId" column="sub_cus_id" />
</resultMap>
<sql id="customerJoins">
LEFT JOIN sys_user s on s.user_name=a.create_by
</sql>
<sql id="selectCustomerVo">
select cus_id, cus_code, cus_name, cus_sap_code, cus_street, cus_payment_terms, cus_phone_number, cus_industry_code, cus_group, cus_vat_no, cus_type, cus_country, cus_language, cus_label, cus_classification, cus_receiving_email, cus_recipient, cus_recipient_phone, cus_remark, cus_state, cus_approval_status from customer
select a.cus_id, a.cus_code, a.cus_name, a.cus_sap_code, a.cus_street, a.cus_payment_terms, a.cus_phone_number,
a.cus_industry_code, a.cus_group, a.cus_vat_no, a.cus_type, a.cus_country, a.cus_language, a.cus_label,
a.cus_classification, a.cus_receiving_email, a.cus_recipient, a.cus_recipient_phone, a.cus_remark,
a.cus_state, a.cus_approval_status,a.create_time,s.nick_name create_name
from customer a
<include refid="customerJoins"/>
</sql>
<select id="selectCustomerList" parameterType="Customer" resultMap="CustomerResult">
@ -85,6 +99,8 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<if test="cusRemark != null">cus_remark,</if>
<if test="cusState != null">cus_state,</if>
<if test="cusApprovalStatus != null">cus_approval_status,</if>
<if test="createBy != null and createBy != ''">create_by,</if>
create_time
</trim>
<trim prefix="values (" suffix=")" suffixOverrides=",">
<if test="cusCode != null">#{cusCode},</if>
@ -107,6 +123,8 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<if test="cusRemark != null">#{cusRemark},</if>
<if test="cusState != null">#{cusState},</if>
<if test="cusApprovalStatus != null">#{cusApprovalStatus},</if>
<if test="createBy != null and createBy != ''">#{createBy},</if>
getdate()
</trim>
</insert>
@ -133,6 +151,8 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<if test="cusRemark != null">cus_remark = #{cusRemark},</if>
<if test="cusState != null">cus_state = #{cusState},</if>
<if test="cusApprovalStatus != null">cus_approval_status = #{cusApprovalStatus},</if>
<if test="updateBy != null and updateBy != ''">update_by = #{updateBy},</if>
update_time = getdate()
</trim>
where cus_id = #{cusId}
</update>

View File

@ -103,6 +103,14 @@
<el-table-column label="客户编码" align="center" prop="cusCode" />
<el-table-column label="客户名称" align="center" prop="cusName" />
<el-table-column label="SAP客户编码" align="center" prop="cusSapCode" />
<el-table-column label="客户类型" align="center" prop="cusType" />
<el-table-column label="客户组" align="center" prop="cusGroup" />
<el-table-column label="创建人" align="center" prop="createName" />
<el-table-column label="创建时间" align="center" prop="createTime" width="160">
<template slot-scope="scope">
<span>{{ parseTime(scope.row.createTime) }}</span>
</template>
</el-table-column>
<el-table-column label="客户禁用状态" align="center" prop="cusState">
<template slot-scope="scope">
<dict-tag :options="dict.type.common_state" :value="scope.row.cusState"/>