This commit is contained in:
JIAL 2024-06-14 15:13:44 +08:00
commit 2d988a2a6a
67 changed files with 2848 additions and 459 deletions

View File

@ -1,5 +1,9 @@
#for tests only !
<<<<<<< HEAD
#Fri Jun 14 15:11:13 CST 2024
=======
#Fri Jun 14 11:47:35 CST 2024
>>>>>>> 4f24577e27615af0f5c59b77a49deac1fa915200
jco.destination.pool_capacity=10
jco.client.lang=ZH
jco.client.ashost=172.19.0.120
@ -7,5 +11,9 @@ jco.client.saprouter=
jco.client.user=RFC
jco.client.sysnr=00
jco.destination.peak_limit=10
<<<<<<< HEAD
jco.client.passwd=654321
=======
jco.client.passwd=fIM!UgIY[[%*5IWWy6w`}PO$6)+{K)R`9,$_P^3ve}26(Qf|
>>>>>>> 4f24577e27615af0f5c59b77a49deac1fa915200
jco.client.client=300

View File

@ -113,6 +113,13 @@
<systemPath>${basedir}/src/main/resources/lib/dom4j-1.6.1.jar</systemPath>
<scope>system</scope>
</dependency>
<dependency>
<groupId>ngdbc</groupId>
<artifactId>ngdbc</artifactId>
<version>1.6.1</version>
<systemPath>${basedir}/src/main/resources/lib/ngdbc-0.0.1-SNAPSHOT.jar</systemPath>
<scope>system</scope>
</dependency>
<dependency>
<groupId>org.freemarker</groupId>
<artifactId>freemarker</artifactId>

View File

@ -22,6 +22,7 @@ import com.ruoyi.system.service.ISysConfigService;
import com.ruoyi.system.service.ISysNoticeService;
import com.ruoyi.web.utils.IdUtils;
import com.ruoyi.web.utils.SapFunction.SapRfcUtils;
import com.ruoyi.web.utils.SapHana.SapHanaUtils;
import com.ruoyi.web.utils.SendNotice.NoticeUtil;
import com.ruoyi.web.utils.qcc.HttpHelper;
import com.ruoyi.web.utils.qcc.QiChaChaUtil;
@ -141,7 +142,15 @@ public class CustomerController extends BaseController
public AjaxResult getReturnUpdateInfo(@PathVariable("cusId") String cusId)
{
Customer customer = customerService.selectCustomerByCusId(cusId);
customer.setCusApprovalStatus("1");// 提交状态设置为 审核中
if("2".equals(customer.getCusApprovalStatus())){
customer.setCusApprovalStatus("1");// 提交状态设置为 审核中
}else if("0".equals(customer.getCusApprovalStatus())){
return error("该客户当前状态为【待提交】状态,无法修改");
}else if("1".equals(customer.getCusApprovalStatus())){
return error("该客户当前状态为【审批中】状态,无法修改");
}else if("3".equals(customer.getCusApprovalStatus())){
return error("该报价单当前状态为【已驳回】状态,无法修改");
}
return success(customer);
}
@ -154,7 +163,9 @@ public class CustomerController extends BaseController
public AjaxResult add(@RequestBody Customer customer)
{
customer.setCusId(UUID.fastUUID().toString());
customer.setCusCode(IdUtils.createNo("KH_",2));
//customer.setCusCode(IdUtils.createNo("KH_",0));
String cusCode = customerService.getCode("KH");
customer.setCusCode(cusCode);
customer.setCreateBy(getUsername());
return toAjax(customerService.insertCustomer(customer));
}
@ -178,13 +189,21 @@ public class CustomerController extends BaseController
@Log(title = "客户信息提交", businessType = BusinessType.OTHER)
@PostMapping("/commitCustomer")
public AjaxResult commitCustomer(@RequestBody Customer customer) {
//校验客户名-税号 SAP是否存在
Boolean isExist = SapHanaUtils.isExist(customer.getCusName(),customer.getCusVatNo());
if(isExist){
return error("已存在该客户,请勿重复提交");
}
String cus_id = customer.getCusId();
customer.setUpdateBy(getUsername());
customer.setCusApprovalStatus("1");//客户提交 状态设置为 审核中
if(StringUtils.isEmpty(cus_id)){
customer.setCusId(UUID.fastUUID().toString());
customer.setCusCode(IdUtils.createNo("KH_",2));
//customer.setCusCode(IdUtils.createNo("KH_",0));
String cusCode = customerService.getCode("KH");
customer.setCusCode(cusCode);
customer.setCreateBy(getUsername());
customerService.insertCustomer(customer);
sendNotice(customer);//发送消息至数据组
@ -222,12 +241,19 @@ public class CustomerController extends BaseController
@PostMapping("/commitSAPCustomer")
public AjaxResult commitSAPCustomer(@RequestBody Customer customer)
{
//校验客户名-税号 SAP是否存在
Boolean isExist = SapHanaUtils.isExist(customer.getCusName(),customer.getCusVatNo());
if(isExist){
return error("已存在该客户,请勿重复提交");
}
if(StringUtils.isNotEmpty(customer.getCusId())){// 数据组 提交业务员创建的客户数据提交SAP
customer.setUpdateBy(getUsername());
customer.setCusApprovalStatus("2");//客户提交 状态设置为 已审核
}else{// 数据组创建的客户数据提交SAP
customer.setCusCode(IdUtils.createNo("KH_",2));
//customer.setCusCode(IdUtils.createNo("KH_",0));
String cusCode = customerService.getCode("KH");
customer.setCusCode(cusCode);
customer.setCreateBy(getUsername());
customer.setCusApprovalStatus("2");//客户提交 状态设置为 已审核
}
@ -321,7 +347,7 @@ public class CustomerController extends BaseController
@PreAuthorize("@ss.hasPermi('customer:customer:qcclist')")
@PostMapping("/checkQccCount")
public AjaxResult checkQccCount(){
String qccCusCount = configService.selectConfigByKey("qcc:cus:count");
String qccCusCount = configService.selectConfigByKey("qcc.cus.count");
Integer searchCount = redisCache.getCacheObject(getCacheKey(getUsername()));
if (searchCount == null){
searchCount = 1;

View File

@ -3,11 +3,15 @@ package com.ruoyi.web.controller.priceVerification;
import java.util.List;
import javax.servlet.http.HttpServletResponse;
import com.ruoyi.common.constant.WebsocketConst;
import com.ruoyi.common.core.domain.model.LoginUser;
import com.ruoyi.common.utils.DateUtils;
import com.ruoyi.common.utils.StringUtils;
import com.ruoyi.quot.domain.Quot;
import com.ruoyi.quot.service.IQuotService;
import com.ruoyi.system.service.ISysNoticeService;
import com.ruoyi.technicalConfirm.domain.QuotJsqr;
import com.ruoyi.web.utils.SendNotice.NoticeUtil;
import org.springframework.security.access.prepost.PreAuthorize;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
@ -43,6 +47,9 @@ public class QuotHjController extends BaseController
@Autowired
private IQuotService quotService;
@Autowired
private ISysNoticeService noticeService;
/**
* 查询报价单-核价单列表
*/
@ -128,9 +135,22 @@ public class QuotHjController extends BaseController
quot.setQuotHjApprovalStatus("2");//报价单-核价单 状态设置为 已协助
quotService.updateQuot(quot);
sendNoticeToQuot(quotHj);// 发送给提醒
return success();
}
/**
* 发送信息-核价协助提交报价组
* @param quotHj
*/
private void sendNoticeToQuot(QuotHj quotHj){
//推送消息
LoginUser loginUser = getLoginUser();//当前登陆者
//获取发送人-报价组
List<String> userIds = noticeService.getSendEmp(WebsocketConst.MSG_SEND_QUOT_BJZ);
NoticeUtil.sendNoticesBusiness(loginUser,"有报价单已完成核价协助","单号:"+quotHj.getQuotCode(),userIds);
}
/**
* 报价单-核价单 驳回
*/

View File

@ -1,21 +1,27 @@
package com.ruoyi.web.controller.quot;
import java.util.ArrayList;
import java.util.List;
import java.util.concurrent.TimeUnit;
import java.util.Map;
import javax.servlet.http.HttpServletResponse;
import com.alibaba.fastjson.JSON;
import com.ruoyi.common.constant.WebsocketConst;
import com.ruoyi.common.core.domain.entity.SysRole;
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.SecurityUtils;
import com.ruoyi.common.utils.StringUtils;
import com.ruoyi.common.utils.file.FileUploadUtils;
import com.ruoyi.common.utils.file.MinioUtil;
import com.ruoyi.common.utils.http.HttpUtils;
import com.ruoyi.common.utils.sign.Base64;
import com.ruoyi.common.utils.uuid.UUID;
import com.ruoyi.priceVerification.domain.QuotHj;
import com.ruoyi.priceVerification.service.IQuotHjService;
import com.ruoyi.quot.domain.QuotFile;
import com.ruoyi.quot.domain.QuotMaterial;
import com.ruoyi.quot.domain.*;
import com.ruoyi.quot.domain.jsw.*;
import com.ruoyi.quot.service.IQuotFileService;
import com.ruoyi.system.service.ISysConfigService;
import com.ruoyi.system.service.ISysNoticeService;
@ -31,7 +37,6 @@ import com.ruoyi.common.annotation.Log;
import com.ruoyi.common.core.controller.BaseController;
import com.ruoyi.common.core.domain.AjaxResult;
import com.ruoyi.common.enums.BusinessType;
import com.ruoyi.quot.domain.Quot;
import com.ruoyi.quot.service.IQuotService;
import com.ruoyi.common.utils.poi.ExcelUtil;
import com.ruoyi.common.core.page.TableDataInfo;
@ -94,6 +99,18 @@ public class QuotController extends BaseController
util.exportExcel(response, list, "报价数据");
}
/**
* 导出报价明细列表
*/
@PostMapping("/exportMaterial")
public void exportMaterial(HttpServletResponse response, Quot quot)
{
Quot q = quotService.selectQuotByQuotId(quot.getQuotId());
List<QuotMaterial> list = q.getQuotMaterialList();
ExcelUtil<QuotMaterial> util = new ExcelUtil<QuotMaterial>(QuotMaterial.class);
util.exportExcel(response, list, "报价明细数据");
}
/**
* 报价单打印状态修改
*/
@ -126,8 +143,17 @@ public class QuotController extends BaseController
public AjaxResult getReturnUpdateInfo(@PathVariable("quotId") String quotId)
{
Quot quot = quotService.selectQuotByQuotId(quotId);
quot.setQuotApprovalStatus("1");// 提交状态设置为 协助中
quotService.updateQuot(quot);
if("2".equals(quot.getQuotApprovalStatus())){
quot.setQuotApprovalStatus("1");// 提交状态设置为 协助中
quotService.updateQuot(quot);
}else if("0".equals(quot.getQuotApprovalStatus())){
return error("该报价单当前状态为【待提交】状态,无法修改");
}else if("1".equals(quot.getQuotApprovalStatus())){
return error("该报价单当前状态为【协助中】状态,无法修改");
}else if("3".equals(quot.getQuotApprovalStatus())){
return error("该报价单当前状态为【已驳回】状态,无法修改");
}
return success(quot);
}
@ -165,10 +191,29 @@ public class QuotController extends BaseController
@PostMapping
public AjaxResult add(@RequestBody Quot quot)
{
// 获取用户角色 --判断是否是核价组角色
Boolean hjRoleFlag = false;
List<SysRole> roles = SecurityUtils.getLoginUser().getUser().getRoles();
for(SysRole sysRole:roles){
String roleKey = sysRole.getRoleKey();
if("PRICE_VERIFICATION".equals(roleKey) || "QUOT".equals(roleKey)){
hjRoleFlag = true;
break;
}
}
quot.setQuotId(UUID.fastUUID().toString());
quot.setQuotCode(IdUtils.createNo("BJD_",2));
quot.setCreateBy(getUsername());
quot.setQuotSalesmanCode(getUsername());
//quot.setQuotCode(IdUtils.createNo("BJD_",0));
String quotCode = quotService.getCode("BJD");
quot.setQuotCode(quotCode);
if(hjRoleFlag){
quot.setCreateBy(quot.getQuotSalesmanCode());
}else{
quot.setCreateBy(getUsername());
}
//quot.setQuotSalesmanCode(getUsername());
quot.setUpdateBy(getUsername());
quotService.insertQuot(quot);
return success(quot);
@ -182,7 +227,21 @@ public class QuotController extends BaseController
@PutMapping
public AjaxResult edit(@RequestBody Quot quot)
{
quot.setUpdateBy(getUsername());
// 获取用户角色 --判断是否是核价组角色
Boolean hjRoleFlag = false;
List<SysRole> roles = SecurityUtils.getLoginUser().getUser().getRoles();
for(SysRole sysRole:roles){
String roleKey = sysRole.getRoleKey();
if("PRICE_VERIFICATION".equals(roleKey) || "QUOT".equals(roleKey)){
hjRoleFlag = true;
break;
}
}
if(hjRoleFlag){
quot.setUpdateBy(quot.getQuotSalesmanCode());
}else{
quot.setUpdateBy(getUsername());
}
return toAjax(quotService.updateQuot(quot));
}
@ -285,11 +344,23 @@ 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("当前报价量已达极限,无法继续提供报价单");
// 获取用户角色 --判断是否是核价组角色
Boolean hjRoleFlag = false;
List<SysRole> roles = SecurityUtils.getLoginUser().getUser().getRoles();
for(SysRole sysRole:roles){
String roleKey = sysRole.getRoleKey();
if("PRICE_VERIFICATION".equals(roleKey) || "QUOT".equals(roleKey)){
hjRoleFlag = true;
break;
}
}
if(!hjRoleFlag){
// 每天限制提交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();
@ -299,20 +370,37 @@ public class QuotController extends BaseController
quot.setQuotInquiryDate(DateUtils.getNowDate());//报价单 询价日期设置为 当前日期
// 校验 是否已有重复报价单客户+项目名
Boolean flag = quotService.checkExistQuot(getUsername(),quot.getQuotCustomerBm(),quot.getQuotProject());
Boolean flag = false;
if(!hjRoleFlag){
flag = quotService.checkExistQuot(getUsername(),quot.getQuotCustomerBm(),quot.getQuotProject());
}else{
flag = quotService.checkExistQuot(quot.getQuotSalesmanCode(),quot.getQuotCustomerBm(),quot.getQuotProject());
}
if(flag){
return error("存在相同客户且项目名称一致的报价单,无法提交");
}
if(StringUtils.isEmpty(quot_id)){
quot.setQuotId(UUID.fastUUID().toString());
quot.setQuotCode(IdUtils.createNo("BJD_",2));
quot.setCreateBy(getUsername());
quot.setQuotSalesmanCode(getUsername());
//quot.setQuotCode(IdUtils.createNo("BJD_",0));
String quotCode = quotService.getCode("BJD");
quot.setQuotCode(quotCode);
if(hjRoleFlag){
quot.setCreateBy(quot.getQuotSalesmanCode());
}else{
quot.setCreateBy(getUsername());
}
//quot.setQuotSalesmanCode(getUsername());
quotService.insertQuot(quot);
sendNoticeToBjz(quot);
return success();
}else{
if(hjRoleFlag){
quot.setUpdateBy(quot.getQuotSalesmanCode());
}else{
quot.setUpdateBy(getUsername());
}
quotService.updateQuot(quot);
sendNoticeToBjz(quot);
return success();
@ -352,7 +440,9 @@ public class QuotController extends BaseController
QuotJsqr quotJsqr = new QuotJsqr();
String quotJsqrId = UUID.fastUUID().toString();
quotJsqr.setQuotJsqrId(quotJsqrId);
quotJsqr.setQuotJsqrCode(IdUtils.createNo("BJD_JSQR_",2));
//quotJsqr.setQuotJsqrCode(IdUtils.createNo("BJD_JSQR_",0));
String quotJsqrCode = quotService.getCode("JSQR");
quotJsqr.setQuotJsqrCode(quotJsqrCode);
//特缆低压中压其他 协助状态设置
if(quotJsxzGroup.indexOf("TL")!=-1){
@ -417,7 +507,10 @@ public class QuotController extends BaseController
QuotHj quotHj = new QuotHj();
String quotHjId = UUID.fastUUID().toString();
quotHj.setQuotHjId(quotHjId);
quotHj.setQuotHjCode(IdUtils.createNo("BJD_HJ_",2));
//quotHj.setQuotHjCode(IdUtils.createNo("BJD_HJ_",0));
String quotHjCode = quotService.getCode("HJD");
quotHj.setQuotHjCode(quotHjCode);
quotHj.setQuotHjPricingType("10");//核价类型 设置为 报价核价
quotHj.setCreateBy(getUsername());
@ -441,7 +534,120 @@ public class QuotController extends BaseController
@PostMapping("/commitJswQuot")
public AjaxResult commitJswQuot(@RequestBody Quot quot)
{
// TODO 对接金思维接口
String quotJswApprovalStatus = quot.getQuotJswApprovalStatus();
if("2".equals(quotJswApprovalStatus)){//重新调点
//==============================账户认证==================================
QuotJswUser quotJswUser = new QuotJswUser("JNBJPT","1q2w3e","S","");
String quotJswUserJson = JSON.toJSONString(quotJswUser);
Map<String,String> res = HttpUtils.sendPostJson("http://price.jncable.com.cn:7778/GTHINKING/AjaxService/N_MISPRO/100208057.ashx/Login",quotJswUserJson,"");
String cookie = res.get("cookie");
System.out.println("cookie======"+cookie);
String QuotJswUserResultJson = res.get("res");
QuotJswUserResult quotJswUserResult = JSON.parseObject(QuotJswUserResultJson, QuotJswUserResult.class);
if(!quotJswUserResult.getSuccess()){
return error(quotJswUserResult.getErrorMessage());
}
String quotJswCode = quot.getQuotJswCode();
String returnTdJson = "{\"bjdid\":\""+quotJswCode+"\"}";
Map<String,String> res2 = HttpUtils.sendPostJson("http://price.jncable.com.cn:7778/GTHINKING/AjaxService/U20231485_N_XLXSBJ/100860101.ashx/DispatchBJD",returnTdJson,cookie);
String returnTdResultJson = res2.get("res");
QuotJswUserResult quotJswUserResult2 = JSON.parseObject(returnTdResultJson, QuotJswUserResult.class);
if(!quotJswUserResult2.getSuccess()){
return error(quotJswUserResult2.getMessage());
}
}else{
// ==============================对接金思维接口==============================
//==============================账户认证==================================
QuotJswUser quotJswUser = new QuotJswUser("JNBJPT","1q2w3e","S","");
String quotJswUserJson = JSON.toJSONString(quotJswUser);
Map<String,String> res = HttpUtils.sendPostJson("http://price.jncable.com.cn:7778/GTHINKING/AjaxService/N_MISPRO/100208057.ashx/Login",quotJswUserJson,"");
String cookie = res.get("cookie");
System.out.println("cookie======"+cookie);
String QuotJswUserResultJson = res.get("res");
QuotJswUserResult quotJswUserResult = JSON.parseObject(QuotJswUserResultJson, QuotJswUserResult.class);
if(!quotJswUserResult.getSuccess()){
return error(quotJswUserResult.getErrorMessage());
}
//==============================报价单信息对接==================================
QuotJswInfo quotJswInfo = new QuotJswInfo();
quotJswInfo.setQuotCode(quot.getQuotCode());
quotJswInfo.setXsy(quot.getQuotSalesmanName());
quotJswInfo.setXsyid(quot.getQuotSalesmanCode());
quotJswInfo.setKh(quot.getQuotCustomerName());
quotJswInfo.setKhid(quot.getQuotCustomerBm());
quotJswInfo.setBz(quot.getQuotQuotationRequire());
List<QuotJswMaterial> quotJswMaterials = new ArrayList<>();
QuotJswMaterial quotJswMaterial = null;
for(QuotMaterial m:quot.getQuotMaterialList()){
quotJswMaterial = new QuotJswMaterial();
quotJswMaterial.setMatXingh(m.getMatXingh());
quotJswMaterial.setMatGuig(m.getMatGuig());
quotJswMaterial.setMatDiany(m.getMatDiany());
quotJswMaterial.setMatStandard(m.getMatStandard());
quotJswMaterial.setMatSl(m.getMatSl());
quotJswMaterial.setMatDanw(m.getMatDanw());
quotJswMaterial.setMatRemark(m.getMatRemark());
quotJswMaterials.add(quotJswMaterial);
}
quotJswInfo.setQuotMaterial(quotJswMaterials);
QuotJsw quotJsw = new QuotJsw();
quotJsw.setRecBJDInfo(quotJswInfo);
String quotJson = JSON.toJSONString(quotJsw);
//调用金思维接口上传报价单信息
Map<String,String> res2 = HttpUtils.sendPostJson("http://price.jncable.com.cn:7778/GTHINKING/AjaxService/U20231485_N_XLXSBJ/100860101.ashx/RecBJDfromJN",quotJson,cookie);
String QuotJswResultJson = res2.get("res");
QuotJswResult quotJswResultObject = JSON.parseObject(QuotJswResultJson, QuotJswResult.class);
if(!quotJswResultObject.getSuccess()){
return error(quotJswResultObject.getErrorMessage());
}
//==============================附件对接==================================
List<QuotFile> files = new ArrayList<>();
QuotFile quotFile = new QuotFile();
quotFile.setRelationId(quot.getQuotId());// 报价单ID
quotFile.setFileType("quotXjFile");// 附件类型-询价清单附件
List<QuotFile> quotXjFiles = quotFileService.selectQuotFileList(quotFile);
if(quotXjFiles!=null&&quotXjFiles.size()>0){
files.addAll(quotXjFiles);
}
quotFile = new QuotFile();
quotFile.setRelationId(quot.getQuotId());// 报价单ID
quotFile.setFileType("quotJsgfFile");// 附件类型-技术附件
List<QuotFile> quotJsgfFiles = quotFileService.selectQuotFileList(quotFile);
if(quotJsgfFiles!=null&&quotJsgfFiles.size()>0){
files.addAll(quotJsgfFiles);
}
QuotJswFiles quotJswFiles = null;
QuotJswFile quotJswFile = new QuotJswFile();
quotJswFile.setBjdid(quotJswResultObject.getKey());
List<QuotJswFiles> quotJswFileList = new ArrayList<QuotJswFiles>();
for(QuotFile qf:files){
quotJswFiles = new QuotJswFiles();
quotJswFiles.setFileName(qf.getFileName());
quotJswFiles.setFileData(Base64.fileBase64(qf.getFileUrl()));
quotJswFileList.add(quotJswFiles);
}
quotJswFile.setFjdata(quotJswFileList);
String fileJson = JSON.toJSONString(quotJswFile);
//调用金思维接口上传附件
if(files!=null&&files.size()>0){
Map<String,String> res3 = HttpUtils.sendPostJson("http://price.jncable.com.cn:7778/GTHINKING/AjaxService/U20231485_N_XLXSBJ/100860101.ashx/UploadFile",fileJson,cookie);
String QuotJswResultFileJson = res3.get("res");
QuotJswResult quotJswResult = JSON.parseObject(QuotJswResultFileJson, QuotJswResult.class);
if(!quotJswResult.getSuccess()){
return error(quotJswResult.getErrorMessage());
}
}
}
quot.setQuotJswApprovalStatus("1");// 更新金思维提交状态为 协助中
quotService.updateQuot(quot);
return success();
@ -455,8 +661,35 @@ public class QuotController extends BaseController
@PostMapping("/commitOAQuot")
public AjaxResult commitOAQuot(@RequestBody Quot quot)
{
// 报价单提交OA,插入中间表 sys_oa_quot sys_oa_quot_material
SysOaQuot sysOaQuot = new SysOaQuot();
SysOaQuot oauser = quotService.selectOAUserByUserName(getUsername());// 查询OA用户
if(oauser==null){
return error("该账户:"+getUsername()+"在OA中不存在");
}
sysOaQuot.setUserId(oauser.getUserId());
sysOaQuot.setDepartmentId(oauser.getUserId());
sysOaQuot.setDepartmentId(oauser.getDepartmentId());
sysOaQuot.setSubmissionTime(DateUtils.getDate());
sysOaQuot.setQuotId(UUID.fastUUID().toString());
sysOaQuot.setQuotCode(quot.getQuotCode());
sysOaQuot.setQuotSalesmanName(quot.getQuotSalesmanName());
sysOaQuot.setQuotCustomerName(quot.getQuotCustomerName());
sysOaQuot.setQuotAddress(quot.getQuotAddress());
sysOaQuot.setQuotPhone(quot.getQuotPhone());
sysOaQuot.setQuotInquiryDate(quot.getQuotInquiryDate());
sysOaQuot.setQuotProject(quot.getQuotProject());
sysOaQuot.setQuotQuotationRequire(quot.getQuotQuotationRequire());
sysOaQuot.setQuotLvPrice(quot.getQuotLvPrice());
sysOaQuot.setQuotTongPrice(quot.getQuotTongPrice());
sysOaQuot.setQuotMatpriceDiff(quot.getQuotMatpriceDiff());
sysOaQuot.setCreateTime(DateUtils.getNowDate());
sysOaQuot.setIsFinish("0");// 报价已提交OA审批中
sysOaQuot.setMaterials(quot.getQuotMaterialList());
quotService.insertSysOAQuot(sysOaQuot);
// TODO 对接OA
quot.setQuotOAApprovalStatus("1");// 更新OA提交状态为 审批中
quotService.updateQuot(quot);
return success();
@ -543,6 +776,9 @@ public class QuotController extends BaseController
return error("报价信息-反馈说明不能为空");
}
quot.setQuotApprovalStatus("3");
quot.setQuotQuotationDate(DateUtils.getNowDate());//报价单-报价日期设置为 当前日期
quot.setQuotCheckUserName(getUsername());
quotService.updateQuot(quot);
return success();
}

View File

@ -1,5 +1,6 @@
package com.ruoyi.web.controller.redBook;
import com.alibaba.fastjson.JSONArray;
import com.ruoyi.common.annotation.DataSource;
import com.ruoyi.common.annotation.Log;
import com.ruoyi.common.constant.CacheConstants;
@ -14,6 +15,7 @@ import com.ruoyi.common.utils.StringUtils;
import com.ruoyi.common.utils.poi.ExcelUtil;
import com.ruoyi.common.utils.uuid.UUID;
import com.ruoyi.customer.domain.Customer;
import com.ruoyi.quot.domain.Quot;
import com.ruoyi.quot.domain.QuotMaterial;
import com.ruoyi.redBook.domain.*;
import com.ruoyi.redBook.service.IRedBookService;
@ -205,8 +207,9 @@ public class RedBookController extends BaseController
List<Product> list = new ArrayList<>();
String name_0 = product.getName_0();//型号
String model = product.getModel();//规格
if(!StringUtils.isEmpty(name_0) || !StringUtils.isEmpty(model) ){
if(!StringUtils.isEmpty(name_0)){
if(!StringUtils.isBlank(name_0) || !StringUtils.isBlank(model) ){
if(!StringUtils.isBlank(name_0)){
name_0 = name_0.replace(" ","");
name_0 = name_0.toUpperCase();
}
list = redBookService.handleSearchData(name_0,model);
@ -226,7 +229,9 @@ public class RedBookController extends BaseController
{
if(StringUtils.isEmpty(quot.getQuot_id())){
quot.setQuot_id(UUID.fastUUID().toString());
quot.setQuotCode(IdUtils.createNo("BJD_",2));
//quot.setQuotCode(IdUtils.createNo("BJD_",0));
String quotCode = redBookService.getCode("RB_BJD");
quot.setQuotCode(quotCode);
quot.setCreateBy(getUsername());
redBookService.insertOAQuot(quot);
}else{
@ -303,6 +308,26 @@ public class RedBookController extends BaseController
for(OAQuotProductTemplate temp:tempList){
temp.setIndex(index);
temp.setRbUid(rbUid);
String name_1 = temp.getName_1();
if(StringUtils.isNotBlank(name_1)){
name_1 = name_1.replace(" ","");
name_1 = name_1.toUpperCase();
temp.setName_1(name_1);
}
String spec = temp.getSpec();
if(StringUtils.isNotBlank(spec)){
spec = spec.replace(" ","");
temp.setSpec(spec);
}
String voltage = temp.getVoltage();
if(StringUtils.isNotBlank(voltage)){
voltage = voltage.replace(" ","");
voltage = voltage.toUpperCase();
}
temp.setVoltage(StringUtils.isBlank(voltage)?"0.6/1KV":voltage);
index++;
}
@ -454,4 +479,13 @@ public class RedBookController extends BaseController
}
return toAjax(redBookService.deleteQuotsByQuotId(quotId));
}
@PostMapping("/exportProduct")
public void exportMaterial(HttpServletResponse response, @RequestParam("selectedResultData") String selectedResultData)
{
List<OAQuotProduct> list = JSONArray.parseArray(selectedResultData, OAQuotProduct.class);
ExcelUtil<OAQuotProduct> util = new ExcelUtil<OAQuotProduct>(OAQuotProduct.class);
util.exportExcel(response, list, "报价明细数据");
}
}

View File

@ -2,14 +2,18 @@ package com.ruoyi.web.controller.technicalConfirm;
import javax.servlet.http.HttpServletResponse;
import com.ruoyi.common.constant.WebsocketConst;
import com.ruoyi.common.core.domain.model.LoginUser;
import com.ruoyi.common.utils.DateUtils;
import com.ruoyi.common.utils.StringUtils;
import com.ruoyi.common.utils.poi.ExcelUtil;
import com.ruoyi.quot.domain.Quot;
import com.ruoyi.quot.service.IQuotService;
import com.ruoyi.system.service.ISysNoticeService;
import com.ruoyi.technicalConfirm.domain.QuotJsqr;
import com.ruoyi.technicalConfirm.domain.QuotJsqrXzDetail;
import com.ruoyi.technicalConfirm.service.IQuotJsqrService;
import com.ruoyi.web.utils.SendNotice.NoticeUtil;
import org.springframework.security.access.prepost.PreAuthorize;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
@ -44,6 +48,9 @@ public class QuotJsqrController extends BaseController
@Autowired
private IQuotService quotService;
@Autowired
private ISysNoticeService noticeService;
/**
* 查询报价单-技术确认单列表
*/
@ -387,7 +394,21 @@ public class QuotJsqrController extends BaseController
return error("其他(防火、轨道、架空)协助还未完成");
}
quot.setQuotJsxzApprovalStatus("2");//报价单-技术协助状态 设置为 已协助
sendNoticeToQuot(quotJsqr);// 发送给提醒
}
return success(quotService.updateQuot(quot));
}
/**
* 发送信息-技术协助提交报价组
* @param quotJsqr
*/
private void sendNoticeToQuot(QuotJsqr quotJsqr){
//推送消息
LoginUser loginUser = getLoginUser();//当前登陆者
//获取发送人-报价组
List<String> userIds = noticeService.getSendEmp(WebsocketConst.MSG_SEND_QUOT_BJZ);
NoticeUtil.sendNoticesBusiness(loginUser,"有报价单已完成技术协助","单号:"+quotJsqr.getQuotCode(),userIds);
}
}

View File

@ -1,5 +1,6 @@
package com.ruoyi.web.controller.tool.quot;
import com.alibaba.fastjson.JSONArray;
import com.alibaba.fastjson2.JSON;
import com.ruoyi.common.annotation.Log;
import com.ruoyi.common.core.controller.BaseController;
@ -15,10 +16,7 @@ import com.ruoyi.system.service.ISysOperLogService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import org.springframework.web.bind.annotation.*;
import java.util.ArrayList;
import java.util.List;
@ -40,7 +38,7 @@ public class quotJswController extends BaseController {
{
// 接口调用记录
SysOperLog sysOperLog = new SysOperLog();
sysOperLog.setTitle("金思维回报价数据");
sysOperLog.setTitle("金思维报价数据");
sysOperLog.setOperParam(quotJson);
sysOperLog.setRequestMethod("POST");
sysOperLog.setOperTime(DateUtils.getNowDate());
@ -49,64 +47,121 @@ public class quotJswController extends BaseController {
try{
quotModel quot = JSON.parseObject(quotJson, quotModel.class);
if(quot==null){
String errMsg = "参数异常为空,同步失败";
sysOperLog.setStatus(1);
long endTime = System.currentTimeMillis();
sysOperLog.setCostTime(endTime - startTime);
sysOperLog.setErrorMsg(errMsg);
sysOperLog.setJsonResult(JSONArray.toJSONString(R.fail(errMsg)));
iSysOperLogService.insertOperlog(sysOperLog);
return R.fail("参数异常为空");
return R.fail(errMsg);
}
if(StringUtils.isBlank(quot.getQuotJswCode())){
String errMsg = "金思维报价单号为空,同步失败";
sysOperLog.setStatus(1);
long endTime = System.currentTimeMillis();
sysOperLog.setCostTime(endTime - startTime);
sysOperLog.setErrorMsg(errMsg);
sysOperLog.setJsonResult(JSONArray.toJSONString(R.fail(errMsg)));
iSysOperLogService.insertOperlog(sysOperLog);
return R.fail("金思维报价单号不能为空");
return R.fail(errMsg);
}
if(StringUtils.isBlank(quot.getQuotCode())){
String errMsg = "客户报价单号为空,同步失败";
sysOperLog.setStatus(1);
long endTime = System.currentTimeMillis();
sysOperLog.setCostTime(endTime - startTime);
sysOperLog.setErrorMsg(errMsg);
sysOperLog.setJsonResult(JSONArray.toJSONString(R.fail(errMsg)));
iSysOperLogService.insertOperlog(sysOperLog);
return R.fail("客户报价单号不能为空");
return R.fail(errMsg);
}
if(StringUtils.isBlank(quot.getQuotTongPrice())){
String errMsg = "铜价为空,同步失败";
sysOperLog.setStatus(1);
long endTime = System.currentTimeMillis();
sysOperLog.setCostTime(endTime - startTime);
sysOperLog.setErrorMsg(errMsg);
sysOperLog.setJsonResult(JSONArray.toJSONString(R.fail(errMsg)));
iSysOperLogService.insertOperlog(sysOperLog);
return R.fail("铜价不能为空");
return R.fail(errMsg);
}
if(StringUtils.isBlank(quot.getQuotLvPrice())){
String errMsg = "铝价为空,同步失败";
sysOperLog.setStatus(1);
long endTime = System.currentTimeMillis();
sysOperLog.setCostTime(endTime - startTime);
sysOperLog.setErrorMsg(errMsg);
sysOperLog.setJsonResult(JSONArray.toJSONString(R.fail(errMsg)));
iSysOperLogService.insertOperlog(sysOperLog);
return R.fail("铝价不能为空");
return R.fail(errMsg);
}
if(StringUtils.isBlank(quot.getQuotMatpriceDiff())){
String errMsg = "整单料价价差率为空,同步失败";
sysOperLog.setStatus(1);
long endTime = System.currentTimeMillis();
sysOperLog.setCostTime(endTime - startTime);
sysOperLog.setErrorMsg(errMsg);
sysOperLog.setJsonResult(JSONArray.toJSONString(R.fail(errMsg)));
iSysOperLogService.insertOperlog(sysOperLog);
return R.fail("整单料价价差率不能为空");
return R.fail(errMsg);
}
List<quotMaterialModel> materials = quot.getQuotMaterial();
if(materials==null || materials.size()==0){
String errMsg = "无明细数据,同步失败";
sysOperLog.setStatus(1);
long endTime = System.currentTimeMillis();
sysOperLog.setCostTime(endTime - startTime);
sysOperLog.setErrorMsg(errMsg);
sysOperLog.setJsonResult(JSONArray.toJSONString(R.fail(errMsg)));
iSysOperLogService.insertOperlog(sysOperLog);
return R.fail("明细不能为空");
return R.fail(errMsg);
}
// 更新报价单
String quotId = quotService.selectQuotByQuotCode(quot.getQuotCode());
if(StringUtils.isEmpty(quotId)){
String errMsg = "报价单号:"+quot.getQuotCode()+" 系统中不存在,同步失败";
sysOperLog.setStatus(1);
long endTime = System.currentTimeMillis();
sysOperLog.setCostTime(endTime - startTime);
sysOperLog.setErrorMsg(errMsg);
sysOperLog.setJsonResult(JSONArray.toJSONString(R.fail(errMsg)));
iSysOperLogService.insertOperlog(sysOperLog);
return R.fail(errMsg);
}
Quot q = quotService.selectQuotByQuotId(quotId);
String quotApprovalStatus = q.getQuotApprovalStatus();
if(!"1".equals(quotApprovalStatus)){
String errMsg = "报价单号:"+quot.getQuotCode()+" 非协助中状态,同步失败";
sysOperLog.setStatus(1);
long endTime = System.currentTimeMillis();
sysOperLog.setCostTime(endTime - startTime);
sysOperLog.setErrorMsg(errMsg);
sysOperLog.setJsonResult(JSONArray.toJSONString(R.fail(errMsg)));
iSysOperLogService.insertOperlog(sysOperLog);
return R.fail(errMsg);
}
String quotJswApprovalStatus = q.getQuotJswApprovalStatus();
if(!"1".equals(quotJswApprovalStatus)){
String errMsg = "报价单号:"+quot.getQuotCode()+" 金思维非协助中状态,同步失败";
sysOperLog.setStatus(1);
long endTime = System.currentTimeMillis();
sysOperLog.setCostTime(endTime - startTime);
sysOperLog.setErrorMsg(errMsg);
sysOperLog.setJsonResult(JSONArray.toJSONString(R.fail(errMsg)));
iSysOperLogService.insertOperlog(sysOperLog);
return R.fail(errMsg);
}
q.setQuotJswCode(quot.getQuotJswCode());
q.setQuotLvPrice(quot.getQuotLvPrice());
q.setQuotTongPrice(quot.getQuotTongPrice());
q.setQuotMatpriceDiff(quot.getQuotMatpriceDiff());
q.setQuotJswApprovalStatus("2");
List<QuotMaterial> qmaterials = new ArrayList<QuotMaterial>();
QuotMaterial quotMaterial = new QuotMaterial();
@ -133,16 +188,91 @@ public class quotJswController extends BaseController {
q.setQuotMaterialList(qmaterials);
quotService.updateQuot(q);
}catch(Exception e){
String errMsg = "同步报价数据接口异常,同步失败";
sysOperLog.setStatus(1);
long endTime = System.currentTimeMillis();
sysOperLog.setCostTime(endTime - startTime);
sysOperLog.setErrorMsg(errMsg);
sysOperLog.setJsonResult(JSONArray.toJSONString(R.fail(errMsg)));
iSysOperLogService.insertOperlog(sysOperLog);
return R.fail(e.getMessage());
return R.fail(errMsg);
}
sysOperLog.setStatus(0);
long endTime = System.currentTimeMillis();
sysOperLog.setCostTime(endTime - startTime);
sysOperLog.setJsonResult(R.ok().toString());
iSysOperLogService.insertOperlog(sysOperLog);
return R.ok();
}
@ApiOperation("更新金思维协助状态")
@PostMapping("/updateQuotJsw")
public R<String> updateQuotJsw(@RequestParam String quotCode) {
// 接口调用记录
SysOperLog sysOperLog = new SysOperLog();
sysOperLog.setTitle("更新金思维协助状态");
sysOperLog.setOperParam(quotCode);
sysOperLog.setRequestMethod("POST");
sysOperLog.setOperTime(DateUtils.getNowDate());
long startTime = System.currentTimeMillis();
try {
if(StringUtils.isBlank(quotCode)){
String errMsg = "报价单号为空,更新失败";
sysOperLog.setStatus(1);
long endTime = System.currentTimeMillis();
sysOperLog.setCostTime(endTime - startTime);
sysOperLog.setErrorMsg(errMsg);
sysOperLog.setJsonResult(JSONArray.toJSONString(R.fail(errMsg)));
iSysOperLogService.insertOperlog(sysOperLog);
return R.fail(errMsg);
}
String quotId = quotService.selectQuotByQuotCode(quotCode);
if(StringUtils.isEmpty(quotId)){
String errMsg = "报价单号:"+quotCode+" 系统中不存在,同步失败";
sysOperLog.setStatus(1);
long endTime = System.currentTimeMillis();
sysOperLog.setCostTime(endTime - startTime);
sysOperLog.setErrorMsg(errMsg);
sysOperLog.setJsonResult(JSONArray.toJSONString(R.fail(errMsg)));
iSysOperLogService.insertOperlog(sysOperLog);
return R.fail(errMsg);
}
Quot q = quotService.selectQuotByQuotId(quotId);
String quotApprovalStatus = q.getQuotApprovalStatus();
if(!"1".equals(quotApprovalStatus)){
String errMsg = "报价单号:"+q.getQuotCode()+" 非协助中状态,同步失败";
sysOperLog.setStatus(1);
long endTime = System.currentTimeMillis();
sysOperLog.setCostTime(endTime - startTime);
sysOperLog.setErrorMsg(errMsg);
sysOperLog.setJsonResult(JSONArray.toJSONString(R.fail(errMsg)));
iSysOperLogService.insertOperlog(sysOperLog);
return R.fail(errMsg);
}
q.setQuotJswApprovalStatus("1");
quotService.updateQuot(q);
}catch(Exception e){
String errMsg = "更新金思维协助状态接口异常,同步失败";
sysOperLog.setStatus(1);
long endTime = System.currentTimeMillis();
sysOperLog.setCostTime(endTime - startTime);
sysOperLog.setErrorMsg(errMsg);
sysOperLog.setJsonResult(JSONArray.toJSONString(R.fail(errMsg)));
iSysOperLogService.insertOperlog(sysOperLog);
return R.fail(errMsg);
}
sysOperLog.setStatus(0);
long endTime = System.currentTimeMillis();
sysOperLog.setCostTime(endTime - startTime);
sysOperLog.setJsonResult(R.ok().toString());
iSysOperLogService.insertOperlog(sysOperLog);
return R.ok();
}

View File

@ -0,0 +1,157 @@
package com.ruoyi.web.utils.SapHana;
import java.sql.*;
/*
* Sap Hana数据库读取配置
* */
public class HanaDB {
static {
try {
Class.forName("com.sap.db.jdbc.Driver");
} catch (ClassNotFoundException e) {
e.printStackTrace();
}
}
public static Connection getConn() {
Connection conn = null;
try {
conn = DriverManager.getConnection(
"jdbc:sap://172.19.1.10:30013?databaseName=EHP&reconnect=true&useServerPrepStmts=false&rewriteBatchedStatements=true",
"ABAP01", "JNdl@2022");
} catch (SQLException e) {
e.printStackTrace();
}
return conn;
}
public static Statement getStmt(Connection conn) {
Statement stmt = null;
try {
stmt = conn.createStatement();
} catch (SQLException e) {
e.printStackTrace();
}
return stmt;
}
public static ResultSet executeQuery(Statement stmt, String sql) {
ResultSet rs = null;
try {
rs = stmt.executeQuery(sql);
} catch (SQLException e) {
e.printStackTrace();
}
return rs;
}
public static ResultSet executeQuery(Connection conn, String sql) {
ResultSet rs = null;
try {
rs = conn.createStatement().executeQuery(sql);
} catch (SQLException e) {
e.printStackTrace();
}
return rs;
}
public static int executeUpdate(Connection conn, String sql) {
int ret = 0;
Statement stmt = null;
try {
stmt = conn.createStatement();
ret = stmt.executeUpdate(sql);
} catch (SQLException e) {
e.printStackTrace();
} finally {
close(stmt);
}
return ret;
}
public static ResultSet executeQuery(PreparedStatement pstmt) {
ResultSet rs = null;
try {
rs = pstmt.executeQuery();
} catch (SQLException e) {
e.printStackTrace();
}
return rs;
}
public static PreparedStatement getPstmt(Connection conn, String sql) {
PreparedStatement pstmt = null;
try {
pstmt = conn.prepareStatement(sql);
} catch (SQLException e) {
e.printStackTrace();
}
return pstmt;
}
public static PreparedStatement getPstmt(Connection conn, String sql, boolean autoGeneratedKeys) {
PreparedStatement pstmt = null;
try {
pstmt = conn.prepareStatement(sql, Statement.RETURN_GENERATED_KEYS);
} catch (SQLException e) {
e.printStackTrace();
}
return pstmt;
}
public static CallableStatement getCallstmt(Connection conn, String sql) {
CallableStatement cstmt = null;
try {
cstmt = conn.prepareCall(sql);
} catch (SQLException e) {
e.printStackTrace();
}
return cstmt;
}
public static void close(Connection conn) {
if (conn != null) {
try {
conn.close();
} catch (SQLException e) {
e.printStackTrace();
}
conn = null;
}
}
public static void close(Statement stmt) {
if (stmt != null) {
try {
stmt.close();
} catch (SQLException e) {
e.printStackTrace();
}
stmt = null;
}
}
public static void close(ResultSet rs) {
if (rs != null) {
try {
rs.close();
} catch (SQLException e) {
e.printStackTrace();
}
rs = null;
}
}
}

View File

@ -0,0 +1,43 @@
package com.ruoyi.web.utils.SapHana;
import java.sql.Connection;
import java.sql.ResultSet;
/**
* SAP 直连hana数据库 工具类
*/
public class SapHanaUtils {
/**
* 查询SAP是否存在相同名称和税号的客户
* @param cusName
* @param cusVatNo
* @return
*/
public static Boolean isExist(String cusName, String cusVatNo) {
Boolean flag = false;
Connection conn = null;
ResultSet rs = null;
try {
conn = HanaDB.getConn();
StringBuffer sf = new StringBuffer();
sf.append(" select name1,BAHNS from SAPHANADB.KNA1 ");
sf.append(" where name1 = '" + cusName + "'" );
sf.append(" and BAHNS = '" + cusVatNo + "'" );
rs = HanaDB.executeQuery(conn, String.valueOf(sf));
if (rs.next()) {
do {
flag = true;
} while (rs.next());
}
} catch (Exception e) {
e.printStackTrace();
} finally {
HanaDB.close(rs);
HanaDB.close(conn);
}
return flag;
}
}

View File

@ -265,29 +265,30 @@ public class excelUtil {
wf_merge = new WritableFont(WritableFont.ARIAL,11,WritableFont.NO_BOLD,false);
wff_merge = new WritableCellFormat(wf_merge);
wff_merge.setAlignment(Alignment.LEFT);
wff_merge.setBorder(Border.BOTTOM, BorderLineStyle.THIN);
wff_merge.setBorder(Border.RIGHT, BorderLineStyle.THIN);
label = new Label(1, i, "3、分支电缆为多芯分支价格不包其它附件不含安装费数量以供方实际测量为准",wff_merge);
wsheet.addCell(label);
/*i++;
wsheet.setRowView(i,390);
wf_merge = new WritableFont(WritableFont.ARIAL,11,WritableFont.NO_BOLD,false);
wff_merge = new WritableCellFormat(wf_merge);
wff_merge.setAlignment(jxl.format.Alignment.LEFT);
wff_merge.setBorder(jxl.format.Border.BOTTOM,jxl.format.BorderLineStyle.THIN);
wff_merge.setBorder(jxl.format.Border.RIGHT,jxl.format.BorderLineStyle.THIN);
wsheet.mergeCells(1,i,7,i);
// label = new Label(1, i, "4、产品交货总数和单根交货长度允许有±1%公差,如有不符对方要求,需重制作报价单。",wff_merge);
wsheet.addCell(label);*/
wsheet.mergeCells(0,i-3,0,i);
i++;
wsheet.setRowView(i,390);
wsheet.mergeCells(1,i,7,i);
wf_merge = new WritableFont(WritableFont.ARIAL,11,WritableFont.NO_BOLD,false);
wff_merge = new WritableCellFormat(wf_merge);
wff_merge.setAlignment(Alignment.LEFT);
wff_merge.setBorder(Border.BOTTOM, BorderLineStyle.THIN);
wff_merge.setBorder(Border.RIGHT, BorderLineStyle.THIN);
label = new Label(1, i, "4、低厂价预付30%,款清发货;",wff_merge);
wsheet.addCell(label);
wsheet.mergeCells(0,i-4,0,i);
wf_merge = new WritableFont(WritableFont.ARIAL,11,WritableFont.NO_BOLD,false);
wff_merge = new WritableCellFormat(wf_merge);
wff_merge.setAlignment(Alignment.CENTRE);
wff_merge.setVerticalAlignment(VerticalAlignment.CENTRE);
wff_merge.setBorder(Border.ALL, BorderLineStyle.THIN);
label = new Label(0, i-3, "备注",wff_merge);
label = new Label(0, i-4, "备注",wff_merge);
wsheet.addCell(label);
InputStream fileInputStream = new ClassPathResource("/jnlogo.png").getInputStream();
@ -358,8 +359,8 @@ public class excelUtil {
response.setContentType("application/vnd.ms-excel");
BigDecimal totalmoney = BigDecimal.ZERO;
File jnlogo_file = new File("logon/"+IdUtils.createNo("jnlogo_",3)+".png");
File wc_file = new File("logon/"+IdUtils.createNo("wc_",3)+".png");
File jnlogo_file = new File("logon/"+quot.getQuotCode()+".png");
File wc_file = new File("logon/"+quot.getQuotCode()+".png");
try {
OutputStream os = response.getOutputStream();
WritableWorkbook wwb = Workbook.createWorkbook(os);
@ -580,29 +581,30 @@ public class excelUtil {
wf_merge = new WritableFont(WritableFont.ARIAL,11,WritableFont.NO_BOLD,false);
wff_merge = new WritableCellFormat(wf_merge);
wff_merge.setAlignment(Alignment.LEFT);
wff_merge.setBorder(Border.BOTTOM, BorderLineStyle.THIN);
wff_merge.setBorder(Border.RIGHT, BorderLineStyle.THIN);
label = new Label(1, i, "3、分支电缆为多芯分支价格不包其它附件不含安装费数量以供方实际测量为准",wff_merge);
wsheet.addCell(label);
/*i++;
wsheet.setRowView(i,390);
wf_merge = new WritableFont(WritableFont.ARIAL,11,WritableFont.NO_BOLD,false);
wff_merge = new WritableCellFormat(wf_merge);
wff_merge.setAlignment(jxl.format.Alignment.LEFT);
wff_merge.setBorder(jxl.format.Border.BOTTOM,jxl.format.BorderLineStyle.THIN);
wff_merge.setBorder(jxl.format.Border.RIGHT,jxl.format.BorderLineStyle.THIN);
wsheet.mergeCells(1,i,7,i);
// label = new Label(1, i, "4、产品交货总数和单根交货长度允许有±1%公差,如有不符对方要求,需重制作报价单。",wff_merge);
wsheet.addCell(label);*/
wsheet.mergeCells(0,i-3,0,i);
i++;
wsheet.setRowView(i,390);
wsheet.mergeCells(1,i,7,i);
wf_merge = new WritableFont(WritableFont.ARIAL,11,WritableFont.NO_BOLD,false);
wff_merge = new WritableCellFormat(wf_merge);
wff_merge.setAlignment(Alignment.LEFT);
wff_merge.setBorder(Border.BOTTOM, BorderLineStyle.THIN);
wff_merge.setBorder(Border.RIGHT, BorderLineStyle.THIN);
label = new Label(1, i, "4、低厂价预付30%,款清发货;",wff_merge);
wsheet.addCell(label);
wsheet.mergeCells(0,i-4,0,i);
wf_merge = new WritableFont(WritableFont.ARIAL,11,WritableFont.NO_BOLD,false);
wff_merge = new WritableCellFormat(wf_merge);
wff_merge.setAlignment(Alignment.CENTRE);
wff_merge.setVerticalAlignment(VerticalAlignment.CENTRE);
wff_merge.setBorder(Border.ALL, BorderLineStyle.THIN);
label = new Label(0, i-3, "备注",wff_merge);
label = new Label(0, i-4, "备注",wff_merge);
wsheet.addCell(label);
InputStream fileInputStream = new ClassPathResource("/jnlogo.png").getInputStream();

View File

@ -61,6 +61,15 @@ spring:
url: jdbc:sqlserver://192.168.9.2:1433;DatabaseName=jn_web
username: sa
password: it12345
# OA数据库数据源
oa:
# 从数据源开关/默认关闭
enabled: true
driver-class-name: com.microsoft.sqlserver.jdbc.SQLServerDriver
# 正式数据库
url: jdbc:sqlserver://192.168.9.182:1433;DatabaseName=ecology
username: sa
password: Itcenter110-
# 初始连接数
initialSize: 10
# 最小连接池数量
@ -116,3 +125,7 @@ spring:
remove-abandoned-timeout: 20
#关闭abanded连接时输出错误日志
log-abandoned: false
#默认为false。因此如果想让数据库和网络故障恢复之后pool能继续请求正常资源必须把此项配置设为false
break-after-acquire-failure: false
fail-fast: true
time-between-connect-error-millis: 10000

View File

@ -104,7 +104,7 @@ spring:
# token配置
token:
# 是否允许账户多终端同时登录true允许 false不允许
soloLogin: false
soloLogin: true
# 令牌自定义标识
header: Authorization
# 令牌密钥
@ -201,7 +201,7 @@ magic-api:
# Minio配置-分布式存储
minio:
useEnable: true
url: http://192.168.9.134:3336
url: http://crmfile.jncable.com.cn:3336
accessKey: minio-admin
secretKey: minio-jndlitzx
bucketName: system

View File

@ -79,7 +79,7 @@
<groupId>org.apache.commons</groupId>
<artifactId>commons-lang3</artifactId>
</dependency>
<!-- JSON工具类 -->
<dependency>
<groupId>com.fasterxml.jackson.core</groupId>
@ -152,7 +152,12 @@
<groupId>javax.servlet</groupId>
<artifactId>javax.servlet-api</artifactId>
</dependency>
<dependency>
<groupId>org.apache.httpcomponents</groupId>
<artifactId>httpclient</artifactId>
<version>4.5.14</version>
</dependency>
</dependencies>
</project>
</project>

View File

@ -43,6 +43,12 @@ public enum DataSourceType
* @author JIAL
* @updateTime 2024/5/24 15:50
*/
ORDER
ORDER,
/**
* OA数据库
*/
OA
}

View File

@ -5,18 +5,21 @@ import java.io.IOException;
import java.io.InputStream;
import java.io.InputStreamReader;
import java.io.PrintWriter;
import java.net.ConnectException;
import java.net.SocketTimeoutException;
import java.net.URL;
import java.net.URLConnection;
import java.net.*;
import java.nio.charset.StandardCharsets;
import java.security.cert.X509Certificate;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import java.util.stream.Collectors;
import javax.net.ssl.HostnameVerifier;
import javax.net.ssl.HttpsURLConnection;
import javax.net.ssl.SSLContext;
import javax.net.ssl.SSLSession;
import javax.net.ssl.TrustManager;
import javax.net.ssl.X509TrustManager;
import org.apache.commons.collections.map.HashedMap;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import com.ruoyi.common.constant.Constants;
@ -24,7 +27,7 @@ import com.ruoyi.common.utils.StringUtils;
/**
* 通用http发送方法
*
*
* @author ruoyi
*/
public class HttpUtils
@ -189,6 +192,190 @@ public class HttpUtils
return result.toString();
}
/**
* 向指定 URL 发送POST方法的请求 - 金思维对接用
*
* @param url 发送请求的 URL
* @param param 请求参数请求参数应该是 json字符串 的形式
* @return 所代表远程资源的响应结果
*/
public static Map<String,String> sendPostJson(String url, String param,String cookie)
{
Map<String,String> map = new HashMap<String,String>();
String tempCookie = "";
PrintWriter out = null;
BufferedReader in = null;
StringBuilder result = new StringBuilder();
try
{
String urlNameString = url;
log.info("sendPost - {}", urlNameString);
URL realUrl = new URL(urlNameString);
URLConnection conn = realUrl.openConnection();
conn.setRequestProperty("accept", "*/*");
conn.setRequestProperty("connection", "Keep-Alive");
conn.setRequestProperty("user-agent", "Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1;SV1)");
conn.setRequestProperty("Accept-Charset", "utf-8");
conn.setRequestProperty("contentType", "application/json");
conn.setRequestProperty("Content-Type", "application/json");
// 设置Cookie头部
if(StringUtils.isNotEmpty(cookie)){
String cookies[] = cookie.split("; ");
String cookieString = "";
for(String c:cookies){
String v[]= c.split("=");
if(".ASPXAUTH".equals(v[0])){
if(StringUtils.isEmpty(cookieString)){
cookieString = v[0] + "=" +v[1] +"; ";
}else{
cookieString = cookieString + v[0] + "=" +v[1] +"; ";
}
}else if("uid".equals(v[0])){
if(StringUtils.isEmpty(cookieString)){
cookieString = v[0] + "=" +v[1] +"; ";
}else{
cookieString = cookieString + v[0] + "=" +v[1] +"; ";
}
}else{
continue;
}
}
conn.setRequestProperty("Cookie", cookieString);
}
conn.setDoOutput(true);
conn.setDoInput(true);
out = new PrintWriter(conn.getOutputStream());
out.print(param);
out.flush();
in = new BufferedReader(new InputStreamReader(conn.getInputStream(), StandardCharsets.UTF_8));
String line;
while ((line = in.readLine()) != null)
{
result.append(line);
}
if(StringUtils.isEmpty(cookie)){
List<String> cookies = conn.getHeaderFields().get("Set-Cookie");
tempCookie = cookies.stream().collect(Collectors.joining("; "));
}
log.info("recv - {}", result);
}
catch (ConnectException e)
{
log.error("调用HttpUtils.sendPost ConnectException, url=" + url + ",param=" + param, e);
}
catch (SocketTimeoutException e)
{
log.error("调用HttpUtils.sendPost SocketTimeoutException, url=" + url + ",param=" + param, e);
}
catch (IOException e)
{
log.error("调用HttpUtils.sendPost IOException, url=" + url + ",param=" + param, e);
}
catch (Exception e)
{
log.error("调用HttpsUtil.sendPost Exception, url=" + url + ",param=" + param, e);
}
finally
{
try
{
if (out != null)
{
out.close();
}
if (in != null)
{
in.close();
}
}
catch (IOException ex)
{
log.error("调用in.close Exception, url=" + url + ",param=" + param, ex);
}
}
map.put("cookie",tempCookie);
map.put("res",result.toString());
return map;
}
/**
* 向指定 URL 发送POST方法的请求
*
* @param url 发送请求的 URL
* @param param 请求参数请求参数应该是 json字符串 的形式
* @return 所代表远程资源的响应结果
*/
public static String sendPostJson2(String url, String param)
{
PrintWriter out = null;
BufferedReader in = null;
StringBuilder result = new StringBuilder();
try
{
String urlNameString = url;
log.info("sendPost - {}", urlNameString);
URL realUrl = new URL(urlNameString);
URLConnection conn = realUrl.openConnection();
conn.setRequestProperty("accept", "*/*");
conn.setRequestProperty("connection", "Keep-Alive");
conn.setRequestProperty("user-agent", "Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1;SV1)");
conn.setRequestProperty("Accept-Charset", "utf-8");
conn.setRequestProperty("contentType", "application/json");
conn.setRequestProperty("Content-Type", "application/json");
conn.setDoOutput(true);
conn.setDoInput(true);
out = new PrintWriter(conn.getOutputStream());
out.print(param);
out.flush();
in = new BufferedReader(new InputStreamReader(conn.getInputStream(), StandardCharsets.UTF_8));
String line;
while ((line = in.readLine()) != null)
{
result.append(line);
}
log.info("recv - {}", result);
}
catch (ConnectException e)
{
log.error("调用HttpUtils.sendPost ConnectException, url=" + url + ",param=" + param, e);
}
catch (SocketTimeoutException e)
{
log.error("调用HttpUtils.sendPost SocketTimeoutException, url=" + url + ",param=" + param, e);
}
catch (IOException e)
{
log.error("调用HttpUtils.sendPost IOException, url=" + url + ",param=" + param, e);
}
catch (Exception e)
{
log.error("调用HttpsUtil.sendPost Exception, url=" + url + ",param=" + param, e);
}
finally
{
try
{
if (out != null)
{
out.close();
}
if (in != null)
{
in.close();
}
}
catch (IOException ex)
{
log.error("调用in.close Exception, url=" + url + ",param=" + param, ex);
}
}
return result.toString();
}
public static String sendSSLPost(String url, String param)
{
StringBuilder result = new StringBuilder();
@ -271,4 +458,4 @@ public class HttpUtils
return true;
}
}
}
}

View File

@ -1,8 +1,18 @@
package com.ruoyi.common.utils.sign;
import org.apache.commons.io.IOUtils;
import org.apache.http.HttpEntity;
import org.apache.http.client.methods.CloseableHttpResponse;
import org.apache.http.client.methods.HttpGet;
import org.apache.http.impl.client.CloseableHttpClient;
import org.apache.http.impl.client.HttpClients;
import java.io.IOException;
import java.io.InputStream;
/**
* Base64工具类
*
*
* @author ruoyi
*/
public final class Base64
@ -263,6 +273,29 @@ public final class Base64
return decodedData;
}
/**
* 将文件转为base64字符串
* @param url
* @return
*/
public static String fileBase64(String url){
String encode = null;
try {
CloseableHttpClient client = HttpClients.createDefault();
HttpGet get = new HttpGet(url);
CloseableHttpResponse response = client.execute(get);
//文件流
HttpEntity httpEntity = response.getEntity();
InputStream inStream = httpEntity.getContent();
byte[] bytes = IOUtils.toByteArray(inStream);
//附件base64
encode = Base64.encode(bytes);
} catch (IOException e) {
return null;
}
return encode;
}
/**
* remove WhiteSpace from MIME containing encoded Base64 data.
*

View File

@ -94,6 +94,15 @@ public class DruidConfig
return druidProperties.dataSource(dataSource);
}
@Bean
@ConfigurationProperties("spring.datasource.druid.oa")
@ConditionalOnProperty(prefix = "spring.datasource.druid.oa", name = "enabled", havingValue = "true")
public DataSource oaDataSource(DruidProperties druidProperties)
{
DruidDataSource dataSource = DruidDataSourceBuilder.create().build();
return druidProperties.dataSource(dataSource);
}
@Bean(name = "dynamicDataSource")
@Primary
public DynamicDataSource dataSource(DataSource masterDataSource)
@ -106,6 +115,7 @@ public class DruidConfig
setDataSource(targetDataSources, DataSourceType.JNERP.name(), "jnerpDataSource");
setDataSource(targetDataSources, DataSourceType.STORAGE.name(), "storageDataSource");
setDataSource(targetDataSources, DataSourceType.ORDER.name(), "orderDataSource");
setDataSource(targetDataSources, DataSourceType.OA.name(), "oaDataSource");
return new DynamicDataSource(masterDataSource, targetDataSources);
}

View File

@ -1,57 +1,51 @@
//package com.ruoyi.quartz.config;
//
//import org.springframework.context.annotation.Bean;
//import org.springframework.context.annotation.Configuration;
//import org.springframework.scheduling.quartz.SchedulerFactoryBean;
//import javax.sql.DataSource;
//import java.util.Properties;
//
///**
// * 定时任务配置单机部署建议删除此类和qrtz数据库表默认走内存会最高效
// *
// * @author ruoyi
// */
//@Configuration
//public class ScheduleConfig
//{
// @Bean
// public SchedulerFactoryBean schedulerFactoryBean(DataSource dataSource)
// {
// SchedulerFactoryBean factory = new SchedulerFactoryBean();
// factory.setDataSource(dataSource);
//
// // quartz参数
// Properties prop = new Properties();
// prop.put("org.quartz.scheduler.instanceName", "RuoyiScheduler");
// prop.put("org.quartz.scheduler.instanceId", "AUTO");
// // 线程池配置
// prop.put("org.quartz.threadPool.class", "org.quartz.simpl.SimpleThreadPool");
// prop.put("org.quartz.threadPool.threadCount", "20");
// prop.put("org.quartz.threadPool.threadPriority", "5");
// // JobStore配置
// prop.put("org.quartz.jobStore.class", "org.springframework.scheduling.quartz.LocalDataSourceJobStore");
// // 集群配置
// prop.put("org.quartz.jobStore.isClustered", "true");
// prop.put("org.quartz.jobStore.clusterCheckinInterval", "15000");
// prop.put("org.quartz.jobStore.maxMisfiresToHandleAtATime", "10");
// prop.put("org.quartz.jobStore.txIsolationLevelSerializable", "true");
//
// // sqlserver 启用
// // prop.put("org.quartz.jobStore.selectWithLockSQL", "SELECT * FROM {0}LOCKS UPDLOCK WHERE LOCK_NAME = ?");
// prop.put("org.quartz.jobStore.misfireThreshold", "12000");
// prop.put("org.quartz.jobStore.tablePrefix", "QRTZ_");
// factory.setQuartzProperties(prop);
//
// factory.setSchedulerName("RuoyiScheduler");
// // 延时启动
// factory.setStartupDelay(1);
// factory.setApplicationContextSchedulerContextKey("applicationContextKey");
// // 可选QuartzScheduler
// // 启动时更新己存在的Job这样就不用每次修改targetObject后删除qrtz_job_details表对应记录了
// factory.setOverwriteExistingJobs(true);
// // 设置自动启动默认为true
// factory.setAutoStartup(true);
//
// return factory;
// }
//}
package com.ruoyi.quartz.config;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.scheduling.quartz.SchedulerFactoryBean;
import javax.sql.DataSource;
import java.util.Properties;
/**
* 定时任务配置单机部署建议删除此类和qrtz数据库表默认走内存会最高效
*
* @author ruoyi
*/
@Configuration
public class ScheduleConfig
{
@Bean
public SchedulerFactoryBean schedulerFactoryBean(DataSource dataSource)
{
SchedulerFactoryBean factory = new SchedulerFactoryBean();
factory.setDataSource(dataSource);
// quartz参数
Properties prop = new Properties();
prop.put("org.quartz.scheduler.instanceName", "RuoyiScheduler");
prop.put("org.quartz.scheduler.instanceId", "AUTO");
// 线程池配置
prop.put("org.quartz.threadPool.class", "org.quartz.simpl.SimpleThreadPool");
prop.put("org.quartz.threadPool.threadCount", "20");
prop.put("org.quartz.threadPool.threadPriority", "5");
// JobStore配置
prop.put("org.quartz.jobStore.class", "org.springframework.scheduling.quartz.LocalDataSourceJobStore");
// 集群配置
prop.put("org.quartz.jobStore.isClustered", "true");
prop.put("org.quartz.jobStore.clusterCheckinInterval", "15000");
prop.put("org.quartz.jobStore.maxMisfiresToHandleAtATime", "10");
prop.put("org.quartz.jobStore.txIsolationLevelSerializable", "true");
// sqlserver 启用
prop.put("org.quartz.jobStore.selectWithLockSQL", "SELECT * FROM {0}LOCKS UPDLOCK WHERE LOCK_NAME = ?");
prop.put("org.quartz.jobStore.misfireThreshold", "12000");
prop.put("org.quartz.jobStore.tablePrefix", "QRTZ_");
factory.setQuartzProperties(prop);
factory.setSchedulerName("RuoyiScheduler");
// 延时启动
factory.setStartupDelay(1);
factory.setApplicationContextSchedulerContextKey("applicationContextKey");
// 可选QuartzScheduler
// 启动时更新己存在的Job这样就不用每次修改targetObject后删除qrtz_job_details表对应记录了
factory.setOverwriteExistingJobs(true);
// 设置自动启动默认为true
factory.setAutoStartup(true);
return factory;
}
}

View File

@ -0,0 +1,55 @@
package com.ruoyi.quartz.domain;
import com.ruoyi.common.core.domain.BaseEntity;
import java.util.Date;
import java.util.List;
/**
* 报价对象 SysOaQuot
*
* @author ruoyi
* @date 2024-04-01
*/
public class OASysQuot
{
/** 报价单id */
private String quotId;
/** 报价单号 */
private String quotCode;
/** OA审批状态 */
private String state;
/** OA审批备注 */
private String remark;
public String getQuotId() {
return quotId;
}
public void setQuotId(String quotId) {
this.quotId = quotId;
}
public String getQuotCode() {return quotCode;}
public void setQuotCode(String quotCode) {this.quotCode = quotCode;}
public String getState() {
return state;
}
public void setState(String state) {
this.state = state;
}
public String getRemark() {
return remark;
}
public void setRemark(String remark) {
this.remark = remark;
}
}

View File

@ -0,0 +1,37 @@
package com.ruoyi.quartz.mapper;
import com.ruoyi.quartz.domain.OASysQuot;
import org.apache.ibatis.annotations.Param;
import java.util.List;
/**
* 报价Mapper接口
*
* @author ruoyi
* @date 2024-04-01
*/
public interface OAQuotMapper
{
/**
* 查询 报价单-OA审批状态为审批中的单号并且在中间表显示流程已经结束的单据根据单号更新 OA审批状态
* @return
*/
List<OASysQuot> selectOAQUOT();
/**
* 批量更新报价单-OA审批状态为已完成
* @param quotId
* @param state
* @param remark
*/
void updateQuotOAApprovalStatus(@Param("quotId") String quotId, @Param("state") String state, @Param("remark") String remark);
/**
* 将中间表 根据报价单号更新 isfinish=1 表示报价流程已结束
* @param quotCode
*/
void updateOAQuotByQuotCode(String quotCode);
}

View File

@ -0,0 +1,33 @@
package com.ruoyi.quartz.service;
import com.ruoyi.quartz.domain.OASysQuot;
import java.util.List;
/**
* 报价Service接口
*
* @author ruoyi
* @date 2024-04-01
*/
public interface OAQuotService
{
/**
* 查询 报价单-OA审批状态为审批中的单号并且在中间表显示流程已经结束的单据根据单号更新 OA审批状态
* @return
*/
List<OASysQuot> selectOAQUOT();
/**
* 批量更新报价单-OA审批状态为已完成
* @param quotId
*/
void updateQuotOAApprovalStatus(String quotId,String state,String remark);
/**
* 将中间表 根据报价单号更新 isfinish=1 表示报价流程已结束
*/
void updateOAQuotByQuotCode(String quotCode);
}

View File

@ -0,0 +1,45 @@
package com.ruoyi.quartz.service.impl;
import com.ruoyi.quartz.domain.OASysQuot;
import com.ruoyi.quartz.mapper.OAQuotMapper;
import com.ruoyi.quartz.service.OAQuotService;
import org.springframework.stereotype.Service;
import javax.annotation.Resource;
import java.util.List;
/**
* 报价Service业务层处理
*
* @author ruoyi
* @date 2024-04-01
*/
@Service
public class OAQuotServiceImpl implements OAQuotService
{
@Resource
private OAQuotMapper aAQuotMapper;
/**
* 查询 报价单-OA审批状态为审批中的单号并且在中间表显示流程已经结束的单据根据单号更新 OA审批状态
* @return
*/
@Override
public List<OASysQuot> selectOAQUOT() {
return aAQuotMapper.selectOAQUOT();
}
@Override
public void updateQuotOAApprovalStatus(String quotId, String state, String remark) {
aAQuotMapper.updateQuotOAApprovalStatus(quotId,state,remark);
}
/**
* 将中间表 根据报价单号更新 isfinish=1 表示报价流程已结束
* @param quotCode
*/
@Override
public void updateOAQuotByQuotCode(String quotCode) {
aAQuotMapper.updateOAQuotByQuotCode(quotCode);
}
}

View File

@ -0,0 +1,51 @@
package com.ruoyi.quartz.task;
import com.ruoyi.common.constant.CacheConstants;
import com.ruoyi.common.core.redis.RedisCache;
import com.ruoyi.common.core.redis.RedisLock;
import com.ruoyi.common.utils.ip.IpUtils;
import com.ruoyi.quartz.domain.OASysQuot;
import com.ruoyi.quartz.service.OAQuotService;
import org.redisson.api.RLock;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;
import javax.annotation.PostConstruct;
import javax.annotation.Resource;
import java.util.List;
/**
* 定时任务调度-报价单OA流程状态读取
*
* @author ruoyi
*/
@Component("quotTask")
public class QuotTask
{
@Resource
private OAQuotService quotService;
public static QuotTask testUtils;
@PostConstruct
public void init() {
testUtils = this;
}
/**
* 检查OA报加单审批流程是否结束
*/
public void OAQuot() throws Exception {
try {
// 查询 报价单-OA审批状态为审批中的单号并且在中间表显示流程已经结束的单据根据单号更新 OA审批状态
List<OASysQuot> quots = quotService.selectOAQUOT();
for(OASysQuot sysoaquot:quots){
// 批量更新报价单-OA审批状态,备注
quotService.updateQuotOAApprovalStatus(sysoaquot.getQuotId(),sysoaquot.getState(),sysoaquot.getRemark());
//将中间表 根据报价单号更新 isfinish=1 表示报价流程已结束
quotService.updateOAQuotByQuotCode(sysoaquot.getQuotCode());
}
} catch (Exception e) {
e.printStackTrace();
}
}
}

View File

@ -6,6 +6,7 @@ import com.ruoyi.common.core.redis.RedisCache;
import com.ruoyi.common.core.redis.RedisLock;
import com.ruoyi.common.enums.DataSourceType;
import com.ruoyi.common.utils.StringUtils;
import com.ruoyi.quartz.domain.OASysQuot;
import com.ruoyi.quartz.domain.c_rb_product_price;
import com.ruoyi.quartz.domain.c_rb_productbase_price;
import com.ruoyi.quartz.service.SapTjService;
@ -29,15 +30,6 @@ import java.util.List;
@Component("rbTask")
public class RbTask
{
@Autowired
private RedisCache redisCache;
@Autowired
private RedisLock redisLock;
@Autowired
private Scheduler scheduler;
@Resource
private SapTjService sapTjService;
@ -52,45 +44,28 @@ public class RbTask
* 同步红本数据库
*/
public void tongb() throws Exception {
String rbVersionUid = testUtils.sapTjService.selRbVersionUid();//红本调价记录uid
Boolean lock= redisLock.getLock(getJobKey("rbTask"), -1, rbVersionUid);
if(lock){
//判断是否已执行调价 6.3 redbook rb_productVersion 是否有新增uid and sta='1'sdmdm1 调价日期今日的数据是否存在
String locVersionUid = testUtils.sapTjService.selLocVersionUid();//本地红本调价记录uid
//判断是否已执行调价 6.3 redbook rb_productVersion 是否有新增uid and sta='1'sdmdm1 调价日期今日的数据是否存在
String locVersionUid = testUtils.sapTjService.selLocVersionUid();//本地红本调价记录uid
String RbProductPriceCount = testUtils.sapTjService.selRbProductPriceVersionUid(rbVersionUid);//RbProductPrice表是否有更新
String RbProductBasePriceCount = testUtils.sapTjService.selRbProductBasePriceVersionUid(rbVersionUid);//RbProductBasePrice表是否有更新
String RbProductPriceCount = testUtils.sapTjService.selRbProductPriceVersionUid(rbVersionUid);//RbProductPrice表是否有更新
String RbProductBasePriceCount = testUtils.sapTjService.selRbProductBasePriceVersionUid(rbVersionUid);//RbProductBasePrice表是否有更新
try{
if(!rbVersionUid.equals(locVersionUid) && Integer.valueOf(RbProductPriceCount)>0 && Integer.valueOf(RbProductBasePriceCount)>0) {//有新增调价版本并且有调价记录
System.out.println("=======================开始同步!======================");
testUtils.sapTjService.deleteLocProductPrice();//删除本地c_rb_product_price表数据
List<c_rb_product_price> productPriceList = testUtils.sapTjService.getProductPriceList(rbVersionUid);
JDBCBatchInsert.insertRbProductPrice(productPriceList);//批量插入
try{
if(!rbVersionUid.equals(locVersionUid) && Integer.valueOf(RbProductPriceCount)>0 && Integer.valueOf(RbProductBasePriceCount)>0) {//有新增调价版本并且有调价记录
System.out.println("=======================开始同步!======================");
testUtils.sapTjService.deleteLocProductPrice();//删除本地c_rb_product_price表数据
List<c_rb_product_price> productPriceList = testUtils.sapTjService.getProductPriceList(rbVersionUid);
JDBCBatchInsert.insertRbProductPrice(productPriceList);//批量插入
testUtils.sapTjService.deleteLocProductBasePrice();//删除本地c_rb_productbase_price表数据
List<c_rb_productbase_price> productBasePriceList = testUtils.sapTjService.getProductBasePriceList(rbVersionUid);
JDBCBatchInsert.insertRbProductBasePrice(productBasePriceList);//批量插入
testUtils.sapTjService.deleteLocProductBasePrice();//删除本地c_rb_productbase_price表数据
List<c_rb_productbase_price> productBasePriceList = testUtils.sapTjService.getProductBasePriceList(rbVersionUid);
JDBCBatchInsert.insertRbProductBasePrice(productBasePriceList);//批量插入
testUtils.sapTjService.updateLocRbVersion(rbVersionUid);//更新本地c_rb_version表
}
redisCache.deleteObject(getJobKey("rbTask"));
}catch (Exception e) {
throw new Exception(e.getMessage(), e);
testUtils.sapTjService.updateLocRbVersion(rbVersionUid);//更新本地c_rb_version表
}
}catch (Exception e) {
throw new Exception(e.getMessage(), e);
}
}
/**
* 定时任务缓存键名
*
* @param jobId 任务编号
* @return 缓存键key
*/
private String getJobKey(String jobId)
{
return CacheConstants.SYS_JOB_KEY + jobId;
}
}

View File

@ -20,7 +20,7 @@ import com.ruoyi.quartz.domain.SysJob;
/**
* 定时任务工具类
*
*
* @author ruoyi
*
*/
@ -77,7 +77,7 @@ public class ScheduleUtils
jobDetail.getJobDataMap().put(ScheduleConstants.TASK_PROPERTIES, job);
//注册triggerListener ->项目多机部署时使用
// scheduler.getListenerManager().addTriggerListener(new RedisTriggerListener());
scheduler.getListenerManager().addTriggerListener(new RedisTriggerListener());
// 判断是否存在
if (scheduler.checkExists(getJobKey(jobId, jobGroup)))
@ -124,7 +124,7 @@ public class ScheduleUtils
/**
* 检查包名是否为白名单配置
*
*
* @param invokeTarget 目标字符串
* @return 结果
*/

View File

@ -0,0 +1,27 @@
<?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE mapper
PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.ruoyi.quartz.mapper.OAQuotMapper">
<select id="selectOAQUOT" resultType="OASysQuot">
select q.quot_id as quotId,q.quot_code as quotCode,sq.state,sq.remark
from quot q
inner join (
select t.quot_code,t.state,t.remark from (
select a.quot_code,a.state,a.remark, row_number() over(partition by quot_code order by create_time desc) rw
from sys_oa_quot a
where a.triggerflag = '1' and a.state in ('2','3') and a.isFinish = '0'
) t where t.rw = 1
) sq on q.quot_code = sq.quot_code
where q.quot_oa_approval_status = '1'
</select>
<update id="updateQuotOAApprovalStatus">
update quot set quot_oa_approval_status = #{state},quot_oa_approval_remark = #{remark}
where quot_id = #{quotId}
</update>
<update id="updateOAQuotByQuotCode">
update sys_oa_quot set isFinish = '1' where quot_code = #{quotCode}
</update>
</mapper>

View File

@ -32,23 +32,18 @@ public class Customer extends BaseEntity
private String cusSapCode;
/** 街道/门牌号 */
@Excel(name = "街道/门牌号")
private String cusStreet;
/** 街道 */
@Excel(name = "街道")
private String cusQccStreet;
/** 付款条件 */
@Excel(name = "付款条件",dictType = "cus_payment_terms")
private String cusPaymentTerms;
/** 电话号码 */
@Excel(name = "电话号码")
private String cusPhoneNumber;
/** 行业代码 */
@Excel(name = "行业代码")
private String cusIndustryCode;
/** 企查查行业代码 */
@ -62,7 +57,6 @@ public class Customer extends BaseEntity
private String cusInsuredCountQcc;
/** 客户组类别 */
@Excel(name = "客户组类别",dictType = "cus_group")
private String cusGroup;
/** 增值税号 */
@ -70,46 +64,36 @@ public class Customer extends BaseEntity
private String cusVatNo;
/** 客户类型 */
@Excel(name = "客户类型",dictType = "cus_type")
private String cusType;
/** 国家 */
@Excel(name = "国家",dictType = "cus_country")
private String cusCountry;
/** 语言 */
@Excel(name = "语言",dictType = "cus_language")
private String cusLanguage;
/** 客户标签 */
@Excel(name = "客户标签")
private String cusLabel;
/** 客户分类 */
@Excel(name = "客户分类")
private String cusClassification;
/** 电子发票接收邮箱 */
@Excel(name = "电子发票接收邮箱")
private String cusReceivingEmail;
/** 收件人 */
@Excel(name = "收件人")
private String cusRecipient;
/** 收件人电话 */
@Excel(name = "收件人电话")
private String cusRecipientPhone;
/** 备注 */
@Excel(name = "备注")
private String cusRemark;
/** 驳回备注 */
private String cusReturnRemark;
/** 客户禁用状态 */
@Excel(name = "客户禁用状态",dictType = "common_state")
private String cusState;
/** 客户审批状态 */
@ -121,7 +105,6 @@ public class Customer extends BaseEntity
private String cusSalesman;
/** 创建人 */
@Excel(name = "创建人")
private String createName;
/** 银行信息 */

View File

@ -84,4 +84,11 @@ public interface CustomerMapper
* @return 结果
*/
public int deleteBankByCusId(String cusId);
/**
* 获取单据编号
* @param type
* @return
*/
String getCode(String type);
}

View File

@ -65,4 +65,11 @@ public interface ICustomerService
* @return
*/
int changCusStatus(Customer customer);
/**
* 获取单据编号
* @param type
* @return
*/
String getCode(String type);
}

View File

@ -122,6 +122,16 @@ public class CustomerServiceImpl implements ICustomerService
return customerMapper.updateCustomer(customer);
}
/**
* 获取单据编号
* @param type
* @return
*/
@Override
public String getCode(String type) {
return customerMapper.getCode(type);
}
/**
* 新增银行信息
*

View File

@ -70,7 +70,6 @@ public class Quot extends BaseEntity
private Date quotQuotationDate;
/** 数量 */
@Excel(name = "数量")
private String quotQuantity;
/** 报价来源 */
@ -81,9 +80,11 @@ public class Quot extends BaseEntity
private String quotQuotationRequire;
/** 反馈说明 */
@Excel(name = "反馈说明")
private String quotFeedbackExplanation;
/** 明细条数 */
private Integer quotMaterialsCount;
/** 铝价 */
private String quotLvPrice;
@ -105,7 +106,6 @@ public class Quot extends BaseEntity
private String quotCheckUserName;
/** 审核人 */
@Excel(name = "审核人")
private String quotCheckUserNickname;
/** 提交状态 */
@ -151,6 +151,7 @@ public class Quot extends BaseEntity
private String quotJswApprovalStatus;
/** OA **/
private String quotOAApprovalStatus;
private String quotOAApprovalStatusRemark;
/** 报价单-产品信息 */
private List<QuotMaterial> quotMaterialList;
@ -290,6 +291,9 @@ public class Quot extends BaseEntity
{
return quotFeedbackExplanation;
}
public Integer getQuotMaterialsCount() { return quotMaterialsCount; }
public void setQuotMaterialsCount(Integer quotMaterialsCount) { this.quotMaterialsCount = quotMaterialsCount; }
public String getQuotLvPrice() { return quotLvPrice; }
public void setQuotLvPrice(String quotLvPrice) { this.quotLvPrice = quotLvPrice; }
@ -427,4 +431,7 @@ public class Quot extends BaseEntity
public String getQuotOAApprovalStatus() { return quotOAApprovalStatus; }
public void setQuotOAApprovalStatus(String quotOAApprovalStatus) { this.quotOAApprovalStatus = quotOAApprovalStatus; }
public String getQuotOAApprovalStatusRemark() { return quotOAApprovalStatusRemark; }
public void setQuotOAApprovalStatusRemark(String quotOAApprovalStatusRemark) { this.quotOAApprovalStatusRemark = quotOAApprovalStatusRemark; }
}

View File

@ -0,0 +1,215 @@
package com.ruoyi.quot.domain;
import com.ruoyi.common.annotation.Excel;
import com.ruoyi.common.core.domain.BaseEntity;
import java.util.Date;
import java.util.List;
/**
* 报价对象 SysOaQuot
*
* @author ruoyi
* @date 2024-04-01
*/
public class SysOaQuot extends BaseEntity
{
private static final long serialVersionUID = 1L;
/** oa用户id */
private Integer userId;
/** oa部门ID */
private Integer departmentId;
/** 提交oa时间 */
private String submissionTime;
/** 报价单id */
private String quotId;
/** 报价单号 */
private String quotCode;
/** 业务员 */
private String quotSalesmanName;
/** 客户名称 */
private String quotCustomerName;
/** 地址 */
private String quotAddress;
/** 联系电话 */
private String quotPhone;
/** 询价日期 */
private Date quotInquiryDate;
/** 项目名称 */
private String quotProject;
/** 报价要求 */
private String quotQuotationRequire;
/** 铝价 */
private String quotLvPrice;
/** 铜价 */
private String quotTongPrice;
/** 整单料价价差率 */
private String quotMatpriceDiff;
/** OA审批状态 */
private String state;
/** OA审批备注 */
private String remark;
/** 报价单状态 1-整个报价流程结束(包括已反馈、已驳回) 0-提交OA待审批*/
private String isFinish;
/** 明细 */
List<QuotMaterial> materials;
public Integer getUserId() {
return userId;
}
public void setUserId(Integer userId) {
this.userId = userId;
}
public Integer getDepartmentId() {
return departmentId;
}
public void setDepartmentId(Integer departmentId) {
this.departmentId = departmentId;
}
public String getSubmissionTime() {
return submissionTime;
}
public void setSubmissionTime(String submissionTime) {
this.submissionTime = submissionTime;
}
public String getQuotId() {
return quotId;
}
public void setQuotId(String quotId) {
this.quotId = quotId;
}
public String getQuotCode() {
return quotCode;
}
public void setQuotCode(String quotCode) {
this.quotCode = quotCode;
}
public String getQuotSalesmanName() {
return quotSalesmanName;
}
public void setQuotSalesmanName(String quotSalesmanName) {
this.quotSalesmanName = quotSalesmanName;
}
public String getQuotCustomerName() {
return quotCustomerName;
}
public void setQuotCustomerName(String quotCustomerName) {
this.quotCustomerName = quotCustomerName;
}
public String getQuotAddress() {
return quotAddress;
}
public void setQuotAddress(String quotAddress) {
this.quotAddress = quotAddress;
}
public String getQuotPhone() {
return quotPhone;
}
public void setQuotPhone(String quotPhone) {
this.quotPhone = quotPhone;
}
public Date getQuotInquiryDate() {
return quotInquiryDate;
}
public void setQuotInquiryDate(Date quotInquiryDate) {
this.quotInquiryDate = quotInquiryDate;
}
public String getQuotProject() {
return quotProject;
}
public void setQuotProject(String quotProject) {
this.quotProject = quotProject;
}
public String getQuotQuotationRequire() {
return quotQuotationRequire;
}
public void setQuotQuotationRequire(String quotQuotationRequire) {this.quotQuotationRequire = quotQuotationRequire;}
public String getQuotLvPrice() {
return quotLvPrice;
}
public void setQuotLvPrice(String quotLvPrice) {
this.quotLvPrice = quotLvPrice;
}
public String getQuotTongPrice() {
return quotTongPrice;
}
public void setQuotTongPrice(String quotTongPrice) {
this.quotTongPrice = quotTongPrice;
}
public String getQuotMatpriceDiff() {
return quotMatpriceDiff;
}
public void setQuotMatpriceDiff(String quotMatpriceDiff) {
this.quotMatpriceDiff = quotMatpriceDiff;
}
public String getState() { return state; }
public void setState(String state) { this.state = state; }
@Override
public String getRemark() { return remark; }
@Override
public void setRemark(String remark) { this.remark = remark; }
public String getIsFinish() {return isFinish;}
public void setIsFinish(String isFinish) {this.isFinish = isFinish;}
public List<QuotMaterial> getMaterials() {
return materials;
}
public void setMaterials(List<QuotMaterial> materials) {
this.materials = materials;
}
}

View File

@ -0,0 +1,16 @@
package com.ruoyi.quot.domain.jsw;
/**
* 金思维 上传报价单信息
*/
public class QuotJsw {
private QuotJswInfo recBJDInfo;
public QuotJswInfo getRecBJDInfo() {
return recBJDInfo;
}
public void setRecBJDInfo(QuotJswInfo recBJDInfo) {
this.recBJDInfo = recBJDInfo;
}
}

View File

@ -0,0 +1,27 @@
package com.ruoyi.quot.domain.jsw;
import java.util.List;
/**
* 金思维 上传报价单附件信息
*/
public class QuotJswFile {
private String bjdid;
List<QuotJswFiles> fjdata;
public String getBjdid() {
return bjdid;
}
public void setBjdid(String bjdid) {
this.bjdid = bjdid;
}
public List<QuotJswFiles> getFjdata() {
return fjdata;
}
public void setFjdata(List<QuotJswFiles> fjdata) {
this.fjdata = fjdata;
}
}

View File

@ -0,0 +1,25 @@
package com.ruoyi.quot.domain.jsw;
/**
* 金思维 上传报价单附件信息
*/
public class QuotJswFiles {
private String fileName;
private String fileData;
public String getFileName() {
return fileName;
}
public void setFileName(String fileName) {
this.fileName = fileName;
}
public String getFileData() {
return fileData;
}
public void setFileData(String fileData) {
this.fileData = fileData;
}
}

View File

@ -0,0 +1,82 @@
package com.ruoyi.quot.domain.jsw;
import java.util.List;
/**
* 金思维 上传报价单主体信息
*/
public class QuotJswInfo {
private String quotCode;
private String xsy;
private String xsyid;
private String kh;
private String khid;
private String xm;
private String bz;
private List<QuotJswMaterial> quotMaterial;
public String getQuotCode() {
return quotCode;
}
public void setQuotCode(String quotCode) {
this.quotCode = quotCode;
}
public String getXsy() {
return xsy;
}
public void setXsy(String xsy) {
this.xsy = xsy;
}
public String getXsyid() {
return xsyid;
}
public void setXsyid(String xsyid) {
this.xsyid = xsyid;
}
public String getKh() {
return kh;
}
public void setKh(String kh) {
this.kh = kh;
}
public String getKhid() {
return khid;
}
public void setKhid(String khid) {
this.khid = khid;
}
public String getXm() {
return xm;
}
public void setXm(String xm) {
this.xm = xm;
}
public String getBz() {
return bz;
}
public void setBz(String bz) {
this.bz = bz;
}
public List<QuotJswMaterial> getQuotMaterial() {
return quotMaterial;
}
public void setQuotMaterial(List<QuotJswMaterial> quotMaterial) {
this.quotMaterial = quotMaterial;
}
}

View File

@ -0,0 +1,72 @@
package com.ruoyi.quot.domain.jsw;
import java.math.BigDecimal;
/**
* 金思维 上传报价单产品信息
*/
public class QuotJswMaterial {
private String matXingh;
private String matGuig;
private String matDiany;
private String matStandard;
private BigDecimal matSl;
private String matDanw;
private String matRemark;
public String getMatXingh() {
return matXingh;
}
public void setMatXingh(String matXingh) {
this.matXingh = matXingh;
}
public String getMatGuig() {
return matGuig;
}
public void setMatGuig(String matGuig) {
this.matGuig = matGuig;
}
public String getMatDiany() {
return matDiany;
}
public void setMatDiany(String matDiany) {
this.matDiany = matDiany;
}
public String getMatStandard() {
return matStandard;
}
public void setMatStandard(String matStandard) {
this.matStandard = matStandard;
}
public BigDecimal getMatSl() {
return matSl;
}
public void setMatSl(BigDecimal matSl) {
this.matSl = matSl;
}
public String getMatDanw() {
return matDanw;
}
public void setMatDanw(String matDanw) {
this.matDanw = matDanw;
}
public String getMatRemark() {
return matRemark;
}
public void setMatRemark(String matRemark) {
this.matRemark = matRemark;
}
}

View File

@ -0,0 +1,43 @@
package com.ruoyi.quot.domain.jsw;
/**
* 金思维 接口返回信息
*/
public class QuotJswResult {
private Boolean Success;
private String Message;
private String ErrorMessage;
private String Key;
public Boolean getSuccess() {
return Success;
}
public void setSuccess(Boolean success) {
Success = success;
}
public String getMessage() {
return Message;
}
public void setMessage(String message) {
Message = message;
}
public String getErrorMessage() {
return ErrorMessage;
}
public void setErrorMessage(String errorMessage) {
ErrorMessage = errorMessage;
}
public String getKey() {
return Key;
}
public void setKey(String key) {
Key = key;
}
}

View File

@ -0,0 +1,47 @@
package com.ruoyi.quot.domain.jsw;
public class QuotJswUser {
private String userId;
private String password;
private String clientType;
private String epId;
public QuotJswUser(String userId, String password, String clientType, String epId) {
this.userId = userId;
this.password = password;
this.clientType = clientType;
this.epId = epId;
}
public String getUserId() {
return userId;
}
public void setUserId(String userId) {
this.userId = userId;
}
public String getPassword() {
return password;
}
public void setPassword(String password) {
this.password = password;
}
public String getClientType() {
return clientType;
}
public void setClientType(String clientType) {
this.clientType = clientType;
}
public String getEpId() {
return epId;
}
public void setEpId(String epId) {
this.epId = epId;
}
}

View File

@ -0,0 +1,30 @@
package com.ruoyi.quot.domain.jsw;
/**
* 金思维 用户认证 返回信息
*/
public class QuotJswUserResult {
private Boolean Success;
private String ErrorMessage;
private String Message;
public Boolean getSuccess() {
return Success;
}
public void setSuccess(Boolean success) {
Success = success;
}
public String getErrorMessage() {
return ErrorMessage;
}
public void setErrorMessage(String errorMessage) {
ErrorMessage = errorMessage;
}
public String getMessage() { return Message; }
public void setMessage(String message) { Message = message; }
}

View File

@ -0,0 +1,16 @@
package com.ruoyi.quot.domain.jsw;
/**
* 金思维 接口返回信息
*/
public class QuotResultObject {
private QuotJswResult ResultObject;
public QuotJswResult getResultObject() {
return ResultObject;
}
public void setResultObject(QuotJswResult resultObject) {
ResultObject = resultObject;
}
}

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 com.ruoyi.quot.domain.SysOaQuot;
import org.apache.ibatis.annotations.Param;
/**
@ -122,4 +123,28 @@ public interface QuotMapper
*/
String checkExistQuot(@Param("quotSalesmanCode") String username, @Param("quotCustomerBm") String quotCustomerBm, @Param("quotProject") String quotProject);
/**
* 报价单提交OA,插入中间表 sys_oa_quot sys_oa_quot_material
* @param sysOaQuot
*/
void insertSysOAQuot(SysOaQuot sysOaQuot);
/**
* 查询OA用户
* @param loginid
* @return
*/
SysOaQuot selectOAUserByUserName(String loginid);
/**
* 报价单提交OA,插入中间表 sys_oa_quot sys_oa_quot_material
* @param subList
*/
void batchSysOaQuotMaterial(List<QuotMaterial> subList);
/**
* 获取单据编号
* @return
*/
String getCode(String type);
}

View File

@ -4,6 +4,7 @@ import java.util.List;
import com.ruoyi.customer.domain.Customer;
import com.ruoyi.quot.domain.Quot;
import com.ruoyi.quot.domain.SysOaQuot;
/**
* 报价Service接口
@ -105,4 +106,22 @@ public interface IQuotService
*/
Boolean checkExistQuot(String username, String quotCustomerBm, String quotProject);
/**
* 报价单提交OA,插入中间表 sys_oa_quot sys_oa_quot_material
* @param sysOaQuot
*/
void insertSysOAQuot(SysOaQuot sysOaQuot);
/**
* 查询OA用户
* @return
*/
SysOaQuot selectOAUserByUserName(String loginid);
/**
* 获取单据编号
* @return
*/
String getCode(String type);
}

View File

@ -3,9 +3,12 @@ package com.ruoyi.quot.service.impl;
import java.util.List;
import com.ruoyi.common.annotation.DataScope;
import com.ruoyi.common.annotation.DataSource;
import com.ruoyi.common.enums.DataSourceType;
import com.ruoyi.common.utils.DateUtils;
import com.ruoyi.common.utils.uuid.UUID;
import com.ruoyi.customer.domain.Customer;
import com.ruoyi.quot.domain.SysOaQuot;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import java.util.ArrayList;
@ -176,6 +179,26 @@ public class QuotServiceImpl implements IQuotService
return !"0".equals(count);
}
/**
* 报价单提交OA,插入中间表 sys_oa_quot sys_oa_quot_material
* @param sysOaQuot
*/
@Override
public void insertSysOAQuot(SysOaQuot sysOaQuot) {
quotMapper.insertSysOAQuot(sysOaQuot);
insertSysOAQuotMaterial(sysOaQuot);
}
/**
* 查询OA用户
* @return
*/
@Override
@DataSource(DataSourceType.OA)
public SysOaQuot selectOAUserByUserName(String loginid) {
return quotMapper.selectOAUserByUserName(loginid);
}
/**
* 新增报价单-产品信息
*
@ -186,6 +209,37 @@ public class QuotServiceImpl implements IQuotService
List<QuotMaterial> quotMaterialList = quot.getQuotMaterialList();
String quotId = quot.getQuotId();
if (StringUtils.isNotNull(quotMaterialList))
{
List<QuotMaterial> list = new ArrayList<QuotMaterial>();
for (QuotMaterial quotMaterial : quotMaterialList)
{
quotMaterial.setMatId(UUID.fastUUID().toString());
quotMaterial.setMatStandard("G");
quotMaterial.setQuotId(quotId);
list.add(quotMaterial);
}
if (list.size() > 0)
{
int batchSize = 100; // 每批次插入的数据量
for (int i = 0; i < list.size(); i += batchSize) {
int toIndex = Math.min(i + batchSize, list.size());
List<QuotMaterial> subList = list.subList(i, toIndex);
quotMapper.batchQuotMaterial(subList);
}
}
}
}
/**
* 新增报价单-OA产品信息
*
* @param sysOaQuot 报价对象
*/
public void insertSysOAQuotMaterial(SysOaQuot sysOaQuot)
{
List<QuotMaterial> quotMaterialList = sysOaQuot.getMaterials();
String quotId = sysOaQuot.getQuotId();
if (StringUtils.isNotNull(quotMaterialList))
{
List<QuotMaterial> list = new ArrayList<QuotMaterial>();
for (QuotMaterial quotMaterial : quotMaterialList)
@ -201,9 +255,18 @@ public class QuotServiceImpl implements IQuotService
for (int i = 0; i < list.size(); i += batchSize) {
int toIndex = Math.min(i + batchSize, list.size());
List<QuotMaterial> subList = list.subList(i, toIndex);
quotMapper.batchQuotMaterial(subList);
quotMapper.batchSysOaQuotMaterial(subList);
}
}
}
}
/**
* 获取单据编号
* @return
*/
@Override
public String getCode(String type) {
return quotMapper.getCode(type);
}
}

View File

@ -1,17 +1,24 @@
package com.ruoyi.redBook.domain;
import com.ruoyi.common.annotation.Excel;
import java.math.BigDecimal;
public class OAQuotProduct implements Comparable<OAQuotProduct>{
private Integer index;//序号
private String uid_0;//版本uid
private String name_0;//产品型号
@Excel(name = "型号")
private String name_1;//型号
@Excel(name = "规格")
private String spec;//规格
@Excel(name = "电压")
private String voltage;//电压
@Excel(name = "单位")
private String stu;//单位
private String price;//红本价
private BigDecimal setPrice;//单价
@Excel(name = "数量")
private BigDecimal count;//数量
private BigDecimal allPrice;//金额
private String quot_product_id;//id

View File

@ -15,6 +15,9 @@ public class OAQuotProductTemplate {
@Excel(name = "规格")
private String spec;//规格
@Excel(name = "电压")
private String voltage;//电压
@Excel(name = "数量")
private BigDecimal count;//数量
@ -42,6 +45,10 @@ public class OAQuotProductTemplate {
this.spec = spec;
}
public String getVoltage() {return voltage;}
public void setVoltage(String voltage) {this.voltage = voltage;}
public BigDecimal getCount() {
return count;
}

View File

@ -123,7 +123,7 @@ public interface OARedBookMapper
* @param rbUid
* @return
*/
OAQuotProduct getFixDatePrice2(@Param("name_1") String name_1, @Param("spec") String spec, @Param("uid_0") String rbUid);
OAQuotProduct getFixDatePrice2(@Param("name_1") String name_1, @Param("spec") String spec, @Param("voltage") String voltage, @Param("uid_0") String rbUid);
/**
* 查询已生成的报价单列表
@ -153,4 +153,10 @@ public interface OARedBookMapper
*/
String rb_price_version();
/**
* 获取单据编号
* @param type
* @return
*/
String getCode(String type);
}

View File

@ -147,4 +147,10 @@ public interface IRedBookService
*/
List<OAQuotProduct> setRedBookPrice2(List<OAQuotProductTemplate> list);
/**
* 获取单据编号
* @param type
* @return
*/
String getCode(String type);
}

View File

@ -129,6 +129,7 @@ public class RedBookServiceImpl implements IRedBookService
* 修改报价单
* @param quot
*/
@Transactional
@Override
public void updateOAQuot(OAQuot quot) {
quot.setUpdateTime(DateUtils.getNowDate());
@ -202,7 +203,7 @@ public class RedBookServiceImpl implements IRedBookService
* @return
*/
@Override
@DataSource(DataSourceType.REDBOOK)
@DataSource(DataSourceType.OAREDBOOK)
public List<OAQuotProduct> setRedBookPrice(List<OAQuotProduct> list) {
for(OAQuotProduct oAQuotProduct : list){
String price = oaRedBookMapper.getFixDatePrice(oAQuotProduct.getName_0(),oAQuotProduct.getSpec(),oAQuotProduct.getVoltage(),oAQuotProduct.getUid_0());
@ -217,12 +218,12 @@ public class RedBookServiceImpl implements IRedBookService
* @return
*/
@Override
@DataSource(DataSourceType.REDBOOK)
@DataSource(DataSourceType.OAREDBOOK)
public List<OAQuotProduct> setRedBookPrice2(List<OAQuotProductTemplate> list) {
List<OAQuotProduct> OAQuotProducts = new ArrayList<>();
OAQuotProduct oAQuotProduct = new OAQuotProduct();
for(OAQuotProductTemplate oAQuotProductTemplate : list){
OAQuotProduct rbProduct = oaRedBookMapper.getFixDatePrice2(oAQuotProductTemplate.getName_1(),oAQuotProductTemplate.getSpec(),oAQuotProductTemplate.getRbUid());
OAQuotProduct rbProduct = oaRedBookMapper.getFixDatePrice2(oAQuotProductTemplate.getName_1(),oAQuotProductTemplate.getSpec(),oAQuotProductTemplate.getVoltage(),oAQuotProductTemplate.getRbUid());
if(rbProduct!=null){
oAQuotProduct = new OAQuotProduct();
oAQuotProduct.setIndex(oAQuotProductTemplate.getIndex());
@ -240,6 +241,16 @@ public class RedBookServiceImpl implements IRedBookService
return OAQuotProducts;
}
/**
* 获取单据编号
* @param type
* @return
*/
@Override
public String getCode(String type) {
return oaRedBookMapper.getCode(type);
}
/**
* 查询已生成的报价单列表

View File

@ -82,6 +82,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<if test="cusCode != null and cusCode != ''"> and cus_code like concat('%', #{cusCode}, '%')</if>
<if test="cusName != null and cusName != ''"> and cus_name like concat('%', #{cusName}, '%')</if>
<if test="cusSapCode != null and cusSapCode != ''"> and cus_sap_code like concat('%', #{cusSapCode}, '%')</if>
<if test="cusSalesman != null and cusSalesman != ''"> and cus_salesman like concat('%', #{cusSalesman}, '%')</if>
<if test="cusState != null and cusState != ''"> and cus_state = #{cusState}</if>
<if test="cusApprovalStatus != null and cusApprovalStatus != ''"> and cus_approval_status = #{cusApprovalStatus}</if>
<!-- 数据范围过滤 -->
@ -256,4 +257,8 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
( #{item.bankId}, #{item.bankName}, #{item.bankAccount}, #{item.cusId}, #{item.bankCode}, #{item.bankCountry})
</foreach>
</insert>
<select id="getCode" resultType="String" statementType="CALLABLE">
{call GetSerialNo(#{type,mode=IN,jdbcType=VARCHAR})}
</select>
</mapper>

View File

@ -63,9 +63,11 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<where>
<if test="quotHjCode != null and quotHjCode != ''"> and quot_hj_code like concat('%', #{quotHjCode}, '%')</if>
<if test="params.beginQuotHjPricingDate != null and params.beginQuotHjPricingDate != '' and params.endQuotHjPricingDate != null and params.endQuotHjPricingDate != ''"> and quot_hj_pricing_date between #{params.beginQuotHjPricingDate} and #{params.endQuotHjPricingDate}</if>
<if test="quotHjApprovalStatus != null and quotHjApprovalStatus != ''"> and q.quot_hj_approval_status = #{quotHjApprovalStatus}</if>
<!-- 数据范围过滤 -->
<!--${params.dataScope}-->
</where>
order by a.quot_hj_code desc
</select>
<select id="selectQuotHjByQuotHjId" parameterType="String" resultMap="QuotHjResult">

View File

@ -23,14 +23,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<include refid="selectQuotFileVo"/>
<where>
and relation_id = #{relationId}
<if test="fileType != null and fileType != ''">
<if test="fileType == 'quotJsgfFile'">
and file_type in ('quotJsgfFile','quotXjFile')
</if>
<if test="fileType != 'quotJsgfFile'">
and file_type = #{fileType}
</if>
</if>
and file_type = #{fileType}
</where>
order by file_time desc
</select>

View File

@ -16,6 +16,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<result property="quotSalesmanDeptId" column="quot_salesman_dept_id" />
<result property="quotSalesmanDeptName" column="quot_salesman_dept_name" />
<result property="quotAddress" column="quot_address" />
<result property="quotContacts" column="quot_contacts" />
<result property="quotPhone" column="quot_phone" />
<result property="quotInquiryDate" column="quot_inquiry_date" />
<result property="quotProject" column="quot_project" />
@ -28,6 +29,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<result property="quotCheckUserName" column="quot_check_user_name" />
<result property="quotCheckUserNickname" column="quot_check_user_nickname" />
<result property="quotApprovalStatus" column="quot_approval_status" />
<result property="quotMaterialsCount" column="quot_materials_count" />
<result property="quotLvPrice" column="quot_lv_price" />
<result property="quotTongPrice" column="quot_tong_price" />
<result property="quotMatpriceDiff" column="quot_matprice_diff" />
@ -64,6 +66,8 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<result property="quotJswApprovalStatus" column="quot_jsw_approval_status" />
<result property="quotOAApprovalStatus" column="quot_oa_approval_status" />
<result property="quotOAApprovalStatusRemark" column="quot_oa_approval_remark" />
</resultMap>
<resultMap id="QuotQuotMaterialResult" type="Quot" extends="QuotResult">
@ -83,8 +87,11 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<result property="matMatprice" column="sub_mat_matprice" />
<result property="matPrice" column="sub_mat_price" />
<result property="matQuotPrice" column="sub_mat_quot_price" />
<result property="matQuotTp" column="sub_mat_quot_tp" />
<result property="matQuotAllPrice" column="sub_mat_quot_allPrice" />
<result property="matMatpriceDiff" column="sub_mat_matprice_diff" />
<result property="xh" column="sub_xh" />
<result property="index" column="sub_number" />
<result property="quotId" column="sub_quot_id" />
</resultMap>
@ -100,10 +107,10 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<sql id="selectQuotVo">
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_customer_name,a.quot_salesman_dept_id, a.quot_salesman_dept_name, a.quot_address, a.quot_contacts,
a.quot_phone, a.quot_inquiry_date, a.quot_project, a.quot_quotation_date, a.quot_quotation_from,
a.quot_quotation_require, a.quot_feedback_explanation, a.quot_quantity, a.quot_total_price,
a.quot_check_user_name, u2.nick_name quot_check_user_nickname, a.quot_approval_status,
a.quot_check_user_name, u2.nick_name quot_check_user_nickname, a.quot_approval_status,a.quot_materials_count,
a.quot_lv_price,a.quot_tong_price,a.quot_matprice_diff,a.quot_print,u3.nick_name quot_print_user_name,
a.create_by, a.create_time, a.update_by, a.update_time, u.nick_name create_name,
@ -119,7 +126,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
h.quot_hj_code,h.quot_hj_pricing_date,
h.quot_hj_remark,
a.quot_jsw_approval_status,a.quot_oa_approval_status
a.quot_jsw_approval_status,a.quot_oa_approval_status,a.quot_oa_approval_remark
from quot a
<include refid="quotJoins"/>
@ -131,12 +138,13 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<if test="quotCode != null and quotCode != ''"> and quot_code like concat('%', #{quotCode}, '%')</if>
<if test="quotCustomerName != null and quotCustomerName != ''"> and quot_customer_name like concat('%', #{quotCustomerName}, '%')</if>
<if test="quotProject != null and quotProject != ''"> and quot_project like concat('%', #{quotProject}, '%')</if>
<if test="quotSalesmanName != null and quotSalesmanName != ''"> and quot_salesman_name like concat('%', #{quotSalesmanName}, '%')</if>
<if test="quotPrint != null and quotPrint != ''"> and quot_print = #{quotPrint}</if>
<if test="quotApprovalStatus != null and quotApprovalStatus != ''"> and quot_approval_status = #{quotApprovalStatus}</if>
<!-- 数据范围过滤 -->
${params.dataScope}
</where>
order by a.update_time desc
order by a.quot_code desc
</select>
<select id="selectQuotListCount" resultType="String">
@ -145,10 +153,10 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<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,
a.quot_salesman_dept_id, a.quot_salesman_dept_name, a.quot_address, a.quot_contacts, a.quot_phone, a.quot_inquiry_date,
a.quot_project, a.quot_quotation_date, a.quot_quotation_from, a.quot_quotation_require, a.quot_feedback_explanation,
a.quot_quantity, a.quot_total_price, a.quot_check_user_name, u2.nick_name quot_check_user_nickname, a.quot_approval_status,
a.quot_lv_price,a.quot_tong_price,a.quot_matprice_diff,a.quot_print,u3.nick_name quot_print_user_name,
a.quot_materials_count,a.quot_lv_price,a.quot_tong_price,a.quot_matprice_diff,a.quot_print,u3.nick_name quot_print_user_name,
a.create_by, a.create_time, a.update_by, a.update_time,
a.quot_jsxz_standard,a.quot_jsxz_approval_status,a.quot_jsxz_chapter,
@ -163,7 +171,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
h.quot_hj_code,h.quot_hj_pricing_date,
h.quot_hj_remark,
a.quot_jsw_approval_status,a.quot_oa_approval_status,
a.quot_jsw_approval_status,a.quot_oa_approval_status,a.quot_oa_approval_remark,
b.mat_id as sub_mat_id, b.mat_xingh as sub_mat_xingh, b.mat_guig as sub_mat_guig,
b.mat_diany as sub_mat_diany, b.mat_standard as sub_mat_standard, b.mat_danw as sub_mat_danw, b.mat_sl as sub_mat_sl,
@ -171,9 +179,14 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
b.mat_matprice as sub_mat_matprice,
b.mat_price as sub_mat_price,
b.mat_quot_price as sub_mat_quot_price,
b.mat_quot_tp as sub_mat_quot_tp,
b.mat_quot_allPrice as sub_mat_quot_allPrice,
b.mat_matprice_diff as sub_mat_matprice_diff,
b.xh as sub_xh,
b.number as sub_number,
b.quot_id as sub_quot_id
from quot a
left join quot_material b on b.quot_id = a.quot_id
@ -207,6 +220,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<if test="quotSalesmanDeptId != null">quot_salesman_dept_id,</if>
<if test="quotSalesmanDeptName != null">quot_salesman_dept_name,</if>
<if test="quotAddress != null">quot_address,</if>
<if test="quotContacts != null">quot_contacts,</if>
<if test="quotPhone != null">quot_phone,</if>
<if test="quotInquiryDate != null">quot_inquiry_date,</if>
<if test="quotProject != null and quotProject != ''">quot_project,</if>
@ -218,6 +232,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<if test="quotTotalPrice != null">quot_total_price,</if>
<if test="quotCheckUserName != null">quot_check_user_name,</if>
<if test="quotApprovalStatus != null">quot_approval_status,</if>
<if test="quotMaterialsCount != null">quot_materials_count,</if>
<if test="quotLvPrice != null">quot_lv_price,</if>
<if test="quotTongPrice != null">quot_tong_price,</if>
<if test="quotMatpriceDiff != null">quot_matprice_diff,</if>
@ -253,6 +268,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<if test="quotSalesmanDeptId != null">#{quotSalesmanDeptId},</if>
<if test="quotSalesmanDeptName != null">#{quotSalesmanDeptName},</if>
<if test="quotAddress != null">#{quotAddress},</if>
<if test="quotContacts != null">#{quotContacts},</if>
<if test="quotPhone != null">#{quotPhone},</if>
<if test="quotInquiryDate != null">#{quotInquiryDate},</if>
<if test="quotProject != null and quotProject != ''">#{quotProject},</if>
@ -264,6 +280,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<if test="quotTotalPrice != null">#{quotTotalPrice},</if>
<if test="quotCheckUserName != null">#{quotCheckUserName},</if>
<if test="quotApprovalStatus != null">#{quotApprovalStatus},</if>
<if test="quotMaterialsCount != null">#{quotMaterialsCount},</if>
<if test="quotLvPrice != null">#{quotLvPrice},</if>
<if test="quotTongPrice != null">#{quotTongPrice},</if>
<if test="quotMatpriceDiff != null">#{quotMatpriceDiff},</if>
@ -289,6 +306,52 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
</trim>
</insert>
<select id="selectOAUserByUserName" resultType="SysOaQuot">
select top 1 id as userId,departmentid as departmentId from HrmResource where loginid = #{loginid}
</select>
<insert id="insertSysOAQuot" parameterType="SysOaQuot">
insert into sys_oa_quot
<trim prefix="(" suffix=")" suffixOverrides=",">
<if test="userId != null and userId != ''">user_id,</if>
<if test="departmentId != null and departmentId != ''">department_id,</if>
<if test="submissionTime != null and submissionTime != ''">submission_time,</if>
<if test="quotId != null and quotId != ''">quot_id,</if>
<if test="quotCode != null and quotCode != ''">quot_code,</if>
<if test="quotSalesmanName != null and quotSalesmanName != ''">quot_salesman_name,</if>
<if test="quotCustomerName != null and quotCustomerName != ''">quot_customer_name,</if>
<if test="quotAddress != null">quot_address,</if>
<if test="quotPhone != null">quot_phone,</if>
<if test="quotInquiryDate != null">quot_inquiry_date,</if>
<if test="quotProject != null and quotProject != ''">quot_project,</if>
<if test="quotQuotationRequire != null and quotQuotationRequire != ''">quot_quotation_require,</if>
<if test="quotLvPrice != null">quot_lv_price,</if>
<if test="quotTongPrice != null">quot_tong_price,</if>
<if test="quotMatpriceDiff != null">quot_matprice_diff,</if>
<if test="createTime != null">create_time,</if>
<if test="isFinish != null">isFinish,</if>
</trim>
<trim prefix="values (" suffix=")" suffixOverrides=",">
<if test="userId != null and userId != ''">#{userId},</if>
<if test="departmentId != null and departmentId != ''">#{departmentId},</if>
<if test="submissionTime != null and submissionTime != ''">#{submissionTime},</if>
<if test="quotId != null and quotId != ''">#{quotId},</if>
<if test="quotCode != null and quotCode != ''">#{quotCode},</if>
<if test="quotSalesmanName != null and quotSalesmanName != ''">#{quotSalesmanName},</if>
<if test="quotCustomerName != null and quotCustomerName != ''">#{quotCustomerName},</if>
<if test="quotAddress != null">#{quotAddress},</if>
<if test="quotPhone != null">#{quotPhone},</if>
<if test="quotInquiryDate != null">#{quotInquiryDate},</if>
<if test="quotProject != null and quotProject != ''">#{quotProject},</if>
<if test="quotQuotationRequire != null and quotQuotationRequire != ''">#{quotQuotationRequire},</if>
<if test="quotLvPrice != null">#{quotLvPrice},</if>
<if test="quotTongPrice != null">#{quotTongPrice},</if>
<if test="quotMatpriceDiff != null">#{quotMatpriceDiff},</if>
<if test="createTime != null">#{createTime},</if>
<if test="isFinish != null">#{isFinish},</if>
</trim>
</insert>
<update id="updateQuot" parameterType="Quot">
update quot
<trim prefix="SET" suffixOverrides=",">
@ -302,6 +365,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<if test="quotSalesmanDeptId != null">quot_salesman_dept_id = #{quotSalesmanDeptId},</if>
<if test="quotSalesmanDeptName != null">quot_salesman_dept_name = #{quotSalesmanDeptName},</if>
<if test="quotAddress != null">quot_address = #{quotAddress},</if>
<if test="quotContacts != null">quot_contacts = #{quotContacts},</if>
<if test="quotPhone != null">quot_phone = #{quotPhone},</if>
<if test="quotInquiryDate != null">quot_inquiry_date = #{quotInquiryDate},</if>
<if test="quotProject != null and quotProject != ''">quot_project = #{quotProject},</if>
@ -313,6 +377,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<if test="quotTotalPrice != null">quot_total_price = #{quotTotalPrice},</if>
<if test="quotCheckUserName != null">quot_check_user_name = #{quotCheckUserName},</if>
<if test="quotApprovalStatus != null">quot_approval_status = #{quotApprovalStatus},</if>
<if test="quotMaterialsCount != null">quot_materials_count = #{quotMaterialsCount},</if>
<if test="quotLvPrice != null">quot_lv_price = #{quotLvPrice},</if>
<if test="quotTongPrice != null">quot_tong_price = #{quotTongPrice},</if>
<if test="quotMatpriceDiff != null">quot_matprice_diff = #{quotMatpriceDiff},</if>
@ -368,6 +433,13 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
</foreach>
</insert>
<insert id="batchSysOaQuotMaterial">
insert into sys_oa_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_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.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.matQuotAllPrice,jdbcType=DECIMAL} as decimal(18,3)), cast(#{item.matMatpriceDiff,jdbcType=DECIMAL} as decimal(18,3)))
</foreach>
</insert>
<select id="selectQuotByQuotJsqrId" parameterType="String" resultMap="QuotQuotMaterialResult">
select a.quot_id, a.quot_code, a.quot_salesman_bm, a.quot_salesman_name, a.quot_customer_name,
a.quot_salesman_dept_id, a.quot_salesman_dept_name, a.quot_address, a.quot_phone, a.quot_inquiry_date,
@ -424,4 +496,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
where a.quot_hj_id = #{quotHjId}
</select>
<select id="getCode" resultType="String" statementType="CALLABLE">
{call GetSerialNo(#{type,mode=IN,jdbcType=VARCHAR})}
</select>
</mapper>

View File

@ -178,7 +178,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
convert(decimal,convert(float,A.红本价格)) price,convert(varchar(10),B.date_0,23) pricedate
from [rb_product_price] A
left join rb_productVersion B on A.version_uid_0=B.uid_0
where A.型号 = #{name_1} and A.规格 = #{spec}
where A.型号 = #{name_1} and A.规格 = #{spec} and UPPER(A.电压等级) = #{voltage}
and B.uid_0 = #{uid_0}
and (B.sta_0=1 or sta_0=0)
</select>
@ -209,7 +209,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<!-- 数据范围过滤 -->
${params.dataScope}
</where>
order by a.update_time desc
order by a.quotCode desc
</select>
<resultMap type="OAQuot" id="QuotResult">
@ -270,4 +270,8 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
)a order by date_0 desc
</select>
<select id="getCode" resultType="String" statementType="CALLABLE">
{call GetSerialNo(#{type,mode=IN,jdbcType=VARCHAR})}
</select>
</mapper>

View File

@ -114,7 +114,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<!-- 数据范围过滤 -->
<!--${params.dataScope}-->
</where>
order by a.update_time desc
order by a.quot_jsqr_code desc
</select>
<select id="selectQuotJsqrByQuotJsqrId" parameterType="String" resultMap="QuotJsqrResult">

View File

@ -7,6 +7,7 @@
<div class="right-menu">
<template v-if="device!=='mobile'">
<search id="header-search" class="right-menu-item" />
<!--<el-tooltip content="源码地址" effect="dark" placement="bottom">
@ -41,6 +42,7 @@
<el-dropdown class="avatar-container right-menu-item hover-effect" trigger="click">
<div class="avatar-wrapper">
<img :src="avatar" class="user-avatar">
{{this.$store.state.user.nickName}}
<i class="el-icon-caret-bottom" />
</div>
<el-dropdown-menu slot="dropdown">

View File

@ -7,6 +7,7 @@ const user = {
token: getToken(),
id: '',
name: '',
nickName: '',
avatar: '',
roles: [],
permissions: [],

View File

@ -106,6 +106,8 @@
this.total = response.data.length;
this.currentPage = 1;
this.loading = false;
},response => {
this.loading = false;
});
},
/** 搜索按钮操作 */

View File

@ -25,6 +25,14 @@
@keyup.enter.native="handleQuery"
/>
</el-form-item>
<el-form-item label="业务员" prop="cusSalesman" v-if="checkRole(['ITZX_SJZ'])">
<el-input
v-model="queryParams.cusSalesman"
placeholder="请输入业务员"
clearable
@keyup.enter.native="handleQuery"
/>
</el-form-item>
<!--<el-form-item label="状态" prop="cusState">
<el-select v-model="queryParams.cusState" placeholder="请选择客户禁用状态" clearable>
<el-option
@ -1171,6 +1179,8 @@ export default {
//this.qccTotal = response.total;
//this.qccCurrentPage = 1;
this.qccLoading = false;
},response => {
this.qccLoading = false;
});
});
},
@ -1242,6 +1252,8 @@ export default {
this.bankCodeTotal = response.total;
this.bankCodeCurrentPage = 1;
this.bankCodeLoading = false;
},response => {
this.bankCodeLoading = false;
});
},

View File

@ -15,20 +15,7 @@
</el-form-item>
</el-col>
</el-row>
<el-row :gutter="8">
<el-col :span="8">
<el-form-item label="核价日期" prop="quotHjPricingDate">
<div class="el-p" style="width:100%">
<el-date-picker
style="width:100%"
v-model="form.quotHjPricingDate"
type="datetime"
placeholder="系统自动生成"
:disabled="true">
</el-date-picker>
</div>
</el-form-item>
</el-col>
<!-- <el-row :gutter="8">
<el-col :span="8">
<el-form-item label="核价类型" prop="quotHjPricingType">
<el-select v-model="form.quotHjPricingType" style="width: 100%;" :disabled="true">
@ -41,23 +28,38 @@
</el-select>
</el-form-item>
</el-col>
<el-col :span="8">
<el-form-item label="业务员" prop="quotSalesmanName">
<el-input v-model="form.quotSalesmanName" :disabled="true"/>
</el-form-item>
</el-col>
</el-row>
</el-row>-->
<el-row :gutter="8">
<el-col :span="16">
<el-col :span="12">
<el-form-item label="客户" prop="quotCustomerName">
<el-input v-model="form.quotCustomerName" :disabled="true"/>
</el-form-item>
</el-col>
<el-col :span="16">
<el-col :span="12">
<el-form-item label="核价日期" prop="quotHjPricingDate">
<div class="el-p" style="width:100%">
<el-date-picker
style="width:100%"
v-model="form.quotHjPricingDate"
type="datetime"
placeholder="系统自动生成"
:disabled="true">
</el-date-picker>
</div>
</el-form-item>
</el-col>
</el-row>
<el-row :gutter="8">
<el-col :span="12">
<el-form-item label="项目名称" prop="quotProject">
<el-input type="textarea" autosize v-model="form.quotProject" :disabled="true"/>
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="业务员" prop="quotSalesmanName">
<el-input v-model="form.quotSalesmanName" :disabled="true"/>
</el-form-item>
</el-col>
</el-row>
<el-row :gutter="8">
<el-col :span="24">
@ -66,10 +68,68 @@
</el-form-item>
</el-col>
</el-row>
<el-divider content-position="center">产品信息</el-divider>
<el-table :data="quotMaterialList" height="300px" show-summary :summary-method="getSummaries" :row-class-name="rowQuotMaterialIndex" ref="quotMaterial">
<el-table-column type="selection" width="80" align="center" />
<el-table-column label="序号" align="center" prop="index" width="50"/>
<el-table-column label="型号" prop="matXingh" width="180">
<template slot-scope="scope">
<el-input v-model="scope.row.matXingh" placeholder="型号" :disabled="true"/>
</template>
</el-table-column>
<el-table-column label="规格" prop="matGuig" width="150">
<template slot-scope="scope">
<el-input v-model="scope.row.matGuig" placeholder="规格" :disabled="true"/>
</template>
</el-table-column>
<el-table-column label="电压" prop="matDiany" width="130">
<template slot-scope="scope">
<el-input v-model="scope.row.matDiany" placeholder="电压" :disabled="true"/>
</template>
</el-table-column>
<el-table-column label="单位" prop="matDanw" width="100">
<template slot-scope="scope">
<el-input v-model="scope.row.matDanw" placeholder="单位" :disabled="true"/>
</template>
</el-table-column>
<el-table-column label="数量" prop="matSl" width="100">
<template slot-scope="scope">
<el-input v-model="scope.row.matSl" placeholder="数量" :disabled="true"/>
</template>
</el-table-column>
<el-table-column label="备注" prop="matRemark" width="180">
<template slot-scope="scope">
<el-input v-model="scope.row.matRemark" placeholder="备注" :disabled="true"/>
</template>
</el-table-column>
</el-table>
<el-row :gutter="8">
<el-col :span="24">
<el-divider content-position="center">询价附件</el-divider>
<el-table class="down" :data="quotXjFileList" border stripe style="width: 100%;" height="150px">
<el-table class="down" :data="quotXjFileList" border stripe style="width: 100%;" height="200px">
<el-table-column prop="fileName" label="文件名称" width="450px"></el-table-column>
<el-table-column prop="fileSize" label="文件大小" width="100px">
<template slot-scope="scope">
<span v-if="scope.row.fileSize / 1024 / 1024 < 1">{{(scope.row.fileSize / 1024).toFixed(2) + 'KB'}}</span>
<span v-else>{{(scope.row.fileSize / 1024 / 1024).toFixed(2) + 'MB'}}</span>
</template>
</el-table-column>
<el-table-column prop="fileTime" label="上传时间"></el-table-column>
<el-table-column width="150px" label="操作">
<template slot-scope="scope">
<el-button :key="Math.random()" size="small" type="text">
<a @click="downloadFile(scope.row.fileUrl)">下载</a>
</el-button>
</template>
</el-table-column>
</el-table>
</el-col>
</el-row>
<el-row :gutter="8">
<el-col :span="24">
<el-divider content-position="center">技术附件</el-divider>
<el-table class="down" :data="quotJsgfFileList" border stripe style="width: 100%;" height="200px">
<el-table-column prop="fileName" label="文件名称" width="450px"></el-table-column>
<el-table-column prop="fileSize" label="文件大小" width="100px">
<template slot-scope="scope">
@ -98,6 +158,7 @@
:action="uploadUrl"
:headers="headers"
:data="{ relation_id: this.form.quotHjId,file_type: 'quotHjFile' }"
:before-upload="beforeAvatarUpload"
:on-success="handleAvatarSuccess"
:show-file-list="false"
:limit="1"
@ -109,7 +170,7 @@
</el-row>
<el-row :gutter="8">
<el-col :span="24">
<el-table class="down" :data="quotHjFileList" border stripe style="width: 100%;" height="150px">
<el-table class="down" v-loading="quotHjFileLoading" :data="quotHjFileList" border stripe style="width: 100%;margin-top: 10px;" height="200px">
<el-table-column prop="fileName" label="文件名称"></el-table-column>
<el-table-column prop="fileSize" label="文件大小" width="150px">
<template slot-scope="scope">
@ -314,9 +375,10 @@
}
</style>
<script>
import { NumberAdd } from '@/utils/number';//
import { getPriceVerification, commitHj, rejectHj } from "@/api/priceVerification/priceVerification";
import { getToken } from "@/utils/auth";
import { quotFileList, quotFileDelete} from "@/api/quot/quot";
import {getQuot, quotFileList, quotFileDelete} from "@/api/quot/quot";
/** 弹窗放大、拖拽 */
import elDragDialog from "@/directive/dialog/dragDialog";
@ -334,9 +396,14 @@ export default {
open: false,
//
isSelfProp: true,
//
quotMaterialList: [],
// -
quotXjFileList: [],
// -
quotJsgfFileList: [],
// -
quotHjFileLoading: false,
quotHjFileList: [],
//-
uploadUrl: process.env.VUE_APP_BASE_API + "/quot/quot/quotFile",
@ -379,7 +446,9 @@ export default {
quotProject: null,
quotHjRemark: null
};
this.quotMaterialList = [];
this.quotXjFileList = [];
this.quotJsgfFileList = [];
this.quotHjFileList = [];
this.showTl = false;
@ -402,9 +471,15 @@ export default {
this.reset();
getPriceVerification(quotHjId).then(response => {
this.form = response.data;
getQuot(this.form.quotId).then(response => {
this.quotMaterialList = response.data.quotMaterialList;
});
this.open = true;
this.title = "核价单信息";
this.getQuotXjFileList();
this.getQuotJsgfFileList();
this.getQuotHjFileList();
const quotJsxzGroup = this.form.quotJsxzGroupValues;
@ -491,7 +566,7 @@ export default {
rejectHj(this.form).then(response => {
this.$modal.msgSuccess("驳回成功");
this.open = false;
this.getList();
this.$emit('refreshList');
});
},
@ -502,6 +577,13 @@ export default {
this.quotXjFileList = response.rows;
});
},
//-
getQuotJsgfFileList(){
const param = {relationId:this.form.quotId,fileType:'quotJsgfFile'}
quotFileList(param).then(response => {
this.quotJsgfFileList = response.rows;
});
},
//-
getQuotHjFileList(){
const param = {relationId:this.form.quotHjId,fileType:'quotHjFile'}
@ -509,7 +591,10 @@ export default {
this.quotHjFileList = response.rows;
});
},
//
beforeAvatarUpload(file){
this.quotHjFileLoading = true;
},
//
handleAvatarSuccess(res) {
//
@ -519,6 +604,7 @@ export default {
} else {
this.$modal.msgError(res.msg);
}
this.quotHjFileLoading = false;
this.$refs.upload.clearFiles(); //****
},
@ -530,10 +616,46 @@ export default {
//
deleteFile(fileId){
let activeName = this.activeName;
this.quotHjFileLoading = true;
quotFileDelete(fileId).then(response => {
this.getQuotHjFileList();
this.quotHjFileLoading = false;
});
}
},
/** 对产品数据-数量、金额进行合算 */
getSummaries(param) {
const { columns, data } = param;
const sums = [];
columns.forEach((column, index) => {
if (index === 0) {
sums[index] = '合计';
return;
}
const values = data.map(item => Number(item[column.property]));
if (column.property === 'matSl' || column.property === 'matQuotAllPrice') {
if (!values.every(value => isNaN(value))) {
sums[index] = values.reduce((prev, curr) => {
const value = Number(curr);
if (!isNaN(value)) {
return NumberAdd(prev,curr);
}else {
return prev;
}
}, 0);
} else {
sums[index] = ''
}
}
});
return sums;
},
/** 报价单-产品序号 */
rowQuotMaterialIndex({ row, rowIndex }) {
row.index = rowIndex + 1;
},
}
};
</script>

View File

@ -20,6 +20,16 @@
end-placeholder="结束日期"
></el-date-picker>
</el-form-item>
<el-form-item label="核价协助状态" prop="quotHjApprovalStatus">
<el-select v-model="queryParams.quotHjApprovalStatus" placeholder="请选择核价协助状态" clearable>
<el-option
v-for="dict in dict.type.quot_hj_approval_status"
:key="dict.value"
:label="dict.label"
:value="dict.value"
/>
</el-select>
</el-form-item>
<el-form-item>
<el-button type="primary" icon="el-icon-search" size="mini" @click="handleQuery">搜索</el-button>
<el-button icon="el-icon-refresh" size="mini" @click="resetQuery">重置</el-button>

View File

@ -25,6 +25,14 @@
@keyup.enter.native="handleQuery"
/>
</el-form-item>
<el-form-item label="业务员" prop="quotSalesmanName" v-if="checkRole(['QUOT'])">
<el-input
v-model="queryParams.quotSalesmanName"
placeholder="请输入业务员"
clearable
@keyup.enter.native="handleQuery"
/>
</el-form-item>
<el-form-item label="是否打印" prop="quotPrint">
<el-select v-model="queryParams.quotPrint" placeholder="请选择打印状态" clearable>
<el-option
@ -121,6 +129,29 @@
<dict-tag :options="dict.type.quot_approval_status" :value="scope.row.quotApprovalStatus"/>
</template>
</el-table-column>
<el-table-column label="业务员" align="center" prop="quotSalesmanName" width="150px"/>
<el-table-column label="客户名称" align="center" prop="quotCustomerName" width="250px"/>
<el-table-column label="项目名称" align="center" prop="quotProject" width="250px"/>
<el-table-column label="金思维提交状态" align="center" prop="quotJsxzApprovalStatus" width="150px" v-if="checkRole(['QUOT'])">
<template slot-scope="scope">
<dict-tag :options="dict.type.quot_jsw_approval_status" :value="scope.row.quotJswApprovalStatus" v-if="scope.row.quotJswApprovalStatus!=0"/>
</template>
</el-table-column>
<el-table-column label="OA提交状态" align="center" prop="quotJsxzApprovalStatus" width="150px" v-if="checkRole(['QUOT'])">
<template slot-scope="scope">
<dict-tag :options="dict.type.quot_oa_approval_status" :value="scope.row.quotOAApprovalStatus" v-if="scope.row.quotOAApprovalStatus!=0"/>
</template>
</el-table-column>
<el-table-column label="技术协助状态" align="center" prop="quotJsxzApprovalStatus" width="150px" v-if="checkRole(['QUOT'])">
<template slot-scope="scope">
<dict-tag :options="dict.type.quot_jsxz_approval_status" :value="scope.row.quotJsxzApprovalStatus" v-if="scope.row.quotJsxzApprovalStatus!=0"/>
</template>
</el-table-column>
<el-table-column label="核价协助状态" align="center" prop="quotHjApprovalStatus" width="150px" v-if="checkRole(['QUOT'])">
<template slot-scope="scope">
<dict-tag :options="dict.type.quot_hj_approval_status" :value="scope.row.quotHjApprovalStatus" v-if="scope.row.quotHjApprovalStatus!=0"/>
</template>
</el-table-column>
<el-table-column label="是否打印" align="center" prop="quotPrint" v-if="$auth.hasPermi('quot:quot:changQuotPrintStatus')">
<template slot-scope="scope">
<el-switch
@ -128,13 +159,12 @@
active-value="0"
inactive-value="1"
@change="handleStatusChange(scope.row)"
:disabled="scope.row.quotPrint=='0'"
></el-switch>
</template>
</el-table-column>
<el-table-column label="打印人" align="center" prop="quotPrintUserName" width="150px" v-if="$auth.hasPermi('quot:quot:changQuotPrintStatus')"/>
<el-table-column label="业务员" align="center" prop="quotSalesmanName" width="150px"/>
<el-table-column label="客户名称" align="center" prop="quotCustomerName" width="250px"/>
<el-table-column label="项目名称" align="center" prop="quotProject" width="250px"/>
<el-table-column label="金思维报价单号" align="center" prop="quotJswCode" width="280px" v-if="checkRole(['QUOT'])"/>
<el-table-column label="询价日期" align="center" prop="quotInquiryDate" width="160">
<template slot-scope="scope">
<span>{{ parseTime(scope.row.quotInquiryDate) }}</span>
@ -147,16 +177,6 @@
</el-table-column>
<el-table-column label="数量" align="center" prop="quotQuantity" width="100"/>
<el-table-column label="反馈说明" align="center" prop="quotFeedbackExplanation" width="150px"/>
<el-table-column label="技术协助状态" align="center" prop="quotJsxzApprovalStatus" width="150px">
<template slot-scope="scope">
<dict-tag :options="dict.type.quot_jsxz_approval_status" :value="scope.row.quotJsxzApprovalStatus" v-if="scope.row.quotJsxzApprovalStatus!=0"/>
</template>
</el-table-column>
<el-table-column label="核价协助状态" align="center" prop="quotHjApprovalStatus" width="150px">
<template slot-scope="scope">
<dict-tag :options="dict.type.quot_hj_approval_status" :value="scope.row.quotHjApprovalStatus" v-if="scope.row.quotHjApprovalStatus!=0"/>
</template>
</el-table-column>
<el-table-column label="创建人" align="center" prop="createName" width="150px"/>
<el-table-column label="创建时间" align="center" prop="createTime" width="160">
<template slot-scope="scope">
@ -179,7 +199,7 @@
<template slot="title">
报价单信息<span style="color:red;margin-left:25px">(此报价单数据型号规格电压等如需下单或签订合同引用请再次自行核对责任自负)</span>
</template>
<el-form ref="form" :model="form" :rules="rules" label-width="100px">
<el-form ref="form" :model="form" :rules="rules" label-width="120px">
<el-divider content-position="left" class="customer_divider_text">当前协助情况</el-divider>
<el-row>
<el-col :span="4">
@ -200,12 +220,12 @@
</el-col>
<el-col :span="4">
<el-form-item label="金思维协助" prop="quotJswApprovalStatus">
<dict-tag :options="dict.type.quot_approval_status" :value="this.form.quotJswApprovalStatus"/>
<dict-tag :options="dict.type.quot_jsw_approval_status" :value="this.form.quotJswApprovalStatus"/>
</el-form-item>
</el-col>
<el-col :span="4">
<el-form-item label="OA审批" prop="quotOAApprovalStatus">
<dict-tag :options="dict.type.quot_approval_status" :value="this.form.quotOAApprovalStatus"/>
<dict-tag :options="dict.type.quot_oa_approval_status" :value="this.form.quotOAApprovalStatus"/>
</el-form-item>
</el-col>
</div>
@ -213,15 +233,18 @@
<el-divider content-position="left" class="customer_divider_text">报价信息</el-divider>
<el-row :gutter="8">
<el-col :span="10">
<el-col :span="8">
<el-form-item label="报价单号" prop="quotCode">
<el-input v-model="form.quotCode" placeholder="系统自动生成" :disabled="true"/>
</el-form-item>
</el-col>
<el-col :span="6">
<el-col :span="8">
<el-form-item label="业务员" prop="quotSalesmanName">
<el-input v-model="form.quotSalesmanName" :disabled="true"/>
<el-input v-model="form.quotSalesmanName" :disabled="true" style="width: 60%"/>
<el-input v-model="form.quotSalesmanBm" v-if="false"/>
<el-input v-model="form.quotSalesmanCode" v-if="false"/>
<el-button type="primary" icon="el-icon-search" style="margin-left: 10px" @click="openPeopleSelect" size="mini" v-if="checkRole(['QUOT','PRICE_VERIFICATION'])"></el-button>
</el-form-item>
</el-col>
<el-col :span="8">
@ -293,145 +316,81 @@
</el-form-item>
</el-col>
</el-row>
<div v-if="checkRole(['QUOT'])">
<el-row :gutter="8" v-if="this.form.quotApprovalStatus != '0' && this.form.quotApprovalStatus != null">
<el-col :span="12">
<el-form-item label="总数量" prop="quotQuantity">
<el-input v-model="form.quotQuantity" :disabled="form.quotApprovalStatus == '2' || form.quotApprovalStatus == '3'"/>
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="总价" prop="quotTotalPrice">
<el-input v-model="form.quotTotalPrice" :disabled="form.quotApprovalStatus == '2' || form.quotApprovalStatus == '3'"/>
</el-form-item>
</el-col>
</el-row>
</div>
<div v-if="checkRole(['QUOT'])">
<el-row :gutter="8" v-if="this.form.quotApprovalStatus != '0' && this.form.quotApprovalStatus != null">
<el-col :span="12">
<el-form-item label="是否打印" prop="quotPrint">
<el-switch
v-model="form.quotPrint"
active-value="0"
inactive-value="1"
:disabled="true"
></el-switch>
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="打印人" prop="quotPrintUserName">
<el-input v-model="form.quotPrintUserName" :disabled="true"/>
</el-form-item>
</el-col>
</el-row>
</div>
<el-row :gutter="8" v-if="this.form.quotApprovalStatus != '0' && this.form.quotApprovalStatus != null">
<el-col :span="24">
<el-form-item label="反馈说明" prop="quotFeedbackExplanation">
<el-input type="textarea" autosize v-model="form.quotFeedbackExplanation" placeholder="报价组填写"/>
<el-col :span="6" v-if="checkRole(['QUOT','PRICE_VERIFICATION'])">
<el-form-item label="明细条数" prop="quotMaterialsCount">
<el-input v-model="form.quotMaterialsCount" :disabled="form.quotApprovalStatus == '2' || form.quotApprovalStatus == '3'"/>
</el-form-item>
</el-col>
<el-col :span="6" v-if="checkRole(['QUOT','PRICE_VERIFICATION'])">
<el-form-item label="总价" prop="quotTotalPrice">
<el-input v-model="form.quotTotalPrice" :disabled="form.quotApprovalStatus == '2' || form.quotApprovalStatus == '3'"/>
</el-form-item>
</el-col>
<el-col :span="6" v-if="checkRole(['QUOT','PRICE_VERIFICATION'])">
<el-form-item label="是否打印" prop="quotPrint">
<el-select v-model="form.quotPrint" :disabled="true">
<el-option
v-for="dict in dict.type.quot_print"
:key="dict.value"
:label="dict.label"
:value="dict.value"
/>
</el-select>
</el-form-item>
</el-col>
<el-col :span="6" v-if="checkRole(['QUOT','PRICE_VERIFICATION'])">
<el-form-item label="打印人" prop="quotPrintUserName">
<el-input v-model="form.quotPrintUserName" :disabled="true"/>
</el-form-item>
</el-col>
</el-row>
<el-divider content-position="left" class="customer_divider_text">反馈附件</el-divider>
<div v-hasPermi="['quot:quot:quotFkFile']" >
<el-upload class="upload-demo"
ref="upload"
name="quotFile"
:action="uploadUrl"
:headers="headers"
:data="{ relation_id: this.form.quotId,file_type: 'quotFkFile' }"
:on-success="handleAvatarSuccess"
:show-file-list="false"
:limit="1"
v-if="this.form.quotApprovalStatus == '1'">
<el-button size="small" type="primary" @click="uploadFile('quotFkFile')">上传文件</el-button>
</el-upload>
</div>
<el-table class="down" :data="quotFkFileList" border stripe style="width: 100%;margin-top: 10px;" height="300px">
<el-table-column prop="fileName" label="文件名称"></el-table-column>
<el-table-column prop="fileSize" label="文件大小" width="150px">
<template slot-scope="scope">
<span v-if="scope.row.fileSize / 1024 / 1024 < 1">{{(scope.row.fileSize / 1024).toFixed(2) + 'KB'}}</span>
<span v-else>{{(scope.row.fileSize / 1024 / 1024).toFixed(2) + 'MB'}}</span>
</template>
</el-table-column>
<el-table-column prop="fileTime" label="上传时间" width="200px"></el-table-column>
<el-table-column width="150px" label="操作">
<template slot-scope="scope">
<el-button size="small" type="text">
<a @click="downloadFile(scope.row.fileUrl)">下载</a>
</el-button>
<el-button size="small" type="text" @click="deleteFile(scope.row.fileId,'quotFkFile')" v-if="form.quotApprovalStatus == '1'">删除</el-button>
</template>
</el-table-column>
</el-table>
<el-divider content-position="left" class="customer_divider_text">产品信息</el-divider>
<el-row :gutter="10" class="mb8">
<el-col :span="1.5">
<el-button type="primary" icon="el-icon-plus" size="mini" @click="handleAddQuotMaterial" v-if="this.form.quotApprovalStatus == '0' || this.form.quotApprovalStatus == null">添加</el-button>
<el-row :gutter="8">
<el-col :span="6" v-if="checkRole(['QUOT','PRICE_VERIFICATION'])">
<el-form-item label="总数量" prop="quotQuantity">
<el-input v-model="form.quotQuantity" :disabled="true"/>
</el-form-item>
</el-col>
<el-col :span="1.5">
<el-button type="danger" icon="el-icon-delete" size="mini" @click="handleDeleteQuotMaterial" v-if="this.form.quotApprovalStatus == '0' || this.form.quotApprovalStatus == null">删除</el-button>
<el-col :span="6" v-if="checkRole(['QUOT','PRICE_VERIFICATION'])">
<el-form-item label="铜价" prop="quotTongPrice">
<el-input v-model="form.quotTongPrice" :disabled="true"/>
</el-form-item>
</el-col>
<el-col :span="1.5">
<el-button type="info" plain icon="el-icon-upload2" size="mini" @click="handleImport" v-if="this.form.quotApprovalStatus == '0' || this.form.quotApprovalStatus == null">导入</el-button>
<el-col :span="6" v-if="checkRole(['QUOT','PRICE_VERIFICATION'])">
<el-form-item label="铝价" prop="quotLvPrice">
<el-input v-model="form.quotLvPrice" :disabled="true"/>
</el-form-item>
</el-col>
<el-col :span="6" v-if="checkRole(['QUOT_MAT_PRICE_DIFF'])">
<el-form-item label="整单料价价差率" prop="quotMatpriceDiff">
<el-input v-model="form.quotMatpriceDiff" :disabled="true"/>
</el-form-item>
</el-col>
</el-row>
<el-row :gutter="8" v-if="checkRole(['QUOT','SALES_MAN'])">
<el-col :span="24" v-if="this.form.quotApprovalStatus != '0' && this.form.quotApprovalStatus != null">
<el-form-item label="反馈说明" prop="quotFeedbackExplanation">
<el-input type="textarea" autosize v-model="form.quotFeedbackExplanation" placeholder="报价组填写" :disabled="this.form.quotApprovalStatus == 2"/>
</el-form-item>
</el-col>
</el-row>
<el-row :gutter="8" v-if="checkRole(['QUOT'])">
<el-col :span="24" v-if="this.form.quotOAApprovalStatus == '2' || this.form.quotOAApprovalStatus == '3'">
<el-form-item label="OA审批说明" prop="quotOAApprovalStatusRemark">
<el-input type="textarea" autosize v-model="form.quotOAApprovalStatusRemark" :disabled="true"/>
</el-form-item>
</el-col>
</el-row>
<el-table :data="quotMaterialList" height="300px" show-summary :summary-method="getSummaries" :row-class-name="rowQuotMaterialIndex" @selection-change="handleQuotMaterialSelectionChange" ref="quotMaterial">
<el-table-column type="selection" width="80" align="center" />
<el-table-column label="序号" align="center" prop="index" width="50"/>
<el-table-column label="型号" prop="matXingh">
<template slot-scope="scope">
<el-input v-model="scope.row.matXingh" placeholder="请输入型号" :disabled="form.quotApprovalStatus != '0' && form.quotApprovalStatus != null"/>
</template>
</el-table-column>
<el-table-column label="规格" prop="matGuig">
<template slot-scope="scope">
<el-input v-model="scope.row.matGuig" placeholder="请输入规格" :disabled="form.quotApprovalStatus != '0' && form.quotApprovalStatus != null"/>
</template>
</el-table-column>
<el-table-column label="电压" prop="matDiany">
<template slot-scope="scope">
<el-input v-model="scope.row.matDiany" placeholder="请输入电压" :disabled="form.quotApprovalStatus != '0' && form.quotApprovalStatus != null"/>
</template>
</el-table-column>
<el-table-column label="单位" prop="matDanw">
<template slot-scope="scope">
<el-input v-model="scope.row.matDanw" placeholder="请输入单位" :disabled="form.quotApprovalStatus != '0' && form.quotApprovalStatus != null"/>
</template>
</el-table-column>
<el-table-column label="数量" prop="matSl">
<template slot-scope="scope">
<el-input v-model="scope.row.matSl" placeholder="请输入数量" :disabled="form.quotApprovalStatus != '0' && form.quotApprovalStatus != null"/>
</template>
</el-table-column>
<el-table-column label="报价" prop="matQuotPrice" v-if="checkRole(['QUOT'])">
<template slot-scope="scope">
<el-input v-model="scope.row.matQuotPrice"/>
</template>
</el-table-column>
<el-table-column label="报价金额" prop="matQuotAllPrice" v-if="checkRole(['QUOT'])">
<template slot-scope="scope">
<el-input v-model="scope.row.matQuotAllPrice"/>
</template>
</el-table-column>
<el-table-column label="备注" prop="matRemark">
<template slot-scope="scope">
<el-input v-model="scope.row.matRemark" placeholder="请输入备注" :disabled="form.quotApprovalStatus != '0' && form.quotApprovalStatus != null"/>
</template>
</el-table-column>
</el-table>
<el-divider content-position="left" class="customer_divider_text">询价附件(先保存再上传产品清单且必须是EXCEL文件)</el-divider>
<el-divider content-position="left" class="customer_divider_text">清单附件(先保存再上传且必须是EXCEL文件)</el-divider>
<div v-hasPermi="['quot:quot:quotXjFile']">
<el-upload class="upload-demo"
ref="upload"
ref="quotXjFileUpload"
name="quotFile"
:action="uploadUrl"
:headers="headers"
:data="{ relation_id: this.form.quotId,file_type: 'quotXjFile' }"
:before-upload="beforeAvatarUploadQuotXjFile"
:on-success="handleAvatarSuccess"
:show-file-list="false"
:limit="1"
@ -439,7 +398,7 @@
<el-button size="small" type="primary" @click="uploadFile('quotXjFile')">上传文件</el-button>
</el-upload>
</div>
<el-table class="down" :data="quotXjFileList" border stripe style="width: 100%;margin-top: 10px;" height="300px">
<el-table class="down" v-loading="quotXjFileLoading" :data="quotXjFileList" border stripe style="width: 100%;margin-top: 10px;" height="200px">
<el-table-column prop="fileName" label="文件名称" ></el-table-column>
<el-table-column prop="fileSize" label="文件大小" width="150px">
<template slot-scope="scope">
@ -460,6 +419,160 @@
</el-table-column>
</el-table>
<el-divider content-position="left" class="customer_divider_text">技术附件(先保存再上传,如包含清单附件则不受理)</el-divider>
<div v-hasPermi="['quot:quot:quotJsgfFile']">
<el-upload class="upload-demo"
ref="quotJsgfFileUpload"
name="quotFile"
:action="uploadUrl"
:headers="headers"
:data="{ relation_id: this.form.quotId,file_type: 'quotJsgfFile' }"
:before-upload="beforeAvatarUploadQuotJsgfFile"
:on-success="handleAvatarSuccess"
:show-file-list="false"
:limit="1"
v-if="this.form.quotApprovalStatus == '0'">
<el-button size="small" type="primary" @click="uploadFile('quotJsgfFile')">上传文件</el-button>
</el-upload>
</div>
<el-table class="down" v-loading="quotJsgfFileLoading" :data="quotJsgfFileList" border stripe style="width: 100%;margin-top: 10px;" height="200px">
<el-table-column prop="fileName" label="文件名称" ></el-table-column>
<el-table-column prop="fileSize" label="文件大小" width="150px">
<template slot-scope="scope">
<span v-if="scope.row.fileSize / 1024 / 1024 < 1">{{(scope.row.fileSize / 1024).toFixed(2) + 'KB'}}</span>
<span v-else>{{(scope.row.fileSize / 1024 / 1024).toFixed(2) + 'MB'}}</span>
</template>
</el-table-column>
<el-table-column prop="fileTime" label="上传时间" width="200px"></el-table-column>
<el-table-column width="150px" label="操作">
<template slot-scope="scope">
<el-button :key="Math.random()" size="small" type="text">
<a @click="downloadFile(scope.row.fileUrl)">下载</a>
</el-button>
<el-button :key="Math.random()" size="small" type="text" v-if="form.quotApprovalStatus == '0'">
<a @click="deleteFile(scope.row.fileId,'quotJsgfFile')">删除</a>
</el-button>
</template>
</el-table-column>
</el-table>
<el-divider content-position="left" class="customer_divider_text">产品信息</el-divider>
<el-row :gutter="10" class="mb8">
<el-col :span="1.5">
<el-button type="primary" icon="el-icon-plus" size="mini" @click="handleAddQuotMaterial" v-if="this.form.quotApprovalStatus == '0' || this.form.quotApprovalStatus == null">添加</el-button>
</el-col>
<el-col :span="1.5">
<el-button type="danger" icon="el-icon-delete" size="mini" @click="handleDeleteQuotMaterial" v-if="this.form.quotApprovalStatus == '0' || this.form.quotApprovalStatus == null">删除</el-button>
</el-col>
<el-col :span="1.5">
<el-button type="info" plain icon="el-icon-upload2" size="mini" @click="handleImport" v-if="(this.form.quotApprovalStatus == '0' || this.form.quotApprovalStatus == null) || checkRole(['QUOT','PRICE_VERIFICATION'])">导入</el-button>
</el-col>
<el-col :span="1.5" v-if="checkRole(['QUOT','PRICE_VERIFICATION'])">
<el-button type="info" plain icon="el-icon-upload2" size="mini" @click="handleExportMaterial">导出</el-button>
</el-col>
</el-row>
<el-table :data="quotMaterialList" height="300px" show-summary :summary-method="getSummaries" :row-class-name="rowQuotMaterialIndex" @selection-change="handleQuotMaterialSelectionChange" ref="quotMaterial">
<el-table-column type="selection" width="80" align="center" />
<el-table-column label="序号" align="center" prop="index" width="50"/>
<el-table-column label="型号" prop="matXingh" width="180">
<template slot-scope="scope">
<el-input v-model="scope.row.matXingh" placeholder="型号" :disabled="form.quotApprovalStatus != '0' && form.quotApprovalStatus != null"/>
</template>
</el-table-column>
<el-table-column label="规格" prop="matGuig" width="150">
<template slot-scope="scope">
<el-input v-model="scope.row.matGuig" placeholder="规格" :disabled="form.quotApprovalStatus != '0' && form.quotApprovalStatus != null"/>
</template>
</el-table-column>
<el-table-column label="电压" prop="matDiany" width="130">
<template slot-scope="scope">
<el-input v-model="scope.row.matDiany" placeholder="电压" :disabled="form.quotApprovalStatus != '0' && form.quotApprovalStatus != null"/>
</template>
</el-table-column>
<el-table-column label="单位" prop="matDanw" width="100">
<template slot-scope="scope">
<el-input v-model="scope.row.matDanw" placeholder="单位" :disabled="form.quotApprovalStatus != '0' && form.quotApprovalStatus != null"/>
</template>
</el-table-column>
<el-table-column label="数量" prop="matSl" width="100">
<template slot-scope="scope">
<el-input v-model="scope.row.matSl" placeholder="数量" :disabled="form.quotApprovalStatus != '0' && form.quotApprovalStatus != null"/>
</template>
</el-table-column>
<el-table-column label="备注" prop="matRemark" width="180">
<template slot-scope="scope">
<el-input v-model="scope.row.matRemark" placeholder="备注" :disabled="form.quotApprovalStatus != '0' && form.quotApprovalStatus != null"/>
</template>
</el-table-column>
<el-table-column label="料单价" prop="matMatprice" v-if="checkRole(['QUOT_MAT_PRICE_DIFF'])" width="130">
<template slot-scope="scope">
<el-input v-model="scope.row.matMatprice" :disabled="true"/>
</template>
</el-table-column>
<el-table-column label="红本单价" prop="matPrice" v-if="checkRole(['QUOT','QUOT_MAT_PRICE_DIFF'])" width="130">
<template slot-scope="scope">
<el-input v-model="scope.row.matPrice" :disabled="true"/>
</template>
</el-table-column>
<el-table-column label="特批下点" prop="matQuotTp" v-if="checkRole(['QUOT','QUOT_MAT_PRICE_DIFF'])" width="100">
<template slot-scope="scope">
<el-input v-model="scope.row.matQuotTp" :disabled="true"/>
</template>
</el-table-column>
<el-table-column label="报价单价" prop="matQuotPrice" v-if="checkRole(['QUOT','QUOT_MAT_PRICE_DIFF'])" width="130">
<template slot-scope="scope">
<el-input v-model="scope.row.matQuotPrice" :disabled="true"/>
</template>
</el-table-column>
<el-table-column label="报价小计" prop="matQuotAllPrice" v-if="checkRole(['QUOT','QUOT_MAT_PRICE_DIFF'])" width="130">
<template slot-scope="scope">
<el-input v-model="scope.row.matQuotAllPrice" :disabled="true"/>
</template>
</el-table-column>
<el-table-column label="毛利率" prop="matMatpriceDiff" v-if="checkRole(['QUOT_MAT_PRICE_DIFF'])" width="130">
<template slot-scope="scope">
<el-input v-model="scope.row.matMatpriceDiff" :disabled="true"/>
</template>
</el-table-column>
</el-table>
<el-divider content-position="left" class="customer_divider_text">反馈附件</el-divider>
<div v-hasPermi="['quot:quot:quotFkFile']" >
<el-upload class="upload-demo"
ref="quotFkFileUpload"
name="quotFile"
:action="uploadUrl"
:headers="headers"
:data="{ relation_id: this.form.quotId,file_type: 'quotFkFile' }"
:before-upload="beforeAvatarUploadQuotFkFile"
:on-success="handleAvatarSuccess"
:show-file-list="false"
:limit="1"
v-if="this.form.quotApprovalStatus == '1'">
<el-button size="small" type="primary" @click="uploadFile('quotFkFile')">上传文件</el-button>
</el-upload>
</div>
<el-table class="down" v-loading="quotFkFileLoading" :data="quotFkFileList" border stripe style="width: 100%;margin-top: 10px;" height="200px">
<el-table-column prop="fileName" label="文件名称"></el-table-column>
<el-table-column prop="fileSize" label="文件大小" width="150px">
<template slot-scope="scope">
<span v-if="scope.row.fileSize / 1024 / 1024 < 1">{{(scope.row.fileSize / 1024).toFixed(2) + 'KB'}}</span>
<span v-else>{{(scope.row.fileSize / 1024 / 1024).toFixed(2) + 'MB'}}</span>
</template>
</el-table-column>
<el-table-column prop="fileTime" label="上传时间" width="200px"></el-table-column>
<el-table-column width="150px" label="操作">
<template slot-scope="scope">
<el-button size="small" type="text">
<a @click="downloadFile(scope.row.fileUrl)">下载</a>
</el-button>
<el-button size="small" type="text" @click="deleteFile(scope.row.fileId,'quotFkFile')" v-if="form.quotApprovalStatus == '1'">删除</el-button>
</template>
</el-table-column>
</el-table>
<!-- 技术协助块-->
<div v-if="checkPermi(['quot:quot:jsxzInfo'])">
<el-divider content-position="left" class="customer_divider_text">技术协助</el-divider>
<el-row :gutter="8">
@ -526,9 +639,9 @@
</el-form-item>
</el-col>
</el-row>
<el-row :gutter="8">
<!--<el-row :gutter="8">
<el-col :span="24">
<el-divider content-position="center">技术规范要求(询价附件)</el-divider>
<el-divider content-position="center">技术规范要求(技术附件)</el-divider>
<div v-hasPermi="['quot:quot:quotJsgfFile']">
<el-upload class="upload-demo"
ref="upload"
@ -568,7 +681,7 @@
</el-table-column>
</el-table>
</el-col>
</el-row>
</el-row>-->
<div v-if="showTl">
<el-divider content-position="center">特缆协助</el-divider>
<el-row :gutter="8">
@ -687,6 +800,7 @@
</div>
</div>
<!-- 核价协助块-->
<div v-if="checkPermi(['quot:quot:hjxzInfo'])">
<el-divider content-position="left" class="customer_divider_text">核价协助</el-divider>
<el-row :gutter="8">
@ -786,22 +900,34 @@
</el-table-column>
</el-table>
</el-dialog>
<PeopleSelect v-if="checkRole(['QUOT','PRICE_VERIFICATION'])" ref="peopleSelect" :type="'single'" :isCheck="true" :open="peopleOpen" @cancel="peopleOpen=false" @submit="submitPeople"></PeopleSelect>
</el-form>
<div slot="footer" class="dialog-footer">
<span v-hasPermi="['quot:quot:save']"><el-button @click="saveForm" v-if="this.form.quotApprovalStatus == '0' || this.form.quotApprovalStatus == null"> </el-button></span>
<span style="margin-left: 10px" v-hasPermi="['quot:quot:commit']"><el-button type="primary" plain @click="commitForm" v-if="this.form.quotApprovalStatus == '0' || this.form.quotApprovalStatus == null"> </el-button></span>
<div style="height: 25px;">
<!-- 业务员提交保存-->
<span v-hasPermi="['quot:quot:save']"><el-button @click="saveForm" v-if="this.form.quotApprovalStatus == '0' || this.form.quotApprovalStatus == null"> </el-button></span>
<span style="margin-left: 10px" v-hasPermi="['quot:quot:commit']"><el-button type="primary" plain @click="commitForm" v-if="this.form.quotApprovalStatus == '0' || this.form.quotApprovalStatus == null"> </el-button></span>
<span v-hasPermi="['quot:quot:assist']"><el-button type="primary" plain @click="commitJsForm" v-if="this.form.quotApprovalStatus == '1'&&this.form.quotJsxzApprovalStatus == '0'">提交技术协助</el-button></span>
<span style="margin-left: 10px" v-hasPermi="['quot:quot:assistHj']"><el-button type="primary" plain @click="commitHjForm" v-if="this.form.quotApprovalStatus == '1'&&this.form.quotHjApprovalStatus == '0'">提交核价审核</el-button></span>
<!-- 报价组提交技术核价协助-->
<span v-hasPermi="['quot:quot:assist']"><el-button type="primary" plain @click="commitJsForm" v-if="this.form.quotApprovalStatus == '1'&&this.form.quotJsxzApprovalStatus == '0'">提交技术协助</el-button></span>
<span style="margin-left: 10px" v-hasPermi="['quot:quot:assistHj']"><el-button type="primary" plain @click="commitHjForm" v-if="this.form.quotApprovalStatus == '1'&&this.form.quotHjApprovalStatus == '0'">提交核价审核</el-button></span>
<span style="margin-left: 10px;float:left" v-hasPermi="['quot:quot:madeQuot']"><el-button type="warning" plain @click="madeQuot" v-if="this.form.quotApprovalStatus == '2'||checkRole(['QUOT'])">生成报价单</el-button></span>
<span style="margin-left: 10px;float:left" v-hasPermi="['quot:quot:assistJsw']"><el-button type="warning" plain @click="commitJswForm" v-if="this.form.quotApprovalStatus == '1'&&this.form.quotJswApprovalStatus == '0'">提交金思维</el-button></span>
<span style="margin-left: 10px;float:left" v-hasPermi="['quot:quot:assistOA']"><el-button type="warning" plain @click="commitOAForm" v-if="this.form.quotApprovalStatus == '1'&&this.form.quotOAApprovalStatus == '0'">提交OA</el-button></span>
<span style="margin-left: 10px" v-hasPermi="['quot:quot:feedback']"><el-button type="primary" plain @click="feedbackQuotForm" v-if="this.form.quotApprovalStatus == '1'&&this.form.quotJsxzApprovalStatus != '1'&&this.form.quotHjApprovalStatus != '1'&&this.form.quotJswApprovalStatus != '1'">提交反馈</el-button></span>
<span style="margin-left: 10px" v-hasPermi="['quot:quot:reject']"><el-button type="danger" plain @click="rejectQuotForm" v-if="this.form.quotApprovalStatus == '1'&&this.form.quotJsxzApprovalStatus != '1'&&this.form.quotHjApprovalStatus != '1'">驳回</el-button></span>
<!-- 业务员报价组生成报价单-->
<span style="float:left" v-hasPermi="['quot:quot:madeQuot']"><el-button type="warning" plain @click="madeQuot" v-if="this.form.quotApprovalStatus == '2'||checkRole(['QUOT'])">生成报价单</el-button></span>
<!-- 报价组提交金思维OA-->
<span style="margin-left: 10px;float:left" v-hasPermi="['quot:quot:assistJsw']"><el-button type="warning" plain @click="commitJswForm" v-if="this.form.quotApprovalStatus == '1'&&(this.form.quotJswApprovalStatus == '0'||this.form.quotJswApprovalStatus == '2')">提交金思维</el-button></span>
<span style="margin-left: 10px;float:left" v-hasPermi="['quot:quot:assistOA']"><el-button type="warning" plain @click="commitOAForm" v-if="this.form.quotApprovalStatus == '1'&&this.form.quotOAApprovalStatus == '0'">提交OA</el-button></span>
<!-- 报价组提交反馈驳回报价单-->
<span style="margin-left: 10px" v-hasPermi="['quot:quot:feedback']"><el-button type="primary" plain @click="feedbackQuotForm" v-if="this.form.quotApprovalStatus == '1'&&this.form.quotJsxzApprovalStatus != '1'&&this.form.quotHjApprovalStatus != '1'&&this.form.quotJswApprovalStatus != '1'&&this.form.quotOAApprovalStatus != '1'">提交反馈</el-button></span>
<span style="margin-left: 10px" v-hasPermi="['quot:quot:reject']"><el-button type="danger" plain @click="rejectQuotForm" v-if="this.form.quotApprovalStatus == '1'&&this.form.quotJsxzApprovalStatus != '1'&&this.form.quotHjApprovalStatus != '1'&&this.form.quotJswApprovalStatus != '1'&&this.form.quotOAApprovalStatus != '1'">驳回</el-button></span>
</div>
</div>
</el-dialog>
<!-- 客户选择对话框-->
<CustomerSelect ref="customerSelect" :open="customerOpen" @submit="submitCustomer" @cancel="customerOpen=false"></CustomerSelect>
<!-- 技术确认单详情对话框 -->
@ -884,6 +1010,8 @@ import CustomerSelect from "@/views/components/Tools/CustomerSelect/index.vue";
import jsqrDialog from '@/views/technicalConfirm/technicalConfirm/jsxzInfo.vue';
/** 导入核价单详情组件*/
import hjDialog from '@/views/priceVerification/priceVerification/hjInfo.vue';
/** 导入选人组件 */
import PeopleSelect from "@/views/components/Tools/PeopleSelect/index.vue";
/** 弹窗放大、拖拽 */
import elDragDialog from "@/directive/dialog/dragDialog";
@ -897,7 +1025,8 @@ export default {
//
'CustomerSelect': CustomerSelect,
'jsqrDialog': jsqrDialog,
'hjDialog': hjDialog
'hjDialog': hjDialog,
'PeopleSelect': PeopleSelect
},
dicts: ['quot_print', 'quot_approval_status','quot_jsxz_group','quot_jsxz_chapter','quot_jsxz_approval_status','quot_jsxz_standard','quot_hj_approval_status','quot_jsw_approval_status','quot_oa_approval_status'],
data() {
@ -938,10 +1067,13 @@ export default {
},
// -
quotXjFileLoading: false,
quotXjFileList: [],
// -
quotFkFileLoading: false,
quotFkFileList: [],
// -
quotJsgfFileLoading: false,
quotJsgfFileList: [],
//-
uploadUrl: process.env.VUE_APP_BASE_API + "/quot/quot/quotFile",
@ -996,13 +1128,23 @@ export default {
quotQuotationRequire: [
{ required: true, message: "报价要求不能为空", trigger: "blur" }
],
quotMaterialsCount: [
{ required: true, message: "明细条数不能为空", trigger: "blur" }
],
quotTotalPrice: [
{ required: true, message: "总价不能为空", trigger: "blur" }
],
},
//-
showTl: false,
showDy: false,
showZy: false,
showQt: false
showQt: false,
//
peopleOpen:false,
selectedPeoples:[]
};
},
created() {
@ -1013,7 +1155,7 @@ export default {
this.getList();
},
methods: {
//
/** 打印状态修改 */
handleStatusChange(row) {
let text = row.quotPrint === "0" ? "打印" : "取消打印";
this.$modal.confirm('确认要"' + text + '"报价单:"' + row.quotCode + '"吗?').then(function() {
@ -1026,11 +1168,11 @@ export default {
});
},
//
/** 打开客户选择弹窗 */
openCustomer(){
this.customerOpen=true;
},
//
/** 客户选择确定按钮事件 */
submitCustomer(customer){
this.form.quotCustomerBm = customer.value;
this.form.quotCustomerName = customer.label;
@ -1043,6 +1185,7 @@ export default {
quotCode: null,
quotSalesmanName: null,
quotSalesmanBm: null,
quotSalesmanCode: null,
quotSalesmanDeptName: null,
quotSalesmanDeptId: null,
quotCustomerBm: null,
@ -1054,8 +1197,15 @@ export default {
quotQuotationDate: null,
quotQuotationRequire: null,
quotFeedbackExplanation: null,
quotOAApprovalStatusRemark: null,
quotApprovalStatus: null,
quotPrintUserName: null,
quotMaterialsCount: null,
quotTongPrice: null,
quotLvPrice: null,
quotMatpriceDiff: null,
quotJsxzApprovalStatus: null,
quotJsxzChapter: null,
quotJsxzConfirmCode: null,
@ -1116,7 +1266,7 @@ export default {
this.resetForm("queryForm");
this.handleQuery();
},
//
/** 多选框选中数据 */
handleSelectionChange(selection) {
this.ids = selection.map(item => item.quotId)
this.single = selection.length!==1
@ -1127,8 +1277,10 @@ export default {
this.reset();
this.open = true;
this.activeName = "quotInfo";
this.form.quotSalesmanName = this.$store.state.user.sapUserName;
this.form.quotSalesmanName = this.$store.state.user.nickName;
//this.form.quotSalesmanName = this.$store.state.user.sapUserName;
this.form.quotSalesmanBm = this.$store.state.user.sapBm;
this.form.quotSalesmanCode = this.$store.state.user.name;
this.form.quotSalesmanDeptId = this.$store.state.user.deptId;
this.form.quotSalesmanDeptName = this.$store.state.user.deptName;
},
@ -1146,10 +1298,12 @@ export default {
const quotId = row.quotId || this.ids
let self = this;
this.$modal.confirm('是否确认修订所选报价单且更新状态为协助中?').then(function() {
}).then(() => {
getReturnUpdateQuot(quotId).then(response => {
self.setInfo(response);
this.$modal.msgSuccess("更改成功");
this.getList();
});
}).then(() => {}).catch(() => {});
}).catch(() => {});
},
/** 修改按钮操作-详细信息设置 */
@ -1190,16 +1344,23 @@ export default {
this.productUpload.title = "产品数据导入";
this.productUpload.open = true;
},
/** 下载模板操作 */
/** 产品数据导出按钮操作 */
handleExportMaterial() {
const quot = {"quotId":this.form.quotId};
this.download('quot/quot/exportMaterial', {
...quot
}, this.form.quotCode +".xlsx")
},
/** 产品数据下载模板操作 */
importTemplate() {
this.download('quot/quot/importTemplate', {
}, `product_template_${new Date().getTime()}.xlsx`)
},
//
/** 产品数据文件上传中处理 */
handleFileUploadProgress(event, file, fileList) {
this.productUpload.isUploading = true;
},
//
/** 产品数据文件上传成功处理 */
handleFileSuccess(response, file, fileList) {
this.productUpload.open = false;
this.productUpload.isUploading = false;
@ -1207,12 +1368,12 @@ export default {
this.$message.success("产品数据导入成功!");
this.quotMaterialList = this.quotMaterialList.concat(response.data)
},
//
/** 产品数据提交上传文件 */
submitFileForm() {
this.$refs.productUpload.submit();
},
/** 保存按钮 */
/** 保存报价单按钮 */
saveForm() {
this.$refs["form"].validate(valid => {
if (valid) {
@ -1225,7 +1386,7 @@ export default {
});
} else {
addQuot(this.form).then(response => {
this.$modal.msgSuccess("新增成功");
this.$modal.msgSuccess("创建成功");
const row = {'quotId':response.data.quotId}
this.handleUpdate(row);
@ -1246,6 +1407,7 @@ export default {
}
this.form.quotMaterialList = this.quotMaterialList;
console.log(this.form)
commitQuot(this.form).then(response => {
this.$modal.msgSuccess("提交成功");
this.open = false;
@ -1300,11 +1462,18 @@ export default {
/** 报价组报价单提交反馈按钮 */
feedbackQuotForm() {
var quotFkFileNum = this.quotFkFileList.length;
const quotTotalPrice = this.form.quotTotalPrice;
const quotMaterialsCount = this.form.quotMaterialsCount;
if(!quotTotalPrice || !quotMaterialsCount ){
this.$modal.msgError("明细条数或总价未填");
return;
}
/*const quotFkFileNum = this.quotFkFileList.length;
if(quotFkFileNum==0){
this.$modal.msgError("反馈附件必须上传");
return;
}
}*/
feedbackQuot(this.form).then(response => {
this.$modal.msgSuccess("提交反馈成功");
this.open = false;
@ -1357,10 +1526,12 @@ export default {
this.$modal.msgSuccess("删除成功");
}).catch(() => {});
},
/** 报价单-产品序号 */
/** 报价单-产品序号 */
rowQuotMaterialIndex({ row, rowIndex }) {
row.index = rowIndex + 1;
},
/** 报价单-产品添加按钮操作 */
handleAddQuotMaterial() {
let obj = {};
@ -1371,6 +1542,7 @@ export default {
obj.matSl = "";
this.quotMaterialList.push(obj);
},
/** 报价单-产品删除按钮操作 */
handleDeleteQuotMaterial() {
if (this.checkedQuotMaterial.length == 0) {
@ -1383,10 +1555,12 @@ export default {
});
}
},
/** 复选框选中数据 */
handleQuotMaterialSelectionChange(selection) {
this.checkedQuotMaterial = selection.map(item => item.index)
},
/** 导出按钮操作 */
handleExport() {
this.download('quot/quot/export', {
@ -1394,7 +1568,7 @@ export default {
}, `quot_${new Date().getTime()}.xlsx`)
},
//
/** 对产品数据-数量、金额进行合算 */
getSummaries(param) {
const { columns, data } = param;
const sums = [];
@ -1421,11 +1595,12 @@ export default {
}
});
this.form.quotQuantity = sums[6];
this.form.quotTotalPrice = sums[8];
this.form.quotTotalPrice = checkRole(['QUOT_MAT_PRICE_DIFF'])? sums[12] : sums[11];
this.form.quotMaterialsCount = data.length;
return sums;
},
/*********************************附件上传*****************************************/
/*********************************附件列表数据展示、上传*****************************************/
//-
getQuotXjFileList(){
const param = {relationId:this.form.quotId,fileType:'quotXjFile'}
@ -1448,8 +1623,9 @@ export default {
});
}
},
//- ()
//-
getQuotJsgfFileList(){
console.log(this.form.quotId)
const param = {relationId:this.form.quotId,fileType:'quotJsgfFile'}
quotFileList(param).then(response => {
this.quotJsgfFileList = response.rows;
@ -1478,7 +1654,7 @@ export default {
this.quotHjFileList = response.rows;
});
},
//
//
handleAddFile(group){
this.addFileOpen = true;
this.quotJsqrFileList = [];
@ -1507,7 +1683,32 @@ export default {
uploadFile(activeName){
this.activeName = activeName
},
//-
beforeAvatarUploadQuotFkFile(file) {
this.quotFkFileLoading = true;
},
//-
beforeAvatarUploadQuotXjFile(file) {
this.quotXjFileLoading = true;
let activeName = this.activeName;
if(activeName=='quotXjFile'){
if(file.name.split('.')[1].toLowerCase() != 'xls' && file.name.split('.')[1].toLowerCase() != 'xlsx'){
this.$modal.msgError("清单附件必须是Excel格式");
this.quotXjFileLoading = false;
return false;
}
}
},
//-
beforeAvatarUploadQuotJsgfFile(file){
this.quotJsgfFileLoading = true;
const maxSize = 100 * 1024 * 1024; // 100MB
if (file.size > maxSize) {
this.$modal.msgError("文件大小超过了"+maxSize / (1024 * 1024)+"MB的限制");
this.quotJsgfFileLoading = false;
return false;
}
},
//
handleAvatarSuccess(res) {
let activeName = this.activeName;
@ -1516,15 +1717,30 @@ export default {
this.$modal.msgSuccess(res.msg);
if(activeName=='quotXjFile'){
this.getQuotXjFileList();
}else if(activeName=='quotJsInfo'){
this.quotXjFileLoading = false;
this.$refs.quotXjFileUpload.clearFiles(); //****
}else if(activeName=='quotJsgfFile'){
this.getQuotJsgfFileList();
this.quotJsgfFileLoading = false;
this.$refs.quotJsgfFileUpload.clearFiles(); //****
}else if(activeName=='quotFkFile'){
this.getQuotFkFileList();
this.quotFkFileLoading = false;
this.$refs.quotFkFileUpload.clearFiles(); //****
}
} else {
this.$modal.msgError(res.msg);
if(activeName=='quotXjFile'){
this.quotXjFileLoading = false;
this.$refs.quotXjFileUpload.clearFiles(); //****
}else if(activeName=='quotJsgfFile'){
this.quotJsgfFileLoading = false;
this.$refs.quotJsgfFileUpload.clearFiles(); //****
}else if(activeName=='quotFkFile'){
this.quotFkFileLoading = false;
this.$refs.quotFkFileUpload.clearFiles(); //****
}
}
this.$refs.upload.clearFiles(); //****
},
//
@ -1534,18 +1750,41 @@ export default {
//
deleteFile(fileId,activeName){
//let activeName = this.activeName;
quotFileDelete(fileId).then(response => {
if(activeName=='quotXjFile'){
if(activeName=='quotXjFile'){
this.quotXjFileLoading = true;
quotFileDelete(fileId).then(response => {
this.getQuotXjFileList();
}else if(activeName=='quotJsInfo'){
this.quotXjFileLoading = false;
})
}else if(activeName=='quotJsgfFile'){
this.quotJsgfFileLoading = true;
quotFileDelete(fileId).then(response => {
this.getQuotJsgfFileList();
}else if(activeName=='quotFkFile'){
this.quotJsgfFileLoading = false;
})
}else if(activeName=='quotFkFile'){
this.quotFkFileLoading = true;
quotFileDelete(fileId).then(response => {
this.getQuotFkFileList();
}
});
this.quotFkFileLoading = false;
})
}
},
/*********************************附件上传*****************************************/
//
openPeopleSelect(){
this.peopleOpen=true;
},
// submitPeople(nikeNamelist) submitPeople(peopleList,nikeNamelist)
submitPeople(peopleList,nickNameList){
this.selectedPeoples = this.selectedPeoples.concat(nickNameList)
this.selectedPeoples = this.unique(this.selectedPeoples)
this.form.quotSalesmanName = this.selectedPeoples[0].nickName;
this.form.quotSalesmanBm = this.selectedPeoples[0].sapUserBm;
this.form.quotSalesmanCode = this.selectedPeoples[0].userName;
this.peopleOpen=false;
},
/*********************************附件列表数据展示、上传*****************************************/
//
showJsqrDialog(){
@ -1555,7 +1794,12 @@ export default {
//
showHjDialog(){
this.$refs.hjDialog.getInfo("报价单-核价单",true,false,this.form.quotHjId);
}
},
//
unique(arr) {
const res = new Map();
return arr.filter((arr) => !res.has(arr.userName) && res.set(arr.userName, 1));
},
}
};
</script>

View File

@ -8,11 +8,10 @@
<el-button style="float: right;" size="mini" type="primary" icon="el-icon-search" @click="handleSearchClick">搜索</el-button>
</el-col>
<el-col :span="14">
<el-button size="mini" icon="el-icon-refresh" @click="handleRefreshClick">刷新</el-button>
<el-button style="float: right;margin-left: 5px;" size="mini" type="success" icon="el-icon-document" @click="handleMadeQuotClick" :disabled="selectedResultData.length==0 || madeQuotDis">生成报价单</el-button>
<el-button style="float: right;margin-left: 5px;" size="mini" type="warning" icon="el-icon-folder" @click="handleSaveClick" :disabled="selectedResultData.length==0">保存</el-button>
<el-button style="float: right;margin-left: 5px;" size="mini" icon="el-icon-refresh" @click="handleRefreshClick">清空信息</el-button>
<el-button style="float: right;" size="mini" type="info" plain icon="el-icon-upload2" @click="handleImport">导入</el-button>
</el-col>
</el-row>
@ -138,6 +137,7 @@
:value="item.value"
@click.native="selectRbDate(item.value)"/>
</el-select>
<el-button style="float: right;" size="mini" type="info" plain icon="el-icon-upload2" @click="handleExport">导出</el-button>
</el-form-item>
</el-col>
</el-row>
@ -152,7 +152,7 @@
<el-button type="text" @click="handleDeleteClick(scope.$index)">删除</el-button>
</template>
</el-table-column>
<el-table-column label="版本uid" align="center" prop="uid_0" v-if="false"/>
<el-table-column label="版本uid" align="center" prop="uid_0"/>
<el-table-column label="产品型号" align="center" prop="name_0" width="200" />
<el-table-column label="型号" align="center" prop="name_1" v-if="false"/>
<el-table-column label="规格" align="center" prop="spec" v-if="false"/>
@ -593,7 +593,7 @@
const allPrice = toDecimal(count * price * (per?per:1) * (per2?per2:1));
const rowDate = {
uid_0: uid_0,
uid_0: uid_0.toString(),
name_0: name_0,
name_1: model,
spec: spec,
@ -758,7 +758,7 @@
//
const content = response;
const blob = new Blob([content]);
const fileName = "BJD_"+this.getTodayCourse()+".xls";
const fileName = "RB_BJD_"+this.getTodayCourse()+".xls";
if ("download" in document.createElement("a")) {
// IE
const elink = document.createElement("a");
@ -814,6 +814,14 @@
this.$refs.productUpload.submit();
},
//
handleExport(){
const fileName = "RB_BJD_"+this.getTodayCourse();
this.download('redBook/redBook/exportProduct', {
selectedResultData: JSON.stringify(this.selectedResultData)
}, fileName +".xlsx")
},
//
getVersionList(){
versionList(this.queryParams).then(response => {
@ -899,6 +907,7 @@
isColumn1ValuesEqual() {
if(this.selectedResultData.length > 0){
const uid_0 = this.selectedResultData[0].uid_0;//uid
console.log(this.selectedResultData)
return this.selectedResultData.every(row => row.uid_0 === uid_0);
}else{
return false;

View File

@ -119,8 +119,8 @@
</el-form-item>
</el-col>
</el-row>
<el-table v-loading="selectedResultLoading" width="100%;" :row-class-name="selectedResultIndex" :data="selectedResultData">
<el-button size="mini" type="info" plain icon="el-icon-upload2" @click="handleExport">导出</el-button>
<el-table v-loading="selectedResultLoading" width="100%;" :row-class-name="selectedResultIndex" :data="selectedResultData" style="margin-top: 10px">
<el-table-column fixed="left" label="" align="center" prop="index" width="50"/>
<el-table-column label="版本uid" align="center" prop="uid_0" v-if="false"/>
<el-table-column fixed="left" label="产品型号" align="center" prop="name_0" width="180"/>
@ -433,7 +433,7 @@
const content = response;
const blob = new Blob([content]);
let fileName = "BJD_"+this.getTodayCourse()+".xls";
let fileName = "RB_BJD_"+this.getTodayCourse()+".xls";
if(this.form.quotCode){
fileName = this.form.quotCode+".xls";
}
@ -454,6 +454,18 @@
}
});
},
//
handleExport(){
let fileName = "RB_BJD_"+this.getTodayCourse();
if(this.form.quotCode){
fileName = this.form.quotCode;
}
this.download('redBook/redBook/exportProduct', {
selectedResultData: JSON.stringify(this.selectedResultData)
}, fileName +".xlsx")
},
//
getTodayCourse(){
const myDate = new Date();

View File

@ -79,7 +79,7 @@
</el-form-item>
</el-col>
</el-row>
<el-divider content-position="center">技术规范要求(询价附件)</el-divider>
<el-divider content-position="center">技术规范要求(技术附件)</el-divider>
<el-row :gutter="8">
<el-col :span="24">
<el-table class="down" :data="quotJsgfFileList" border stripe style="width: 100%;" height="150px">
@ -714,13 +714,14 @@
:action="uploadUrl"
:headers="headers"
:data="{ relation_id: this.form.quotJsqrId,file_type: fileType }"
:before-upload="beforeAvatarUpload"
:on-success="handleAvatarSuccess"
:show-file-list="false"
:limit="1"
v-if="uploadDis">
<el-button size="small" type="primary">上传文件</el-button>
</el-upload>
<el-table class="down" :data="quotJsqrFileList" border stripe style="width: 100%;margin-top: 20px;" height="200px">
<el-table class="down" v-loading="quotJsqrFileLoading" :data="quotJsqrFileList" border stripe style="width: 100%;margin-top: 20px;" height="200px">
<el-table-column prop="fileName" label="文件名称" ></el-table-column>
<el-table-column prop="fileSize" label="文件大小" width="150px">
<template slot-scope="scope">
@ -809,6 +810,7 @@
//
uploadDis: false,
//
quotJsqrFileLoading: false,
quotJsqrFileList: [],
quotJsqrTlFileNum: 0,
quotJsqrDyFileNum: 0,
@ -993,8 +995,9 @@
param.quotJsxzGroup = quotJsxzGroup;//
param.type = type;//
param.state = state;///
param.fileNum = quotJsxzGroup=='TL'?this.quotJsqrTlFileNum:quotJsxzGroup=='Dy'?this.quotJsqrDyFileNum:quotJsxzGroup=='Zy'?this.quotJsqrZyFileNum:this.quotJsqrQtFileNum;//
param.fileNum = quotJsxzGroup=='TL'?this.quotJsqrTlFileNum:(quotJsxzGroup=='DY'?this.quotJsqrDyFileNum:(quotJsxzGroup=='ZY'?this.quotJsqrZyFileNum:this.quotJsqrQtFileNum));//
console.log(param.fileNum)
param.quotJsqrTlRemark = this.form.quotJsqrTlRemark;
param.quotJsqrTlCheckRemark = this.form.quotJsqrTlCheckRemark;
param.quotJsqrTlLeaderRemark = this.form.quotJsqrTlLeaderRemark;
@ -1149,8 +1152,10 @@
//
deleteFile(fileId){
this.quotJsqrFileLoading = true;
quotFileDelete(fileId).then(response => {
this.getQuotJsqrFileList(this.fileType);
this.quotJsqrFileLoading = false;
});
},
@ -1411,6 +1416,10 @@
//
this.getQuotJsqrFileList(this.fileType);
},
//
beforeAvatarUpload(file){
this.quotJsqrFileLoading = true;
},
//
handleAvatarSuccess(res) {
//
@ -1420,6 +1429,7 @@
} else {
this.$modal.msgError(res.msg);
}
this.quotJsqrFileLoading = false;
this.$refs.upload.clearFiles(); //****
},
//