| | |
| | | import com.zy.crm.manager.service.OrderService; |
| | | import org.springframework.stereotype.Service; |
| | | |
| | | import java.util.ArrayList; |
| | | import java.util.HashMap; |
| | | import java.util.List; |
| | | |
| | | @Service("orderService") |
| | | public class OrderServiceImpl extends ServiceImpl<OrderMapper, Order> implements OrderService { |
| | | |
| | |
| | | } |
| | | |
| | | @Override |
| | | public Page<Order> getPage(Page<Order> page, Long hostId, String deptId, Long userId, String condition) { |
| | | return page.setRecords(baseMapper.listByPage(page, hostId, deptId, userId, condition)); |
| | | public Page<Order> getPage(Page<Order> page, Long hostId, String deptId, Long userId, Long director, String condition, Integer status) { |
| | | return page.setRecords(baseMapper.listByPage(page, hostId, deptId, userId,director, condition, status)); |
| | | } |
| | | |
| | | @Override |
| | |
| | | private String getNextUuid(Long hostId) { |
| | | Order order = this.baseMapper.selectOrderByNewestUuid(hostId); |
| | | if (order == null) { |
| | | return "0001"; |
| | | return "00001"; |
| | | } |
| | | return zerofill(String.valueOf(Integer.parseInt(order.getUuid()) + 1), 4); |
| | | return zerofill(String.valueOf(Integer.parseInt(order.getUuid()) + 1), 5); |
| | | } |
| | | |
| | | public static String zerofill(String msg, Integer count){ |
| | |
| | | } |
| | | } |
| | | |
| | | @Override |
| | | public Double selectMoneyByYearAndStatus(String year, Integer status) { |
| | | Double data = this.baseMapper.selectMoneyByYearAndStatus(year, status); |
| | | if (data == null) { |
| | | return 0D; |
| | | } |
| | | return data; |
| | | } |
| | | |
| | | @Override |
| | | public Double selectMoneyByUserAndYearAndStatus(Long userId, String year, Integer status) { |
| | | Double data = this.baseMapper.selectMoneyByUserAndYearAndStatus(userId, year, status); |
| | | if (data == null) { |
| | | return 0D; |
| | | } |
| | | return data; |
| | | } |
| | | |
| | | @Override |
| | | public Integer selectCountByUserYearAndStatus(Long userId, String year, Integer status) { |
| | | return this.baseMapper.selectCountByUserYearAndStatus(userId, year, status); |
| | | } |
| | | |
| | | @Override |
| | | public List<Order> selectTopMoney() { |
| | | return this.baseMapper.selectTopMoney(); |
| | | } |
| | | |
| | | @Override |
| | | public List<Double> selectCurrentYearMonthSuccess() { |
| | | ArrayList<Double> list = new ArrayList<Double>(){{ |
| | | add(0D);add(0D);add(0D);add(0D); |
| | | add(0D);add(0D);add(0D);add(0D); |
| | | add(0D);add(0D);add(0D);add(0D); |
| | | }}; |
| | | for (HashMap<String, Object> map : this.baseMapper.selectCurrentYearMonthSuccess()) { |
| | | list.set(Integer.parseInt(map.get("mon").toString()) - 1, Double.parseDouble(map.get("money").toString())); |
| | | } |
| | | return list; |
| | | } |
| | | } |