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

View File

@ -8,7 +8,7 @@ import com.ruoyi.common.core.domain.BaseEntity;
/** /**
* 客户管理对象 customer * 客户管理对象 customer
* *
* @author ruoyi * @author ruoyi
* @date 2024-03-25 * @date 2024-03-25
*/ */
@ -84,199 +84,211 @@ public class Customer extends BaseEntity
@Excel(name = "客户审批状态") @Excel(name = "客户审批状态")
private String cusApprovalStatus; private String cusApprovalStatus;
/** 创建人 */
@Excel(name = "创建人")
private String createName;
/** 银行信息 */ /** 银行信息 */
private List<Bank> bankList; private List<Bank> bankList;
public void setCusId(Long cusId) public void setCusId(Long cusId)
{ {
this.cusId = cusId; this.cusId = cusId;
} }
public Long getCusId() public Long getCusId()
{ {
return cusId; return cusId;
} }
public void setCusCode(String cusCode) public void setCusCode(String cusCode)
{ {
this.cusCode = cusCode; this.cusCode = cusCode;
} }
public String getCusCode() public String getCusCode()
{ {
return cusCode; return cusCode;
} }
public void setCusName(String cusName) public void setCusName(String cusName)
{ {
this.cusName = cusName; this.cusName = cusName;
} }
public String getCusName() public String getCusName()
{ {
return cusName; return cusName;
} }
public void setCusSapCode(String cusSapCode) public void setCusSapCode(String cusSapCode)
{ {
this.cusSapCode = cusSapCode; this.cusSapCode = cusSapCode;
} }
public String getCusSapCode() public String getCusSapCode()
{ {
return cusSapCode; return cusSapCode;
} }
public void setCusStreet(String cusStreet) public void setCusStreet(String cusStreet)
{ {
this.cusStreet = cusStreet; this.cusStreet = cusStreet;
} }
public String getCusStreet() public String getCusStreet()
{ {
return cusStreet; return cusStreet;
} }
public void setCusPaymentTerms(String cusPaymentTerms) public void setCusPaymentTerms(String cusPaymentTerms)
{ {
this.cusPaymentTerms = cusPaymentTerms; this.cusPaymentTerms = cusPaymentTerms;
} }
public String getCusPaymentTerms() public String getCusPaymentTerms()
{ {
return cusPaymentTerms; return cusPaymentTerms;
} }
public void setCusPhoneNumber(String cusPhoneNumber) public void setCusPhoneNumber(String cusPhoneNumber)
{ {
this.cusPhoneNumber = cusPhoneNumber; this.cusPhoneNumber = cusPhoneNumber;
} }
public String getCusPhoneNumber() public String getCusPhoneNumber()
{ {
return cusPhoneNumber; return cusPhoneNumber;
} }
public void setCusIndustryCode(String cusIndustryCode) public void setCusIndustryCode(String cusIndustryCode)
{ {
this.cusIndustryCode = cusIndustryCode; this.cusIndustryCode = cusIndustryCode;
} }
public String getCusIndustryCode() public String getCusIndustryCode()
{ {
return cusIndustryCode; return cusIndustryCode;
} }
public void setCusGroup(String cusGroup) public void setCusGroup(String cusGroup)
{ {
this.cusGroup = cusGroup; this.cusGroup = cusGroup;
} }
public String getCusGroup() public String getCusGroup()
{ {
return cusGroup; return cusGroup;
} }
public void setCusVatNo(String cusVatNo) public void setCusVatNo(String cusVatNo)
{ {
this.cusVatNo = cusVatNo; this.cusVatNo = cusVatNo;
} }
public String getCusVatNo() public String getCusVatNo()
{ {
return cusVatNo; return cusVatNo;
} }
public void setCusType(String cusType) public void setCusType(String cusType)
{ {
this.cusType = cusType; this.cusType = cusType;
} }
public String getCusType() public String getCusType()
{ {
return cusType; return cusType;
} }
public void setCusCountry(String cusCountry) public void setCusCountry(String cusCountry)
{ {
this.cusCountry = cusCountry; this.cusCountry = cusCountry;
} }
public String getCusCountry() public String getCusCountry()
{ {
return cusCountry; return cusCountry;
} }
public void setCusLanguage(String cusLanguage) public void setCusLanguage(String cusLanguage)
{ {
this.cusLanguage = cusLanguage; this.cusLanguage = cusLanguage;
} }
public String getCusLanguage() public String getCusLanguage()
{ {
return cusLanguage; return cusLanguage;
} }
public void setCusLabel(String cusLabel) public void setCusLabel(String cusLabel)
{ {
this.cusLabel = cusLabel; this.cusLabel = cusLabel;
} }
public String getCusLabel() public String getCusLabel()
{ {
return cusLabel; return cusLabel;
} }
public void setCusClassification(String cusClassification) public void setCusClassification(String cusClassification)
{ {
this.cusClassification = cusClassification; this.cusClassification = cusClassification;
} }
public String getCusClassification() public String getCusClassification()
{ {
return cusClassification; return cusClassification;
} }
public void setCusReceivingEmail(String cusReceivingEmail) public void setCusReceivingEmail(String cusReceivingEmail)
{ {
this.cusReceivingEmail = cusReceivingEmail; this.cusReceivingEmail = cusReceivingEmail;
} }
public String getCusReceivingEmail() public String getCusReceivingEmail()
{ {
return cusReceivingEmail; return cusReceivingEmail;
} }
public void setCusRecipient(String cusRecipient) public void setCusRecipient(String cusRecipient)
{ {
this.cusRecipient = cusRecipient; this.cusRecipient = cusRecipient;
} }
public String getCusRecipient() public String getCusRecipient()
{ {
return cusRecipient; return cusRecipient;
} }
public void setCusRecipientPhone(String cusRecipientPhone) public void setCusRecipientPhone(String cusRecipientPhone)
{ {
this.cusRecipientPhone = cusRecipientPhone; this.cusRecipientPhone = cusRecipientPhone;
} }
public String getCusRecipientPhone() public String getCusRecipientPhone()
{ {
return cusRecipientPhone; return cusRecipientPhone;
} }
public void setCusRemark(String cusRemark) public void setCusRemark(String cusRemark)
{ {
this.cusRemark = cusRemark; this.cusRemark = cusRemark;
} }
public String getCusRemark() public String getCusRemark()
{ {
return cusRemark; return cusRemark;
} }
public void setCusState(String cusState) public void setCusState(String cusState)
{ {
this.cusState = cusState; this.cusState = cusState;
} }
public String getCusState() public String getCusState()
{ {
return cusState; return cusState;
} }
public void setCusApprovalStatus(String cusApprovalStatus) public void setCusApprovalStatus(String cusApprovalStatus)
{ {
this.cusApprovalStatus = cusApprovalStatus; this.cusApprovalStatus = cusApprovalStatus;
} }
public String getCusApprovalStatus() public String getCusApprovalStatus()
{ {
return cusApprovalStatus; return cusApprovalStatus;
} }
public String getCreateName() {
return createName;
}
public void setCreateName(String createName) {
this.createName = createName;
}
public List<Bank> getBankList() public List<Bank> getBankList()
{ {
return bankList; return bankList;

View File

@ -26,6 +26,11 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<result property="cusRemark" column="cus_remark" /> <result property="cusRemark" column="cus_remark" />
<result property="cusState" column="cus_state" /> <result property="cusState" column="cus_state" />
<result property="cusApprovalStatus" column="cus_approval_status" /> <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>
<resultMap id="CustomerBankResult" type="Customer" extends="CustomerResult"> <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" /> <result property="cusId" column="sub_cus_id" />
</resultMap> </resultMap>
<sql id="customerJoins">
LEFT JOIN sys_user s on s.user_name=a.create_by
</sql>
<sql id="selectCustomerVo"> <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> </sql>
<select id="selectCustomerList" parameterType="Customer" resultMap="CustomerResult"> <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="cusRemark != null">cus_remark,</if>
<if test="cusState != null">cus_state,</if> <if test="cusState != null">cus_state,</if>
<if test="cusApprovalStatus != null">cus_approval_status,</if> <if test="cusApprovalStatus != null">cus_approval_status,</if>
<if test="createBy != null and createBy != ''">create_by,</if>
create_time
</trim> </trim>
<trim prefix="values (" suffix=")" suffixOverrides=","> <trim prefix="values (" suffix=")" suffixOverrides=",">
<if test="cusCode != null">#{cusCode},</if> <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="cusRemark != null">#{cusRemark},</if>
<if test="cusState != null">#{cusState},</if> <if test="cusState != null">#{cusState},</if>
<if test="cusApprovalStatus != null">#{cusApprovalStatus},</if> <if test="cusApprovalStatus != null">#{cusApprovalStatus},</if>
<if test="createBy != null and createBy != ''">#{createBy},</if>
getdate()
</trim> </trim>
</insert> </insert>
@ -133,6 +151,8 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<if test="cusRemark != null">cus_remark = #{cusRemark},</if> <if test="cusRemark != null">cus_remark = #{cusRemark},</if>
<if test="cusState != null">cus_state = #{cusState},</if> <if test="cusState != null">cus_state = #{cusState},</if>
<if test="cusApprovalStatus != null">cus_approval_status = #{cusApprovalStatus},</if> <if test="cusApprovalStatus != null">cus_approval_status = #{cusApprovalStatus},</if>
<if test="updateBy != null and updateBy != ''">update_by = #{updateBy},</if>
update_time = getdate()
</trim> </trim>
where cus_id = #{cusId} where cus_id = #{cusId}
</update> </update>

View File

@ -103,6 +103,14 @@
<el-table-column label="客户编码" align="center" prop="cusCode" /> <el-table-column label="客户编码" align="center" prop="cusCode" />
<el-table-column label="客户名称" align="center" prop="cusName" /> <el-table-column label="客户名称" align="center" prop="cusName" />
<el-table-column label="SAP客户编码" align="center" prop="cusSapCode" /> <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"> <el-table-column label="客户禁用状态" align="center" prop="cusState">
<template slot-scope="scope"> <template slot-scope="scope">
<dict-tag :options="dict.type.common_state" :value="scope.row.cusState"/> <dict-tag :options="dict.type.common_state" :value="scope.row.cusState"/>