|
@@ -7,6 +7,7 @@ import cn.fastfun.service.AppDeviceService;
|
|
|
import cn.fastfun.service.SysExcelFieldService;
|
|
|
import cn.fastfun.service.entity.AppDevice;
|
|
|
import cn.fastfun.service.entity.Product;
|
|
|
+import cn.fastfun.util.DateUtils;
|
|
|
import cn.fastfun.util.VerifyUtil;
|
|
|
import cn.fastfun.util.ObjectUtil;
|
|
|
import com.bridge.dto.ApiDTO;
|
|
@@ -17,7 +18,9 @@ import com.bridge.service.JpaService;
|
|
|
import io.swagger.annotations.Api;
|
|
|
import io.swagger.annotations.ApiOperation;
|
|
|
import io.swagger.annotations.ApiParam;
|
|
|
+import lombok.extern.slf4j.Slf4j;
|
|
|
import org.apache.poi.hssf.usermodel.HSSFWorkbook;
|
|
|
+import org.springframework.util.StringUtils;
|
|
|
import org.springframework.web.bind.annotation.*;
|
|
|
import org.springframework.web.multipart.MultipartFile;
|
|
|
|
|
@@ -31,6 +34,7 @@ import java.util.Map;
|
|
|
/**
|
|
|
* @author Bridge AutoGen
|
|
|
*/
|
|
|
+@Slf4j
|
|
|
@Api(tags = {"设备信息"})
|
|
|
@RestController
|
|
|
@RequestMapping("/api/v1/appdevice")
|
|
@@ -114,8 +118,13 @@ public class ApiAppDeviceController {
|
|
|
@ApiOperation(value = "设备批次分页搜索")
|
|
|
@RequestMapping(value = "batchNum/pageQuery", method = RequestMethod.POST)
|
|
|
public ApiPageDTO batchNumPageQuery(@RequestBody DeviceBathQueryParam param) {
|
|
|
- StringBuffer sql = new StringBuffer("select t.batch_num,t.sn,t.deliver_time,count(0) as total from app_device t");
|
|
|
- sql.append(" group by t.batch_num");
|
|
|
+ StringBuffer sql = new StringBuffer("select t1.batch_num,t1.sn,t1.deliver_time,count(0) as total,t1.add_time,t1.deliver_addr from app_device t1");
|
|
|
+ sql.append(" group by t1.batch_num");
|
|
|
+ if(!StringUtils.isEmpty(param.getOrderBy())){
|
|
|
+ sql.append(param.getOrderBy());
|
|
|
+ }
|
|
|
+ log.info("SQL: {}", sql.toString());
|
|
|
+
|
|
|
|
|
|
ApiPageDTO page = appDeviceService.getListBySQL(sql.toString(), new HashMap<>(), param);
|
|
|
// 组装数据
|
|
@@ -124,6 +133,8 @@ public class ApiAppDeviceController {
|
|
|
DeviceAttrDTO attr = appDeviceService.sn2Attr(ObjectUtil.obj2String(p.get("sn")));
|
|
|
p.put("type_title", attr.getTypeTitle());
|
|
|
p.put("pack_title", attr.getPackTitle());
|
|
|
+ p.put("deliver_time", DateUtils.toString(ObjectUtil.obj2Date(p.get("deliver_time")),DateUtils.YMD));
|
|
|
+ p.put("add_time", DateUtils.toString(ObjectUtil.obj2Date(p.get("add_time")),DateUtils.YMDHMS));
|
|
|
}
|
|
|
page.setData(list);
|
|
|
return page;
|