Browse Source

发票超期收款通知调整

sangwenwei 8 months atrás
parent
commit
87f44b05ef

+ 10 - 0
jeeplus-api/jeeplus-system-api/src/main/java/com/jeeplus/flowable/factory/FlowableApiFallbackFactory.java

@@ -68,11 +68,21 @@ public class FlowableApiFallbackFactory implements FallbackFactory <IFlowableApi
             }
 
             @Override
+            public void updateTitleMyNotice2(Map<String, String> map) {
+
+            }
+
+            @Override
             public String getRepetitionCountBymyNoticeTitle(Map<String, String> map) {
                 return null;
             }
 
             @Override
+            public String getCountBymyNoticeTitle(Map<String, String> map) {
+                return null;
+            }
+
+            @Override
             public String add(Map<String, String> map) {
                 return null;
             }

+ 16 - 0
jeeplus-api/jeeplus-system-api/src/main/java/com/jeeplus/flowable/feign/IFlowableApi.java

@@ -51,6 +51,14 @@ public interface IFlowableApi {
     void updateMyNotice(@RequestBody Map<String ,String > map);
 
     /**
+     * 修改通知数据
+     * @param map
+     * @return
+     */
+    @RequestMapping(value = "/flowable/task/updateTitleMyNotice2", method = RequestMethod.POST)
+    void updateTitleMyNotice2(@RequestBody Map<String ,String > map);
+
+    /**
      * 根据通知信息查询数据
      * @param map
      * @return
@@ -59,6 +67,14 @@ public interface IFlowableApi {
     String getRepetitionCountBymyNoticeTitle(@RequestBody Map<String ,String > map);
 
     /**
+     * 根据通知信息查询数据
+     * @param map
+     * @return
+     */
+    @RequestMapping(value = "/flowable/task/getCountBymyNoticeTitle", method = RequestMethod.POST)
+    String getCountBymyNoticeTitle(@RequestBody Map<String ,String > map);
+
+    /**
      * 发送通知
      */
     @RequestMapping(value = "/flowable/task/add", method = RequestMethod.POST)

+ 25 - 0
jeeplus-modules/jeeplus-flowable/src/main/java/com/jeeplus/flowable/controller/FlowableTaskController.java

@@ -1140,6 +1140,15 @@ public class FlowableTaskController {
         noticeServicel.updateMyNotice(jsonObject);
     }
 
+    @ApiOperation(value = "会计/评估,修改通知数据数据")
+    @RequestMapping(value = "/updateTitleMyNotice2", method = RequestMethod.POST)
+    public void updateTitleMyNotice2(@RequestBody Map<String, String> map) throws Exception {
+        String myNoticeInfo = map.get("myNoticeInfo");
+        MyNoticeList jsonObject = JSON.parseObject(myNoticeInfo, new TypeReference<MyNoticeList>() {
+        });
+        noticeServicel.updateTitleMyNotice2(jsonObject);
+    }
+
     @ApiOperation(value = "根据通知信息查询数据")
     @RequestMapping(value = "/getRepetitionCountBymyNoticeTitle", method = RequestMethod.POST)
     public String getRepetitionCountBymyNoticeTitle(@RequestBody Map<String, String> map) throws Exception {
@@ -1150,4 +1159,20 @@ public class FlowableTaskController {
         return JSON.toJSONString(noticeList);
     }
 
+    /**
+     * 会计/评估超期收款时获取到的通知数量
+     * @param map
+     * @return
+     * @throws Exception
+     */
+    @ApiOperation(value = "根据通知信息查询数据")
+    @RequestMapping(value = "/getCountBymyNoticeTitle", method = RequestMethod.POST)
+    public String getCountBymyNoticeTitle(@RequestBody Map<String, String> map) throws Exception {
+        String myNoticeInfo = map.get("myNoticeInfo");
+        MyNoticeList jsonObject = JSON.parseObject(myNoticeInfo, new TypeReference<MyNoticeList>() {
+        });
+        MyNoticeList noticeList = noticeServicel.getCountBymyNoticeTitle(jsonObject);
+        return JSON.toJSONString(noticeList);
+    }
+
 }

+ 13 - 0
jeeplus-modules/jeeplus-flowable/src/main/java/com/jeeplus/flowable/mapper/MyNoticeListMapper.java

@@ -45,6 +45,12 @@ public interface MyNoticeListMapper extends BaseMapper<MyNoticeList> {
     void updateMyNotice(MyNoticeList myNoticeList);
 
     /**
+     * 修改通知信息
+     * @param myNoticeList
+     */
+    void updateTitleMyNotice2(MyNoticeList myNoticeList);
+
+    /**
      * 根据通知信息查询详情
      * @param myNoticeList
      * @return
@@ -52,6 +58,13 @@ public interface MyNoticeListMapper extends BaseMapper<MyNoticeList> {
     MyNoticeList getRepetitionCountBymyNoticeTitle(MyNoticeList myNoticeList);
 
     /**
+     * 根据通知信息查询详情
+     * @param myNoticeList
+     * @return
+     */
+    MyNoticeList getCountBymyNoticeTitle(MyNoticeList myNoticeList);
+
+    /**
      * 部分通知变更为已读
      * @param idList
      * @return

+ 38 - 0
jeeplus-modules/jeeplus-flowable/src/main/java/com/jeeplus/flowable/mapper/xml/MyNoticeListMapper.xml

@@ -140,6 +140,34 @@
 			and a.type = 0
 		</where>
 	</select>
+    <select id="getCountBymyNoticeTitle" resultType="com.jeeplus.flowable.model.MyNoticeList">
+		select
+		a.id,
+		a.create_by_id,
+		a.create_time,
+		a.update_by_id,
+		a.update_time,
+		a.del_flag,
+		a.task_id,
+		a.title,
+		a.def_id,
+		a.task_name,
+		a.link,
+		a.create_user,
+		a.create_time,
+		a.type,
+		a.repetition_count,
+		a.notice_id
+		from
+		my_notice_list a
+		<where>
+			a.del_flag = 0
+			and a.notice_id = #{noticeId}
+			and a.title like concat('%',#{title},'%')
+			and a.type = 0
+			ORDER BY a.create_time desc LIMIT 1
+		</where>
+	</select>
     <select id="selectNoticePage2" resultType="com.jeeplus.flowable.model.MyNoticeList">
 		SELECT
 		 a.id, a.create_by_id, a.create_time,
@@ -212,6 +240,16 @@
 		where id = #{id}
 	</update>
 
+	<update id="updateTitleMyNotice2">
+		update my_notice_list
+		set `type` = 0,
+		repetition_count = #{repetitionCount},
+		title = #{title},
+		update_time = #{updateTime},
+		create_time = #{createTime}
+		where id = #{id}
+	</update>
+
 
 	<update id="portionRead">
 		UPDATE my_notice_list

+ 18 - 0
jeeplus-modules/jeeplus-flowable/src/main/java/com/jeeplus/flowable/service/MyNoticeService.java

@@ -250,12 +250,30 @@ public class MyNoticeService {
      * @param myNoticeList
      * @return
      */
+    public void updateTitleMyNotice2(MyNoticeList myNoticeList){
+        mapper.updateTitleMyNotice2(myNoticeList);
+    }
+
+    /**
+     * 根据通知信息查询数据
+     * @param myNoticeList
+     * @return
+     */
     public MyNoticeList getRepetitionCountBymyNoticeTitle(MyNoticeList myNoticeList){
         return mapper.getRepetitionCountBymyNoticeTitle(myNoticeList);
     }
 
     /**
      * 根据通知信息查询数据
+     * @param myNoticeList
+     * @return
+     */
+    public MyNoticeList getCountBymyNoticeTitle(MyNoticeList myNoticeList){
+        return mapper.getCountBymyNoticeTitle(myNoticeList);
+    }
+
+    /**
+     * 根据通知信息查询数据
      * @param idList
      * @return
      */

+ 21 - 7
jeeplus-modules/jeeplus-xxl-job-executor-sample/src/main/java/com/xxl/job/executor/service/jobhandler/SampleXxlJob.java

@@ -758,14 +758,17 @@ public class SampleXxlJob {
             //对数据进行发送通知
             String taskName = null;
             String titleStr = null;
+            String title = null; //查询是否已经通知时使用的title
 
             int interval = Integer.parseInt(this.getInterval(invoice.getBillingDate(), new Date()));
 
             taskName = "超期收款发票";
             if (StringUtils.isNotBlank(invoice.getProgramName())){
                 titleStr = "发票编号为"+ invoice.getNo()+"的项目["+invoice.getProgramName()+"],开票金额为:"+invoice.getAccount() +"元,已超期"+interval+"天,请尽快收款";
+                title = "发票编号为"+ invoice.getNo()+"的项目["+invoice.getProgramName()+"],开票金额为:"+invoice.getAccount() +"元";
             }else {
-                titleStr = "发票编号为"+ invoice.getNo()+",已超期"+interval+"天,请尽快收款";
+                titleStr = "发票编号为"+ invoice.getNo()+",开票金额为:"+invoice.getAccount() +"元,已超期"+interval+"天,请尽快收款";
+                title = "发票编号为"+ invoice.getNo()+",开票金额为:"+invoice.getAccount() +"元";
             }
             Set<String> noticeUserSet = new HashSet<String>();
 
@@ -798,11 +801,12 @@ public class SampleXxlJob {
                 for (String noticeUserId : noticeUserList) {
                     myNotice.setNoticeId(noticeUserId);
                     myNotice.setNoticeName(createUser.getName());
+                    myNotice.setTitle(title);
                     //根据taskName和通知人 查询重复数量
                     String myNoticeInfo = JSON.toJSONString(myNotice);
                     Map<String,String> map = new HashMap();
                     map.put("myNoticeInfo", myNoticeInfo);
-                    String jsonInfo = SpringUtil.getBean(IFlowableApi.class).getRepetitionCountBymyNoticeTitle(map);
+                    String jsonInfo = SpringUtil.getBean(IFlowableApi.class).getCountBymyNoticeTitle(map);
                     MyNoticeList repetitionCountBymyNotice = JSON.parseObject(jsonInfo, new TypeReference<MyNoticeList>() {});
 
                     if(null == repetitionCountBymyNotice){
@@ -810,6 +814,7 @@ public class SampleXxlJob {
                         String id = UUID.randomUUID().toString().replace("-", "");
                         myNotice.setId(id);
                         myNotice.setRepetitionCount(0);
+                        myNotice.setTitle(titleStr);
 
                         myNoticeInfo = JSON.toJSONString(myNotice);
                         map.put("myNoticeInfo", myNoticeInfo);
@@ -817,10 +822,10 @@ public class SampleXxlJob {
                     }else{
                         myNotice.setId(repetitionCountBymyNotice.getId());
                         myNotice.setRepetitionCount(repetitionCountBymyNotice.getRepetitionCount()+1);
-
+                        myNotice.setTitle(titleStr);
                         myNoticeInfo = JSON.toJSONString(myNotice);
                         map.put("myNoticeInfo", myNoticeInfo);
-                        SpringUtil.getBean ( IFlowableApi.class ).updateMyNotice(map);
+                        SpringUtil.getBean ( IFlowableApi.class ).updateTitleMyNotice2(map);
                     }
                 }
             }
@@ -838,14 +843,19 @@ public class SampleXxlJob {
             //对数据进行发送通知
             String taskName = null;
             String titleStr = null;
+            String title = null; //查询是否已经通知时使用的title
 
             int interval = Integer.parseInt(this.getInterval(invoice.getBillingDate(), new Date()));
 
             taskName = "评估发票超期收款";
             if (StringUtils.isNotBlank(invoice.getProgramName())){
                 titleStr = "发票编号为"+ invoice.getNo()+"的项目["+invoice.getProgramName()+"],开票金额为:"+invoice.getAccount() +"元,已超期"+interval+"天,请尽快收款";
+                title = "发票编号为"+ invoice.getNo()+"的项目["+invoice.getProgramName()+"],开票金额为:"+invoice.getAccount() +"元";
+
             }else {
-                titleStr = "发票编号为"+ invoice.getNo()+",已超期"+interval+"天,请尽快收款";
+                titleStr = "发票编号为"+ invoice.getNo()+",开票金额为:"+invoice.getAccount() +"元,已超期"+interval+"天,请尽快收款";
+                title = "发票编号为"+ invoice.getNo()+",开票金额为:"+invoice.getAccount() +"元";
+
             }
 
             Set<String> noticeUserSet = new HashSet<String>();
@@ -879,11 +889,13 @@ public class SampleXxlJob {
                 for (String noticeUserId : noticeUserList) {
                     myNotice.setNoticeId(noticeUserId);
                     myNotice.setNoticeName(createUser.getName());
+                    myNotice.setTitle(title);
+
                     //根据taskName和通知人 查询重复数量
                     String myNoticeInfo = JSON.toJSONString(myNotice);
                     Map<String,String> map = new HashMap();
                     map.put("myNoticeInfo", myNoticeInfo);
-                    String jsonInfo = SpringUtil.getBean(IFlowableApi.class).getRepetitionCountBymyNoticeTitle(map);
+                    String jsonInfo = SpringUtil.getBean(IFlowableApi.class).getCountBymyNoticeTitle(map);
                     MyNoticeList repetitionCountBymyNotice = JSON.parseObject(jsonInfo, new TypeReference<MyNoticeList>() {});
 
                     if(null == repetitionCountBymyNotice){
@@ -891,6 +903,7 @@ public class SampleXxlJob {
                         String id = UUID.randomUUID().toString().replace("-", "");
                         myNotice.setId(id);
                         myNotice.setRepetitionCount(0);
+                        myNotice.setTitle(titleStr);
 
                         myNoticeInfo = JSON.toJSONString(myNotice);
                         map.put("myNoticeInfo", myNoticeInfo);
@@ -898,10 +911,11 @@ public class SampleXxlJob {
                     }else{
                         myNotice.setId(repetitionCountBymyNotice.getId());
                         myNotice.setRepetitionCount(repetitionCountBymyNotice.getRepetitionCount()+1);
+                        myNotice.setTitle(titleStr);
 
                         myNoticeInfo = JSON.toJSONString(myNotice);
                         map.put("myNoticeInfo", myNoticeInfo);
-                        SpringUtil.getBean ( IFlowableApi.class ).updateMyNotice(map);
+                        SpringUtil.getBean ( IFlowableApi.class ).updateTitleMyNotice2(map);
                     }
                 }
             }