This commit is contained in:
xd 2024-06-04 13:59:43 +08:00
parent c14301a9cc
commit 937d2d9462
9 changed files with 119 additions and 12 deletions

View File

@ -1,5 +1,5 @@
#for tests only !
#Tue Jun 04 08:13:25 CST 2024
#Tue Jun 04 13:59:05 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=d8I=KV+!D[+D!pL4TCjb[F!d9%S3gJ+,yj85yHvb$hqgCGl`
jco.client.passwd=g]8^b-oV5)bg?0=#[a~}U*AcfC4BmB/D}?F8E5.6%iG`lg]L
jco.client.client=300

View File

@ -1,10 +1,12 @@
package com.ruoyi.web.controller.quot;
import java.util.List;
import java.util.concurrent.TimeUnit;
import javax.servlet.http.HttpServletResponse;
import com.ruoyi.common.constant.WebsocketConst;
import com.ruoyi.common.core.domain.model.LoginUser;
import com.ruoyi.common.core.redis.RedisCache;
import com.ruoyi.common.utils.DateUtils;
import com.ruoyi.common.utils.StringUtils;
import com.ruoyi.common.utils.file.FileUploadUtils;
@ -15,6 +17,7 @@ import com.ruoyi.priceVerification.service.IQuotHjService;
import com.ruoyi.quot.domain.QuotFile;
import com.ruoyi.quot.domain.QuotMaterial;
import com.ruoyi.quot.service.IQuotFileService;
import com.ruoyi.system.service.ISysConfigService;
import com.ruoyi.system.service.ISysNoticeService;
import com.ruoyi.technicalConfirm.domain.QuotJsqr;
import com.ruoyi.technicalConfirm.service.IQuotJsqrService;
@ -44,6 +47,12 @@ import org.springframework.web.multipart.MultipartFile;
@RequestMapping("/quot/quot")
public class QuotController extends BaseController
{
@Autowired
private RedisCache redisCache;
@Autowired
private ISysConfigService configService;
@Autowired
private IQuotService quotService;
@ -276,6 +285,13 @@ public class QuotController extends BaseController
@PostMapping("/commitQuot")
public AjaxResult commitQuot(@RequestBody Quot quot)
{
// 每天限制提交200条
String quotCommitCount = configService.selectConfigByKey("quot:commit:count");
String count = quotService.selectQuotListCount();
if(Integer.valueOf(count)>=Integer.valueOf(quotCommitCount)){
return error("当前报价量已达极限,无法继续提供报价单");
}
String quot_id = quot.getQuotId();
quot.setUpdateBy(getUsername());

View File

@ -5,6 +5,7 @@ import com.ruoyi.common.annotation.Log;
import com.ruoyi.common.core.controller.BaseController;
import com.ruoyi.common.core.domain.R;
import com.ruoyi.common.enums.BusinessType;
import com.ruoyi.common.utils.DateUtils;
import com.ruoyi.common.utils.StringUtils;
import com.ruoyi.quot.domain.Quot;
import com.ruoyi.quot.domain.QuotMaterial;
@ -37,35 +38,65 @@ public class quotJswController extends BaseController {
@PostMapping("/updateQuot")
public R<String> updateQuot(@RequestBody String quotJson)
{
try{
// 记录接口日志
// 接口调用记录
SysOperLog sysOperLog = new SysOperLog();
sysOperLog.setTitle("金思维返回报价数据");
sysOperLog.setOperParam(quotJson);
iSysOperLogService.insertOperlog(sysOperLog);
sysOperLog.setRequestMethod("POST");
sysOperLog.setOperTime(DateUtils.getNowDate());
long startTime = System.currentTimeMillis();
try{
quotModel quot = JSON.parseObject(quotJson, quotModel.class);
if(quot==null){
sysOperLog.setStatus(1);
long endTime = System.currentTimeMillis();
sysOperLog.setCostTime(endTime - startTime);
iSysOperLogService.insertOperlog(sysOperLog);
return R.fail("参数异常为空");
}
if(StringUtils.isBlank(quot.getQuotJswCode())){
sysOperLog.setStatus(1);
long endTime = System.currentTimeMillis();
sysOperLog.setCostTime(endTime - startTime);
iSysOperLogService.insertOperlog(sysOperLog);
return R.fail("金思维报价单号不能为空");
}
if(StringUtils.isBlank(quot.getQuotCode())){
sysOperLog.setStatus(1);
long endTime = System.currentTimeMillis();
sysOperLog.setCostTime(endTime - startTime);
iSysOperLogService.insertOperlog(sysOperLog);
return R.fail("客户报价单号不能为空");
}
if(StringUtils.isBlank(quot.getQuotTongPrice())){
sysOperLog.setStatus(1);
long endTime = System.currentTimeMillis();
sysOperLog.setCostTime(endTime - startTime);
iSysOperLogService.insertOperlog(sysOperLog);
return R.fail("铜价不能为空");
}
if(StringUtils.isBlank(quot.getQuotLvPrice())){
sysOperLog.setStatus(1);
long endTime = System.currentTimeMillis();
sysOperLog.setCostTime(endTime - startTime);
iSysOperLogService.insertOperlog(sysOperLog);
return R.fail("铝价不能为空");
}
if(StringUtils.isBlank(quot.getQuotMatpriceDiff())){
sysOperLog.setStatus(1);
long endTime = System.currentTimeMillis();
sysOperLog.setCostTime(endTime - startTime);
iSysOperLogService.insertOperlog(sysOperLog);
return R.fail("整单料价价差率不能为空");
}
List<quotMaterialModel> materials = quot.getQuotMaterial();
if(materials==null || materials.size()==0){
sysOperLog.setStatus(1);
long endTime = System.currentTimeMillis();
sysOperLog.setCostTime(endTime - startTime);
iSysOperLogService.insertOperlog(sysOperLog);
return R.fail("明细不能为空");
}
@ -91,8 +122,10 @@ public class quotJswController extends BaseController {
quotMaterial.setMatMatprice(model.getMatMatprice());
quotMaterial.setMatPrice(model.getMatPrice());
quotMaterial.setMatQuotPrice(model.getMatQuotPrice());
quotMaterial.setMatQuotTp(model.getMatQuotTp());
quotMaterial.setMatQuotAllPrice(model.getMatQuotAllPrice());
quotMaterial.setMatMatpriceDiff(model.getMatMatpriceDiff());
quotMaterial.setXh(model.getXh());
quotMaterial.setIndex(model.getIndex());
qmaterials.add(quotMaterial);
}
@ -100,9 +133,17 @@ public class quotJswController extends BaseController {
q.setQuotMaterialList(qmaterials);
quotService.updateQuot(q);
}catch(Exception e){
sysOperLog.setStatus(1);
long endTime = System.currentTimeMillis();
sysOperLog.setCostTime(endTime - startTime);
iSysOperLogService.insertOperlog(sysOperLog);
return R.fail(e.getMessage());
}
sysOperLog.setStatus(0);
long endTime = System.currentTimeMillis();
sysOperLog.setCostTime(endTime - startTime);
iSysOperLogService.insertOperlog(sysOperLog);
return R.ok();
}
}

View File

@ -7,6 +7,10 @@ import java.math.BigDecimal;
@ApiModel(value = "quotMaterialModel", description = "报价单产品明细")
public class quotMaterialModel {
@ApiModelProperty("序号")
private Integer xh;//序号
@ApiModelProperty("行号")
private Integer index;//行号
@ -40,12 +44,18 @@ public class quotMaterialModel {
@ApiModelProperty("报价")
private BigDecimal matQuotPrice;//报价
@ApiModelProperty("特批下点")
private BigDecimal matQuotTp;//特批下点
@ApiModelProperty("报价金额")
private BigDecimal matQuotAllPrice;//报价金额
@ApiModelProperty("料价价差率")
private BigDecimal matMatpriceDiff;//料价价差率
public Integer getXh() { return xh; }
public void setXh(Integer xh) { this.xh = xh; }
public Integer getIndex() { return index; }
public void setIndex(Integer index) { this.index = index; }
@ -119,6 +129,9 @@ public class quotMaterialModel {
this.matQuotPrice = matQuotPrice;
}
public BigDecimal getMatQuotTp() { return matQuotTp; }
public void setMatQuotTp(BigDecimal matQuotTp) { this.matQuotTp = matQuotTp; }
public BigDecimal getMatQuotAllPrice() {
return matQuotAllPrice;
}

View File

@ -56,14 +56,19 @@ public class QuotMaterial extends BaseEntity
/** 报价 */
private BigDecimal matQuotPrice;
/** 特批下点 */
private BigDecimal matQuotTp;
/** 报价金额 */
private BigDecimal matQuotAllPrice;
/** 料价价差率 */
private BigDecimal matMatpriceDiff;
/** 排序 */
private Integer index;//序号
/** 序号 */
private Integer xh;//序号
/** 行号 */
private Integer index;//行号
/** */
private String quotId;
@ -137,12 +142,18 @@ public class QuotMaterial extends BaseEntity
public BigDecimal getMatQuotPrice() { return matQuotPrice; }
public void setMatQuotPrice(BigDecimal matQuotPrice) { this.matQuotPrice = matQuotPrice; }
public BigDecimal getMatQuotTp() { return matQuotTp; }
public void setMatQuotTp(BigDecimal matQuotTp) { this.matQuotTp = matQuotTp; }
public BigDecimal getMatQuotAllPrice() { return matQuotAllPrice; }
public void setMatQuotAllPrice(BigDecimal matQuotAllPrice) { this.matQuotAllPrice = matQuotAllPrice; }
public BigDecimal getMatMatpriceDiff() { return matMatpriceDiff; }
public void setMatMatpriceDiff(BigDecimal matMatpriceDiff) { this.matMatpriceDiff = matMatpriceDiff; }
public Integer getXh() { return xh; }
public void setXh(Integer xh) { this.xh = xh; }
public Integer getIndex() { return index; }
public void setIndex(Integer index) { this.index = index; }

View File

@ -36,6 +36,12 @@ public interface QuotMapper
*/
public List<Quot> selectQuotList(Quot quot);
/**
* 统计当天协助中已协助的报价单数量
* @return
*/
String selectQuotListCount();
/**
* 新增报价
*
@ -115,4 +121,5 @@ public interface QuotMapper
* @return
*/
String checkExistQuot(@Param("quotSalesmanCode") String username, @Param("quotCustomerBm") String quotCustomerBm, @Param("quotProject") String quotProject);
}

View File

@ -37,6 +37,12 @@ public interface IQuotService
*/
public List<Quot> selectQuotList(Quot quot);
/**
* 统计当天协助中已协助的报价单数量
* @return
*/
String selectQuotListCount();
/**
* 新增报价
*

View File

@ -63,6 +63,15 @@ public class QuotServiceImpl implements IQuotService
return quotMapper.selectQuotList(quot);
}
/**
* 统计当天协助中已协助的报价单数量
* @return
*/
@Override
public String selectQuotListCount() {
return quotMapper.selectQuotListCount();
}
/**
* 新增报价
*

View File

@ -139,6 +139,10 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
order by a.update_time desc
</select>
<select id="selectQuotListCount" resultType="String">
select count(1) from quot where quot_approval_status in ('1','2') and CONVERT(DATE, quot_inquiry_date) = CONVERT(DATE, GETDATE())
</select>
<select id="selectQuotByQuotId" parameterType="String" resultMap="QuotQuotMaterialResult">
select a.quot_id, a.quot_code,a.quot_jsw_code, a.quot_salesman_code, a.quot_salesman_bm, a.quot_salesman_name, a.quot_customer_bm,a.quot_customer_name,
a.quot_salesman_dept_id, a.quot_salesman_dept_name, a.quot_address, a.quot_phone, a.quot_inquiry_date,
@ -358,9 +362,9 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
</delete>
<insert id="batchQuotMaterial">
insert into quot_material( mat_id, mat_xingh, mat_guig, mat_diany,mat_standard, mat_danw, mat_sl,mat_remark, quot_id,number,mat_matprice,mat_price,mat_quot_price,mat_quot_allPrice,mat_matprice_diff) values
insert into quot_material( mat_id, mat_xingh, mat_guig, mat_diany,mat_standard, mat_danw, mat_sl,mat_remark, quot_id,xh,number,mat_matprice,mat_price,mat_quot_price,mat_quot_tp,mat_quot_allPrice,mat_matprice_diff) values
<foreach item="item" index="index" collection="list" separator=",">
( #{item.matId}, #{item.matXingh}, #{item.matGuig}, #{item.matDiany}, #{item.matStandard}, #{item.matDanw}, cast(#{item.matSl,jdbcType=DECIMAL} as decimal(18,3)),#{item.matRemark}, #{item.quotId}, #{item.index}, cast(#{item.matMatprice,jdbcType=DECIMAL} as decimal(18,3)), cast(#{item.matPrice,jdbcType=DECIMAL} as decimal(18,3)), cast(#{item.matQuotPrice,jdbcType=DECIMAL} as decimal(18,3)), cast(#{item.matQuotAllPrice,jdbcType=DECIMAL} as decimal(18,3)), cast(#{item.matMatpriceDiff,jdbcType=DECIMAL} as decimal(18,3)))
( #{item.matId}, #{item.matXingh}, #{item.matGuig}, #{item.matDiany}, #{item.matStandard}, #{item.matDanw}, cast(#{item.matSl,jdbcType=DECIMAL} as decimal(18,3)),#{item.matRemark}, #{item.quotId}, #{item.xh}, #{item.index}, cast(#{item.matMatprice,jdbcType=DECIMAL} as decimal(18,3)), cast(#{item.matPrice,jdbcType=DECIMAL} as decimal(18,3)), cast(#{item.matQuotPrice,jdbcType=DECIMAL} as decimal(18,3)), cast(#{item.matQuotTp,jdbcType=DECIMAL} as decimal(18,3)),cast(#{item.matQuotAllPrice,jdbcType=DECIMAL} as decimal(18,3)), cast(#{item.matMatpriceDiff,jdbcType=DECIMAL} as decimal(18,3)))
</foreach>
</insert>