lsw 10 months ago
parent
commit
bceac37863

+ 2 - 1
app/pages.json

@@ -296,7 +296,8 @@
 		{
 			"path": "pages/user/resume/application/invite",
 			"style": {
-				"navigationBarTitleText": "兼职邀约"
+				"navigationBarTitleText": "兼职邀约",
+				"enablePullDownRefresh": true
 			}
 		},
 		{

+ 13 - 6
app/pages/user/index.vue

@@ -78,7 +78,7 @@
 					<view class="out">
 						<view class="int">
 							<view class="icon" style="background-color: #ff9800">&#xe602;</view>
-							<view class="title">职位管理</view>
+							<view class="title">发布职位</view>
 						</view>
 					</view>
 				</view>
@@ -148,7 +148,7 @@
 				<view class="out">
 					<view class="int">
 						<view class="icon" style="background-color: #03a9f4">&#xe63c;</view>
-						<view class="title">兼职管理</view>
+						<view class="title">发布兼职</view>
 					</view>
 				</view>
 			</view>
@@ -178,12 +178,19 @@
 					</view>
 				</view>
 			</view>
-			<view class="cd" @click="go('/pages/user/resume/application/task_to_do')">
+			<view class="cd" @click="go('/pages/user/resume/application/task_to_do?role=0')">
 				<view class="out">
 					<view class="int">
 						<view class="icon" style="background-color: #03a9f4">&#xe63c;</view>
-						<view class="title">任务清单</view>
-						<!-- <view class="bage" v-if="user.applicationNoRead > 0">{{ user.applicationNoRead > 99 ? '99+' : user.applicationNoRead }}</view> -->
+						<view class="title">甲方任务</view>
+					</view>
+				</view>
+			</view>
+			<view class="cd" @click="go('/pages/user/resume/application/task_to_do?role=1')">
+				<view class="out">
+					<view class="int">
+						<view class="icon" style="background-color: #03a9f4">&#xe63c;</view>
+						<view class="title">乙方任务</view>
 					</view>
 				</view>
 			</view>
@@ -264,7 +271,7 @@ export default {
 		};
 	},
 	onShow() {
-		/* 		this.user = {
+/* 		 		this.user = {
 			token: 'eyJhbGciOiJIUzUxMiJ9.eyJsb2dpbl91c2VyX2tleSI6IjdhZGY4MzFmLWE0NjQtNGY5YS04YTY5LWMzM2QyNDU2MzI2ZSJ9.EPHElRmlVoFTfT4OxHNpvIC7bDKc1gKpNiO1u_dBOerYh5JFIuSrSkgp0PtQ0kOhO9iuvU0dttEGbsgofdrcpQ'
 		};
 		uni.setStorageSync('user', this.user); */

+ 1 - 1
app/pages/user/resume/application/task_detail.vue

@@ -21,7 +21,7 @@
 		<view class="mfooter">
 			<view class="cn">
 				<view class="f">
-					<button class="btn" @click="go('/pages/user/resume/application/task_list?taskId=' + obj.id)">
+					<button class="btn" @click="go('/pages/user/resume/application/task_list?taskId=' + obj.id + '&role=' + obj.role)">
 						<text class="icon">&#xe656;</text>
 						<text>任务日志</text>
 					</button>

+ 4 - 3
app/pages/user/resume/application/task_list.vue

@@ -7,14 +7,14 @@
 				</view>
 				<view class="con">
 					<view class="date">{{ item.createTime }}</view>
-					<view class="del" @click="remove(item)">删除</view>
+					<view class="del" @click="remove(item)" v-if="param.role == 1">删除</view>
 					<images v-model="item.pic" :read="true"></images>
 					<view class="contents">{{ item.contents }}</view>
 				</view>
 			</view>
 			<u-empty v-if="list.length == 0"></u-empty>
 		</view>
-		<view class="mfooter">
+		<view class="mfooter" v-if="param.role == 1">
 			<button class="btn" @click="show()">
 				<text class="icon">&#xe7c4;</text>
 				<text>添加</text>
@@ -34,6 +34,7 @@ export default {
 	},
 	onLoad(e) {
 		this.param.taskId = e.taskId;
+		this.param.role = e.role || 0;
 		this.getData();
 	},
 	methods: {
@@ -115,7 +116,7 @@ export default {
 				top: -31px;
 				right: 0px;
 				position: absolute;
-				color: #F44336;
+				color: #f44336;
 			}
 			.contents {
 				padding-top: 5px;

+ 9 - 1
app/pages/user/resume/application/task_to_do.vue

@@ -12,7 +12,13 @@
 				<view class="address">{{ item.startDate }}至{{ item.endDate }}</view>
 				<view class="distance">{{ item.createTime }}</view>
 			</view>
-			<view class="flex">
+			<view class="flex" v-if="param.role == 0">
+				<view class="f br agree" v-if="item.isComplete == 0">进行中...</view>
+				<view class="f br agree" v-if="item.isComplete == 1">对方发起任务完成申请</view>
+				<view class="f br agree" v-if="item.isComplete == 2">已完成(打款)</view>
+				<view class="f br danger" v-if="item.isComplete == 3">未通过</view>
+			</view>
+			<view class="flex" v-if="param.role == 1">
 				<view class="f br agree" v-if="item.isComplete == 0">进行中...</view>
 				<view class="f br agree" v-if="item.isComplete == 1">确认中...</view>
 				<view class="f br agree" v-if="item.isComplete == 2">已完成</view>
@@ -40,6 +46,7 @@ export default {
 		};
 	},
 	onLoad(e) {
+		this.param.role = e.role || 0;
 		this.getData();
 	},
 	methods: {
@@ -52,6 +59,7 @@ export default {
 					this.loadMore = res.data.pages > this.param.pageNum ? true : false;
 					res.data.rows.forEach((item) => {
 						item.createTime = uni.$u.timeFrom(Date.parse(item.createTime));
+						item.role = this.param.role;
 						this.list.push(item);
 					});
 				}

+ 11 - 2
ruoyi-admin/src/main/java/com/ruoyi/web/work/api/Api_ResumeDeliverController.java

@@ -32,7 +32,16 @@ public class Api_ResumeDeliverController extends BaseController {
 
     @GetMapping("/user/list")
     public TableDataInfo userList(ResumeDeliver resumeDeliver) {
-        resumeDeliver.setUserId(getUser().getId());
+        if (resumeDeliver.getRole() == null) {
+            resumeDeliver.setUserId(getUser().getId());
+        } else {
+            //0甲方,1乙方
+            if (resumeDeliver.getRole() == 0) {
+                resumeDeliver.setEnterpriseId(getUser().getId());
+            } else {
+                resumeDeliver.setUserId(getUser().getId());
+            }
+        }
         startPage();
         List<ResumeDeliver> list = resumeDeliverService.selectList(resumeDeliver);
         return getDataTable(list);
@@ -103,7 +112,7 @@ public class Api_ResumeDeliverController extends BaseController {
     }
 
     @PostMapping("/jTaskComplete")
-    public AjaxResult jTaskComplete(@Validated @RequestBody JTaskCompleteDto dto) {
+    public AjaxResult jTaskComplete(@Validated @RequestBody JTaskCompleteDto dto) throws ParseException {
         return resumeDeliverService.jTaskComplete(dto);
     }
 }

+ 10 - 1
ruoyi-admin/src/main/java/com/ruoyi/web/work/api/Api_TaskListController.java

@@ -23,7 +23,16 @@ public class Api_TaskListController extends BaseController {
 
     @GetMapping("/list")
     public AjaxResult list(TaskList taskList) {
-        taskList.setUserId(getUser().getId());
+        if (taskList.getRole() == null) {
+            taskList.setUserId(getUser().getId());
+        } else {
+            //0甲方,1乙方
+            if (taskList.getRole() == 0) {
+                taskList.setEnterpriseId(getUser().getId());
+            } else {
+                taskList.setUserId(getUser().getId());
+            }
+        }
         return AjaxResult.success(taskListService.selectList(taskList));
     }
 

+ 3 - 0
ruoyi-admin/src/main/java/com/ruoyi/web/work/domain/ResumeDeliver.java

@@ -121,4 +121,7 @@ public class ResumeDeliver {
     @TableField(exist = false)
     private Integer max;
 
+    @TableField(exist = false)
+    private Integer role;
+
 }

+ 7 - 3
ruoyi-admin/src/main/java/com/ruoyi/web/work/domain/TaskList.java

@@ -1,13 +1,14 @@
 package com.ruoyi.web.work.domain;
 
-import java.util.Date;
-import com.fasterxml.jackson.annotation.JsonFormat;
 import com.baomidou.mybatisplus.annotation.FieldFill;
 import com.baomidou.mybatisplus.annotation.TableField;
-import lombok.Data;
 import com.baomidou.mybatisplus.annotation.TableName;
+import com.fasterxml.jackson.annotation.JsonFormat;
 import io.swagger.annotations.ApiModelProperty;
+import lombok.Data;
 import lombok.experimental.Accessors;
+
+import java.util.Date;
 /**
  * @author lsw
  * @date 2024-07-03
@@ -42,5 +43,8 @@ public class TaskList{
     @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
     private Date createTime;
 
+    @TableField(exist = false)
+    private Integer role;
+
 
 }

+ 1 - 1
ruoyi-admin/src/main/java/com/ruoyi/web/work/service/IResumeDeliverService.java

@@ -116,5 +116,5 @@ public interface IResumeDeliverService extends IService<ResumeDeliver> {
      * @param dto
      * @return
      */
-    AjaxResult jTaskComplete(JTaskCompleteDto dto);
+    AjaxResult jTaskComplete(JTaskCompleteDto dto) throws ParseException;
 }

+ 13 - 3
ruoyi-admin/src/main/java/com/ruoyi/web/work/service/impl/ResumeDeliverServiceImpl.java

@@ -232,7 +232,7 @@ public class ResumeDeliverServiceImpl extends ServiceImpl<ResumeDeliverMapper, R
             body.set("template_id", "bxOGj5FbyGHSevmWf9yzwpSZDjlFZPnGBeqGgIj9w_o");
             body.set("page", "pages/user/resume/application/invite");
             content.set("thing4", new JSONObject().set("value", position.getTitle()));//兼职名称
-            content.set("thing6", "对方已同意接单,请留意工作进度");//备注
+            content.set("thing6", new JSONObject().set("value", "对方已同意接单,请留意工作进度"));//备注
         }
         //兼职报名审核结果通知
         if (resumeDeliver.getState() == 1 && resumeDeliver.getIsAccept() == 2 && resumeDeliver.getType() == 1) {
@@ -240,7 +240,16 @@ public class ResumeDeliverServiceImpl extends ServiceImpl<ResumeDeliverMapper, R
             body.set("template_id", "pyUsW2HqOcXmFETHFUDjuH-ekf05QVc29k0tRaY9wP8");
             body.set("page", "pages/user/resume/application/invite");
             content.set("thing3", new JSONObject().set("value", position.getTitle()));//兼职名称
-            content.set("thing5", "对方拒绝接单,请重新选择接单人员");//备注
+            content.set("thing5", new JSONObject().set("value", "对方拒绝接单,请重新选择接单人员"));//备注
+        }
+        //兼职薪资到账通知
+        if (resumeDeliver.getState() == 1 && resumeDeliver.getIsAccept() == 2 && resumeDeliver.getType() == 1 && resumeDeliver.getIsComplete() == 2) {
+            Position position = positionService.getById(resumeDeliver.getPositionId());
+            body.set("template_id", "87jYTnpeZJnvdQ6gHcscZ96eQYlSXpfGeFU3g9deTeA");
+            body.set("page", "pages/user/money/index");
+            content.set("thing1", new JSONObject().set("value", position.getTitle()));//兼职名称
+            content.set("amount4", new JSONObject().set("value", position.getSalary()));//佣金金额
+            content.set("thing5", new JSONObject().set("value", "平台充值到账号余额"));//到账渠道
         }
         body.set("data", content);
         String result = HttpUtil.post("https://api.weixin.qq.com/cgi-bin/message/subscribe/send?access_token=" + jsonObject.getStr("access_token"), body.toString());
@@ -267,7 +276,7 @@ public class ResumeDeliverServiceImpl extends ServiceImpl<ResumeDeliverMapper, R
 
     @Transactional
     @Override
-    public AjaxResult jTaskComplete(JTaskCompleteDto dto) {
+    public AjaxResult jTaskComplete(JTaskCompleteDto dto) throws ParseException {
         ResumeDeliver resumeDeliver = getById(dto.getId());
         if (resumeDeliver == null || !resumeDeliver.getEnterpriseId().equals(AppUtil.getUser().getId())) {
             return AjaxResult.error("兼职任务不存在或非法操作");
@@ -302,6 +311,7 @@ public class ResumeDeliverServiceImpl extends ServiceImpl<ResumeDeliverMapper, R
                 throw new ServiceException("保存余额入账记录失败,请联系平台");
             }
         }
+        sendMessage(resumeDeliver);
         return AjaxResult.success();
     }
 }