Commit de999aee66edad9ce86b02214f6dc5f11c3a2f25

Authored by yeqianyong
2 parents 02e48b77 2aab1287

Merge branch 'master_cj_zq' into master_sample_order

@@ -298,8 +298,15 @@ public class PurchaseOrderInfoController extends DefaultBaseController { @@ -298,8 +298,15 @@ public class PurchaseOrderInfoController extends DefaultBaseController {
298 if (contract == null) { 298 if (contract == null) {
299 throw new DefaultClientException("合同不存在!"); 299 throw new DefaultClientException("合同不存在!");
300 } 300 }
301 - Boolean standardStandardized = contract.getStandardStandardized();  
302 - if (!BooleanUtils.isTrue(standardStandardized)) { 301 + String contractType = contract.getType();
  302 + if (("DISTRIB_STD".equals(contractType) || "INTL_STD_CONTRACT".equals(contractType) || "PROCESS_STD_AGMT".equals(contractType)
  303 + || "DRAFT_DIST_AGMT".equals(contractType) || "INTL_OPEN_SPEC_AGMT".equals(contractType))
  304 + && !"PASS".equals(contract.getStandardApproved())) {
  305 + // 标准、未锁规合同
  306 + throw new DefaultClientException("合同不规范,请补充!");
  307 + } else if (("DIST_STOCK_CONTRACT".equals(contractType) || "INTL_INVENTORY_AGMT".equals(contractType))
  308 + && !"PASS".equals(contract.getFormalApproved())) {
  309 + // 库存合同
303 throw new DefaultClientException("合同不规范,请补充!"); 310 throw new DefaultClientException("合同不规范,请补充!");
304 } 311 }
305 return InvokeResultBuilder.success(); 312 return InvokeResultBuilder.success();
@@ -494,6 +494,19 @@ public class ReceiptLedgerInfoServiceImpl extends BaseMpServiceImpl<ReceiptLedge @@ -494,6 +494,19 @@ public class ReceiptLedgerInfoServiceImpl extends BaseMpServiceImpl<ReceiptLedge
494 vo.setEndTime(endTime); 494 vo.setEndTime(endTime);
495 } 495 }
496 DateTimeFormatter formatter = DateTimeFormatter.ofPattern("yyyy-MM-dd HH:mm:ss"); 496 DateTimeFormatter formatter = DateTimeFormatter.ofPattern("yyyy-MM-dd HH:mm:ss");
  497 + // 总欠款筛选
  498 + String debtAmountScope = vo.getDebtAmountScope();
  499 + if ("SCOPE_1".equals(debtAmountScope)) {
  500 + vo.setDebtStartValue(new BigDecimal(5000000));
  501 + } else if ("SCOPE_2".equals(debtAmountScope)) {
  502 + vo.setDebtStartValue(new BigDecimal(3000000));
  503 + vo.setDebtEndValue(new BigDecimal(5000000));
  504 + } else if ("SCOPE_3".equals(debtAmountScope)) {
  505 + vo.setDebtStartValue(new BigDecimal(1000000));
  506 + vo.setDebtEndValue(new BigDecimal(3000000));
  507 + } else if ("SCOPE_4".equals(debtAmountScope)) {
  508 + vo.setDebtEndValue(new BigDecimal(1000000));
  509 + }
497 // 开启分页 510 // 开启分页
498 PageHelperUtil.startPage(pageIndex, pageSize); 511 PageHelperUtil.startPage(pageIndex, pageSize);
499 List<ReceiptLedgerReportBo> dataList = getBaseMapper().report(vo); 512 List<ReceiptLedgerReportBo> dataList = getBaseMapper().report(vo);
@@ -132,6 +132,24 @@ @@ -132,6 +132,24 @@
132 AND tb.debt_status = #{vo.debtStatus} 132 AND tb.debt_status = #{vo.debtStatus}
133 </if> 133 </if>
134 </where> 134 </where>
  135 + ORDER BY
  136 + CASE
  137 + WHEN d.name like '宁波办%' THEN 1
  138 + WHEN d.name like '温州办%' THEN 2
  139 + WHEN d.name like '东莞办%' THEN 3
  140 + WHEN d.name like '佛山办%' THEN 4
  141 + WHEN d.name like '苏州办%' THEN 5
  142 + WHEN d.name like '常州办%' THEN 6
  143 + WHEN d.name like '北方办%' THEN 7
  144 + WHEN d.name like '紫铜办%' THEN 8
  145 + WHEN d.name like '外贸办%' THEN 9
  146 + ELSE 10 -- 其他办事处按字母顺序排在后面
  147 + END,
  148 + d.name ASC,
  149 + r.name ASC,
  150 + cs.short_name ASC,
  151 + oc.name ASC,
  152 + tb.shipment_date DESC
135 </select> 153 </select>
136 154
137 <select id="queryByCustomerShortName" resultMap="ReceiptLedgerInfo"> 155 <select id="queryByCustomerShortName" resultMap="ReceiptLedgerInfo">
@@ -231,7 +249,8 @@ @@ -231,7 +249,8 @@
231 tb.region, 249 tb.region,
232 r.name as region_name, 250 r.name as region_name,
233 max(cc.company_credit_limit) as quota, 251 max(cc.company_credit_limit) as quota,
234 - max(cc.company_settlement_period) as settle_term 252 + max(cc.company_settlement_period) as settle_term,
  253 + sum(distinct rl.end_account_receivable) as end_account_total
235 from base_data_customer_short tb 254 from base_data_customer_short tb
236 left join sys_dept d on tb.dept_id = d.id 255 left join sys_dept d on tb.dept_id = d.id
237 left join sys_dept r on tb.region = r.id 256 left join sys_dept r on tb.region = r.id
@@ -254,11 +273,27 @@ @@ -254,11 +273,27 @@
254 group by tb.short_name,tb.type,tb.dept_id,tb.region 273 group by tb.short_name,tb.type,tb.dept_id,tb.region
255 having 1=1 274 having 1=1
256 <if test="vo.debtStartValue != null"> 275 <if test="vo.debtStartValue != null">
257 - and sum(rl.end_account_receivable) >= #{debtStartValue} 276 + and sum(distinct rl.end_account_receivable) >= #{vo.debtStartValue}
258 </if> 277 </if>
259 <if test="vo.debtEndValue != null"> 278 <if test="vo.debtEndValue != null">
260 - and sum(rl.end_account_receivable) &lt;= #{debtEndValue} 279 + and sum(distinct rl.end_account_receivable) &lt;= #{vo.debtEndValue}
261 </if> 280 </if>
  281 + order by
  282 + case
  283 + when d.name like '宁波办%' then 1
  284 + when d.name like '温州办%' then 2
  285 + when d.name like '东莞办%' then 3
  286 + when d.name like '佛山办%' then 4
  287 + when d.name like '苏州办%' then 5
  288 + when d.name like '常州办%' then 6
  289 + when d.name like '北方办%' then 7
  290 + when d.name like '紫铜办%' then 8
  291 + when d.name like '外贸办%' then 9
  292 + else 10 -- 其他办事处按字母顺序排在后面
  293 + end,
  294 + d.name asc,
  295 + r.name asc,
  296 + sum(distinct rl.end_account_receivable) desc
262 </select> 297 </select>
263 298
264 <select id="statisticsDebtByShortName" resultType="java.util.Map"> 299 <select id="statisticsDebtByShortName" resultType="java.util.Map">