This commit is contained in:
xd 2024-05-24 13:37:29 +08:00
parent 53ee38de3b
commit dab6735b7d
6 changed files with 48 additions and 2 deletions

View File

@ -1,5 +1,5 @@
#for tests only !
#Fri May 24 10:59:58 CST 2024
#Fri May 24 13:35:10 CST 2024
jco.destination.pool_capacity=10
jco.client.lang=ZH
jco.client.ashost=172.19.0.120
@ -7,5 +7,5 @@ jco.client.saprouter=
jco.client.user=RFC
jco.client.sysnr=00
jco.destination.peak_limit=10
jco.client.passwd=eh#cz-.rtcXe[J,v=]]kN+:WMGkUk|l**Lw)XHiZ5XN)Zm0`
jco.client.passwd=u?K-{MKso0NR;1AE/+Y9s/7g^0`/0Uo7Mk{RY=Aw!O|5bcY$
jco.client.client=300

View File

@ -279,6 +279,13 @@ public class QuotController extends BaseController
quot.setUpdateBy(getUsername());
quot.setQuotApprovalStatus("1");//报价单 状态设置为 协助中
quot.setQuotInquiryDate(DateUtils.getNowDate());//报价单 询价日期设置为 当前日期
// 校验 是否已有重复报价单客户+项目名
Boolean flag = quotService.checkExistQuot(getUsername(),quot.getQuotCustomerBm(),quot.getQuotProject());
if(flag){
return error("存在相同客户且项目名称一致的报价单,无法提交");
}
if(StringUtils.isEmpty(quot_id)){
quot.setQuotId(UUID.fastUUID().toString());
quot.setQuotCode(IdUtils.createNo("BJD_",2));

View File

@ -3,6 +3,7 @@ package com.ruoyi.quot.mapper;
import java.util.List;
import com.ruoyi.quot.domain.Quot;
import com.ruoyi.quot.domain.QuotMaterial;
import org.apache.ibatis.annotations.Param;
/**
* 报价Mapper接口
@ -98,4 +99,13 @@ public interface QuotMapper
* @return
*/
Quot selectQuotByQuotHjId(String quotHjId);
/**
* 校验 是否已有重复报价单客户+项目名
* @param username
* @param quotCustomerBm
* @param quotProject
* @return
*/
String checkExistQuot(@Param("quotSalesmanCode") String username, @Param("quotCustomerBm") String quotCustomerBm, @Param("quotProject") String quotProject);
}

View File

@ -81,4 +81,13 @@ public interface IQuotService
* @return
*/
int changQuotPrintStatus(Quot quot);
/**
* 校验 是否已有重复报价单客户+项目名
* @param username
* @param quotCustomerBm
* @param quotProject
* @return
*/
Boolean checkExistQuot(String username, String quotCustomerBm, String quotProject);
}

View File

@ -144,6 +144,19 @@ public class QuotServiceImpl implements IQuotService
return quotMapper.updateQuot(quot);
}
/**
* 校验 是否已有重复报价单客户+项目名
* @param username
* @param quotCustomerBm
* @param quotProject
* @return
*/
@Override
public Boolean checkExistQuot(String username, String quotCustomerBm, String quotProject) {
String count = quotMapper.checkExistQuot(username,quotCustomerBm,quotProject);
return !"0".equals(count);
}
/**
* 新增报价单-产品信息
*
@ -159,6 +172,7 @@ public class QuotServiceImpl implements IQuotService
for (QuotMaterial quotMaterial : quotMaterialList)
{
quotMaterial.setMatId(UUID.fastUUID().toString());
//TODO 标准
quotMaterial.setQuotId(quotId);
list.add(quotMaterial);
}

View File

@ -154,6 +154,12 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
where a.quot_id = #{quotId}
</select>
<select id="checkExistQuot" parameterType="Quot" resultMap="QuotResult">
select count(1) from quot where quot_salesman_code != #{quotSalesmanCode}
and quot_customer_bm = #{quotCustomerBm} and quot_project = #{quotProject}
and quot_approval_status in ('1','2')
</select>
<insert id="insertQuot" parameterType="Quot">
insert into quot
<trim prefix="(" suffix=")" suffixOverrides=",">