package com.mes.damage.controller;
|
|
|
import cn.hutool.core.date.DateTime;
|
import com.mes.damage.entity.Damage;
|
import com.mes.damage.entity.DamagePrint;
|
import com.mes.damage.service.DamageService;
|
import com.mes.utils.Result;
|
import io.swagger.annotations.Api;
|
import io.swagger.annotations.ApiOperation;
|
import org.springframework.beans.factory.annotation.Autowired;
|
import org.springframework.web.bind.annotation.*;
|
|
import java.util.Date;
|
import java.util.List;
|
import java.util.Map;
|
|
/**
|
* <p>
|
* 前端控制器
|
* </p>
|
*
|
* @author wu
|
* @since 2024-06-25
|
*/
|
@Api(description = "报工信息")
|
@RestController
|
@RequestMapping("/damage")
|
@ResponseBody
|
public class DamageController {
|
|
@Autowired
|
private DamageService damageService;
|
@ApiOperation("报工数据查询")
|
@PostMapping("/selectDamage")
|
public Result selectDamage(@RequestBody Map map) {
|
String startTime=map.get("startTime").toString();
|
String endTime=map.get("endTime").toString();
|
int type =Integer.parseInt(map.get("type").toString());
|
int status =Integer.parseInt(map.get("status").toString());
|
String workingProcedure =map.get("workingProcedure").toString();
|
return Result.build(200,"查询成功",damageService.selectDamage(startTime,endTime,type,status,workingProcedure));
|
}
|
|
@ApiOperation("报工")
|
@PostMapping("/submitDamage")
|
public Result submitDamage(@RequestBody List<Damage> damageList) {
|
damageService.submitDamage(damageList);
|
damageService.updateBatchById(damageList);
|
return Result.build(200,"报工成功",1);
|
}
|
|
@ApiOperation("报工数据修改")
|
@PostMapping("/updateDamage")
|
public Result updateDamage(@RequestBody List<Damage> damageList) {
|
damageService.updateBatchById(damageList);
|
return Result.build(200,"修改成功",1);
|
}
|
|
@ApiOperation("报工数据新增")
|
@PostMapping("/insertDamage")
|
public Result insertDamage(@RequestBody Damage damage) {
|
damageService.insertDamage(damage);
|
return Result.build(200,"新增成功",1);
|
}
|
@ApiOperation("拿走数据查询")
|
@PostMapping("/selectDamagePrint")
|
public Result selectDamagePrint(@RequestBody Damage damage) {
|
List<Damage> damage2=damageService.selectDamagePrint(damage);
|
return Result.build(200,"查询成功",damage2);
|
}
|
@ApiOperation("拿走打印查询")
|
@PostMapping("/selectDamagePrintDetails")
|
public Result selectDamagePrintDetails(@RequestBody Damage damage) {
|
List<DamagePrint> damage2=damageService.selectDamagePrintDetails(damage);
|
return Result.build(200,"查询成功",damage2);
|
}
|
|
}
|