| | |
| | | import com.bstek.dorado.annotation.DataProvider; |
| | | import com.bstek.dorado.annotation.DataResolver; |
| | | import com.bstek.dorado.annotation.Expose; |
| | | import com.fzzy.common.constant.BizTypeEnum; |
| | | import com.fzzy.igds.domain.Depot; |
| | | import com.fzzy.igds.service.DepotService; |
| | | import com.fzzy.igds.service.PledgeContractService; |
| | | import com.fzzy.igds.utils.ContextUtil; |
| | | import com.ruoyi.common.annotation.Log; |
| | | import com.ruoyi.common.enums.BusinessType; |
| | | import com.ruoyi.common.utils.StringUtils; |
| | | import lombok.extern.slf4j.Slf4j; |
| | | import org.springframework.beans.BeanUtils; |
| | | import org.springframework.stereotype.Component; |
| | | import org.springframework.transaction.annotation.Transactional; |
| | | |
| | | import javax.annotation.Resource; |
| | | import java.util.List; |
| | | |
| | |
| | | @Resource |
| | | private DepotService depotService; |
| | | |
| | | @Resource |
| | | private PledgeContractService pledgeContractService; |
| | | |
| | | /** |
| | | * depotPR#getData |
| | | * |
| | | * @return |
| | | */ |
| | | @DataProvider |
| | | public List<Depot> getData(){ |
| | | return depotService.getData(null, null); |
| | | public List<Depot> getData(String parentId) { |
| | | if (StringUtils.isNotEmpty(parentId)) { |
| | | return depotService.getData(null, parentId, false); |
| | | } |
| | | return depotService.getData(null, ContextUtil.subDeptId(null), false); |
| | | } |
| | | |
| | | /** |
| | | * depotPR#getDepotByUserType |
| | | * |
| | | * @return |
| | | */ |
| | | |
| | | @DataProvider |
| | | public List<Depot> getDepotByUserType(String parentId) { |
| | | if (StringUtils.isNotEmpty(parentId)) { |
| | | return depotService.getDepotByUserType(parentId); |
| | | } |
| | | return depotService.getDepotByUserType(null); |
| | | } |
| | | /** |
| | | * depotPR#saveOrUpdate |
| | | * |
| | | * @param data |
| | | * @return |
| | | */ |
| | |
| | | Depot depot = new Depot(); |
| | | BeanUtils.copyProperties(data, depot); |
| | | depotService.saveDepot(depot); |
| | | depotService.flushCache(null); |
| | | return null; |
| | | } |
| | | |
| | | /** |
| | | * 更新库存信息 |
| | | * depotPR#saveOrUpdate2 |
| | | * |
| | | * @param data |
| | | * @return |
| | | */ |
| | | @DataResolver |
| | | @Transactional |
| | | @Log(title = "库存管理", businessType = BusinessType.UPDATE,bizType = BizTypeEnum.SYS) |
| | | public String saveOrUpdate2(Depot data) { |
| | | |
| | | Depot depot = new Depot(); |
| | | BeanUtils.copyProperties(data, depot); |
| | | depotService.updateStorageReal(depot); |
| | | return null; |
| | | } |
| | | |
| | | /** |
| | | * depotPR#deleteDepot |
| | | * |
| | | * @param data |
| | | */ |
| | | @Expose |
| | | @Transactional |
| | | public void deleteDepot(Depot data) { |
| | | @Log(title = "仓库管理", businessType = BusinessType.DELETE,bizType = BizTypeEnum.SYS) |
| | | public void deleteDepot(Depot data) { |
| | | Depot depot = new Depot(); |
| | | BeanUtils.copyProperties(data, depot); |
| | | depotService.deleteDepot(depot); |
| | |
| | | |
| | | /** |
| | | * ${dorado.getDataProvider("depotPR#getAllCache").getResult()} |
| | | * |
| | | * @return |
| | | */ |
| | | @DataProvider |
| | |
| | | |
| | | /** |
| | | * depotPR#ajaxGetAllCache |
| | | * |
| | | * @return |
| | | */ |
| | | @Expose |
| | |
| | | } |
| | | |
| | | /** |
| | | * depotPR#getDataByCompanyId |
| | | * |
| | | * @return |
| | | */ |
| | | @DataProvider |
| | | public List<Depot> getDataByCompanyId() { |
| | | return depotService.getData(null, null, false); |
| | | } |
| | | |
| | | /** |
| | | * depotPR#getDepot 获取仓库信息 |
| | | * |
| | | * @param depotId |