修改追溯查询返回方式

cert
anthonywj 2 years ago
parent b99d015e50
commit 578c1de03c

@ -32,17 +32,17 @@ public class userPersonController {
@Resource
private UserPersonService userPersonService;
@ApiOperation(value = "获取用户个人信息",response = UserPersonEntity.class)
@ApiOperation(value = "获取用户个人信息", response = UserPersonEntity.class)
@PostMapping("/sup/company/person/filterList")
public BaseResponse filterCompanyCert(@RequestBody UserPersonFilterRequest userPersonFilterRequest , BindingResult bindingResult){
public BaseResponse filterCompanyCert(@RequestBody UserPersonFilterRequest userPersonFilterRequest, BindingResult bindingResult) {
if (bindingResult.hasErrors()) {
return ResultVOUtils.error(ResultEnum.PARAM_VERIFY_FALL, bindingResult.getFieldError().getDefaultMessage());
}
QueryWrapper<UserPersonEntity> and;
if(StrUtil.isNotBlank(userPersonFilterRequest.getUserName())){
and= new QueryWrapper<UserPersonEntity>().like("userName", userPersonFilterRequest.getUserName()).and(i -> i.eq("companyId", userPersonFilterRequest.getCompanyId()));
}else{
and= new QueryWrapper<UserPersonEntity>().eq("companyId", userPersonFilterRequest.getCompanyId());
if (StrUtil.isNotBlank(userPersonFilterRequest.getUserName())) {
and = new QueryWrapper<UserPersonEntity>().like("userName", userPersonFilterRequest.getUserName()).and(i -> i.eq("companyId", userPersonFilterRequest.getCompanyId()));
} else {
and = new QueryWrapper<UserPersonEntity>().eq("companyId", userPersonFilterRequest.getCompanyId());
}
List<UserPersonEntity> list = userPersonService.list(and);
PageInfo<UserPersonEntity> pageInfo;
@ -53,41 +53,34 @@ public class userPersonController {
return ResultVOUtils.success(pageSimpleResponse);
}
@ApiOperation(value = "跟新企业负责人信息",response = BaseResponse.class)
@ApiOperation(value = "更新企业负责人信息", response = BaseResponse.class)
@PostMapping("/sup/company/person/updatePerSon")
public BaseResponse updatePerSon(@RequestBody UserPersonFilterRequest userPersonFilterRequest ,BindingResult bindingResult ){
public BaseResponse updatePerSon(@RequestBody UserPersonFilterRequest userPersonFilterRequest, BindingResult bindingResult) {
if (bindingResult.hasErrors()) {
return ResultVOUtils.error(ResultEnum.PARAM_VERIFY_FALL, bindingResult.getFieldError().getDefaultMessage());
}
UserPersonEntity userPerson = new UserPersonEntity();
BeanUtils.copyProperties(userPersonFilterRequest,userPerson);
BeanUtils.copyProperties(userPersonFilterRequest, userPerson);
userPerson.setPassword(userPersonFilterRequest.getCheckPassword());
userPersonService.update(userPerson);
return ResultVOUtils.success();
return ResultVOUtils.success();
}
@ApiOperation(value = "删除企业负责人信息",response = BaseResponse.class)
@ApiOperation(value = "删除企业负责人信息", response = BaseResponse.class)
@PostMapping("/sup/company/person/daletePerSon")
public BaseResponse daletePerSon(@RequestBody UserPersonFilterRequest userPersonFilterRequest ,BindingResult bindingResult ){
public BaseResponse daletePerSon(@RequestBody UserPersonFilterRequest userPersonFilterRequest, BindingResult bindingResult) {
if (bindingResult.hasErrors()) {
return ResultVOUtils.error(ResultEnum.PARAM_VERIFY_FALL, bindingResult.getFieldError().getDefaultMessage());
}
UserPersonEntity userPerson = new UserPersonEntity();
BeanUtils.copyProperties(userPersonFilterRequest,userPerson);
BeanUtils.copyProperties(userPersonFilterRequest, userPerson);
userPersonService.delete(userPerson);
return ResultVOUtils.success();
return ResultVOUtils.success();
}
}

@ -54,11 +54,9 @@ public class TraceManuOrderController {
@Resource
TraceManuCodeRelService traceManuCodeRelService;
@Resource
TraceTaskService traceTaskService;
@Resource
private final RabbitTemplate rabbitTemplate;
@ApiOperation(value = "生产信息推送接口",response = BaseResponse.class)
@ApiOperation(value = "生产信息推送接口", response = BaseResponse.class)
@GetMapping("udi/trace/manu/order/sendUdi")
public BaseResponse sendUdi(@RequestBody TraceManuOrderUploadRequest traceManuOrderUploadRequest) {
String messageJson = JSON.toJSONString(traceManuOrderUploadRequest);
@ -68,8 +66,7 @@ public class TraceManuOrderController {
}
@ApiOperation(value = "查询追溯单据列表",response = TraceManuOrderResponse.class)
@ApiOperation(value = "查询追溯生产订单列表", response = TraceManuOrderResponse.class)
@AuthRuleAnnotation("udi/trace/manu/order/filter")
@GetMapping("udi/trace/manu/order/filter")
public BaseResponse filterLogs(TraceManuOrderRequest traceManuOrderRequest) {
@ -82,7 +79,7 @@ public class TraceManuOrderController {
return ResultVOUtils.success(pageSimpleResponse);
}
@ApiOperation(value = "查询追溯单据详情列表",response = TraceManuCodeRellResponse.class)
@ApiOperation(value = "查询追溯生产订单关联关系", response = TraceManuCodeRellResponse.class)
@AuthRuleAnnotation("udi/trace/manu/order/relCode")
@GetMapping("udi/trace/manu/order/relCode")
public BaseResponse filterDetail(TraceManuDetailRequest traceManuDetailRequest) {
@ -99,7 +96,7 @@ public class TraceManuOrderController {
TraceTaskNoticeService traceTaskNoticeService;
//客户端生产信息上传接口
@ApiOperation(value = "客户端生产信息上传接口",response = BaseResponse.class)
@ApiOperation(value = "客户端生产信息上传接口", response = BaseResponse.class)
@AuthRuleAnnotation("udi/trace/manu/order/upload")
@PostMapping("udi/trace/manu/order/upload")
public BaseResponse uploadManuOrder(@RequestBody TraceManuOrderUploadRequest traceManuOrderUploadRequest, BindingResult bindingResult) {

@ -1,27 +1,20 @@
package com.glxp.api.controller.trace;
import cn.hutool.core.collection.CollUtil;
import cn.hutool.core.util.IdUtil;
import cn.hutool.core.util.StrUtil;
import com.alibaba.fastjson.JSON;
import com.github.pagehelper.PageInfo;
import com.glxp.api.annotation.AuthRuleAnnotation;
import com.glxp.api.common.enums.ResultEnum;
import com.glxp.api.common.res.BaseResponse;
import com.glxp.api.common.util.ResultVOUtils;
import com.glxp.api.config.rabbit.TopicRabbitConfig;
import com.glxp.api.controller.BaseController;
import com.glxp.api.entity.basic.UdiEntity;
import com.glxp.api.entity.sup.UserCompanyEntity;
import com.glxp.api.entity.trace.TraceManuCodeRelEntity;
import com.glxp.api.entity.trace.TraceManuOrderEntity;
import com.glxp.api.entity.trace.TraceOrderEntity;
import com.glxp.api.entity.trace.TraceTaskNoticeEntity;
import com.glxp.api.req.auth.FilterUserComapanyRequest;
import com.glxp.api.req.trace.*;
import com.glxp.api.req.trace.TraceOrderDetailRequest;
import com.glxp.api.req.trace.TraceOrderUploadRequest;
import com.glxp.api.res.PageSimpleResponse;
import com.glxp.api.res.trace.TraceOrderResponse;
import com.glxp.api.res.trace.TraceProductRecordResponse;
import com.glxp.api.service.trace.TraceOrderService;
import com.glxp.api.service.trace.TraceTaskNoticeService;
import com.glxp.api.util.udi.FilterUdiUtils;
@ -39,7 +32,6 @@ import org.springframework.web.bind.annotation.RestController;
import springfox.documentation.annotations.ApiIgnore;
import javax.annotation.Resource;
import java.util.ArrayList;
import java.util.Date;
import java.util.List;
@ -55,7 +47,7 @@ public class TraceOrderController extends BaseController {
@Resource
private final RabbitTemplate rabbitTemplate;
@ApiOperation(value = "查询追溯单据列表",response = TraceOrderResponse.class)
@ApiOperation(value = "查询追溯出入库单据列表", response = TraceOrderResponse.class)
@AuthRuleAnnotation("")
@GetMapping("udi/trace/order/filter")
public BaseResponse getTraceOrderList(TraceOrderDetailRequest traceOrderDetailRequest) {
@ -87,7 +79,7 @@ public class TraceOrderController extends BaseController {
TraceTaskNoticeService traceTaskNoticeService;
//客户端单据信息上传接口
@ApiOperation(value = "客户端单据信息上传接口",response = BaseResponse.class)
@ApiOperation(value = "客户端单据信息上传接口", response = BaseResponse.class)
@AuthRuleAnnotation("udi/trace/inout/order/upload")
@PostMapping("udi/trace/inout/order/upload")
public BaseResponse uploadInoutOrder(@RequestBody TraceOrderUploadRequest traceOrderUploadRequest, BindingResult bindingResult) {

@ -1,18 +1,31 @@
package com.glxp.api.controller.trace;
import cn.hutool.core.util.StrUtil;
import com.alibaba.fastjson2.JSON;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.github.pagehelper.PageInfo;
import com.glxp.api.annotation.AuthRuleAnnotation;
import com.glxp.api.common.res.BaseResponse;
import com.glxp.api.common.util.ResultVOUtils;
import com.glxp.api.config.rabbit.TopicRabbitConfig;
import com.glxp.api.controller.BaseController;
import com.glxp.api.entity.trace.TraceManuOrderEntity;
import com.glxp.api.entity.trace.TraceOrderEntity;
import com.glxp.api.entity.trace.TraceRecordLogEntity;
import com.glxp.api.req.trace.TraceRecordRequest;
import com.glxp.api.res.PageSimpleResponse;
import com.glxp.api.res.trace.TraceRecordResponse;
import com.glxp.api.res.trace.TraceSearchReponse;
import com.glxp.api.service.trace.TraceManuOrderService;
import com.glxp.api.service.trace.TraceOrderService;
import com.glxp.api.service.trace.TraceRecordService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import lombok.extern.slf4j.Slf4j;
import org.apache.poi.ss.formula.functions.T;
import org.bouncycastle.util.encoders.UTF8;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RestController;
import springfox.documentation.annotations.ApiIgnore;
@ -27,9 +40,14 @@ public class TraceRecordController extends BaseController {
@Resource
TraceRecordService traceRecordService;
@Resource
TraceOrderService traceOrderService;
@Resource
TraceManuOrderService traceManuOrderService;
// 查询记录搜索
@ApiOperation(value = "追溯查询记录搜索",response = TraceRecordResponse.class)
@ApiOperation(value = "追溯查询记录搜索", response = TraceRecordResponse.class)
@AuthRuleAnnotation("udi/trace/record/filter")
@GetMapping("udi/trace/record/filter")
public BaseResponse filterLogs(TraceRecordRequest traceRecordRequest) {
@ -43,4 +61,23 @@ public class TraceRecordController extends BaseController {
}
@ApiOperation(value = "追溯查询记录结果", response = TraceRecordResponse.class)
@AuthRuleAnnotation("udi/trace/record/result")
@GetMapping("udi/trace/record/result")
public BaseResponse getTraceResult(TraceRecordRequest traceRecordRequest) {
if (StrUtil.isNotEmpty(traceRecordRequest.getRecordCode())) {
TraceRecordLogEntity traceRecordLogEntity = traceRecordService.getOne(new QueryWrapper<TraceRecordLogEntity>().eq("recordCode", traceRecordRequest.getRecordCode()));
List<TraceOrderEntity> traceOrderEntities = traceOrderService.findByProductIdFk(traceRecordLogEntity.getTraceProductIdFk());
List<TraceManuOrderEntity> traceManuOrderEntities = traceManuOrderService.list(new QueryWrapper<TraceManuOrderEntity>().eq("traceProductIdFk", traceRecordLogEntity.getTraceProductIdFk()));
TraceSearchReponse traceSearchReponse = new TraceSearchReponse();
traceSearchReponse.setTraceOrderEntities(traceOrderEntities);
traceSearchReponse.setTraceManuOrderEntities(traceManuOrderEntities);
traceSearchReponse.setTraceRecordLogEntity(traceRecordLogEntity);
return ResultVOUtils.success(traceSearchReponse);
} else {
return ResultVOUtils.error(500, "查询记录号不能为空!");
}
}
}

@ -1,7 +1,6 @@
package com.glxp.api.controller.trace;
import cn.hutool.core.collection.CollUtil;
import cn.hutool.core.lang.UUID;
import cn.hutool.core.util.IdUtil;
import cn.hutool.core.util.StrUtil;
import com.alibaba.fastjson.JSON;
@ -27,7 +26,6 @@ import com.glxp.api.service.basic.BasicUdiRelService;
import com.glxp.api.service.sup.UserCompanyService;
import com.glxp.api.service.system.SystemParamConfigService;
import com.glxp.api.service.trace.*;
import com.glxp.api.util.DateUtil;
import com.glxp.api.util.GennerOrderUtils;
import com.glxp.api.util.udi.FilterUdiUtils;
import io.swagger.annotations.Api;
@ -46,9 +44,7 @@ import springfox.documentation.annotations.ApiIgnore;
import javax.annotation.Resource;
import java.util.Date;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
@Api(tags = "UDI追溯相关接口")
@ -59,13 +55,9 @@ import java.util.Map;
public class UdiTraceController extends BaseController {
@Resource
TraceProductDetailService traceProductDetailService;
@Resource
BasicUdiRelService basicUdiRelService;
@Resource
GennerOrderUtils gennerOrderUtils;
@Resource
TraceTaskNoticeService traceTaskNoticeService;
@Resource
@ -88,7 +80,7 @@ public class UdiTraceController extends BaseController {
private final RabbitTemplate rabbitTemplate;
@ApiIgnore
@ApiOperation(value = "消息推送接口",response = BaseResponse.class)
@ApiOperation(value = "消息推送接口", response = BaseResponse.class)
@GetMapping("/udi/trace/source/sendUDI")
public BaseResponse sendUdi(@RequestBody TraceRecordRequest traceRecordRequest) {
String messageJson = JSON.toJSONString(traceRecordRequest);
@ -106,14 +98,13 @@ public class UdiTraceController extends BaseController {
}*/
/**
*
*
* @param traceRecordRequest
* @return
*/
@ApiOperation(value = "源头追溯查询",response = TraceOrderEntity.class)
@ApiOperation(value = "源头追溯查询", response = TraceOrderEntity.class)
@AuthRuleAnnotation("udi/trace/source/search")
@GetMapping("udi/trace/source/search")
public BaseResponse createTrace(TraceRecordRequest traceRecordRequest) {
@ -214,7 +205,7 @@ public class UdiTraceController extends BaseController {
* @param traceRecordRequest
* @return
*/
@ApiOperation(value = "现场检查查询",response = TraceOrderEntity.class)
@ApiOperation(value = "现场检查查询", response = TraceOrderEntity.class)
@AuthRuleAnnotation("udi/trace/scene/search")
@GetMapping("udi/trace/scene/search")
public BaseResponse sceneTrace(TraceRecordRequest traceRecordRequest) {
@ -309,7 +300,7 @@ public class UdiTraceController extends BaseController {
* @return
*/
@Transactional
@ApiOperation(value = "客户端根据任务上传出入库单据",response = BaseResponse.class)
@ApiOperation(value = "客户端根据任务上传出入库单据", response = BaseResponse.class)
@AuthRuleAnnotation("udi/trace/order/upload")
@PostMapping("udi/trace/order/upload")
public BaseResponse uploadOrder(@RequestBody TraceOrderUploadRequest traceOrderUploadRequest, BindingResult bindingResult) {
@ -347,7 +338,7 @@ public class UdiTraceController extends BaseController {
* @return
*/
@Transactional
@ApiOperation(value = "客户端根据任务上传生产关联关系信息",response = BaseResponse.class)
@ApiOperation(value = "客户端根据任务上传生产关联关系信息", response = BaseResponse.class)
@AuthRuleAnnotation("udi/trace/manuOrder/upload")
@PostMapping("udi/trace/manuOrder/upload")
public BaseResponse uploadManuOrder(@RequestBody TraceManuOrderUploadRequest traceManuOrderUploadRequest, BindingResult bindingResult) {

@ -8,16 +8,16 @@ import lombok.Data;
import java.util.Date;
@Data
@ApiModel("跟踪记录请求")
@ApiModel("追溯记录请求")
public class TraceRecordRequest extends ListPageRequest {
@ApiModelProperty(hidden = true,value = "主键")
@ApiModelProperty(hidden = true, value = "主键")
private Long id;
/**
*
*/
@ApiModelProperty(hidden = true,value = "查询记录号")
@ApiModelProperty(hidden = true, value = "查询记录号")
private String recordCode;
/**
@ -35,18 +35,18 @@ public class TraceRecordRequest extends ListPageRequest {
/**
*
*/
@ApiModelProperty(hidden = true,value = "查询记录时间")
@ApiModelProperty(hidden = true, value = "查询记录时间")
private Date createTime;
/**
*
*/
@ApiModelProperty(hidden = true,value = "更新时间")
@ApiModelProperty(hidden = true, value = "更新时间")
private Date updateTime;
/**
* 1:2)
*/
@ApiModelProperty(hidden = true,value = "查询方式1:源头查询2现在检查查询)")
@ApiModelProperty(hidden = true, value = "查询方式1:源头查询2现在检查查询)")
private Integer traceSource;
/**
* UDI/

@ -1,16 +1,23 @@
package com.glxp.api.res.trace;
import com.glxp.api.entity.trace.TraceManuOrderEntity;
import com.glxp.api.entity.trace.TraceOrderEntity;
import com.glxp.api.entity.trace.TraceRecordLogEntity;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import java.util.List;
@Data
@ApiModel("追溯查询结果")
public class TraceSearchReponse {
@ApiModelProperty(value = "追溯日志")
TraceRecordLogEntity traceRecordLogEntity;
@ApiModelProperty(value = "追溯查询出入库单结果")
List<TraceOrderEntity> traceOrderEntities;
@ApiModelProperty(value = "追溯查询生产订单结果")
List<TraceManuOrderEntity> traceManuOrderEntities;
}

Loading…
Cancel
Save