Merge remote-tracking branch 'origin/master'
| | |
| | | private CapacityScopeService capacityScopeService; |
| | | |
| | | private ProductService productService; |
| | | @ValueAuth |
| | | |
| | | @ValueClassify("è½åèå´") |
| | | @ApiOperation(value = "è·åé¡¹ç®æ£éªåæ°å表") |
| | | @PostMapping("/selectItemParameterList") |
| | | public Result selectItemParameterList(@RequestBody Map<String, Object> data) throws Exception { |
| | |
| | | public Result selectTestObjectByName() { |
| | | return Result.success(capacityScopeService.selectTestObjectByName()); |
| | | } |
| | | @ValueClassify("设å¤å·¥å
·æç»") |
| | | @ValueClassify("设å¤") |
| | | @ApiOperation(value = "设å¤éé¢éæ©æ£éªé¡¹ç®(æ å½¢ç»æ)") |
| | | @PostMapping("/getInsProduction") |
| | | public Result getInsProduction(){ |
| | | return Result.success(capacityScopeService.getInsProduction()); |
| | | } |
| | | @ValueClassify(value="产åç»´æ¤") |
| | | @ValueClassify(value="è½åèå´") |
| | | @ApiOperation(value = "ç»´æ¤æ£éªå¯¹è±¡ç产å") |
| | | @PostMapping("/selectProductListByObjectId") |
| | | public Result selectProductListByObjectId(@RequestBody Map<String, Object> data) throws Exception { |
| | |
| | | package com.yuanchu.mom.controller; |
| | | |
| | | import com.baomidou.mybatisplus.extension.plugins.pagination.Page; |
| | | import com.yuanchu.mom.annotation.ValueAuth; |
| | | import com.yuanchu.mom.annotation.ValueClassify; |
| | | import com.yuanchu.mom.pojo.Certification; |
| | | import com.yuanchu.mom.pojo.Device; |
| | | import com.yuanchu.mom.service.CertificationService; |
| | | import com.yuanchu.mom.utils.JackSonUtil; |
| | | import com.yuanchu.mom.vo.Result; |
| | |
| | | import org.springframework.web.bind.annotation.RequestMapping; |
| | | import org.springframework.web.bind.annotation.RestController; |
| | | |
| | | import java.util.List; |
| | | import java.util.Map; |
| | | |
| | | @Api(tags = "èµè´¨è¯´æ") |
| | |
| | | public class CertificationController { |
| | | |
| | | private CertificationService certificationService; |
| | | @ValueAuth |
| | | |
| | | @ValueClassify("å®éªå®¤èµè´¨") |
| | | @ApiOperation(value = "æ¥è¯¢èµè´¨æç»å表") |
| | | @PostMapping("/getCertificationDetail") |
| | | public Result getCertificationDetail(@RequestBody Map<String, Object> data) throws Exception { |
| | |
| | | import com.yuanchu.mom.annotation.ValueAuth; |
| | | import com.yuanchu.mom.annotation.ValueClassify; |
| | | import com.yuanchu.mom.dto.UserDto; |
| | | import com.yuanchu.mom.dto.UserPageDto; |
| | | import com.yuanchu.mom.pojo.Department; |
| | | import com.yuanchu.mom.pojo.User; |
| | | import com.yuanchu.mom.service.DepartmentService; |
| | | import com.yuanchu.mom.utils.JackSonUtil; |
| | | import com.yuanchu.mom.vo.Result; |
| | |
| | | import io.swagger.annotations.ApiOperation; |
| | | import lombok.AllArgsConstructor; |
| | | import org.springframework.web.bind.annotation.*; |
| | | import org.springframework.stereotype.Controller; |
| | | |
| | | import java.util.Map; |
| | | |
| | |
| | | public Result addDepartment(@RequestBody Department department) { |
| | | return Result.success(departmentService.addDepartment(department)); |
| | | } |
| | | @ValueAuth |
| | | @ApiOperation(value = "è·åé¨é¨æ ") |
| | | @GetMapping("/selectDepartment") |
| | | @ValueClassify("人åæç»") |
| | | public Result selectDepartment() { |
| | | return Result.success(departmentService.selectDepartment()); |
| | | } |
| | |
| | | import com.yuanchu.mom.utils.JackSonUtil; |
| | | import com.yuanchu.mom.vo.Result; |
| | | import io.swagger.annotations.Api; |
| | | import io.swagger.annotations.ApiImplicitParam; |
| | | import io.swagger.annotations.ApiImplicitParams; |
| | | import io.swagger.annotations.ApiOperation; |
| | | import org.springframework.beans.factory.annotation.Value; |
| | | import org.springframework.web.bind.annotation.*; |
| | |
| | | |
| | | @Value("${file.path}") |
| | | private String filePath; |
| | | @ValueAuth |
| | | |
| | | @ValueClassify("设å¤") |
| | | @ApiOperation(value = "æ¥è¯¢è®¾å¤è¯¦æ
å表") |
| | | @PostMapping("/selectDeviceParameter") |
| | | public Result selectDeviceParameter(@RequestBody Map<String, Object> data) throws Exception { |
| | |
| | | DeviceDto itemParameter = JackSonUtil.unmarshal(JackSonUtil.marshal(data.get("entity")), DeviceDto.class); |
| | | return Result.success(deviceService.selectDeviceParameter(page, itemParameter)); |
| | | } |
| | | @ValueClassify("设å¤å·¥å
·æç»") |
| | | @ValueClassify("设å¤") |
| | | @ApiOperation(value = "æ·»å 设å¤è¯¦æ
åæ°") |
| | | @PostMapping("/addDeviceParameter") |
| | | public Result addDeviceParameter(@RequestBody Device itemParameter) { |
| | | return Result.success(deviceService.addDeviceParameter(itemParameter)); |
| | | } |
| | | @ValueClassify("设å¤å·¥å
·æç»") |
| | | @ValueClassify("设å¤") |
| | | @ApiOperation(value = "å é¤è®¾å¤è¯¦æ
åæ°") |
| | | @PostMapping("/delDeviceParameter") |
| | | public Result<?> delDeviceParameter(Integer id) { |
| | | return Result.success(deviceService.delDeviceParameter(id)); |
| | | } |
| | | @ValueClassify("设å¤å·¥å
·æç»") |
| | | @ValueClassify("设å¤") |
| | | @ApiOperation(value = "ä¿®æ¹è®¾å¤è¯¦æ
åæ°") |
| | | @PostMapping("/upDeviceParameter") |
| | | public Result<?> upDeviceParameter(@RequestBody Device itemParameter) { |
| | |
| | | package com.yuanchu.mom.controller; |
| | | |
| | | |
| | | import cn.hutool.core.lang.UUID; |
| | | import com.baomidou.mybatisplus.extension.plugins.pagination.Page; |
| | | import com.yuanchu.mom.annotation.ValueAuth; |
| | | import com.yuanchu.mom.annotation.ValueClassify; |
| | |
| | | import org.springframework.web.bind.annotation.*; |
| | | |
| | | import javax.annotation.Resource; |
| | | import javax.annotation.Resources; |
| | | import java.util.Map; |
| | | |
| | | /** |
| | |
| | | |
| | | @Resource |
| | | private LaboratoryService laboratoryService; |
| | | @ValueAuth |
| | | |
| | | @ValueClassify("åºææè®¾æ½") |
| | | @ApiOperation(value = "æ¥è¯¢å®éªå®¤ç®¡çå表") |
| | | @PostMapping("/selectItemParameter") |
| | | public Result selectItemParameter(@RequestBody Map<String, Object> data) throws Exception { |
| | |
| | | import com.yuanchu.mom.annotation.ValueAuth; |
| | | import com.yuanchu.mom.annotation.ValueClassify; |
| | | import com.yuanchu.mom.pojo.StandardMethod; |
| | | import com.yuanchu.mom.pojo.StructureItemParameter; |
| | | import com.yuanchu.mom.service.StandardMethodService; |
| | | import com.yuanchu.mom.utils.JackSonUtil; |
| | | import com.yuanchu.mom.vo.Result; |
| | | import io.swagger.annotations.Api; |
| | | import io.swagger.annotations.ApiOperation; |
| | | import lombok.AllArgsConstructor; |
| | | import lombok.Value; |
| | | import org.springframework.context.annotation.Lazy; |
| | | import org.springframework.web.bind.annotation.*; |
| | | |
| | | import java.util.Map; |
| | |
| | | public class StandardMethodController { |
| | | |
| | | private StandardMethodService standardMethodService; |
| | | @ValueAuth |
| | | |
| | | @ValueClassify("å®éªå®¤çæ£æµè½åæ¡£æ¡") |
| | | @ApiOperation(value = "è·åæ åæ¹æ³å表") |
| | | @PostMapping("/selectStandardMethodList") |
| | | public Result selectStandardMethodList(@RequestBody Map<String, Object> data) throws Exception { |
| | |
| | | } |
| | | Map<String, Integer> map = new HashMap<>(); |
| | | map.put("userId", id); |
| | | map.put("look", authMapper.countPower(id, method)); |
| | | Integer look = authMapper.countPower(id, method); |
| | | map.put("look", look==null?0:look); |
| | | return map; |
| | | } |
| | | } |
| | |
| | | package com.yuanchu.mom.controller; |
| | | |
| | | import cn.hutool.core.bean.BeanUtil; |
| | | import com.alibaba.fastjson.JSON; |
| | | import com.alibaba.fastjson.JSONArray; |
| | | import com.baomidou.mybatisplus.extension.plugins.pagination.Page; |
| | |
| | | import com.yuanchu.mom.service.InsOrderService; |
| | | import com.yuanchu.mom.service.InsOrderTemplateService; |
| | | import com.yuanchu.mom.service.InsProductService; |
| | | import com.yuanchu.mom.service.InsSampleService; |
| | | import com.yuanchu.mom.utils.JackSonUtil; |
| | | import com.yuanchu.mom.vo.Result; |
| | | import io.swagger.annotations.*; |
| | | import io.swagger.annotations.Api; |
| | | import io.swagger.annotations.ApiImplicitParam; |
| | | import io.swagger.annotations.ApiImplicitParams; |
| | | import io.swagger.annotations.ApiOperation; |
| | | import lombok.AllArgsConstructor; |
| | | import org.springframework.beans.BeanUtils; |
| | | import org.springframework.context.annotation.Bean; |
| | | import org.springframework.web.bind.annotation.*; |
| | | |
| | | import java.time.LocalDateTime; |
| | |
| | | private InsOrderTemplateService insOrderTemplateService; |
| | | |
| | | //è·åæ£éªä¸åæ°æ® |
| | | @ValueAuth |
| | | @ValueClassify("æ£éªä¸å") |
| | | @ApiOperation(value = "æ¥è¯¢æ£éªä¸åæ°æ®") |
| | | @PostMapping("/selectInsOrderParameter") |
| | | public Result selectInsOrderParameter(@RequestBody Map<String, Object> data) throws Exception { |
| | |
| | | SampleProductDto2 sampleProductDto = JackSonUtil.unmarshal(JackSonUtil.marshal(data.get("entity")), SampleProductDto2.class); |
| | | return Result.success(insOrderService.selectSampleAndProductByOrderId(page, sampleProductDto)); |
| | | } |
| | | @ValueAuth |
| | | @ValueClassify("è´¹ç¨ç»è®¡") |
| | | @ApiOperation(value = "è´¹ç¨ç»è®¡") |
| | | @PostMapping("/costStatistics") |
| | | public Result<?> costStatistics(@RequestBody Map<String, Object> data) throws Exception { |
| | |
| | | CostStatisticsDto costStatisticsDto = JackSonUtil.unmarshal(JackSonUtil.marshal(data.get("entity")), CostStatisticsDto.class); |
| | | return Result.success(insOrderService.costStatistics(page, costStatisticsDto)); |
| | | } |
| | | @ValueAuth |
| | | @ValueClassify("ç»è®¡å¾è¡¨") |
| | | @ApiOperation(value = "æ ·åç¼ºé·ææ°") |
| | | @PostMapping("/selectSampleDefects") |
| | | public Result selectSampleDefects(Integer size, Integer current, String inspectionItems, String orderNumber) { |
| | |
| | | |
| | | private InsOrderPlanService insOrderPlanService; |
| | | |
| | | @ValueAuth |
| | | @ValueClassify("æ£éªä»»å¡") |
| | | @ApiOperation(value = "è·åæ£éªä»»å¡å表") |
| | | @PostMapping("/selectInsOrderPlanList") |
| | | public Result selectInsOrderPlanList(@RequestBody Map<String, Object> data) throws Exception { |
| | |
| | | @Value("${wordUrl}") |
| | | private String wordUrl; |
| | | |
| | | @ValueAuth |
| | | @ValueClassify("æ¥åç¼å¶") |
| | | @ApiOperation(value = "æ¥è¯¢æ£éªæ¥åæ°æ®") |
| | | @PostMapping("/pageInsReport") |
| | | public Result pageInsReport(@RequestBody Map<String, Object> data) throws Exception { |
| | |
| | | package com.yuanchu.mom.controller; |
| | | |
| | | |
| | | import com.baomidou.mybatisplus.extension.plugins.pagination.Page; |
| | | import com.yuanchu.mom.annotation.ValueAuth; |
| | | import com.yuanchu.mom.annotation.ValueClassify; |
| | | import com.yuanchu.mom.dto.SampleOrderDto; |
| | | import com.yuanchu.mom.service.ReportService; |
| | | import com.yuanchu.mom.utils.JackSonUtil; |
| | | import com.yuanchu.mom.vo.Result; |
| | | import io.swagger.annotations.Api; |
| | | import io.swagger.annotations.ApiOperation; |
| | | import lombok.AllArgsConstructor; |
| | | import org.springframework.web.bind.annotation.*; |
| | | |
| | | import java.time.LocalDate; |
| | | import java.time.LocalDateTime; |
| | | import java.util.Map; |
| | | import org.springframework.web.bind.annotation.GetMapping; |
| | | import org.springframework.web.bind.annotation.PostMapping; |
| | | import org.springframework.web.bind.annotation.RequestMapping; |
| | | import org.springframework.web.bind.annotation.RestController; |
| | | |
| | | @RestController |
| | | @AllArgsConstructor |
| | |
| | | public class ReportController { |
| | | |
| | | private ReportService reportService; |
| | | @ValueAuth |
| | | |
| | | @ValueClassify("ç»è®¡å¾è¡¨") |
| | | @ApiOperation(value = "æ¯æ¥ä¸å¡ç»è®¡") |
| | | @GetMapping("/businessStatisticsByDay") |
| | | public Result businessStatisticsByDay(){ |
| | | return Result.success(reportService.businessStatisticsByDay()); |
| | | } |
| | | @ValueAuth |
| | | @ValueClassify("ç»è®¡å¾è¡¨") |
| | | @ApiOperation(value = "æ£æµé¡¹ç®ç»è®¡") |
| | | @GetMapping("/testProductByDay") |
| | | public Result testProductByDay(){ |
| | | return Result.success(reportService.testProductByDay()); |
| | | } |
| | | @ValueAuth |
| | | @ApiOperation(value = "é¦é¡µ-->æ¥åä»»å¡å¾") |
| | | @ApiOperation(value = "æ¥åä»»å¡å¾") |
| | | @GetMapping("/calendarWorkByWeek") |
| | | public Result calendarWorkByWeek(){ |
| | | return Result.success(reportService.calendarWorkByWeek()); |
| | | } |
| | | @ValueClassify("个人é¦é¡µ") |
| | | @ApiOperation(value = "é¦é¡µ-->æ·»å æ¥ç¨") |
| | | @ApiOperation(value = "æ·»å æ¥ç¨") |
| | | @PostMapping("/addSchedule") |
| | | public Result addSchedule(String time, String text){ |
| | | return Result.success(reportService.addSchedule(time,text)); |
| | | } |
| | | @ValueAuth |
| | | @ApiOperation(value = "é¦é¡µ-->æçæ¥ç¨") |
| | | @ApiOperation(value = "æçæ¥ç¨") |
| | | @PostMapping("/ScheduleByMe") |
| | | public Result ScheduleByMe(String date){ |
| | | return Result.success(reportService.ScheduleByMe(date)); |
| | |
| | | import com.yuanchu.mom.utils.JackSonUtil; |
| | | import com.yuanchu.mom.vo.Result; |
| | | import io.swagger.annotations.Api; |
| | | import io.swagger.annotations.ApiImplicitParams; |
| | | import io.swagger.annotations.ApiOperation; |
| | | import lombok.AllArgsConstructor; |
| | | import org.springframework.web.bind.annotation.*; |
| | |
| | | public class StandardTemplateController { |
| | | |
| | | private StandardTemplateService standardTemplateService; |
| | | @ValueAuth |
| | | @ValueClassify("æ ååº") |
| | | @ApiOperation(value = "è·ååå§è®°å½æ¨¡æ¿å表") |
| | | @PostMapping("/selectStandardTemplatePageList") |
| | | public Result selectStandardTemplatePageList(@RequestBody Map<String, Object> data) throws Exception { |
| | |
| | | StandardTemplate standardTemplate = JackSonUtil.unmarshal(JackSonUtil.marshal(data.get("entity")), StandardTemplate.class); |
| | | return Result.success(standardTemplateService.selectStandardTemplatePageList(page, standardTemplate)); |
| | | } |
| | | @ValueClassify("åå§è®°å½æ¨¡æ¿") |
| | | @ValueClassify("æ ååº") |
| | | @ApiOperation(value = "æ·»å åå§è®°å½æ¨¡æ¿") |
| | | @PostMapping("/addStandardTemplate") |
| | | public Result addStandardTemplate(@RequestBody StandardTemplate standardTemplate) { |
| | | return Result.success(standardTemplateService.addStandardTemplate(standardTemplate)); |
| | | } |
| | | @ValueClassify("åå§è®°å½æ¨¡æ¿") |
| | | @ValueClassify("æ ååº") |
| | | @ApiOperation(value = "ä¿®æ¹åå§è®°å½æ¨¡æ¿") |
| | | @PostMapping("/upStandardTemplate") |
| | | public Result<?> upStandardTemplate(@RequestBody StandardTemplate standardTemplate) { |
| | | return Result.success(standardTemplateService.upStandardTemplate(standardTemplate)); |
| | | } |
| | | @ValueClassify("åå§è®°å½æ¨¡æ¿") |
| | | @ValueClassify("æ ååº") |
| | | @ApiOperation(value = "å é¤åå§è®°å½æ¨¡æ¿") |
| | | @PostMapping("/delStandardTemplate") |
| | | public Result<?> delStandardTemplate(Integer id) { |
| | |
| | | private StandardMethodListService standardMethodListService; |
| | | |
| | | private StandardProductListService standardProductListService; |
| | | @ValueAuth |
| | | |
| | | @ValueClassify("æ ååº") |
| | | @ApiOperation(value = "è·åæ åæ ") |
| | | @GetMapping("/selectStandardTreeList") |
| | | public Result selectStandardTreeList(){ |
| | |
| | | public Result addStandardTree(@RequestBody StandardTree standardTree){ |
| | | return Result.success(standardTreeService.addStandardTree(standardTree)); |
| | | } |
| | | |
| | | @ValueAuth |
| | | @ValueClassify("æ ååº") |
| | | @ApiOperation(value = "ç»æ åæ æ·»å æ£éªæ å") |
| | | @PostMapping("/addStandardMethodList") |
| | |
| | | public Result upStandardProductList(@RequestBody StandardProductList list){ |
| | | return Result.success(standardProductListService.upStandardProductList(list)); |
| | | } |
| | | @ValueAuth |
| | | @ValueClassify("æ ååº") |
| | | @ApiOperation(value = "å 餿 åæ ä¸çæ£éªæ å") |
| | | @PostMapping("/delStandardMethodByFLSSM") |
| | | public Result delStandardMethodByFLSSM(Integer id){ |
| | | return Result.success(standardMethodListService.delStandardMethodByFLSSM(id)); |
| | | } |
| | | @ValueAuth |
| | | @ValueClassify("æ ååº") |
| | | @ApiOperation(value = "å 餿 åæ ä¸çæ£éªé¡¹ç®") |
| | | @PostMapping("/delStandardProductByIds") |
| | |
| | | JSONArray lists = JSON.parseArray(ids); |
| | | return Result.success(standardProductListService.delStandardProduct(lists)); |
| | | } |
| | | @ValueAuth |
| | | @ValueClassify("æ ååº") |
| | | @ApiOperation(value = "æ°å¢æ åæ ä¸çæ£éªé¡¹ç®") |
| | | @PostMapping("/addStandardProduct") |
| | | public Result addStandardProduct(String ids, String tree){ |
| | | return Result.success(standardTreeService.addStandardProduct(ids, tree)); |
| | | } |
| | | |
| | | @ValueClassify("æ ååº") |
| | | @ApiOperation(value = "å 餿 åæ çå±çº§") |
| | | @PostMapping("/delStandardTree") |
| | |
| | | @ApiOperation(value = "éè¿æ£éªæ åæ¥è¯¢æ£éªé¡¹ç®") |
| | | @PostMapping("/selectStandardProductListByMethodId") |
| | | @ValueAuth |
| | | public Result selectStandardProductListByMethodId(Integer id, String tree){ |
| | | return Result.success(standardProductListService.selectStandardProductListByMethodId(id, tree)); |
| | | public Result selectStandardProductListByMethodId(Integer id, String tree, Integer page){ |
| | | return Result.success(standardProductListService.selectStandardProductListByMethodId(id, tree, page)); |
| | | } |
| | | |
| | | @ApiOperation(value = "è·åæ åæ ä¸æ åæ¹æ³æä¸¾") |
| | |
| | | public Result addWarehouse(String name) { |
| | | return Result.success(warehouseService.addWarehouse(name)); |
| | | } |
| | | @ValueAuth |
| | | |
| | | @ValueClassify("æ ·å管ç") |
| | | @GetMapping("/selectWarehouse") |
| | | @ApiOperation("æ¥è¯¢ä»åº") |
| | | public Result selectWarehouse() { |
| | |
| | | import com.yuanchu.mom.pojo.StandardProductList; |
| | | |
| | | import java.util.List; |
| | | import java.util.Map; |
| | | |
| | | /** |
| | | * @author Administrator |
| | |
| | | |
| | | List<StandardProductList> selectStandardProductList(InsSample insSample); |
| | | |
| | | List<StandardProductList> selectStandardProductListByMethodId(Integer id, String tree); |
| | | Map<String, Object> selectStandardProductListByMethodId(Integer id, String tree, Integer page); |
| | | |
| | | } |
| | |
| | | import org.springframework.stereotype.Service; |
| | | |
| | | import java.math.BigDecimal; |
| | | import java.util.ArrayList; |
| | | import java.util.List; |
| | | import java.util.Objects; |
| | | import java.util.*; |
| | | import java.util.concurrent.CompletableFuture; |
| | | import java.util.stream.Collectors; |
| | | |
| | |
| | | } |
| | | |
| | | @Override |
| | | public List<StandardProductList> selectStandardProductListByMethodId(Integer id, String tree) { |
| | | public Map<String, Object> selectStandardProductListByMethodId(Integer id, String tree, Integer page) { |
| | | String[] trees = tree.split(" - "); |
| | | List<StandardProductList> list = new ArrayList<>(); |
| | | if (trees.length == 3) { |
| | |
| | | } |
| | | } |
| | | } |
| | | if(page == 1){ |
| | | Integer userId = getLook.selectPowerByMethodAndUserId(null).get("userId"); |
| | | CompletableFuture.supplyAsync(() -> { |
| | | standardProductListMapper.delete(Wrappers.<StandardProductList>lambdaUpdate().eq(StandardProductList::getStandardMethodListId, id).like(StandardProductList::getTree, tree)); |
| | |
| | | e.printStackTrace(); |
| | | return null; |
| | | }); |
| | | return list; |
| | | } |
| | | Map<String, Object> map = new HashMap<>(); |
| | | try { |
| | | map.put("productList", list.subList((page - 1)*50, page * 50)); |
| | | }catch (IndexOutOfBoundsException e){ |
| | | map.put("productList", list.subList((page - 1)*50, list.size())); |
| | | } |
| | | map.put("total", list.size()); |
| | | return map; |
| | | } |
| | | } |
| | | |
| | |
| | | @ValueTableShow(value = 5,name = "ç¶æ") |
| | | private String insState; |
| | | |
| | | @ValueTableShow(value = 8,name = "æ£éªç»æ") |
| | | private Integer insResult; |
| | | @ValueTableShow(value = 8,name = "æ£éªå¼å§æ¶é´") |
| | | private String insTime; |
| | | |
| | | @ValueTableShow(value = 6,name = "çº¦å®æ¶é´") |
| | | private String appointed; |
| | |
| | | io.sample_type, |
| | | isu.user_id, |
| | | ip.son_laboratory, |
| | | io.ins_result |
| | | io.ins_time |
| | | FROM |
| | | ins_order io |
| | | LEFT JOIN ins_sample isa ON isa.ins_order_id = io.id |
| | |
| | | io.id |
| | | ) a |
| | | LEFT JOIN ins_order_state ios ON ios.ins_order_id = a.id AND ios.laboratory = a.son_laboratory |
| | | left join (SELECT c.user_id order_user_id, c.ins_sample_id from (SELECT * FROM ins_sample_user ORDER BY id DESC) c GROUP BY ins_sample_id having order_user_id = #{userId}) isu2 on isu2.ins_sample_id = a.id |
| | | left join (SELECT td.user_id order_user_id, td.ins_sample_id FROM ins_sample_user td,(SELECT max(id) id FROM ins_sample_user GROUP BY ins_sample_id) md where td.id = md.id and user_id = #{userId}) isu2 on isu2.ins_sample_id = a.id |
| | | ORDER BY |
| | | a.user_id DESC, |
| | | a.type DESC, |
| | |
| | | left join standard_tree st on st.laboratory = l.laboratory_name |
| | | and st.sample_type = sto.specimen_name |
| | | and st.sample = p.name |
| | | order by l.id,CAST(sto.code AS DECIMAL),st.id |
| | | order by l.id,CAST(sto.code AS DECIMAL),p.id,ISNULL(st.id),st.id |
| | | </select> |
| | | |
| | | <select id="selectStandardProductById" resultType="com.yuanchu.mom.pojo.StandardProductList"> |
| | |
| | | import io.swagger.annotations.Api; |
| | | import io.swagger.annotations.ApiOperation; |
| | | import lombok.AllArgsConstructor; |
| | | import org.apache.ibatis.annotations.Param; |
| | | import org.springframework.web.bind.annotation.PostMapping; |
| | | import org.springframework.web.bind.annotation.RequestBody; |
| | | import org.springframework.web.bind.annotation.RequestMapping; |
| | |
| | | @Resource |
| | | private AuxiliaryWorkingHoursService auxiliaryWorkingHoursService; |
| | | |
| | | @ValueClassify("å·¥æ¶ç®¡ç") |
| | | @ApiOperation(value="æ¥è¯¢è¾
å©å·¥æ¶") |
| | | @PostMapping("/selectAuxiliaryWorkingHours") |
| | | public Result selectAuxiliaryWorkingHours(@RequestBody Map<String, Object> data) throws Exception { |
| | |
| | | public Result insertAuxiliaryWorkingHours(@RequestBody AuxiliaryWorkingHours auxiliaryWorkingHours){ |
| | | return Result.success(auxiliaryWorkingHoursService.insertAuxiliaryWorkingHours(auxiliaryWorkingHours)); |
| | | } |
| | | |
| | | |
| | | } |
| | |
| | | import com.alibaba.excel.write.style.HorizontalCellStyleStrategy; |
| | | import com.alibaba.excel.write.style.column.LongestMatchColumnWidthStyleStrategy; |
| | | import com.baomidou.mybatisplus.extension.plugins.pagination.Page; |
| | | import com.yuanchu.mom.annotation.ValueClassify; |
| | | import com.yuanchu.mom.dto.PerformanceShiftAddDto; |
| | | import com.yuanchu.mom.pojo.PerformanceShift; |
| | | import com.yuanchu.mom.service.PerformanceShiftService; |
| | |
| | | @Autowired |
| | | private PerformanceShiftService performanceShiftService; |
| | | |
| | | @ApiOperation(value = "绩æç®¡ç-çæ¬¡-æç") |
| | | @ValueClassify("çæ¬¡") |
| | | @ApiOperation(value = "æç") |
| | | @PostMapping("add") |
| | | public Result<?> performanceShiftAdd(@RequestBody PerformanceShiftAddDto performanceShiftAddDto) { |
| | | performanceShiftService.performanceShiftAdd(performanceShiftAddDto); |
| | | return Result.success(); |
| | | } |
| | | |
| | | @ApiOperation(value = "绩æç®¡ç-çæ¬¡-æä»½å页æ¥è¯¢") |
| | | @ValueClassify("çæ¬¡") |
| | | @ApiOperation(value = "æä»½å页æ¥è¯¢") |
| | | @PostMapping("page") |
| | | public Result<?> performanceShiftPage(Integer size, Integer current, String time, String userName, String laboratory) { |
| | | return Result.success(performanceShiftService.performanceShiftPage(new Page<>(current, size), time, userName, laboratory)); |
| | | } |
| | | |
| | | @ApiOperation(value = "绩æç®¡ç-çæ¬¡-年份å页æ¥è¯¢") |
| | | @ValueClassify("çæ¬¡") |
| | | @ApiOperation(value = "年份å页æ¥è¯¢") |
| | | @PostMapping("pageYear") |
| | | public Result<?> performanceShiftPageYear(Integer size, Integer current, String time, String userName, String laboratory) { |
| | | return Result.success(performanceShiftService.performanceShiftPageYear(new Page<>(current, size), time, userName, laboratory)); |
| | | } |
| | | |
| | | @ApiOperation(value = "绩æç®¡ç-çæ¬¡-çæ¬¡ç¶æä¿®æ¹") |
| | | @ValueClassify("çæ¬¡") |
| | | @ApiOperation(value = "çæ¬¡ç¶æä¿®æ¹") |
| | | @PutMapping("update") |
| | | public Result<?> performanceShiftUpdate(@RequestBody PerformanceShift performanceShift) { |
| | | performanceShiftService.performanceShiftUpdate(performanceShift); |
| | | return Result.success(); |
| | | } |
| | | |
| | | @ApiOperation(value = "绩æç®¡ç-çæ¬¡-导åº") |
| | | @ValueClassify("çæ¬¡") |
| | | @ApiOperation(value = "导åº") |
| | | @GetMapping("export") |
| | | public void exportToExcel(@NotNull(message = "æ¶é´ä¸è½ä¸ºç©ºï¼") String time, String userName, String laboratory, Boolean isMonth, HttpServletResponse response) throws Exception { |
| | | Map<Object, Object> data; |
| | |
| | | type: com.alibaba.druid.pool.DruidDataSource |
| | | driverClassName: com.mysql.cj.jdbc.Driver |
| | | #url: jdbc:mysql://localhost:3306/center_lims?useSSL=false&useUnicode=true&characterEncoding=utf-8&serverTimezone=GMT%2B8 |
| | | url: jdbc:mysql://114.132.189.42:9004/center-lims?useSSL=false&useUnicode=true&characterEncoding=utf-8&serverTimezone=GMT%2B8 |
| | | # url: jdbc:mysql://114.132.189.42:9004/center-lims?useSSL=false&useUnicode=true&characterEncoding=utf-8&serverTimezone=GMT%2B8 |
| | | url: jdbc:mysql://localhost:3306/center-lims?useSSL=false&useUnicode=true&characterEncoding=utf-8&serverTimezone=GMT%2B8 |
| | | username: root |
| | | password: 123456 |
| | | druid: |
¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.yuanchu.mom.controller; |
| | | |
| | | import cn.hutool.http.HttpRequest; |
| | | import cn.hutool.http.HttpResponse; |
| | | import cn.hutool.http.HttpUtil; |
| | | import com.yuanchu.mom.annotation.ValueAuth; |
| | | import com.yuanchu.mom.pojo.AuthApi; |
| | | import com.yuanchu.mom.pojo.Company; |
| | | import com.yuanchu.mom.util.HeaderToken; |
| | | import com.yuanchu.mom.vo.Result; |
| | | import io.swagger.annotations.Api; |
| | | import io.swagger.annotations.ApiOperation; |
| | | import io.swagger.annotations.Authorization; |
| | | import lombok.AllArgsConstructor; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.web.bind.annotation.GetMapping; |
| | | import org.springframework.web.bind.annotation.RequestMapping; |
| | | import org.springframework.web.bind.annotation.RestController; |
| | | |
| | | import java.util.List; |
| | | |
| | | @RestController |
| | | @AllArgsConstructor |
| | | @RequestMapping("/companies") |
| | | @Api("ç»ç»æ¨¡å") |
| | | public class CompaniesController { |
| | | |
| | | @Autowired |
| | | private HeaderToken headerToken; |
| | | |
| | | @ValueAuth |
| | | @ApiOperation(value = "è·åç»ç»å表") |
| | | @GetMapping(value = "/selectCompaniesList") |
| | | public Result<List<Company>> selectcompaniesList(){ |
| | | return Result.success(headerToken.companyUrl()); |
| | | } |
| | | } |
| | |
| | | package com.yuanchu.mom.controller; |
| | | |
| | | import com.alibaba.fastjson.JSON; |
| | | import com.baomidou.mybatisplus.extension.plugins.pagination.Page; |
| | | import com.yuanchu.mom.annotation.ValueAuth; |
| | | import com.yuanchu.mom.annotation.ValueClassify; |
| | | import com.yuanchu.mom.dto.RolePowerDto; |
| | | import com.yuanchu.mom.pojo.Enums; |
| | | import com.yuanchu.mom.service.EnumService; |
| | | import com.yuanchu.mom.utils.JackSonUtil; |
| | |
| | | import io.swagger.annotations.Api; |
| | | import io.swagger.annotations.ApiOperation; |
| | | import lombok.AllArgsConstructor; |
| | | import org.springframework.web.bind.annotation.*; |
| | | import org.springframework.web.bind.annotation.PostMapping; |
| | | import org.springframework.web.bind.annotation.RequestBody; |
| | | import org.springframework.web.bind.annotation.RequestMapping; |
| | | import org.springframework.web.bind.annotation.RestController; |
| | | |
| | | import java.util.Map; |
| | | |
| | |
| | | |
| | | private EnumService enumService; |
| | | |
| | | @ValueAuth |
| | | @ValueClassify("æ°æ®åå
¸") |
| | | @ApiOperation(value = "è·åæä¸¾å表") |
| | | @PostMapping("/selectEnumList") |
| | | public Result selectEnumList(@RequestBody Map<String, Object> data) throws Exception { |
¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.yuanchu.mom.controller; |
| | | |
| | | import com.yuanchu.mom.annotation.ValueAuth; |
| | | import com.yuanchu.mom.pojo.Post; |
| | | import com.yuanchu.mom.util.HeaderToken; |
| | | import com.yuanchu.mom.vo.Result; |
| | | import io.swagger.annotations.Api; |
| | | import io.swagger.annotations.ApiOperation; |
| | | import lombok.AllArgsConstructor; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.web.bind.annotation.*; |
| | | |
| | | import java.util.List; |
| | | |
| | | @RestController |
| | | @AllArgsConstructor |
| | | @RequestMapping("/post") |
| | | @Api("å²ä½æ¨¡å") |
| | | public class PostController { |
| | | |
| | | @Autowired |
| | | private HeaderToken headerToken; |
| | | |
| | | @ValueAuth |
| | | @ApiOperation(value = "è·åå²ä½å表") |
| | | @PostMapping(value = "/selectPostList/{companyId}") |
| | | public Result<List<Post>> selectPostList(@PathVariable String companyId){ |
| | | return Result.success(headerToken.postUrl(companyId)); |
| | | } |
| | | } |
| | |
| | | import lombok.AllArgsConstructor; |
| | | import org.springframework.web.bind.annotation.*; |
| | | |
| | | import java.util.HashMap; |
| | | import java.util.List; |
| | | import java.util.Map; |
| | | |
| | | @RequestMapping("/role") |
| | |
| | | private RoleService roleService; |
| | | |
| | | private PowerService powerService; |
| | | |
| | | @ValueAuth |
| | | @ApiOperation(value = "è·åè§è²å表æä¸¾") |
| | | @GetMapping("/selectRoleList") |
| | |
| | | return Result.success(roleService.selectList()); |
| | | } |
| | | |
| | | @ValueAuth |
| | | @ValueClassify("è§è²ç®¡ç") |
| | | @ApiOperation(value = "è·åè§è²å表") |
| | | @PostMapping("/selectRoleLists") |
| | | public Result selectRoleLists(@RequestBody Map<String, Object> data) throws Exception { |
¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.yuanchu.mom.controller; |
| | | |
| | | |
| | | import com.yuanchu.mom.pojo.User; |
| | | import com.yuanchu.mom.util.HeaderToken; |
| | | import com.yuanchu.mom.vo.Result; |
| | | import io.swagger.annotations.Api; |
| | | import lombok.AllArgsConstructor; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.web.bind.annotation.*; |
| | | |
| | | import java.util.List; |
| | | |
| | | |
| | | @AllArgsConstructor |
| | | @RestController |
| | | @RequestMapping("/simple") |
| | | @Api("äººåæ¨¡å") |
| | | public class SimpleController { |
| | | |
| | | @Autowired |
| | | private HeaderToken headerToken; |
| | | |
| | | @PostMapping( value = "/selectSimpleList/companyId") |
| | | public Result<List<User>> selectSimpleList(@PathVariable String companyId){ |
| | | return Result.success(headerToken.userUrl(companyId)); |
| | | } |
| | | } |
| | |
| | | package com.yuanchu.mom.controller; |
| | | |
| | | |
| | | |
| | | import com.baomidou.mybatisplus.extension.plugins.pagination.Page; |
| | | import com.yuanchu.mom.annotation.ValueAuth; |
| | | import com.yuanchu.mom.annotation.ValueClassify; |
| | | import com.yuanchu.mom.pojo.PageSystemLogDto; |
| | | import com.yuanchu.mom.service.SystemLogService; |
| | | import com.yuanchu.mom.utils.JackSonUtil; |
| | |
| | | import io.swagger.annotations.Api; |
| | | import io.swagger.annotations.ApiOperation; |
| | | import lombok.AllArgsConstructor; |
| | | import org.springframework.web.bind.annotation.*; |
| | | import org.springframework.web.bind.annotation.PostMapping; |
| | | import org.springframework.web.bind.annotation.RequestBody; |
| | | import org.springframework.web.bind.annotation.RequestMapping; |
| | | import org.springframework.web.bind.annotation.RestController; |
| | | |
| | | import java.util.Map; |
| | | |
| | |
| | | public class SystemLogController { |
| | | |
| | | private SystemLogService systemLogService; |
| | | |
| | | @ValueAuth |
| | | @ApiOperation(value = "è·åç³»ç»æ¥å¿å表") |
| | | @PostMapping("/selectSystemLogList") |
| | |
| | | import io.swagger.annotations.Api; |
| | | import io.swagger.annotations.ApiOperation; |
| | | import lombok.AllArgsConstructor; |
| | | import org.springframework.beans.factory.annotation.Value; |
| | | import org.springframework.util.DigestUtils; |
| | | import org.springframework.web.bind.annotation.*; |
| | | import org.springframework.web.multipart.MultipartFile; |
| | | |
| | | import java.util.HashMap; |
| | | import java.util.Map; |
| | |
| | | } |
| | | return Result.fail(map.get("info")); |
| | | } |
| | | @ValueAuth |
| | | |
| | | @ValueClassify("ç¨æ·ç®¡ç") |
| | | @ApiOperation(value = "è·åç¨æ·å表") |
| | | @PostMapping("/selectUserList") |
| | | public Result selectUserList(@RequestBody Map<String, Object> data) throws Exception { |
| | |
| | | public Result<?> getUserMenu() { |
| | | return Result.success(userService.getUserMenu()); |
| | | } |
| | | @ValueAuth |
| | | |
| | | @ValueClassify("客æ·ç®¡ç") |
| | | @ApiOperation(value = "è·å客æ·å表") |
| | | @PostMapping("/selectCustomPageList") |
| | | public Result selectCustomPageList(@RequestBody Map<String, Object> data) throws Exception { |
¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.yuanchu.mom.pojo; |
| | | |
| | | public class AuthApi { |
| | | |
| | | public static String companies = "https://ztt-sso.asuncloud.net/api/org/v1/companies"; |
| | | |
| | | public static String post="https://ztt-sso.asuncloud.net/api/org/v1/post?companyId="; |
| | | |
| | | public static String simple="https://ztt-sso.asuncloud.net/api/org/v1/employees/simple?companyId="; |
| | | |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.yuanchu.mom.pojo; |
| | | |
| | | import lombok.Data; |
| | | |
| | | @Data |
| | | public class Company { |
| | | |
| | | private String companyId; |
| | | |
| | | private String companyName; |
| | | |
| | | private String parentCompanyId; |
| | | |
| | | private String description; |
| | | |
| | | private String status; |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.yuanchu.mom.pojo; |
| | | |
| | | import lombok.Data; |
| | | |
| | | @Data |
| | | public class Post { |
| | | private String companyId; |
| | | private String postCode; |
| | | private String postName; |
| | | private String deptCode; |
| | | private String postType; |
| | | private String status; |
| | | } |
| | |
| | | @ApiModelProperty(value = "å
³èçé¨é¨id") |
| | | private String departId; |
| | | |
| | | ////人åç¼å·ï¼å
¨å±å¯ä¸ |
| | | // private String employeeID; |
| | | ////å²ä½ |
| | | // private String position; |
| | | ////å²ä½ç¼ç |
| | | // private String positionCode; |
| | | ////ææºå·ç |
| | | // private String phoneNumber; |
| | | // |
| | | // //æ§å« 1:ç· 2:女 |
| | | // private int gender; |
| | | // |
| | | // //ç»ç»ç¶æ enable:å¨è disabled:离è |
| | | // private String status; |
| | | ////æå±ç»ç»ç¼ç |
| | | // private String companyId; |
| | | ////å
¬å¸é®ç®±(å¯ç¨äºé®ç®±ç³»ç») |
| | | // private String companyEmail; |
| | | ////å
¥èå
¬å¸æ¶é´ |
| | | // private String dateOfJoiningTheCompany; |
| | | ////ç»ç»å
çé¨é¨ç¼ç |
| | | // private String departmentCode; |
| | | } |
| | |
| | | package com.yuanchu.mom.service.impl; |
| | | |
| | | import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; |
| | | import com.baomidou.mybatisplus.core.metadata.IPage; |
| | | import com.baomidou.mybatisplus.core.toolkit.Wrappers; |
| | | import com.yuanchu.mom.common.GetLook; |
| | | import com.yuanchu.mom.common.PrintChina; |
| | | import com.yuanchu.mom.dto.RolePowerDto; |
| | | import com.yuanchu.mom.dto.UserPageDto; |
| | | import com.yuanchu.mom.mapper.PowerMapper; |
| | | import com.yuanchu.mom.mapper.RoleMapper; |
| | | import com.yuanchu.mom.mapper.UserMapper; |
| | | import com.yuanchu.mom.pojo.Menu; |
| | | import com.yuanchu.mom.pojo.Power; |
| | | import com.yuanchu.mom.pojo.Role; |
| | | import com.yuanchu.mom.pojo.User; |
| | | import com.yuanchu.mom.service.RoleService; |
| | | import com.yuanchu.mom.service.UserService; |
| | | import com.yuanchu.mom.utils.Jwt; |
| | | import com.yuanchu.mom.utils.QueryWrappers; |
| | | import lombok.AllArgsConstructor; |
| | | import org.springframework.stereotype.Service; |
| | | import org.springframework.transaction.annotation.Transactional; |
| | | import org.springframework.util.DigestUtils; |
| | | |
| | | import java.util.HashMap; |
| | | import java.util.List; |
¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.yuanchu.mom.util; |
| | | |
| | | import cn.hutool.http.HttpRequest; |
| | | import cn.hutool.http.HttpResponse; |
| | | import com.alibaba.fastjson.JSON; |
| | | import com.fasterxml.jackson.core.JsonProcessingException; |
| | | import com.fasterxml.jackson.core.type.TypeReference; |
| | | import com.fasterxml.jackson.databind.JsonNode; |
| | | import com.fasterxml.jackson.databind.ObjectMapper; |
| | | import com.yuanchu.mom.pojo.AuthApi; |
| | | import com.yuanchu.mom.pojo.Company; |
| | | import com.yuanchu.mom.pojo.Post; |
| | | import com.yuanchu.mom.pojo.User; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.data.redis.core.RedisTemplate; |
| | | import org.springframework.stereotype.Component; |
| | | |
| | | import javax.annotation.Resource; |
| | | import java.time.Duration; |
| | | import java.util.List; |
| | | import java.util.concurrent.TimeUnit; |
| | | |
| | | @Component |
| | | public class HeaderToken { |
| | | |
| | | @Resource |
| | | private RedisTemplate redisTemplate; |
| | | |
| | | public static void main(String[] args) { |
| | | HttpRequest request = HttpRequest.post("https://ztt-sso.asuncloud.net/oauth2/token") |
| | | .header("Content-Type", "application/x-www-form-urlencoded") |
| | | .form("grant_type", "client_credentials") |
| | | .form("client_id", "8b2f2c7e-2ab9-4718-8193-c0c636dceba8") |
| | | .form("client_secret", "db59b70d28ab1865aafe4008f59d4760"); |
| | | |
| | | HttpResponse response = request.execute(); |
| | | |
| | | System.out.println(response.body()); |
| | | } |
| | | |
| | | public String fetchNewAccessToken() { |
| | | HttpRequest request = HttpRequest.post("https://ztt-sso.asuncloud.net/oauth2/token") |
| | | .header("Content-Type", "application/x-www-form-urlencoded") |
| | | .form("grant_type", "client_credentials") |
| | | .form("client_id", "8b2f2c7e-2ab9-4718-8193-c0c636dceba8") |
| | | .form("client_secret", "db59b70d28ab1865aafe4008f59d4760"); |
| | | HttpResponse response = request.execute(); |
| | | |
| | | System.out.println(response.body()); |
| | | ObjectMapper objectMapper = new ObjectMapper(); |
| | | JsonNode jsonNode = null; |
| | | try { |
| | | jsonNode = objectMapper.readTree(response.body()); |
| | | String accessToken = jsonNode.get("access_token").asText(); |
| | | redisTemplate.opsForValue().set("access_token",accessToken); |
| | | redisTemplate.expire("access_token", dataTime("access_token"), TimeUnit.SECONDS); |
| | | } catch (JsonProcessingException e) { |
| | | e.printStackTrace(); |
| | | } |
| | | return null; |
| | | } |
| | | private String accessToken ; |
| | | |
| | | //夿æ¯å¦è¿æ |
| | | public String getAccessToken() { |
| | | accessToken=(String) redisTemplate.opsForValue().get("access_token"); |
| | | if (accessToken == null) { |
| | | accessToken = fetchNewAccessToken(); |
| | | } |
| | | return accessToken; |
| | | } |
| | | //夿 token æ¯å¦å·²åå¨ |
| | | public String getToken(String token) { |
| | | String o = redisTemplate.opsForValue().get(token).toString(); |
| | | if (o != null && !o.isEmpty()) { |
| | | return o; |
| | | }else{ |
| | | redisTemplate.expire(token,dataTime("access_token"),TimeUnit.SECONDS); |
| | | String tokens = redisTemplate.opsForValue().get(token).toString(); |
| | | return tokens; |
| | | } |
| | | // è·å token |
| | | // accessToken = fetchNewAccessToken(); |
| | | // return accessToken; |
| | | } |
| | | |
| | | //è·åtokenè¿ææ¶é´ |
| | | public Long dataTime(String token){ |
| | | Long access_token = redisTemplate.getExpire(token); |
| | | if(access_token != null && access_token >60) { |
| | | redisTemplate.expire(token, access_token - 60 ,TimeUnit.SECONDS); |
| | | return access_token - 60; |
| | | }//å°±ç´æ¥è°ç¨ |
| | | return null; |
| | | } |
| | | |
| | | |
| | | |
| | | //è°ç¨ |
| | | public List<Company> companyUrl() { |
| | | String accessToken = getAccessToken(); |
| | | String getToken= getToken(accessToken); |
| | | String apiUrl =AuthApi.companies; // æ¿æ¢ä¸ºå®é
çAPI端ç¹URL |
| | | HttpRequest request = HttpRequest.get(apiUrl) |
| | | .header("Authorization", "Bearer " + accessToken); |
| | | HttpResponse response = request.execute(); |
| | | ObjectMapper objectMapper = new ObjectMapper(); |
| | | String body = response.body(); |
| | | List<Company> companies = null; |
| | | try { |
| | | companies = objectMapper.readValue(body, new TypeReference<List<Company>>(){}); |
| | | } catch (JsonProcessingException e) { |
| | | e.printStackTrace(); |
| | | } |
| | | return companies; |
| | | } |
| | | |
| | | public List<Post> postUrl(String companyId) { |
| | | String accessToken = getAccessToken(); |
| | | String token = getToken(accessToken); |
| | | String apiUrl =AuthApi.post+companyId; // æ¿æ¢ä¸ºå®é
çAPI端ç¹URL |
| | | HttpRequest request = HttpRequest.get(apiUrl) |
| | | .header("Authorization", "Bearer " + accessToken); |
| | | HttpResponse response = request.execute(); |
| | | ObjectMapper objectMapper = new ObjectMapper(); |
| | | String body = response.body(); |
| | | List<Post> posts = null; |
| | | try { |
| | | posts=objectMapper.readValue(body, new TypeReference<List<Post>>() {}); |
| | | } catch (JsonProcessingException e) { |
| | | e.printStackTrace(); |
| | | } |
| | | return posts; |
| | | } |
| | | |
| | | public List<User> userUrl(String companyId) { |
| | | String accessToken = getAccessToken(); |
| | | String token = getToken(accessToken); |
| | | String apiUrl =AuthApi.simple+companyId; // æ¿æ¢ä¸ºå®é
çAPI端ç¹URL |
| | | HttpRequest request = HttpRequest.get(apiUrl) |
| | | .header("Authorization", "Bearer " + accessToken) |
| | | .header("Content-Type", "application/form-data"); |
| | | HttpResponse response = request.execute(); |
| | | ObjectMapper objectMapper = new ObjectMapper(); |
| | | String body = response.body(); |
| | | List<User> user=null; |
| | | try { |
| | | user= objectMapper.readValue(body,new TypeReference<List<User>>(){}); |
| | | } catch (JsonProcessingException e) { |
| | | e.printStackTrace(); |
| | | } |
| | | return user; |
| | | } |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.yuanchu.mom.util; |
| | | |
| | | import cn.hutool.http.HttpRequest; |
| | | import cn.hutool.http.HttpResponse; |
| | | import com.yuanchu.mom.pojo.AuthApi; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.stereotype.Component; |
| | | |
| | | @Component |
| | | public class TestApi { |
| | | |
| | | @Autowired |
| | | private HeaderToken headerToken; |
| | | |
| | | public void testApi() { |
| | | String accessToken =headerToken.getAccessToken(); |
| | | String apiUrl = AuthApi.companies; |
| | | // æ¿æ¢ä¸ºå®é
çAPI端ç¹URL |
| | | HttpRequest request = HttpRequest.get(apiUrl) |
| | | .header("Authorization", "Bearer " + accessToken); |
| | | HttpResponse response = request.execute(); |
| | | System.out.println("Response Code: " + response.getStatus()); |
| | | System.out.println("Response Body: " + response.body()); |
| | | } |
| | | } |
| | |
| | | |
| | | <select id="selectEnumPageList" resultType="com.yuanchu.mom.pojo.Enums"> |
| | | select * from ( |
| | | select e.id,e.category,e.label,e.value,e.order_num,e.type , u2.name create_user_name,e.create_time, u3.name update_user_name, e.update_time |
| | | select e.id,e.category,e.label,e.value,e.order_num,e.type , u2.name create_user_name,e.create_time, u3.name update_user_name, e.update_time,e.create_user |
| | | from enums e |
| | | left join user u2 on u2.id = e.create_user |
| | | left join user u3 on u3.id = e.update_user |