|
...
|
...
|
@@ -36,6 +36,7 @@ import org.jeecgframework.poi.excel.entity.ExportParams; |
|
|
|
import org.jeecgframework.poi.excel.entity.ImportParams;
|
|
|
|
import org.jeecgframework.poi.excel.view.JeecgEntityExcelView;
|
|
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
|
|
import org.springframework.transaction.annotation.Transactional;
|
|
|
|
import org.springframework.web.bind.annotation.*;
|
|
|
|
import org.springframework.web.multipart.MultipartFile;
|
|
|
|
import org.springframework.web.multipart.MultipartHttpServletRequest;
|
|
...
|
...
|
@@ -104,16 +105,17 @@ public class TblOrderFormController extends JeecgController<TblOrderForm, ITblOr |
|
|
|
* @param tblOrderForm
|
|
|
|
* @return
|
|
|
|
*/
|
|
|
|
@Transactional(rollbackFor = Exception.class)
|
|
|
|
@AutoLog(value = "订单表-添加")
|
|
|
|
@ApiOperation(value="订单表-添加", notes="订单表-添加")
|
|
|
|
@PostMapping(value = "/add")
|
|
|
|
public Result<String> add(@RequestBody TblOrderForm tblOrderForm) {
|
|
|
|
// 产品类型
|
|
|
|
String type = tblOrderForm.getProductType() + DateUtil.format(new Date(), "YYYYMM");
|
|
|
|
Integer count = tblOrderFormService.getCountByType(type);
|
|
|
|
log.info("订单编号:"+ count);
|
|
|
|
String orderId= type + StrUtil.padPre(String.valueOf(count+1),4, '0');
|
|
|
|
tblOrderForm.setOrderId(orderId);
|
|
|
|
String orderId = tblOrderFormService.getCountByType(type);
|
|
|
|
log.info("订单编号:"+ orderId);
|
|
|
|
String orderIdNew= type + StrUtil.padPre(String.valueOf(Integer.valueOf(orderId.substring(8))+1),4, '0');
|
|
|
|
tblOrderForm.setOrderId(orderIdNew);
|
|
|
|
//任务下达日期
|
|
|
|
tblOrderForm.setOrderDate(new Date());
|
|
|
|
//是否分派设计 0 未分派 1已分派
|
|
...
|
...
|
@@ -133,6 +135,7 @@ public class TblOrderFormController extends JeecgController<TblOrderForm, ITblOr |
|
|
|
* @param tblOrderForm
|
|
|
|
* @return
|
|
|
|
*/
|
|
|
|
@Transactional(rollbackFor = Exception.class)
|
|
|
|
@AutoLog(value = "订单表-编辑")
|
|
|
|
@ApiOperation(value="订单表-编辑", notes="订单表-编辑")
|
|
|
|
@RequestMapping(value = "/edit", method = {RequestMethod.PUT,RequestMethod.POST})
|
|
...
|
...
|
@@ -194,15 +197,17 @@ public class TblOrderFormController extends JeecgController<TblOrderForm, ITblOr |
|
|
|
* @param id
|
|
|
|
* @return
|
|
|
|
*/
|
|
|
|
@Transactional(rollbackFor = Exception.class)
|
|
|
|
@AutoLog(value = "订单表-通过id删除")
|
|
|
|
@ApiOperation(value="订单表-通过id删除", notes="订单表-通过id删除")
|
|
|
|
@DeleteMapping(value = "/delete")
|
|
|
|
public Result<String> delete(@RequestParam(name="id",required=true) String id) {
|
|
|
|
TblOrderForm orderForm = tblOrderFormService.getById(id);
|
|
|
|
if (!orderForm.getStatus().equals("未下单")){
|
|
|
|
return Result.error("订单已开始,不允许删除");
|
|
|
|
}
|
|
|
|
tblOrderFormService.delMain(id);
|
|
|
|
// TblOrderForm orderForm = tblOrderFormService.getById(id);
|
|
|
|
// if (!orderForm.getStatus().equals("未下单")){
|
|
|
|
// return Result.error("订单已开始,不允许删除");
|
|
|
|
// }
|
|
|
|
// tblOrderFormService.delMain(id);
|
|
|
|
tblOrderFormService.removeById(id);
|
|
|
|
return Result.OK("删除成功!");
|
|
|
|
}
|
|
|
|
|
...
|
...
|
|