| | |
| | | package com.consum.base.config; |
| | | |
| | | import cn.afterturn.easypoi.excel.entity.result.ExcelVerifyHandlerResult; |
| | | import cn.afterturn.easypoi.handler.inter.IExcelVerifyHandler; |
| | | import java.util.HashMap; |
| | | import java.util.List; |
| | | import java.util.StringJoiner; |
| | | |
| | | import com.consum.base.core.type.StatesType; |
| | | import com.consum.base.pojo.WarnConfImEntity; |
| | | import com.consum.base.service.BaseGoodsModelsService; |
| | | import com.consum.base.service.BaseGoodsTemplateService; |
| | |
| | | import com.consum.model.po.BaseWarehouse; |
| | | import com.iplatform.core.BeanContextAware; |
| | | import com.walker.infrastructure.utils.CollectionUtils; |
| | | import java.util.HashMap; |
| | | import java.util.List; |
| | | import java.util.StringJoiner; |
| | | |
| | | import cn.afterturn.easypoi.excel.entity.result.ExcelVerifyHandlerResult; |
| | | import cn.afterturn.easypoi.handler.inter.IExcelVerifyHandler; |
| | | |
| | | /** |
| | | * @ClassName WhWarningImportVerifyHandler |
| | |
| | | **/ |
| | | |
| | | public class WhWarningImportVerifyHandler implements IExcelVerifyHandler<WarnConfImEntity> { |
| | | //保存所有数据 |
| | | // 保存所有数据 |
| | | private HashMap<String, Integer> containMap; |
| | | // 当前人机构 |
| | | private Long agencyId; |
| | |
| | | this.baseGoodsModelsService = BeanContextAware.getBeanByType(BaseGoodsModelsService.class); |
| | | |
| | | } |
| | | |
| | | |
| | | @Override |
| | | public ExcelVerifyHandlerResult verifyHandler(WarnConfImEntity param) { |
| | |
| | | param.setBaseWarehouseId(warehouse.getId()); |
| | | } |
| | | |
| | | List<BaseGoodsTemplate> baseGoodsTemplates = baseGoodsTemplateService.queryGoodsTemplateByCategoryId(agencyId, null, (short) 1, goodsTemplateName); |
| | | List<BaseGoodsTemplate> baseGoodsTemplates = baseGoodsTemplateService.queryGoodsTemplateByCategoryId(agencyId, |
| | | null, StatesType.NORMAL.getValue(), goodsTemplateName); |
| | | if (CollectionUtils.isEmpty(baseGoodsTemplates)) { |
| | | joiner.add("物品名称有误"); |
| | | String errMsg = joiner.toString(); |
| | |
| | | import com.alibaba.excel.event.AnalysisEventListener; |
| | | import com.alibaba.excel.exception.ExcelDataConvertException; |
| | | import com.consum.base.BaseController; |
| | | import com.consum.base.core.type.StatesType; |
| | | import com.consum.base.core.utils.CommonUtil; |
| | | import com.consum.base.core.utils.MapUtils; |
| | | import com.consum.base.core.utils.MapperUtil; |
| | |
| | | * |
| | | * @author 卢庆阳 |
| | | * @date 2023/10/25 |
| | | * <p> |
| | | * 物品的禁用或删除,不影响已经采购入过库的物品信息。 |
| | | * <p> |
| | | */ |
| | | // TODO 物品的禁用或删除,不影响已经采购入过库的物品信息。 |
| | | @PostMapping("/updStatus") |
| | | public ResponseValue updateStatus() { |
| | | BaseGoodsTemplate goodsTemplate = CommonUtil.getObjFromReqBody(BaseGoodsTemplate.class); |
| | |
| | | * @Description 根据物品id删除物品 |
| | | * @Author 卢庆阳 |
| | | * @Date 2023/10/25 |
| | | * <p> |
| | | * 物品的禁用或删除,不影响已经采购入过库的物品信息。 |
| | | * <p/> |
| | | */ |
| | | // TODO 物品的禁用或删除,不影响已经采购入过库的物品信息。 |
| | | @DeleteMapping("/del") |
| | | public ResponseValue updateById() { |
| | | BaseGoodsTemplate goodsTemplate = CommonUtil.getObjFromReqBody(BaseGoodsTemplate.class); |
| | |
| | | |
| | | @GetMapping("/query/goodsTemplate") |
| | | public ResponseValue queryGoodsTemplateByCategoryId(Long agencyId, Long categoryId) { |
| | | // TODO 不限制机构 |
| | | List<BaseGoodsTemplate> list = |
| | | this.baseGoodsTemplateService.queryGoodsTemplateByCategoryId(null, categoryId, null, null); |
| | | // 不限制机构 |
| | | List<BaseGoodsTemplate> list = baseGoodsTemplateService.queryGoodsTemplateByCategoryId(null, categoryId, |
| | | StatesType.NORMAL.getValue(), null); |
| | | if (list == null) { |
| | | return ResponseValue.error("查询失败!"); |
| | | } |
New file |
| | |
| | | package com.consum.base.core.type; |
| | | |
| | | /** |
| | | * 状态枚举 |
| | | * |
| | | * @author asus |
| | | * @version 2023/12/14 13:41 |
| | | **/ |
| | | public enum StatesType { |
| | | /** |
| | | * 正常 |
| | | */ |
| | | NORMAL(1, "正常"), |
| | | /** |
| | | * 禁用 |
| | | */ |
| | | DISABLED(2, "禁用"), |
| | | /** |
| | | * 已删除 |
| | | */ |
| | | DELETE(3, "已删除"); |
| | | |
| | | private Integer value; |
| | | |
| | | private String desc; |
| | | |
| | | StatesType(Integer value, String desc) { |
| | | this.value = value; |
| | | this.desc = desc; |
| | | } |
| | | |
| | | public Integer getValue() { |
| | | return value; |
| | | } |
| | | |
| | | public void setValue(Integer value) { |
| | | this.value = value; |
| | | } |
| | | |
| | | public String getDesc() { |
| | | return desc; |
| | | } |
| | | |
| | | public void setDesc(String desc) { |
| | | this.desc = desc; |
| | | } |
| | | } |
| | |
| | | package com.consum.base.service; |
| | | |
| | | import java.util.List; |
| | | import java.util.Map; |
| | | |
| | | import com.consum.base.pojo.BaseGoodsTemplateParam; |
| | | import com.consum.model.po.BaseCategory; |
| | | import com.consum.model.po.BaseGoodsTemplate; |
| | |
| | | import com.iplatform.model.po.S_user_core; |
| | | import com.walker.db.page.GenericPager; |
| | | import com.walker.jdbc.service.BaseService; |
| | | import java.util.List; |
| | | import java.util.Map; |
| | | |
| | | public interface BaseGoodsTemplateService extends BaseService { |
| | | |
| | |
| | | * @param agencyId |
| | | * @param categoryId |
| | | * @param states |
| | | * @param goodsName 全匹配!!! |
| | | * @param goodsName 全匹配!!! |
| | | * @return |
| | | */ |
| | | |
| | | List<BaseGoodsTemplate> queryGoodsTemplateByCategoryId(Long agencyId, Long categoryId, Short states, String goodsName); |
| | | List<BaseGoodsTemplate> queryGoodsTemplateByCategoryId(Long agencyId, Long categoryId, Integer states, |
| | | String goodsName); |
| | | } |
| | |
| | | public List<BaseGoodsModels> queryGoodsModelByGoodsTemplatesId(Long baseGoodsModelsId) { |
| | | StringBuilder sql = new StringBuilder("select * from base_goods_models where states != 3 "); |
| | | HashMap<String, Object> param = new HashMap<>(); |
| | | sql.append("and goods_templates_id=:baseGoodsModelsId"); |
| | | param.put("baseGoodsModelsId", baseGoodsModelsId); |
| | | if (baseGoodsModelsId != null) { |
| | | sql.append("and goods_templates_id=:baseGoodsModelsId"); |
| | | param.put("baseGoodsModelsId", baseGoodsModelsId); |
| | | } |
| | | return select(sql.toString(), param, new BaseGoodsModels()); |
| | | } |
| | | |
| | |
| | | * @return |
| | | */ |
| | | @Override |
| | | public List<BaseGoodsTemplate> queryGoodsTemplateByCategoryId(Long agencyId, Long categoryId, Short states, |
| | | public List<BaseGoodsTemplate> queryGoodsTemplateByCategoryId(Long agencyId, Long categoryId, Integer states, |
| | | String goodsName) { |
| | | StringBuilder sql = new StringBuilder("SELECT * FROM base_goods_template WHERE 1=1 "); |
| | | Map<String, Object> params = new HashMap<>(); |