goods.js 9.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373
  1. define([ 'ngResource' ], function() {
  2. angular.module('goodsServices', [ 'ngResource' ]).factory('Goods', ['$resource', 'BaseService', function($resource, BaseService) {
  3. var rootPath = BaseService.getRootPath();
  4. //获取ComponentSubmit的分页数据
  5. return $resource('trade/goods', {}, {
  6. /**
  7. * 获取分页面的GOODS数据(后台数据 产品管理部分)
  8. * start wangcz
  9. * */
  10. loadGoodsList: {
  11. url: 'trade/goods/background/page',
  12. method: 'POST'
  13. },
  14. // 获取上传产品详情列表数据
  15. loadUploadProductDetail: {
  16. url: '/store-service/storeinfo',
  17. method: 'GET'
  18. },
  19. /**
  20. * end wangcz
  21. * */
  22. //取得完整的消息
  23. findAllByUuid : {
  24. url : 'trade/goods/byUuid/:uuid',
  25. method : 'GET',
  26. isArray : true
  27. },
  28. // 取得价格信息
  29. findPriceByCode : {
  30. url : 'trade/goods/price',
  31. method : 'GET'
  32. },
  33. //取得简化的消息
  34. findSimpleAllByUuid : {
  35. url : 'trade/goods/simple/byUuid/:uuid',
  36. method : 'GET',
  37. isArray : true
  38. },
  39. findOneById : {
  40. url : 'trade/goods/one',
  41. method : 'GET'
  42. },
  43. //取得有效的简化的消息
  44. findSimpleAvailableByUuid : {
  45. url : 'trade/goods/simple/byUuidAndCurrency',
  46. method : 'GET',
  47. isArray : true,
  48. params : { _status : 'available' }
  49. },
  50. // 通过uuid获取批次信息
  51. findGoodsGroupByStoreOrderByMinrmbPrice : {
  52. url : 'trade/goods/store/uuid/:uuid',
  53. method : 'GET',
  54. isArray : true
  55. },
  56. // 上传Excel批量发布产品
  57. publishByExcel: {
  58. url: 'trade/goods/publish/excel',
  59. method: 'POST'
  60. },
  61. //获取在售的产品
  62. findSalingGoods : {
  63. url : 'trade/goods/saling',
  64. method :'GET'
  65. },
  66. //管理平台获取在售的产品
  67. findSalingGoodsAdmin : {
  68. url : 'trade/goods/saling/admin',
  69. method :'GET'
  70. },
  71. //获取已下架的产品
  72. findDownedGoods : {
  73. url : 'trade/goods/downed',
  74. method :'GET'
  75. },
  76. // 获取上架/下架产品
  77. findUpAndDown : {
  78. url : 'trade/goods/upAndDown',
  79. method :'GET'
  80. },
  81. //管理平台获取已下架的产品
  82. findDownedGoodsAdmin : {
  83. url : 'trade/goods/downed/admin',
  84. method :'GET'
  85. },
  86. //更新产品
  87. updateGoods : {
  88. url : 'trade/goods',
  89. method : 'PUT'
  90. },
  91. //批量下架产品
  92. batchDown : {
  93. url : 'trade/goods/batchdown',
  94. method : 'DELETE'
  95. },
  96. //失效产品全部下架产品
  97. batchDownAll : {
  98. url : 'trade/goods/batchdownAll',
  99. method : 'DELETE'
  100. },
  101. //根据批次号获取产品详情
  102. findByBatchCode : {
  103. url : 'trade/goods/:batchCode/detail',
  104. method : 'GET'
  105. },
  106. //判断商品是否被送样
  107. isSample : {
  108. url : 'trade/goods/:id/issample',
  109. method : 'GET'
  110. },
  111. //刷新批次有效期
  112. refresh : {
  113. url : 'trade/goods/refresh/:id',
  114. method : 'GET'
  115. },
  116. //获取即将失效批次
  117. getOvertime : {
  118. url : 'trade/goods/overtime',
  119. method : 'GET',
  120. isArray : true
  121. },
  122. // 获取发布人信息
  123. getPublisherInfo : {
  124. url : 'trade/goods/publisher/info',
  125. method : 'GET'
  126. },
  127. getStatistics : {
  128. url : 'trade/goods/statistics',
  129. method : 'GET'
  130. },
  131. // 根据关键字、库存来源和器件类目分页获取商品信息列表
  132. findGoodsByKeyword : {
  133. url : 'api/product/component/goods/original/:original',
  134. method : 'GET'
  135. },
  136. // 根据批次号获取批次信息变更记录(卖家)
  137. findGoodsHistoryWithVendor : {
  138. url : 'trade/goods/goodsHistory',
  139. method : 'GET'
  140. },
  141. // 分页获取当前店铺的某一状态的商品信息
  142. getGoodsByPageAndStatus : {
  143. url : 'trade/goods/store/status',
  144. method : 'GET'
  145. },
  146. // 重新上架已下架商品 该方法的后台代码又问题,被弃用
  147. putOnCommodityOnce : {
  148. url : rootPath + '/trade/goods/:batchCode/putOnOnce',
  149. method : 'PUT'
  150. },
  151. //商品上架
  152. putOn : {
  153. url : 'trade/goods/putOn/:id',
  154. method: 'PUT'
  155. },
  156. downNowEnterpriseGoods: {
  157. url : 'trade/goods/down/enUU',
  158. method: 'PUT'
  159. },
  160. // 删除列表
  161. deleteGoodsByIdList: {
  162. url : 'trade/goods/delete/batch',
  163. method: 'PUT'
  164. },
  165. // 删除企业下在售
  166. deleteGoodsByEnUU: {
  167. url : 'trade/goods/delete/enUU',
  168. method: 'PUT'
  169. },
  170. // 卖家下架已上架商品
  171. offShelfGoodsByProvider : {
  172. url : 'trade/goods/provider/off/shelf',
  173. method : 'PUT'
  174. },
  175. // 卖家下架已上架商品
  176. offShelfGoodsByids : {
  177. url : rootPath + '/trade/goods/provider/down/id',
  178. method : 'PUT'
  179. },
  180. // 随机生成4个热卖商品 Deprecated
  181. randomGetHotCommodity : {
  182. url : rootPath + '/trade/goods/hot/random',
  183. method : 'GET'
  184. },
  185. // 据店铺UUID获取商品和品牌的数量
  186. findCommodityAndKindNumberByStore : {
  187. url : rootPath + '/trade/goods/storeid/:storeUuid/counts',
  188. method : 'GET'
  189. },
  190. //获取最近的库存信息
  191. getLatestGoods: {
  192. url : rootPath + '/api/commodity/latest',
  193. method : 'GET',
  194. isArray : true
  195. },
  196. // 各月新增在售批次数量
  197. getIncreaseBatch: {
  198. url : rootPath + '/trade/goods/increaseBatchCount',
  199. method : 'GET',
  200. isArray : true
  201. },
  202. // 各月新增在售器件数量
  203. getIncreaseCmp: {
  204. url : rootPath + '/trade/goods/increaseCmpCount',
  205. method : 'GET',
  206. isArray : true
  207. },
  208. // 上传产品个数
  209. getProductsCmp: {
  210. url : rootPath + '/trade/products/apply/count',
  211. method : 'GET'
  212. },
  213. // 所有统计信息数据
  214. getAllCmp: {
  215. url : rootPath + '/api/product/commoncount/all',
  216. method : 'GET',
  217. isArray: true
  218. },
  219. getDownLoadStatus: {
  220. url : 'release/product/release/failure/status',
  221. method : 'GET'
  222. },
  223. /**
  224. * 获取类似的产品
  225. */
  226. getSimilarityPro : {
  227. url : 'trade/goods/similarities',
  228. method : 'GET'
  229. },
  230. /**
  231. * 获取类似的产品
  232. */
  233. getSimilarityProCount : {
  234. url : 'trade/goods/similarities/count',
  235. method : 'GET'
  236. },
  237. /**
  238. * 批量获取类似的产品
  239. */
  240. getSimilarityProCountBatch : {
  241. url : 'trade/goods/similarities/count/batch',
  242. method : 'POST'
  243. },
  244. /**
  245. * 下架该公司所有的产品
  246. */
  247. downAllGoodsByEnterprise : {
  248. url : 'trade/goods/downAllGoods/enterprise',
  249. method : 'GET'
  250. },
  251. /**
  252. * 根据产品id获取对应上架信息
  253. */
  254. getGoodsByProductId : {
  255. url : 'trade/goods/by/productId',
  256. method : 'GET',
  257. isArray : true
  258. },
  259. /**
  260. * 修改goods状态,转为在售
  261. */
  262. modifyGoodsStatus : {
  263. url : 'trade/goods/turn/sale',
  264. method : 'PUT'
  265. },
  266. /**
  267. * 是否被推荐了
  268. */
  269. isRecommendGoods : {
  270. url : 'trade/goods/isRecommend/:id',
  271. method: 'GET'
  272. },
  273. /**
  274. * 删除产品信息
  275. */
  276. deleteGoodsById : {
  277. url : 'trade/goods/delete/:id',
  278. method: 'DELETE'
  279. },
  280. /**
  281. * 添加产品信息
  282. */
  283. addGoods : {
  284. url : 'trade/goods/addGoods',
  285. method : 'POST'
  286. },
  287. getDeleteProductMessage : {
  288. url : 'trade/goods/:productid/deleteMessage',
  289. method : 'GET'
  290. },
  291. getRepeatByTagAndProductId : {
  292. url : 'trade/goods/repeat/tag',
  293. method : 'GET'
  294. },
  295. // 查看出入库记录
  296. getLoadStorageData: {
  297. url: 'CommodityInOutbound/page',
  298. method: 'GET'
  299. },
  300. // 库存管理其它出入库,根据联想词得到产品库数据
  301. getKeywordToProductId : {
  302. url : 'trade/products/code/keyword',
  303. method : 'GET',
  304. isArray : true
  305. },
  306. // 库存管理其它出入库,保存数据
  307. saveOtherProductData : {
  308. url: 'CommodityInOutbound/:storage_tab/other?enName=:enName',
  309. method: 'POST'
  310. },
  311. // 采购入库接口
  312. getByEnterpriseData: {
  313. url : 'trade/invoice/enterprise/inbound',
  314. method: 'GET'
  315. },
  316. // 采购入库确认入库接口
  317. getByEnterpriseId: {
  318. url : 'trade/order/signReceive',
  319. method: 'PUT',
  320. params : { _status : 'ensureaccept' }
  321. },
  322. // 销售出库接口对应销售订单的待发货
  323. getByStatusAndInternal: {
  324. url : 'trade/purchase/status/createtime',
  325. method: 'GET'
  326. },
  327. // 获取物流公司信息
  328. findAllSelected : {
  329. url: 'trade/distributor/selected',
  330. method: 'GET',
  331. isArray : true
  332. },
  333. // 根据所有ID获取产品信息
  334. findAllProduct : {
  335. url: 'trade/products/ids',
  336. method: 'GET',
  337. isArray : true
  338. }
  339. });
  340. }]).factory('GoodsModifyInfo', ['$resource', function ($resource) {
  341. return $resource('goods/modifyInfo', {}, {
  342. getPageModifyInfo : {
  343. url: 'goods/modifyInfo/page',
  344. method: 'GET'
  345. },
  346. getPageModifyDetail : {
  347. url: 'goods/modifyInfo/detail/page',
  348. method: 'GET'
  349. },
  350. getModifyInfoByBatchCode : {
  351. url: 'goods/modifyInfo/batchCode',
  352. method: 'GET',
  353. isArray: true
  354. },
  355. auditedGoods : {
  356. url: 'goods/modifyInfo/audit/goods',
  357. method: 'PUT'
  358. }
  359. })
  360. }]).factory('GoodsHistory', ['$resource', function ($resource) {
  361. return $resource('trade/goodsHistory', {}, {
  362. findDataOfUpAndDown: {
  363. url: 'trade/goodsHistory/page/batchCode',
  364. method: 'GET'
  365. }
  366. })
  367. }]);
  368. });