MouldController.java 1.7 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647
  1. package com.hssx.cloudmodel.controller;
  2. import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
  3. import com.hssx.cloudmodel.entity.Mould;
  4. import com.hssx.cloudmodel.entity.User;
  5. import com.hssx.cloudmodel.service.MouldService;
  6. import com.hssx.cloudmodel.service.UserService;
  7. import com.hssx.cloudmodel.util.HttpRespMsg;
  8. import io.swagger.annotations.ApiOperation;
  9. import org.springframework.beans.factory.annotation.Autowired;
  10. import org.springframework.stereotype.Controller;
  11. import org.springframework.web.bind.annotation.RequestMapping;
  12. import org.springframework.web.bind.annotation.ResponseBody;
  13. /**
  14. * @author 吴涛涛
  15. * @since 2019-07-30
  16. */
  17. @Controller
  18. @RequestMapping("/mould")
  19. public class MouldController {
  20. @Autowired
  21. private MouldService mouldService;
  22. @Autowired
  23. private UserService userService;
  24. /**
  25. * 添加/修改模具设备
  26. * 添加参数:equipmentId 设备id, modelNo 模具编号
  27. * 修改参数:id 模具id, modelName 模具名称,settingLife 使用年限, initialModulus 初始模次 equipmentId 设备id,
  28. * produceCompanyId 生产方公司id,ocCycle 每模平均周期,rfid rfid码,area 工厂地址,factoryId 工厂id,factoryName 工厂名称
  29. * belongCompanyId 所属公司id ,equipmentName 设备名称
  30. * @return
  31. */
  32. @ApiOperation("添加/修改模具")
  33. @RequestMapping("/addOrUpdate")
  34. @ResponseBody
  35. public HttpRespMsg addOrUpdate(Mould mould, String token) {
  36. HttpRespMsg msg = new HttpRespMsg();
  37. QueryWrapper<User> qw = new QueryWrapper<>();
  38. qw.eq("head_imgurl",token);
  39. User user = userService.getOne(qw);
  40. msg = mouldService.addAndUpdateMould(mould,user);
  41. return msg;
  42. }
  43. }