|
@@ -7,7 +7,6 @@ import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
|
|
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
|
|
import com.fjhx.common.utils.Assert;
|
|
|
import com.fjhx.item.service.product.ProductInfoService;
|
|
|
-import com.fjhx.mes.entity.production.dto.ProductionSchedulingDto;
|
|
|
import com.fjhx.mes.entity.production.dto.ProductionSchedulingSelectDto;
|
|
|
import com.fjhx.mes.entity.production.po.ProductionOrder;
|
|
|
import com.fjhx.mes.entity.production.po.ProductionOrderDetail;
|
|
@@ -38,7 +37,6 @@ import org.springframework.stereotype.Service;
|
|
|
|
|
|
import javax.annotation.Resource;
|
|
|
import java.math.BigDecimal;
|
|
|
-import java.text.SimpleDateFormat;
|
|
|
import java.util.ArrayList;
|
|
|
import java.util.Date;
|
|
|
import java.util.List;
|
|
@@ -158,8 +156,7 @@ public class ProductionSchedulingServiceImpl extends ServiceImpl<ProductionSched
|
|
|
|
|
|
@DSTransactional
|
|
|
@Override
|
|
|
- public void add(List<ProductionScheduling> dtoList) {
|
|
|
- SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd");
|
|
|
+ public synchronized void add(List<ProductionScheduling> dtoList) {
|
|
|
for (ProductionScheduling dto : dtoList) {
|
|
|
dto.setCompanyId(SecurityUtils.getCompanyId());
|
|
|
|
|
@@ -170,7 +167,7 @@ public class ProductionSchedulingServiceImpl extends ServiceImpl<ProductionSched
|
|
|
.eq(ProductionScheduling::getSchedulingDate, dto.getSchedulingDate())
|
|
|
);
|
|
|
if (count > 0) {
|
|
|
- throw new ServiceException(sdf.format(dto.getSchedulingDate()) + "已有排程信息,请前往修改或删除!");
|
|
|
+ throw new ServiceException(DateUtil.format(dto.getSchedulingDate(), "yyyy-MM-dd") + "已有排程信息,请前往删除重新排程!");
|
|
|
}
|
|
|
this.save(dto);
|
|
|
|
|
@@ -180,18 +177,6 @@ public class ProductionSchedulingServiceImpl extends ServiceImpl<ProductionSched
|
|
|
}
|
|
|
|
|
|
@Override
|
|
|
- public void edit(ProductionSchedulingDto dto) {
|
|
|
- ProductionScheduling oldPs = this.getById(dto.getId());
|
|
|
- Assert.notEmpty(oldPs, "查询不到排程信息!");
|
|
|
-
|
|
|
- if (dto.getQuantity() < oldPs.getFinishQuantity()) {
|
|
|
- throw new ServiceException("排程数量不能小于已完工数量!");
|
|
|
- }
|
|
|
-
|
|
|
-// this.updateById(dto);
|
|
|
- }
|
|
|
-
|
|
|
- @Override
|
|
|
public void delete(Long id) {
|
|
|
ProductionScheduling oldPs = this.getById(id);
|
|
|
Assert.notEmpty(oldPs, "查询不到排程信息!");
|