| | |
| | | import cn.hutool.core.date.DatePattern; |
| | | import cn.hutool.core.date.DateTime; |
| | | import cn.hutool.core.date.DateUtil; |
| | | import cn.hutool.core.util.StrUtil; |
| | | import com.baomidou.mybatisplus.core.toolkit.Wrappers; |
| | | import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; |
| | | import com.sinata.rest.modular.mall.dao.MallCommissionSettlementMonthMapper; |
| | |
| | | |
| | | @Override |
| | | @Transactional(rollbackFor = Exception.class) |
| | | public void commissionSettlemenMonth() { |
| | | public void commissionSettlementMonth() { |
| | | // 上月时间 |
| | | DateTime lastMonth = DateUtil.offsetMonth(DateUtil.date(), -1); |
| | | String beginLastMonth = DateUtil.beginOfMonth(lastMonth).toString(); |
| | |
| | | for (MallCommissionSettlementMonth m : notCommissionSettlementList) { |
| | | for (MemUser u : memUserList) { |
| | | // 匹配用户城市 |
| | | if (u.getId().equals(m.getUserId())) { |
| | | m.setProvinceCode(u.getAgentProvinceCode()); |
| | | m.setCityCode(u.getAgentCityCode()); |
| | | m.setCountyCode(u.getAgentCountyCode()); |
| | | if (u.getId().equals(m.getUserId()) && StrUtil.isNotBlank(u.getCityCode())) { |
| | | m.setProvinceCode(u.getCityCode().substring(0, 2) + "0000"); |
| | | m.setCityCode(u.getCityCode().substring(0, 4) + "00"); |
| | | m.setCountyCode(u.getCityCode()); |
| | | break; |
| | | } |
| | | } |