Browse Source

roll label

print/logistic/save
qiezi 2 years ago
parent
commit
d1312d05ac
  1. 6
      src/main/java/com/gaotao/modules/label/service/impl/PrintRollLabelRecordServiceImpl.java
  2. 7
      src/main/java/com/gaotao/modules/part/controller/CategoryController.java
  3. 16
      src/main/java/com/gaotao/modules/part/entity/Category.java
  4. 2
      src/main/java/com/gaotao/modules/part/service/CategoryService.java
  5. 9
      src/main/java/com/gaotao/modules/part/service/impl/CategoryServiceImpl.java

6
src/main/java/com/gaotao/modules/label/service/impl/PrintRollLabelRecordServiceImpl.java

@ -13,11 +13,13 @@ import com.gaotao.modules.label.service.PrintRollLabelRecordService;
import com.gaotao.modules.label.service.SeqService;
import com.gaotao.modules.sys.service.SysMsgService;
import lombok.extern.slf4j.Slf4j;
import org.apache.commons.lang.time.DateFormatUtils;
import org.springframework.beans.BeanUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import org.springframework.util.StringUtils;
import java.math.BigDecimal;
import java.time.LocalDate;
@ -52,6 +54,10 @@ public class PrintRollLabelRecordServiceImpl extends ServiceImpl<PrintRollLabelR
BigDecimal cartonCount = printRollLabelRecord.getCartonCount();
// 计数器
BigDecimal zero = BigDecimal.ZERO;
// 处理OrderNo/Po
if(StringUtils.isEmpty(printRollLabelRecord.getOrderNo())){
printRollLabelRecord.setOrderNo(DateFormatUtils.format(new Date(), "yyyyMMdd"));
}
if (cartonCount.compareTo(zero) == 0 && cartonCount.scale() != 0){
throw new RuntimeException(sysMsgService.getLanguageMsg(SysMsgConstant.PRINT_LABEL_COUNT_ERROR));
}

7
src/main/java/com/gaotao/modules/part/controller/CategoryController.java

@ -23,4 +23,11 @@ public class CategoryController {
List<Category> list = categoryService.selectCategoryList(category);
return R.ok().put("rows", list);
}
@PostMapping
public R getCategoryByValue(@RequestBody Category category) {
Category category1 = categoryService.getCategoryByValue(category.getCategoryValue());
return R.ok().put("data", category1);
}
}

16
src/main/java/com/gaotao/modules/part/entity/Category.java

@ -1,6 +1,7 @@
package com.gaotao.modules.part.entity;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import lombok.Data;
@ -8,6 +9,7 @@ import lombok.Data;
@TableName("category")
public class Category {
@TableId
private Long id;
private String categoryName;
@ -24,5 +26,19 @@ public class Category {
private String rollLabelRequired;
private String qtyPerRollLabel;//每卷数量 描述
private String cartonCountLabel;//每箱数量 描述
private String rollCountLabel;//每卷数量 描述
private String showRollQtyPerRoll;
private String showCartonQtyPerRoll;
private String showCartonRollsPerCarton;
private String editQtyPerCarton;
private String active;
}

2
src/main/java/com/gaotao/modules/part/service/CategoryService.java

@ -7,4 +7,6 @@ import java.util.List;
public interface CategoryService extends IService<Category> {
List<Category> selectCategoryList(Category category);
Category getCategoryByValue(String categoryValue);
}

9
src/main/java/com/gaotao/modules/part/service/impl/CategoryServiceImpl.java

@ -7,6 +7,7 @@ import com.gaotao.modules.part.mapper.CategoryMapper;
import com.gaotao.modules.part.service.CategoryService;
import lombok.extern.slf4j.Slf4j;
import org.springframework.stereotype.Service;
import org.springframework.util.StringUtils;
import java.util.List;
@ -21,4 +22,12 @@ public class CategoryServiceImpl extends ServiceImpl<CategoryMapper,Category> im
return lambdaQuery().eq(Category::getActive, Constant.ACTIVE).orderByAsc(Category::getSeqNo).list();
}
@Override
public Category getCategoryByValue(String categoryValue) {
if (StringUtils.isEmpty(categoryValue)){
throw new RuntimeException("Part Category is null");
}
return lambdaQuery().eq(Category::getCategoryValue, categoryValue).one();
}
}
Loading…
Cancel
Save