上传设置备份

pro
1178634255 2 years ago
parent f0cd926013
commit 68586c23cb

@ -1,14 +1,20 @@
package com.glxp.api.controller.thrsys;
import cn.hutool.core.bean.BeanUtil;
import cn.hutool.core.collection.CollUtil;
import cn.hutool.core.util.StrUtil;
import com.glxp.api.annotation.AuthRuleAnnotation;
import com.glxp.api.entity.basic.BasicBussinessTypeEntity;
import com.glxp.api.entity.system.SyncDataBustypeEntity;
import com.glxp.api.entity.system.SyncUploadDataSetEntity;
import com.glxp.api.entity.thrsys.ThrSystemEntity;
import com.glxp.api.req.thrsys.FilterBasicThirdSysRequest;
import com.glxp.api.service.system.SyncUploadDataBustypeService;
import com.glxp.api.service.system.SyncUploadDataSetService;
import com.glxp.api.common.enums.ResultEnum;
import com.glxp.api.common.res.BaseResponse;
import com.glxp.api.common.util.ResultVOUtils;
import org.springframework.validation.BindingResult;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
@ -48,13 +54,36 @@ public class ThirdUploadSetController {
}
return ResultVOUtils.success();
}
//编辑
//编辑
@AuthRuleAnnotation("system/third/syncData/update")
@GetMapping("/system/third/syncData/update")
public BaseResponse update() {
SyncUploadDataSetEntity syncDataSetResponse = syncUploadDataSetService.selectSet();
return ResultVOUtils.success(syncDataSetResponse);
public BaseResponse update(@RequestBody @Valid SyncUploadDataSetEntity syncUploadDataSetEntity) {
// 获取需要更新的数据集ID
Long dataSetId = Long.valueOf(syncUploadDataSetEntity.getId());
// 根据数据集ID查询原有数据集信息
SyncUploadDataSetEntity oldDataSet = syncUploadDataSetService.getById(dataSetId);
if (oldDataSet == null) {
return ResultVOUtils.error(ResultEnum.NOT_NETWORK);
}
// // 更新数据集信息
// oldDataSet.setName(syncUploadDataSetEntity.getName());
// oldDataSet.setDescription(syncUploadDataSetEntity.getDescription());
// oldDataSet.setUpdateTime(new Date());
// 更新数据集业务类型信息
// List<SyncDataBustypeEntity> busTypes = syncUploadDataSetEntity.getBusTypes();
// syncUploadDataBustypeService.deleteByDataSetId(dataSetId);
// if (CollUtil.isNotEmpty(busTypes)) {
// for (SyncDataBustypeEntity busType : busTypes) {
// busType.setDataSetId(dataSetId);
// }
// syncUploadDataBustypeService.inserts(busTypes);
// }
// 保存更新后的数据集信息
boolean b = syncUploadDataSetService.updateById(oldDataSet);
if (!b) {
return ResultVOUtils.error(ResultEnum.NOT_NETWORK);
}
return ResultVOUtils.success();
}
}

@ -10,4 +10,7 @@ public interface SyncUploadDataSetDao {
boolean insert(SyncUploadDataSetEntity syncDataSetEntity);
SyncUploadDataSetEntity getById(Long dataSetId);
boolean updateById(SyncUploadDataSetEntity oldDataSet);
}

@ -11,4 +11,8 @@ public interface SyncUploadDataSetService {
boolean insert(SyncUploadDataSetEntity syncUploadDataSetEntity);
SyncUploadDataSetEntity getById(Long dataSetId);
boolean updateById(SyncUploadDataSetEntity oldDataSet);
}

@ -47,4 +47,14 @@ public class SyncUploadDataSetServiceImpl implements SyncUploadDataSetService {
return syncUploadDataSetDao.insert(syncDataSetEntity);
}
@Override
public SyncUploadDataSetEntity getById(Long dataSetId) {
return syncUploadDataSetDao.getById(dataSetId);
}
@Override
public boolean updateById(SyncUploadDataSetEntity oldDataSet) {
return syncUploadDataSetDao.updateById(oldDataSet);
}
}

@ -2,6 +2,25 @@
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd" >
<mapper namespace="com.glxp.api.dao.system.SyncUploadDataSetDao">
<update id="updateById">
UPDATE thr_order_upload
<set>
<if test="orderUnCheck != null">orderUnCheck=#{orderUnCheck},</if>
<if test="orderUnReceive != null">orderUnReceive=#{orderUnReceive},</if>
<if test="orderScanFinish != null">orderScanFinish=#{orderScanFinish},</if>
<if test="checkUdims != null">checkUdims=#{checkUdims},</if>
<if test="checkPdaEd != null">checkPdaEd=#{checkPdaEd},</if>
<if test="checkPdaUn != null">checkPdaUn=#{checkPdaUn},</if>
<if test="checkPc != null">checkPc=#{checkPc},</if>
<if test="checkWebNew != null">checkWebNew=#{checkWebNew},</if>
<if test="checkChange != null">checkChange=#{checkChange},</if>
<if test="checkSp != null">checkSp=#{checkSp},</if>
<if test="checkBalacne != null">checkBalacne=#{checkBalacne},</if>
</set>
WHERE id = #{id}
</update>
<select id="selectSet"
@ -9,6 +28,11 @@
SELECT *
FROM thr_order_upload limit 1
</select>
<select id="getById" resultType="com.glxp.api.entity.system.SyncUploadDataSetEntity">
SELECT *
FROM thr_order_upload_bustypes WHERE id = ?
</select>
<insert id="insert" parameterType="com.glxp.api.entity.system.SyncUploadDataSetEntity">

Loading…
Cancel
Save