|
|
@@ -1,5 +1,7 @@
|
|
|
package com.tld.service.impl;
|
|
|
|
|
|
+import com.github.pagehelper.PageHelper;
|
|
|
+import com.github.pagehelper.PageInfo;
|
|
|
import com.tld.mapper.AskGoodsMapper;
|
|
|
import com.tld.mapper.DeliveryMapper;
|
|
|
import com.tld.mapper.DictionaryMapper;
|
|
|
@@ -382,6 +384,72 @@ public class DeliveryServiceImpl implements DeliveryService {
|
|
|
return map;
|
|
|
}
|
|
|
|
|
|
+ @Override
|
|
|
+ public Map<String, Object> getEquipmentBindingSoftware(EquipmentBindingSoftware equipmentBindingSoftware) {
|
|
|
+ Map<String, Object> map = new HashMap<>();
|
|
|
+ try {
|
|
|
+ PageHelper.startPage(equipmentBindingSoftware.getPage(), equipmentBindingSoftware.getLimit());
|
|
|
+ PageInfo<EquipmentBindingSoftware> pageInfo = new PageInfo<>(deliveryMapper.getEquipmentBindingSoftware(equipmentBindingSoftware));
|
|
|
+ map.put("data", pageInfo);
|
|
|
+ map.put("msg", "200");
|
|
|
+ } catch (Exception e) {
|
|
|
+ e.printStackTrace();
|
|
|
+ map.put("msg", "500");
|
|
|
+ map.put("errMsg", "服务器请求异常,请稍后再试");
|
|
|
+ }
|
|
|
+ return map;
|
|
|
+ }
|
|
|
+
|
|
|
+ @Override
|
|
|
+ public Map<String, Object> addEquipmentBindingSoftware(EquipmentBindingSoftware equipmentBindingSoftware, HttpServletRequest request) {
|
|
|
+ Map<String, Object> map = new HashMap<>();
|
|
|
+ try {
|
|
|
+ equipmentBindingSoftware.setModifyUser(request.getHeader("userId"));
|
|
|
+ int count = deliveryMapper.getIsNotBinding(equipmentBindingSoftware);
|
|
|
+ if(count > 0){
|
|
|
+ map.put("msg", "500");
|
|
|
+ map.put("errMsg", "此设备已经绑定过次软件,请勿重复绑定!");
|
|
|
+ return map;
|
|
|
+ }
|
|
|
+ deliveryMapper.addEquipmentBindingSoftware(equipmentBindingSoftware);
|
|
|
+ map.put("msg", "200");
|
|
|
+ } catch (Exception e) {
|
|
|
+ e.printStackTrace();
|
|
|
+ map.put("msg", "500");
|
|
|
+ map.put("errMsg", "服务器请求异常,请稍后再试");
|
|
|
+ }
|
|
|
+ return map;
|
|
|
+ }
|
|
|
+
|
|
|
+ @Override
|
|
|
+ public Map<String, Object> updateEquipmentBindingSoftware(EquipmentBindingSoftware equipmentBindingSoftware, HttpServletRequest request) {
|
|
|
+ Map<String, Object> map = new HashMap<>();
|
|
|
+ try {
|
|
|
+ equipmentBindingSoftware.setModifyUser(request.getHeader("userId"));
|
|
|
+ deliveryMapper.updateEquipmentBindingSoftware(equipmentBindingSoftware);
|
|
|
+ map.put("msg", "200");
|
|
|
+ } catch (Exception e) {
|
|
|
+ e.printStackTrace();
|
|
|
+ map.put("msg", "500");
|
|
|
+ map.put("errMsg", "服务器请求异常,请稍后再试");
|
|
|
+ }
|
|
|
+ return map;
|
|
|
+ }
|
|
|
+
|
|
|
+ @Override
|
|
|
+ public Map<String, Object> delEquipmentBindingSoftware(String id) {
|
|
|
+ Map<String, Object> map = new HashMap<>();
|
|
|
+ try {
|
|
|
+ deliveryMapper.delEquipmentBindingSoftware(id);
|
|
|
+ map.put("msg", "200");
|
|
|
+ } catch (Exception e) {
|
|
|
+ e.printStackTrace();
|
|
|
+ map.put("msg", "500");
|
|
|
+ map.put("errMsg", "服务器请求异常,请稍后再试");
|
|
|
+ }
|
|
|
+ return map;
|
|
|
+ }
|
|
|
+
|
|
|
/**
|
|
|
* 出库单生成
|
|
|
* @return
|