| | |
| | | import java.math.BigDecimal; |
| | | import java.text.ParseException; |
| | | import java.text.SimpleDateFormat; |
| | | import java.time.LocalDate; |
| | | import java.time.LocalDateTime; |
| | | import java.time.format.DateTimeFormatter; |
| | | import java.util.*; |
| | | |
| | | @RequestMapping("/dataReporting") |
| | |
| | | } |
| | | list.add(reporting); |
| | | } |
| | | deleteAllData(format); |
| | | dataReportingService.addDataReporting(list, format, param); |
| | | return Result.success(); |
| | | } |
| | |
| | | } catch (ParseException e) { |
| | | throw new ErrorException("文件中日期在转换时出现错误"); |
| | | } |
| | | deleteAllFans(LocalDate.parse(format).plusDays(1).format(DateTimeFormatter.ofPattern("yyyy-MM-dd"))); |
| | | for (int i = 6; i < rows.size(); i++) { |
| | | FansSubmit fansSubmit = new FansSubmit(); |
| | | for (int i1 = 0; i1 < rows.get(5).size(); i1++) { |
| | |
| | | } catch (ParseException e) { |
| | | throw new ErrorException("文件中日期在转换时出现错误"); |
| | | } |
| | | deleteAllFinance(LocalDate.parse(format).plusDays(1).format(DateTimeFormatter.ofPattern("yyyy-MM-dd"))); |
| | | for (int i = 6; i < rows.size(); i++) { |
| | | FinanceSubmit financeSubmit = new FinanceSubmit(); |
| | | for (int i1 = 0; i1 < rows.get(5).size(); i1++) { |
| | |
| | | List<DataReporting> list = JSON.parseArray(str, DataReporting.class); |
| | | return Result.success(dataReportingService.updateVxCards(list)); |
| | | } |
| | | |
| | | @ApiOperation(value = "一键删除所有进粉上报的数据") |
| | | @PostMapping("/deleteAllFans") |
| | | public Result deleteAllFans(String date) { |
| | | fansSubmitService.deleteAllFans(date); |
| | | return Result.success(); |
| | | } |
| | | |
| | | @ApiOperation(value = "一键删除所有财务上报的数据") |
| | | @PostMapping("/deleteAllFinance") |
| | | public Result deleteAllFinance(String date) { |
| | | financeSubmitService.deleteAllFinance(date); |
| | | return Result.success(); |
| | | } |
| | | } |
| | |
| | | @Length(max= 255,message="编码长度不能超过255") |
| | | @ValueTableShow(3) |
| | | private String registrant; |
| | | |
| | | @ApiModelProperty("姓名") |
| | | @ValueTableShow(3) |
| | | private String name2; |
| | | /** |
| | | * 部门 |
| | | */ |
| | |
| | | |
| | | int updateVxCards(List<DataReporting> list); |
| | | |
| | | |
| | | } |
| | |
| | | |
| | | String getYesterday(); |
| | | |
| | | void deleteAllFans(String date); |
| | | |
| | | } |
| | |
| | | |
| | | int addFinanceSubmit(FinanceSubmit financeSubmit, String date, String param); |
| | | |
| | | |
| | | void deleteAllFinance(String date); |
| | | |
| | | } |
| | |
| | | public void addDataReporting(List<DataReporting> list, String date, String param) { |
| | | int userId = Integer.parseInt(JSONUtil.parseObj(new Jwt().readJWT(ServletUtils.getRequest().getHeader("token")).get("data")).get("id") + ""); |
| | | Map<String, String> map = dataReportingMapper.selectUser(userId); |
| | | String date2 = date; |
| | | if(date == null) { |
| | | date2 = fansSubmitService.getYesterday(); |
| | | date = LocalDateTime.now().format(DateTimeFormatter.ofPattern("yyyy-MM-dd")); |
| | | } else date = LocalDateTime.parse(date+"T00:00:00").plusDays(1).format(DateTimeFormatter.ofPattern("yyyy-MM-dd")); |
| | | for (DataReporting dataReporting : list) { |
| | | String date2 = date; |
| | | if(date == null) { |
| | | date2 = fansSubmitService.getYesterday(); |
| | | date = LocalDateTime.now().format(DateTimeFormatter.ofPattern("yyyy-MM-dd")); |
| | | } else date = LocalDateTime.parse(date+"T00:00:00").plusDays(1).format(DateTimeFormatter.ofPattern("yyyy-MM-dd")); |
| | | // List<FansSubmit> fansSubmits = fansSubmitMapper.selectList(Wrappers.<FansSubmit>lambdaQuery().eq(FansSubmit::getProduct, dataReporting.getProduct()).eq(FansSubmit::getVx, param).select(FansSubmit::getFansAdd).like(FansSubmit::getCreateTime, date)); |
| | | FinanceSubmit financeSubmit = financeSubmitMapper.selectOne(Wrappers.<FinanceSubmit>lambdaQuery().eq(FinanceSubmit::getCompany, dataReporting.getAgent()).eq(FinanceSubmit::getName, dataReporting.getName()).select(FinanceSubmit::getEmployeeRebate).like(FinanceSubmit::getCreateTime, date).orderByDesc(FinanceSubmit::getId).last("limit 1")); |
| | | // Integer sum = 0; |
| | |
| | | } |
| | | return 1; |
| | | } |
| | | |
| | | } |
| | | |
| | | |
| | |
| | | queryWrapper.select("DISTINCT vx").like("create_time", format); |
| | | return fansSubmitMapper.selectList(queryWrapper); |
| | | } |
| | | |
| | | @Override |
| | | public void deleteAllFans(String date) { |
| | | List<FansSubmit> list = fansSubmitMapper.selectList(Wrappers.<FansSubmit>lambdaQuery().eq(FansSubmit::getCreateUser, getLook.selectPowerByMethodAndUserId("selectDataReportingList").get("userId")).like(FansSubmit::getCreateTime, date).select(FansSubmit::getId)); |
| | | for (FansSubmit fansSubmit : list) { |
| | | delFansSubmit(fansSubmit.getId()); |
| | | } |
| | | } |
| | | |
| | | } |
| | | |
| | | |
| | |
| | | public String getYesterday(){ |
| | | return LocalDate.now().minusDays(1).format(DateTimeFormatter.ofPattern("yyyy-MM-dd")); |
| | | } |
| | | |
| | | @Override |
| | | public void deleteAllFinance(String date) { |
| | | List<FinanceSubmit> list = financeSubmitMapper.selectList(Wrappers.<FinanceSubmit>lambdaQuery().eq(FinanceSubmit::getCreateUser, getLook.selectPowerByMethodAndUserId("selectDataReportingList").get("userId")).like(FinanceSubmit::getCreateTime, date).select(FinanceSubmit::getId)); |
| | | for (FinanceSubmit financeSubmit : list) { |
| | | delFinanceSubmit(financeSubmit.getId()); |
| | | } |
| | | } |
| | | } |
| | | |
| | | |
| | |
| | | </select> |
| | | <select id="selectRegistrantCountDtoPageList" resultType="com.yuanchu.mom.dto.RegistrantCountDto"> |
| | | select * from ( |
| | | select id, department, registrant, product, name, sum(show_num) show_num, sum(click) click, |
| | | sum(account_consumption)account_consumption, sum(rebate_consumption) |
| | | rebate_consumption,(sum(rebate_consumption)+sum(remark)) rebate_consumption2, sum(discounted_consumption) |
| | | discounted_consumption, sum(fans_add) fans_add, sum(actual_cost) actual_cost, sum(customer_costs) |
| | | customer_costs, sum(profit) profit, sum(agent_rebate) agent_rebate, sum(customer_rebate) customer_rebate, |
| | | sum(remark) remark, create_time, update_time, create_user |
| | | select department, |
| | | registrant, |
| | | name2, |
| | | product, |
| | | name, |
| | | sum(show_num) show_num, |
| | | sum(click) click, |
| | | sum(account_consumption) account_consumption, |
| | | sum(rebate_consumption) |
| | | rebate_consumption, |
| | | (sum(rebate_consumption) + sum(remark)) rebate_consumption2, |
| | | sum(discounted_consumption) |
| | | discounted_consumption, |
| | | sum(fans_add) fans_add, |
| | | sum(actual_cost) actual_cost, |
| | | sum(customer_costs) |
| | | customer_costs, |
| | | sum(profit) profit, |
| | | sum(agent_rebate) agent_rebate, |
| | | sum(customer_rebate) customer_rebate, |
| | | sum(remark) remark, |
| | | date_format(create_time, '%Y-%m-%d') create_time, |
| | | create_user |
| | | from data_reporting |
| | | group by registrant,date_format(create_time, '%Y-%m-%d') |
| | | group by name2,product, date_format(create_time, '%Y-%m-%d') |
| | | ) a |
| | | <if test="ew.customSqlSegment != null and ew.customSqlSegment != ''"> |
| | | ${ew.customSqlSegment} |