| | |
| | | import io.swagger.annotations.ApiImplicitParam; |
| | | import io.swagger.annotations.ApiImplicitParams; |
| | | import io.swagger.annotations.ApiOperation; |
| | | import org.springframework.validation.annotation.Validated; |
| | | import org.springframework.web.bind.annotation.*; |
| | | import springfox.documentation.spring.web.json.Json; |
| | | |
| | | import javax.annotation.Resource; |
| | | import java.util.*; |
| | |
| | | return Result.success(map); |
| | | } |
| | | |
| | | @ApiOperation(value = "新增销售单-->添加产品-->查询成品库存") |
| | | @PostMapping("/seleRepe") |
| | | public Result seleRepe() { |
| | | return Result.success(repertoryService.getSale()); |
| | | } |
| | | |
| | | @ApiOperation(value = "新增销售单") |
| | | @PostMapping("/addSale") |
| | | public Result addSale(@RequestHeader("token") String token, @RequestBody SaleDto saleDto) throws Exception { |
| | | Map<String, String> data = JackSonUtil.unmarshal(jwt.readJWT(token).get("data"), Map.class); |
| | | saleService.addSale(data.get("name").replaceAll("\"", ""), saleDto); |
| | | public Result addSale(@RequestHeader("token") String token,@Validated @RequestBody SaleDto saleDto) throws Exception { |
| | | Map<String, String> data = JackSonUtil.unmarshal(jwt.readJWT(token).get("data"), Map.class); |
| | | saleService.addSale(data.get("name").replaceAll("\"", ""), saleDto); |
| | | return Result.success("新增成功!"); |
| | | } |
| | | |
| | |
| | | |
| | | @ApiOperation(value = "根据销售单id修改详情信息") |
| | | @ApiImplicitParams(value = { |
| | | @ApiImplicitParam(name = "id", value = "销售单id", dataTypeClass = Integer.class, required = true) |
| | | @ApiImplicitParam(name = "id", value = "销售单id", dataTypeClass = Integer.class, required = true), |
| | | @ApiImplicitParam(name = "id", value = "json格式的销售单内容", dataTypeClass = Json.class, required = true) |
| | | }) |
| | | @PostMapping("/updateSaleById") |
| | | public Result updateSaleById(@RequestHeader("token") String token, Integer id, @RequestBody SaleVo saleVo) throws Exception { |
| | | 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("修改成功!"); |