|  | @@ -7,6 +7,7 @@ import com.yonge.cooleshow.biz.dal.entity.CustomerServiceReceive;
 | 
	
		
			
				|  |  |  import com.yonge.cooleshow.biz.dal.service.CustomerServiceReceiveService;
 | 
	
		
			
				|  |  |  import com.yonge.cooleshow.biz.dal.wrapper.im.CustomerServiceReceiveWrapper;
 | 
	
		
			
				|  |  |  import com.yonge.cooleshow.common.entity.HttpResponseResult;
 | 
	
		
			
				|  |  | +import com.yonge.toolset.base.exception.BizException;
 | 
	
		
			
				|  |  |  import com.yonge.toolset.base.page.PageInfo;
 | 
	
		
			
				|  |  |  import com.yonge.toolset.mybatis.support.PageUtil;
 | 
	
		
			
				|  |  |  import io.swagger.annotations.Api;
 | 
	
	
		
			
				|  | @@ -14,10 +15,9 @@ import io.swagger.annotations.ApiImplicitParam;
 | 
	
		
			
				|  |  |  import io.swagger.annotations.ApiImplicitParams;
 | 
	
		
			
				|  |  |  import io.swagger.annotations.ApiOperation;
 | 
	
		
			
				|  |  |  import lombok.extern.slf4j.Slf4j;
 | 
	
		
			
				|  |  | +import org.apache.commons.collections.CollectionUtils;
 | 
	
		
			
				|  |  |  import org.springframework.beans.factory.annotation.Autowired;
 | 
	
		
			
				|  |  |  import org.springframework.validation.annotation.Validated;
 | 
	
		
			
				|  |  | -import org.springframework.web.bind.annotation.GetMapping;
 | 
	
		
			
				|  |  | -import org.springframework.web.bind.annotation.PathVariable;
 | 
	
		
			
				|  |  |  import org.springframework.web.bind.annotation.PostMapping;
 | 
	
		
			
				|  |  |  import org.springframework.web.bind.annotation.RequestBody;
 | 
	
		
			
				|  |  |  import org.springframework.web.bind.annotation.RequestMapping;
 | 
	
	
		
			
				|  | @@ -25,6 +25,7 @@ import org.springframework.web.bind.annotation.RequestParam;
 | 
	
		
			
				|  |  |  import org.springframework.web.bind.annotation.RestController;
 | 
	
		
			
				|  |  |  
 | 
	
		
			
				|  |  |  import java.util.List;
 | 
	
		
			
				|  |  | +import java.util.Objects;
 | 
	
		
			
				|  |  |  
 | 
	
		
			
				|  |  |  @Slf4j
 | 
	
		
			
				|  |  |  @Validated
 | 
	
	
		
			
				|  | @@ -36,22 +37,6 @@ public class CustomerServiceReceiveController {
 | 
	
		
			
				|  |  |      @Autowired
 | 
	
		
			
				|  |  |      private CustomerServiceReceiveService customerServiceReceiveService;
 | 
	
		
			
				|  |  |  
 | 
	
		
			
				|  |  | -	/**
 | 
	
		
			
				|  |  | -	 * 查询单条
 | 
	
		
			
				|  |  | -	 * @param id 详情ID
 | 
	
		
			
				|  |  | -	 * @return R<CustomerServiceReceiveVo.CustomerServiceReceive>
 | 
	
		
			
				|  |  | -	 */
 | 
	
		
			
				|  |  | -	@ApiOperation(value = "详情", notes = "客服群发接收-根据详情ID查询单条, 传入id")
 | 
	
		
			
				|  |  | -    @ApiImplicitParams({
 | 
	
		
			
				|  |  | -            @ApiImplicitParam(name = "id", value = "id", dataType = "long")
 | 
	
		
			
				|  |  | -    })
 | 
	
		
			
				|  |  | -    @GetMapping("/detail/{id}")
 | 
	
		
			
				|  |  | -    public HttpResponseResult<CustomerServiceReceiveVo.CustomerServiceReceive> detail(@PathVariable("id") Long id) {
 | 
	
		
			
				|  |  | -    
 | 
	
		
			
				|  |  | -    	CustomerServiceReceive wrapper = customerServiceReceiveService.detail(id);
 | 
	
		
			
				|  |  | -        
 | 
	
		
			
				|  |  | -        return HttpResponseResult.succeed(CustomerServiceReceiveVo.CustomerServiceReceive.from(JSON.toJSONString(wrapper)));
 | 
	
		
			
				|  |  | -	}
 | 
	
		
			
				|  |  |      
 | 
	
		
			
				|  |  |      /**
 | 
	
		
			
				|  |  |  	 * 查询分页
 | 
	
	
		
			
				|  | @@ -60,15 +45,12 @@ public class CustomerServiceReceiveController {
 | 
	
		
			
				|  |  |  	 */
 | 
	
		
			
				|  |  |      @ApiOperation(value = "查询分页", notes = "客服群发接收- 传入 CustomerServiceReceiveVo.CustomerServiceReceiveQuery") 
 | 
	
		
			
				|  |  |      @PostMapping("/page")
 | 
	
		
			
				|  |  | -    public HttpResponseResult<PageInfo<CustomerServiceReceiveVo.CustomerServiceReceive>> page(@RequestBody CustomerServiceReceiveWrapper.CustomerServiceReceiveQuery query) {
 | 
	
		
			
				|  |  | +    public HttpResponseResult<PageInfo<CustomerServiceReceiveWrapper.CustomerServiceReceive>> page(@RequestBody CustomerServiceReceiveWrapper.CustomerServiceReceiveQuery query) {
 | 
	
		
			
				|  |  |      
 | 
	
		
			
				|  |  |          // 查询数据
 | 
	
		
			
				|  |  | -        IPage<CustomerServiceReceive> pages = customerServiceReceiveService.selectPage(PageUtil.getPage(query), query);
 | 
	
		
			
				|  |  | -        // 数据类型转换
 | 
	
		
			
				|  |  | -        List<CustomerServiceReceiveVo.CustomerServiceReceive> records = JSON.parseArray(JSON.toJSONString(pages.getRecords()), 
 | 
	
		
			
				|  |  | -        	CustomerServiceReceiveVo.CustomerServiceReceive.class);
 | 
	
		
			
				|  |  | -        
 | 
	
		
			
				|  |  | -        return HttpResponseResult.succeed(PageUtil.getPageInfo(pages, records));
 | 
	
		
			
				|  |  | +        IPage<CustomerServiceReceiveWrapper.CustomerServiceReceive> pages = customerServiceReceiveService.selectPage(PageUtil.getPage(query), query);
 | 
	
		
			
				|  |  | +
 | 
	
		
			
				|  |  | +        return HttpResponseResult.succeed(PageUtil.pageInfo(pages));
 | 
	
		
			
				|  |  |  	}
 | 
	
		
			
				|  |  |      
 | 
	
		
			
				|  |  |      /**
 | 
	
	
		
			
				|  | @@ -78,29 +60,20 @@ public class CustomerServiceReceiveController {
 | 
	
		
			
				|  |  |  	 */
 | 
	
		
			
				|  |  |      @ApiOperation(value = "新增", notes = "客服群发接收- 传入 CustomerServiceReceiveVo.CustomerServiceReceive")
 | 
	
		
			
				|  |  |  	@PostMapping("/save")
 | 
	
		
			
				|  |  | -	public HttpResponseResult<Boolean> add(@Validated @RequestBody CustomerServiceReceiveVo.CustomerServiceReceive info) {
 | 
	
		
			
				|  |  | -    
 | 
	
		
			
				|  |  | -        // 新增数据
 | 
	
		
			
				|  |  | -        customerServiceReceiveService.save(JSON.parseObject(info.jsonString(), CustomerServiceReceive.class));
 | 
	
		
			
				|  |  | +	public HttpResponseResult<Boolean> add(@Validated @RequestBody List<CustomerServiceReceiveVo.CustomerServiceReceive> info) {
 | 
	
		
			
				|  |  | +
 | 
	
		
			
				|  |  | +		if (CollectionUtils.isEmpty(info)
 | 
	
		
			
				|  |  | +				|| info.stream().anyMatch(x -> Objects.isNull(x.getBatchSendingId()))) {
 | 
	
		
			
				|  |  | +			throw new BizException("无效的请求参数");
 | 
	
		
			
				|  |  | +		}
 | 
	
		
			
				|  |  | +
 | 
	
		
			
				|  |  | +		List<CustomerServiceReceive> receives = JSON.parseArray(JSON.toJSONString(info), CustomerServiceReceive.class);
 | 
	
		
			
				|  |  | +		// 新增数据
 | 
	
		
			
				|  |  | +        customerServiceReceiveService.saveBatch(receives);
 | 
	
		
			
				|  |  |          
 | 
	
		
			
				|  |  |          return HttpResponseResult.succeed();
 | 
	
		
			
				|  |  |  	}
 | 
	
		
			
				|  |  |      
 | 
	
		
			
				|  |  | -    /**
 | 
	
		
			
				|  |  | -	 * 修改
 | 
	
		
			
				|  |  | -	 * @param info CustomerServiceReceiveVo.CustomerServiceReceive
 | 
	
		
			
				|  |  | -	 * @return R<Boolean>
 | 
	
		
			
				|  |  | -	 */
 | 
	
		
			
				|  |  | -    @ApiOperation(value = "修改", notes = "客服群发接收- 传入 CustomerServiceReceiveVo.CustomerServiceReceive")
 | 
	
		
			
				|  |  | -	@PostMapping("/update")
 | 
	
		
			
				|  |  | -	public HttpResponseResult<Boolean> update(@Validated @RequestBody CustomerServiceReceiveVo.CustomerServiceReceive info) {
 | 
	
		
			
				|  |  | -                
 | 
	
		
			
				|  |  | -        // 更新数据
 | 
	
		
			
				|  |  | -        customerServiceReceiveService.updateById(JSON.parseObject(info.jsonString(), CustomerServiceReceive.class));
 | 
	
		
			
				|  |  | -        
 | 
	
		
			
				|  |  | -        return HttpResponseResult.succeed();
 | 
	
		
			
				|  |  | -	}
 | 
	
		
			
				|  |  | -
 | 
	
		
			
				|  |  |   	/**
 | 
	
		
			
				|  |  |  	 * 删除
 | 
	
		
			
				|  |  |  	 * @param id 详情ID
 |