zss
2023-08-09 e06fe535194cb73db903548f0e0750f508ebe5aa
sale-server/src/main/java/com/yuanchu/mom/controller/SaleController.java
@@ -82,12 +82,9 @@
            @ApiImplicitParam(name = "id", value = "销售单id", dataTypeClass = Integer.class, required = true)
    })
    @PostMapping("/updateSaleById")
    public Result updateSaleById(@RequestHeader("token") String token, Integer id, @RequestBody SaleVo saleVo) throws JSONException {
        Map<String, String> map = jwt.readJWT(token);
        String data = map.get("data");
        JSONObject jsonObject = new JSONObject(data);
        String saleman = jsonObject.getString("name");
        saleService.updateSaleById(saleman,id, saleVo);
    public Result updateSaleById(@RequestHeader("token") String token, Integer id, @RequestBody SaleVo saleVo) throws Exception {
        Map<String, String> data = JackSonUtil.unmarshal(jwt.readJWT(token).get("data"), Map.class);
        saleService.updateSaleById(data.get("name").replaceAll("\"", ""),id, saleVo);
        return Result.success("修改成功!");
    }
@@ -117,12 +114,9 @@
            @ApiImplicitParam(name = "type", value = "状态", dataTypeClass = Integer.class, required = true)
    })
    @PostMapping("/check")
    public Result check(@RequestHeader("token") String token,Integer id,Integer type) throws JSONException {
        Map<String, String> map = jwt.readJWT(token);
        String data = map.get("data");
        JSONObject jsonObject = new JSONObject(data);
        String checkname = jsonObject.getString("name");
        saleService.check(checkname,id,type);
    public Result check(@RequestHeader("token") String token,Integer id,Integer type) throws Exception {
        Map<String, String> data = JackSonUtil.unmarshal(jwt.readJWT(token).get("data"), Map.class);
        saleService.check(data.get("name").replaceAll("\"", ""),id,type);
        return Result.success("审核成功");
    }