更新微信请求参数处理方式

This commit is contained in:
lujiang 2024-08-13 11:24:30 +08:00
parent 7f2d20fb42
commit 0887d25673
3 changed files with 47 additions and 15 deletions

View File

@ -7,13 +7,14 @@ import com.ics.admin.service.IIcsCustomerStaffService;
import com.ics.admin.service.IRepairAttachService; import com.ics.admin.service.IRepairAttachService;
import com.ics.admin.service.IRepairLogService; import com.ics.admin.service.IRepairLogService;
import com.ics.admin.service.IRepairService; import com.ics.admin.service.IRepairService;
import com.ics.admin.utils.FlowOperate; import com.ics.admin.utils.RepairDTO;
import com.ics.admin.vo.RepairAttachVO; import com.ics.admin.vo.RepairAttachVO;
import com.ics.common.core.controller.BaseController; import com.ics.common.core.controller.BaseController;
import com.ics.common.core.domain.IcsCustomerStaff; import com.ics.common.core.domain.IcsCustomerStaff;
import com.ics.common.core.domain.R; import com.ics.common.core.domain.R;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping; import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
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;
import org.wf.jwtp.annotation.Logical; import org.wf.jwtp.annotation.Logical;
@ -46,22 +47,25 @@ public class RepairController extends BaseController {
@Autowired @Autowired
private IIcsCustomerStaffService customerStaffService; private IIcsCustomerStaffService customerStaffService;
//@Ignore /**
* 报修
*/
@RequiresPermissions(value = {"repair:attach:operator", "member:center:view"}, logical = Logical.OR) @RequiresPermissions(value = {"repair:attach:operator", "member:center:view"}, logical = Logical.OR)
@PostMapping("flow/start") @PostMapping("flow/start")
public R startFlow(Repair repair, String[] files) { public R startFlow(@RequestBody RepairDTO repairDTO) {
Long userId = getLoginStaffId(); Long userId = getLoginStaffId();
String result = repairService.handleFlow(repair, userId, files, null, null); String result = repairService.handleFlow(repairDTO.getRepair(), userId, repairDTO.getFiles(), null, null);
return IRepairService.OK.equals(result) ? R.ok() : R.error(result); return IRepairService.OK.equals(result) ? R.ok() : R.error(result);
} }
/**
//@Ignore * 流程处理
*/
@RequiresPermissions(value = {"repair:attach:operator", "member:center:view"}, logical = Logical.OR) @RequiresPermissions(value = {"repair:attach:operator", "member:center:view"}, logical = Logical.OR)
@PostMapping("flow/handle") @PostMapping("flow/handle")
public R handleFlow(Repair repair, String content, FlowOperate operate) { public R handleFlow(@RequestBody RepairDTO repairDTO) {
Long userId = getLoginStaffId(); Long userId = getLoginStaffId();
String result = repairService.handleFlow(repair, userId, null, content, operate); String result = repairService.handleFlow(repairDTO.getRepair(), userId, null, repairDTO.getContent(), repairDTO.getOperate());
return IRepairService.OK.equals(result) ? R.ok() : R.error(result); return IRepairService.OK.equals(result) ? R.ok() : R.error(result);
} }
@ -70,9 +74,9 @@ public class RepairController extends BaseController {
*/ */
@RequiresPermissions(value = {"repair:attach:operator", "member:center:view"}, logical = Logical.OR) @RequiresPermissions(value = {"repair:attach:operator", "member:center:view"}, logical = Logical.OR)
@PostMapping("eval") @PostMapping("eval")
public R eval(Repair repair) { public R eval(@RequestBody RepairDTO repairDTO) {
Long userId = getLoginStaffId(); Long userId = getLoginStaffId();
return toAjax(repairService.eval(repair, userId)); return toAjax(repairService.eval(repairDTO.getRepair(), userId));
} }
/** /**
@ -89,7 +93,7 @@ public class RepairController extends BaseController {
*/ */
@RequiresPermissions(value = {"repair:attach:operator", "member:center:view"}, logical = Logical.OR) @RequiresPermissions(value = {"repair:attach:operator", "member:center:view"}, logical = Logical.OR)
@RequestMapping("list") @RequestMapping("list")
public R list(String type) { public R list(@RequestBody String type) {
startPage(); startPage();
Long userId = getLoginStaffId(); Long userId = getLoginStaffId();
IcsCustomerStaff loginUser = customerStaffService.selectIcsCustomerStaffById(userId); IcsCustomerStaff loginUser = customerStaffService.selectIcsCustomerStaffById(userId);
@ -106,7 +110,7 @@ public class RepairController extends BaseController {
*/ */
@RequiresPermissions(value = {"repair:attach:operator", "member:center:view"}, logical = Logical.OR) @RequiresPermissions(value = {"repair:attach:operator", "member:center:view"}, logical = Logical.OR)
@RequestMapping("get") @RequestMapping("get")
public R get(Long id) { public R get(@RequestBody Long id) {
Repair repair = repairService.selectRepairById(id); Repair repair = repairService.selectRepairById(id);
List<RepairAttach> list = repairAttachService.getListByRepair(id); List<RepairAttach> list = repairAttachService.getListByRepair(id);
@ -140,7 +144,7 @@ public class RepairController extends BaseController {
* 删除工单 * 删除工单
*/ */
@RequiresPermissions("repair:attach:operator") @RequiresPermissions("repair:attach:operator")
@PostMapping("delete") @RequestMapping("delete")
public R remove(Long id) { public R remove(Long id) {
return toAjax(repairService.deleteRepairById(id)); return toAjax(repairService.deleteRepairById(id));
} }

View File

@ -0,0 +1,28 @@
package com.ics.admin.utils;
import com.ics.admin.domain.Repair;
import lombok.Data;
import java.io.Serializable;
/**
* weixin 传输参数体
* created at 2024-8-13 11:11
*
* @author lujiang
* @version 1.0.0
* @since 1.0.0
*/
@Data
public class RepairDTO implements Serializable {
private static final long serialVersionUID = -202408131112L;
private Repair repair;
private String[] files; //附件id
private String content; //反馈文字内容
FlowOperate operate; //json 参数值NEXTBACKEND
}

View File

@ -79,7 +79,7 @@
<if test="floorId != null ">floor_id,</if> <if test="floorId != null ">floor_id,</if>
<if test="floor != null and floor != ''">floor,</if> <if test="floor != null and floor != ''">floor,</if>
<if test="room != null and room != ''">room,</if> <if test="room != null and room != ''">room,</if>
<if test="explain != null and explain != ''">explain,</if> <if test="explain != null and explain != ''">`explain`,</if>
<if test="perUserId != null ">per_userid,</if> <if test="perUserId != null ">per_userid,</if>
<if test="preDate != null ">preDate,</if> <if test="preDate != null ">preDate,</if>
<if test="cause != null and cause != ''">cause,</if> <if test="cause != null and cause != ''">cause,</if>
@ -171,7 +171,7 @@
<if test="floorId != null ">floor_id = #{floorId},</if> <if test="floorId != null ">floor_id = #{floorId},</if>
<if test="floor != null and floor != ''">floor = #{floor},</if> <if test="floor != null and floor != ''">floor = #{floor},</if>
<if test="room != null and room != ''">room = #{room},</if> <if test="room != null and room != ''">room = #{room},</if>
<if test="explain != null and explain != ''">explain = #{explain},</if> <if test="explain != null and explain != ''">`explain` = #{explain},</if>
<if test="perUserId != null ">per_userid = #{perUserId},</if> <if test="perUserId != null ">per_userid = #{perUserId},</if>
<if test="preDate != null ">predate = #{preDate},</if> <if test="preDate != null ">predate = #{preDate},</if>
<if test="cause != null and cause != ''">cause = #{cause},</if> <if test="cause != null and cause != ''">cause = #{cause},</if>