|
@@ -4,13 +4,19 @@ import com.ruoyi.common.core.web.domain.AjaxResult;
|
|
|
import com.ruoyi.common.core.web.page.PageDomain;
|
|
|
import com.ruoyi.common.core.web.page.TableDataInfo;
|
|
|
import com.ruoyi.common.core.web.page.TableSupport;
|
|
|
+import com.ruoyi.common.security.utils.DictUtils;
|
|
|
+import com.sooka.sponest.data.api.housingconstruction.domain.HousingconstructionCar;
|
|
|
+import com.sooka.sponest.data.api.housingconstruction.domain.HousingconstructionPractitioner;
|
|
|
+import com.sooka.sponest.data.api.housingconstruction.domain.HousingconstructionSteelcylinder;
|
|
|
import com.sooka.sponest.data.api.housingconstruction.domain.HousingconstructionSteelcylinderLog;
|
|
|
import com.sooka.sponest.data.api.housingconstruction.service.RemoteHousingconstructionSteelcylinderService;
|
|
|
-import org.springframework.web.bind.annotation.GetMapping;
|
|
|
-import org.springframework.web.bind.annotation.RequestMapping;
|
|
|
-import org.springframework.web.bind.annotation.RestController;
|
|
|
+import com.sooka.sponest.mobile.utils.DictUtil;
|
|
|
+import org.apache.commons.collections4.MapUtils;
|
|
|
+import org.springframework.web.bind.annotation.*;
|
|
|
|
|
|
import javax.annotation.Resource;
|
|
|
+import java.util.List;
|
|
|
+import java.util.Map;
|
|
|
|
|
|
/**
|
|
|
* 钢瓶基础数据Controller
|
|
@@ -24,6 +30,11 @@ public class HousingconstructionSteelcylinderController{
|
|
|
@Resource
|
|
|
RemoteHousingconstructionSteelcylinderService steelcylinderService;
|
|
|
|
|
|
+ /**
|
|
|
+ * 巡检: 根据选择的用户获取钢瓶列表
|
|
|
+ * @param steelcy
|
|
|
+ * @return
|
|
|
+ */
|
|
|
@GetMapping("/steelcylinder/getSteelcylinderList")
|
|
|
public AjaxResult getRealNameUserListAllByType(HousingconstructionSteelcylinderLog steelcy){
|
|
|
PageDomain pageDomain = TableSupport.buildPageRequest();
|
|
@@ -38,4 +49,68 @@ public class HousingconstructionSteelcylinderController{
|
|
|
return AjaxResult.error(resultData.getCode(), resultData.getMsg());
|
|
|
}
|
|
|
}
|
|
|
+
|
|
|
+ /**
|
|
|
+ * 运营: 获取钢瓶列表
|
|
|
+ */
|
|
|
+ @GetMapping("/getList")
|
|
|
+ public AjaxResult getList(HousingconstructionSteelcylinder steelcylinder){
|
|
|
+ PageDomain pageDomain = TableSupport.buildPageRequest();
|
|
|
+ Integer pageNum = pageDomain.getPageNum();
|
|
|
+ Integer pageSize = pageDomain.getPageSize();
|
|
|
+ String state = steelcylinder.getState();
|
|
|
+ String name = steelcylinder.getName();
|
|
|
+ TableDataInfo list = steelcylinderService.getList(pageNum, pageSize, state, name);
|
|
|
+
|
|
|
+ Map<String, Object> steelcylinderState = DictUtils.getDictCacheToMap("steelcylinder_state");
|
|
|
+ Map<String, Object> steelcylinderType = DictUtils.getDictCacheToMap("steelcylinder_type");
|
|
|
+
|
|
|
+
|
|
|
+ if(200 == list.getCode()){
|
|
|
+ List<Map<String, Object>> rows = (List<Map<String, Object>>) list.getRows();
|
|
|
+ rows.forEach(row->{
|
|
|
+ row.put("standardsLabel", MapUtils.getString(steelcylinderType, MapUtils.getString(row, "standards")));
|
|
|
+ row.put("stateLabel", MapUtils.getString(steelcylinderState, MapUtils.getString(row, "state")));
|
|
|
+ });
|
|
|
+ return AjaxResult.success(rows);
|
|
|
+ }else{
|
|
|
+ return AjaxResult.error(list.getCode(), list.getMsg());
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ /**
|
|
|
+ * 获取人员接口
|
|
|
+ */
|
|
|
+ @GetMapping("/getPersonList")
|
|
|
+ public AjaxResult getPersonList(HousingconstructionPractitioner practitioner){
|
|
|
+ String post = practitioner.getPost();
|
|
|
+ String enterpriseId = practitioner.getEnterpriseId();
|
|
|
+ return steelcylinderService.getPersonList(post, enterpriseId);
|
|
|
+ }
|
|
|
+
|
|
|
+ /**
|
|
|
+ * 获取车辆列表
|
|
|
+ */
|
|
|
+ @GetMapping("/getCarList")
|
|
|
+ public AjaxResult getCarList(HousingconstructionCar car){
|
|
|
+ String enterpriseId = car.getEnterpriseId();
|
|
|
+ return steelcylinderService.getCarList(enterpriseId);
|
|
|
+ }
|
|
|
+
|
|
|
+ /**
|
|
|
+ * 根据钢瓶id查询最后入户的用户id
|
|
|
+ */
|
|
|
+ @GetMapping("/getSteelcylinderLog")
|
|
|
+ public AjaxResult getSteelcylinderLog(@RequestParam("steelcylinderId") String steelcylinderId){
|
|
|
+ return steelcylinderService.getSteelcylinderLog(steelcylinderId);
|
|
|
+ }
|
|
|
+
|
|
|
+ /**
|
|
|
+ * 钢瓶流转
|
|
|
+ */
|
|
|
+ @PostMapping("/addLog")
|
|
|
+ public AjaxResult addLog(@RequestBody HousingconstructionSteelcylinderLog steelcylinderLog){
|
|
|
+ return steelcylinderService.addLog(steelcylinderLog);
|
|
|
+ }
|
|
|
+
|
|
|
}
|