Commit ba77b3ac authored by 周健威's avatar 周健威

Merge remote-tracking branch 'origin/dev' into dev

parents 38e69565 f005f688
......@@ -225,7 +225,7 @@ public class StaffStatisticsBiz {
if (staffStatisticsFindDTO.getPage() == 1) {
List<UserStaffBo> userStaffBos = appUserDetailBiz.findStaffsByIdsAndCompanyAndPostion(staffStatisticsFindDTO);
List<StaffStatisticsBo> totalStaffStatisticsBos = processStaffStatistics(userStaffBos, staffStatisticsFindDTO);
StaffStatisticsTotalBo staffStatisticsTotalBo = getStaffStatisticsTotalBo(allStaffs.size(), totalStaffStatisticsBos);
StaffStatisticsTotalBo staffStatisticsTotalBo = getStaffStatisticsTotalBo(userStaffBos.size(), totalStaffStatisticsBos);
result.put(TOTAL_VAL, staffStatisticsTotalBo);
}
pageDataVO.setData(staffStatisticsBos);
......
......@@ -12,6 +12,10 @@ import com.xxfc.platform.vehicle.mapper.BranchCompanyVehicleCountMapper;
import com.xxfc.platform.vehicle.pojo.BranchCompanyVehicleCountVo;
import com.xxfc.platform.vehicle.pojo.dto.BranchCompanyVehicleCountDTO;
import lombok.extern.slf4j.Slf4j;
import org.apache.commons.lang3.StringUtils;
import org.joda.time.DateTime;
import org.joda.time.format.DateTimeFormat;
import org.joda.time.format.DateTimeFormatter;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.scheduling.annotation.Scheduled;
import org.springframework.stereotype.Service;
......@@ -24,6 +28,8 @@ public class BranchCompanyVehicleCountBiz extends BaseBiz<BranchCompanyVehicleCo
@Autowired
VehicleBiz vehicleBiz;
public static final DateTimeFormatter DATE_TIME_FORMATTER = DateTimeFormat.forPattern("yyyy-MM-dd");
public ObjectRestResponse add(BranchCompanyVehicleCount branchCompanyVehicleCount) {
if (branchCompanyVehicleCount == null) {
......@@ -88,6 +94,10 @@ public class BranchCompanyVehicleCountBiz extends BaseBiz<BranchCompanyVehicleCo
Integer type = branchCompanyVehicleCountDTO.getType() == null ? 1 : branchCompanyVehicleCountDTO.getType();
branchCompanyVehicleCountDTO.setPage(page);
branchCompanyVehicleCountDTO.setLimit(limit);
if (StringUtils.isBlank(branchCompanyVehicleCountDTO.getStartTime()) || StringUtils.isBlank(branchCompanyVehicleCountDTO.getEndTime())) {
branchCompanyVehicleCountDTO.setStartTime(DateTime.now().toString(DATE_TIME_FORMATTER));
branchCompanyVehicleCountDTO.setEndTime(DateTime.now().toString(DATE_TIME_FORMATTER));
}
Query query = new Query(branchCompanyVehicleCountDTO);
if (type == 1) {//按天
return ObjectRestResponse.succ(countByDay(query));
......
......@@ -592,9 +592,21 @@
<!--导出分公司停靠所有车辆-->
<select id="getAllVehicleInfo" resultType="com.xxfc.platform.vehicle.pojo.BranchCompanyVehicleCountVo">
select b.id as companyId, DATE_FORMAT(now(),'%Y') as countYear, DATE_FORMAT(now(),'%m') as countMonth,DATE_FORMAT(now(),'%u') as countWeek,DATE_FORMAT(now(),'%Y-%m-%d') as countDate,count(*) as vehicleNum from vehicle v
LEFT JOIN branch_company b on b.id = v.park_branch_company_id
GROUP BY b.id
SELECT
b.id AS companyId,
DATE_FORMAT(
DATE_SUB(NOW(), INTERVAL 1 DAY),
'%Y'
) AS countYear,
DATE_FORMAT(DATE_SUB(NOW(), INTERVAL 1 DAY), '%m') AS countMonth,
DATE_FORMAT(DATE_SUB(NOW(), INTERVAL 1 DAY), '%u') AS countWeek,
DATE_FORMAT(DATE_SUB(NOW(), INTERVAL 1 DAY), '%Y-%m-%d') AS countDate,
count(*) AS vehicleNum
FROM
vehicle v
LEFT JOIN branch_company b ON b.id = v.park_branch_company_id
GROUP BY
b.id
</select>
<select id="lockByCode" resultType="com.xxfc.platform.vehicle.entity.Vehicle"
......
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