|
@@ -8,6 +8,7 @@ import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
|
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
|
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
|
import com.github.pagehelper.PageHelper;
|
|
import com.github.pagehelper.PageHelper;
|
|
import com.github.pagehelper.PageInfo;
|
|
import com.github.pagehelper.PageInfo;
|
|
|
|
+import org.apache.commons.lang.StringUtils;
|
|
import org.apache.shiro.SecurityUtils;
|
|
import org.apache.shiro.SecurityUtils;
|
|
import org.jeecg.common.system.vo.LoginUser;
|
|
import org.jeecg.common.system.vo.LoginUser;
|
|
import org.jeecg.common.util.DateUtils;
|
|
import org.jeecg.common.util.DateUtils;
|
|
@@ -55,134 +56,84 @@ public class ByteDanceVideoReportDailyServiceImpl extends ServiceImpl<ByteDanceV
|
|
|
|
|
|
//QueryWrapper<ByteDanceVideoReportDaily> queryWrapper = new QueryWrapper<>();
|
|
//QueryWrapper<ByteDanceVideoReportDaily> queryWrapper = new QueryWrapper<>();
|
|
|
|
|
|
- List<ByteDanceVideoReportDaily> mList2 = byteDanceVideoReportDailyMapper.selectList(wrapper);
|
|
|
|
-
|
|
|
|
- for(ByteDanceVideoReportDaily m:mList2){
|
|
|
|
- String statDate = DateUtils.formatDate(DateUtils.addDay(m.getStatDatetime(),-1));
|
|
|
|
- BigDecimal cost = byteDanceVideoReportDailyMapper.getVideoReportDailyByDateAndSignature(statDate,statDate,m.getSignature(),companyId);
|
|
|
|
-
|
|
|
|
- BigDecimal huanbi =BigDecimal.ZERO;
|
|
|
|
- if(cost != null && cost.compareTo(BigDecimal.ZERO)>0){
|
|
|
|
- huanbi = m.getCost().subtract(cost).divide(cost,7, BigDecimal.ROUND_HALF_UP);
|
|
|
|
- }
|
|
|
|
-
|
|
|
|
- m.setHuanbi(huanbi);
|
|
|
|
- byteDanceVideoReportDailyMapper.updateById(m);
|
|
|
|
- }
|
|
|
|
|
|
+ //List<ByteDanceVideoReportDaily> mList2 = byteDanceVideoReportDailyMapper.selectList(wrapper);
|
|
|
|
+ //
|
|
|
|
+ //for(ByteDanceVideoReportDaily m:mList2){
|
|
|
|
+ // String statDate = DateUtils.formatDate(DateUtils.addDay(m.getStatDatetime(),-1));
|
|
|
|
+ // BigDecimal cost = byteDanceVideoReportDailyMapper.getVideoReportDailyByDateAndSignature(statDate,statDate,m.getSignature(),companyId);
|
|
|
|
+ //
|
|
|
|
+ // BigDecimal huanbi =BigDecimal.ZERO;
|
|
|
|
+ // if(cost != null && cost.compareTo(BigDecimal.ZERO)>0){
|
|
|
|
+ // huanbi = m.getCost().subtract(cost).divide(cost,7, BigDecimal.ROUND_HALF_UP);
|
|
|
|
+ // }
|
|
|
|
+ //
|
|
|
|
+ // m.setHuanbi(huanbi);
|
|
|
|
+ // byteDanceVideoReportDailyMapper.updateById(m);
|
|
|
|
+ //}
|
|
}
|
|
}
|
|
|
|
|
|
//视频按天列表
|
|
//视频按天列表
|
|
- public PageInfo<ByteDanceVideoReportDaily> videoInfoListDaily(String startDate, String endDate, String signature, BigDecimal cost, Integer pageNo, Integer pageSize, Long[] projectIds, Long[] accountIds){
|
|
|
|
|
|
+ public PageInfo<ByteDanceVideoReportDaily> videoInfoListDaily(String startDate, String endDate, String signature, BigDecimal cost, Integer pageNo, Integer pageSize, Long[] projectIds, Long[] accountIds, String sort){
|
|
LoginUser sysUser = (LoginUser) SecurityUtils.getSubject().getPrincipal();
|
|
LoginUser sysUser = (LoginUser) SecurityUtils.getSubject().getPrincipal();
|
|
String userId = sysUser.getId();
|
|
String userId = sysUser.getId();
|
|
String roleCode = byteDanceVideoReportDailyMapper.getRoleCodeByUserId(userId);
|
|
String roleCode = byteDanceVideoReportDailyMapper.getRoleCodeByUserId(userId);
|
|
String companyId = byteDanceVideoReportDailyMapper.getCompanyIdByUserId(userId);
|
|
String companyId = byteDanceVideoReportDailyMapper.getCompanyIdByUserId(userId);
|
|
|
|
|
|
|
|
+ if(StringUtils.isBlank(sort)){
|
|
|
|
+ sort = "cost-";
|
|
|
|
+ }
|
|
|
|
+ sort = sort.replace("-", " desc,").replace("+", " asc,"); //sort=id-name+age+
|
|
|
|
+ sort = sort.substring(0, sort.length() - 1);
|
|
List<ByteDanceVideoReportDaily> mList = new ArrayList<>();
|
|
List<ByteDanceVideoReportDaily> mList = new ArrayList<>();
|
|
|
|
+
|
|
|
|
+ List<Long> accountIdsList = null;
|
|
|
|
+ if(accountIds != null && accountIds.length != 0){
|
|
|
|
+ accountIdsList = Arrays.asList(accountIds);
|
|
|
|
+ }
|
|
//admin能看所有视频
|
|
//admin能看所有视频
|
|
if(roleCode.equals("admin")){
|
|
if(roleCode.equals("admin")){
|
|
- if (projectIds != null && projectIds.length != 0){
|
|
|
|
- List<Long> projectIdsList = Arrays.asList(projectIds);
|
|
|
|
- List<Long> accountIdsList = byteDanceVideoReportDailyMapper.getAccountIdByprojectIds(projectIdsList);
|
|
|
|
- if(accountIdsList.size()==0 || accountIdsList == null){
|
|
|
|
- accountIdsList.add(-1L);
|
|
|
|
- }
|
|
|
|
- PageHelper.startPage(pageNo,pageSize);
|
|
|
|
- mList = byteDanceVideoReportDailyMapper.videoInfoListGroupAdmin(startDate, endDate, accountIdsList, signature, cost);
|
|
|
|
- }else{
|
|
|
|
- PageHelper.startPage(pageNo,pageSize);
|
|
|
|
- mList = byteDanceVideoReportDailyMapper.videoInfoListGroupAdmin(startDate, endDate, null, signature, cost);
|
|
|
|
- }
|
|
|
|
|
|
+ PageHelper.startPage(pageNo,pageSize,sort);
|
|
|
|
+ mList = byteDanceVideoReportDailyMapper.videoInfoListGroupAdmin(startDate, endDate, accountIdsList, signature, cost);
|
|
}else if(roleCode.equals("touTiaoOperationManager") || roleCode.equals("operator") || roleCode.equals("operationAssistant")) {
|
|
}else if(roleCode.equals("touTiaoOperationManager") || roleCode.equals("operator") || roleCode.equals("operationAssistant")) {
|
|
- if (projectIds != null && projectIds.length != 0){
|
|
|
|
- List<Long> projectIdsList = Arrays.asList(projectIds);
|
|
|
|
- List<Long> accountIdsList = byteDanceVideoReportDailyMapper.getAccountIdByprojectIds(projectIdsList);
|
|
|
|
- if(accountIdsList.size()==0 || accountIdsList == null){
|
|
|
|
- accountIdsList.add(-1L);
|
|
|
|
- }
|
|
|
|
- PageHelper.startPage(pageNo,pageSize);
|
|
|
|
|
|
+ if (accountIdsList != null && accountIdsList.size() != 0){
|
|
|
|
+ PageHelper.startPage(pageNo,pageSize,sort);
|
|
mList = byteDanceVideoReportDailyMapper.videoInfoListGroupOperator(startDate,endDate,accountIdsList,signature,cost);
|
|
mList = byteDanceVideoReportDailyMapper.videoInfoListGroupOperator(startDate,endDate,accountIdsList,signature,cost);
|
|
}else{
|
|
}else{
|
|
List<Long> accoutnIds= byteDanceVideoReportDailyMapper.getAccountIdsByOperatorIdAndMediaId(1,userId);
|
|
List<Long> accoutnIds= byteDanceVideoReportDailyMapper.getAccountIdsByOperatorIdAndMediaId(1,userId);
|
|
- PageHelper.startPage(pageNo,pageSize);
|
|
|
|
|
|
+ PageHelper.startPage(pageNo,pageSize,sort);
|
|
mList = byteDanceVideoReportDailyMapper.videoInfoListGroupOperator(startDate,endDate,accoutnIds,signature,cost);
|
|
mList = byteDanceVideoReportDailyMapper.videoInfoListGroupOperator(startDate,endDate,accoutnIds,signature,cost);
|
|
}
|
|
}
|
|
}else if(roleCode.equals("shot")){
|
|
}else if(roleCode.equals("shot")){
|
|
- //设计师传入projectIds,根据projectIds解析出accountIdsList
|
|
|
|
- if (projectIds != null && projectIds.length != 0){
|
|
|
|
- List<Long> projectIdsList = Arrays.asList(projectIds);
|
|
|
|
- List<Long> accountIdsList = byteDanceVideoReportDailyMapper.getAccountIdByprojectIds(projectIdsList);
|
|
|
|
- if(accountIdsList.size() != 0){
|
|
|
|
- if(accountIdsList.size()==0 || accountIdsList == null){
|
|
|
|
- accountIdsList.add(-1L);
|
|
|
|
- }
|
|
|
|
- PageHelper.startPage(pageNo,pageSize);
|
|
|
|
- mList = byteDanceVideoReportDailyMapper.videoInfoListGroupShot(startDate, endDate, companyId, userId, accountIdsList, signature, cost);
|
|
|
|
- }
|
|
|
|
- }else{
|
|
|
|
- PageHelper.startPage(pageNo,pageSize);
|
|
|
|
- mList = byteDanceVideoReportDailyMapper.videoInfoListGroupShot(startDate, endDate, companyId, userId, null, signature, cost);
|
|
|
|
- }
|
|
|
|
|
|
+ PageHelper.startPage(pageNo,pageSize,sort);
|
|
|
|
+ mList = byteDanceVideoReportDailyMapper.videoInfoListGroupShot(startDate, endDate, companyId, userId, accountIdsList, signature, cost);
|
|
}else if(roleCode.equals("plan")){
|
|
}else if(roleCode.equals("plan")){
|
|
- if (projectIds != null && projectIds.length != 0){
|
|
|
|
- List<Long> projectIdsList = Arrays.asList(projectIds);
|
|
|
|
- List<Long> accountIdsList = byteDanceVideoReportDailyMapper.getAccountIdByprojectIds(projectIdsList);
|
|
|
|
- if(accountIdsList.size()==0 || accountIdsList == null){
|
|
|
|
- accountIdsList.add(-1L);
|
|
|
|
- }
|
|
|
|
- if(accountIdsList.size() != 0){
|
|
|
|
- PageHelper.startPage(pageNo,pageSize);
|
|
|
|
- mList = byteDanceVideoReportDailyMapper.videoInfoListGroupPlan(startDate, endDate, companyId, userId, accountIdsList, signature, cost);
|
|
|
|
- }
|
|
|
|
- }else{
|
|
|
|
- PageHelper.startPage(pageNo,pageSize);
|
|
|
|
- mList = byteDanceVideoReportDailyMapper.videoInfoListGroupPlan(startDate, endDate, companyId, userId, null, signature, cost);
|
|
|
|
- }
|
|
|
|
|
|
+ PageHelper.startPage(pageNo,pageSize,sort);
|
|
|
|
+ mList = byteDanceVideoReportDailyMapper.videoInfoListGroupPlan(startDate, endDate, companyId, userId, accountIdsList, signature, cost);
|
|
}else if(roleCode.equals("plane")){
|
|
}else if(roleCode.equals("plane")){
|
|
- if (projectIds != null && projectIds.length != 0){
|
|
|
|
- List<Long> projectIdsList = Arrays.asList(projectIds);
|
|
|
|
- List<Long> accountIdsList = byteDanceVideoReportDailyMapper.getAccountIdByprojectIds(projectIdsList);
|
|
|
|
- if(accountIdsList.size()==0 || accountIdsList == null){
|
|
|
|
- accountIdsList.add(-1L);
|
|
|
|
- }
|
|
|
|
- if(accountIdsList.size() != 0){
|
|
|
|
- PageHelper.startPage(pageNo,pageSize);
|
|
|
|
- mList = byteDanceVideoReportDailyMapper.videoInfoListGroupPlaneAndPlaneLeader(startDate, endDate, companyId, userId, accountIdsList, signature, cost);
|
|
|
|
- }
|
|
|
|
- }else{
|
|
|
|
- PageHelper.startPage(pageNo,pageSize);
|
|
|
|
- mList = byteDanceVideoReportDailyMapper.videoInfoListGroupPlaneAndPlaneLeader(startDate, endDate, companyId, userId, null, signature, cost);
|
|
|
|
- }
|
|
|
|
|
|
+ PageHelper.startPage(pageNo,pageSize,sort);
|
|
|
|
+ mList = byteDanceVideoReportDailyMapper.videoInfoListGroupPlaneAndPlaneLeader(startDate, endDate, companyId, userId, accountIdsList, signature, cost);
|
|
}else if(roleCode.equals("clip")){
|
|
}else if(roleCode.equals("clip")){
|
|
- if (projectIds != null && projectIds.length != 0){
|
|
|
|
- List<Long> projectIdsList = Arrays.asList(projectIds);
|
|
|
|
- List<Long> accountIdsList = byteDanceVideoReportDailyMapper.getAccountIdByprojectIds(projectIdsList);
|
|
|
|
- if(accountIdsList.size()==0 || accountIdsList == null){
|
|
|
|
- accountIdsList.add(-1L);
|
|
|
|
- }
|
|
|
|
- if(accountIdsList.size() != 0){
|
|
|
|
- PageHelper.startPage(pageNo,pageSize);
|
|
|
|
- mList = byteDanceVideoReportDailyMapper.videoInfoListGroupClip(startDate, endDate, companyId, userId, accountIdsList, signature, cost);
|
|
|
|
- }
|
|
|
|
- }else{
|
|
|
|
- PageHelper.startPage(pageNo,pageSize);
|
|
|
|
- mList = byteDanceVideoReportDailyMapper.videoInfoListGroupClip(startDate, endDate, companyId, userId, null, signature, cost);
|
|
|
|
- }
|
|
|
|
|
|
+ PageHelper.startPage(pageNo,pageSize,sort);
|
|
|
|
+ mList = byteDanceVideoReportDailyMapper.videoInfoListGroupClip(startDate, endDate, companyId, userId, accountIdsList, signature, cost);
|
|
}else if(roleCode.equals("designTeamLeader")){
|
|
}else if(roleCode.equals("designTeamLeader")){
|
|
- if (projectIds != null && projectIds.length != 0){
|
|
|
|
- List<Long> projectIdsList = Arrays.asList(projectIds);
|
|
|
|
- List<Long> accountIdsList = byteDanceVideoReportDailyMapper.getAccountIdByprojectIds(projectIdsList);
|
|
|
|
- if(accountIdsList.size()==0 || accountIdsList == null){
|
|
|
|
- accountIdsList.add(-1L);
|
|
|
|
- }
|
|
|
|
- if(accountIdsList.size() != 0){
|
|
|
|
- PageHelper.startPage(pageNo,pageSize);
|
|
|
|
- mList = byteDanceVideoReportDailyMapper.videoInfoListGroupdesignTeamLeader(startDate, endDate, companyId, accountIdsList, signature, cost);
|
|
|
|
- }
|
|
|
|
- }else{
|
|
|
|
- PageHelper.startPage(pageNo,pageSize);
|
|
|
|
- mList = byteDanceVideoReportDailyMapper.videoInfoListGroupdesignTeamLeader(startDate, endDate, companyId, null, signature, cost);
|
|
|
|
|
|
+ PageHelper.startPage(pageNo,pageSize,sort);
|
|
|
|
+ mList = byteDanceVideoReportDailyMapper.videoInfoListGroupdesignTeamLeader(startDate, endDate, companyId, accountIdsList, signature, cost);
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ //计算环比
|
|
|
|
+ for(ByteDanceVideoReportDaily m:mList){
|
|
|
|
+ Integer datediff = DateUtils.dateDiff(startDate, endDate);
|
|
|
|
+ String startMonthDate = DateUtils.formatDate(DateUtils.addDay(startDate,-(datediff + 1) ) );
|
|
|
|
+ String endMonthDate = DateUtils.formatDate(DateUtils.addDay(startDate,-1));
|
|
|
|
+
|
|
|
|
+ BigDecimal costBefore = byteDanceVideoReportDailyMapper.getVideoReportDailyByDateAndSignature(startMonthDate,endMonthDate,m.getSignature(),accountIdsList);
|
|
|
|
+
|
|
|
|
+ BigDecimal huanbi =BigDecimal.ZERO;
|
|
|
|
+ if(costBefore != null && costBefore.compareTo(BigDecimal.ZERO)>0){
|
|
|
|
+ huanbi = m.getCost().subtract(costBefore).divide(costBefore,7, BigDecimal.ROUND_HALF_UP);
|
|
}
|
|
}
|
|
|
|
+
|
|
|
|
+ m.setHuanbi(huanbi);
|
|
}
|
|
}
|
|
|
|
|
|
PageInfo<ByteDanceVideoReportDaily> pageInfo = new PageInfo<>(mList);
|
|
PageInfo<ByteDanceVideoReportDaily> pageInfo = new PageInfo<>(mList);
|
|
@@ -191,131 +142,60 @@ public class ByteDanceVideoReportDailyServiceImpl extends ServiceImpl<ByteDanceV
|
|
|
|
|
|
|
|
|
|
//视频报表月列表
|
|
//视频报表月列表
|
|
- public PageInfo<ByteDanceVideoReportDaily> videoInfoListMonth(String startDate, String endDate, String signature, BigDecimal cost, Integer pageNo, Integer pageSize, Long[] projectIds, Long[] accountIds){
|
|
|
|
|
|
+ public PageInfo<ByteDanceVideoReportDaily> videoInfoListMonth(String startDate, String endDate, String signature, BigDecimal cost, Integer pageNo, Integer pageSize, Long[] projectIds, Long[] accountIds, String sort){
|
|
LoginUser sysUser = (LoginUser) SecurityUtils.getSubject().getPrincipal();
|
|
LoginUser sysUser = (LoginUser) SecurityUtils.getSubject().getPrincipal();
|
|
String userId = sysUser.getId();
|
|
String userId = sysUser.getId();
|
|
String roleCode = byteDanceVideoReportDailyMapper.getRoleCodeByUserId(userId);
|
|
String roleCode = byteDanceVideoReportDailyMapper.getRoleCodeByUserId(userId);
|
|
String companyId = byteDanceVideoReportDailyMapper.getCompanyIdByUserId(userId);
|
|
String companyId = byteDanceVideoReportDailyMapper.getCompanyIdByUserId(userId);
|
|
|
|
|
|
|
|
+ if(StringUtils.isBlank(sort)){
|
|
|
|
+ sort = "cost-";
|
|
|
|
+ }
|
|
|
|
+ sort = sort.replace("-", " desc,").replace("+", " asc,"); //sort=id-name+age+
|
|
|
|
+ sort = sort.substring(0, sort.length() - 1);
|
|
List<ByteDanceVideoReportDaily> mList = new ArrayList<>();
|
|
List<ByteDanceVideoReportDaily> mList = new ArrayList<>();
|
|
|
|
+
|
|
|
|
+ List<Long> accountIdsList = null;
|
|
|
|
+ if(accountIds != null && accountIds.length != 0){
|
|
|
|
+ accountIdsList = Arrays.asList(accountIds);
|
|
|
|
+ }
|
|
//admin能看所有视频
|
|
//admin能看所有视频
|
|
if(roleCode.equals("admin")){
|
|
if(roleCode.equals("admin")){
|
|
- if (projectIds != null && projectIds.length != 0){
|
|
|
|
- List<Long> projectIdsList = Arrays.asList(projectIds);
|
|
|
|
- List<Long> accountIdsList = byteDanceVideoReportDailyMapper.getAccountIdByprojectIds(projectIdsList);
|
|
|
|
- if(accountIdsList.size()==0 || accountIdsList == null){
|
|
|
|
- accountIdsList.add(-1L);
|
|
|
|
- }
|
|
|
|
- PageHelper.startPage(pageNo,pageSize);
|
|
|
|
- mList = byteDanceVideoReportDailyMapper.videoInfoListGroupAdmin(startDate, endDate, accountIdsList, signature, cost);
|
|
|
|
- }else{
|
|
|
|
- PageHelper.startPage(pageNo,pageSize);
|
|
|
|
- mList = byteDanceVideoReportDailyMapper.videoInfoListGroupAdmin(startDate, endDate, null, signature, cost);
|
|
|
|
- }
|
|
|
|
|
|
+ PageHelper.startPage(pageNo,pageSize,sort);
|
|
|
|
+ mList = byteDanceVideoReportDailyMapper.videoInfoListGroupAdmin(startDate, endDate, accountIdsList, signature, cost);
|
|
}else if(roleCode.equals("touTiaoOperationManager") || roleCode.equals("operator") || roleCode.equals("operationAssistant")) {
|
|
}else if(roleCode.equals("touTiaoOperationManager") || roleCode.equals("operator") || roleCode.equals("operationAssistant")) {
|
|
- if (projectIds != null && projectIds.length != 0){
|
|
|
|
- List<Long> projectIdsList = Arrays.asList(projectIds);
|
|
|
|
- List<Long> accountIdsList = byteDanceVideoReportDailyMapper.getAccountIdByprojectIds(projectIdsList);
|
|
|
|
- if(accountIdsList.size()==0 || accountIdsList == null){
|
|
|
|
- accountIdsList.add(-1L);
|
|
|
|
- }
|
|
|
|
- PageHelper.startPage(pageNo,pageSize);
|
|
|
|
|
|
+ if (accountIdsList != null && accountIdsList.size() != 0){
|
|
|
|
+ PageHelper.startPage(pageNo,pageSize,sort);
|
|
mList = byteDanceVideoReportDailyMapper.videoInfoListGroupOperator(startDate,endDate,accountIdsList,signature,cost);
|
|
mList = byteDanceVideoReportDailyMapper.videoInfoListGroupOperator(startDate,endDate,accountIdsList,signature,cost);
|
|
}else{
|
|
}else{
|
|
List<Long> accoutnIds= byteDanceVideoReportDailyMapper.getAccountIdsByOperatorIdAndMediaId(1,userId);
|
|
List<Long> accoutnIds= byteDanceVideoReportDailyMapper.getAccountIdsByOperatorIdAndMediaId(1,userId);
|
|
- PageHelper.startPage(pageNo,pageSize);
|
|
|
|
|
|
+ PageHelper.startPage(pageNo,pageSize,sort);
|
|
mList = byteDanceVideoReportDailyMapper.videoInfoListGroupOperator(startDate,endDate,accoutnIds,signature,cost);
|
|
mList = byteDanceVideoReportDailyMapper.videoInfoListGroupOperator(startDate,endDate,accoutnIds,signature,cost);
|
|
}
|
|
}
|
|
}else if(roleCode.equals("shot")){
|
|
}else if(roleCode.equals("shot")){
|
|
- //设计师传入projectIds,根据projectIds解析出accountIdsList
|
|
|
|
- if (projectIds != null && projectIds.length != 0){
|
|
|
|
- List<Long> projectIdsList = Arrays.asList(projectIds);
|
|
|
|
- List<Long> accountIdsList = byteDanceVideoReportDailyMapper.getAccountIdByprojectIds(projectIdsList);
|
|
|
|
- if(accountIdsList.size() != 0){
|
|
|
|
- if(accountIdsList.size()==0 || accountIdsList == null){
|
|
|
|
- accountIdsList.add(-1L);
|
|
|
|
- }
|
|
|
|
- PageHelper.startPage(pageNo,pageSize);
|
|
|
|
- mList = byteDanceVideoReportDailyMapper.videoInfoListGroupShot(startDate, endDate, companyId, userId, accountIdsList, signature, cost);
|
|
|
|
- }
|
|
|
|
- }else{
|
|
|
|
- PageHelper.startPage(pageNo,pageSize);
|
|
|
|
- mList = byteDanceVideoReportDailyMapper.videoInfoListGroupShot(startDate, endDate, companyId, userId, null, signature, cost);
|
|
|
|
- }
|
|
|
|
|
|
+ PageHelper.startPage(pageNo,pageSize,sort);
|
|
|
|
+ mList = byteDanceVideoReportDailyMapper.videoInfoListGroupShot(startDate, endDate, companyId, userId, accountIdsList, signature, cost);
|
|
}else if(roleCode.equals("plan")){
|
|
}else if(roleCode.equals("plan")){
|
|
- if (projectIds != null && projectIds.length != 0){
|
|
|
|
- List<Long> projectIdsList = Arrays.asList(projectIds);
|
|
|
|
- List<Long> accountIdsList = byteDanceVideoReportDailyMapper.getAccountIdByprojectIds(projectIdsList);
|
|
|
|
- if(accountIdsList.size()==0 || accountIdsList == null){
|
|
|
|
- accountIdsList.add(-1L);
|
|
|
|
- }
|
|
|
|
- if(accountIdsList.size() != 0){
|
|
|
|
- PageHelper.startPage(pageNo,pageSize);
|
|
|
|
- mList = byteDanceVideoReportDailyMapper.videoInfoListGroupPlan(startDate, endDate, companyId, userId, accountIdsList, signature, cost);
|
|
|
|
- }
|
|
|
|
- }else{
|
|
|
|
- PageHelper.startPage(pageNo,pageSize);
|
|
|
|
- mList = byteDanceVideoReportDailyMapper.videoInfoListGroupPlan(startDate, endDate, companyId, userId, null, signature, cost);
|
|
|
|
- }
|
|
|
|
|
|
+ PageHelper.startPage(pageNo,pageSize,sort);
|
|
|
|
+ mList = byteDanceVideoReportDailyMapper.videoInfoListGroupPlan(startDate, endDate, companyId, userId, accountIdsList, signature, cost);
|
|
}else if(roleCode.equals("plane")){
|
|
}else if(roleCode.equals("plane")){
|
|
- if (projectIds != null && projectIds.length != 0){
|
|
|
|
- List<Long> projectIdsList = Arrays.asList(projectIds);
|
|
|
|
- List<Long> accountIdsList = byteDanceVideoReportDailyMapper.getAccountIdByprojectIds(projectIdsList);
|
|
|
|
- if(accountIdsList.size()==0 || accountIdsList == null){
|
|
|
|
- accountIdsList.add(-1L);
|
|
|
|
- }
|
|
|
|
- if(accountIdsList.size() != 0){
|
|
|
|
- PageHelper.startPage(pageNo,pageSize);
|
|
|
|
- mList = byteDanceVideoReportDailyMapper.videoInfoListGroupPlaneAndPlaneLeader(startDate, endDate, companyId, userId, accountIdsList, signature, cost);
|
|
|
|
- }
|
|
|
|
- }else{
|
|
|
|
- PageHelper.startPage(pageNo,pageSize);
|
|
|
|
- mList = byteDanceVideoReportDailyMapper.videoInfoListGroupPlaneAndPlaneLeader(startDate, endDate, companyId, userId, null, signature, cost);
|
|
|
|
- }
|
|
|
|
|
|
+ PageHelper.startPage(pageNo,pageSize,sort);
|
|
|
|
+ mList = byteDanceVideoReportDailyMapper.videoInfoListGroupPlaneAndPlaneLeader(startDate, endDate, companyId, userId, accountIdsList, signature, cost);
|
|
}else if(roleCode.equals("clip")){
|
|
}else if(roleCode.equals("clip")){
|
|
- if (projectIds != null && projectIds.length != 0){
|
|
|
|
- List<Long> projectIdsList = Arrays.asList(projectIds);
|
|
|
|
- List<Long> accountIdsList = byteDanceVideoReportDailyMapper.getAccountIdByprojectIds(projectIdsList);
|
|
|
|
- if(accountIdsList.size()==0 || accountIdsList == null){
|
|
|
|
- accountIdsList.add(-1L);
|
|
|
|
- }
|
|
|
|
- if(accountIdsList.size() != 0){
|
|
|
|
- PageHelper.startPage(pageNo,pageSize);
|
|
|
|
- mList = byteDanceVideoReportDailyMapper.videoInfoListGroupClip(startDate, endDate, companyId, userId, accountIdsList, signature, cost);
|
|
|
|
- }
|
|
|
|
- }else{
|
|
|
|
- PageHelper.startPage(pageNo,pageSize);
|
|
|
|
- mList = byteDanceVideoReportDailyMapper.videoInfoListGroupClip(startDate, endDate, companyId, userId, null, signature, cost);
|
|
|
|
- }
|
|
|
|
|
|
+ PageHelper.startPage(pageNo,pageSize,sort);
|
|
|
|
+ mList = byteDanceVideoReportDailyMapper.videoInfoListGroupClip(startDate, endDate, companyId, userId, accountIdsList, signature, cost);
|
|
}else if(roleCode.equals("designTeamLeader")){
|
|
}else if(roleCode.equals("designTeamLeader")){
|
|
- if (projectIds != null && projectIds.length != 0){
|
|
|
|
- List<Long> projectIdsList = Arrays.asList(projectIds);
|
|
|
|
- List<Long> accountIdsList = byteDanceVideoReportDailyMapper.getAccountIdByprojectIds(projectIdsList);
|
|
|
|
- if(accountIdsList.size()==0 || accountIdsList == null){
|
|
|
|
- accountIdsList.add(-1L);
|
|
|
|
- }
|
|
|
|
- if(accountIdsList.size() != 0){
|
|
|
|
- PageHelper.startPage(pageNo,pageSize);
|
|
|
|
- mList = byteDanceVideoReportDailyMapper.videoInfoListGroupdesignTeamLeader(startDate, endDate, companyId, accountIdsList, signature, cost);
|
|
|
|
- }
|
|
|
|
- }else{
|
|
|
|
- PageHelper.startPage(pageNo,pageSize);
|
|
|
|
- mList = byteDanceVideoReportDailyMapper.videoInfoListGroupdesignTeamLeader(startDate, endDate, companyId, null, signature, cost);
|
|
|
|
- }
|
|
|
|
|
|
+ PageHelper.startPage(pageNo,pageSize,sort);
|
|
|
|
+ mList = byteDanceVideoReportDailyMapper.videoInfoListGroupdesignTeamLeader(startDate, endDate, companyId, accountIdsList, signature, cost);
|
|
}
|
|
}
|
|
|
|
|
|
//计算环比
|
|
//计算环比
|
|
for(ByteDanceVideoReportDaily m:mList){
|
|
for(ByteDanceVideoReportDaily m:mList){
|
|
- String startMonthDate = null;
|
|
|
|
- String endMonthDate = null;
|
|
|
|
- try {
|
|
|
|
- startMonthDate = DateUtils.addMonth( DateUtils.formatDate(DateUtils.addDay(m.getStatDatetime(),1)) , -1);
|
|
|
|
- endMonthDate = DateUtils.formatDate(DateUtils.addDay(m.getStatDatetime(),-1));
|
|
|
|
- } catch (ParseException e) {
|
|
|
|
- e.printStackTrace();
|
|
|
|
- }
|
|
|
|
|
|
+ Integer datediff = DateUtils.dateDiff(startDate, endDate);
|
|
|
|
+ String startMonthDate = DateUtils.formatDate(DateUtils.addDay(startDate,-(datediff + 1) ) );
|
|
|
|
+ String endMonthDate = DateUtils.formatDate(DateUtils.addDay(startDate,-1));
|
|
|
|
|
|
- BigDecimal costBefore = byteDanceVideoReportDailyMapper.getVideoReportDailyByDateAndSignature(startMonthDate,endMonthDate,m.getSignature(),companyId);
|
|
|
|
|
|
+ BigDecimal costBefore = byteDanceVideoReportDailyMapper.getVideoReportDailyByDateAndSignature(startMonthDate,endMonthDate,m.getSignature(),accountIdsList);
|
|
|
|
|
|
BigDecimal huanbi =BigDecimal.ZERO;
|
|
BigDecimal huanbi =BigDecimal.ZERO;
|
|
if(costBefore != null && costBefore.compareTo(BigDecimal.ZERO)>0){
|
|
if(costBefore != null && costBefore.compareTo(BigDecimal.ZERO)>0){
|
|
@@ -331,117 +211,67 @@ public class ByteDanceVideoReportDailyServiceImpl extends ServiceImpl<ByteDanceV
|
|
|
|
|
|
|
|
|
|
//视频总报表列表
|
|
//视频总报表列表
|
|
- public PageInfo<ByteDanceVideoReportDaily> videoInfoListTotal(String startDate, String endDate, String signature, BigDecimal cost , Integer pageNo, Integer pageSize, Long[] projectIds, Long[] accountIds){
|
|
|
|
|
|
+ public PageInfo<ByteDanceVideoReportDaily> videoInfoListTotal(String startDate, String endDate, String signature, BigDecimal cost , Integer pageNo, Integer pageSize, Long[] projectIds, Long[] accountIds, String sort){
|
|
LoginUser sysUser = (LoginUser) SecurityUtils.getSubject().getPrincipal();
|
|
LoginUser sysUser = (LoginUser) SecurityUtils.getSubject().getPrincipal();
|
|
String userId = sysUser.getId();
|
|
String userId = sysUser.getId();
|
|
String roleCode = byteDanceVideoReportDailyMapper.getRoleCodeByUserId(userId);
|
|
String roleCode = byteDanceVideoReportDailyMapper.getRoleCodeByUserId(userId);
|
|
String companyId = byteDanceVideoReportDailyMapper.getCompanyIdByUserId(userId);
|
|
String companyId = byteDanceVideoReportDailyMapper.getCompanyIdByUserId(userId);
|
|
|
|
|
|
|
|
+ if(StringUtils.isBlank(sort)){
|
|
|
|
+ sort = "cost-";
|
|
|
|
+ }
|
|
|
|
+ sort = sort.replace("-", " desc,").replace("+", " asc,"); //sort=id-name+age+
|
|
|
|
+ sort = sort.substring(0, sort.length() - 1);
|
|
List<ByteDanceVideoReportDaily> mList = new ArrayList<>();
|
|
List<ByteDanceVideoReportDaily> mList = new ArrayList<>();
|
|
|
|
+
|
|
|
|
+ List<Long> accountIdsList = null;
|
|
|
|
+ if(accountIds != null && accountIds.length != 0){
|
|
|
|
+ accountIdsList = Arrays.asList(accountIds);
|
|
|
|
+ }
|
|
//admin能看所有视频
|
|
//admin能看所有视频
|
|
if(roleCode.equals("admin")){
|
|
if(roleCode.equals("admin")){
|
|
- if (projectIds != null && projectIds.length != 0){
|
|
|
|
- List<Long> projectIdsList = Arrays.asList(projectIds);
|
|
|
|
- List<Long> accountIdsList = byteDanceVideoReportDailyMapper.getAccountIdByprojectIds(projectIdsList);
|
|
|
|
- if(accountIdsList.size()==0 || accountIdsList == null){
|
|
|
|
- accountIdsList.add(-1L);
|
|
|
|
- }
|
|
|
|
- PageHelper.startPage(pageNo,pageSize);
|
|
|
|
- mList = byteDanceVideoReportDailyMapper.videoInfoListGroupAdmin(startDate, endDate, accountIdsList, signature, cost);
|
|
|
|
- }else{
|
|
|
|
- PageHelper.startPage(pageNo,pageSize);
|
|
|
|
- mList = byteDanceVideoReportDailyMapper.videoInfoListGroupAdmin(startDate, endDate, null, signature, cost);
|
|
|
|
- }
|
|
|
|
|
|
+ PageHelper.startPage(pageNo,pageSize,sort);
|
|
|
|
+ mList = byteDanceVideoReportDailyMapper.videoInfoListGroupAdmin(startDate, endDate, accountIdsList, signature, cost);
|
|
}else if(roleCode.equals("touTiaoOperationManager") || roleCode.equals("operator") || roleCode.equals("operationAssistant")) {
|
|
}else if(roleCode.equals("touTiaoOperationManager") || roleCode.equals("operator") || roleCode.equals("operationAssistant")) {
|
|
- if (projectIds != null && projectIds.length != 0){
|
|
|
|
- List<Long> projectIdsList = Arrays.asList(projectIds);
|
|
|
|
- List<Long> accountIdsList = byteDanceVideoReportDailyMapper.getAccountIdByprojectIds(projectIdsList);
|
|
|
|
- if(accountIdsList.size()==0 || accountIdsList == null){
|
|
|
|
- accountIdsList.add(-1L);
|
|
|
|
- }
|
|
|
|
- PageHelper.startPage(pageNo,pageSize);
|
|
|
|
|
|
+ if (accountIdsList != null && accountIdsList.size() != 0){
|
|
|
|
+ PageHelper.startPage(pageNo,pageSize,sort);
|
|
mList = byteDanceVideoReportDailyMapper.videoInfoListGroupOperator(startDate,endDate,accountIdsList,signature,cost);
|
|
mList = byteDanceVideoReportDailyMapper.videoInfoListGroupOperator(startDate,endDate,accountIdsList,signature,cost);
|
|
}else{
|
|
}else{
|
|
List<Long> accoutnIds= byteDanceVideoReportDailyMapper.getAccountIdsByOperatorIdAndMediaId(1,userId);
|
|
List<Long> accoutnIds= byteDanceVideoReportDailyMapper.getAccountIdsByOperatorIdAndMediaId(1,userId);
|
|
- PageHelper.startPage(pageNo,pageSize);
|
|
|
|
|
|
+ PageHelper.startPage(pageNo,pageSize,sort);
|
|
mList = byteDanceVideoReportDailyMapper.videoInfoListGroupOperator(startDate,endDate,accoutnIds,signature,cost);
|
|
mList = byteDanceVideoReportDailyMapper.videoInfoListGroupOperator(startDate,endDate,accoutnIds,signature,cost);
|
|
}
|
|
}
|
|
}else if(roleCode.equals("shot")){
|
|
}else if(roleCode.equals("shot")){
|
|
- //设计师传入projectIds,根据projectIds解析出accountIdsList
|
|
|
|
- if (projectIds != null && projectIds.length != 0){
|
|
|
|
- List<Long> projectIdsList = Arrays.asList(projectIds);
|
|
|
|
- List<Long> accountIdsList = byteDanceVideoReportDailyMapper.getAccountIdByprojectIds(projectIdsList);
|
|
|
|
- if(accountIdsList.size() != 0){
|
|
|
|
- if(accountIdsList.size()==0 || accountIdsList == null){
|
|
|
|
- accountIdsList.add(-1L);
|
|
|
|
- }
|
|
|
|
- PageHelper.startPage(pageNo,pageSize);
|
|
|
|
- mList = byteDanceVideoReportDailyMapper.videoInfoListGroupShot(startDate, endDate, companyId, userId, accountIdsList, signature, cost);
|
|
|
|
- }
|
|
|
|
- }else{
|
|
|
|
- PageHelper.startPage(pageNo,pageSize);
|
|
|
|
- mList = byteDanceVideoReportDailyMapper.videoInfoListGroupShot(startDate, endDate, companyId, userId, null, signature, cost);
|
|
|
|
- }
|
|
|
|
|
|
+ PageHelper.startPage(pageNo,pageSize,sort);
|
|
|
|
+ mList = byteDanceVideoReportDailyMapper.videoInfoListGroupShot(startDate, endDate, companyId, userId, accountIdsList, signature, cost);
|
|
}else if(roleCode.equals("plan")){
|
|
}else if(roleCode.equals("plan")){
|
|
- if (projectIds != null && projectIds.length != 0){
|
|
|
|
- List<Long> projectIdsList = Arrays.asList(projectIds);
|
|
|
|
- List<Long> accountIdsList = byteDanceVideoReportDailyMapper.getAccountIdByprojectIds(projectIdsList);
|
|
|
|
- if(accountIdsList.size()==0 || accountIdsList == null){
|
|
|
|
- accountIdsList.add(-1L);
|
|
|
|
- }
|
|
|
|
- if(accountIdsList.size() != 0){
|
|
|
|
- PageHelper.startPage(pageNo,pageSize);
|
|
|
|
- mList = byteDanceVideoReportDailyMapper.videoInfoListGroupPlan(startDate, endDate, companyId, userId, accountIdsList, signature, cost);
|
|
|
|
- }
|
|
|
|
- }else{
|
|
|
|
- PageHelper.startPage(pageNo,pageSize);
|
|
|
|
- mList = byteDanceVideoReportDailyMapper.videoInfoListGroupPlan(startDate, endDate, companyId, userId, null, signature, cost);
|
|
|
|
- }
|
|
|
|
|
|
+ PageHelper.startPage(pageNo,pageSize,sort);
|
|
|
|
+ mList = byteDanceVideoReportDailyMapper.videoInfoListGroupPlan(startDate, endDate, companyId, userId, accountIdsList, signature, cost);
|
|
}else if(roleCode.equals("plane")){
|
|
}else if(roleCode.equals("plane")){
|
|
- if (projectIds != null && projectIds.length != 0){
|
|
|
|
- List<Long> projectIdsList = Arrays.asList(projectIds);
|
|
|
|
- List<Long> accountIdsList = byteDanceVideoReportDailyMapper.getAccountIdByprojectIds(projectIdsList);
|
|
|
|
- if(accountIdsList.size()==0 || accountIdsList == null){
|
|
|
|
- accountIdsList.add(-1L);
|
|
|
|
- }
|
|
|
|
- if(accountIdsList.size() != 0){
|
|
|
|
- PageHelper.startPage(pageNo,pageSize);
|
|
|
|
- mList = byteDanceVideoReportDailyMapper.videoInfoListGroupPlaneAndPlaneLeader(startDate, endDate, companyId, userId, accountIdsList, signature, cost);
|
|
|
|
- }
|
|
|
|
- }else{
|
|
|
|
- PageHelper.startPage(pageNo,pageSize);
|
|
|
|
- mList = byteDanceVideoReportDailyMapper.videoInfoListGroupPlaneAndPlaneLeader(startDate, endDate, companyId, userId, null, signature, cost);
|
|
|
|
- }
|
|
|
|
|
|
+ PageHelper.startPage(pageNo,pageSize,sort);
|
|
|
|
+ mList = byteDanceVideoReportDailyMapper.videoInfoListGroupPlaneAndPlaneLeader(startDate, endDate, companyId, userId, accountIdsList, signature, cost);
|
|
}else if(roleCode.equals("clip")){
|
|
}else if(roleCode.equals("clip")){
|
|
- if (projectIds != null && projectIds.length != 0){
|
|
|
|
- List<Long> projectIdsList = Arrays.asList(projectIds);
|
|
|
|
- List<Long> accountIdsList = byteDanceVideoReportDailyMapper.getAccountIdByprojectIds(projectIdsList);
|
|
|
|
- if(accountIdsList.size()==0 || accountIdsList == null){
|
|
|
|
- accountIdsList.add(-1L);
|
|
|
|
- }
|
|
|
|
- if(accountIdsList.size() != 0){
|
|
|
|
- PageHelper.startPage(pageNo,pageSize);
|
|
|
|
- mList = byteDanceVideoReportDailyMapper.videoInfoListGroupClip(startDate, endDate, companyId, userId, accountIdsList, signature, cost);
|
|
|
|
- }
|
|
|
|
- }else{
|
|
|
|
- PageHelper.startPage(pageNo,pageSize);
|
|
|
|
- mList = byteDanceVideoReportDailyMapper.videoInfoListGroupClip(startDate, endDate, companyId, userId, null, signature, cost);
|
|
|
|
- }
|
|
|
|
|
|
+ PageHelper.startPage(pageNo,pageSize,sort);
|
|
|
|
+ mList = byteDanceVideoReportDailyMapper.videoInfoListGroupClip(startDate, endDate, companyId, userId, accountIdsList, signature, cost);
|
|
}else if(roleCode.equals("designTeamLeader")){
|
|
}else if(roleCode.equals("designTeamLeader")){
|
|
- if (projectIds != null && projectIds.length != 0){
|
|
|
|
- List<Long> projectIdsList = Arrays.asList(projectIds);
|
|
|
|
- List<Long> accountIdsList = byteDanceVideoReportDailyMapper.getAccountIdByprojectIds(projectIdsList);
|
|
|
|
- if(accountIdsList.size()==0 || accountIdsList == null){
|
|
|
|
- accountIdsList.add(-1L);
|
|
|
|
- }
|
|
|
|
- if(accountIdsList.size() != 0){
|
|
|
|
- PageHelper.startPage(pageNo,pageSize);
|
|
|
|
- mList = byteDanceVideoReportDailyMapper.videoInfoListGroupdesignTeamLeader(startDate, endDate, companyId, accountIdsList, signature, cost);
|
|
|
|
- }
|
|
|
|
- }else{
|
|
|
|
- PageHelper.startPage(pageNo,pageSize);
|
|
|
|
- mList = byteDanceVideoReportDailyMapper.videoInfoListGroupdesignTeamLeader(startDate, endDate, companyId, null, signature, cost);
|
|
|
|
|
|
+ PageHelper.startPage(pageNo,pageSize,sort);
|
|
|
|
+ mList = byteDanceVideoReportDailyMapper.videoInfoListGroupdesignTeamLeader(startDate, endDate, companyId, accountIdsList, signature, cost);
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ //计算环比
|
|
|
|
+ for(ByteDanceVideoReportDaily m:mList){
|
|
|
|
+ Integer datediff = DateUtils.dateDiff(startDate, endDate);
|
|
|
|
+ String startMonthDate = DateUtils.formatDate(DateUtils.addDay(startDate,-(datediff + 1) ) );
|
|
|
|
+ String endMonthDate = DateUtils.formatDate(DateUtils.addDay(startDate,-1));
|
|
|
|
+
|
|
|
|
+ BigDecimal costBefore = byteDanceVideoReportDailyMapper.getVideoReportDailyByDateAndSignature(startMonthDate,endMonthDate,m.getSignature(),accountIdsList);
|
|
|
|
+
|
|
|
|
+ BigDecimal huanbi =BigDecimal.ZERO;
|
|
|
|
+ if(costBefore != null && costBefore.compareTo(BigDecimal.ZERO)>0){
|
|
|
|
+ huanbi = m.getCost().subtract(costBefore).divide(costBefore,7, BigDecimal.ROUND_HALF_UP);
|
|
}
|
|
}
|
|
|
|
+
|
|
|
|
+ m.setHuanbi(huanbi);
|
|
}
|
|
}
|
|
|
|
|
|
PageInfo<ByteDanceVideoReportDaily> pageInfo = new PageInfo<>(mList);
|
|
PageInfo<ByteDanceVideoReportDaily> pageInfo = new PageInfo<>(mList);
|
|
@@ -449,139 +279,125 @@ public class ByteDanceVideoReportDailyServiceImpl extends ServiceImpl<ByteDanceV
|
|
}
|
|
}
|
|
|
|
|
|
//视频总报表列表导出excel
|
|
//视频总报表列表导出excel
|
|
- public List<ByteDanceVideoReportDaily> videoInfoListTotalExcel(String startDate, String endDate, String signature, BigDecimal cost){
|
|
|
|
|
|
+ public List<ByteDanceVideoReportDaily> videoInfoListTotalExcel(String startDate, String endDate, String signature, BigDecimal cost , Long[] accountIds, String sort){
|
|
|
|
+ //LoginUser sysUser = (LoginUser) SecurityUtils.getSubject().getPrincipal();
|
|
|
|
+ //String userId = sysUser.getId();
|
|
|
|
+ //String roleCode = byteDanceVideoReportDailyMapper.getRoleCodeByUserId(userId);
|
|
|
|
+ //String companyId = byteDanceVideoReportDailyMapper.getCompanyIdByUserId(userId);
|
|
|
|
+ //
|
|
|
|
+ //List<ByteDanceVideoReportDaily> mList = byteDanceVideoReportDailyMapper.videoInfoListWeek(startDate, endDate, roleCode, userId, signature, companyId, cost);
|
|
|
|
+
|
|
LoginUser sysUser = (LoginUser) SecurityUtils.getSubject().getPrincipal();
|
|
LoginUser sysUser = (LoginUser) SecurityUtils.getSubject().getPrincipal();
|
|
String userId = sysUser.getId();
|
|
String userId = sysUser.getId();
|
|
String roleCode = byteDanceVideoReportDailyMapper.getRoleCodeByUserId(userId);
|
|
String roleCode = byteDanceVideoReportDailyMapper.getRoleCodeByUserId(userId);
|
|
String companyId = byteDanceVideoReportDailyMapper.getCompanyIdByUserId(userId);
|
|
String companyId = byteDanceVideoReportDailyMapper.getCompanyIdByUserId(userId);
|
|
|
|
|
|
- List<ByteDanceVideoReportDaily> mList = byteDanceVideoReportDailyMapper.videoInfoListWeek(startDate, endDate, roleCode, userId, signature, companyId, cost);
|
|
|
|
|
|
+ if(StringUtils.isBlank(sort)){
|
|
|
|
+ sort = "cost-";
|
|
|
|
+ }
|
|
|
|
+ sort = sort.replace("-", " desc,").replace("+", " asc,"); //sort=id-name+age+
|
|
|
|
+ sort = sort.substring(0, sort.length() - 1);
|
|
|
|
+ List<ByteDanceVideoReportDaily> mList = new ArrayList<>();
|
|
|
|
+
|
|
|
|
+ List<Long> accountIdsList = null;
|
|
|
|
+ if(accountIds != null && accountIds.length != 0){
|
|
|
|
+ accountIdsList = Arrays.asList(accountIds);
|
|
|
|
+ }
|
|
|
|
+ //admin能看所有视频
|
|
|
|
+ if(roleCode.equals("admin")){
|
|
|
|
+ mList = byteDanceVideoReportDailyMapper.videoInfoListGroupAdmin(startDate, endDate, accountIdsList, signature, cost);
|
|
|
|
+ }else if(roleCode.equals("touTiaoOperationManager") || roleCode.equals("operator") || roleCode.equals("operationAssistant")) {
|
|
|
|
+ if (accountIdsList != null && accountIdsList.size() != 0){
|
|
|
|
+ mList = byteDanceVideoReportDailyMapper.videoInfoListGroupOperator(startDate,endDate,accountIdsList,signature,cost);
|
|
|
|
+ }else{
|
|
|
|
+ List<Long> accoutnIds= byteDanceVideoReportDailyMapper.getAccountIdsByOperatorIdAndMediaId(1,userId);
|
|
|
|
+ mList = byteDanceVideoReportDailyMapper.videoInfoListGroupOperator(startDate,endDate,accoutnIds,signature,cost);
|
|
|
|
+ }
|
|
|
|
+ }else if(roleCode.equals("shot")){
|
|
|
|
+ mList = byteDanceVideoReportDailyMapper.videoInfoListGroupShot(startDate, endDate, companyId, userId, accountIdsList, signature, cost);
|
|
|
|
+ }else if(roleCode.equals("plan")){
|
|
|
|
+ mList = byteDanceVideoReportDailyMapper.videoInfoListGroupPlan(startDate, endDate, companyId, userId, accountIdsList, signature, cost);
|
|
|
|
+ }else if(roleCode.equals("plane")){
|
|
|
|
+ mList = byteDanceVideoReportDailyMapper.videoInfoListGroupPlaneAndPlaneLeader(startDate, endDate, companyId, userId, accountIdsList, signature, cost);
|
|
|
|
+ }else if(roleCode.equals("clip")){
|
|
|
|
+ mList = byteDanceVideoReportDailyMapper.videoInfoListGroupClip(startDate, endDate, companyId, userId, accountIdsList, signature, cost);
|
|
|
|
+ }else if(roleCode.equals("designTeamLeader")){
|
|
|
|
+ mList = byteDanceVideoReportDailyMapper.videoInfoListGroupdesignTeamLeader(startDate, endDate, companyId, accountIdsList, signature, cost);
|
|
|
|
+ }
|
|
|
|
|
|
|
|
+ //计算环比
|
|
|
|
+ //for(ByteDanceVideoReportDaily m:mList){
|
|
|
|
+ // Integer datediff = DateUtils.dateDiff(startDate, endDate);
|
|
|
|
+ // String startMonthDate = DateUtils.formatDate(DateUtils.addDay(startDate,-(datediff + 1) ) );
|
|
|
|
+ // String endMonthDate = DateUtils.formatDate(DateUtils.addDay(startDate,-1));
|
|
|
|
+ //
|
|
|
|
+ // BigDecimal costBefore = byteDanceVideoReportDailyMapper.getVideoReportDailyByDateAndSignature(startMonthDate,endMonthDate,m.getSignature(),accountIdsList);
|
|
|
|
+ //
|
|
|
|
+ // BigDecimal huanbi =BigDecimal.ZERO;
|
|
|
|
+ // if(costBefore != null && costBefore.compareTo(BigDecimal.ZERO)>0){
|
|
|
|
+ // huanbi = m.getCost().subtract(costBefore).divide(costBefore,7, BigDecimal.ROUND_HALF_UP);
|
|
|
|
+ // }
|
|
|
|
+ //
|
|
|
|
+ // m.setHuanbi(huanbi);
|
|
|
|
+ //}
|
|
return mList;
|
|
return mList;
|
|
}
|
|
}
|
|
|
|
|
|
//视频报表周列表
|
|
//视频报表周列表
|
|
- public PageInfo<ByteDanceVideoReportDaily> videoInfoListWeek(String startDate, String endDate, String signature, BigDecimal cost, Integer pageNo, Integer pageSize, Long[] projectIds, Long[] accountIds){
|
|
|
|
|
|
+ public PageInfo<ByteDanceVideoReportDaily> videoInfoListWeek(String startDate, String endDate, String signature, BigDecimal cost, Integer pageNo, Integer pageSize, Long[] projectIds, Long[] accountIds, String sort){
|
|
LoginUser sysUser = (LoginUser) SecurityUtils.getSubject().getPrincipal();
|
|
LoginUser sysUser = (LoginUser) SecurityUtils.getSubject().getPrincipal();
|
|
String userId = sysUser.getId();
|
|
String userId = sysUser.getId();
|
|
String roleCode = byteDanceVideoReportDailyMapper.getRoleCodeByUserId(userId);
|
|
String roleCode = byteDanceVideoReportDailyMapper.getRoleCodeByUserId(userId);
|
|
String companyId = byteDanceVideoReportDailyMapper.getCompanyIdByUserId(userId);
|
|
String companyId = byteDanceVideoReportDailyMapper.getCompanyIdByUserId(userId);
|
|
|
|
|
|
|
|
+ if(StringUtils.isBlank(sort)){
|
|
|
|
+ sort = "cost-";
|
|
|
|
+ }
|
|
|
|
+ sort = sort.replace("-", " desc,").replace("+", " asc,"); //sort=id-name+age+
|
|
|
|
+ sort = sort.substring(0, sort.length() - 1);
|
|
List<ByteDanceVideoReportDaily> mList = new ArrayList<>();
|
|
List<ByteDanceVideoReportDaily> mList = new ArrayList<>();
|
|
- //PageHelper.startPage(pageNo,pageSize);
|
|
|
|
- //mList = byteDanceVideoReportDailyMapper.videoInfoListWeek(startDate, endDate, roleCode, userId, signature, companyId, cost);
|
|
|
|
|
|
|
|
|
|
+ List<Long> accountIdsList = null;
|
|
|
|
+ if(accountIds != null && accountIds.length != 0){
|
|
|
|
+ accountIdsList = Arrays.asList(accountIds);
|
|
|
|
+ }
|
|
//admin能看所有视频
|
|
//admin能看所有视频
|
|
if(roleCode.equals("admin")){
|
|
if(roleCode.equals("admin")){
|
|
- if (projectIds != null && projectIds.length != 0){
|
|
|
|
- List<Long> projectIdsList = Arrays.asList(projectIds);
|
|
|
|
- List<Long> accountIdsList = byteDanceVideoReportDailyMapper.getAccountIdByprojectIds(projectIdsList);
|
|
|
|
- if(accountIdsList.size()==0 || accountIdsList == null){
|
|
|
|
- accountIdsList.add(-1L);
|
|
|
|
- }
|
|
|
|
- PageHelper.startPage(pageNo,pageSize);
|
|
|
|
- mList = byteDanceVideoReportDailyMapper.videoInfoListGroupAdmin(startDate, endDate, accountIdsList, signature, cost);
|
|
|
|
- }else{
|
|
|
|
- PageHelper.startPage(pageNo,pageSize);
|
|
|
|
- mList = byteDanceVideoReportDailyMapper.videoInfoListGroupAdmin(startDate, endDate, null, signature, cost);
|
|
|
|
- }
|
|
|
|
|
|
+ PageHelper.startPage(pageNo,pageSize,sort);
|
|
|
|
+ mList = byteDanceVideoReportDailyMapper.videoInfoListGroupAdmin(startDate, endDate, accountIdsList, signature, cost);
|
|
}else if(roleCode.equals("touTiaoOperationManager") || roleCode.equals("operator") || roleCode.equals("operationAssistant")) {
|
|
}else if(roleCode.equals("touTiaoOperationManager") || roleCode.equals("operator") || roleCode.equals("operationAssistant")) {
|
|
- if (projectIds != null && projectIds.length != 0){
|
|
|
|
- List<Long> projectIdsList = Arrays.asList(projectIds);
|
|
|
|
- List<Long> accountIdsList = byteDanceVideoReportDailyMapper.getAccountIdByprojectIds(projectIdsList);
|
|
|
|
- if(accountIdsList.size()==0 || accountIdsList == null){
|
|
|
|
- accountIdsList.add(-1L);
|
|
|
|
- }
|
|
|
|
- PageHelper.startPage(pageNo,pageSize);
|
|
|
|
|
|
+ if (accountIdsList != null && accountIdsList.size() != 0){
|
|
|
|
+ PageHelper.startPage(pageNo,pageSize,sort);
|
|
mList = byteDanceVideoReportDailyMapper.videoInfoListGroupOperator(startDate,endDate,accountIdsList,signature,cost);
|
|
mList = byteDanceVideoReportDailyMapper.videoInfoListGroupOperator(startDate,endDate,accountIdsList,signature,cost);
|
|
}else{
|
|
}else{
|
|
List<Long> accoutnIds= byteDanceVideoReportDailyMapper.getAccountIdsByOperatorIdAndMediaId(1,userId);
|
|
List<Long> accoutnIds= byteDanceVideoReportDailyMapper.getAccountIdsByOperatorIdAndMediaId(1,userId);
|
|
- PageHelper.startPage(pageNo,pageSize);
|
|
|
|
|
|
+ PageHelper.startPage(pageNo,pageSize,sort);
|
|
mList = byteDanceVideoReportDailyMapper.videoInfoListGroupOperator(startDate,endDate,accoutnIds,signature,cost);
|
|
mList = byteDanceVideoReportDailyMapper.videoInfoListGroupOperator(startDate,endDate,accoutnIds,signature,cost);
|
|
}
|
|
}
|
|
}else if(roleCode.equals("shot")){
|
|
}else if(roleCode.equals("shot")){
|
|
- //设计师传入projectIds,根据projectIds解析出accountIdsList
|
|
|
|
- if (projectIds != null && projectIds.length != 0){
|
|
|
|
- List<Long> projectIdsList = Arrays.asList(projectIds);
|
|
|
|
- List<Long> accountIdsList = byteDanceVideoReportDailyMapper.getAccountIdByprojectIds(projectIdsList);
|
|
|
|
- if(accountIdsList.size() != 0){
|
|
|
|
- if(accountIdsList.size()==0 || accountIdsList == null){
|
|
|
|
- accountIdsList.add(-1L);
|
|
|
|
- }
|
|
|
|
- PageHelper.startPage(pageNo,pageSize);
|
|
|
|
- mList = byteDanceVideoReportDailyMapper.videoInfoListGroupShot(startDate, endDate, companyId, userId, accountIdsList, signature, cost);
|
|
|
|
- }
|
|
|
|
- }else{
|
|
|
|
- PageHelper.startPage(pageNo,pageSize);
|
|
|
|
- mList = byteDanceVideoReportDailyMapper.videoInfoListGroupShot(startDate, endDate, companyId, userId, null, signature, cost);
|
|
|
|
- }
|
|
|
|
|
|
+ PageHelper.startPage(pageNo,pageSize,sort);
|
|
|
|
+ mList = byteDanceVideoReportDailyMapper.videoInfoListGroupShot(startDate, endDate, companyId, userId, accountIdsList, signature, cost);
|
|
}else if(roleCode.equals("plan")){
|
|
}else if(roleCode.equals("plan")){
|
|
- if (projectIds != null && projectIds.length != 0){
|
|
|
|
- List<Long> projectIdsList = Arrays.asList(projectIds);
|
|
|
|
- List<Long> accountIdsList = byteDanceVideoReportDailyMapper.getAccountIdByprojectIds(projectIdsList);
|
|
|
|
- if(accountIdsList.size()==0 || accountIdsList == null){
|
|
|
|
- accountIdsList.add(-1L);
|
|
|
|
- }
|
|
|
|
- if(accountIdsList.size() != 0){
|
|
|
|
- PageHelper.startPage(pageNo,pageSize);
|
|
|
|
- mList = byteDanceVideoReportDailyMapper.videoInfoListGroupPlan(startDate, endDate, companyId, userId, accountIdsList, signature, cost);
|
|
|
|
- }
|
|
|
|
- }else{
|
|
|
|
- PageHelper.startPage(pageNo,pageSize);
|
|
|
|
- mList = byteDanceVideoReportDailyMapper.videoInfoListGroupPlan(startDate, endDate, companyId, userId, null, signature, cost);
|
|
|
|
- }
|
|
|
|
|
|
+ PageHelper.startPage(pageNo,pageSize,sort);
|
|
|
|
+ mList = byteDanceVideoReportDailyMapper.videoInfoListGroupPlan(startDate, endDate, companyId, userId, accountIdsList, signature, cost);
|
|
}else if(roleCode.equals("plane")){
|
|
}else if(roleCode.equals("plane")){
|
|
- if (projectIds != null && projectIds.length != 0){
|
|
|
|
- List<Long> projectIdsList = Arrays.asList(projectIds);
|
|
|
|
- List<Long> accountIdsList = byteDanceVideoReportDailyMapper.getAccountIdByprojectIds(projectIdsList);
|
|
|
|
- if(accountIdsList.size()==0 || accountIdsList == null){
|
|
|
|
- accountIdsList.add(-1L);
|
|
|
|
- }
|
|
|
|
- if(accountIdsList.size() != 0){
|
|
|
|
- PageHelper.startPage(pageNo,pageSize);
|
|
|
|
- mList = byteDanceVideoReportDailyMapper.videoInfoListGroupPlaneAndPlaneLeader(startDate, endDate, companyId, userId, accountIdsList, signature, cost);
|
|
|
|
- }
|
|
|
|
- }else{
|
|
|
|
- PageHelper.startPage(pageNo,pageSize);
|
|
|
|
- mList = byteDanceVideoReportDailyMapper.videoInfoListGroupPlaneAndPlaneLeader(startDate, endDate, companyId, userId, null, signature, cost);
|
|
|
|
- }
|
|
|
|
|
|
+ PageHelper.startPage(pageNo,pageSize,sort);
|
|
|
|
+ mList = byteDanceVideoReportDailyMapper.videoInfoListGroupPlaneAndPlaneLeader(startDate, endDate, companyId, userId, accountIdsList, signature, cost);
|
|
}else if(roleCode.equals("clip")){
|
|
}else if(roleCode.equals("clip")){
|
|
- if (projectIds != null && projectIds.length != 0){
|
|
|
|
- List<Long> projectIdsList = Arrays.asList(projectIds);
|
|
|
|
- List<Long> accountIdsList = byteDanceVideoReportDailyMapper.getAccountIdByprojectIds(projectIdsList);
|
|
|
|
- if(accountIdsList.size()==0 || accountIdsList == null){
|
|
|
|
- accountIdsList.add(-1L);
|
|
|
|
- }
|
|
|
|
- if(accountIdsList.size() != 0){
|
|
|
|
- PageHelper.startPage(pageNo,pageSize);
|
|
|
|
- mList = byteDanceVideoReportDailyMapper.videoInfoListGroupClip(startDate, endDate, companyId, userId, accountIdsList, signature, cost);
|
|
|
|
- }
|
|
|
|
- }else{
|
|
|
|
- PageHelper.startPage(pageNo,pageSize);
|
|
|
|
- mList = byteDanceVideoReportDailyMapper.videoInfoListGroupClip(startDate, endDate, companyId, userId, null, signature, cost);
|
|
|
|
- }
|
|
|
|
|
|
+ PageHelper.startPage(pageNo,pageSize,sort);
|
|
|
|
+ mList = byteDanceVideoReportDailyMapper.videoInfoListGroupClip(startDate, endDate, companyId, userId, accountIdsList, signature, cost);
|
|
}else if(roleCode.equals("designTeamLeader")){
|
|
}else if(roleCode.equals("designTeamLeader")){
|
|
- if (projectIds != null && projectIds.length != 0){
|
|
|
|
- List<Long> projectIdsList = Arrays.asList(projectIds);
|
|
|
|
- List<Long> accountIdsList = byteDanceVideoReportDailyMapper.getAccountIdByprojectIds(projectIdsList);
|
|
|
|
- if(accountIdsList.size()==0 || accountIdsList == null){
|
|
|
|
- accountIdsList.add(-1L);
|
|
|
|
- }
|
|
|
|
- if(accountIdsList.size() != 0){
|
|
|
|
- PageHelper.startPage(pageNo,pageSize);
|
|
|
|
- mList = byteDanceVideoReportDailyMapper.videoInfoListGroupdesignTeamLeader(startDate, endDate, companyId, accountIdsList, signature, cost);
|
|
|
|
- }
|
|
|
|
- }else{
|
|
|
|
- PageHelper.startPage(pageNo,pageSize);
|
|
|
|
- mList = byteDanceVideoReportDailyMapper.videoInfoListGroupdesignTeamLeader(startDate, endDate, companyId, null, signature, cost);
|
|
|
|
- }
|
|
|
|
|
|
+ PageHelper.startPage(pageNo,pageSize,sort);
|
|
|
|
+ mList = byteDanceVideoReportDailyMapper.videoInfoListGroupdesignTeamLeader(startDate, endDate, companyId, accountIdsList, signature, cost);
|
|
}
|
|
}
|
|
|
|
|
|
//计算环比
|
|
//计算环比
|
|
for(ByteDanceVideoReportDaily m:mList){
|
|
for(ByteDanceVideoReportDaily m:mList){
|
|
- String startWeekDate = DateUtils.formatDate(DateUtils.addDay(DateUtils.getDate(startDate),-1));
|
|
|
|
- String endWeekDate = DateUtils.formatDate(DateUtils.addDay(startDate,-7));
|
|
|
|
- BigDecimal costBefore = byteDanceVideoReportDailyMapper.getVideoReportDailyByDateAndSignature(startWeekDate,endWeekDate,m.getSignature(),companyId);
|
|
|
|
|
|
+ Integer datediff = DateUtils.dateDiff(startDate, endDate);
|
|
|
|
+ String startMonthDate = DateUtils.formatDate(DateUtils.addDay(startDate,-(datediff + 1) ) );
|
|
|
|
+ String endMonthDate = DateUtils.formatDate(DateUtils.addDay(startDate,-1));
|
|
|
|
+
|
|
|
|
+ BigDecimal costBefore = byteDanceVideoReportDailyMapper.getVideoReportDailyByDateAndSignature(startMonthDate,endMonthDate,m.getSignature(),accountIdsList);
|
|
|
|
|
|
BigDecimal huanbi =BigDecimal.ZERO;
|
|
BigDecimal huanbi =BigDecimal.ZERO;
|
|
if(costBefore != null && costBefore.compareTo(BigDecimal.ZERO)>0){
|
|
if(costBefore != null && costBefore.compareTo(BigDecimal.ZERO)>0){
|
|
@@ -596,13 +412,64 @@ public class ByteDanceVideoReportDailyServiceImpl extends ServiceImpl<ByteDanceV
|
|
return pageInfo;
|
|
return pageInfo;
|
|
}
|
|
}
|
|
|
|
|
|
- public List<ByteDanceVideoReportDaily> videoInfoListDetail(String startDate, String endDate, String signature){
|
|
|
|
|
|
+ public List<ByteDanceVideoReportDaily> videoInfoListDetail(String startDate, String endDate, String signature, Long[] accountIds){
|
|
LoginUser sysUser = (LoginUser) SecurityUtils.getSubject().getPrincipal();
|
|
LoginUser sysUser = (LoginUser) SecurityUtils.getSubject().getPrincipal();
|
|
String userId = sysUser.getId();
|
|
String userId = sysUser.getId();
|
|
String roleCode = byteDanceVideoReportDailyMapper.getRoleCodeByUserId(userId);
|
|
String roleCode = byteDanceVideoReportDailyMapper.getRoleCodeByUserId(userId);
|
|
String companyId = byteDanceVideoReportDailyMapper.getCompanyIdByUserId(userId);
|
|
String companyId = byteDanceVideoReportDailyMapper.getCompanyIdByUserId(userId);
|
|
|
|
|
|
- return byteDanceVideoReportDailyMapper.videoInfoListDetail(companyId, startDate, endDate, signature, roleCode);
|
|
|
|
|
|
+ //List<ByteDanceVideoReportDaily> mList = byteDanceVideoReportDailyMapper.videoInfoListDetail(companyId, startDate, endDate, signature, roleCode);
|
|
|
|
+ List<ByteDanceVideoReportDaily> mList =new ArrayList<>();
|
|
|
|
+
|
|
|
|
+ List<Long> accountIdsList = null;
|
|
|
|
+ if(accountIds != null && accountIds.length != 0){
|
|
|
|
+ accountIdsList = Arrays.asList(accountIds);
|
|
|
|
+ }
|
|
|
|
+ //admin能看所有视频
|
|
|
|
+ if(roleCode.equals("admin")){
|
|
|
|
+ mList = byteDanceVideoReportDailyMapper.videoInfoListDetail(companyId, startDate, endDate, signature, accountIdsList);
|
|
|
|
+ }else if(roleCode.equals("touTiaoOperationManager") || roleCode.equals("operator") || roleCode.equals("operationAssistant")) {
|
|
|
|
+ if (accountIdsList != null && accountIdsList.size() != 0){
|
|
|
|
+ mList = byteDanceVideoReportDailyMapper.videoInfoListDetailOperator(companyId, startDate,endDate,signature, accountIdsList);
|
|
|
|
+ }else{
|
|
|
|
+ accountIdsList= byteDanceVideoReportDailyMapper.getAccountIdsByOperatorIdAndMediaId(1,userId);
|
|
|
|
+ mList = byteDanceVideoReportDailyMapper.videoInfoListDetailOperator(companyId, startDate,endDate,signature, accountIdsList);
|
|
|
|
+ }
|
|
|
|
+ }else if(roleCode.equals("shot")){
|
|
|
|
+ accountIdsList = byteDanceVideoReportDailyMapper.getAccountIds(companyId, signature);
|
|
|
|
+ mList = byteDanceVideoReportDailyMapper.videoInfoListDetailDesign(companyId, startDate,endDate,signature, accountIdsList);
|
|
|
|
+ }else if(roleCode.equals("plan")){
|
|
|
|
+ accountIdsList = byteDanceVideoReportDailyMapper.getAccountIds(companyId, signature);
|
|
|
|
+ mList = byteDanceVideoReportDailyMapper.videoInfoListDetailDesign(companyId, startDate,endDate,signature, accountIdsList);
|
|
|
|
+ }else if(roleCode.equals("plane")){
|
|
|
|
+ accountIdsList = byteDanceVideoReportDailyMapper.getAccountIds(companyId, signature);
|
|
|
|
+ mList = byteDanceVideoReportDailyMapper.videoInfoListDetailDesign(companyId, startDate,endDate,signature, accountIdsList);
|
|
|
|
+ }else if(roleCode.equals("clip")){
|
|
|
|
+ accountIdsList = byteDanceVideoReportDailyMapper.getAccountIds(companyId, signature);
|
|
|
|
+ mList = byteDanceVideoReportDailyMapper.videoInfoListDetailDesign(companyId, startDate,endDate,signature, accountIdsList);
|
|
|
|
+ }else if(roleCode.equals("designTeamLeader")){
|
|
|
|
+ accountIdsList = byteDanceVideoReportDailyMapper.getAccountIds(companyId, signature);
|
|
|
|
+ mList = byteDanceVideoReportDailyMapper.videoInfoListDetailDesign(companyId, startDate,endDate,signature, accountIdsList);
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ //计算环比
|
|
|
|
+ for(ByteDanceVideoReportDaily m:mList){
|
|
|
|
+ //Integer datediff = DateUtils.dateDiff(startDate, endDate);
|
|
|
|
+ //String startMonthDate = DateUtils.formatDate(DateUtils.addDay(startDate,-(datediff + 1) ) );
|
|
|
|
+ String beforeDate = DateUtils.formatDate(DateUtils.addDay(m.getStatDatetime(),-1));
|
|
|
|
+ //List<Long> accountIdsList = new ArrayList<>();
|
|
|
|
+ //accountIdsList.add(m.getAccountId());
|
|
|
|
+ BigDecimal costBefore = byteDanceVideoReportDailyMapper.getVideoReportDailyByDateAndSignature(beforeDate,beforeDate,m.getSignature(),accountIdsList);
|
|
|
|
+
|
|
|
|
+ BigDecimal huanbi =BigDecimal.ZERO;
|
|
|
|
+ if(costBefore != null && costBefore.compareTo(BigDecimal.ZERO)>0){
|
|
|
|
+ huanbi = m.getCost().subtract(costBefore).divide(costBefore,7, BigDecimal.ROUND_HALF_UP);
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ m.setHuanbi(huanbi);
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ return mList;
|
|
}
|
|
}
|
|
|
|
|
|
public String getColumnJson(Integer columnType){
|
|
public String getColumnJson(Integer columnType){
|