| | |
| | | package com.zy.asrs.controller; |
| | | |
| | | |
| | | import com.alibaba.excel.EasyExcel; |
| | | import com.alibaba.excel.write.style.column.LongestMatchColumnWidthStyleStrategy; |
| | | import com.alibaba.fastjson.JSONObject; |
| | | import com.baomidou.mybatisplus.mapper.EntityWrapper; |
| | | import com.baomidou.mybatisplus.mapper.Wrapper; |
| | |
| | | import com.core.common.*; |
| | | import com.core.exception.CoolException; |
| | | import com.zy.asrs.entity.*; |
| | | import com.zy.asrs.entity.param.CheckDTO; |
| | | import com.zy.asrs.entity.param.MatnrDto; |
| | | import com.zy.asrs.entity.param.OrderCheckParam; |
| | | import com.zy.asrs.entity.param.OrderDomainParam; |
| | | import com.zy.asrs.entity.param.*; |
| | | import com.zy.asrs.entity.result.KeyValueVo; |
| | | import com.zy.asrs.service.*; |
| | | import com.zy.common.CodeRes; |
| | |
| | | import org.springframework.web.bind.annotation.*; |
| | | |
| | | import javax.imageio.ImageIO; |
| | | import javax.servlet.ServletOutputStream; |
| | | import javax.servlet.http.HttpServletResponse; |
| | | import java.awt.image.BufferedImage; |
| | | import java.io.IOException; |
| | | import java.net.URLEncoder; |
| | | import java.util.*; |
| | | |
| | | @RestController |
| | |
| | | |
| | | @Autowired |
| | | private LocCheckTrimService locCheckTrimService; |
| | | |
| | | @RequestMapping(value = "/orderCheck/examine") |
| | | @ManagerAuth(memo = "审核盘点单") |
| | | @Transactional |
| | | public R examine(@RequestBody ExamineParam param){ |
| | | orderCheckService.examine(param); |
| | | |
| | | return R.ok("审核完成"); |
| | | } |
| | | |
| | | |
| | | |
| | | |
| | | @RequestMapping(value = "/orderCheck/nav/list/auth") |
| | | @ManagerAuth |
| | |
| | | orderCheck.setOrderTime(DateUtils.convert(now)); |
| | | orderCheck.setStatus(1); |
| | | orderCheck.setSettle(1L); |
| | | orderCheck.setDocType(23L); |
| | | orderCheck.setDocType(16L); |
| | | orderCheck.setCreateTime(now); |
| | | orderCheck.setUpdateTime(now); |
| | | |
| | | if (!orderCheckService.insert(orderCheck)) { |
| | | throw new CoolException("保存盘点单主档失败"); |
| | | } |
| | |
| | | locCheck.setCreateTime(now); |
| | | locCheck.setUpdateTime(now); |
| | | locCheck.setOrderNo(param.getOrderNo()); |
| | | locCheck.setBatch(manLocDetl.getBatch()); |
| | | if (!locCheckService.insert(locCheck)){ |
| | | return R.error("插入失败"); |
| | | } |
| | |
| | | |
| | | } |
| | | |
| | | @RequestMapping(value = "/orderCheck/printExport/auth") |
| | | // @ManagerAuth(memo = "盘点单导出") |
| | | public void export(HttpServletResponse response,@RequestParam String orderNo) throws IOException { |
| | | //从数据库查询数据 |
| | | EntityWrapper<LocCheck> locCheckEntityWrapper = new EntityWrapper<>(); |
| | | locCheckEntityWrapper.eq("order_no",orderNo); |
| | | List<LocCheck> list = locCheckService.selectList(locCheckEntityWrapper); |
| | | for (LocCheck locCheck:list){ |
| | | locCheck.setRealAnfme(null); |
| | | } |
| | | |
| | | response.setContentType("application/vnd.ms-excel"); |
| | | response.setCharacterEncoding("utf-8"); |
| | | String fileName = URLEncoder.encode("盘点单", "UTF-8"); |
| | | response.setHeader("Content-disposition", "attachment;filename=" + fileName+ orderNo + ".xlsx"); |
| | | Set<String> includeColumnFiledNames = new HashSet<String>(); |
| | | includeColumnFiledNames.add("orderNo"); |
| | | includeColumnFiledNames.add("matnr"); |
| | | includeColumnFiledNames.add("maktx"); |
| | | includeColumnFiledNames.add("locNo"); |
| | | includeColumnFiledNames.add("anfme"); |
| | | includeColumnFiledNames.add("owner"); |
| | | includeColumnFiledNames.add("payment"); |
| | | includeColumnFiledNames.add("createTime"); |
| | | includeColumnFiledNames.add("realAnfme"); |
| | | EasyExcel.write(response.getOutputStream(), LocCheck.class) |
| | | .registerWriteHandler(new LongestMatchColumnWidthStyleStrategy()) |
| | | .includeColumnFiledNames(includeColumnFiledNames) |
| | | .sheet("表1") |
| | | .doWrite(list); |
| | | } |
| | | |
| | | |
| | | } |