|
@@ -1,10 +1,18 @@
|
|
package com.yh.saas.plugin.yiliangyiyun.service.impl;
|
|
package com.yh.saas.plugin.yiliangyiyun.service.impl;
|
|
|
|
|
|
|
|
+import com.baomidou.mybatisplus.plugins.Page;
|
|
|
|
+import com.google.common.collect.Lists;
|
|
|
|
+import com.yh.saas.plugin.yiliangyiyun.constant.StatusEnum;
|
|
import com.yh.saas.plugin.yiliangyiyun.entity.WeighingManagement;
|
|
import com.yh.saas.plugin.yiliangyiyun.entity.WeighingManagement;
|
|
import com.yh.saas.plugin.yiliangyiyun.mapper.WeighingManagementMapper;
|
|
import com.yh.saas.plugin.yiliangyiyun.mapper.WeighingManagementMapper;
|
|
import com.yh.saas.plugin.yiliangyiyun.service.IWeighingManagementService;
|
|
import com.yh.saas.plugin.yiliangyiyun.service.IWeighingManagementService;
|
|
import com.baomidou.mybatisplus.service.impl.ServiceImpl;
|
|
import com.baomidou.mybatisplus.service.impl.ServiceImpl;
|
|
import org.springframework.stereotype.Service;
|
|
import org.springframework.stereotype.Service;
|
|
|
|
+import org.springframework.transaction.annotation.Transactional;
|
|
|
|
+
|
|
|
|
+import java.util.HashMap;
|
|
|
|
+import java.util.List;
|
|
|
|
+import java.util.Map;
|
|
|
|
|
|
/**
|
|
/**
|
|
* <p>
|
|
* <p>
|
|
@@ -17,4 +25,68 @@ import org.springframework.stereotype.Service;
|
|
@Service
|
|
@Service
|
|
public class WeighingManagementServiceImpl extends ServiceImpl<WeighingManagementMapper, WeighingManagement> implements IWeighingManagementService {
|
|
public class WeighingManagementServiceImpl extends ServiceImpl<WeighingManagementMapper, WeighingManagement> implements IWeighingManagementService {
|
|
|
|
|
|
|
|
+ /**
|
|
|
|
+ * 检斤管理列表
|
|
|
|
+ * @param weighingManagement
|
|
|
|
+ * @return
|
|
|
|
+ */
|
|
|
|
+ @Override
|
|
|
|
+ public Page<WeighingManagement> selectWeighingManagement(WeighingManagement weighingManagement) {
|
|
|
|
+ Map<String, Object> pageView = new HashMap<>();
|
|
|
|
+ pageView.put("startRecord", (weighingManagement.getCurrentPage() - 1)
|
|
|
|
+ * weighingManagement.getPageSize());
|
|
|
|
+ //公司id
|
|
|
|
+ pageView.put("compId",weighingManagement.getCompId());
|
|
|
|
+ pageView.put("searchKeyWord",weighingManagement.getSearchKeyWord());
|
|
|
|
+ pageView.put("pageSize",weighingManagement.getPageSize());
|
|
|
|
+ pageView.put("currentPage",weighingManagement.getCurrentPage());
|
|
|
|
+ // 查询销售订单总数
|
|
|
|
+ Integer dataCount = baseMapper.getCountByCondition(pageView);
|
|
|
|
+ List<WeighingManagement> dataList = baseMapper.getListByCondition(pageView);
|
|
|
|
+ Page<WeighingManagement> page = new Page<>();
|
|
|
|
+ page.setRecords(dataList == null ? Lists.newArrayList() : dataList);
|
|
|
|
+ page.setTotal(dataCount == null ? 0 : dataCount);
|
|
|
|
+ page.setCurrent(weighingManagement.getCurrentPage());
|
|
|
|
+ page.setSize(weighingManagement.getPageSize());
|
|
|
|
+ return page;
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ /**
|
|
|
|
+ * 毛重检斤
|
|
|
|
+ * @param weighingManagement
|
|
|
|
+ * @return
|
|
|
|
+ */
|
|
|
|
+ @Override
|
|
|
|
+ @Transactional(rollbackFor = Exception.class)
|
|
|
|
+ public String editGrossWeight(WeighingManagement weighingManagement) {
|
|
|
|
+ //状态改为已称毛重
|
|
|
|
+ weighingManagement.setStatus(StatusEnum.WEIGHED_GROSS_WEIGHT.getName());
|
|
|
|
+ weighingManagement.setStatusFlag(StatusEnum.WEIGHED_GROSS_WEIGHT.getFlag());
|
|
|
|
+ boolean one = this.updateById(weighingManagement);
|
|
|
|
+ if (one) {
|
|
|
|
+ return "OK";
|
|
|
|
+ } else {
|
|
|
|
+ return "NG";
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ /**
|
|
|
|
+ * 皮重检斤
|
|
|
|
+ * @param weighingManagement
|
|
|
|
+ * @return
|
|
|
|
+ */
|
|
|
|
+ @Override
|
|
|
|
+ @Transactional(rollbackFor = Exception.class)
|
|
|
|
+ public String editTare(WeighingManagement weighingManagement) {
|
|
|
|
+ //状态改为已称皮重
|
|
|
|
+ weighingManagement.setStatus(StatusEnum.TARED.getName());
|
|
|
|
+ weighingManagement.setStatusFlag(StatusEnum.TARED.getFlag());
|
|
|
|
+ boolean one = this.updateById(weighingManagement);
|
|
|
|
+ if (one) {
|
|
|
|
+ return "OK";
|
|
|
|
+ } else {
|
|
|
|
+ return "NG";
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+
|
|
}
|
|
}
|