|
@@ -1,6 +1,9 @@
|
|
|
package com.ruoyi.base.service.impl;
|
|
|
|
|
|
import java.util.List;
|
|
|
+
|
|
|
+import com.ruoyi.base.domain.vo.CodeSkuRelationshipVO;
|
|
|
+import com.ruoyi.common.core.domain.AjaxResult;
|
|
|
import com.ruoyi.common.utils.DateUtils;
|
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
|
import org.springframework.stereotype.Service;
|
|
@@ -10,37 +13,34 @@ import com.ruoyi.base.service.ICodeSkuRelationshipService;
|
|
|
|
|
|
/**
|
|
|
* 条码品号关系表Service业务层处理
|
|
|
- *
|
|
|
+ *
|
|
|
* @author andy
|
|
|
* @date 2022-11-07
|
|
|
*/
|
|
|
@Service
|
|
|
-public class CodeSkuRelationshipServiceImpl implements ICodeSkuRelationshipService
|
|
|
-{
|
|
|
+public class CodeSkuRelationshipServiceImpl implements ICodeSkuRelationshipService {
|
|
|
@Autowired
|
|
|
private CodeSkuRelationshipMapper codeSkuRelationshipMapper;
|
|
|
|
|
|
/**
|
|
|
* 查询条码品号关系表
|
|
|
- *
|
|
|
+ *
|
|
|
* @param id 条码品号关系表主键
|
|
|
* @return 条码品号关系表
|
|
|
*/
|
|
|
@Override
|
|
|
- public CodeSkuRelationship selectCodeSkuRelationshipById(Long id)
|
|
|
- {
|
|
|
+ public CodeSkuRelationship selectCodeSkuRelationshipById(Long id) {
|
|
|
return codeSkuRelationshipMapper.selectCodeSkuRelationshipById(id);
|
|
|
}
|
|
|
|
|
|
/**
|
|
|
* 查询条码品号关系表列表
|
|
|
- *
|
|
|
+ *
|
|
|
* @param codeSkuRelationship 条码品号关系表
|
|
|
* @return 条码品号关系表
|
|
|
*/
|
|
|
@Override
|
|
|
- public List<CodeSkuRelationship> selectCodeSkuRelationshipList(CodeSkuRelationship codeSkuRelationship)
|
|
|
- {
|
|
|
+ public List<CodeSkuRelationship> selectCodeSkuRelationshipList(CodeSkuRelationship codeSkuRelationship) {
|
|
|
return codeSkuRelationshipMapper.selectCodeSkuRelationshipList(codeSkuRelationship);
|
|
|
}
|
|
|
|
|
@@ -51,10 +51,9 @@ public class CodeSkuRelationshipServiceImpl implements ICodeSkuRelationshipServi
|
|
|
* @return 条码品号关系表
|
|
|
*/
|
|
|
@Override
|
|
|
- public CodeSkuRelationship selectCodeSkuRelationshipByModel(CodeSkuRelationship codeSkuRelationship)
|
|
|
- {
|
|
|
+ public CodeSkuRelationship selectCodeSkuRelationshipByModel(CodeSkuRelationship codeSkuRelationship) {
|
|
|
List<CodeSkuRelationship> list = codeSkuRelationshipMapper.selectCodeSkuRelationshipList(codeSkuRelationship);
|
|
|
- if (list!=null && list.size()>0) {
|
|
|
+ if (list != null && list.size() > 0) {
|
|
|
return list.get(0);
|
|
|
} else {
|
|
|
return null;
|
|
@@ -63,51 +62,62 @@ public class CodeSkuRelationshipServiceImpl implements ICodeSkuRelationshipServi
|
|
|
|
|
|
/**
|
|
|
* 新增条码品号关系表
|
|
|
- *
|
|
|
+ *
|
|
|
* @param codeSkuRelationship 条码品号关系表
|
|
|
* @return 结果
|
|
|
*/
|
|
|
@Override
|
|
|
- public int insertCodeSkuRelationship(CodeSkuRelationship codeSkuRelationship)
|
|
|
- {
|
|
|
+ public int insertCodeSkuRelationship(CodeSkuRelationship codeSkuRelationship) {
|
|
|
codeSkuRelationship.setCreateTime(DateUtils.getNowDate());
|
|
|
return codeSkuRelationshipMapper.insertCodeSkuRelationship(codeSkuRelationship);
|
|
|
}
|
|
|
|
|
|
/**
|
|
|
* 修改条码品号关系表
|
|
|
- *
|
|
|
+ *
|
|
|
* @param codeSkuRelationship 条码品号关系表
|
|
|
* @return 结果
|
|
|
*/
|
|
|
@Override
|
|
|
- public int updateCodeSkuRelationship(CodeSkuRelationship codeSkuRelationship)
|
|
|
- {
|
|
|
+ public int updateCodeSkuRelationship(CodeSkuRelationship codeSkuRelationship) {
|
|
|
codeSkuRelationship.setUpdateTime(DateUtils.getNowDate());
|
|
|
return codeSkuRelationshipMapper.updateCodeSkuRelationship(codeSkuRelationship);
|
|
|
}
|
|
|
|
|
|
/**
|
|
|
* 批量删除条码品号关系表
|
|
|
- *
|
|
|
+ *
|
|
|
* @param ids 需要删除的条码品号关系表主键
|
|
|
* @return 结果
|
|
|
*/
|
|
|
@Override
|
|
|
- public int deleteCodeSkuRelationshipByIds(Long[] ids)
|
|
|
- {
|
|
|
+ public int deleteCodeSkuRelationshipByIds(Long[] ids) {
|
|
|
return codeSkuRelationshipMapper.deleteCodeSkuRelationshipByIds(ids);
|
|
|
}
|
|
|
|
|
|
/**
|
|
|
* 删除条码品号关系表信息
|
|
|
- *
|
|
|
+ *
|
|
|
* @param id 条码品号关系表主键
|
|
|
* @return 结果
|
|
|
*/
|
|
|
@Override
|
|
|
- public int deleteCodeSkuRelationshipById(Long id)
|
|
|
- {
|
|
|
+ public int deleteCodeSkuRelationshipById(Long id) {
|
|
|
return codeSkuRelationshipMapper.deleteCodeSkuRelationshipById(id);
|
|
|
}
|
|
|
+
|
|
|
+ /**
|
|
|
+ * 条码检测
|
|
|
+ *
|
|
|
+ * @param sn 条码
|
|
|
+ * @return
|
|
|
+ */
|
|
|
+ @Override
|
|
|
+ public AjaxResult snCheck(String sn) {
|
|
|
+ CodeSkuRelationshipVO codeSkuRelationshipVO = codeSkuRelationshipMapper.selectCodeSkuRelationshipBySn(sn);
|
|
|
+ if (codeSkuRelationshipVO.getStatus().equals("N")) {
|
|
|
+ return AjaxResult.error("该产品已禁用");
|
|
|
+ }
|
|
|
+ return AjaxResult.success(codeSkuRelationshipVO);
|
|
|
+ }
|
|
|
}
|