| | |
| | | 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 org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.web.bind.annotation.*; |
| | | |
| | | import java.util.Date; |
| | | import java.util.List; |
| | | import java.util.Map; |
| | | |
| | |
| | | * @author wu |
| | | * @since 2024-06-25 |
| | | */ |
| | | @Api(description = "报工信息") |
| | | @Api(tags = "报工信息") |
| | | @RestController |
| | | @RequestMapping("/damage") |
| | | @ResponseBody |
| | | public class DamageController { |
| | | |
| | | @Autowired |
| | | @Autowired(required=true) |
| | | private DamageService damageService; |
| | | |
| | | @ApiOperation("报工数据查询") |
| | | @PostMapping("/selectDamage") |
| | | public Result selectDamage(@RequestBody Map map) { |
| | |
| | | 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)); |
| | | return Result.build(200,"查询成功",damageService.selectDamage(startTime,endTime,type,status, workingProcedure)); |
| | | } |
| | | |
| | | @ApiOperation("报工") |
| | | @PostMapping("/submitDamage") |
| | | public Result submitDamage(@RequestBody List<Damage> damageList) { |
| | | damageService.submitDamage(damageList); |
| | | if(damageList.get(0).getStatus()==1){ |
| | | damageList.forEach(damage -> damage.setStatus(3)); |
| | | }else{ |
| | | damageList.forEach(damage -> damage.setStatus(8)); |
| | | } |
| | | damageService.updateBatchById(damageList); |
| | | return Result.build(200,"报工成功",1); |
| | | } |
| | |
| | | List<DamagePrint> damage2=damageService.selectDamagePrintDetails(damage); |
| | | return Result.build(200,"查询成功",damage2); |
| | | } |
| | | @ApiOperation("自动报工") |
| | | @PostMapping("/autoSubmitReport") |
| | | public Result autoSubmitReport(String glassId, int deviceId, String workingProcedure, String remark, int type) { |
| | | damageService.autoSubmitReport(glassId,deviceId,workingProcedure,remark,type); |
| | | return Result.build(200,"查询成功",""); |
| | | } |
| | | |
| | | } |
| | | |