|
|
@@ -258,7 +258,7 @@ public class PurQuotationSelectionController {
|
|
|
return Result.OK(PurOrderPage);
|
|
|
}
|
|
|
|
|
|
- public static void main(String[] args) {
|
|
|
+ public static void mai1n(String[] args) {
|
|
|
|
|
|
|
|
|
List<String> list = new ArrayList<String>();
|
|
|
@@ -469,6 +469,20 @@ public class PurQuotationSelectionController {
|
|
|
|
|
|
List<String> listId = new ArrayList<>();
|
|
|
|
|
|
+ BigDecimal checkQuotaBig = new BigDecimal("2000");
|
|
|
+
|
|
|
+ try {
|
|
|
+
|
|
|
+ String checkQuota = sysDictService.queryDescriptionByKey("check_quota");
|
|
|
+
|
|
|
+ if(StringUtils.isNotBlank(checkQuota)){
|
|
|
+ checkQuotaBig = new BigDecimal(checkQuota);
|
|
|
+ }
|
|
|
+
|
|
|
+ }catch (Exception e){
|
|
|
+
|
|
|
+ }
|
|
|
+
|
|
|
StringBuffer sb = new StringBuffer();
|
|
|
for (PurQuotationSelection o : list) {
|
|
|
//提交(1-是 ,0-否)
|
|
|
@@ -482,7 +496,8 @@ public class PurQuotationSelectionController {
|
|
|
|
|
|
BigDecimal totalAmountUsd = o.getTotalAmountUsd() == null ? BigDecimal.ZERO : o.getTotalAmountUsd();
|
|
|
String id = o.getId();
|
|
|
- if(totalAmountUsd.compareTo(new BigDecimal("2000")) >= 0 ){
|
|
|
+// if(totalAmountUsd.compareTo(new BigDecimal("2000")) >= 0 ){
|
|
|
+ if(totalAmountUsd.compareTo(checkQuotaBig) >= 0 ){
|
|
|
listId.add(id);
|
|
|
}
|
|
|
|
|
|
@@ -497,26 +512,57 @@ public class PurQuotationSelectionController {
|
|
|
ent.setSubmit("1");
|
|
|
purQuotationSelectionService.update(ent, queryWrapper);
|
|
|
|
|
|
- if(listId.size() > 0){
|
|
|
-
|
|
|
- String active = getActiveProfile();
|
|
|
- if(StringUtils.isNotBlank(active) && (active.equals("prod") || active.equals("dev"))){
|
|
|
-
|
|
|
- QueryWrapper<PurQuotationSelection> queryWrapper2 = new QueryWrapper<>();
|
|
|
- queryWrapper2.in("id",listId);
|
|
|
- PurQuotationSelection ent2 = new PurQuotationSelection();
|
|
|
+ LoginUser sysUser = (LoginUser) SecurityUtils.getSubject().getPrincipal();
|
|
|
+// if(StringUtils.isNotBlank(sysUser.getOrgCode()) &&
|
|
|
+// (sysUser.getUsername().equals("admin")||
|
|
|
+// sysUser.getOrgCode().equals("A02A03")||
|
|
|
+// sysUser.getOrgCode().equals("A02A03A01")||
|
|
|
+// sysUser.getOrgCode().equals("A02A03A02")||
|
|
|
+// sysUser.getOrgCode().equals("A02A03A03")||
|
|
|
+// sysUser.getOrgCode().equals("A02A03A04")||
|
|
|
+// sysUser.getOrgCode().equals("A02A03A05")||
|
|
|
+// sysUser.getOrgCode().equals("A02A03A06")||
|
|
|
+// sysUser.getOrgCode().equals("A02A03A07"))) {
|
|
|
+ if(StringUtils.isNotBlank(sysUser.getOrgCode()) &&
|
|
|
+ (sysUser.getUsername().equals("admin")||
|
|
|
+ sysUser.getOrgCode().indexOf("A02A03") != -1)) {
|
|
|
+
|
|
|
+ if(listId.size() > 0){
|
|
|
+
|
|
|
+ String active = getActiveProfile();
|
|
|
+ if(StringUtils.isNotBlank(active) && (active.equals("prod") || active.equals("dev"))){
|
|
|
+
|
|
|
+ QueryWrapper<PurQuotationSelection> queryWrapper2 = new QueryWrapper<>();
|
|
|
+ queryWrapper2.in("id",listId);
|
|
|
+ PurQuotationSelection ent2 = new PurQuotationSelection();
|
|
|
// 提交(1是 0否 2待审核)
|
|
|
- ent2.setSubmit("2");
|
|
|
- purQuotationSelectionService.update(ent2, queryWrapper2);
|
|
|
+ ent2.setSubmit("2");
|
|
|
+ purQuotationSelectionService.update(ent2, queryWrapper2);
|
|
|
+
|
|
|
+ return Result.OK("提交成功(本单报价金额超过"+checkQuotaBig+"美金,需上级审批)!");
|
|
|
+ }
|
|
|
|
|
|
- return Result.OK("提交成功(本单报价金额超过2000美金,需上级审批)!");
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
+
|
|
|
return Result.OK("提交成功!");
|
|
|
}
|
|
|
|
|
|
+ public static void main(String[] args) {
|
|
|
+ String str = "A02A03";
|
|
|
+ String toFind = "A02A03";
|
|
|
+
|
|
|
+ // 使用 indexOf() 方法查找子串
|
|
|
+ int index = str.indexOf(toFind);
|
|
|
+
|
|
|
+ if (index != -1) {
|
|
|
+ System.out.println("找到子串 '" + toFind + "',起始索引为: " + index);
|
|
|
+ } else {
|
|
|
+ System.out.println("未找到子串 '" + toFind + "'");
|
|
|
+ }
|
|
|
+ }
|
|
|
|
|
|
|
|
|
/**
|