| | |
| | | import org.jeecgframework.poi.excel.def.NormalExcelConstants; |
| | | import org.jeecgframework.poi.excel.entity.ExportParams; |
| | | import org.jeecgframework.poi.excel.view.JeecgEntityExcelView; |
| | | import org.springframework.beans.BeanUtils; |
| | | import org.springframework.stereotype.Service; |
| | | import org.springframework.web.servlet.ModelAndView; |
| | | |
| | | import javax.annotation.Resource; |
| | | import javax.servlet.http.HttpServletRequest; |
| | | import java.math.BigDecimal; |
| | | import java.util.ArrayList; |
| | | import java.util.Collections; |
| | | import java.util.List; |
| | |
| | | public MdcProcessQuantityDto findById(String id) { |
| | | return this.baseMapper.findById(id); |
| | | } |
| | | |
| | | |
| | | /** |
| | | * 添加数据 |
| | | * |
| | | * @param mdcProcessQuantity |
| | | * @return |
| | | */ |
| | | @Override |
| | | public boolean addData(MdcProcessQuantity mdcProcessQuantity) { |
| | | boolean result = false; |
| | | String[] equipmentIds = mdcProcessQuantity.getEquipmentIds().split(","); |
| | | for (String equipmentId : equipmentIds) { |
| | | MdcProcessQuantity processQuantity = new MdcProcessQuantity(); |
| | | BeanUtils.copyProperties(mdcProcessQuantity, processQuantity); |
| | | processQuantity.setEquipmentId(equipmentId); |
| | | boolean b = super.save(processQuantity); |
| | | if (b) { |
| | | result = true; |
| | | } |
| | | } |
| | | return result; |
| | | } |
| | | |
| | | /** |
| | | * |
| | | * @param equipmentId |
| | | * @param validDate |
| | | * @return |
| | | */ |
| | | @Override |
| | | public BigDecimal findTemporarily(String equipmentId, String validDate) { |
| | | BigDecimal result = BigDecimal.ZERO; |
| | | List<MdcProcessQuantityDto> mdcProcessQuantityList = this.baseMapper.findList(equipmentId, validDate); |
| | | if (mdcProcessQuantityList != null && !mdcProcessQuantityList.isEmpty()) { |
| | | for (MdcProcessQuantityDto mdcProcessQuantity : mdcProcessQuantityList) { |
| | | result = result.add(new BigDecimal(mdcProcessQuantity.getProcessQuantity()).multiply(new BigDecimal(mdcProcessQuantity.getDuration()))); |
| | | } |
| | | } |
| | | return result; |
| | | } |
| | | } |