diff --git a/database_script.sql b/database_script.sql index 2907cae50..1416bb041 100644 --- a/database_script.sql +++ b/database_script.sql @@ -305,7 +305,7 @@ INSERT INTO `VERIFICATION` USE measurement_devices; INSERT INTO `CALIBRATION_MODULE` -(`id`,`condDesignation`, `deviceType`,`email`,`employeeFullName`,`moduleType`,`organizationCode`,`serialNumber`,`telephone`,`workDate`,`calibratorId`) +(`moduleId`,`condDesignation`, `deviceType`,`email`,`employeeFullName`,`moduleType`,`organizationCode`,`serialNumber`,`telephone`,`workDate`,`calibratorId`) VALUES (1,'АС-П', 'WATER', 'module@gmail.com', 'Пупкін Євген Вікторович', 'mobile_station', '569859878', '895678', '0634524378', '2015-10-25', '11'), (2,'АС-К', 'WATER', 'ex@gmail.com', 'Мупкін Орест Вікторович', 'mobile_station', '569859333', '111678', '0634524888', '2015-10-25', '11'), @@ -330,9 +330,21 @@ INSERT INTO `CALIBRATION_TEST` VALUES (2, 'В зоні', '2015-07-24 11:49:42', INSERT INTO `CALIBRATION_TEST` VALUES (3, 'В зоні', '2015-09-15 12:40:30', 76, 77, 'Державна система забезпечення єдності вимірювань', 'ДСТУ 2681-94', 'Successful Test', NULL, 8, 30, 'SUCCESS', 'bbae737e-d7fe-4fff-a4c1-bca0ab5ec706'); INSERT INTO `CALIBRATION_TEST` VALUES (4, 'Придатний', '2015-07-24 11:57:42', 75, 77, 'Державна система забезпечення єдності вимірювань', 'ДСТУ 2681-94', 'Тест №7', NULL, 7, 77, 'SUCCESS', '44479022-k720-5524-ab71-eed574d1b48d'); INSERT INTO `CALIBRATION_TEST` VALUES (5, 'Придатний', '2015-07-24 12:41:42', 72, 75, 'Державна система забезпечення єдності вимірювань', 'ДСТУ 2681-94', 'Тест №7', NULL, 7, 77, 'FAILED', '44479022-k720-5524-ab71-eed574d1b48d'); -UPDATE `CALIBRATION_TEST` +/*UPDATE `CALIBRATION_TEST` SET -`consumptionStatus` = 'IN_THE_AREA'; +`consumptionStatus` = 'IN_THE_AREA' +*/ + + +USE measurement_devices; +-- ------------------------------- СALIBRATION DISASSEMBLY TEAM ---------------------------- -- +INSERT INTO `DISASSEMBLY_TEAM` (`id`, `name`, `effectiveTo`, `specialization`, `leaderFullName`, `leaderPhone`, `leaderEmail`, `calibratorId`) +VALUES +('1', 'Dart Vader', '2015-10-20', 'WATER', 'Nazarkevych V.T.', '957000105', 'ladykkevych@gmail.com', '11'), +('2', 'Dart', '2015-10-24', 'WATER', 'Nazarkevych V.T.', '957000105', 'ladykkevych@gmail.com', '11'), +('3', 'Dart Vader 1', '2015-10-24', 'WATER', 'Nazarkevych V.T.', '957000105', 'ladykkevych@gmail.com', '11'), +('4', 'Dart Vader 2', '2015-11-24', 'WATER', 'Nazarkevych V.T.', '957000105', 'ladykkevych@gmail.com', '11'); + UPDATE `VERIFICATION` diff --git a/repository/src/main/java/com/softserve/edu/entity/catalogue/Team/DisassemblyTeam.java b/repository/src/main/java/com/softserve/edu/entity/catalogue/Team/DisassemblyTeam.java new file mode 100644 index 000000000..f503eb4ed --- /dev/null +++ b/repository/src/main/java/com/softserve/edu/entity/catalogue/Team/DisassemblyTeam.java @@ -0,0 +1,67 @@ +package com.softserve.edu.entity.catalogue.Team; + + +import com.softserve.edu.entity.device.Device; +import com.softserve.edu.entity.organization.Organization; +import lombok.*; + +import javax.persistence.*; +import java.util.Date; + +/** + * Disassembly team entity. Contain information about teams. + */ +@Entity +@Getter +@Setter +@EqualsAndHashCode(of = "id") +@NoArgsConstructor(access = AccessLevel.PROTECTED) +@Table(name = "DISASSEMBLY_TEAM") +public class DisassemblyTeam { + + @Setter(AccessLevel.PRIVATE) + @Id + private String id; + + private String name; + + @Temporal(TemporalType.DATE) + private Date effectiveTo; + + @Enumerated(EnumType.STRING) + private Device.DeviceType specialization; + + private String leaderFullName; + + private String leaderPhone; + + private String leaderEmail; + + @ManyToOne(fetch = FetchType.EAGER) + @JoinColumn(name = "calibratorId") + private Organization organization; + + public DisassemblyTeam(String id, String name, Date effectiveTo, Device.DeviceType specialization, String leaderFullName, + String leaderPhone, String leaderEmail) { + this.id = id; + this.name = name; + this.effectiveTo = effectiveTo; + this.specialization = specialization; + this.leaderFullName = leaderFullName; + this.leaderPhone = leaderPhone; + this.leaderEmail = leaderEmail; + } + + @Override + public String toString() { + return "DisassemblyTeam{" + + "id='" + id + '\'' + + ", name='" + name + '\'' + + ", effectiveTo=" + effectiveTo + + ", specialization=" + specialization + + ", leaderFullName='" + leaderFullName + '\'' + + ", leaderPhone='" + leaderPhone + '\'' + + ", leaderEmail='" + leaderEmail + '\'' + + '}'; + } +} diff --git a/repository/src/main/java/com/softserve/edu/entity/device/MeasuringEquipment.java b/repository/src/main/java/com/softserve/edu/entity/device/MeasuringEquipment.java index 23b278e71..666e1353b 100644 --- a/repository/src/main/java/com/softserve/edu/entity/device/MeasuringEquipment.java +++ b/repository/src/main/java/com/softserve/edu/entity/device/MeasuringEquipment.java @@ -2,10 +2,7 @@ import lombok.*; -import javax.persistence.Entity; -import javax.persistence.GeneratedValue; -import javax.persistence.Id; -import javax.persistence.Table; +import javax.persistence.*; @Entity @@ -16,9 +13,9 @@ @NoArgsConstructor public class MeasuringEquipment { - @Id - @GeneratedValue @Setter(AccessLevel.PRIVATE) + @Id + @GeneratedValue(strategy = GenerationType.IDENTITY) private Long id; private String name; diff --git a/repository/src/main/java/com/softserve/edu/entity/organization/Organization.java b/repository/src/main/java/com/softserve/edu/entity/organization/Organization.java index d13669a7b..4b83c64fb 100644 --- a/repository/src/main/java/com/softserve/edu/entity/organization/Organization.java +++ b/repository/src/main/java/com/softserve/edu/entity/organization/Organization.java @@ -1,23 +1,17 @@ package com.softserve.edu.entity.organization; import com.fasterxml.jackson.annotation.JsonBackReference; - import com.softserve.edu.entity.Address; import com.softserve.edu.entity.catalogue.Locality; +import com.softserve.edu.entity.catalogue.Team.DisassemblyTeam; import com.softserve.edu.entity.device.CalibrationModule; import com.softserve.edu.entity.device.Device; import com.softserve.edu.entity.enumeration.organization.OrganizationType; import com.softserve.edu.entity.user.User; import com.softserve.edu.entity.verification.calibration.CalibrationTask; - import lombok.*; -import org.hibernate.annotations.*; - import javax.persistence.*; -import javax.persistence.CascadeType; -import javax.persistence.Entity; -import javax.persistence.Table; import java.util.Date; import java.util.HashSet; import java.util.Set; @@ -67,6 +61,10 @@ public class Organization { @JsonBackReference private Set modules = new HashSet<>(); + @OneToMany(mappedBy = "organization", cascade = CascadeType.ALL) + @JsonBackReference + private Set disassemblyTeams = new HashSet<>(); + @OneToMany(mappedBy = "organization", cascade = CascadeType.ALL) @JsonBackReference private Set tasks = new HashSet<>(); diff --git a/repository/src/main/java/com/softserve/edu/entity/verification/Verification.java b/repository/src/main/java/com/softserve/edu/entity/verification/Verification.java index 46c2bc811..26422a6ad 100644 --- a/repository/src/main/java/com/softserve/edu/entity/verification/Verification.java +++ b/repository/src/main/java/com/softserve/edu/entity/verification/Verification.java @@ -28,8 +28,8 @@ @Table(name = "VERIFICATION") public class Verification { - @Id @Setter(AccessLevel.PRIVATE) + @Id private String id; @Enumerated(EnumType.STRING) diff --git a/repository/src/main/java/com/softserve/edu/repository/CalibrationDisassemblyTeamRepository.java b/repository/src/main/java/com/softserve/edu/repository/CalibrationDisassemblyTeamRepository.java new file mode 100644 index 000000000..9d60fe692 --- /dev/null +++ b/repository/src/main/java/com/softserve/edu/repository/CalibrationDisassemblyTeamRepository.java @@ -0,0 +1,18 @@ +package com.softserve.edu.repository; + +import com.softserve.edu.entity.catalogue.Team.DisassemblyTeam; +import org.springframework.data.domain.Page; +import org.springframework.data.domain.Pageable; +import org.springframework.data.jpa.repository.JpaSpecificationExecutor; +import org.springframework.data.repository.PagingAndSortingRepository; + + +public interface CalibrationDisassemblyTeamRepository extends + PagingAndSortingRepository, JpaSpecificationExecutor { + + Page findAll(Pageable pageable); + + //Page findByCalibratorId(Long calibratorId, Pageable pageable); + + Page findByNameLikeIgnoreCase(String name, Pageable pageable); +} diff --git a/repository/src/main/java/com/softserve/edu/repository/MeasuringEquipmentRepository.java b/repository/src/main/java/com/softserve/edu/repository/MeasuringEquipmentRepository.java index 47e5cc123..2634a9d5d 100644 --- a/repository/src/main/java/com/softserve/edu/repository/MeasuringEquipmentRepository.java +++ b/repository/src/main/java/com/softserve/edu/repository/MeasuringEquipmentRepository.java @@ -10,7 +10,7 @@ @Repository public interface MeasuringEquipmentRepository extends CrudRepository { - public Page findAll(Pageable pageable); + Page findAll(Pageable pageable); Page findByNameLikeIgnoreCase(String name, Pageable pageable); } diff --git a/service/src/main/java/com/softserve/edu/service/calibrator/CalibratorDisassemblyTeamService.java b/service/src/main/java/com/softserve/edu/service/calibrator/CalibratorDisassemblyTeamService.java new file mode 100644 index 000000000..37d2a25dd --- /dev/null +++ b/service/src/main/java/com/softserve/edu/service/calibrator/CalibratorDisassemblyTeamService.java @@ -0,0 +1,27 @@ +package com.softserve.edu.service.calibrator; + + +import com.softserve.edu.entity.catalogue.Team.DisassemblyTeam; +import com.softserve.edu.entity.device.Device; +import com.softserve.edu.service.exceptions.DuplicateRecordException; +import org.springframework.data.domain.Page; + +import java.util.Date; +import java.util.List; + +public interface CalibratorDisassemblyTeamService { + + List getAll(); + + Page getDisassemblyTeamBySearchAndPagination(int pageNumber,int itemsPerPage, String search); + + void addDisassemblyTeam(DisassemblyTeam disassemblyTeam) throws DuplicateRecordException; + + DisassemblyTeam getDisassemblyTeamById(String teamId); + + void editDisassemblyTeam(String id, String name, Date effectiveTo, Device.DeviceType specialization, String leaderFullName, + String leaderPhone, String leaderEmail); + + void deleteDisassemblyTeam(String teamId); + +} diff --git a/service/src/main/java/com/softserve/edu/service/calibrator/impl/CalibrationDisassemblyTeamServiceImpl.java b/service/src/main/java/com/softserve/edu/service/calibrator/impl/CalibrationDisassemblyTeamServiceImpl.java new file mode 100644 index 000000000..d667d9417 --- /dev/null +++ b/service/src/main/java/com/softserve/edu/service/calibrator/impl/CalibrationDisassemblyTeamServiceImpl.java @@ -0,0 +1,73 @@ +package com.softserve.edu.service.calibrator.impl; + +import com.softserve.edu.entity.catalogue.Team.DisassemblyTeam; +import com.softserve.edu.entity.device.Device; +import com.softserve.edu.repository.CalibrationDisassemblyTeamRepository; +import com.softserve.edu.service.calibrator.CalibratorDisassemblyTeamService; +import com.softserve.edu.service.exceptions.DuplicateRecordException; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.data.domain.Page; +import org.springframework.data.domain.PageRequest; +import org.springframework.stereotype.Service; +import org.springframework.transaction.annotation.Transactional; + +import java.util.Date; +import java.util.List; + + +@Service +public class CalibrationDisassemblyTeamServiceImpl implements CalibratorDisassemblyTeamService { + + @Autowired + private CalibrationDisassemblyTeamRepository teamRepository; + + @Override + @Transactional + public List getAll() { + return (List) teamRepository.findAll(); + } + + @Override + @Transactional + public Page getDisassemblyTeamBySearchAndPagination(int pageNumber, int itemsPerPage, String search) { + PageRequest pageRequest = new PageRequest(pageNumber - 1, itemsPerPage); + return search == null ? teamRepository.findAll(pageRequest) : + teamRepository.findByNameLikeIgnoreCase("%" + search + "%", pageRequest); + } + + @Override + @Transactional + public void addDisassemblyTeam(DisassemblyTeam disassemblyTeam) throws DuplicateRecordException { + try { + teamRepository.save(disassemblyTeam); + } catch (Exception e) { + throw new DuplicateRecordException(String.format("Team %s already exists.", disassemblyTeam.getId())); + } + } + + @Override + @Transactional + public DisassemblyTeam getDisassemblyTeamById(String teamId) { + return teamRepository.findOne(teamId); + } + + @Override + @Transactional + public void editDisassemblyTeam(String id, String name, Date effectiveTo, Device.DeviceType specialization, + String leaderFullName, String leaderPhone, String leaderEmail) { + DisassemblyTeam team = teamRepository.findOne(id); + team.setName(name); + team.setEffectiveTo(effectiveTo); + team.setSpecialization(specialization); + team.setLeaderFullName(leaderFullName); + team.setLeaderPhone(leaderPhone); + team.setLeaderEmail(leaderEmail); + teamRepository.save(team); + } + + @Override + @Transactional + public void deleteDisassemblyTeam(String teamId) { + teamRepository.delete(teamRepository.findOne(teamId)); + } +} diff --git a/service/src/main/java/com/softserve/edu/service/calibrator/specifications/CalibrationDisassenblyTeamSpecifications.java b/service/src/main/java/com/softserve/edu/service/calibrator/specifications/CalibrationDisassenblyTeamSpecifications.java new file mode 100644 index 000000000..42d2cfbfb --- /dev/null +++ b/service/src/main/java/com/softserve/edu/service/calibrator/specifications/CalibrationDisassenblyTeamSpecifications.java @@ -0,0 +1,84 @@ +package com.softserve.edu.service.calibrator.specifications; + +import com.softserve.edu.entity.catalogue.Team.DisassemblyTeam; +import com.softserve.edu.entity.device.Device; +import org.springframework.data.jpa.domain.Specification; + +import java.util.Date; + +/** + * Created for filtering data using PagingAndSortingRepository + */ +public class CalibrationDisassenblyTeamSpecifications { + + /** + * build query for id, filtering by id + * @param id + * @return query, for searching + */ + public static Specification disassemblyTeamHasId(String id) { + return (root, criteriaQuery, criteriaBuilder) -> criteriaBuilder.equal(root.get("id"), id); + } + + /** + * build query for name, filtering by name + * @param name + * @return query, for searching + */ + public static Specification disassemblyTeamHasName(String name) { + return (root, criteriaQuery, criteriaBuilder) -> criteriaBuilder.equal(root.get("name"), name); + } + + /** + * build query for effectiveTo, filtering by effective + * @param effectiveTo + * @return query, for searching + */ + public static Specification disassemblyTeamHasEffectiveTo(Date effectiveTo) { + return (root, criteriaQuery, criteriaBuilder) -> criteriaBuilder.lessThan(root.get("effectiveTo"), effectiveTo); + } + + /** + * build query for disassemblyTeamType, filtering by disassemblyTeamType + * @param disassemblyTeamType + * @return query, for searching + */ + public static Specification disassemblyTeamHasType(Device.DeviceType disassemblyTeamType){ + return (root, criteriaQuery, criteriaBuilder) -> + criteriaBuilder.equal(root.get("specialization"), disassemblyTeamType); + } + + /** + * build query for leaderFullName, filtering by leaderFullName + * @param leaderFullName + * @return query, for searching + */ + public static Specification disassemblyTeamHasLeaderFullName(String leaderFullName) { + return (root, criteriaQuery, criteriaBuilder) -> + criteriaBuilder.equal(root.get("leaderFullName"), leaderFullName); + } + + /** + * build query for leaderPhone, filtering by leaderPhone + * @param leaderPhone + * @return query, for searching + */ + public static Specification disassemblyTeamHasLeaderPhone(String leaderPhone) { + return (root, criteriaQuery, criteriaBuilder) -> criteriaBuilder.equal(root.get("leaderPhone"), leaderPhone); + } + + /** + * build query for leaderEmail, filtering by leaderEmail + * @param leaderEmail + * @return query, for searching + */ + public static Specification disassemblyTeamHasLeaderEmail(String leaderEmail) { + return (root, criteriaQuery, criteriaBuilder) -> criteriaBuilder.equal(root.get("leaderEmail"), leaderEmail); + } + + public static Specification disassemblyTeamHasCalibratorId(Long calibratorId){ + return (root, criteriaQuery, criteriaBuilder) -> + criteriaBuilder.equal(root.get("organization").get("id"), calibratorId); + } + +} diff --git a/service/src/main/java/com/softserve/edu/service/exceptions/DuplicateRecordException.java b/service/src/main/java/com/softserve/edu/service/exceptions/DuplicateRecordException.java new file mode 100644 index 000000000..c46745501 --- /dev/null +++ b/service/src/main/java/com/softserve/edu/service/exceptions/DuplicateRecordException.java @@ -0,0 +1,10 @@ +package com.softserve.edu.service.exceptions; + +import lombok.NoArgsConstructor; + +@NoArgsConstructor +public class DuplicateRecordException extends Exception { + public DuplicateRecordException(String format) { + super(format); + } +} diff --git a/service/src/main/java/com/softserve/edu/service/tool/impl/MeasuringEquipmentServiceImpl.java b/service/src/main/java/com/softserve/edu/service/tool/impl/MeasuringEquipmentServiceImpl.java index 53b52c869..0d157a189 100644 --- a/service/src/main/java/com/softserve/edu/service/tool/impl/MeasuringEquipmentServiceImpl.java +++ b/service/src/main/java/com/softserve/edu/service/tool/impl/MeasuringEquipmentServiceImpl.java @@ -28,7 +28,8 @@ public List getAll() { public Page getMeasuringEquipmentsBySearchAndPagination(int pageNumber, int itemsPerPage, String search) { PageRequest pageRequest = new PageRequest(pageNumber - 1, itemsPerPage); - return search == null ? measuringEquipmentRepository.findAll(pageRequest) : measuringEquipmentRepository.findByNameLikeIgnoreCase("%" + search + "%", pageRequest); + return search == null ? measuringEquipmentRepository.findAll(pageRequest) : + measuringEquipmentRepository.findByNameLikeIgnoreCase("%" + search + "%", pageRequest); } @Override @@ -45,12 +46,14 @@ public MeasuringEquipment getMeasuringEquipmentById(Long equipmentId) { @Override @Transactional - public void editMeasuringEquipment(Long equipmentId, String name, String deviceType, String manufacturer, String verificationInterval) { + public void editMeasuringEquipment(Long equipmentId, String name, String deviceType, String manufacturer, + String verificationInterval) { MeasuringEquipment measuringEquipment = measuringEquipmentRepository.findOne(equipmentId); measuringEquipment.setName(name); measuringEquipment.setDeviceType(deviceType); measuringEquipment.setManufacturer(manufacturer); measuringEquipment.setVerificationInterval(verificationInterval); + measuringEquipmentRepository.save(measuringEquipment); } @Override diff --git a/web/src/main/java/com/softserve/edu/controller/calibrator/CalibratorDisassemblyTeamController.java b/web/src/main/java/com/softserve/edu/controller/calibrator/CalibratorDisassemblyTeamController.java new file mode 100644 index 000000000..377e7b790 --- /dev/null +++ b/web/src/main/java/com/softserve/edu/controller/calibrator/CalibratorDisassemblyTeamController.java @@ -0,0 +1,140 @@ +package com.softserve.edu.controller.calibrator; + + +import com.softserve.edu.dto.PageDTO; +import com.softserve.edu.dto.calibrator.CalibrationDisassemblyTeamDTO; +import com.softserve.edu.dto.calibrator.DisassemblyTeamPageItem; +import com.softserve.edu.entity.catalogue.Team.DisassemblyTeam; +import com.softserve.edu.service.calibrator.CalibratorDisassemblyTeamService; +import com.softserve.edu.service.exceptions.DuplicateRecordException; +import org.apache.log4j.Logger; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.data.domain.Page; +import org.springframework.http.HttpStatus; +import org.springframework.http.ResponseEntity; +import org.springframework.web.bind.annotation.*; + +@RestController +@RequestMapping(value = "/calibrator/disassemblyTeam/", produces = "application/json") +public class CalibratorDisassemblyTeamController { + + private final Logger logger = Logger.getLogger(CalibratorDisassemblyTeamController.class); + + + @Autowired + private CalibratorDisassemblyTeamService teamService; + + /** + * Responds a page according to input data and search value + * @param pageNumber current page number + * @param itemsPerPage counts of elements per one page + * @param search keyword for looking entities by DisassemblyTeam.name + * @return a page of DisassemblyTeam with their total amount + */ + @RequestMapping(value = "{pageNumber}/{itemsPerPage}/{search}", method = RequestMethod.GET) + public PageDTO pageDisassemblyTeamsWithSearch( + @PathVariable Integer pageNumber, @PathVariable Integer itemsPerPage, @PathVariable String search) { + + Page page = teamService + .getDisassemblyTeamBySearchAndPagination(pageNumber, itemsPerPage, search) + .map(disassemblyTeam -> new DisassemblyTeamPageItem(disassemblyTeam.getId(), + disassemblyTeam.getName(), disassemblyTeam.getEffectiveTo(), + disassemblyTeam.getSpecialization(), disassemblyTeam.getLeaderFullName(), + disassemblyTeam.getLeaderPhone(), disassemblyTeam.getLeaderEmail())); + return new PageDTO<>(page.getTotalElements(), page.getContent()); + } + + /** + * Responds a page according to input data. + * + *

+ * Note that this uses method {@code pageDisassemblyTeamsWithSearch}, whereas + * search values is {@literal null} + * + * @param pageNumber current page number + * @param itemsPerPage counts of elements per one page + * @return a page of DisassemblyTeam with their total amount + */ + @RequestMapping(value = "{pageNumber}/{itemsPerPage}", method = RequestMethod.GET) + public PageDTO getDisassemblyTeamsPage(@PathVariable Integer pageNumber, + @PathVariable Integer itemsPerPage) { + return pageDisassemblyTeamsWithSearch(pageNumber, itemsPerPage, null); + } + + /** + * Responds DisassemblyTeam by Id + * @param disassemblyTeamId + * @return DisassemblyTeam + */ + @RequestMapping(value = "getDisassemblyTeam/{disassemblyTeamId}", method = RequestMethod.GET) + public ResponseEntity getDisassemblyTeam(@PathVariable String disassemblyTeamId){ + DisassemblyTeam foundDisassemblyTeam = teamService.getDisassemblyTeamById(disassemblyTeamId); + return new ResponseEntity<>(foundDisassemblyTeam, HttpStatus.OK); + } + + /** + * Saves Disassembly team in database + * @param disassemblyTeamDTO object with disassembly team data + * @return a response body with http status {@literal CREATED} if everything + * DisassemblyTeam successfully created or else http + * status {@literal CONFLICT} + */ + @RequestMapping(value = "add", method = RequestMethod.POST) + public ResponseEntity addDisassemblyTeam(@RequestBody CalibrationDisassemblyTeamDTO disassemblyTeamDTO){ + HttpStatus httpStatus = HttpStatus.CREATED; + try { + DisassemblyTeam createdDisassemblyTeam = disassemblyTeamDTO.saveTeam(); + teamService.addDisassemblyTeam(createdDisassemblyTeam); + }catch (DuplicateRecordException e) { + logger.error("GOT EXCEPTION " + e.getMessage()); + httpStatus = HttpStatus.CONFLICT;//from body get a message + return new ResponseEntity(e, httpStatus); + }catch (Exception e) { + logger.error("GOT EXCEPTION " + e.getMessage()); + httpStatus = HttpStatus.CONFLICT; + } + return new ResponseEntity(httpStatus); + } + + /** + * Edit DisassemblyTeam in database + * + * @param disassemblyTeamDTO object with edited team data + * @param disassemblyTeamId + * @return a response body with http status {@Literal CREATED} if everything Disassembly team successfully + * edited or else http status {@Literal CONFLICT} + */ + @RequestMapping(value = "edit/{disassemblyTeamId}", method = RequestMethod.POST) + public ResponseEntity editDisassemblyTeam(@RequestBody CalibrationDisassemblyTeamDTO disassemblyTeamDTO, + @PathVariable String disassemblyTeamId){ + HttpStatus httpStatus = HttpStatus.OK; + try { + teamService.editDisassemblyTeam(disassemblyTeamId, disassemblyTeamDTO.getName(), + disassemblyTeamDTO.getEffectiveTo(), disassemblyTeamDTO.getSpecialization(), + disassemblyTeamDTO.getLeaderFullName(), disassemblyTeamDTO.getLeaderPhone(), + disassemblyTeamDTO.getLeaderEmail()); + } catch (Exception e) { + logger.error("GOT EXCEPTION " + e.getMessage()); + httpStatus = HttpStatus.CONFLICT; + } + return new ResponseEntity(httpStatus); + } + + /** + * Delete disassembly team from database + * @param disassemblyTeamId + * return http status {@Literal OK} if disassembly team successfully deleted from database, + * else http status {@literal CONFLICT} + */ + @RequestMapping(value = "delete/{disassemblyTeamId}", method = RequestMethod.POST) + private ResponseEntity deleteDisassemblyTeam(@PathVariable String disassemblyTeamId) { + HttpStatus httpStatus = HttpStatus.OK; + try { + teamService.deleteDisassemblyTeam(disassemblyTeamId); + } catch (Exception e) { + logger.error("GOT EXCEPTION " + e.getMessage()); + httpStatus = HttpStatus.CONFLICT; + } + return new ResponseEntity(httpStatus); + } +} diff --git a/web/src/main/java/com/softserve/edu/controller/calibrator/MeasuringEquipmentController.java b/web/src/main/java/com/softserve/edu/controller/calibrator/MeasuringEquipmentController.java index 1152a44b0..214e3b756 100644 --- a/web/src/main/java/com/softserve/edu/controller/calibrator/MeasuringEquipmentController.java +++ b/web/src/main/java/com/softserve/edu/controller/calibrator/MeasuringEquipmentController.java @@ -39,9 +39,11 @@ public class MeasuringEquipmentController { public PageDTO pageMeasuringEquipmentsWithSearch(@PathVariable Integer pageNumber, @PathVariable Integer itemsPerPage, @PathVariable String search) { - Page page = measureEquipmentService.getMeasuringEquipmentsBySearchAndPagination(pageNumber, itemsPerPage, search) - .map(measuringEquipment -> new MeasuringEquipmentPageItem(measuringEquipment.getId(), measuringEquipment.getName(), - measuringEquipment.getDeviceType(), measuringEquipment.getManufacturer(), measuringEquipment.getVerificationInterval())); + Page page = measureEquipmentService + .getMeasuringEquipmentsBySearchAndPagination(pageNumber, itemsPerPage, search) + .map(measuringEquipment -> new MeasuringEquipmentPageItem(measuringEquipment.getId(), + measuringEquipment.getName(), measuringEquipment.getDeviceType(), + measuringEquipment.getManufacturer(), measuringEquipment.getVerificationInterval())); return new PageDTO<>(page.getTotalElements(), page.getContent()); } @@ -60,7 +62,8 @@ public PageDTO pageMeasuringEquipmentsWithSearch(@Pa * @return a page of MeasuringEquipments with their total amount */ @RequestMapping(value = "{pageNumber}/{itemsPerPage}", method = RequestMethod.GET) - public PageDTO getMeasuringEquipmentsPage(@PathVariable Integer pageNumber, @PathVariable Integer itemsPerPage) { + public PageDTO getMeasuringEquipmentsPage(@PathVariable Integer pageNumber, + @PathVariable Integer itemsPerPage) { return pageMeasuringEquipmentsWithSearch(pageNumber, itemsPerPage, null); } @@ -107,11 +110,12 @@ public ResponseEntity addMeasuringEquipment(@RequestBody MeasuringEquipmentDTO m * successfully edited or else http status {@literal CONFLICT} */ @RequestMapping(value = "edit/{mEquipmentId}", method = RequestMethod.POST) - public ResponseEntity editMeasuringEquipment(@RequestBody MeasuringEquipmentDTO mEquipmentDTO, @PathVariable Long mEquipmentId){ + public ResponseEntity editMeasuringEquipment(@RequestBody MeasuringEquipmentDTO mEquipmentDTO, + @PathVariable Long mEquipmentId){ HttpStatus httpStatus = HttpStatus.OK; try { - measureEquipmentService.editMeasuringEquipment(mEquipmentId, mEquipmentDTO.getName(), mEquipmentDTO.getDeviceType(), - mEquipmentDTO.getManufacturer(), mEquipmentDTO.getVerificationInterval()); + measureEquipmentService.editMeasuringEquipment(mEquipmentId, mEquipmentDTO.getName(), + mEquipmentDTO.getDeviceType(), mEquipmentDTO.getManufacturer(), mEquipmentDTO.getVerificationInterval()); } catch (Exception e) { logger.error("GOT EXCEPTION " + e.getMessage()); httpStatus = HttpStatus.CONFLICT; diff --git a/web/src/main/java/com/softserve/edu/dto/calibrator/CalibrationDisassemblyTeamDTO.java b/web/src/main/java/com/softserve/edu/dto/calibrator/CalibrationDisassemblyTeamDTO.java new file mode 100644 index 000000000..b7f00ac44 --- /dev/null +++ b/web/src/main/java/com/softserve/edu/dto/calibrator/CalibrationDisassemblyTeamDTO.java @@ -0,0 +1,29 @@ +package com.softserve.edu.dto.calibrator; + + +import com.softserve.edu.entity.catalogue.Team.DisassemblyTeam; +import com.softserve.edu.entity.device.Device; +import lombok.AccessLevel; +import lombok.Getter; +import lombok.NoArgsConstructor; +import lombok.Setter; + +import java.util.Date; + +@Getter +@Setter +@NoArgsConstructor(access = AccessLevel.PUBLIC) +public class CalibrationDisassemblyTeamDTO { + + private String id; + private String name; + private Date effectiveTo; + private Device.DeviceType specialization; + private String leaderFullName; + private String leaderPhone; + private String leaderEmail; + + public DisassemblyTeam saveTeam() { + return new DisassemblyTeam(id, name, effectiveTo, specialization, leaderFullName, leaderPhone, leaderEmail); + } +} diff --git a/web/src/main/java/com/softserve/edu/dto/calibrator/DisassemblyTeamPageItem.java b/web/src/main/java/com/softserve/edu/dto/calibrator/DisassemblyTeamPageItem.java new file mode 100644 index 000000000..162d9b201 --- /dev/null +++ b/web/src/main/java/com/softserve/edu/dto/calibrator/DisassemblyTeamPageItem.java @@ -0,0 +1,36 @@ +package com.softserve.edu.dto.calibrator; + +import com.softserve.edu.entity.device.Device; +import lombok.AccessLevel; +import lombok.Getter; +import lombok.NoArgsConstructor; +import lombok.Setter; + +import java.util.Date; + + +@Getter +@Setter +@NoArgsConstructor(access = AccessLevel.PROTECTED) +public class DisassemblyTeamPageItem { + + private String id; + private String name; + private Date effectiveTo; + private Device.DeviceType specialization; + private String leaderFullName; + private String leaderPhone; + private String leaderEmail; + + public DisassemblyTeamPageItem(String id, String name, Date effectiveTo, Device.DeviceType specialization, String leaderFullName, + String leaderPhone, String leaderEmail) { + this.id = id; + this.name = name; + this.effectiveTo = effectiveTo; + this.specialization = specialization; + this.leaderFullName = leaderFullName; + this.leaderPhone = leaderPhone; + this.leaderEmail = leaderEmail; + } + +} diff --git a/web/src/main/webapp/resources/app/calibrator/controllers/DisassemblyTeamAddModalController.js b/web/src/main/webapp/resources/app/calibrator/controllers/DisassemblyTeamAddModalController.js new file mode 100644 index 000000000..ec3e09394 --- /dev/null +++ b/web/src/main/webapp/resources/app/calibrator/controllers/DisassemblyTeamAddModalController.js @@ -0,0 +1,173 @@ +angular.module('employeeModule') + .controller('DisassemblyTeamAddModalControllerCalibrator', + ['$rootScope', '$scope', '$modalInstance', 'DisassemblyTeamServiceCalibrator', '$modal', + function ($rootScope, $scope, $modalInstance, DisassemblyTeamServiceCalibrator, $modal) { + + + var teamData = {}; + /** + * Closes modal window on browser's back/forward button click. + */ + $rootScope.$on('$locationChangeStart', function() { + $modalInstance.close(); + }); + + /** + * Resets Team form + */ + $scope.resetTeamForm = function () { + $scope.$broadcast('show-errors-reset'); + $scope.teamNumber = null; + $scope.teamFormData = null; + //$scope.teamFormData = null; + //$scope.nameValidation = null; + //$scope.deviceTypeValidation = null; + //$scope.manufacturerValidation = null; + //$scope.verificationIntervalValidation = null; + //$scope.incorrectValue = false; + }; + $scope.resetTeamForm(); + + function retranslater() { + teamData = { + teamNumber: $scope.teamFormData.teamNumber + //firstName: $scope.employeeFormData.firstName, + } + } + + /** + * Validates team form before saving + */ + $scope.onTeamFormSubmit = function () { + $scope.$broadcast('show-errors-check-validity'); + if (!$scope.teamNumberValidation.isValid) { + saveDisassemblyTeam(); + $modal.open({ + animation: true, + templateUrl: '/resources/app/calibrator/views/modals/disassembly-team-adding-success.html', + controller: function ($modalInstance) { + this.ok = function () { + $modalInstance.close(); + } + }, + controllerAs: 'successController', + size: 'md' + }); + } else { + $scope.incorrectValue = true; + } + }; + + /** + * Saves new team from the form in database. + * If everything is ok then resets the team + * form and updates table with teams. + */ + function saveDisassemblyTeam() { + DisassemblyTeamServiceCalibrator.saveDisassemblyTeam( + $scope.teamFormData).then( + function (data) { + if (data == 201) { + $scope.closeModal(); + $scope.resetTeamForm(); + $rootScope.onTableHandling(); + } + }); + } + + + /** + * Closes the modal window for adding new + * team. + */ + $rootScope.closeModal = function () { + $modalInstance.close(); + }; + + $scope.checkAll = function (caseForValidation) { + switch (caseForValidation) { + case ('teamNumber')://TODO should rewrite it (check if team is already exist) + var teamNumber = $scope.teamFormData.teamNumber; + if (teamNumber == null) { + } else if ($scope.TEAM_USERNAME_REGEX.test(teamNumber)) { + validator('teamNumber', false) + } else { + validator('teamNumber', true); + } + break; + case ('name'): + var name = $scope.teamFormData.name; + if (name == null) { + + } else if (/^[a-zA-Z0-9]{5,20}$/.test(name)) { + validator('name', false); + } else { + validator('name', true); + } + break; + case ('effectiveTo'): + var effectiveTo = $scope.teamFormData.effectiveTo; + if (deviceType == null) { + + } else if (/^[A-Z0-9]{4,10}$/.test(deviceType)) { + validator('deviceType', false); + } else { + validator('deviceType', true); + } + break; + case ('manufacturer'): + var manufacturer = $scope.teamFormData.manufacturer; + if (manufacturer == null) { + } + else if (/^[a-zA-Z0-9]{5,20}$/.test(manufacturer)) { + validator('manufacturer', false); + } else { + validator('manufacturer', true); + } + break; + case ('verificationInterval'): + var verificationInterval = $scope.teamFormData.verificationInterval; + if (verificationInterval == null) { + } + else if (/^\d{2,5}$/.test(verificationInterval)) { + validator('verificationInterval', false); + } else { + validator('verificationInterval', true); + } + break; + } + + } + + function validator(caseForValidation, isValid) { + switch (caseForValidation) { + case ('name'): + $scope.nameValidation = { + isValid: isValid, + css: isValid ? 'has-error' : 'has-success' + } + break; + case ('deviceType'): + $scope.deviceTypeValidation = { + isValid: isValid, + css: isValid ? 'has-error' : 'has-success' + } + break; + case ('manufacturer'): + $scope.manufacturerValidation = { + isValid: isValid, + css: isValid ? 'has-error' : 'has-success' + } + break; + case ('verificationInterval'): + $scope.verificationIntervalValidation = { + isValid: isValid, + css: isValid ? 'has-error' : 'has-success' + } + break; + } + } + + $scope.TEAM_USERNAME_REGEX = /^[a-z0-9_-]{3,16}$/; + + }]); diff --git a/web/src/main/webapp/resources/app/calibrator/controllers/DisassemblyTeamControllerCalibrator.js b/web/src/main/webapp/resources/app/calibrator/controllers/DisassemblyTeamControllerCalibrator.js new file mode 100644 index 000000000..a60141782 --- /dev/null +++ b/web/src/main/webapp/resources/app/calibrator/controllers/DisassemblyTeamControllerCalibrator.js @@ -0,0 +1,67 @@ +angular + .module('employeeModule') + .controller('DisassemblyTeamControllerCalibrator', ['$rootScope', '$scope', '$modal', + 'DisassemblyTeamServiceCalibrator', '$timeout', + function ($rootScope, $scope, $modal, disassemblyTeamServiceCalibrator, $timeout) { + $scope.totalItems = 0; + $scope.currentPage = 1; + $scope.itemsPerPage = 5; + $scope.pageContent = []; + + /** + * Updates the table with DisassemblyTeams + */ + $rootScope.onTableHandling = function () { + disassemblyTeamServiceCalibrator + .getPage($scope.currentPage, $scope.itemsPerPage, $scope.searchData) + .then(function (data) { + $scope.pageContent = data.content; + $scope.totalItems = data.totalItems; + }) + }; + $rootScope.onTableHandling(); + + + /** + * Opens modal window for adding new team + */ + $scope.openAddDisassemblyTeamModal = function() { + var addTeamModal = $modal + .open({ + animation : true, + controller : 'DisassemblyTeamAddModalControllerCalibrator', + templateUrl : '/resources/app/calibrator/views/modals/disassembly-team-add-modal.html' + }) + }; + + /** + * Opens modal window for editing team + */ + $scope.openEditDisassemblyTeamModal = function(teamId) { + $rootScope.teamId = teamId; + disassemblyTeamServiceCalibrator.getDisassemblyTeamWithId($rootScope.teamId) + .then(function(data) { + $rootScope.team = data; + } + ); + var teamDTOModal = $modal + .open({ + animation : true, + controller : 'DisassemblyTeamEditModalControllerCalibrator', + templateUrl : '/resources/app/calibrator/views/modals/disassembly-team-edit-modal.html' + }) + }; + + /** + * delete team + */ + $scope.deleteDisassemblyTeam = function (teamId) { + $rootScope.teamId = teamId; + disassemblyTeamServiceCalibrator.deleteDisassemblyTeam($rootScope.teamId); + $timeout(function () { + console.log('delete with timeout'); + $rootScope.onTableHandling(); + }, 700); + } + + }]); diff --git a/web/src/main/webapp/resources/app/calibrator/controllers/DisassemblyTeamEditModalController.js b/web/src/main/webapp/resources/app/calibrator/controllers/DisassemblyTeamEditModalController.js new file mode 100644 index 000000000..30715f6f2 --- /dev/null +++ b/web/src/main/webapp/resources/app/calibrator/controllers/DisassemblyTeamEditModalController.js @@ -0,0 +1,141 @@ +/** + * Created by Volodya NT on 22.10.2015. + */angular.module('employeeModule') + .controller('DisassemblyTeamEditModalControllerCalibrator', + ['$rootScope', '$scope', '$modalInstance', 'MeasuringEquipmentServiceCalibrator', '$log', + function ($rootScope, $scope, $modalInstance, MeasuringEquipmentServiceCalibrator, $log) { + + /** + * Closes modal window on browser's back/forward button click. + */ + $rootScope.$on('$locationChangeStart', function() { + $modalInstance.close(); + }); + + /** + * Resets Equipment form + */ + $scope.resetEquipmentForm = function () { + $scope.$broadcast('show-errors-reset'); + $scope.equipment = null; + $scope.nameValidation = null; + $scope.deviceTypeValidation = null; + $scope.manufacturerValidation = null; + $scope.verificationIntervalValidation = null; + $scope.incorrectValue = false; + }; + + /** + * Edit equipment. If everything is ok then + * resets the equipment form and closes modal + * window. + */ + $scope.editEquipment = function () { + var equipmentForm = { + name: $scope.equipment.name, + deviceType: $scope.equipment.deviceType, + manufacturer: $scope.equipment.manufacturer, + verificationInterval: $scope.equipment.verificationInterval + + } + if (!$scope.nameValidation.isValid && !$scope.deviceTypeValidation.isValid + && !$scope.manufacturerValidation.isValid && !$scope.verificationIntervalValidation.isValid) { + MeasuringEquipmentServiceCalibrator.editEquipment( + equipmentForm, + $rootScope.equipmentId).then( + function (data) { + if (data == 200) { + $scope.closeModal(); + $scope.resetEquipmentForm(); + $rootScope.onTableHandling(); + } + }); + } else { + $scope.incorrectValue = true; + } + } + $log.debug($rootScope.equipment); + /** + * Closes edit modal window. + */ + $scope.closeModal = function () { + $modalInstance.close(); + }; + + $scope.checkAll = function (caseForValidation) { + switch (caseForValidation) { + case ('name'): + var name = $scope.equipment.name; + if (name == null) { + + } else if (/^[a-zA-Z0-9]{5,20}$/.test(name)) { + validator('name', false); + } else { + validator('name', true); + } + break; + case ('deviceType'): + var deviceType = $scope.equipment.deviceType; + if (deviceType == null) { + + } else if (/^[A-Z]{4,16}$/.test(deviceType)) { + validator('deviceType', false); + } else { + validator('deviceType', true); + } + break; + case ('manufacturer'): + var manufacturer = $scope.equipment.manufacturer; + if (manufacturer == null) { + } + else if (/^[a-zA-Z0-9]{5,20}$/.test(manufacturer)) { + validator('manufacturer', false); + } else { + validator('manufacturer', true); + } + break; + case ('verificationInterval'): + var verificationInterval = $scope.equipment.verificationInterval; + if (verificationInterval == null) { + } + else if (/^\d{2,5}$/.test(verificationInterval)) { + validator('verificationInterval', false); + } else { + validator('verificationInterval', true); + } + break; + } + + } + + function validator(caseForValidation, isValid) { + switch (caseForValidation) { + case ('name'): + $scope.nameValidation = { + isValid: isValid, + css: isValid ? 'has-error' : 'has-success' + } + break; + case ('deviceType'): + $scope.deviceTypeValidation = { + isValid: isValid, + css: isValid ? 'has-error' : 'has-success' + } + break; + case ('manufacturer'): + $scope.manufacturerValidation = { + isValid: isValid, + css: isValid ? 'has-error' : 'has-success' + } + break; + case ('verificationInterval'): + $scope.verificationIntervalValidation = { + isValid: isValid, + css: isValid ? 'has-error' : 'has-success' + } + break; + } + } + + }]); + diff --git a/web/src/main/webapp/resources/app/calibrator/services/DisassemblyTeamServiceCalibrator.js b/web/src/main/webapp/resources/app/calibrator/services/DisassemblyTeamServiceCalibrator.js new file mode 100644 index 000000000..ef4ab7adf --- /dev/null +++ b/web/src/main/webapp/resources/app/calibrator/services/DisassemblyTeamServiceCalibrator.js @@ -0,0 +1,52 @@ +angular + .module('employeeModule') + .factory('DisassemblyTeamServiceCalibrator', +function ($http) { + return { + getPage : function (pageNumber, itemsPerPage, search) { + var url = '/calibrator/disassemblyTeam/' + pageNumber + '/' + itemsPerPage; + if (search != null && search != undefined && search != "") { + url += '/' + search; + } + + return $http.get(url) + .then(function (result) { + return result.data; + }); + }, + isDisassemblyTeamNameAvailable : function (Tname) { + var url = '/calibrator/disassemblyTeam/available/' + Tname; + return $http.get(url) + .then(function(result) { + return result.data; + }); + }, + saveDisassemblyTeam : function(formData) { + return $http.post("/calibrator/disassemblyTeam/add", formData) + .then(function (result) { + return result.status; + }); + }, + getDisassemblyTeamWithId : function (id) { + var url = '/calibrator/disassemblyTeam/getDisassemblyTeam/' + id; + return $http.get(url).then(function(result) { + return result.data; + }); + }, + editDisassemblyTeam : function(formData, id) { + var url = '/calibrator/disassemblyTeam/edit/' + id; + return $http.post(url, formData) + .then(function(result) { + return result.status; + }); + }, + deleteDisassemblyTeam : function(disassemblyTeamId) { + var url = '/calibrator/disassemblyTeam/delete/' + disassemblyTeamId; + return $http.post(url) + .then(function(result) { + return result.status; + }); + } + + } +}); diff --git a/web/src/main/webapp/resources/app/calibrator/views/disassembly-team.html b/web/src/main/webapp/resources/app/calibrator/views/disassembly-team.html new file mode 100644 index 000000000..da663c682 --- /dev/null +++ b/web/src/main/webapp/resources/app/calibrator/views/disassembly-team.html @@ -0,0 +1,105 @@ + + + + + + + +

+
+
+

{{'DISASSEMBLY_TEAM' | translate}}

+
+
+ +
+
+ +
+
+

+ +
+
+
+
{{'DISASSEMBLY_TEAMS' | translate}}
+
+
+
+ +
+ +
+
+
+ + + + + + + + + + + + + + + + + + + + +
+ +
+ + + +
{{'ID'| translate}}{{'NAME' | translate}}{{'EFFECTIVE_TO_DATE' | translate }}{{ 'LEADER_FULL_NAME' | translate }}{{'LEADER_PHONE' | translate}}{{ 'LEADER_EMAIL' | translate }}{{ 'ACTION' | translate }}
{{ disassemblyTeam.id }}{{ disassemblyTeam.name }}{{ disassemblyTeam.effectiveTo }}{{ disassemblyTeam.leaderFullName }}{{ disassemblyTeam.leaderPhone }}{{ disassemblyTeam.leaderEmail }} + + + + +
+
+
+ +
+
+ +
+
+
+
+
+
+
+ + + + \ No newline at end of file diff --git a/web/src/main/webapp/resources/app/calibrator/views/modals/disassembly-team-add-modal.html b/web/src/main/webapp/resources/app/calibrator/views/modals/disassembly-team-add-modal.html new file mode 100644 index 000000000..f851fa712 --- /dev/null +++ b/web/src/main/webapp/resources/app/calibrator/views/modals/disassembly-team-add-modal.html @@ -0,0 +1,62 @@ + + + \ No newline at end of file diff --git a/web/src/main/webapp/resources/app/calibrator/views/modals/disassembly-team-adding-success.html b/web/src/main/webapp/resources/app/calibrator/views/modals/disassembly-team-adding-success.html new file mode 100644 index 000000000..8c2156c43 --- /dev/null +++ b/web/src/main/webapp/resources/app/calibrator/views/modals/disassembly-team-adding-success.html @@ -0,0 +1,8 @@ + + + \ No newline at end of file diff --git a/web/src/main/webapp/resources/app/calibrator/views/modals/disassembly-team-edit-modal.html b/web/src/main/webapp/resources/app/calibrator/views/modals/disassembly-team-edit-modal.html new file mode 100644 index 000000000..d538fea65 --- /dev/null +++ b/web/src/main/webapp/resources/app/calibrator/views/modals/disassembly-team-edit-modal.html @@ -0,0 +1,10 @@ + + + + + + + + + + \ No newline at end of file diff --git a/web/src/main/webapp/resources/app/employeeModule.js b/web/src/main/webapp/resources/app/employeeModule.js index 94362f42c..73d64b345 100644 --- a/web/src/main/webapp/resources/app/employeeModule.js +++ b/web/src/main/webapp/resources/app/employeeModule.js @@ -97,6 +97,11 @@ templateUrl: '/resources/app/calibrator/views/measurement-equipments.html', controller: 'MeasuringEquipmentControllerCalibrator' }) + .state("disassembly-team-calibrator", { + url: 'calibrator/disassemblyTeam/', + templateUrl: 'resources/app/calibrator/views/disassembly-team.html', + controller: 'DisassemblyTeamControllerCalibrator' + }) .state("employee-show-calibrator", { url: '/calibrator/employee-show', templateUrl: '/resources/app/calibrator/views/employee/show-employee.html', @@ -247,6 +252,11 @@ 'calibrator/controllers/MeasuringEquipmentControllerCalibrator', 'calibrator/controllers/MeasuringEquipmentAddModalControllerCalibrator', 'calibrator/controllers/MeasuringEquipmentEditModalControllerCalibrator', + + 'calibrator/controllers/DisassemblyTeamAddModalController', + 'calibrator/controllers/DisassemblyTeamEditModalController', + 'calibrator/controllers/DisassemblyTeamControllerCalibrator', + 'calibrator/controllers/UploadBbiFileController', 'calibrator/controllers/UploadArchiveController', 'calibrator/controllers/UploadPhotoController', @@ -264,6 +274,8 @@ 'calibrator/services/MeasuringEquipmentServiceCalibrator', 'calibrator/controllers/PieCalibratorEmployee', + 'calibrator/services/DisassemblyTeamServiceCalibrator', + 'verificator/controllers/TopNavBarControllerVerificator', 'verificator/controllers/MainPanelControllerVerificator', 'verificator/controllers/NewVerificationsControllerVerificator', diff --git a/web/src/main/webapp/resources/app/index.jsp b/web/src/main/webapp/resources/app/index.jsp index 83991c9ca..5fe2bf147 100644 --- a/web/src/main/webapp/resources/app/index.jsp +++ b/web/src/main/webapp/resources/app/index.jsp @@ -181,6 +181,7 @@ лабораторія) +
  • Планування завдання @@ -222,6 +223,13 @@
  • + +
  • + + Довідник демонтажних бригад + +
  • + diff --git a/web/src/main/webapp/resources/app/provider/views/employee/employee-add-modal.html b/web/src/main/webapp/resources/app/provider/views/employee/employee-add-modal.html index a86eac520..89eadb0f2 100644 --- a/web/src/main/webapp/resources/app/provider/views/employee/employee-add-modal.html +++ b/web/src/main/webapp/resources/app/provider/views/employee/employee-add-modal.html @@ -9,6 +9,7 @@