|
@@ -0,0 +1,74 @@
|
|
|
|
+package com.tld.service.impl;
|
|
|
|
+
|
|
|
|
+import com.github.pagehelper.PageHelper;
|
|
|
|
+import com.github.pagehelper.PageInfo;
|
|
|
|
+import com.tld.mapper.TableAdjustmentMapper;
|
|
|
|
+import com.tld.model.StorageLocation;
|
|
|
|
+import com.tld.model.TableAdjustment;
|
|
|
|
+import com.tld.service.TableAdjustmentService;
|
|
|
|
+import org.springframework.beans.factory.annotation.Autowired;
|
|
|
|
+import org.springframework.stereotype.Service;
|
|
|
|
+import org.springframework.transaction.annotation.Transactional;
|
|
|
|
+
|
|
|
|
+import java.util.HashMap;
|
|
|
|
+import java.util.Map;
|
|
|
|
+
|
|
|
|
+/**
|
|
|
|
+ * @program: tld-consumer-9560
|
|
|
|
+ * @description: 表单调整
|
|
|
|
+ * @author: XiaoChen
|
|
|
|
+ * @create: 2023-04-26 15:28
|
|
|
|
+ **/
|
|
|
|
+@Service
|
|
|
|
+public class TableAdjustmentServiceImpl implements TableAdjustmentService {
|
|
|
|
+ @Autowired
|
|
|
|
+ private TableAdjustmentMapper tableAdjustmentMapper;
|
|
|
|
+
|
|
|
|
+ /**
|
|
|
|
+ * @Description: 获取表单调整信息
|
|
|
|
+ * @Param: tableAdjustment
|
|
|
|
+ * @return: Map<String,Object>
|
|
|
|
+ * @Author: XiaoChen
|
|
|
|
+ * @Date: 2023/4/26
|
|
|
|
+ */
|
|
|
|
+ @Override
|
|
|
|
+ public Map<String, Object> getTableAdjustment(TableAdjustment tableAdjustment) {
|
|
|
|
+ Map<String, Object> map = new HashMap<>();
|
|
|
|
+ try{
|
|
|
|
+ TableAdjustment tableAdjustment1 = tableAdjustmentMapper.getTableAdjustment(tableAdjustment);
|
|
|
|
+ map.put("data", tableAdjustment1);
|
|
|
|
+ map.put("msg", "200");
|
|
|
|
+ }catch (Exception e){
|
|
|
|
+ e.printStackTrace();
|
|
|
|
+ map.put("msg", "500");
|
|
|
|
+ map.put("errMsg", "服务器请求异常,请稍后再试");
|
|
|
|
+ }
|
|
|
|
+ return map;
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ /**
|
|
|
|
+ * @Description: 保存表单调整信息
|
|
|
|
+ * @Param: tableAdjustment
|
|
|
|
+ * @return: Map<String,Object>
|
|
|
|
+ * @Author: XiaoChen
|
|
|
|
+ * @Date: 2023/4/26
|
|
|
|
+ */
|
|
|
|
+ @Override
|
|
|
|
+ @Transactional(rollbackFor = Exception.class)
|
|
|
|
+ public Map<String, Object> addTableAdjustment(TableAdjustment tableAdjustment) {
|
|
|
|
+ Map<String, Object> map = new HashMap<>();
|
|
|
|
+ try{
|
|
|
|
+ TableAdjustment tableAdjustment1 = tableAdjustmentMapper.getTableAdjustment(tableAdjustment);
|
|
|
|
+ if(tableAdjustment1 != null){
|
|
|
|
+ tableAdjustmentMapper.delTableAdjustment(tableAdjustment1);
|
|
|
|
+ }
|
|
|
|
+ tableAdjustmentMapper.addTableAdjustment(tableAdjustment);
|
|
|
|
+ map.put("msg", "200");
|
|
|
|
+ }catch (Exception e){
|
|
|
|
+ e.printStackTrace();
|
|
|
|
+ map.put("msg", "500");
|
|
|
|
+ map.put("errMsg", "服务器请求异常,请稍后再试");
|
|
|
|
+ }
|
|
|
|
+ return map;
|
|
|
|
+ }
|
|
|
|
+}
|