| | |
| | | String Code_200="200";//成功 |
| | | String Code_600="600";//其他问题 |
| | | String Code_msg = "服务器发生异常,保存失败"; |
| | | |
| | | //玻璃计算方式保留位数 |
| | | Integer decimalPoint =2; |
| | | } |
| | |
| | | private String thisProcess; |
| | | @ExcelProperty("报工班组") |
| | | private String teamsGroupsName; |
| | | @ExcelProperty("订单编号") |
| | | private String orderId; |
| | | @ExcelProperty("项目名称") |
| | | private String project; |
| | | @ExcelProperty("流程卡号") |
| | |
| | | import com.alibaba.fastjson.JSON; |
| | | import com.alibaba.fastjson.TypeReference; |
| | | import com.baomidou.dynamic.datasource.annotation.DS; |
| | | import com.example.erp.tools.AreaComputed.*; |
| | | |
| | | import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; |
| | | import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; |
| | |
| | | import java.util.stream.Collectors; |
| | | |
| | | import static cn.hutool.core.convert.Convert.toDouble; |
| | | import static com.example.erp.tools.AreaComputed.computeArea; |
| | | |
| | | @Service |
| | | @DS("pp") |
| | |
| | | Integer offset = (pageNum - 1) * pageSize; |
| | | Map<String, Object> map = new HashMap<>(); |
| | | String laminating = reportMapper.getLaminating(selectProcesses); |
| | | |
| | | map.put("data", reportMapper.teamOutputMp(offset, pageSize, selectTime1, selectTime2,selectProcesses,laminating, teamOutputDTO)); |
| | | map.put("process", productionSchedulingMapper.selectProcess()); |
| | | map.put("total", reportMapper.teamOutputPageTotal(offset, pageSize, selectTime1, selectTime2,selectProcesses,laminating, teamOutputDTO)); |
| New file |
| | |
| | | package com.example.erp.tools; |
| | | |
| | | import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; |
| | | import com.example.erp.common.Constants; |
| | | import com.example.erp.entity.sd.Order; |
| | | import com.example.erp.mapper.sd.OrderMapper; |
| | | import lombok.RequiredArgsConstructor; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | |
| | | import java.text.DecimalFormat; |
| | | import java.util.List; |
| | | import java.util.Map; |
| | | |
| | | @RequiredArgsConstructor |
| | | public class AreaComputed { |
| | | private static final OrderMapper orderMapper = null; |
| | | |
| | | public static List<Map<String,Object>> computeArea( List<Map<String, Object>> list) { |
| | | |
| | | list.forEach(map -> { |
| | | //获取结算面积计算方式 |
| | | Order order = orderMapper.selectOne(new QueryWrapper<Order>().eq("order_id", map.get("orderId"))); |
| | | Integer width = Integer.parseInt(map.get("width").toString()); |
| | | Integer height = Integer.parseInt(map.get("height").toString()); |
| | | Integer quantity = Integer.parseInt(map.get("quantity").toString()); |
| | | |
| | | //设置面积保留位数 |
| | | Double area = Double.valueOf(String.format("%."+Constants.decimalPoint+"f", width * height /1000000 )); |
| | | |
| | | Double totalArea =0.00; |
| | | switch (order.getCalculateType()) { |
| | | // |
| | | case 2: |
| | | case 4: { |
| | | totalArea = Double.valueOf( |
| | | String.format("%."+Constants.decimalPoint+"f", |
| | | width * height*quantity /1000000 |
| | | ) |
| | | ); |
| | | break; |
| | | } |
| | | default:{ |
| | | totalArea = Double.valueOf( |
| | | String.format("%."+Constants.decimalPoint+"f", |
| | | area*quantity /1000000 |
| | | ) |
| | | ); |
| | | break; |
| | | } |
| | | } |
| | | |
| | | map.put("computeGrossArea", totalArea); |
| | | |
| | | }); |
| | | |
| | | return list; |
| | | |
| | | } |
| | | } |
| | |
| | | rw.this_process, |
| | | rw.teams_groups_name, |
| | | o.project, |
| | | o.order_id, |
| | | rw.process_id, |
| | | fc.order_number, |
| | | MAX(ogd.child_width) AS width, |