| | |
| | | import com.core.annotations.ManagerAuth; |
| | | import com.core.common.R; |
| | | import com.zy.asrs.entity.MonthlySettle; |
| | | import com.zy.asrs.entity.MonthlySettleDetail; |
| | | import com.zy.asrs.entity.param.DateRangeParam; |
| | | import com.zy.asrs.entity.param.MonthlySettleQueryParam; |
| | | import com.zy.asrs.entity.result.MonthlySettleStatisticsVO; |
| | | import com.zy.asrs.service.MonthlySettleService; |
| | | import com.zy.common.web.BaseController; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.web.bind.annotation.*; |
| | | |
| | | import java.text.SimpleDateFormat; |
| | | import java.util.ArrayList; |
| | | import java.util.Date; |
| | | import java.util.List; |
| | | |
| | | @RestController |
| | | public class MonthlySettleController extends BaseController { |
| | |
| | | return R.ok("删除成功"); |
| | | } |
| | | |
| | | /** |
| | | * 导出月结明细 |
| | | */ |
| | | @RequestMapping(value = "/monthlySettle/detail/export/{id}/auth") |
| | | @ManagerAuth(memo = "导出月结明细") |
| | | public R exportDetail(@PathVariable("id") Long id) { |
| | | // 获取月结统计信息 |
| | | MonthlySettleStatisticsVO statistics = monthlySettleService.getSettleStatistics(id); |
| | | if (statistics == null || statistics.getDetails() == null) { |
| | | return R.error("月结明细不存在"); |
| | | } |
| | | |
| | | List<MonthlySettleDetail> details = statistics.getDetails(); |
| | | |
| | | // 定义导出字段 |
| | | List<String> fields = new ArrayList<>(); |
| | | fields.add("matnr"); |
| | | fields.add("maktx"); |
| | | fields.add("batch"); |
| | | fields.add("brand"); |
| | | fields.add("beginningQty"); |
| | | fields.add("endingQty"); |
| | | fields.add("diffQty"); |
| | | fields.add("inQty"); |
| | | fields.add("outQty"); |
| | | |
| | | return R.ok(exportSupport(details, fields)); |
| | | } |
| | | |
| | | } |
| | | |