diff --git a/ABAP_AS_WITH_POOL.jcoDestination b/ABAP_AS_WITH_POOL.jcoDestination index f887a7e..f2e94da 100644 --- a/ABAP_AS_WITH_POOL.jcoDestination +++ b/ABAP_AS_WITH_POOL.jcoDestination @@ -1,5 +1,9 @@ #for tests only ! +<<<<<<< HEAD #Thu Jun 20 12:02:54 CST 2024 +======= +#Thu Jun 20 11:01:14 CST 2024 +>>>>>>> e4cb8bad7c55f817ead3e419a33f96f5d3492ee4 jco.destination.pool_capacity=10 jco.client.lang=ZH jco.client.ashost=172.19.0.125 @@ -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=w7hAeYb,##Zc}g(emH-GJL;?*-*mA;_enm-`{=LFKC[%7:pE +>>>>>>> e4cb8bad7c55f817ead3e419a33f96f5d3492ee4 jco.client.client=800 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 ba11e8d..d233a95 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 @@ -1,7 +1,9 @@ package com.ruoyi.web.controller.quot; import java.math.BigDecimal; +import java.text.SimpleDateFormat; import java.util.ArrayList; +import java.util.Date; import java.util.List; import java.util.Map; import javax.servlet.http.HttpServletResponse; @@ -375,66 +377,92 @@ public class QuotController extends BaseController @PostMapping("/commitQuot") public AjaxResult commitQuot(@RequestBody Quot quot) { - // 获取用户角色 --判断是否是核价组角色 - Boolean hjRoleFlag = false; - List roles = SecurityUtils.getLoginUser().getUser().getRoles(); - for(SysRole sysRole:roles){ - String roleKey = sysRole.getRoleKey(); - if("PRICE_VERIFICATION".equals(roleKey) || "QUOT".equals(roleKey)){ - hjRoleFlag = true; - break; + try{ + // 获取用户角色 --判断是否是核价组角色 + Boolean hjRoleFlag = false; + List 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("当前报价量已达极限,无法继续提供报价单"); + if(!hjRoleFlag){ + // 每天限制提交200条 + String quotCommitCount = configService.selectConfigByKey("quot.commit.count"); + String count = quotService.selectQuotListCount(); + if(Integer.valueOf(count)>=Integer.valueOf(quotCommitCount)){ + return error("当前报价量已达极限,无法继续提供报价单"); + } + + // 提交报价时间限制 + String commitQuotTime = configService.selectConfigByKey("quot.allow.commitQuotTime"); + if(commitQuotTime.indexOf("-")<0){ + return error("提交报价时间限制系统参数错误-格式不规范,请联系管理员"); + } + String startTime = commitQuotTime.split("-")[0]; + String endTime = commitQuotTime.split("-")[1]; + if(!DateUtils.isMatch(startTime) || !DateUtils.isMatch(endTime)){ + return error("提交报价时间限制系统参数错误-格式不规范,请联系管理员"); + } + + //当前时间 + Date date = new Date(); + String currentTime = new SimpleDateFormat("HH:mm:ss").format(date); + Date nowTime = new SimpleDateFormat("HH:mm:ss").parse(currentTime); + Date startTimeD = new SimpleDateFormat("HH:mm:ss").parse(startTime); + Date endTimeE = new SimpleDateFormat("HH:mm:ss").parse(endTime); + Boolean flag = DateUtils.isEffectiveDate(nowTime,startTimeD,endTimeE); + if(!flag){ + return error("已超过提交报价限制时间【"+commitQuotTime+"】,无法继续提交"); + } } - } - String quot_id = quot.getQuotId(); + String quot_id = quot.getQuotId(); - quot.setUpdateBy(getUsername()); - quot.setQuotApprovalStatus("1");//报价单 状态设置为 协助中 - quot.setQuotInquiryDate(DateUtils.getNowDate());//报价单 询价日期设置为 当前日期 + quot.setUpdateBy(getUsername()); + quot.setQuotApprovalStatus("1");//报价单 状态设置为 协助中 + quot.setQuotInquiryDate(DateUtils.getNowDate());//报价单 询价日期设置为 当前日期 - // 校验 是否已有重复报价单(客户+项目名) - 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)); - String quotCode = quotService.getCode("BJD"); - quot.setQuotCode(quotCode); - - if(hjRoleFlag){ - quot.setCreateBy(quot.getQuotSalesmanCode()); + // 校验 是否已有重复报价单(客户+项目名) + Boolean flag = false; + if(!hjRoleFlag){ + flag = quotService.checkExistQuot(getUsername(),quot.getQuotCustomerBm(),quot.getQuotProject()); }else{ - quot.setCreateBy(getUsername()); + flag = quotService.checkExistQuot(quot.getQuotSalesmanCode(),quot.getQuotCustomerBm(),quot.getQuotProject()); } - //quot.setQuotSalesmanCode(getUsername()); - quotService.insertQuot(quot); - //sendNoticeToBjz(quot); - return success(); - }else{ - if(hjRoleFlag){ - quot.setUpdateBy(quot.getQuotSalesmanCode()); + if(flag){ + return error("存在相同客户且项目名称一致的报价单,无法提交"); + } + + if(StringUtils.isEmpty(quot_id)){ + quot.setQuotId(UUID.fastUUID().toString()); + //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{ - quot.setUpdateBy(getUsername()); + if(hjRoleFlag){ + quot.setUpdateBy(quot.getQuotSalesmanCode()); + }else{ + quot.setUpdateBy(getUsername()); + } + quotService.updateQuot(quot); + //sendNoticeToBjz(quot); + return success(); } - quotService.updateQuot(quot); - //sendNoticeToBjz(quot); - return success(); + }catch (Exception e){ + return error("系统异常"); } } @@ -609,6 +637,7 @@ public class QuotController extends BaseController quotJswInfo.setKh(quot.getQuotCustomerName()); quotJswInfo.setKhid(quot.getQuotCustomerBm()); quotJswInfo.setBz(quot.getQuotQuotationRequire()); + quotJswInfo.setQuotUserId(getUsername()); List quotJswMaterials = new ArrayList<>(); QuotJswMaterial quotJswMaterial = null; @@ -715,6 +744,26 @@ public class QuotController extends BaseController sysOaQuot.setQuotLvPrice(quot.getQuotLvPrice()); sysOaQuot.setQuotTongPrice(quot.getQuotTongPrice()); sysOaQuot.setQuotMatpriceDiff(quot.getQuotMatpriceDiff()); + sysOaQuot.setQuotMatpriceDiff2(quot.getQuotMatpriceDiff2()); + + // 上传反馈清单 + QuotFile quotFile = new QuotFile(); + quotFile.setRelationId(quot.getQuotId()); + quotFile.setFileType("quotFkFile"); + List fileList = quotFileService.selectQuotFileList(quotFile); + String fileString = ""; + if(fileList!=null&&fileList.size()>0){ + for(QuotFile f:fileList){ + String fileUrl = f.getFileUrl(); + if(StringUtils.isEmpty(fileString)){ + fileString = fileString+fileUrl; + }else{ + fileString = fileString+","+fileUrl; + } + } + } + sysOaQuot.setQuotFkFile(fileString); + sysOaQuot.setCreateTime(DateUtils.getNowDate()); sysOaQuot.setIsFinish("0");// 报价已提交OA审批中 sysOaQuot.setMaterials(quot.getQuotMaterialList()); diff --git a/ruoyi-admin/src/main/java/com/ruoyi/web/controller/redBook/RedBookController.java b/ruoyi-admin/src/main/java/com/ruoyi/web/controller/redBook/RedBookController.java index e94836d..f130ed0 100644 --- a/ruoyi-admin/src/main/java/com/ruoyi/web/controller/redBook/RedBookController.java +++ b/ruoyi-admin/src/main/java/com/ruoyi/web/controller/redBook/RedBookController.java @@ -283,6 +283,11 @@ public class RedBookController extends BaseController List list = quot.getSelectedResultData(); + File directory = new File("xjQuotFile/"); + // 如果文件夹不存在,则创建文件夹 + if (!directory.exists()) { + directory.mkdir(); + } excelFile = new File("xjQuotFile/"+xjquot.getQuotCode()+".xls"); File file = excelUtil.exportXjQuotExcel(response,excelFile,xjquot,list); MultipartFile multipartFile = convert(file); diff --git a/ruoyi-admin/src/main/resources/application-druid.yml b/ruoyi-admin/src/main/resources/application-druid.yml index 91d30d0..e8b56b2 100644 --- a/ruoyi-admin/src/main/resources/application-druid.yml +++ b/ruoyi-admin/src/main/resources/application-druid.yml @@ -53,14 +53,14 @@ spring: url: jdbc:sqlserver://192.168.9.99:1433;DatabaseName=jn_storage username: sa password: Itcenter110- - order: + #order: # 从数据源开关/默认关闭 - enabled: true - driver-class-name: com.microsoft.sqlserver.jdbc.SQLServerDriver + #enabled: true + #driver-class-name: com.microsoft.sqlserver.jdbc.SQLServerDriver # 正式数据库 - url: jdbc:sqlserver://192.168.9.2:1433;DatabaseName=jn_web - username: sa - password: it12345 + #url: jdbc:sqlserver://192.168.9.2:1433;DatabaseName=jn_web + #username: sa + #password: it12345 # OA数据库数据源 oa: # 从数据源开关/默认关闭 diff --git a/ruoyi-common/src/main/java/com/ruoyi/common/utils/DateUtils.java b/ruoyi-common/src/main/java/com/ruoyi/common/utils/DateUtils.java index 5905cb3..8fd8124 100644 --- a/ruoyi-common/src/main/java/com/ruoyi/common/utils/DateUtils.java +++ b/ruoyi-common/src/main/java/com/ruoyi/common/utils/DateUtils.java @@ -5,7 +5,11 @@ import java.text.ParseException; import java.text.SimpleDateFormat; import java.time.*; import java.time.temporal.ChronoUnit; +import java.util.Calendar; import java.util.Date; +import java.util.regex.Matcher; +import java.util.regex.Pattern; + import org.apache.commons.lang3.time.DateFormatUtils; /** @@ -204,8 +208,79 @@ public class DateUtils extends org.apache.commons.lang3.time.DateUtils return Integer.parseInt(String.valueOf(secondsLeft)); } + /** + * 判断当前时间是否在[startTime, endTime]区间,注意时间格式要一致 + * + * @param nowTime 当前时间 + * @param startTime 开始时间 + * @param endTime 结束时间 + * @return + */ + public static boolean isEffectiveDate(Date nowTime, Date startTime, Date endTime) { + if (nowTime.getTime() == startTime.getTime() + || nowTime.getTime() == endTime.getTime()) { + return true; + } + + Calendar date = Calendar.getInstance(); + date.setTime(nowTime); + + Calendar begin = Calendar.getInstance(); + begin.setTime(startTime); + + Calendar end = Calendar.getInstance(); + end.setTime(endTime); + + if (date.after(begin) && date.before(end)) { + return true; + } else { + return false; + } + } + + /** + * 是否满足时分秒时间格式 + * @param inputString + * @return + */ + public static boolean isMatch(String inputString) { + String timeRegex = "^([01]?[0-9]|2[0-3]):[0-5][0-9]:[0-5][0-9]$"; + Pattern pattern = Pattern.compile(timeRegex); + Matcher matcher = pattern.matcher(inputString); + return matcher.matches(); + } + public static void main(String[] args) { - System.out.println(secondsUntilMidnight()); + + try{ + String format = "HH:mm:ss"; + + Date date = new Date(); + String currentTime = new SimpleDateFormat(format).format(date); + + Date nowTime = new SimpleDateFormat(format).parse(currentTime); + Date startTime = new SimpleDateFormat(format).parse("7:00:00"); + Date endTime = new SimpleDateFormat(format).parse("19:00:00"); + System.out.println(isEffectiveDate(nowTime, startTime, endTime)); + + + String inputString = "7:34:56"; + String timeRegex = "^([01]?[0-9]|2[0-3]):[0-5][0-9]:[0-5][0-9]$"; + + Pattern pattern = Pattern.compile(timeRegex); + Matcher matcher = pattern.matcher(inputString); + + if (matcher.matches()) { + System.out.println("输入的字符串是时分秒格式"); + } else { + System.out.println("输入的字符串不是时分秒格式"); + } + + }catch (Exception e){ + e.printStackTrace(); + } + + } } diff --git a/ruoyi-system/src/main/java/com/ruoyi/quot/domain/Quot.java b/ruoyi-system/src/main/java/com/ruoyi/quot/domain/Quot.java index c14c84c..eba39fd 100644 --- a/ruoyi-system/src/main/java/com/ruoyi/quot/domain/Quot.java +++ b/ruoyi-system/src/main/java/com/ruoyi/quot/domain/Quot.java @@ -93,6 +93,8 @@ public class Quot extends BaseEntity /** 整单料价价差率 */ private String quotMatpriceDiff; + /** 整单料价价差率2 */ + private String quotMatpriceDiff2; /** 是否打印 */ private String quotPrint; @@ -305,6 +307,9 @@ public class Quot extends BaseEntity public String getQuotMatpriceDiff() { return quotMatpriceDiff; } public void setQuotMatpriceDiff(String quotMatpriceDiff) { this.quotMatpriceDiff = quotMatpriceDiff; } + public String getQuotMatpriceDiff2() { return quotMatpriceDiff2; } + + public void setQuotMatpriceDiff2(String quotMatpriceDiff2) { this.quotMatpriceDiff2 = quotMatpriceDiff2; } public String getQuotPrint() { return quotPrint; } public void setQuotPrint(String quotPrint) { this.quotPrint = quotPrint; } diff --git a/ruoyi-system/src/main/java/com/ruoyi/quot/domain/SysOaQuot.java b/ruoyi-system/src/main/java/com/ruoyi/quot/domain/SysOaQuot.java index 2373c32..670e2d5 100644 --- a/ruoyi-system/src/main/java/com/ruoyi/quot/domain/SysOaQuot.java +++ b/ruoyi-system/src/main/java/com/ruoyi/quot/domain/SysOaQuot.java @@ -60,6 +60,11 @@ public class SysOaQuot extends BaseEntity /** 整单料价价差率 */ private String quotMatpriceDiff; + /** 整单料价价差率2 */ + private String quotMatpriceDiff2; + + /** 询价单-询价清单地址 */ + private String quotFkFile; /** OA审批状态 */ private String state; @@ -191,6 +196,14 @@ public class SysOaQuot extends BaseEntity this.quotMatpriceDiff = quotMatpriceDiff; } + public String getQuotMatpriceDiff2() { return quotMatpriceDiff2; } + + public void setQuotMatpriceDiff2(String quotMatpriceDiff2) { this.quotMatpriceDiff2 = quotMatpriceDiff2; } + + public String getQuotFkFile() { return quotFkFile; } + + public void setQuotFkFile(String quotFkFile) { this.quotFkFile = quotFkFile; } + public String getState() { return state; } public void setState(String state) { this.state = state; } diff --git a/ruoyi-system/src/main/java/com/ruoyi/quot/domain/jsw/QuotJswInfo.java b/ruoyi-system/src/main/java/com/ruoyi/quot/domain/jsw/QuotJswInfo.java index a87c5f8..e0e7043 100644 --- a/ruoyi-system/src/main/java/com/ruoyi/quot/domain/jsw/QuotJswInfo.java +++ b/ruoyi-system/src/main/java/com/ruoyi/quot/domain/jsw/QuotJswInfo.java @@ -6,13 +6,14 @@ 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 String quotCode;//客户报价单号 + private String xsy;//业务员名称 + private String xsyid;//业务员编码 + private String kh;//客户名称 + private String khid;//客户编码 + private String xm;//项目名称 + private String bz;//报价要求 + private String quotUserId;//报价员账户 private List quotMaterial; @@ -72,6 +73,10 @@ public class QuotJswInfo { this.bz = bz; } + public String getQuotUserId() { return quotUserId; } + + public void setQuotUserId(String quotUserId) { this.quotUserId = quotUserId; } + public List getQuotMaterial() { return quotMaterial; } diff --git a/ruoyi-system/src/main/resources/mapper/quot/QuotMapper.xml b/ruoyi-system/src/main/resources/mapper/quot/QuotMapper.xml index 7ba2bb2..ae99598 100644 --- a/ruoyi-system/src/main/resources/mapper/quot/QuotMapper.xml +++ b/ruoyi-system/src/main/resources/mapper/quot/QuotMapper.xml @@ -33,6 +33,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" + @@ -113,7 +114,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" 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_materials_count, - a.quot_lv_price,a.quot_tong_price,a.quot_matprice_diff,a.quot_print,a.quot_print_user_name,u3.nick_name quot_print_user_nickName, + a.quot_lv_price,a.quot_tong_price,a.quot_matprice_diff,a.quot_matprice_diff2,a.quot_print,a.quot_print_user_name,u3.nick_name quot_print_user_nickName, a.create_by, a.create_time, a.update_by, a.update_time, u.nick_name create_name, a.quot_jsxz_standard,a.quot_jsxz_approval_status,a.quot_jsxz_chapter, @@ -143,10 +144,11 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" and quot_salesman_name like concat('%', #{quotSalesmanName}, '%') and quot_print = #{quotPrint} and quot_approval_status = #{quotApprovalStatus} + and quot_oa_approval_status = #{quotOAApprovalStatus} ${params.dataScope} - order by a.quot_inquiry_date desc +