From 5f61c6810711b7b79d08ba0e5f9f02dfdf10f1eb Mon Sep 17 00:00:00 2001 From: xd <844539747@qq.com> Date: Wed, 12 Jun 2024 17:24:53 +0800 Subject: [PATCH] '123' --- ABAP_AS_WITH_POOL.jcoDestination | 11 + .../priceVerification/QuotHjController.java | 20 ++ .../web/controller/quot/QuotController.java | 227 +++++++++++------- .../technicalConfirm/QuotJsqrController.java | 21 ++ .../ruoyi/common/utils/http/HttpUtils.java | 29 ++- .../com/ruoyi/quot/mapper/QuotMapper.java | 6 + .../com/ruoyi/quot/service/IQuotService.java | 6 + .../quot/service/impl/QuotServiceImpl.java | 9 + .../mapper/priceVerification/QuotHjMapper.xml | 1 + .../main/resources/mapper/quot/QuotMapper.xml | 3 + ruoyi-ui/src/views/quot/quot/index.vue | 10 +- 11 files changed, 242 insertions(+), 101 deletions(-) create mode 100644 ABAP_AS_WITH_POOL.jcoDestination diff --git a/ABAP_AS_WITH_POOL.jcoDestination b/ABAP_AS_WITH_POOL.jcoDestination new file mode 100644 index 0000000..8c6afb3 --- /dev/null +++ b/ABAP_AS_WITH_POOL.jcoDestination @@ -0,0 +1,11 @@ +#for tests only ! +#Wed Jun 12 17:04:18 CST 2024 +jco.destination.pool_capacity=10 +jco.client.lang=ZH +jco.client.ashost=172.19.0.120 +jco.client.saprouter= +jco.client.user=RFC +jco.client.sysnr=00 +jco.destination.peak_limit=10 +jco.client.passwd=gR+@VS{@vcSt}PE/DW_]@6@mm8UiFKt|ELFuvqDg@R+lSEZZ +jco.client.client=300 diff --git a/ruoyi-admin/src/main/java/com/ruoyi/web/controller/priceVerification/QuotHjController.java b/ruoyi-admin/src/main/java/com/ruoyi/web/controller/priceVerification/QuotHjController.java index 2f01a74..5d87a0f 100644 --- a/ruoyi-admin/src/main/java/com/ruoyi/web/controller/priceVerification/QuotHjController.java +++ b/ruoyi-admin/src/main/java/com/ruoyi/web/controller/priceVerification/QuotHjController.java @@ -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 userIds = noticeService.getSendEmp(WebsocketConst.MSG_SEND_QUOT_BJZ); + NoticeUtil.sendNoticesBusiness(loginUser,"有报价单已完成核价协助","单号:"+quotHj.getQuotCode(),userIds); + } + /** * 报价单-核价单 驳回 */ diff --git a/ruoyi-admin/src/main/java/com/ruoyi/web/controller/quot/QuotController.java b/ruoyi-admin/src/main/java/com/ruoyi/web/controller/quot/QuotController.java index fbb99fe..1979a5c 100644 --- a/ruoyi-admin/src/main/java/com/ruoyi/web/controller/quot/QuotController.java +++ b/ruoyi-admin/src/main/java/com/ruoyi/web/controller/quot/QuotController.java @@ -2,13 +2,16 @@ package com.ruoyi.web.controller.quot; import java.util.ArrayList; import java.util.List; +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; @@ -177,7 +180,9 @@ public class QuotController extends BaseController public AjaxResult add(@RequestBody Quot quot) { quot.setQuotId(UUID.fastUUID().toString()); - quot.setQuotCode(IdUtils.createNo("BJD_",0)); + //quot.setQuotCode(IdUtils.createNo("BJD_",0)); + String quotCode = quotService.getCode("BJD"); + quot.setQuotCode(quotCode); quot.setCreateBy(getUsername()); quot.setQuotSalesmanCode(getUsername()); quot.setUpdateBy(getUsername()); @@ -296,11 +301,22 @@ 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 roles = SecurityUtils.getLoginUser().getUser().getRoles(); + for(SysRole sysRole:roles){ + String roleKey = sysRole.getRoleKey(); + if("PRICE_VERIFICATION".equals(roleKey)){ + hjRoleFlag = true; + } + } + 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(); @@ -310,14 +326,21 @@ 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_",0)); + //quot.setQuotCode(IdUtils.createNo("BJD_",0)); + String quotCode = quotService.getCode("BJD"); + quot.setQuotCode(quotCode); quot.setCreateBy(getUsername()); quot.setQuotSalesmanCode(getUsername()); quotService.insertQuot(quot); @@ -363,7 +386,9 @@ public class QuotController extends BaseController QuotJsqr quotJsqr = new QuotJsqr(); String quotJsqrId = UUID.fastUUID().toString(); quotJsqr.setQuotJsqrId(quotJsqrId); - quotJsqr.setQuotJsqrCode(IdUtils.createNo("BJD_JSQR_",0)); + //quotJsqr.setQuotJsqrCode(IdUtils.createNo("BJD_JSQR_",0)); + String quotJsqrCode = quotService.getCode("JSQR"); + quotJsqr.setQuotJsqrCode(quotJsqrCode); //特缆、低压、中压、其他 协助状态设置 if(quotJsxzGroup.indexOf("TL")!=-1){ @@ -428,7 +453,10 @@ public class QuotController extends BaseController QuotHj quotHj = new QuotHj(); String quotHjId = UUID.fastUUID().toString(); quotHj.setQuotHjId(quotHjId); - quotHj.setQuotHjCode(IdUtils.createNo("BJD_HJ_",0)); + //quotHj.setQuotHjCode(IdUtils.createNo("BJD_HJ_",0)); + String quotHjCode = quotService.getCode("HJD"); + quotHj.setQuotHjCode(quotHjCode); + quotHj.setQuotHjPricingType("10");//核价类型 设置为 报价核价 quotHj.setCreateBy(getUsername()); @@ -452,89 +480,108 @@ public class QuotController extends BaseController @PostMapping("/commitJswQuot") public AjaxResult commitJswQuot(@RequestBody Quot quot) { - // 对接金思维接口 - //==============================账户认证================================== - QuotJswUser quotJswUser = new QuotJswUser("JNBJPT","1q2w3e","S",""); - String quotJswUserJson = JSON.toJSONString(quotJswUser); + String quotJswApprovalStatus = quot.getQuotJswApprovalStatus(); + if("2".equals(quotJswApprovalStatus)){//重新调点 + String quotJswCode = quot.getQuotJswCode(); + String returnTdJson = "{\"bjdid\":"+quotJswCode+"}"; + Map res = HttpUtils.sendPostJson("http://price.jncable.com.cn:7778/GTHINKING/AjaxService/U20231485_N_XLXSBJ/100860101.ashx/DispatchBJD",returnTdJson,""); + String returnTdResultJson = res.get("res"); + QuotJswUserResult quotJswUserResult = JSON.parseObject(returnTdResultJson, QuotJswUserResult.class); + if(!quotJswUserResult.getSuccess()){ + return error(quotJswUserResult.getErrorMessage()); + } + }else{ + // ==============================对接金思维接口============================== + //==============================账户认证================================== + QuotJswUser quotJswUser = new QuotJswUser("JNBJPT","1q2w3e","S",""); + String quotJswUserJson = JSON.toJSONString(quotJswUser); + Map 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 QuotJswUserResultJson = HttpUtils.sendPostJson("http://price.jncable.com.cn:7778/GTHINKING/AjaxService/N_MISPRO/100208057.ashx/Login",quotJswUserJson); - 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 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 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 files = new ArrayList<>(); + + QuotFile quotFile = new QuotFile(); + quotFile.setRelationId(quot.getQuotId());// 报价单ID + quotFile.setFileType("quotXjFile");// 附件类型-询价清单附件 + List quotXjFiles = quotFileService.selectQuotFileList(quotFile); + if(quotXjFiles!=null&"XjFiles.size()>0){ + files.addAll(quotXjFiles); + } + + quotFile = new QuotFile(); + quotFile.setRelationId(quot.getQuotId());// 报价单ID + quotFile.setFileType("quotJsgfFile");// 附件类型-技术附件 + List quotJsgfFiles = quotFileService.selectQuotFileList(quotFile); + if(quotJsgfFiles!=null&"JsgfFiles.size()>0){ + files.addAll(quotJsgfFiles); + } + + QuotJswFiles quotJswFiles = null; + QuotJswFile quotJswFile = new QuotJswFile(); + quotJswFile.setBjdid(quotJswResultObject.getKey()); + List quotJswFileList = new ArrayList(); + 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 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()); + } + } } - //==============================报价单信息对接================================== - 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 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); - //调用金思维接口上传报价单信息 - String QuotJswResultJson = HttpUtils.sendPostJson("http://price.jncable.com.cn:7778/GTHINKING/AjaxService/U20231485_N_XLXSBJ/100860101.ashx/RecBJDfromJN",quotJson); - QuotJswResult quotJswResultObject = JSON.parseObject(QuotJswResultJson, QuotJswResult.class); - if(!quotJswResultObject.getSuccess()){ - return error(quotJswResultObject.getErrorMessage()); - } - - //==============================附件对接================================== - List files = new ArrayList<>(); - - QuotFile quotFile = new QuotFile(); - quotFile.setRelationId(quot.getQuotId());// 报价单ID - quotFile.setFileType("quotXjFile");// 附件类型-询价清单附件 - List quotXjFiles = quotFileService.selectQuotFileList(quotFile); - if(quotXjFiles!=null&"XjFiles.size()>0){ - files.addAll(quotXjFiles); - } - - quotFile = new QuotFile(); - quotFile.setRelationId(quot.getQuotId());// 报价单ID - quotFile.setFileType("quotJsgfFile");// 附件类型-技术附件 - List quotJsgfFiles = quotFileService.selectQuotFileList(quotFile); - if(quotJsgfFiles!=null&"JsgfFiles.size()>0){ - files.addAll(quotJsgfFiles); - } - - QuotJswFiles quotJswFiles = null; - QuotJswFile quotJswFile = new QuotJswFile(); - quotJswFile.setBjdid(quot.getQuotCode()); - for(QuotFile qf:files){ - quotJswFiles = new QuotJswFiles(); - quotJswFiles.setFileName(qf.getFileName()); - quotJswFiles.setFileData(Base64.fileBase64(qf.getFileUrl())); - quotJswFile.getFjdata().add(quotJswFiles); - } - String fileJson = JSON.toJSONString(quotJswFile); - //调用金思维接口上传附件 - String QuotJswResultFileJson = HttpUtils.sendPostJson("http://price.jncable.com.cn:7778/GTHINKING/AjaxService/U20231485_N_XLXSBJ/100860101.ashx/UploadFile",fileJson); - QuotJswResult quotJswResult = JSON.parseObject(QuotJswResultFileJson, QuotJswResult.class); - if(!quotJswResult.getSuccess()){ - return error(quotJswResult.getErrorMessage()); - } - - quot.setQuotJswApprovalStatus("1");// 更新金思维提交状态为 协助中 quotService.updateQuot(quot); return success(); diff --git a/ruoyi-admin/src/main/java/com/ruoyi/web/controller/technicalConfirm/QuotJsqrController.java b/ruoyi-admin/src/main/java/com/ruoyi/web/controller/technicalConfirm/QuotJsqrController.java index 6cdb6fa..cc7da7f 100644 --- a/ruoyi-admin/src/main/java/com/ruoyi/web/controller/technicalConfirm/QuotJsqrController.java +++ b/ruoyi-admin/src/main/java/com/ruoyi/web/controller/technicalConfirm/QuotJsqrController.java @@ -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 userIds = noticeService.getSendEmp(WebsocketConst.MSG_SEND_QUOT_BJZ); + NoticeUtil.sendNoticesBusiness(loginUser,"有报价单已完成技术协助","单号:"+quotJsqr.getQuotCode(),userIds); + } } diff --git a/ruoyi-common/src/main/java/com/ruoyi/common/utils/http/HttpUtils.java b/ruoyi-common/src/main/java/com/ruoyi/common/utils/http/HttpUtils.java index 25c2b42..671aefa 100644 --- a/ruoyi-common/src/main/java/com/ruoyi/common/utils/http/HttpUtils.java +++ b/ruoyi-common/src/main/java/com/ruoyi/common/utils/http/HttpUtils.java @@ -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; @@ -196,8 +199,11 @@ public class HttpUtils * @param param 请求参数,请求参数应该是 json字符串 的形式。 * @return 所代表远程资源的响应结果 */ - public static String sendPostJson(String url, String param) + public static Map sendPostJson(String url, String param,String cookie) { + Map map = new HashMap(); + String tempCookie = ""; + PrintWriter out = null; BufferedReader in = null; StringBuilder result = new StringBuilder(); @@ -213,6 +219,10 @@ public class HttpUtils conn.setRequestProperty("Accept-Charset", "utf-8"); conn.setRequestProperty("contentType", "application/json"); conn.setRequestProperty("Content-Type", "application/json"); + // 设置Cookie头部 + if(StringUtils.isNotEmpty(cookie)){ + conn.setRequestProperty("Cookies", "cookie="+cookie); + } conn.setDoOutput(true); conn.setDoInput(true); out = new PrintWriter(conn.getOutputStream()); @@ -224,6 +234,11 @@ public class HttpUtils { result.append(line); } + if(StringUtils.isEmpty(cookie)){ + List cookies = conn.getHeaderFields().get("Set-Cookie"); + tempCookie = cookies.stream().collect(Collectors.joining("; ")); + } + log.info("recv - {}", result); } catch (ConnectException e) @@ -260,7 +275,9 @@ public class HttpUtils log.error("调用in.close Exception, url=" + url + ",param=" + param, ex); } } - return result.toString(); + map.put("cookie",tempCookie); + map.put("res",result.toString()); + return map; } public static String sendSSLPost(String url, String param) diff --git a/ruoyi-system/src/main/java/com/ruoyi/quot/mapper/QuotMapper.java b/ruoyi-system/src/main/java/com/ruoyi/quot/mapper/QuotMapper.java index f678c2e..7014cd7 100644 --- a/ruoyi-system/src/main/java/com/ruoyi/quot/mapper/QuotMapper.java +++ b/ruoyi-system/src/main/java/com/ruoyi/quot/mapper/QuotMapper.java @@ -141,4 +141,10 @@ public interface QuotMapper * @param subList */ void batchSysOaQuotMaterial(List subList); + + /** + * 获取单据编号 + * @return + */ + String getCode(String type); } diff --git a/ruoyi-system/src/main/java/com/ruoyi/quot/service/IQuotService.java b/ruoyi-system/src/main/java/com/ruoyi/quot/service/IQuotService.java index 2a3c64a..361594c 100644 --- a/ruoyi-system/src/main/java/com/ruoyi/quot/service/IQuotService.java +++ b/ruoyi-system/src/main/java/com/ruoyi/quot/service/IQuotService.java @@ -118,4 +118,10 @@ public interface IQuotService * @return */ SysOaQuot selectOAUserByUserName(String loginid); + + /** + * 获取单据编号 + * @return + */ + String getCode(String type); } diff --git a/ruoyi-system/src/main/java/com/ruoyi/quot/service/impl/QuotServiceImpl.java b/ruoyi-system/src/main/java/com/ruoyi/quot/service/impl/QuotServiceImpl.java index f980b84..59e1f61 100644 --- a/ruoyi-system/src/main/java/com/ruoyi/quot/service/impl/QuotServiceImpl.java +++ b/ruoyi-system/src/main/java/com/ruoyi/quot/service/impl/QuotServiceImpl.java @@ -260,4 +260,13 @@ public class QuotServiceImpl implements IQuotService } } } + + /** + * 获取单据编号 + * @return + */ + @Override + public String getCode(String type) { + return quotMapper.getCode(type); + } } diff --git a/ruoyi-system/src/main/resources/mapper/priceVerification/QuotHjMapper.xml b/ruoyi-system/src/main/resources/mapper/priceVerification/QuotHjMapper.xml index 3ad3240..dcc488d 100644 --- a/ruoyi-system/src/main/resources/mapper/priceVerification/QuotHjMapper.xml +++ b/ruoyi-system/src/main/resources/mapper/priceVerification/QuotHjMapper.xml @@ -66,6 +66,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" + order by a.update_time desc + diff --git a/ruoyi-ui/src/views/quot/quot/index.vue b/ruoyi-ui/src/views/quot/quot/index.vue index a69501b..99a50f6 100644 --- a/ruoyi-ui/src/views/quot/quot/index.vue +++ b/ruoyi-ui/src/views/quot/quot/index.vue @@ -452,12 +452,12 @@ - + - + @@ -467,17 +467,17 @@ - + - + - +