Bladeren bron

1.大小写
2.企业列表五个位置中文

jz.kai 5 jaren geleden
bovenliggende
commit
5c2ad545ba

+ 49 - 0
common/src/main/java/com/jpsoft/smart/modules/base/dto/CompanyInfoDTO.java

@@ -0,0 +1,49 @@
+package com.jpsoft.smart.modules.base.dto;
+
+import com.fasterxml.jackson.annotation.JsonFormat;
+import com.jpsoft.smart.modules.base.entity.CompanyPosition;
+import io.swagger.annotations.ApiModelProperty;
+import lombok.Data;
+import org.springframework.format.annotation.DateTimeFormat;
+
+import java.util.Date;
+
+@Data
+public class CompanyInfoDTO {
+    @ApiModelProperty(value = "公司编号")
+    private String id;
+    @ApiModelProperty(value = "公司logo")
+    private String logo;
+    @ApiModelProperty(value = "序号")
+    private Integer sortNo;
+    @ApiModelProperty(value = "公司名称")
+    private String name;
+    @ApiModelProperty(value = "备注")
+    private String remark;
+    @ApiModelProperty(value = "创建人")
+    private String createBy;
+
+    @DateTimeFormat(pattern="yyyy-MM-dd HH:mm")
+    @JsonFormat(pattern = "yyyy-MM-dd HH:mm",timezone ="GMT+8")
+    @ApiModelProperty(value = "创建时间")
+    private Date createTime;
+    @ApiModelProperty(value = "更新人")
+    private String updateBy;
+
+    @DateTimeFormat(pattern="yyyy-MM-dd HH:mm")
+    @JsonFormat(pattern = "yyyy-MM-dd HH:mm",timezone ="GMT+8")
+    @ApiModelProperty(value = "更新时间")
+    private Date updateTime;
+    @ApiModelProperty(value = "是否删除")
+    private Boolean delFlag;
+    @ApiModelProperty(value = "位置1")
+    private String position1Name;
+    @ApiModelProperty(value = "位置2")
+    private String position2Name;
+    @ApiModelProperty(value = "位置3")
+    private String position3Name;
+    @ApiModelProperty(value = "位置4")
+    private String position4Name;
+    @ApiModelProperty(value = "位置5")
+    private String position5Name;
+}

+ 3 - 0
common/src/main/java/com/jpsoft/smart/modules/base/service/CompanyInfoService.java

@@ -2,6 +2,9 @@ package com.jpsoft.smart.modules.base.service;
 
 import java.util.List;
 import java.util.Map;
+
+import com.jpsoft.smart.modules.base.dao.CompanyInfoDAO;
+import com.jpsoft.smart.modules.base.dto.CompanyInfoDTO;
 import com.jpsoft.smart.modules.base.entity.CompanyInfo;
 import com.github.pagehelper.Page;
 import com.jpsoft.smart.modules.common.dto.Sort;

+ 23 - 1
web/src/main/java/com/jpsoft/smart/modules/base/controller/CompanyInfoController.java

@@ -1,6 +1,9 @@
 package com.jpsoft.smart.modules.base.controller;
 
 import com.github.pagehelper.Page;
+import com.jpsoft.smart.modules.base.dto.CompanyInfoDTO;
+import com.jpsoft.smart.modules.base.entity.CompanyPosition;
+import com.jpsoft.smart.modules.base.service.CompanyPositionService;
 import com.jpsoft.smart.modules.common.utils.PojoUtils;
 import com.jpsoft.smart.modules.common.dto.Sort;
 import com.jpsoft.smart.modules.common.dto.MessageResult;
@@ -27,6 +30,9 @@ public class CompanyInfoController {
     @Autowired
     private CompanyInfoService companyInfoService;
 
+    @Autowired
+    private CompanyPositionService companyPositionService;
+
     @ApiOperation(value="创建空记录")
     @GetMapping("create")
     public MessageResult<CompanyInfo> create(){
@@ -216,9 +222,25 @@ public class CompanyInfoController {
         }
 
         Page<CompanyInfo> page = companyInfoService.pageSearch(searchParams,pageIndex,pageSize,sortList);
+        Page<CompanyInfoDTO> pageDTO = PojoUtils.convertPage(page, CompanyInfoDTO.class);
+        for(CompanyInfoDTO li : pageDTO.getResult()){
+            Map<String,Object> searchParams1 = new HashMap<>();
+            searchParams1.put("companyId",li.getId());
+            List<Sort> sortList1 = new ArrayList<>();
+            sortList1.add(new Sort("id_","asc"));
+
+            Page<CompanyPosition> page1 = companyPositionService.pageSearch(searchParams1,1,1,false,sortList1);
+            if(page1.size() > 0) {
+                li.setPosition1Name(page1.get(0).getPosition1Name());
+                li.setPosition2Name(page1.get(0).getPosition2Name());
+                li.setPosition3Name(page1.get(0).getPosition3Name());
+                li.setPosition4Name(page1.get(0).getPosition4Name());
+                li.setPosition5Name(page1.get(0).getPosition5Name());
+            }
+        }
 
         msgResult.setResult(true);
-        msgResult.setData(PojoUtils.pageWrapper(page));
+        msgResult.setData(PojoUtils.pageWrapper(pageDTO));
 
         return msgResult;
     }

+ 8 - 8
web/src/main/java/com/jpsoft/smart/modules/base/controller/PersonInfoController.java

@@ -347,11 +347,11 @@ public class PersonInfoController {
     }
 
     @ApiOperation(value="人脸授权")
-    @PostMapping("EnabledFace")
+    @PostMapping("enabledFace")
     @ApiImplicitParams({
             @ApiImplicitParam(name = "id",value = "人员编号", required = false, paramType = "form",dataType = "String")
     })
-    public MessageResult<PersonInfo> EnabledFace(@RequestParam(value="id",defaultValue="") Long id,@RequestAttribute String subject){
+    public MessageResult<PersonInfo> enabledFace(@RequestParam(value="id",defaultValue="") Long id,@RequestAttribute String subject){
         MessageResult<PersonInfo> msgResult = new MessageResult<>();
 
         try {
@@ -386,11 +386,11 @@ public class PersonInfoController {
     }
 
     @ApiOperation(value="刷卡授权")
-    @PostMapping("EnabledCard")
+    @PostMapping("enabledCard")
     @ApiImplicitParams({
             @ApiImplicitParam(name = "id",value = "人员编号", required = false, paramType = "form",dataType = "String")
     })
-    public MessageResult<PersonInfo> EnabledCard(@RequestParam(value="id",defaultValue="") Long id,@RequestAttribute String subject){
+    public MessageResult<PersonInfo> enabledCard(@RequestParam(value="id",defaultValue="") Long id,@RequestAttribute String subject){
         MessageResult<PersonInfo> msgResult = new MessageResult<>();
 
         try {
@@ -425,11 +425,11 @@ public class PersonInfoController {
     }
 
     @ApiOperation(value="手机授权")
-    @PostMapping("EnabledApp")
+    @PostMapping("enabledApp")
     @ApiImplicitParams({
             @ApiImplicitParam(name = "id",value = "人员编号", required = false, paramType = "form",dataType = "String")
     })
-    public MessageResult<PersonInfo> EnabledApp(@RequestParam(value="id",defaultValue="") Long id,@RequestAttribute String subject){
+    public MessageResult<PersonInfo> enabledApp(@RequestParam(value="id",defaultValue="") Long id,@RequestAttribute String subject){
         MessageResult<PersonInfo> msgResult = new MessageResult<>();
 
         try {
@@ -464,11 +464,11 @@ public class PersonInfoController {
     }
 
     @ApiOperation(value="访客授权")
-    @PostMapping("EnabledGuest")
+    @PostMapping("enabledGuest")
     @ApiImplicitParams({
             @ApiImplicitParam(name = "id",value = "人员编号", required = false, paramType = "form",dataType = "String")
     })
-    public MessageResult<PersonInfo> EnabledGuest(@RequestParam(value="id",defaultValue="") Long id,@RequestAttribute String subject){
+    public MessageResult<PersonInfo> enabledGuest(@RequestParam(value="id",defaultValue="") Long id,@RequestAttribute String subject){
         MessageResult<PersonInfo> msgResult = new MessageResult<>();
 
         try {