|
@@ -0,0 +1,55 @@
|
|
|
+package com.management.platform.controller;
|
|
|
+
|
|
|
+
|
|
|
+import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
|
|
+import com.management.platform.entity.*;
|
|
|
+import com.management.platform.mapper.EstimateTimeSettingMapper;
|
|
|
+import com.management.platform.util.HttpRespMsg;
|
|
|
+import com.management.platform.util.MessageUtils;
|
|
|
+import org.springframework.web.bind.annotation.RequestMapping;
|
|
|
+
|
|
|
+import org.springframework.web.bind.annotation.RestController;
|
|
|
+
|
|
|
+import javax.annotation.Resource;
|
|
|
+import java.util.List;
|
|
|
+
|
|
|
+/**
|
|
|
+ * <p>
|
|
|
+ * 前端控制器
|
|
|
+ * </p>
|
|
|
+ *
|
|
|
+ * @author Seyason
|
|
|
+ * @since 2023-11-19
|
|
|
+ */
|
|
|
+@RestController
|
|
|
+@RequestMapping("/estimate-time-setting")
|
|
|
+public class EstimateTimeSettingController {
|
|
|
+
|
|
|
+ @Resource
|
|
|
+ private EstimateTimeSettingMapper estimateTimeSettingMapper;
|
|
|
+
|
|
|
+ @RequestMapping("/get")
|
|
|
+ public HttpRespMsg get(Integer companyId) {
|
|
|
+ HttpRespMsg httpRespMsg = new HttpRespMsg();
|
|
|
+ EstimateTimeSetting estimateTimeSetting = estimateTimeSettingMapper.selectById(companyId);
|
|
|
+ if (estimateTimeSetting == null) {
|
|
|
+ estimateTimeSetting = new EstimateTimeSetting();
|
|
|
+ estimateTimeSetting.setCompanyId(companyId);
|
|
|
+ estimateTimeSettingMapper.insert(estimateTimeSetting);
|
|
|
+ estimateTimeSetting = estimateTimeSettingMapper.selectById(companyId);
|
|
|
+ }
|
|
|
+ httpRespMsg.data = estimateTimeSetting;
|
|
|
+ return httpRespMsg;
|
|
|
+ }
|
|
|
+
|
|
|
+ @RequestMapping("/save")
|
|
|
+ public HttpRespMsg save(EstimateTimeSetting record) {
|
|
|
+ Boolean success = estimateTimeSettingMapper.updateById(record) > 0;
|
|
|
+ HttpRespMsg httpRespMsg = new HttpRespMsg();
|
|
|
+ if (!success) {
|
|
|
+ httpRespMsg.setError(MessageUtils.message("other.saveError"));
|
|
|
+ }
|
|
|
+ return httpRespMsg;
|
|
|
+ }
|
|
|
+}
|
|
|
+
|