|
@@ -5,17 +5,20 @@ import com.baomidou.mybatisplus.core.metadata.IPage;
|
|
|
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
|
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
|
|
import com.qdport.core.boot.ctrl.QdportController;
|
|
import com.qdport.core.boot.ctrl.QdportController;
|
|
|
import com.qdport.core.tool.api.R;
|
|
import com.qdport.core.tool.api.R;
|
|
|
|
|
+import com.qdport.entity.PolicyCondition;
|
|
|
import com.qdport.entity.PolicyShare;
|
|
import com.qdport.entity.PolicyShare;
|
|
|
import com.qdport.modules.system.entity.SysDept;
|
|
import com.qdport.modules.system.entity.SysDept;
|
|
|
import com.qdport.modules.system.service.SysDeptService;
|
|
import com.qdport.modules.system.service.SysDeptService;
|
|
|
import com.qdport.query.PolicyProgressQuery;
|
|
import com.qdport.query.PolicyProgressQuery;
|
|
|
import com.qdport.query.QueryWrapperBuilder;
|
|
import com.qdport.query.QueryWrapperBuilder;
|
|
|
|
|
+import com.qdport.service.PolicyConditionService;
|
|
|
import com.qdport.service.PolicyShareService;
|
|
import com.qdport.service.PolicyShareService;
|
|
|
import com.qdport.service.PolicyStriveService;
|
|
import com.qdport.service.PolicyStriveService;
|
|
|
import com.qdport.util.StringUtil;
|
|
import com.qdport.util.StringUtil;
|
|
|
import com.qdport.vo.PolicyProgressVo;
|
|
import com.qdport.vo.PolicyProgressVo;
|
|
|
import io.swagger.annotations.Api;
|
|
import io.swagger.annotations.Api;
|
|
|
import io.swagger.annotations.ApiOperation;
|
|
import io.swagger.annotations.ApiOperation;
|
|
|
|
|
+import org.springframework.beans.BeanUtils;
|
|
|
import org.springframework.web.bind.annotation.GetMapping;
|
|
import org.springframework.web.bind.annotation.GetMapping;
|
|
|
import org.springframework.web.bind.annotation.RequestMapping;
|
|
import org.springframework.web.bind.annotation.RequestMapping;
|
|
|
import org.springframework.web.bind.annotation.RestController;
|
|
import org.springframework.web.bind.annotation.RestController;
|
|
@@ -34,27 +37,43 @@ public class PolicyProgressController extends QdportController {
|
|
|
@Resource
|
|
@Resource
|
|
|
private PolicyStriveService policyStriveService;
|
|
private PolicyStriveService policyStriveService;
|
|
|
@Resource
|
|
@Resource
|
|
|
|
|
+ private PolicyConditionService policyConditionService;
|
|
|
|
|
+ @Resource
|
|
|
private SysDeptService sysDeptService;
|
|
private SysDeptService sysDeptService;
|
|
|
|
|
|
|
|
@GetMapping("sharePage")
|
|
@GetMapping("sharePage")
|
|
|
@ApiOperation(value = "分页", notes = "分页")
|
|
@ApiOperation(value = "分页", notes = "分页")
|
|
|
public R<IPage> page(@Valid PolicyProgressQuery query) {
|
|
public R<IPage> page(@Valid PolicyProgressQuery query) {
|
|
|
- IPage<SysDept> page = new Page<>(query.getPage(), query.getSize());
|
|
|
|
|
|
|
+ IPage<SysDept> deptPage = new Page<>(query.getPage(), query.getSize());
|
|
|
QueryWrapper<SysDept> wrapper = QueryWrapperBuilder.buildQueryWrapper(query, SysDept.class);
|
|
QueryWrapper<SysDept> wrapper = QueryWrapperBuilder.buildQueryWrapper(query, SysDept.class);
|
|
|
if (StringUtil.isEmpty(query.getBeginCreateTime()) || StringUtil.isEmpty(query.getEndCreateTime())) {
|
|
if (StringUtil.isEmpty(query.getBeginCreateTime()) || StringUtil.isEmpty(query.getEndCreateTime())) {
|
|
|
throw new RuntimeException("参数错误");
|
|
throw new RuntimeException("参数错误");
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
- page = sysDeptService.page(page, wrapper);
|
|
|
|
|
- List<SysDept> records = page.getRecords();
|
|
|
|
|
|
|
+ deptPage = sysDeptService.page(deptPage, wrapper);
|
|
|
|
|
+ List<SysDept> records = deptPage.getRecords();
|
|
|
|
|
|
|
|
|
|
+ IPage<PolicyProgressVo> page = new Page<>(query.getPage(), query.getSize());
|
|
|
|
|
+ page.setTotal(deptPage.getTotal());
|
|
|
List<PolicyProgressVo> progressVoList = new ArrayList<>();
|
|
List<PolicyProgressVo> progressVoList = new ArrayList<>();
|
|
|
for (SysDept model : records) {
|
|
for (SysDept model : records) {
|
|
|
|
|
+ PolicyProgressVo vo = new PolicyProgressVo();
|
|
|
|
|
+ BeanUtils.copyProperties(model, vo);
|
|
|
|
|
+
|
|
|
QueryWrapper<PolicyShare> policyShareWrapper = new QueryWrapper<>();
|
|
QueryWrapper<PolicyShare> policyShareWrapper = new QueryWrapper<>();
|
|
|
policyShareWrapper.eq("COMPANY_ID", model.getId());
|
|
policyShareWrapper.eq("COMPANY_ID", model.getId());
|
|
|
policyShareWrapper.lt("CREATE_TIME", query.getEndCreateTime());
|
|
policyShareWrapper.lt("CREATE_TIME", query.getEndCreateTime());
|
|
|
policyShareWrapper.gt("CREATE_TIME", query.getBeginCreateTime());
|
|
policyShareWrapper.gt("CREATE_TIME", query.getBeginCreateTime());
|
|
|
- policyShareService.getOne(policyShareWrapper);
|
|
|
|
|
|
|
+ long count = policyShareService.count(policyShareWrapper);
|
|
|
|
|
+ vo.setCount(count);
|
|
|
|
|
+
|
|
|
|
|
+// if (count == 1) {
|
|
|
|
|
+// PolicyShare shareOne = policyShareService.getOne(policyShareWrapper);
|
|
|
|
|
+//
|
|
|
|
|
+// }
|
|
|
|
|
+
|
|
|
|
|
+
|
|
|
|
|
+ progressVoList.add(vo);
|
|
|
}
|
|
}
|
|
|
return null;
|
|
return null;
|
|
|
}
|
|
}
|