|
@@ -1,12 +1,11 @@
|
|
package com.yh.saas.plugin.yiliangyiyun.service.impl;
|
|
package com.yh.saas.plugin.yiliangyiyun.service.impl;
|
|
|
|
|
|
import com.baomidou.mybatisplus.mapper.EntityWrapper;
|
|
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.common.support.util.IdGenerator;
|
|
import com.yh.saas.plugin.yiliangyiyun.constant.StatusEnum;
|
|
import com.yh.saas.plugin.yiliangyiyun.constant.StatusEnum;
|
|
-import com.yh.saas.plugin.yiliangyiyun.entity.CargoOwnerInfo;
|
|
|
|
-import com.yh.saas.plugin.yiliangyiyun.entity.CommonUser;
|
|
|
|
-import com.yh.saas.plugin.yiliangyiyun.entity.PatformAnagementEgulations;
|
|
|
|
-import com.yh.saas.plugin.yiliangyiyun.entity.PublishTaskInfo;
|
|
|
|
|
|
+import com.yh.saas.plugin.yiliangyiyun.entity.*;
|
|
import com.yh.saas.plugin.yiliangyiyun.mapper.PatformAnagementEgulationsMapper;
|
|
import com.yh.saas.plugin.yiliangyiyun.mapper.PatformAnagementEgulationsMapper;
|
|
import com.yh.saas.plugin.yiliangyiyun.service.IPatformAnagementEgulationsService;
|
|
import com.yh.saas.plugin.yiliangyiyun.service.IPatformAnagementEgulationsService;
|
|
import com.baomidou.mybatisplus.service.impl.ServiceImpl;
|
|
import com.baomidou.mybatisplus.service.impl.ServiceImpl;
|
|
@@ -15,7 +14,9 @@ import org.springframework.transaction.annotation.Transactional;
|
|
|
|
|
|
import java.text.SimpleDateFormat;
|
|
import java.text.SimpleDateFormat;
|
|
import java.util.Date;
|
|
import java.util.Date;
|
|
|
|
+import java.util.HashMap;
|
|
import java.util.List;
|
|
import java.util.List;
|
|
|
|
+import java.util.Map;
|
|
|
|
|
|
/**
|
|
/**
|
|
* <p>
|
|
* <p>
|
|
@@ -39,7 +40,8 @@ public class PatformAnagementEgulationsServiceImpl extends ServiceImpl<PatformAn
|
|
public String add(PatformAnagementEgulations patformAnagementEgulations) {
|
|
public String add(PatformAnagementEgulations patformAnagementEgulations) {
|
|
//新增主键id
|
|
//新增主键id
|
|
patformAnagementEgulations.setId(IdGenerator.generateUUID());
|
|
patformAnagementEgulations.setId(IdGenerator.generateUUID());
|
|
-
|
|
|
|
|
|
+ patformAnagementEgulations.setStatusKey(StatusEnum.PLATFORM_REVIEWED.getFlag());
|
|
|
|
+ patformAnagementEgulations.setStatus(StatusEnum.PLATFORM_REVIEWED.getName());
|
|
// 操作主表数据
|
|
// 操作主表数据
|
|
boolean one = this.insert(patformAnagementEgulations);
|
|
boolean one = this.insert(patformAnagementEgulations);
|
|
if (one) {
|
|
if (one) {
|
|
@@ -56,13 +58,14 @@ public class PatformAnagementEgulationsServiceImpl extends ServiceImpl<PatformAn
|
|
*/
|
|
*/
|
|
@Override
|
|
@Override
|
|
public String edit(PatformAnagementEgulations patformAnagementEgulations) {
|
|
public String edit(PatformAnagementEgulations patformAnagementEgulations) {
|
|
- //查询发布任务
|
|
|
|
- PatformAnagementEgulations patformAnagementEgulations1 = this.selectById(patformAnagementEgulations.getId());
|
|
|
|
- //除审核中状态其余可编辑
|
|
|
|
- if(patformAnagementEgulations1 != null) {
|
|
|
|
- this.updateById(patformAnagementEgulations1);
|
|
|
|
|
|
+ patformAnagementEgulations.setStatusKey(StatusEnum.PLATFORM_REVIEWED.getFlag());
|
|
|
|
+ patformAnagementEgulations.setStatus(StatusEnum.PLATFORM_REVIEWED.getName());
|
|
|
|
+ boolean one = this.updateById(patformAnagementEgulations);
|
|
|
|
+ if(one){
|
|
|
|
+ return "OK";
|
|
|
|
+ }{
|
|
|
|
+ return "NG";
|
|
}
|
|
}
|
|
- return "OK";
|
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
|
|
@@ -71,12 +74,77 @@ public class PatformAnagementEgulationsServiceImpl extends ServiceImpl<PatformAn
|
|
* @return
|
|
* @return
|
|
*/
|
|
*/
|
|
@Override
|
|
@Override
|
|
- public PatformAnagementEgulations show() {
|
|
|
|
- //查询发布任务
|
|
|
|
- PatformAnagementEgulations patformAnagementEgulations = this.selectOne(new EntityWrapper<PatformAnagementEgulations>().eq("delete_flag","0"));
|
|
|
|
- //查询货主姓名
|
|
|
|
|
|
+ public PatformAnagementEgulations show(String id) {
|
|
|
|
+ PatformAnagementEgulations patformAnagementEgulations = this.selectById(id);
|
|
return patformAnagementEgulations;
|
|
return patformAnagementEgulations;
|
|
}
|
|
}
|
|
|
|
|
|
|
|
+ /**
|
|
|
|
+ * 删除
|
|
|
|
+ * @param id
|
|
|
|
+ */
|
|
|
|
+ @Override
|
|
|
|
+ public void delete(String id) {
|
|
|
|
+ PatformAnagementEgulations patformAnagementEgulations = this.selectById(id);
|
|
|
|
+ if (patformAnagementEgulations != null) {
|
|
|
|
+ this.deleteById(patformAnagementEgulations.getId());
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ /**
|
|
|
|
+ *平台规定管理列表
|
|
|
|
+ * @param
|
|
|
|
+ * @return
|
|
|
|
+ */
|
|
|
|
+ @Override
|
|
|
|
+ public Page<PatformAnagementEgulations> selectPage(PatformAnagementEgulations patformAnagementEgulations) {
|
|
|
|
+ Map<String, Object> pageView = new HashMap<>();
|
|
|
|
+ pageView.put("startRecord", (patformAnagementEgulations.getCurrentPage() - 1)
|
|
|
|
+ * patformAnagementEgulations.getPageSize());
|
|
|
|
+ //模糊查询
|
|
|
|
+ pageView.put("searchKeyWord", patformAnagementEgulations.getSearchKeyWord());
|
|
|
|
+ pageView.put("searchType", patformAnagementEgulations.getSearchType());
|
|
|
|
+ pageView.put("pageSize", patformAnagementEgulations.getPageSize());
|
|
|
|
+ pageView.put("currentPage", patformAnagementEgulations.getCurrentPage());
|
|
|
|
+ // 查询规定总数
|
|
|
|
+ Integer dataCount = baseMapper.getCountByConditions(pageView);
|
|
|
|
+ List<PatformAnagementEgulations> dataList = baseMapper.getListByConditions(pageView);
|
|
|
|
+ Page<PatformAnagementEgulations> page = new Page<>();
|
|
|
|
+ page.setRecords(dataList == null ? Lists.newArrayList() : dataList);
|
|
|
|
+ page.setTotal(dataCount == null ? 0 : dataCount);
|
|
|
|
+ page.setCurrent(patformAnagementEgulations.getCurrentPage());
|
|
|
|
+ page.setSize(patformAnagementEgulations.getPageSize());
|
|
|
|
+ return page;
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ /**
|
|
|
|
+ * 审核
|
|
|
|
+ *
|
|
|
|
+ * @param patformAnagementEgulations
|
|
|
|
+ * @return
|
|
|
|
+ */
|
|
|
|
+ @Override
|
|
|
|
+ @Transactional(rollbackFor = Exception.class)
|
|
|
|
+ public String examine(PatformAnagementEgulations patformAnagementEgulations) {
|
|
|
|
+ //查询
|
|
|
|
+ PatformAnagementEgulations patformAnagementEgulations1 = this.selectById(patformAnagementEgulations.getId());
|
|
|
|
+
|
|
|
|
+ if (patformAnagementEgulations1 != null) {
|
|
|
|
+ //通过
|
|
|
|
+ if ("1".equals(patformAnagementEgulations.getFlag())) {
|
|
|
|
+ patformAnagementEgulations1.setStatusKey(StatusEnum.PLATFORM_COMPLETED.getFlag());
|
|
|
|
+ patformAnagementEgulations1.setStatus(StatusEnum.PLATFORM_COMPLETED.getName());
|
|
|
|
+ }
|
|
|
|
+ //驳回
|
|
|
|
+ else if("2".equals(patformAnagementEgulations.getFlag())){
|
|
|
|
+ patformAnagementEgulations1.setStatusKey(StatusEnum.PLATFORM_FAILED.getFlag());
|
|
|
|
+ patformAnagementEgulations1.setStatus(StatusEnum.PLATFORM_FAILED.getName());
|
|
|
|
+ }
|
|
|
|
+ //更改信息
|
|
|
|
+ this.updateById(patformAnagementEgulations1);
|
|
|
|
+ return "OK";
|
|
|
|
+ }
|
|
|
|
+ return "NG";
|
|
|
|
+ }
|
|
|
|
|
|
}
|
|
}
|