Merge branch 'insp'
This commit is contained in:
commit
dfef351a46
@ -132,8 +132,8 @@ public class InspectionInfoController extends BaseController {
|
||||
*/
|
||||
@GetMapping("geStelectInspectionByBusiness")
|
||||
public CommonResult geStelectInspectionByBusiness(InspectionInfo inspectionInfo,
|
||||
@RequestParam(value = "pageNum", required = false, defaultValue = "1") Integer pageNum,
|
||||
@RequestParam(value = "pageSize", required = false, defaultValue = "10") Integer pageSize) {
|
||||
@RequestParam(value = "pageNum", required = false, defaultValue = "1") Integer pageNum,
|
||||
@RequestParam(value = "pageSize", required = false, defaultValue = "10") Integer pageSize) {
|
||||
Page<InspectionInfo> page = new Page<>(pageNum, pageSize);
|
||||
return success(inspectionInfoService.geStelectInspectionByBusiness(page, inspectionInfo));
|
||||
}
|
||||
@ -396,8 +396,27 @@ public class InspectionInfoController extends BaseController {
|
||||
* @date 16:22 2024/12/18
|
||||
**/
|
||||
@GetMapping("/getBusinessCountByType")
|
||||
public CommonResult<?> getBusinessCountByType(@RequestParam(required = false, name ="partnerId") Integer partnerId) {
|
||||
return success(inspectionInfoService.getBusinessCountByType(partnerId));
|
||||
public CommonResult<?> getBusinessCountByType(@RequestParam(required = false, name = "partnerId") Integer partnerId,
|
||||
@RequestParam(required = false, name = "unit") String unit) {
|
||||
List<String> datetimeRange = new ArrayList<>();
|
||||
if (unit != null) {
|
||||
DateTime now = DateUtil.date();
|
||||
switch (unit) {
|
||||
case "day":
|
||||
datetimeRange.add(String.valueOf(DateUtil.beginOfDay(now)));
|
||||
datetimeRange.add(String.valueOf(DateUtil.endOfDay(now)));
|
||||
break;
|
||||
case "week":
|
||||
datetimeRange.add(String.valueOf(DateUtil.beginOfWeek(now)));
|
||||
datetimeRange.add(String.valueOf(DateUtil.endOfWeek(now)));
|
||||
break;
|
||||
case "month":
|
||||
datetimeRange.add(String.valueOf(DateUtil.beginOfMonth(now)));
|
||||
datetimeRange.add(String.valueOf(DateUtil.endOfMonth(now)));
|
||||
break;
|
||||
}
|
||||
}
|
||||
return success(inspectionInfoService.getBusinessCountByType(partnerId,datetimeRange));
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -258,4 +258,6 @@ public class InspectionInfo extends TenantBaseDO
|
||||
/** 保险公司名称 */
|
||||
@TableField(exist = false)
|
||||
private String insuranceCompanyName;
|
||||
@TableField(exist = false)
|
||||
private List<String> datetimeRange;
|
||||
}
|
||||
|
@ -179,7 +179,7 @@ public interface IInspectionInfoService extends IService<InspectionInfo>
|
||||
*/
|
||||
IPage<InspectionInfo> geStelectInspectionByBusiness(Page<InspectionInfo> page, InspectionInfo inspectionInfo);
|
||||
|
||||
Map<String, Long> getBusinessCountByType(Integer partnerId);
|
||||
Map<String, Long> getBusinessCountByType(Integer partnerId, List<String> datetimeRange);
|
||||
|
||||
List<InspectionInfo> selectMeetCarList(List<String> datetimeRange);
|
||||
|
||||
|
@ -1027,7 +1027,7 @@ public class InspectionInfoServiceImpl extends ServiceImpl<InspectionInfoMapper,
|
||||
* @return
|
||||
*/
|
||||
@Override
|
||||
public Map<String, Long> getBusinessCountByType(Integer partnerId) {
|
||||
public Map<String, Long> getBusinessCountByType(Integer partnerId, List<String> datetimeRange) {
|
||||
// 创建线程池
|
||||
ExecutorService executor = Executors.newFixedThreadPool(10);
|
||||
|
||||
@ -1058,6 +1058,7 @@ public class InspectionInfoServiceImpl extends ServiceImpl<InspectionInfoMapper,
|
||||
// 深拷贝对象,防止多线程修改冲突
|
||||
InspectionInfo infoCopy = JSON.parseObject(JSON.toJSONString(inspectionInfo), InspectionInfo.class);
|
||||
infoCopy.setStatus(status);
|
||||
infoCopy.setDatetimeRange(datetimeRange);
|
||||
|
||||
Page<InspectionInfo> page = new Page<>(1, 1);
|
||||
|
||||
|
@ -689,6 +689,11 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||
AND ii.status = '1'
|
||||
</if>
|
||||
</if>
|
||||
<if test="info.datetimeRange != null and info.datetimeRange.size() > 0">
|
||||
<if test="info.datetimeRange.size() == 2">
|
||||
AND imco.create_time BETWEEN #{info.datetimeRange[0]} AND #{info.datetimeRange[1]}
|
||||
</if>
|
||||
</if>
|
||||
</select>
|
||||
|
||||
<select id="selectMeetCarList" resultType="cn.iocoder.yudao.module.inspection.entity.InspectionInfo">
|
||||
|
Loading…
Reference in New Issue
Block a user