|
@@ -1,6 +1,8 @@
|
|
|
package com.yh.saas.plugin.yiliangyiyun.service.impl;
|
|
|
|
|
|
import com.baomidou.mybatisplus.mapper.EntityWrapper;
|
|
|
+import com.baomidou.mybatisplus.plugins.Page;
|
|
|
+import com.google.common.collect.Lists;
|
|
|
import com.yh.saas.common.support.util.IdGenerator;
|
|
|
import com.yh.saas.plugin.yiliangyiyun.constant.NumberConstant;
|
|
|
import com.yh.saas.plugin.yiliangyiyun.constant.StatusEnum;
|
|
@@ -18,7 +20,9 @@ import org.springframework.stereotype.Service;
|
|
|
import org.springframework.transaction.annotation.Transactional;
|
|
|
import org.springframework.util.CollectionUtils;
|
|
|
|
|
|
+import java.util.HashMap;
|
|
|
import java.util.List;
|
|
|
+import java.util.Map;
|
|
|
|
|
|
/**
|
|
|
* <p>
|
|
@@ -34,6 +38,38 @@ public class CargoOwnerInfoServiceImpl extends ServiceImpl<CargoOwnerInfoMapper,
|
|
|
@Autowired
|
|
|
private ICargoOwnerCompInfoService cargoOwnerCompInfoService;
|
|
|
|
|
|
+
|
|
|
+
|
|
|
+ /**
|
|
|
+ * 货主后台管理页面
|
|
|
+ *
|
|
|
+ * @param cargoOwnerInfo
|
|
|
+ * @return
|
|
|
+ */
|
|
|
+ @Override
|
|
|
+ public Page<CargoOwnerInfo> selectCargoOwnerInfoPage(CargoOwnerInfo cargoOwnerInfo) {
|
|
|
+ Map<String, Object> pageView = new HashMap<>();
|
|
|
+ pageView.put("startRecord", (cargoOwnerInfo.getCurrentPage() - 1)
|
|
|
+ * cargoOwnerInfo.getPageSize());
|
|
|
+ //公司id
|
|
|
+// pageView.put("compId", cargoOwnerInfo.getCompId());
|
|
|
+ pageView.put("commonId", cargoOwnerInfo.getCommonId());
|
|
|
+ pageView.put("searchType", cargoOwnerInfo.getSearchType());
|
|
|
+ pageView.put("searchKeyWord", cargoOwnerInfo.getSearchKeyWord());
|
|
|
+ pageView.put("pageSize", cargoOwnerInfo.getPageSize());
|
|
|
+ pageView.put("currentPage", cargoOwnerInfo.getCurrentPage());
|
|
|
+ // 查询司机总数
|
|
|
+ Integer dataCount = baseMapper.getCountByCondition(pageView);
|
|
|
+ List<CargoOwnerInfo> dataList = baseMapper.getListByCondition(pageView);
|
|
|
+ Page<CargoOwnerInfo> page = new Page<>();
|
|
|
+ page.setRecords(dataList == null ? Lists.newArrayList() : dataList);
|
|
|
+ page.setTotal(dataCount == null ? 0 : dataCount);
|
|
|
+ page.setCurrent(cargoOwnerInfo.getCurrentPage());
|
|
|
+ page.setSize(cargoOwnerInfo.getPageSize());
|
|
|
+ return page;
|
|
|
+ }
|
|
|
+
|
|
|
+
|
|
|
/**
|
|
|
*货主认证列表
|
|
|
* @param commonId
|
|
@@ -90,4 +126,70 @@ public class CargoOwnerInfoServiceImpl extends ServiceImpl<CargoOwnerInfoMapper,
|
|
|
}
|
|
|
return "OK";
|
|
|
}
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+ /**
|
|
|
+ * 审核/ 禁用
|
|
|
+ *
|
|
|
+ * @param cargoOwnerInfo
|
|
|
+ * @return
|
|
|
+ */
|
|
|
+ @Override
|
|
|
+ @Transactional(rollbackFor = Exception.class)
|
|
|
+ public String examine(CargoOwnerInfo cargoOwnerInfo) {
|
|
|
+ //查询列表
|
|
|
+ CargoOwnerInfo cargoOwnerInfo1 = this.selectById(cargoOwnerInfo.getId());
|
|
|
+
|
|
|
+ if (cargoOwnerInfo1 != null) {
|
|
|
+ //通过
|
|
|
+ if ("1".equals(cargoOwnerInfo.getFlag())) {
|
|
|
+ cargoOwnerInfo1.setAuthenticationStatusKey(StatusEnum.IDENTITY_COMPLETED.getFlag());
|
|
|
+ cargoOwnerInfo1.setAuthenticationStatus(StatusEnum.IDENTITY_COMPLETED.getName());
|
|
|
+// geTuiUtils.pushByCid("审核通知", "您的司机认证申请已审核通过", commonUser.getId());
|
|
|
+// UnimallMessage messageDO = new UnimallMessage();
|
|
|
+// messageDO.setAdminId(commonUser.getId());
|
|
|
+// messageDO.setCustomer(commonUser.getUserName());
|
|
|
+// messageDO.setOperation("审核通知");
|
|
|
+// messageDO.setResult("您的司机认证申请已审核通过");
|
|
|
+// messageDO.setGmtUpdate(new java.util.Date());
|
|
|
+// messageDO.setGmtCreate(new Date());
|
|
|
+// messageDO.setTaskId(IdGenerator.generateUUID());
|
|
|
+// messageDO.setCompanyId(AuthSecurityUtils.getCurrentUserInfo().getCompId());
|
|
|
+// messageDO.setPath("XXXXX");
|
|
|
+// webSocket.sendOneMessage(messageDO);
|
|
|
+ }
|
|
|
+// 驳回
|
|
|
+ else if("2".equals(cargoOwnerInfo.getFlag())){
|
|
|
+ cargoOwnerInfo1.setAuthenticationStatusKey(StatusEnum.IDENTITY_FAILED.getFlag());
|
|
|
+ cargoOwnerInfo1.setAuthenticationStatus(StatusEnum.IDENTITY_FAILED.getName());
|
|
|
+// geTuiUtils.pushByCid("驳回通知", "您的司机认证申请已被驳回", commonUser.getId());
|
|
|
+// UnimallMessage messageDO = new UnimallMessage();
|
|
|
+// messageDO.setAdminId(commonUser.getId());
|
|
|
+// messageDO.setCustomer(commonUser.getUserName());
|
|
|
+// messageDO.setOperation("驳回通知");
|
|
|
+// messageDO.setResult("您的司机认证申请已被驳回");
|
|
|
+// messageDO.setGmtUpdate(new java.util.Date());
|
|
|
+// messageDO.setGmtCreate(new Date());
|
|
|
+// messageDO.setTaskId(IdGenerator.generateUUID());
|
|
|
+// messageDO.setCompanyId(AuthSecurityUtils.getCurrentUserInfo().getCompId());
|
|
|
+// messageDO.setPath("XXXXX");
|
|
|
+// webSocket.sendOneMessage(messageDO);
|
|
|
+ }
|
|
|
+ // 禁用
|
|
|
+ else if("3".equals(cargoOwnerInfo.getFlag())){
|
|
|
+ cargoOwnerInfo1.setAuthenticationStatusKey(StatusEnum.IDENTITY_COMPLETED_NO.getFlag());
|
|
|
+ cargoOwnerInfo1.setAuthenticationStatus(StatusEnum.IDENTITY_COMPLETED_NO.getName());
|
|
|
+ }
|
|
|
+ else if("4".equals(cargoOwnerInfo.getFlag())){
|
|
|
+ cargoOwnerInfo1.setAuthenticationStatusKey(StatusEnum.IDENTITY_COMPLETED.getFlag());
|
|
|
+ cargoOwnerInfo1.setAuthenticationStatus(StatusEnum.IDENTITY_COMPLETED.getName());
|
|
|
+ }
|
|
|
+ //更改信息
|
|
|
+ this.updateById(cargoOwnerInfo1);
|
|
|
+ return "OK";
|
|
|
+ }
|
|
|
+ return "NG";
|
|
|
+ }
|
|
|
+
|
|
|
}
|