|
@@ -474,73 +474,85 @@ public class IdentityAuthenticationInfoServiceImpl extends ServiceImpl<IdentityA
|
|
|
*/
|
|
|
@Override
|
|
|
public List<IdentityAuthenticationInfo> identityAuthenticationInfoCustomer(IdentityAuthenticationInfo identityAuthenticationInfo) {
|
|
|
-// Map<String, Object> pageView = new HashMap<>();
|
|
|
-// if(identityAuthenticationInfo.getCompId() == null || identityAuthenticationInfo.getCompId().isEmpty()){
|
|
|
-// identityAuthenticationInfo.setCompId(AuthSecurityUtils.getStaffById(AuthSecurityUtils.getCurrentUserId()).getCompId());
|
|
|
-// }
|
|
|
-// //公司id
|
|
|
-// pageView.put("compId", identityAuthenticationInfo.getCompId());
|
|
|
-// pageView.put("authenticationStatusKey", identityAuthenticationInfo.getAuthenticationStatusKey());
|
|
|
-// pageView.put("searchKeyWord", identityAuthenticationInfo.getSearchKeyWord());
|
|
|
-// List<IdentityAuthenticationInfo> dataList = this.baseMapper.getIdentityInfoByCondition(pageView);
|
|
|
-// return dataList;
|
|
|
+ Map<String, Object> pageView = new HashMap<>();
|
|
|
if(identityAuthenticationInfo.getCompId() == null || identityAuthenticationInfo.getCompId().isEmpty()){
|
|
|
identityAuthenticationInfo.setCompId(AuthSecurityUtils.getStaffById(AuthSecurityUtils.getCurrentUserId()).getCompId());
|
|
|
}
|
|
|
- Wrapper<IdentityAuthenticationInfo> identityAuthenticationInfoWrapper = new EntityWrapper<>();
|
|
|
- identityAuthenticationInfoWrapper.eq("comp_id",identityAuthenticationInfo.getCompId())
|
|
|
- .eq("cover","0")
|
|
|
- .eq("authentication_status_key","7");
|
|
|
- if (!StringUtils.isEmpty(identityAuthenticationInfo.getSearchKeyWord())) {
|
|
|
- identityAuthenticationInfoWrapper.andNew("replace(" + "customer_name" + ",' ','')like {0} or "
|
|
|
- + "customer_phone" + " like {0} or "
|
|
|
- + "supplier" + " like {0}", "%" + identityAuthenticationInfo.getSearchKeyWord() + "%");
|
|
|
- }
|
|
|
- List<IdentityAuthenticationInfo> identityAuthenticationInfoList = this.selectList(identityAuthenticationInfoWrapper);
|
|
|
PurchasePrice purchasePrice=purchasePriceService.selectOne(new EntityWrapper<PurchasePrice>()
|
|
|
.eq("warehouse_id",identityAuthenticationInfo.getWarehouseId())
|
|
|
.eq("goods_name",identityAuthenticationInfo.getGoodsName())
|
|
|
.eq("status","已通过"));
|
|
|
- List<IdentityAuthenticationInfo> identityAuthenticationInfoListNew=new ArrayList<>();
|
|
|
- if (CollectionUtils.isNotEmpty(identityAuthenticationInfoList)){
|
|
|
- for (IdentityAuthenticationInfo identityAuthenticationInfo1:identityAuthenticationInfoList) {
|
|
|
- Float cumulant = 0.0f;
|
|
|
- //本年第一天零点
|
|
|
- SimpleDateFormat now = new SimpleDateFormat("yyyy-01-01 00:00:00");
|
|
|
- Calendar c = Calendar.getInstance();
|
|
|
- c.setTime(new java.util.Date());
|
|
|
- c.add(Calendar.YEAR, 0);
|
|
|
- Date y = c.getTime();
|
|
|
- String year = now.format(y);
|
|
|
- if (identityAuthenticationInfo.getGoodsName().contains("玉米")) {
|
|
|
- identityAuthenticationInfo.setGoodsName("玉米");
|
|
|
- }
|
|
|
- List<PaymentManagement> paymentManagementList = paymentManagementService.selectList(new EntityWrapper<PaymentManagement>()
|
|
|
- .like("goods_name", "%" + identityAuthenticationInfo.getGoodsName() + "%")
|
|
|
- .eq("customer_number_card", identityAuthenticationInfo1.getCustomerNumberCard())
|
|
|
- .eq("comp_id", purchasePrice.getCompId())
|
|
|
- .ge("create_date", year));
|
|
|
- if (!CollectionUtils.isEmpty(paymentManagementList)) {
|
|
|
- Float netWeight = 0f;
|
|
|
- for (PaymentManagement paymentManagement1 : paymentManagementList) {
|
|
|
- //干粮净重
|
|
|
- if ("干粮".equals(paymentManagement1.getType())) {
|
|
|
- netWeight = netWeight + (paymentManagement1.getNetWeight() != null ? paymentManagement1.getNetWeight() : 0f);
|
|
|
- }
|
|
|
- //潮粮纯重
|
|
|
- else if ("潮粮".equals(paymentManagement1.getType())) {
|
|
|
- netWeight = netWeight + (paymentManagement1.getPureWeight() != null ? paymentManagement1.getPureWeight() : 0f);
|
|
|
- }
|
|
|
- }
|
|
|
- cumulant = cumulant + netWeight;
|
|
|
- }
|
|
|
- if (cumulant > (purchasePrice.getSaleLimit() - 50)*1000) {
|
|
|
- identityAuthenticationInfoListNew.add(identityAuthenticationInfo1);
|
|
|
- }
|
|
|
- }
|
|
|
- identityAuthenticationInfoList.removeAll(identityAuthenticationInfoListNew);
|
|
|
+ if (identityAuthenticationInfo.getGoodsName().contains("玉米")) {
|
|
|
+ identityAuthenticationInfo.setGoodsName("玉米");
|
|
|
}
|
|
|
- return identityAuthenticationInfoList;
|
|
|
+ SimpleDateFormat now = new SimpleDateFormat("yyyy-01-01 00:00:00");
|
|
|
+ Calendar c = Calendar.getInstance();
|
|
|
+ c.setTime(new java.util.Date());
|
|
|
+ c.add(Calendar.YEAR, 0);
|
|
|
+ Date y = c.getTime();
|
|
|
+ String year = now.format(y);
|
|
|
+ //公司id
|
|
|
+ pageView.put("compId", identityAuthenticationInfo.getCompId());
|
|
|
+ pageView.put("authenticationStatusKey", "7");
|
|
|
+ pageView.put("year", year);
|
|
|
+ pageView.put("goodsName",identityAuthenticationInfo.getGoodsName());
|
|
|
+ pageView.put("saleLimit", purchasePrice.getSaleLimit()*1000);
|
|
|
+ pageView.put("searchKeyWord", identityAuthenticationInfo.getSearchKeyWord());
|
|
|
+ List<IdentityAuthenticationInfo> dataList = this.baseMapper.getIdentityInfoNotLimit(pageView);
|
|
|
+ return dataList;
|
|
|
+// if(identityAuthenticationInfo.getCompId() == null || identityAuthenticationInfo.getCompId().isEmpty()){
|
|
|
+// identityAuthenticationInfo.setCompId(AuthSecurityUtils.getStaffById(AuthSecurityUtils.getCurrentUserId()).getCompId());
|
|
|
+// }
|
|
|
+// Wrapper<IdentityAuthenticationInfo> identityAuthenticationInfoWrapper = new EntityWrapper<>();
|
|
|
+// identityAuthenticationInfoWrapper.eq("comp_id",identityAuthenticationInfo.getCompId())
|
|
|
+// .eq("cover","0")
|
|
|
+// .eq("authentication_status_key","7");
|
|
|
+// if (!StringUtils.isEmpty(identityAuthenticationInfo.getSearchKeyWord())) {
|
|
|
+// identityAuthenticationInfoWrapper.andNew("replace(" + "customer_name" + ",' ','')like {0} or "
|
|
|
+// + "customer_phone" + " like {0} or "
|
|
|
+// + "supplier" + " like {0}", "%" + identityAuthenticationInfo.getSearchKeyWord() + "%");
|
|
|
+// }
|
|
|
+// List<IdentityAuthenticationInfo> identityAuthenticationInfoList = this.selectList(identityAuthenticationInfoWrapper);
|
|
|
+// List<IdentityAuthenticationInfo> identityAuthenticationInfoListNew=new ArrayList<>();
|
|
|
+// if (CollectionUtils.isNotEmpty(identityAuthenticationInfoList)){
|
|
|
+// for (IdentityAuthenticationInfo identityAuthenticationInfo1:identityAuthenticationInfoList) {
|
|
|
+// Float cumulant = 0.0f;
|
|
|
+// //本年第一天零点
|
|
|
+// SimpleDateFormat now = new SimpleDateFormat("yyyy-01-01 00:00:00");
|
|
|
+// Calendar c = Calendar.getInstance();
|
|
|
+// c.setTime(new java.util.Date());
|
|
|
+// c.add(Calendar.YEAR, 0);
|
|
|
+// Date y = c.getTime();
|
|
|
+// String year = now.format(y);
|
|
|
+// if (identityAuthenticationInfo.getGoodsName().contains("玉米")) {
|
|
|
+// identityAuthenticationInfo.setGoodsName("玉米");
|
|
|
+// }
|
|
|
+// List<PaymentManagement> paymentManagementList = paymentManagementService.selectList(new EntityWrapper<PaymentManagement>()
|
|
|
+// .like("goods_name", "%" + identityAuthenticationInfo.getGoodsName() + "%")
|
|
|
+// .eq("customer_number_card", identityAuthenticationInfo1.getCustomerNumberCard())
|
|
|
+// .eq("comp_id", purchasePrice.getCompId())
|
|
|
+// .ge("create_date", year));
|
|
|
+// if (!CollectionUtils.isEmpty(paymentManagementList)) {
|
|
|
+// Float netWeight = 0f;
|
|
|
+// for (PaymentManagement paymentManagement1 : paymentManagementList) {
|
|
|
+// //干粮净重
|
|
|
+// if ("干粮".equals(paymentManagement1.getType())) {
|
|
|
+// netWeight = netWeight + (paymentManagement1.getNetWeight() != null ? paymentManagement1.getNetWeight() : 0f);
|
|
|
+// }
|
|
|
+// //潮粮纯重
|
|
|
+// else if ("潮粮".equals(paymentManagement1.getType())) {
|
|
|
+// netWeight = netWeight + (paymentManagement1.getPureWeight() != null ? paymentManagement1.getPureWeight() : 0f);
|
|
|
+// }
|
|
|
+// }
|
|
|
+// cumulant = cumulant + netWeight;
|
|
|
+// }
|
|
|
+// if (cumulant > (purchasePrice.getSaleLimit() - 50)*1000) {
|
|
|
+// identityAuthenticationInfoListNew.add(identityAuthenticationInfo1);
|
|
|
+// }
|
|
|
+// }
|
|
|
+// identityAuthenticationInfoList.removeAll(identityAuthenticationInfoListNew);
|
|
|
+// }
|
|
|
+// return identityAuthenticationInfoList;
|
|
|
}
|
|
|
|
|
|
/**
|