待办列表优化
This commit is contained in:
parent
8d0ae241d3
commit
55713b1f95
|
|
@ -10,12 +10,14 @@ import com.bonus.common.log.enums.OperaType;
|
|||
import com.bonus.common.security.annotation.InnerAuth;
|
||||
import com.bonus.common.security.annotation.RequiresPermissionsOrInnerAuth;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.apache.commons.beanutils.BeanUtils;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.Objects;
|
||||
|
||||
import static com.bonus.bmw.utils.OwnPermissionUtil.dealWithPermission;
|
||||
|
||||
|
|
@ -45,10 +47,21 @@ public class PmToDoController extends BaseController {
|
|||
Map<String,String> map = dealWithPermission();
|
||||
if(!map.isEmpty()){
|
||||
// 3. 将 map 中的值复制到 o 对象中
|
||||
org.apache.commons.beanutils.BeanUtils.populate(o, map);
|
||||
BeanUtils.populate(o, map);
|
||||
}
|
||||
startPage();
|
||||
List<PmToDoVo> list = service.selectTodoList(o);
|
||||
if(Objects.equals(o.getType(), "2")){
|
||||
//查询合同修改的,看到就是已读,将其改成已读
|
||||
StringBuilder ids = new StringBuilder();
|
||||
for (int i = 0; i < list.size(); i++) {
|
||||
if("0".equals(list.get(i).getStatus())){
|
||||
ids.append(list.get(i).getId()).append(",");
|
||||
}
|
||||
}
|
||||
o.setIds(ids.toString());
|
||||
service.updateTodoStatus(o);
|
||||
}
|
||||
return getDataTable(list);
|
||||
} catch (Exception e) {
|
||||
log.error(e.toString(), e);
|
||||
|
|
@ -65,10 +78,10 @@ public class PmToDoController extends BaseController {
|
|||
//TODO 如果是总公司人员,不给提示直接返回0
|
||||
if(!map.isEmpty()){
|
||||
// 3. 将 map 中的值复制到 o 对象中
|
||||
org.apache.commons.beanutils.BeanUtils.populate(o, map);
|
||||
BeanUtils.populate(o, map);
|
||||
}
|
||||
int m = service.getToDoNum(o);
|
||||
return toAjax(m);
|
||||
return AjaxResult.success(m);
|
||||
} catch (Exception e) {
|
||||
logger.error(e.toString(), e);
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in New Issue