This commit is contained in:
xd 2024-06-12 17:24:53 +08:00
parent 52f2ef90c2
commit 5f61c68107
11 changed files with 242 additions and 101 deletions

View File

@ -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

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

@ -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,12 +301,23 @@ public class QuotController extends BaseController
@PostMapping("/commitQuot")
public AjaxResult commitQuot(@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)){
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,12 +480,25 @@ public class QuotController extends BaseController
@PostMapping("/commitJswQuot")
public AjaxResult commitJswQuot(@RequestBody Quot quot)
{
// 对接金思维接口
String quotJswApprovalStatus = quot.getQuotJswApprovalStatus();
if("2".equals(quotJswApprovalStatus)){//重新调点
String quotJswCode = quot.getQuotJswCode();
String returnTdJson = "{\"bjdid\":"+quotJswCode+"}";
Map<String,String> 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);
String QuotJswUserResultJson = HttpUtils.sendPostJson("http://price.jncable.com.cn:7778/GTHINKING/AjaxService/N_MISPRO/100208057.ashx/Login",quotJswUserJson);
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());
@ -492,7 +533,8 @@ public class QuotController extends BaseController
String quotJson = JSON.toJSONString(quotJsw);
//调用金思维接口上传报价单信息
String QuotJswResultJson = HttpUtils.sendPostJson("http://price.jncable.com.cn:7778/GTHINKING/AjaxService/U20231485_N_XLXSBJ/100860101.ashx/RecBJDfromJN",quotJson);
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());
@ -519,21 +561,26 @@ public class QuotController extends BaseController
QuotJswFiles quotJswFiles = null;
QuotJswFile quotJswFile = new QuotJswFile();
quotJswFile.setBjdid(quot.getQuotCode());
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()));
quotJswFile.getFjdata().add(quotJswFiles);
quotJswFileList.add(quotJswFiles);
}
quotJswFile.setFjdata(quotJswFileList);
String fileJson = JSON.toJSONString(quotJswFile);
//调用金思维接口上传附件
String QuotJswResultFileJson = HttpUtils.sendPostJson("http://price.jncable.com.cn:7778/GTHINKING/AjaxService/U20231485_N_XLXSBJ/100860101.ashx/UploadFile",fileJson);
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);

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

@ -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<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();
@ -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<String> 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)

View File

@ -141,4 +141,10 @@ public interface QuotMapper
* @param subList
*/
void batchSysOaQuotMaterial(List<QuotMaterial> subList);
/**
* 获取单据编号
* @return
*/
String getCode(String type);
}

View File

@ -118,4 +118,10 @@ public interface IQuotService
* @return
*/
SysOaQuot selectOAUserByUserName(String loginid);
/**
* 获取单据编号
* @return
*/
String getCode(String type);
}

View File

@ -260,4 +260,13 @@ public class QuotServiceImpl implements IQuotService
}
}
}
/**
* 获取单据编号
* @return
*/
@Override
public String getCode(String type) {
return quotMapper.getCode(type);
}
}

View File

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

View File

@ -492,4 +492,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

@ -452,12 +452,12 @@
<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">
<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">
<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>
@ -467,17 +467,17 @@
<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">
<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">
<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">
<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>