old mode 100644
new mode 100755
| | |
| | | |
| | | import com.alibaba.fastjson.JSONObject; |
| | | import com.java110.core.base.dao.BaseServiceDao; |
| | | import com.java110.dto.basePrivilege.BasePrivilegeDto; |
| | | import com.java110.dto.businessDatabus.BusinessDatabusDto; |
| | | import com.java110.entity.mapping.Mapping; |
| | | import com.java110.order.dao.ICenterServiceDAO; |
| | | import com.java110.utils.constant.ResponseConstant; |
| | | import com.java110.utils.exception.DAOException; |
| | | import com.java110.utils.util.StringUtil; |
| | | import org.slf4j.Logger; |
| | | import org.slf4j.LoggerFactory; |
| | | import org.springframework.stereotype.Service; |
| | |
| | | public class CenterServiceDAOImpl extends BaseServiceDao implements ICenterServiceDAO { |
| | | |
| | | protected final static Logger logger = LoggerFactory.getLogger(CenterServiceDAOImpl.class); |
| | | |
| | | @Override |
| | | public Map getOrder(Map order) throws DAOException { |
| | | List<Map> orders = sqlSessionTemplate.selectList("centerServiceDAOImpl.getOrder", order); |
| | | if (orders != null && orders.size() > 0) { |
| | | return orders.get(0); |
| | | } |
| | | return null; |
| | | } |
| | | |
| | | @Override |
| | | public List<Map> getOrderItems(Map orderItem) throws DAOException { |
| | | List<Map> orderItems = sqlSessionTemplate.selectList("centerServiceDAOImpl.getOrderItems", orderItem); |
| | | |
| | | return orderItems; |
| | | } |
| | | |
| | | @Override |
| | | public void saveOrderItem(Map orderItem) throws DAOException { |
| | | logger.debug("----【CenterServiceDAOImpl.saveOrderItem】保存数据入参 : " + JSONObject.toJSONString(orderItem)); |
| | | |
| | | int saveFlag = sqlSessionTemplate.insert("centerServiceDAOImpl.saveOrderItem", orderItem); |
| | | if (saveFlag < 1) { |
| | | throw new DAOException(ResponseConstant.RESULT_CODE_INNER_ERROR, "保存订单项信息失败:" + JSONObject.toJSONString(orderItem)); |
| | | } |
| | | |
| | | |
| | | |
| | | |
| | | if (!orderItem.containsKey("logText") || StringUtil.isEmpty(orderItem.get("logText") + "")) { |
| | | return; |
| | | } |
| | | |
| | | saveFlag = sqlSessionTemplate.insert("centerServiceDAOImpl.saveUnItemLog", orderItem); |
| | | |
| | | if (saveFlag < 1) { |
| | | throw new DAOException(ResponseConstant.RESULT_CODE_INNER_ERROR, "保存回滚日志失败:" + JSONObject.toJSONString(orderItem)); |
| | | } |
| | | |
| | | |
| | | } |
| | | |
| | | @Override |
| | | public void updateOrderItem(Map orderItem) throws DAOException { |
| | | int saveFlag = sqlSessionTemplate.update("centerServiceDAOImpl.updateOrderItem", orderItem); |
| | | if (saveFlag < 1) { |
| | | throw new DAOException(ResponseConstant.RESULT_CODE_INNER_ERROR, "修改订单项失败:" + JSONObject.toJSONString(orderItem)); |
| | | } |
| | | } |
| | | |
| | | @Override |
| | | public void deleteUnItemLog(Map unItemLog) throws DAOException { |
| | | int saveFlag = sqlSessionTemplate.delete("centerServiceDAOImpl.deleteUnItemLog", unItemLog); |
| | | if (saveFlag < 1) { |
| | | throw new DAOException(ResponseConstant.RESULT_CODE_INNER_ERROR, "删除事务日志失败:" + JSONObject.toJSONString(unItemLog)); |
| | | } |
| | | } |
| | | |
| | | |
| | | /** |
| | | * 保存订单信息 |
| | |
| | | return sqlSessionTemplate.selectList("centerServiceDAOImpl.getMappingInfoAll"); |
| | | } |
| | | |
| | | @Override |
| | | public List<BasePrivilegeDto> getPrivilegeAll() { |
| | | return sqlSessionTemplate.selectList("centerServiceDAOImpl.getPrivilegeAll"); |
| | | } |
| | | |
| | | @Override |
| | | public List<BusinessDatabusDto> getDatabusAll() { |
| | | return sqlSessionTemplate.selectList("centerServiceDAOImpl.getDatabusAll"); |
| | | } |
| | | |
| | | /** |
| | | * 查询业主订单 |
| | | * |
| | |
| | | return sqlSessionTemplate.selectList("centerServiceDAOImpl.queryOrderByBusinessType", info); |
| | | } |
| | | |
| | | /** |
| | | * 查询业主订单 |
| | | * |
| | | * @param info |
| | | * @return |
| | | */ |
| | | @Override |
| | | public List<Map> queryOrderByBId(Map info) { |
| | | return sqlSessionTemplate.selectList("centerServiceDAOImpl.queryOrderByBId", info); |
| | | } |
| | | |
| | | public int updateBusinessStatusCd(Map info) { |
| | | return sqlSessionTemplate.update("centerServiceDAOImpl.updateBusinessStatusCd", info); |
| | | } |