| | |
| | | import org.springframework.beans.factory.annotation.Autowired;
|
| | | import org.springframework.validation.annotation.Validated;
|
| | | import org.springframework.web.bind.annotation.CrossOrigin;
|
| | | import org.springframework.web.bind.annotation.PostMapping;
|
| | | import org.springframework.web.bind.annotation.RequestBody;
|
| | | import org.springframework.web.bind.annotation.RequestHeader;
|
| | | import org.springframework.web.bind.annotation.RequestMapping;
|
| | | import org.springframework.web.bind.annotation.RequestMethod;
|
| | | import org.springframework.web.bind.annotation.RestController;
|
| | |
|
| | | import com.qianwen.mdc.common.OpResult;
|
| | | import com.qianwen.mdc.dto.IdsDTO;
|
| | | import com.qianwen.mdc.dto.machine.MachineDTO;
|
| | | import com.qianwen.mdc.service.machine.MachineEditService;
|
| | | import com.qianwen.mdc.vallidate.AddGroup;
|
| | |
| | |
|
| | | public static final Logger logger = LoggerFactory.getLogger(MachineEditController.class);
|
| | |
|
| | | @RequestMapping(value = "/modify", method = RequestMethod.POST)
|
| | | @PostMapping(value = "/modify")
|
| | | public OpResult<Void> modify(@RequestHeader(value = "mdc-token", defaultValue = "") String token,
|
| | | @Validated(value = {UpdateGroup.class,AddGroup.class,}) @RequestBody MachineDTO machineDTO) {
|
| | |
|
| | |
| | | * @param request
|
| | | * @return
|
| | | */
|
| | | @RequestMapping(value = "/delete", method = RequestMethod.POST)
|
| | | @PostMapping(value = "/delete")
|
| | | public OpResult<Void> delete(@RequestHeader(value = "mdc-token", defaultValue = "") String token,
|
| | | Integer id) {
|
| | | @RequestBody IdsDTO dto) {
|
| | |
|
| | | try {
|
| | | editService.delete(id);
|
| | | editService.delete(dto.getIds());
|
| | | }catch(Exception ex) {
|
| | | logger.error("å 餿ºåºå¤±è´¥",ex);
|
| | | return OpResult.fail(ex.getMessage());
|
| | |
| | | return OpResult.success();
|
| | | }
|
| | |
|
| | | @RequestMapping(value = "/concern", method = RequestMethod.POST)
|
| | | /**
|
| | | * ç»æºåºè®¾ç½®å
³æ³¨æ è®°
|
| | | * @param token
|
| | | * @param dto å
å«idï¼concernåæ°
|
| | | * @return
|
| | | */
|
| | | @PostMapping(value = "/concern")
|
| | | public OpResult<Void> switchConcern(@RequestHeader(value = "mdc-token", defaultValue = "") String token,
|
| | | Integer id,int concern) {
|
| | | |
| | | @RequestBody MachineDTO dto) {
|
| | | //Integer id,int concern
|
| | | try {
|
| | | editService.switchConcern(id,concern);
|
| | | editService.switchConcern(dto.getId(),dto.getConcern());
|
| | | }catch(Exception ex) {
|
| | | logger.error("设置å
³æ³¨å¤±è´¥",ex);
|
| | | logger.error("æºåºè®¾ç½®å
³æ³¨å¤±è´¥",ex);
|
| | | return OpResult.fail(ex.getMessage());
|
| | | }
|
| | |
|
| | |
| | | import org.springframework.beans.factory.annotation.Autowired;
|
| | | import org.springframework.web.bind.annotation.CrossOrigin;
|
| | | import org.springframework.web.bind.annotation.PostMapping;
|
| | | import org.springframework.web.bind.annotation.RequestBody;
|
| | | import org.springframework.web.bind.annotation.RequestHeader;
|
| | | import org.springframework.web.bind.annotation.RequestMapping;
|
| | | import org.springframework.web.bind.annotation.RequestMethod;
|
| | |
| | | import com.alibaba.fastjson.JSONObject;
|
| | | import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
| | | import com.qianwen.mdc.common.OpResult;
|
| | | import com.qianwen.mdc.dto.IdsDTO;
|
| | | import com.qianwen.mdc.dto.MachineMaintainDTO;
|
| | | import com.qianwen.mdc.dto.MachineMaintainFullDTO;
|
| | | import com.qianwen.mdc.dto.MachineMaintainQueryDTO;
|
| | |
| | |
|
| | | @RequestMapping(value = "/delete", method = RequestMethod.POST)
|
| | | public OpResult<Void> delete(@RequestHeader(value = "mdc-token", defaultValue = "") String token,
|
| | | @RequestParam List<Integer> ids, HttpServletRequest request) {
|
| | | @RequestBody IdsDTO dto, HttpServletRequest request) {
|
| | | accountTokenService.checkToken(token);
|
| | |
|
| | | JSONObject jsonResult = new JSONObject();
|
| | | jsonResult.put("result", "SUCCESS");
|
| | |
|
| | | try {
|
| | | editService.delete(ids);
|
| | | editService.delete(dto.getIds());
|
| | | return OpResult.success();
|
| | | }catch(Exception e) {
|
| | | logger.error("å é¤ç»´æ¤è®°å½å¤±è´¥",e);
|
| | |
| | | import org.springframework.web.bind.annotation.GetMapping;
|
| | | import org.springframework.web.bind.annotation.PostMapping;
|
| | | import org.springframework.web.bind.annotation.RequestBody;
|
| | | import org.springframework.web.bind.annotation.RequestHeader;
|
| | | import org.springframework.web.bind.annotation.RequestMapping;
|
| | | import org.springframework.web.bind.annotation.RequestMethod;
|
| | | import org.springframework.web.bind.annotation.RestController;
|
| | |
|
| | | import com.alibaba.fastjson.JSONObject;
|
| | | import com.qianwen.mdc.common.OpResult;
|
| | | import com.qianwen.mdc.dto.IdsDTO;
|
| | | import com.qianwen.mdc.dto.PlantDTO;
|
| | | import com.qianwen.mdc.service.plant.PlantService;
|
| | | import com.qianwen.mdc.vallidate.AddGroup;
|
| | |
| | | return OpResult.success();
|
| | | }
|
| | |
|
| | | @RequestMapping(value = "/delete", method = RequestMethod.POST)
|
| | | public OpResult<Void> delete(@RequestHeader(value = "mdc-token", defaultValue = "") String token,
|
| | | @RequestBody IdsDTO dto, HttpServletRequest request) {
|
| | | //accountTokenService.checkToken(token);
|
| | |
|
| | | try {
|
| | | plantService.delete(dto.getIds());
|
| | | return OpResult.success();
|
| | | }catch(Exception e) {
|
| | | logger.error("å é¤ç»´æ¤è®°å½å¤±è´¥",e);
|
| | | return OpResult.fail(e.getMessage());
|
| | | }
|
| | | }
|
| | | |
| | | /**
|
| | | * å
¨é¨è½¦é´å表
|
| | | * @param request
|
| | |
| | | package com.qianwen.mdc.controller;
|
| | |
|
| | | import java.util.List;
|
| | |
|
| | | import javax.annotation.Resource;
|
| | |
|
| | | import org.slf4j.Logger;
|
| | |
| | | }
|
| | | }
|
| | |
|
| | | @RequestMapping(value = "/list", method = RequestMethod.POST)
|
| | | public JSONObject getUserList(@RequestHeader(value = "mdc-token", defaultValue = "") String token) {
|
| | | /*
|
| | | AccountToken mdcTokenObj = new AccountToken();
|
| | | mdcTokenObj.setToken(token);
|
| | | AccountToken mdcToken = mdcTokenMapper.selectOne(mdcTokenObj);
|
| | | JSONObject tokenResult = MdcTokenServiceImpl.genTokenErrMsg(mdcToken);
|
| | | if (tokenResult != null) {
|
| | | return tokenResult;
|
| | | @GetMapping(value = "/list")
|
| | | public OpResult<List<SysAccountDTO>> getUserList(@RequestHeader(value = "mdc-token", defaultValue = "") String token) {
|
| | | try {
|
| | | |
| | | return OpResult.success(accountService.allSysAccounts());
|
| | | }catch(Exception e) {
|
| | | logger.error("userlistæ¥è¯¢å¼å¸¸",e);
|
| | | return OpResult.fail(e.getMessage());
|
| | | }
|
| | |
|
| | | mdcToken.setExpireTime(MdcTokenServiceImpl.genExpiredTime());
|
| | | mdcTokenMapper.updateByPrimaryKeySelective(mdcToken);
|
| | |
|
| | | JSONObject jsonResult = new JSONObject();
|
| | | jsonResult.put("result", "SUCCESS");
|
| | |
|
| | | List<SysAccount> mdcUsers = mdcUserMapper.selectAll();
|
| | | jsonResult.put("list", mdcUsers);
|
| | |
|
| | | return jsonResult;
|
| | | */
|
| | | return null;
|
| | | |
| | | }
|
| | |
|
| | |
|
| | |
| | | import org.springframework.beans.factory.annotation.Value;
|
| | | import org.springframework.web.bind.annotation.CrossOrigin;
|
| | | import org.springframework.web.bind.annotation.GetMapping;
|
| | | import org.springframework.web.bind.annotation.PostMapping;
|
| | | import org.springframework.web.bind.annotation.RequestBody;
|
| | | import org.springframework.web.bind.annotation.RequestHeader;
|
| | | import org.springframework.web.bind.annotation.RequestMapping;
|
| | | import org.springframework.web.bind.annotation.RequestMethod;
|
| | | import org.springframework.web.bind.annotation.RestController;
|
| | |
|
| | | import com.qianwen.mdc.common.OpResult;
|
| | |
| | | import com.qianwen.mdc.service.account.StaticData;
|
| | |
|
| | | /**
|
| | | * å°è´¦æ°å¢
|
| | | * å°è´¦æ°å¢æ§å¶å¨
|
| | | */
|
| | | @RestController
|
| | | @CrossOrigin
|
| | |
| | |
|
| | | public static final Logger logger = LoggerFactory.getLogger(MachineAccountAddController.class);
|
| | |
|
| | | @RequestMapping(value = "/create", method = RequestMethod.POST)
|
| | | @PostMapping(value = "/create")
|
| | | public OpResult<Void> create(@RequestHeader(value = "mdc-token", defaultValue = "") String token,
|
| | | @RequestBody MachineAccountEditDTO dto, HttpServletRequest request) {
|
| | | /*
|
| | |
| | |
|
| | | import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
| | | import com.qianwen.mdc.common.OpResult;
|
| | | import com.qianwen.mdc.dto.IdsDTO;
|
| | | import com.qianwen.mdc.dto.devicetype.DeviceTypeDTO;
|
| | | import com.qianwen.mdc.service.devicetype.DeviceTypeService;
|
| | |
|
| | |
| | | * @return
|
| | | */
|
| | | @GetMapping(value = "/{id}")
|
| | | public OpResult<DeviceTypeDTO> pageQuery(@PathVariable("id") Integer id) {
|
| | | public OpResult<DeviceTypeDTO> get(@PathVariable("id") Integer id) {
|
| | | try {
|
| | | DeviceTypeDTO d = deviceTypeService.get(id);
|
| | | return OpResult.success(d);
|
| | |
| | |
|
| | | @RequestMapping(value = "/delete", method = RequestMethod.POST)
|
| | | public OpResult<Void> delete(@RequestHeader(value = "mdc-token", defaultValue = "") String token,
|
| | | @RequestParam List<Integer> ids, HttpServletRequest request) {
|
| | | //accountTokenService.checkToken(token);
|
| | |
|
| | | |
| | | @RequestBody IdsDTO dto, HttpServletRequest request) {
|
| | | //accountTokenService.checkToken(token);@RequestParam List<Integer> ids
|
| | | |
| | | try {
|
| | | deviceTypeService.delete(ids);
|
| | | deviceTypeService.delete(dto.getIds());
|
| | | return OpResult.success();
|
| | | }catch(Exception e) {
|
| | | logger.error("å é¤å¤±è´¥",e);
|
| | |
| | | private String machineName;
|
| | |
|
| | | /**
|
| | | * machine uuid
|
| | | * ç»ä¸ç¼å·
|
| | | */
|
| | | private String uuid;
|
| | |
|
| | | /**
|
| | | * machine specification
|
| | | * è§æ ¼
|
| | | */
|
| | | private String specification;
|
| | |
|
| | | /**
|
| | | * machine type
|
| | | * åå·
|
| | | */
|
| | | private String type;
|
| | |
|
| | |
| | | */
|
| | | @TableName("machine_maintain")
|
| | | public class MachineMaintain implements Serializable {
|
| | | /**
|
| | | * primary key
|
| | | */
|
| | | |
| | | @TableId(type=IdType.AUTO)
|
| | | private Integer id;
|
| | |
|
| | |
| | | private Integer machineId;
|
| | |
|
| | | /**
|
| | | * user id
|
| | | * ä¿å
ȏ
user id
|
| | | */
|
| | | //@Column(name = "user_id")
|
| | | private Integer userId;
|
| | |
| | | */
|
| | | private Integer style;
|
| | |
|
| | | /**
|
| | | * ç»ä¸ç¼å·
|
| | | */
|
| | | private String sn;
|
| | |
|
| | | /**
|
| | | * 设å¤åå·ï¼ææ¬
|
| | | */
|
| | | private String type;
|
| | |
|
| | | /**
|
| | | * è¯¥åæ®µç®å没æä½¿ç¨
|
| | |
| | | /**
|
| | | * 使ç¨åä½ï¼æåï¼ï¼å·¥èº/ç¼å¶/ç产
|
| | | */
|
| | | private String department;
|
| | | private Integer department;
|
| | |
|
| | | private static final long serialVersionUID = 1L;
|
| | |
|
| | |
| | | this.style = style;
|
| | | }
|
| | |
|
| | | public String getType() {
|
| | | return type;
|
| | | }
|
| | |
|
| | | |
| | | public void setType(String type) {
|
| | | this.type = type;
|
| | | }
|
| | |
|
| | | /**
|
| | | * è·åstart date from
|
| | | *
|
| | | * @return start_date_from - start date from
|
| | | */
|
| | | public Date getStartDateFrom() {
|
| | | return startDateFrom;
|
| | | }
|
| | |
| | | this.isQualified = isQualified;
|
| | | }
|
| | |
|
| | | |
| | | public String getSn() {
|
| | | return sn;
|
| | | }
|
| | |
|
| | | public void setSn(String sn) {
|
| | | this.sn = sn;
|
| | | }
|
| | |
|
| | | public String getStatus() {
|
| | | return status;
|
| | |
| | | this.detail = detail;
|
| | | }
|
| | |
|
| | | public String getDepartment() {
|
| | | public Integer getDepartment() {
|
| | | return department;
|
| | | }
|
| | |
|
| | | public void setDepartment(String department) {
|
| | | public void setDepartment(Integer department) {
|
| | | this.department = department;
|
| | | }
|
| | |
|
| | | |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.qianwen.mdc.dto; |
| | | |
| | | import java.util.List; |
| | | |
| | | /** |
| | | * åªæids(id List)åæ°ï¼ä¸»è¦ç¨æ·æ¹éå é¤è¿ç±»åºæ¯çåæ°ä¼ é |
| | | */ |
| | | public class IdsDTO { |
| | | private List<Integer> ids; |
| | | |
| | | public List<Integer> getIds() { |
| | | return ids; |
| | | } |
| | | |
| | | public void setIds(List<Integer> ids) { |
| | | this.ids = ids; |
| | | } |
| | | |
| | | |
| | | } |
| | |
| | | private Integer userId;
|
| | |
|
| | | /**
|
| | | * 使ç¨åä½ï¼æåï¼ï¼å·¥èº/ç¼å¶/ç产
|
| | | * 使ç¨åä½ï¼1å·¥èº/2ç¼å¶/3ç产
|
| | | */
|
| | | private String department;
|
| | | private Integer department;
|
| | |
|
| | | public Integer getId() {
|
| | | return id;
|
| | |
| | | public void setUserId(Integer userId) {
|
| | | this.userId = userId;
|
| | | }
|
| | | public String getDepartment() {
|
| | | public Integer getDepartment() {
|
| | | return department;
|
| | | }
|
| | | public void setDepartment(String department) {
|
| | | public void setDepartment(Integer department) {
|
| | | this.department = department;
|
| | | }
|
| | |
|
| | |
| | | private Integer machineId;
|
| | | private String machineName;
|
| | | /**
|
| | | * 设å¤åå·ï¼ææ¬
|
| | | * 设å¤åå·ï¼å°è´¦éçä¿¡æ¯
|
| | | */
|
| | | private String type;
|
| | | /**
|
| | |
| | | private String userName;
|
| | |
|
| | | /**
|
| | | * 使ç¨åä½ï¼æåï¼ï¼å·¥èº/ç¼å¶/ç产
|
| | | * 使ç¨åä½ï¼æåï¼ï¼1å·¥èº/2ç¼å¶/3ç产
|
| | | */
|
| | | private String department;
|
| | | private Integer department;
|
| | | /**
|
| | | * é¨é¨åç§°ï¼ä»use_departmentèåæ¥è¯¢èæ¥
|
| | | */
|
| | | private String departmentName;
|
| | | /**
|
| | | * è§æ ¼ï¼å°è´¦éçä¿¡æ¯
|
| | | */
|
| | | private String specification;
|
| | | |
| | |
|
| | | public Integer getId() {
|
| | | return id;
|
| | |
| | | public void setUserId(Integer userId) {
|
| | | this.userId = userId;
|
| | | }
|
| | | public String getDepartment() {
|
| | | |
| | | public Integer getDepartment() {
|
| | | return department;
|
| | | }
|
| | | public void setDepartment(String department) {
|
| | | public void setDepartment(Integer department) {
|
| | | this.department = department;
|
| | | }
|
| | | public String getMachineName() {
|
| | |
| | | public void setUserName(String userName) {
|
| | | this.userName = userName;
|
| | | }
|
| | | public String getDepartmentName() {
|
| | | return departmentName;
|
| | | }
|
| | | public void setDepartmentName(String departmentName) {
|
| | | this.departmentName = departmentName;
|
| | | }
|
| | | public String getSpecification() {
|
| | | return specification;
|
| | | }
|
| | | public void setSpecification(String specification) {
|
| | | this.specification = specification;
|
| | | }
|
| | |
|
| | |
|
| | | }
|
| | |
| | | /**
|
| | | * ç»ä¸ç¼å·
|
| | | */
|
| | | private String sn;
|
| | | private String uuid;
|
| | |
|
| | | /*
|
| | | * ä¿å
»ç±»åï¼1ï¼æ¥å¸¸ä¿å
»ï¼2:ä¸çº§ä¿å
»ï¼3ï¼äºçº§ä¿å
»ï¼4ï¼ä¸çº§ä¿å
»
|
| | |
| | | private Integer userId;
|
| | |
|
| | | /**
|
| | | * 使ç¨åä½ï¼æåï¼ï¼å·¥èº/ç¼å¶/ç产
|
| | | * 使ç¨åä½idï¼1å·¥èº/2ç¼å¶/3ç产
|
| | | */
|
| | | private String department;
|
| | | private Integer department;
|
| | |
|
| | | public String getSn() {
|
| | | return sn;
|
| | | }
|
| | | public void setSn(String sn) {
|
| | | this.sn = sn;
|
| | | }
|
| | | |
| | | public Integer getStyle() {
|
| | | return style;
|
| | | }
|
| | |
| | | public void setUserId(Integer userId) {
|
| | | this.userId = userId;
|
| | | }
|
| | | public String getDepartment() {
|
| | | public String getUuid() {
|
| | | return uuid;
|
| | | }
|
| | | public void setUuid(String uuid) {
|
| | | this.uuid = uuid;
|
| | | }
|
| | | public Integer getDepartment() {
|
| | | return department;
|
| | | }
|
| | | public void setDepartment(String department) {
|
| | | public void setDepartment(Integer department) {
|
| | | this.department = department;
|
| | | }
|
| | | |
| | | |
| | | |
| | | }
|
| | |
| | | * 夿³¨
|
| | | */
|
| | | private String remark;
|
| | |
|
| | | /**
|
| | | * ç¶æï¼ä»machine_statusè·å
|
| | | */
|
| | | private String status;
|
| | | private static final long serialVersionUID = 1L;
|
| | |
|
| | | public Integer getId() {
|
| | |
| | | this.manageType = manageType;
|
| | | }
|
| | |
|
| | | public String getStatus() {
|
| | | return status;
|
| | | }
|
| | |
|
| | | public void setStatus(String status) {
|
| | | this.status = status;
|
| | | }
|
| | |
|
| | | }
|
| | |
| | | @NotNull(message = "åæ¿ä¸è½ä¸ºç©º")
|
| | | private Integer plantId;
|
| | |
|
| | | /**
|
| | | * å
³æ³¨æ è®°
|
| | | */
|
| | | private Integer concern;
|
| | |
|
| | | public Integer getId() {
|
| | | return id;
|
| | |
| | | public void setPlantId(Integer plantId) {
|
| | | this.plantId = plantId;
|
| | | }
|
| | |
|
| | | public Integer getConcern() {
|
| | | return concern;
|
| | | }
|
| | |
|
| | | public void setConcern(Integer concern) {
|
| | | this.concern = concern;
|
| | | }
|
| | |
|
| | |
|
| | | }
|
| | |
| | | import lombok.extern.slf4j.Slf4j;
|
| | |
|
| | | /**
|
| | | * æ°æ®å½æ¡£æå¡
|
| | | * æ°æ®å½æ¡£æå¡,å° machine_status æ°æ®å¯¼å
¥machine_status_history表,å¹¶å å
¥ææ°çmachine_statusæ°æ®
|
| | | */
|
| | | @Slf4j
|
| | | @Component
|
| | |
| | |
|
| | | //List<MdcMachineAccount> list = mdcMachineAccountMapper.selectList(wrapperAcc);
|
| | | List<MachineAccount> list = machineAccountMapper.lastByMachineId(status.getMachineId());
|
| | | if ((list == null) || (list.size() == 0)) {
|
| | | if (list.isEmpty()) {
|
| | | continue;
|
| | | }
|
| | | MachineAccount account = list.get(0);
|
| | |
| | | DeviceType dtype;
|
| | | for(Integer id : ids) {
|
| | | dtype = deviceTypeMapper.selectById(id);
|
| | | if(dtype == null) {
|
| | | continue;
|
| | | }
|
| | | dtype.markDeleted();
|
| | | deviceTypeMapper.updateById(dtype);
|
| | | }
|
| | |
| | | package com.qianwen.mdc.service.machine;
|
| | |
|
| | | import java.util.List;
|
| | |
|
| | | import org.springframework.beans.factory.annotation.Autowired;
|
| | | import org.springframework.stereotype.Service;
|
| | | import org.springframework.transaction.annotation.Transactional;
|
| | |
| | | * @param id
|
| | | */
|
| | | @Transactional
|
| | | public void delete(Integer id) {
|
| | | //éè¦å
¶ä»æ°æ®çå 餿è
å¤çåå¨è¿éãã
|
| | | |
| | | public void delete(List<Integer> ids) {
|
| | | //å é¤è®¾å¤æ°æ®
|
| | | machineMapper.deleteById(id);
|
| | | for(Integer id : ids) {
|
| | | machineMapper.deleteById(id);
|
| | | }
|
| | | |
| | | }
|
| | |
|
| | | /*
|
| | |
| | | mm.setDetail(dto.getDetail());
|
| | | mm.setIsQualified(dto.getIsQualified());
|
| | | mm.setMachineId(dto.getMachineId());
|
| | | mm.setSn(dto.getSn());
|
| | |
|
| | | mm.setStartDateFrom(dto.getStartDateFrom());
|
| | | mm.setStartDateTo(dto.getStartDateTo());
|
| | | mm.setStyle(dto.getStyle());
|
| | |
| | | mm.setDetail(dto.getDetail());
|
| | | mm.setIsQualified(dto.getIsQualified());
|
| | | mm.setMachineId(dto.getMachineId());
|
| | | mm.setSn(dto.getSn());
|
| | | mm.setStartDateFrom(dto.getStartDateFrom());
|
| | | mm.setStartDateTo(dto.getStartDateTo());
|
| | | mm.setStyle(dto.getStyle());
|
| | | mm.setType(dto.getType());
|
| | |
|
| | | mm.setUserId(dto.getUserId());
|
| | | mm.setDepartment(dto.getDepartment());
|
| | |
|
| | |
| | | public class PlantService {
|
| | | @Autowired
|
| | | private PlantMapper plantMapper;
|
| | | |
| | | /**
|
| | | * æ°å¢åæ¿
|
| | | * @param plantDTO
|
| | | */
|
| | | @Transactional
|
| | | public void save(PlantDTO plantDTO) {
|
| | |
|
| | |
| | | plantMapper.insert(p);
|
| | | }
|
| | |
|
| | | /**
|
| | | * ä¿®æ¹åæ¿
|
| | | * @param plantDTO
|
| | | */
|
| | | @Transactional
|
| | | public void modify(PlantDTO plantDTO) {
|
| | |
|
| | |
| | | plantMapper.updateById(p);
|
| | | }
|
| | |
|
| | | @Transactional
|
| | | /**
|
| | | * ææåæ¿å表
|
| | | * @return
|
| | | */
|
| | | @Transactional(readOnly=true)
|
| | | public List<PlantDTO> list() {
|
| | |
|
| | | List<Plant> plist = plantMapper.selectList(null);
|
| | |
| | | }).collect(Collectors.toList());
|
| | |
|
| | | }
|
| | | |
| | | /**
|
| | | * å é¤åæ¿
|
| | | * @param ids åæ¿idå表
|
| | | */
|
| | | @Transactional
|
| | | public void delete(List<Integer> ids) {
|
| | | //TODO æ£æ¥åæ¿çè®¾å¤æ°é
|
| | | |
| | | }
|
| | | }
|
| | |
| | | package com.qianwen.mdc.service.sysaccount;
|
| | |
|
| | | import java.util.List;
|
| | | import java.util.stream.Collectors;
|
| | |
|
| | | import org.apache.commons.lang3.StringUtils;
|
| | | import org.slf4j.Logger;
|
| | |
| | | return result;
|
| | | }
|
| | |
|
| | | @Transactional(readOnly=true)
|
| | | public List<SysAccountDTO> allSysAccounts() {
|
| | | |
| | | List<SysAccount> atlist = sysAccountMapper.selectList(null);
|
| | | |
| | | return atlist.stream().map(acc -> {
|
| | | SysAccountDTO dto = new SysAccountDTO();
|
| | | dto.setId(acc.getId());
|
| | | dto.setName(acc.getName());
|
| | | dto.setUsername(acc.getUsername());
|
| | | dto.setCreateTime(acc.getCreateTime());
|
| | | return dto;
|
| | | }).collect(Collectors.toList());
|
| | | |
| | | }
|
| | | }
|
| | |
| | |
|
| | | <select id="queryPage" parameterType="com.qianwen.mdc.dto.account.MachineAccountQueryDTO" resultType="com.qianwen.mdc.dto.account.MachineAccountDTO">
|
| | | select
|
| | | a.id,
|
| | | a.machine_id machineId,
|
| | | a.uuid,
|
| | | a.id,
|
| | | a.specification,
|
| | | a.type,
|
| | | a.category,
|
| | |
| | | a.pic,
|
| | | a.remark,
|
| | | a.manage_type manageType,
|
| | | a.classes
|
| | | a.classes,
|
| | | ms.status
|
| | | from machine_account a
|
| | | left join use_department ud on a.department=ud.id
|
| | | left join (select max(id) id,machine_id,status from machine_status group by machine_id,status) ms on a.machine_id=ms.machine_id
|
| | | <where>
|
| | | <if test="dto.uuid != null and dto.uuid != ''">
|
| | | <bind name="uuid" value="'%' + dto.uuid + '%'" />
|
| | |
| | | <result column="user_id" jdbcType="INTEGER" property="userId" />
|
| | | <result column="machine_account_id" jdbcType="INTEGER" property="machineAccountId" />
|
| | | <result column="style" jdbcType="INTEGER" property="style" />
|
| | | <result column="sn" jdbcType="VARCHAR" property="sn" />
|
| | | <result column="type" jdbcType="VARCHAR" property="type" />
|
| | | <result column="period" jdbcType="VARCHAR" property="period" />
|
| | | <result column="start_date_from" jdbcType="TIMESTAMP" property="startDateFrom" />
|
| | | <result column="start_date_to" jdbcType="TIMESTAMP" property="startDateTo" />
|
| | |
| | | <result column="is_qualified" jdbcType="BIT" property="isQualified" />
|
| | | <result column="status" jdbcType="VARCHAR" property="status" />
|
| | | <result column="detail" jdbcType="VARCHAR" property="detail" />
|
| | | <result column="department" jdbcType="VARCHAR" property="department" />
|
| | | <result column="department" jdbcType="INTEGER" property="department" />
|
| | | </resultMap>
|
| | |
|
| | | <resultMap id="FullResultMap" type="com.qianwen.mdc.dto.MachineMaintainFullDTO">
|
| | |
| | | <result column="user_name" jdbcType="VARCHAR" property="userName" />
|
| | | <result column="machine_account_id" jdbcType="INTEGER" property="machineAccountId" />
|
| | | <result column="style" jdbcType="INTEGER" property="style" />
|
| | | <result column="sn" jdbcType="VARCHAR" property="sn" />
|
| | | <result column="uuid" jdbcType="VARCHAR" property="uuid" />
|
| | | <result column="type" jdbcType="VARCHAR" property="type" />
|
| | | <result column="period" jdbcType="VARCHAR" property="period" />
|
| | | <result column="start_date_from" jdbcType="TIMESTAMP" property="startDateFrom" />
|
| | |
| | | <result column="status" jdbcType="VARCHAR" property="status" />
|
| | | <result column="detail" jdbcType="VARCHAR" property="detail" />
|
| | | <result column="department" jdbcType="VARCHAR" property="department" />
|
| | | <result column="department_name" jdbcType="VARCHAR" property="departmentName" />
|
| | | <result column="specification" jdbcType="VARCHAR" property="specification" />
|
| | | |
| | | </resultMap>
|
| | |
|
| | | <select id="queryPage" resultMap="FullResultMap">
|
| | | |
| | | SELECT mm.id,mm.machine_id,m.name machine_name,mm.user_id,u.name user_name,style,department,sn,mm.type,start_date_from,start_date_to,complete_date_from,complete_date_to,is_qualified,mm.status,mm.detail |
| | | SELECT mm.id,mm.machine_id,m.name machine_name,mm.user_id,u.name user_name,style,mm.department,ud.name department_name,ma.uuid,ma.type,start_date_from,start_date_to,complete_date_from,complete_date_to,is_qualified,mm.status,mm.detail |
| | | FROM machine_maintain mm left join machine m on mm.machine_id=m.id left join sys_account u on mm.user_id=u.id
|
| | | left join machine_account ma on m.id=ma.machine_id
|
| | | left join use_department ud on mm.department=ud.id
|
| | | <where>
|
| | | <if test="dto.sn != null and dto.sn != ''">
|
| | | <bind name="sn" value="'%' + dto.sn + '%'" />
|
| | | and sn like #{sn}
|
| | | <if test="dto.uuid != null and dto.uuid != ''">
|
| | | <bind name="uuid" value="'%' + dto.uuid + '%'" />
|
| | | and ma.uuid like #{uuid}
|
| | | </if>
|
| | | <if test="dto.type != null and dto.type != ''">
|
| | | <bind name="type" value="'%' + dto.type + '%'" />
|
| | | and type like #{type}
|
| | | and ma.type like #{type}
|
| | | </if>
|
| | | <if test="dto.department != null and dto.department != ''">
|
| | | <if test="dto.department != null">
|
| | | and department=#{dto.department}
|
| | | </if>
|
| | | <if test="dto.machineId != null">
|