Commit f545d249 authored by 廖旭伟's avatar 廖旭伟

增加用户填单记录删除接口

parent 24a5fe27
Pipeline #2983 canceled with stages
...@@ -18,6 +18,7 @@ import com.mortals.xhx.feign.base.pdu.SitePdu; ...@@ -18,6 +18,7 @@ import com.mortals.xhx.feign.base.pdu.SitePdu;
import com.mortals.xhx.feign.rsp.ApiResp; import com.mortals.xhx.feign.rsp.ApiResp;
import com.mortals.xhx.module.h5.pdu.MobileCodePdu; import com.mortals.xhx.module.h5.pdu.MobileCodePdu;
import com.mortals.xhx.module.user.model.UserFillHistoryEntity; import com.mortals.xhx.module.user.model.UserFillHistoryEntity;
import com.mortals.xhx.module.user.model.UserFillHistoryQuery;
import com.mortals.xhx.module.user.service.UserFillHistoryService; import com.mortals.xhx.module.user.service.UserFillHistoryService;
import lombok.extern.slf4j.Slf4j; import lombok.extern.slf4j.Slf4j;
import org.apache.commons.collections4.CollectionUtils; import org.apache.commons.collections4.CollectionUtils;
...@@ -30,6 +31,7 @@ import org.springframework.web.bind.annotation.RequestMapping; ...@@ -30,6 +31,7 @@ import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController; import org.springframework.web.bind.annotation.RestController;
import java.util.*; import java.util.*;
import java.util.stream.Collectors;
/** /**
* 终端访问接口 * 终端访问接口
...@@ -116,6 +118,44 @@ public class TerminalController extends BaseJsonBodyController { ...@@ -116,6 +118,44 @@ public class TerminalController extends BaseJsonBodyController {
return ret; return ret;
} }
/**
* 获取我的填单列表
* @param query
* @return
*/
@PostMapping({"fill/history/delete"})
@UnAuth
public Rest<Object> deleteHistoryList(@RequestBody UserFillHistoryEntity query) {
Rest<Object> ret = new Rest();
Map<String, Object> model = new HashMap();
String busiDesc = "填单设备终端用户删除填单记录";
int code = 1;
try {
if(query.getId()==null){
throw new AppException("请选择一条记录");
}
UserFillHistoryEntity entity = userFillHistoryService.get(query.getId());
if(entity==null){
throw new AppException("记录不存在或者已经删除");
}
List<UserFillHistoryEntity> list = userFillHistoryService.find(new UserFillHistoryQuery().materialId(entity.getMaterialId()).openId(entity.getOpenId()));
List<Long> idList = list.stream().map(UserFillHistoryEntity::getId).collect(Collectors.toList());
userFillHistoryService.remove(idList,null);
model.put("message_info", busiDesc + "成功");
this.recordSysLog(this.request, busiDesc + " 【成功】");
} catch (Exception var9) {
code = -1;
model.put("message_info", "填单设备终端用户删除填单记录异常");
this.doException(this.request, busiDesc, model, var9);
}
ret.setCode(code);
ret.setData(model);
ret.setMsg(model.get("message_info") == null ? "" : model.remove("message_info").toString());
return ret;
}
/** /**
* 获取我的填单列表 * 获取我的填单列表
* @param query * @param query
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment