| | |
| | | |
| | | import com.baomidou.mybatisplus.core.metadata.IPage; |
| | | import com.baomidou.mybatisplus.extension.plugins.pagination.Page; |
| | | import com.yuanchu.mom.pojo.dto.ExportSaleDto; |
| | | import com.yuanchu.mom.pojo.dto.SaleDto; |
| | | import com.yuanchu.mom.pojo.dto.SaleMaterialDto; |
| | | import com.yuanchu.mom.pojo.vo.SaleVo; |
| | | import com.yuanchu.mom.service.RepertoryService; |
| | | import com.yuanchu.mom.utils.JackSonUtil; |
| | | import com.yuanchu.mom.pojo.dto.SaleDto; |
| | | import com.yuanchu.mom.service.SaleService; |
| | | import com.yuanchu.mom.utils.JackSonUtil; |
| | | import com.yuanchu.mom.utils.Jwt; |
| | | import com.yuanchu.mom.vo.Result; |
| | | import io.swagger.annotations.Api; |
| | |
| | | import springfox.documentation.spring.web.json.Json; |
| | | |
| | | import javax.annotation.Resource; |
| | | import javax.servlet.http.HttpServletResponse; |
| | | import java.util.*; |
| | | |
| | | /** |
| | |
| | | public Result updateSaleById(@RequestHeader("token") String token, Integer id, String str) throws Exception { |
| | | SaleVo saleVo = JackSonUtil.unmarshal(str, SaleVo.class); |
| | | Map<String, String> data = JackSonUtil.unmarshal(jwt.readJWT(token).get("data"), Map.class); |
| | | saleService.updateSaleById(data.get("name").replaceAll("\"", ""), id, saleVo); |
| | | return Result.success("修改成功!"); |
| | | return Result.success(saleService.updateSaleById(data.get("name").replaceAll("\"", ""), id, saleVo)); |
| | | } |
| | | |
| | | @ApiOperation(value = "根据销售单id删除") |
| | |
| | | return Result.success("审核成功"); |
| | | } |
| | | |
| | | @ApiOperation(value = "同步") |
| | | @PostMapping("/synchronization") |
| | | public Result synchronization(){ |
| | | return Result.success(saleService.synchronization()); |
| | | } |
| | | |
| | | @ApiOperation(value = "下载附件") |
| | | @ApiImplicitParams(value = { |
| | | @ApiImplicitParam(name = "id", value = "销售单id", dataTypeClass = Integer.class, required = true) |
| | | }) |
| | | @PostMapping("/download") |
| | | public Result download(Integer id){ |
| | | return Result.success(saleService.download(id)); |
| | | } |
| | | |
| | | @ApiOperation(value = "销售订单导出") |
| | | @ApiImplicitParams(value = { |
| | | @ApiImplicitParam(name = "orderNumber", value = "订单编号", dataTypeClass = String.class), |
| | | @ApiImplicitParam(name = "name", value = "产品名称", dataTypeClass = String.class), |
| | | @ApiImplicitParam(name = "type", value = "状态(为空=全部)", dataTypeClass = Integer.class), |
| | | @ApiImplicitParam(name = "delTime", value = "交货日期", dataTypeClass = String.class) |
| | | }) |
| | | @PostMapping("/exportSale") |
| | | public void exportSale(@RequestBody ExportSaleDto dto, HttpServletResponse response){ |
| | | saleService.exportSale(dto,response); |
| | | } |
| | | |
| | | } |