已核销的订单不能进行删除
This commit is contained in:
parent
d0191ba05d
commit
647bb9d69d
@ -23,17 +23,38 @@ public class DinnerTypeUtils {
|
|||||||
}
|
}
|
||||||
return instance;
|
return instance;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public void updateDinnerTypeUtils(String settings){
|
||||||
|
String[] setting = settings.split(",");
|
||||||
|
if (setting.length != 6) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
String today = DateUtil.today();
|
||||||
|
this.breakfastStart = DateUtil.parse(today + " " + setting[0]);
|
||||||
|
this.breakfastEnd = DateUtil.parse(today + " " + setting[1]);
|
||||||
|
|
||||||
private final Date breakfastStart;
|
this.lunchStart = DateUtil.parse(today + " " + setting[2]);
|
||||||
private final Date breakfastEnd;
|
this.lunchEnd = DateUtil.parse(today + " " + setting[3]);
|
||||||
|
|
||||||
private final Date lunchStart;
|
this.dinnerStart = DateUtil.parse(today + " " + setting[4]);
|
||||||
private final Date lunchEnd;
|
this.dinnerEnd = DateUtil.parse(today + " " + setting[5]);
|
||||||
|
|
||||||
private final Date dinnerStart;
|
}
|
||||||
private final Date dinnerEnd;
|
|
||||||
|
private Date breakfastStart;
|
||||||
|
private Date breakfastEnd;
|
||||||
|
|
||||||
|
private Date lunchStart;
|
||||||
|
private Date lunchEnd;
|
||||||
|
|
||||||
|
private Date dinnerStart;
|
||||||
|
private Date dinnerEnd;
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 初始化用餐类型判断基础类,加载用餐时间参数
|
||||||
|
* @param configDaoService
|
||||||
|
*/
|
||||||
private DinnerTypeUtils(IFtConfigDaoService configDaoService) {
|
private DinnerTypeUtils(IFtConfigDaoService configDaoService) {
|
||||||
|
|
||||||
Map<String, String> setting = configDaoService.getDinnerTimeSetting();
|
Map<String, String> setting = configDaoService.getDinnerTimeSetting();
|
||||||
|
@ -12,6 +12,7 @@ import com.ruoyi.common.core.page.TableDataInfo;
|
|||||||
import com.ruoyi.common.enums.BusinessType;
|
import com.ruoyi.common.enums.BusinessType;
|
||||||
import com.ruoyi.common.utils.StringUtils;
|
import com.ruoyi.common.utils.StringUtils;
|
||||||
import com.ruoyi.common.utils.poi.ExcelUtil;
|
import com.ruoyi.common.utils.poi.ExcelUtil;
|
||||||
|
import com.ruoyi.system.fantang.common.DinnerTypeUtils;
|
||||||
import com.ruoyi.system.fantang.domain.FtConfigDao;
|
import com.ruoyi.system.fantang.domain.FtConfigDao;
|
||||||
import com.ruoyi.system.fantang.service.IFtConfigDaoService;
|
import com.ruoyi.system.fantang.service.IFtConfigDaoService;
|
||||||
import lombok.RequiredArgsConstructor;
|
import lombok.RequiredArgsConstructor;
|
||||||
@ -20,9 +21,7 @@ import org.springframework.security.access.prepost.PreAuthorize;
|
|||||||
import org.springframework.web.bind.annotation.*;
|
import org.springframework.web.bind.annotation.*;
|
||||||
|
|
||||||
import java.text.SimpleDateFormat;
|
import java.text.SimpleDateFormat;
|
||||||
import java.util.Arrays;
|
import java.util.*;
|
||||||
import java.util.Date;
|
|
||||||
import java.util.List;
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 饭堂参数Controller
|
* 饭堂参数Controller
|
||||||
@ -116,10 +115,8 @@ public class FtConfigDaoController extends BaseController {
|
|||||||
@PostMapping("/updateDinnerTime")
|
@PostMapping("/updateDinnerTime")
|
||||||
public AjaxResult updateDinnerTime(@RequestBody JSONObject params) {
|
public AjaxResult updateDinnerTime(@RequestBody JSONObject params) {
|
||||||
|
|
||||||
|
|
||||||
StringBuilder configValue = new StringBuilder();
|
StringBuilder configValue = new StringBuilder();
|
||||||
|
|
||||||
|
|
||||||
SimpleDateFormat sdf = new SimpleDateFormat("HH:mm");
|
SimpleDateFormat sdf = new SimpleDateFormat("HH:mm");
|
||||||
JSONArray breakfastJson = params.getJSONArray("breakfast");
|
JSONArray breakfastJson = params.getJSONArray("breakfast");
|
||||||
JSONArray lunchJson = params.getJSONArray("lunch");
|
JSONArray lunchJson = params.getJSONArray("lunch");
|
||||||
@ -149,12 +146,10 @@ public class FtConfigDaoController extends BaseController {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
UpdateWrapper<FtConfigDao> wrapper = new UpdateWrapper<>();
|
iFtConfigDaoService.updateConfigValue(params.getLong("id"),configValue.toString());
|
||||||
wrapper.eq("id", params.getLong("id"));
|
|
||||||
FtConfigDao ftConfigDao = new FtConfigDao();
|
DinnerTypeUtils.getInstance(iFtConfigDaoService).updateDinnerTypeUtils(configValue.toString());
|
||||||
ftConfigDao.setConfigValue(configValue.toString());
|
|
||||||
|
|
||||||
iFtConfigDaoService.update(ftConfigDao, wrapper);
|
|
||||||
return AjaxResult.success("已修改");
|
return AjaxResult.success("已修改");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -58,6 +58,7 @@ public class FtOrderDaoServiceImpl extends ServiceImpl<FtOrderDaoMapper, FtOrder
|
|||||||
dao.setStaffId(staffId);
|
dao.setStaffId(staffId);
|
||||||
dao.setOrderType(orderType);
|
dao.setOrderType(orderType);
|
||||||
dao.setOrderDate(demandDate);
|
dao.setOrderDate(demandDate);
|
||||||
|
dao.setCreateAt(new Date());
|
||||||
QueryWrapper<FtOrderDao> wrapper = new QueryWrapper<>();
|
QueryWrapper<FtOrderDao> wrapper = new QueryWrapper<>();
|
||||||
wrapper.eq("staff_id", staffId);
|
wrapper.eq("staff_id", staffId);
|
||||||
wrapper.eq("order_type", orderType);
|
wrapper.eq("order_type", orderType);
|
||||||
@ -108,9 +109,11 @@ public class FtOrderDaoServiceImpl extends ServiceImpl<FtOrderDaoMapper, FtOrder
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public AjaxResult cancelOrder(Long orderId) {
|
public AjaxResult cancelOrder(Long orderId) {
|
||||||
FtOrderDao dao = new FtOrderDao();
|
QueryWrapper<FtOrderDao> wrapper = new QueryWrapper<>();
|
||||||
dao.setOrderId(orderId);
|
wrapper.eq("order_id",orderId);
|
||||||
return AjaxResult.success(this.baseMapper.deleteById(dao));
|
wrapper.eq("write_off_flag", 0);
|
||||||
|
|
||||||
|
return AjaxResult.success(this.baseMapper.delete(wrapper));
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
Loading…
x
Reference in New Issue
Block a user