Prechádzať zdrojové kódy

定时任务处理维护资产(0)

5 rokov pred
rodič
commit
3f15e63e67

+ 14 - 0
pcbms/src/main/java/com/hssx/pcbms/controller/IdeaController.java

@@ -43,6 +43,20 @@ public class IdeaController {
         return msg;
     }
 
+    /**
+     * 获取草稿
+     * 参数:
+     * uid :当前发表人的id
+     * @return
+     */
+    @ApiOperation(value = "获取草稿", notes = "获取草稿方法")
+    @RequestMapping("/getDraft")
+    @ResponseBody
+    public HttpRespMsg getDraft(Idea idea) {
+        HttpRespMsg msg = ideaService.getDraft(idea);
+        return msg;
+    }
+
     /**
      * 删除建议
      * 参数:

+ 1 - 0
pcbms/src/main/java/com/hssx/pcbms/controller/ScoreController.java

@@ -27,6 +27,7 @@ import java.text.ParseException;
  */
 @Controller
 @RequestMapping("/score")
+
 public class ScoreController {
     @Autowired
     private ScoreService scoreService;

+ 1 - 2
pcbms/src/main/java/com/hssx/pcbms/controller/UserController.java

@@ -71,8 +71,7 @@ public class UserController {
     }
 
     /**
-     * 用户列表
-     * 参数:deptId 部门id ,
+     * 通讯录列表
      * @return
      */
     @ApiOperation(value = "用户列表", notes = "用户列表方法")

+ 2 - 0
pcbms/src/main/java/com/hssx/pcbms/service/IdeaService.java

@@ -25,4 +25,6 @@ public interface IdeaService extends IService<Idea> {
     HttpRespMsg ideaListByTime(Idea idea,String time);
 
     HttpRespMsg getAdviceScore(IdeaVO ideaVO);
+
+    HttpRespMsg getDraft(Idea idea);
 }

+ 13 - 3
pcbms/src/main/java/com/hssx/pcbms/service/impl/GoodsServiceImpl.java

@@ -442,6 +442,7 @@ public class GoodsServiceImpl extends ServiceImpl<GoodsMapper, Goods> implements
 
     @Override
     public HttpRespMsg goodsMaintainChecking() {
+        HttpRespMsg msg = new HttpRespMsg();
         log.info("处理维护资产的定时任务启动了");
 //        List<Goods> goodsLists = goodsMapper.selectList(new QueryWrapper<>());
         List<GoodsVO> goodsLists = goodsMapper.getListBycondition(null, null, null);
@@ -453,17 +454,26 @@ public class GoodsServiceImpl extends ServiceImpl<GoodsMapper, Goods> implements
                 no.setIsMaintain(1);
                 //此处利用update配合修改条件和条件构造器来实现批量修改数据
                 goodsNoMapper.update(no, new QueryWrapper<GoodsNo>().eq("goods_id", good.getId()));
-                List<User> users = userMapper.selectOperateUsersListByCondition();
                 //条件通知消息
                 NewsNotice newsNotice = new NewsNotice();
+                newsNotice.setNoticeType(0);
+                newsNotice.setRefId(good.getId());
+                newsNotice.setRafName(good.getName());
                 String content = Constant.GOODS_MATAIN_CONTENT;
                 content = content.replace("name",good.getName()).replace("num",good.getGoodsNos().size()+good.getUnit());
                 newsNotice.setContent(content);
                 newsNoticeMapper.insert(newsNotice);
+                List<User> users = userMapper.selectOperateUsersListByCondition();
+                //通知所有操作员
+                for (User user : users) {
+                    NewsNoticeUser noticeUser = new NewsNoticeUser();
+                    noticeUser.setNewsId(newsNotice.getId());
+                    noticeUser.setUserId(user.getId());
+                    newsNoticeUserMapper.insert(noticeUser);
+                }
             }
-            
         }
-        return null;
+        return msg;
     }
 
     public static void main(String[] args) {

+ 11 - 0
pcbms/src/main/java/com/hssx/pcbms/service/impl/IdeaServiceImpl.java

@@ -89,4 +89,15 @@ public class IdeaServiceImpl extends ServiceImpl<IdeaMapper, Idea> implements Id
         return msg;
     }
 
+    @Override
+    public HttpRespMsg getDraft(Idea idea) {
+        HttpRespMsg msg = new HttpRespMsg();
+        Idea draftidea = ideaMapper.selectOne(new QueryWrapper<Idea>().eq("uid", idea.getUid()).eq("is_draft", 1).last("limit 1"));
+        if(draftidea != null){
+            msg.data = draftidea;
+        }else{
+            msg.data = idea;
+        }
+        return msg;
+    }
 }

+ 2 - 2
pcbms/src/main/resources/mapper/IdeaMapper.xml

@@ -25,7 +25,7 @@
         <id column="id" property="id" />
         <result column="uid" property="uid" />
         <result column="indate" property="indate" />
-        <result column="content" property="content" />
+        <result column="idea_content" property="content" />
         <result column="score" property="score" />
         <result column="is_draft" property="isDraft" />
         <result column="is_evaluated" property="isEvaluated" />
@@ -41,7 +41,7 @@
     
     <select id="getIdeaListByUid" resultMap="BaseResultMapVO">
         select
-            i.id, i.uid, i.indate, i.content, i.score, i.is_draft, i.is_evaluated, i.score_id,
+            i.id, i.uid, i.indate, i.content idea_content, i.score, i.is_draft, i.is_evaluated, i.score_id,
             ic.id cid,ic.idea_id, ic.content, ic.responder_id, ic.responder, ic.indate
         from
             idea i