Commit 89d07221ccc112b20f4f6888f365f8122524e23f

Authored by 房远帅
2 parents 9480ec50 bab22544

Merge branch 'master_after20' into master_cj_zq

@@ -98,6 +98,14 @@ public class ContractFrameworkController extends DefaultBaseController { @@ -98,6 +98,14 @@ public class ContractFrameworkController extends DefaultBaseController {
98 98
99 vo.setCustomerIdList(customerList.stream().map(Customer::getId).collect(Collectors.toList())); 99 vo.setCustomerIdList(customerList.stream().map(Customer::getId).collect(Collectors.toList()));
100 } 100 }
  101 + if (vo != null && StringUtils.isNotBlank(vo.getKeyword())) {
  102 + QueryCustomerVo queryCustomerVo = new QueryCustomerVo();
  103 + queryCustomerVo.setName(vo.getKeyword());
  104 + List<Customer> customerList = customerService.query(queryCustomerVo);
  105 + if (CollectionUtils.isNotEmpty(customerList)) {
  106 + vo.setCustomerIdList(customerList.stream().map(Customer::getId).collect(Collectors.toList()));
  107 + }
  108 + }
101 109
102 PageResult<ContractFramework> pageResult = contractFrameworkService.query(getPageIndex(vo), getPageSize(vo), vo); 110 PageResult<ContractFramework> pageResult = contractFrameworkService.query(getPageIndex(vo), getPageSize(vo), vo);
103 111
@@ -37,14 +37,14 @@ public class LatexFormulaExcelExporterUtil { @@ -37,14 +37,14 @@ public class LatexFormulaExcelExporterUtil {
37 } 37 }
38 38
39 latex.append(formatScientificNotation(comp.getBase())); 39 latex.append(formatScientificNotation(comp.getBase()));
40 - if (comp.getSup() != null && comp.getSup().compareTo(BigDecimal.ZERO) > 0) { 40 + if (comp.getSup() != null && comp.getSup().compareTo(BigDecimal.ZERO) >= 0) {
41 latex.append("^{+").append(formatScientificNotation(comp.getSup())).append("}"); 41 latex.append("^{+").append(formatScientificNotation(comp.getSup())).append("}");
42 } 42 }
43 if (comp.getSup() != null && comp.getSup().compareTo(BigDecimal.ZERO) < 0) { 43 if (comp.getSup() != null && comp.getSup().compareTo(BigDecimal.ZERO) < 0) {
44 latex.append("^{").append(formatScientificNotation(comp.getSup())).append("}"); 44 latex.append("^{").append(formatScientificNotation(comp.getSup())).append("}");
45 } 45 }
46 46
47 - if (comp.getSub() != null && comp.getSub().compareTo(BigDecimal.ZERO) > 0) { 47 + if (comp.getSub() != null && comp.getSub().compareTo(BigDecimal.ZERO) >= 0) {
48 latex.append("_{+").append(formatScientificNotation(comp.getSub())).append("}"); 48 latex.append("_{+").append(formatScientificNotation(comp.getSub())).append("}");
49 } 49 }
50 if (comp.getSub() != null && comp.getSub().compareTo(BigDecimal.ZERO) < 0) { 50 if (comp.getSub() != null && comp.getSub().compareTo(BigDecimal.ZERO) < 0) {
@@ -92,4 +92,10 @@ public class QueryContractFrameworkVo extends PageVo implements BaseVo, Serializ @@ -92,4 +92,10 @@ public class QueryContractFrameworkVo extends PageVo implements BaseVo, Serializ
92 */ 92 */
93 @ApiModelProperty("客户Id集合") 93 @ApiModelProperty("客户Id集合")
94 private List<String> customerIdList; 94 private List<String> customerIdList;
  95 +
  96 + /**
  97 + * 移动端搜索
  98 + */
  99 + @ApiModelProperty("移动端搜索")
  100 + private String keyword;
95 } 101 }
@@ -63,12 +63,31 @@ @@ -63,12 +63,31 @@
63 <if test="vo.validityTimeEnd != null"> 63 <if test="vo.validityTimeEnd != null">
64 AND tb.validity_time &lt;= #{vo.validityTimeEnd} 64 AND tb.validity_time &lt;= #{vo.validityTimeEnd}
65 </if> 65 </if>
66 - <if test="vo.customerIdList != null and vo.customerIdList.size() > 0">  
67 - AND tb.customer_id IN  
68 - <foreach collection="vo.customerIdList" open="(" separator="," close=")" item="item">  
69 - #{item}  
70 - </foreach>  
71 - </if> 66 + <choose>
  67 + <!-- 情况1:customerIdList 和 keyword 都有值 -->
  68 + <when test="vo.customerIdList != null and vo.customerIdList.size() > 0 and vo.keyword != null and vo.keyword != ''">
  69 + AND (
  70 + tb.customer_id IN
  71 + <foreach collection="vo.customerIdList" open="(" separator="," close=")" item="item">
  72 + #{item}
  73 + </foreach>
  74 + OR tb.code LIKE CONCAT('%', #{vo.keyword}, '%')
  75 + )
  76 + </when>
  77 +
  78 + <!-- 情况2:只有 customerIdList 有值 -->
  79 + <when test="vo.customerIdList != null and vo.customerIdList.size() > 0">
  80 + AND tb.customer_id IN
  81 + <foreach collection="vo.customerIdList" open="(" separator="," close=")" item="item">
  82 + #{item}
  83 + </foreach>
  84 + </when>
  85 +
  86 + <!-- 情况3:只有 keyword 有值 -->
  87 + <when test="vo.keyword != null and vo.keyword != ''">
  88 + AND tb.code LIKE CONCAT('%', #{vo.keyword}, '%')
  89 + </when>
  90 + </choose>
72 </where> 91 </where>
73 order by tb.create_time desc 92 order by tb.create_time desc
74 </select> 93 </select>